OptionalapplyOptionalcommitMaterialize a new node from drag-rect bounds (drag-to-insert tools).
Optional — hooks that don't drive insertion (e.g. useClone,
read-only clipboard) won't call it, and sceneToAdapter only fills
it in when options.commitInsert is supplied. Hooks that do call
it (insert tools) document the requirement at their own surface.
OptionalcommitMaterialize one or more new nodes from a clipboard snapshot. Optional
— required by useClipboard.paste, ignored by other consumers.
Optionalctx: { dropPoint?: { worldX: number; worldY: number } }OptionalgetReturns the current selection. Used by clone behaviors.
Mutator wired by setSelection ops batched alongside paste.
OptionalsnapshotSnapshot the current selection into the clipboard payload shape.
Optional — required by useClipboard.copy / cut and useClone's
ghost capture, ignored by other consumers.
Narrow adapter for
useInsertanduseClipboardOps. The kit knows nothing about what tool is active or what shape to construct; it asks the adapter to produce node(s) given gesture or paste inputs.Drag-rectangle path:
commitInsert(bounds)returns one new node or null. Clipboard paste path:commitPaste(clipboard, offset)returns the array of newly-materialized nodes (in order). Both empty array and array of length N are valid; the kit wraps each entry in anInsertOp.snapshotSelection(ids)builds the payload that paste later consumes.getPasteOffsetis optional; the kit defaults to a fixed grid-cell offset supplied by the consumer (passed touseClipboardOpsoptions if needed; see the hook for resolution order).