mirror of
https://codeberg.org/Sevichecc/Seigwai.git
synced 2025-04-30 07:49:30 +08:00
28 lines
552 B
JavaScript
28 lines
552 B
JavaScript
// ⚠️ Experiment
|
|
// Ref: https://tiptap.dev/experiments/commands
|
|
import { Extension } from '@tiptap/core'
|
|
import Suggestion from '@tiptap/suggestion'
|
|
|
|
export default Extension.create({
|
|
name: 'commands',
|
|
|
|
addOptions() {
|
|
return {
|
|
suggestion: {
|
|
char: '/',
|
|
command: ({ editor, range, props }) => {
|
|
props.command({ editor, range })
|
|
},
|
|
},
|
|
}
|
|
},
|
|
|
|
addProseMirrorPlugins() {
|
|
return [
|
|
Suggestion({
|
|
editor: this.editor,
|
|
...this.options.suggestion,
|
|
}),
|
|
]
|
|
},
|
|
})
|