Rich text / API

foldkit-richtext-dom/toolbar

The marks toolbar (§35, §119): a button per mark, dispatching the same Messages a chord does. It is the application's chrome, not the editor's — §29 gives the editor the contenteditable subtree and the application everything around it — so this renders a value the application places beside the editor's host, and it never touches the DOM the editor owns. A Mixins slot family wraps these buttons when an application needs to restyle or replace parts.

Functions

markActiveA mark is active when the caret carries it, or — with no stored format — when every run the selection covers does (§119). Exported because a Mixins slot…
marksToolbarButtons for the editor's marks. The application decides where they go.

Values

blockAnchoranchorToBlock as a Mount, for the element a block handle is drawn in. Key that element by node.
blockDragdragBlock as a Mount, for a block handle's grip; its drop is the editor's MovedBlock.
CONTROLS_ATTRIBUTEMarks an element whose controls act on the editor: a toolbar, a menu of blocks. A press in one does not take the focus from the text, so the selection stays…
SELECTION_DECORATIONThe decoration kind the editor draws its own selection with while a control beside it has the focus: [data-decoration="selection"], for a stylesheet to…
selectionAnchoranchorToSelection as a Mount, for the element a floating toolbar is drawn in.

Interfaces

ToolbarOptions
ToolbarStateThe editor state a toolbar reads: what a Bundle projects, without the rest.