add dropcursor options

This commit is contained in:
Philipp Kühn 2020-11-18 21:40:20 +01:00
parent 107a6d7813
commit 8146dd0842

View File

@ -1,10 +1,22 @@
import { Extension } from '@tiptap/core'
import { dropCursor } from 'prosemirror-dropcursor'
type DropcursorOptions = {
color: string | null,
width: number | null,
class: string | null,
}
const Dropcursor = Extension.create({
defaultOptions: <DropcursorOptions>{
color: 'black',
width: 1,
class: null,
},
addProseMirrorPlugins() {
return [
dropCursor(),
dropCursor(this.options),
]
},
})