prosekit/extensions/drop-indicator
Interfaces
Section titled “Interfaces”DropIndicatorOptions
Section titled “DropIndicatorOptions”Options for defineDropIndicator.
Properties
Section titled “Properties”-
A callback that is called when the drop indicator should be shown.
-
onHide?:
VoidFunction
-
A callback that is called when the drop indicator should be hidden.
-
A callback that is called when the
dragover
event is fired. You can returnfalse
to disable the current drop point and thus hide the drop indicator.
DragEventHandlerOptions
Section titled “DragEventHandlerOptions”Options for DragEventHandler.
Properties
Section titled “Properties”-
The editor's view.
-
pos:
number
-
The drop position in current document.
ShowHandlerOptions
Section titled “ShowHandlerOptions”Options for ShowHandler.
Properties
Section titled “Properties”-
The editor's view.
-
pos:
number
-
The ProseMirror position that the drop indicator should be shown at.
-
line:
Line
-
The line that the drop indicator should be shown at.
Type Aliases
Section titled “Type Aliases”DragEventHandler()
Section titled “DragEventHandler()”-
type DragEventHandler = (
options
:DragEventHandlerOptions
) =>boolean
-
A function that will be called when the
dragover
event is fired. You can returnfalse
to disable the current drop point and thus hide the drop indicator.
ShowHandler()
Section titled “ShowHandler()”-
type ShowHandler = (
options
:ShowHandlerOptions
) =>void
-
A function that will be called when the drop indicator should be shown.
Functions
Section titled “Functions”defineDropIndicator()
Section titled “defineDropIndicator()”-
function defineDropIndicator(
options?
:DropIndicatorOptions
):PlainExtension
-
Defines an extension that controls the behavior of the drop indicator.
This extension itself doesn't draw the drop indicator, but it provides the necessary callbacks to do so. You probably don't want to use this extension directly, but rather use the
<DropIndicator>
component.You can add this extension multiple times. If any extension has
onDrag
callback defined, and it returnsfalse
, then the drop point will be discarded.