tiptap/packages/extension-dropcursor/src/dropcursor.ts
bdbch b941eea6da
feat: added jsdocs (#4356)
* added JSDocs for almost all extensions

* start adding commands jsdocs

* add jsdocs for rest of extensions

* add jsdocs for Extensions

* add js docs for all extensions

* add more jsdocs

* add js docs for node spec definitions
2024-05-11 14:30:44 +02:00

50 lines
994 B
TypeScript

import { Extension } from '@tiptap/core'
import { dropCursor } from '@tiptap/pm/dropcursor'
export interface DropcursorOptions {
/**
* The color of the drop cursor
* @default 'currentColor'
* @example 'red'
*/
color: string | undefined,
/**
* The width of the drop cursor
* @default 1
* @example 2
*/
width: number | undefined,
/**
* The class of the drop cursor
* @default undefined
* @example 'drop-cursor'
*/
class: string | undefined,
}
/**
* This extension allows you to add a drop cursor to your editor.
* A drop cursor is a line that appears when you drag and drop content
* inbetween nodes.
* @see https://tiptap.dev/api/extensions/dropcursor
*/
export const Dropcursor = Extension.create<DropcursorOptions>({
name: 'dropCursor',
addOptions() {
return {
color: 'currentColor',
width: 1,
class: undefined,
}
},
addProseMirrorPlugins() {
return [
dropCursor(this.options),
]
},
})