mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 17:07:49 +08:00
25 lines
464 B
TypeScript
25 lines
464 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: 'currentColor',
|
|
width: 1,
|
|
class: null,
|
|
},
|
|
|
|
addProseMirrorPlugins() {
|
|
return [
|
|
dropCursor(this.options),
|
|
]
|
|
},
|
|
})
|