Composition / foldkit-mixins-builder
The keyboard and the pointer
Five Behaviors from foldkit-primitives wire keyboard and pointer interactions:
| Where | Behavior | What it handles |
|---|---|---|
tree, row | TreeNavigation | Arrow, Home, and End focus movement; Right/Left expand or collapse rows |
layers, canvas | keyPressed | Alt+Arrow moves; Mod+D duplicates; Delete removes; Mod+Z/Y undo/redo; Escape clears |
canvas | Targets | Hover marking and click-to-select without following links |
canvas | EditableText | Double-click or Enter edits text fields inline; Enter commits; Escape cancels |
layers, canvas | KeepInView | Scrolls newly selected rows and canvas nodes into view |
tree, canvas | PointerDrag | 4px drag (400ms hold on touch) moves nodes before, inside, or after targets |
nodeHandle | GripPlace | Switches handle to data-grip-place="inside" when top space is tight |
nodeHandle | PointerDrag | Grip drags the selected node; tap or click opens nodeMenu popover |
dragPreview | DragPreview | Renders floating drag preview following --fk-drag-x / --fk-drag-y |
palette | PointerDrag | Drags Block tiles onto canvas or layer rows; clicks insert at selection |
Key interaction details:
- Shortcuts scope: keyboard shortcuts attach to
layersandcanvas, keepingDeleteinside inspector inputs for text editing. All action buttons, toolbar items, and shortcut hints readPageBuilder.commandsand format keys forBuilderView.inputs({ platform: 'mac' }). - Grip and touch menu:
GripPlacechecks scrolling ancestors'scroll-padding-topso sticky headers never covernodeGrip. ClickingnodeGripopens thenodeMenupopover (keepnodeMenuhidden when closed and setdisplayonly for open state). - Drag preview and drops:
DragPreviewrenders in the top layer witharia-hiddenand CSS custom properties--fk-drag-xand--fk-drag-yso pointer moves avoid re-rendering. Dropping on a palette tile's target inserts a new Block (catalog patterns insert on press). - Announcements: structural edits announce changes (such as "Moved Heading,
2 of 3 in Section body") inside the
liveregion using the Builder's words.