Import it from @grafloria/renderer.
tsclass DomEventBinder
Methods
getDraggingNodeIds(): string[]— . The nodes currently being DRAGGED (past the movement threshold — an armed-but-uncommitted press is a click, not a drag).hasActiveGesture(): boolean— True while a resize / rotate / vertex gesture owns the pointer.constructor( private readonly container: HTMLElement, private readonly host: DomEventBinderHost, options: DomEventBinderOptions = {} )setReadonly(readonly: boolean): void— Flip thereadonlyoption live (the instance'ssetReadonly). A view-level switch: it refuses gestures and editing keys, but leaves the document writable to code — the model's own lock is untouched.readonlyNow(): boolean— The answer every gesture consults: the option, or the document's lock.startConnectionFromPort(portId: string, clientX: number, clientY: number): boolean— Start a connection drag fromportIdat a client point — what a press on the port itself does, for a control that stands in for the port (the affordances' "+"). The rest of the gesture is the binder's as usual: the preview line, snapping, the reason label,connectorconnect:drop-empty.attach(): void— Bind DOM listeners. No-op on the server and no-op if already attached.detach(): void— Remove EXACTLY the listeners we added, and drop all gesture state.get isAttached(): booleanonWheel(event: WheelEvent): voidonMouseDown(event: MouseEvent): voidonMouseMove(event: MouseEvent): voidonMouseUp(event: MouseEvent): voidonMouseLeave(): void— Pointer left the canvas — abort every in-flight gesture so nothing sticks.onDoubleClick(event: MouseEvent): void— Double-click: node → in-place rename; link label → rename; link body → waypoint.onKeyDown(event: KeyboardEvent): voidonKeyUp(event: KeyboardEvent): voidbeginLabelEdit(target: TextEditTarget, options?: { seed?: string }): boolean— Open the in-place label editor programmatically — the seam behind F2 and a host's context-menu Rename. Unlike the double-click path this is NOT gated onenableInPlaceTextEdit: an explicit call IS the host's opt-in. Returns false when the target does not exist / is not editable / readonly.
Was this page helpful?