tiptap/packages/extension-dropcursor/src/dropcursor.ts
2021-02-10 18:25:08 +01:00

25 lines
457 B
TypeScript

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