Composition / API

foldkit-mixins-builder

foldkit-mixins-builder: the page Builder drawn as accessible HTML, every element a foldkit-mixins Slot.

foldkit-builder owns the editor's state and draws nothing of its own worth shipping. This package draws it: a palette of the Blocks a page may gain, the page's layers as an ARIA tree driven by the keyboard, the selected node's props in an inspector, undo and redo, a viewport picker, and the page itself, drawn by the site's own Renderer in edit mode. It adds no state and no Messages: every element dispatches one of the Builder's own.

Interaction comes from foldkit-primitives, attached as Behaviors: TreeNavigation on the layers, Targets on the canvas (hover and click pick a node), and the Builder's keyPressed shortcuts on the layers and the canvas.

Namespaces

BuilderView
viewportWidthsThe width each viewport draws the page at.

Functions

keysOfA command's key as a person on platform reads it, in its own order: ⌥⇧⌘Z on a Mac, where mod is ⌘, and Ctrl+Alt+Shift+Z elsewhere, the modifiers named by words.
layerIdThe DOM id a layer row carries, so keyboard focus can find it.
rowsOfEvery node as a tree row, in document order, with its parent node and whether it holds any.

Values

BuilderSlotsThe Builder's public customization contract: every element the editor draws.
builderWords
ROW_ATTRIBUTEThe attribute a layer row carries, holding its node's id, for a drag to find.
ROW_DRAGGING_ATTRIBUTEOn the row being dragged.
ROW_DROP_ATTRIBUTEOn the row a drop is aimed at, holding where: before, inside or after.

Interfaces

BuilderLikeWhat BuilderView.define needs of a Builder: what Builder.make returns has all of it.
BuilderOptionOne choice of a relation picker: what is stored, and what is shown.
BuilderPartsThe drawn Builder's pieces, by what they show.
BuilderViewInputsWhat the drawn Builder is given beside its Model, by the page's parent: the application's, never the Builder's to keep.
BuilderWordsEvery word the drawn Builder shows of its own, so an application can put the editor in another language. Words are text; a word that takes a value names it…
SettingsLookHow the inspector's settings forms look: Styles attached to every Block's settings form, as to any form's FormView.field(form) and FormView.define.

Types

BuilderInputWhat the drawn Builder's Slots and Behaviors read: its Model and its inputs.
BuilderPartOne piece of the drawn Builder, placed by BuilderView.assemble.
BuilderSlotViewThe drawn Builder: what BuilderView.define returns.
PlatformThe platform keys are named for: a Mac's, or any other's.