mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-08 04:18:06 +08:00
31 lines
556 B
TypeScript
31 lines
556 B
TypeScript
import { Extension } from '@tiptap/core'
|
|
import { dropCursor } from 'prosemirror-dropcursor'
|
|
|
|
export interface 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(this.options),
|
|
]
|
|
},
|
|
})
|
|
|
|
export default Dropcursor
|
|
|
|
declare module '@tiptap/core' {
|
|
interface AllExtensions {
|
|
Dropcursor: typeof Dropcursor,
|
|
}
|
|
}
|