@eigenpal/docx-editor-core/prosemirror/utils/PointerEventHandler
Pointer Event Handler
Centralized input handling for all pointer events. Provides single source of truth for click, drag, and focus management.
Classes (1)
PointerEventHandlerclassSource ↗
PointerEventHandler handles all pointer input for the paged editor. It provides: - Single/double/triple click detection - Drag selection with anchor tracking - Coordinate normalization for zoom - Focus management
declare class PointerEventHandler| Member | Type | Summary |
|---|---|---|
| (constructor) | | Constructs a new instance of the `PointerEventHandler` class |
| attach | | Attach event listeners to a container element. |
| cancelDrag | | Cancel any ongoing drag. |
| detach | | Detach event listeners from the container. |
| getDragAnchor | | Get drag anchor position. |
| isDragging | | Get current drag state. |
| MULTI_CLICK_DELAY | | |
| setPositionResolver | | Update the position resolver reference. |
Interfaces (2)
EditorInterfaceinterfaceSource ↗
Interface for the editor that the handler controls.
interface EditorInterface| Member | Type | Summary |
|---|---|---|
| focus | | Focus the editor |
| getSelection | | Get current selection |
| setSelection | | Set selection to a position (collapsed) |
| setSelectionRange | | Set selection range |
PointerEventHandlerOptionsinterfaceSource ↗
Options for PointerEventHandler.
interface PointerEventHandlerOptions| Member | Type | Summary |
|---|---|---|
| editor | EditorInterface | The editor to control |
| onInput? | InputEventCallback | Callback for input events |
| positionResolver | ClickPositionResolver | Position resolver for click mapping |
Type aliases (1)
InputEventCallbacktypeSource ↗
Callback for input events.
type InputEventCallback = (event: {
type: 'click' | 'doubleClick' | 'tripleClick' | 'dragStart' | 'drag' | 'dragEnd';
position?: number;
from?: number;
to?: number;
}) => void;