Composition / foldkit-builder

Messages

MessageWhat it does
Applied({ op })Applies an Operation from a button, key, drag, or agent
InsertAsked({ block, at })Inserts a new node with starter props once an id is minted
DuplicateAsked({ id, at })Duplicates a node and subtree once new ids are minted
PatternAsked({ pattern, at })Inserts a Catalog pattern once ids are minted for its nodes
CopyAsked, CutAsked, PasteAsked, Copied, ClipboardReadCopies, cuts, and pastes node subtrees via the clipboard
EditingAsked, FieldTyped, EditingCommitted, EditingCancelledManages inline text editing on canvas fields
Minted({ ids, request })Delivers Command-minted ids for a pending insert or paste
Selected({ id }), Deselected(), Hovered({ id }), Unhovered()Updates selection and hover state for the inspector
RowPressed({ id }), RowToggled({ id })Focuses/selects a layers row or toggles its tree expansion
Undid(), Redid()Steps backward or forward in the page undo history
PanelChosen({ panel }), ViewportChosen({ viewport })Switches the active side panel or preview viewport width
DragStarted, DraggedOver, DraggedOverRegion, DraggedOverPageStarts a drag and updates the active drop target
DraggedOff, DragDropped, DragCancelledClears the hover target, commits the drop, or cancels
PreviewChosen({ key, value }), PreviewCleared({ key })Overrides or clears a context key for conditional preview
Inspected({ id, message })Forwards a Message to the selected node's settings form
Layers.wrapper.make(...), Announcer.wrapper.make(...)Forwards Messages for the placed tree and live region
  • Ids are minted in a Command (Composition.newIds), keeping update pure and ensuring every Operation already carries its created ids before changing the page.
  • An applied Operation and its undo step change together: the Builder pushes the new Document onto its page history, a foldkit-primitives/state history. Consecutive edits of one prop of one node share a group, so typing a heading undoes as a whole.
  • A refused edit leaves the page as it was and says why in refused, until the next edit goes through.
  • A new node is selected, and a removed one is cleared from selection.