@eigenpal/docx-editor-core/prosemirror/cellDragSelection

Functions (3)

applyCellSelectionfunctionSource ↗

Dispatch a CellSelection spanning the two cell positions.

declare function applyCellSelection(view: EditorView, anchorCellPos: number, headCellPos: number): boolean;

createCellDragTrackerfunctionSource ↗

declare function createCellDragTracker(): CellDragTracker;

findCellPosFromPmPosfunctionSource ↗

Walk up from a PM position to the enclosing tableCell/tableHeader and return its before(d) position (what CellSelection resolves against), or null when the position isn't inside a table cell.

declare function findCellPosFromPmPos(view: EditorView, pmPos: number): number | null;

Interfaces (1)

CellDragTrackerinterfaceSource ↗

Per-gesture state machine for cell-drag selection. Create one per pointer handler; drive it from mousedown/mousemove/mouseup.

interface CellDragTracker
MemberTypeSummary
beginmousedown: record the cell under the press (or null when outside a table).
endmouseup / gesture end: clear the transient drag flags.
isCellDraggingbooleanTrue while a cell drag is actively producing CellSelections.
updatemousemove: returns true when it applied a `CellSelection` and the caller should NOT also run its text-drag selection for this move.

Variables (1)

CELL_SELECT_OVERFLOW_PXconstSource ↗

Once a text selection has maxed out inside a single cell, the cursor stops moving while the mouse keeps going. Promote to a full-cell selection after the pointer overshoots the last caret position by this many pixels.

CELL_SELECT_OVERFLOW_PX = 5

On this page