Rich text / API
foldkit-richtext-dom/editor
The editor's Message vocabulary and the mount that produces it (§§31, 118).
The DOM adapter reports what the browser asked for as commands, a caret, and a
history chord. This is what those mean to an editor's update, so one set of
Messages arrives whether a person typed, pasted, or moved the caret. The Bundle
proof in controlled.ts consumed these by hand; events is where the browser
produces them.
Functions
attachEditor | Attaches the translation to a host element and reports each Message through emit. Separate from the mount so a test can drive the DOM without pulling a… |
focusEditor | Focuses the editor at hostId with selection in the browser (Attachment.focus); false when none is attached there. |
heldDocument | The latest document the editor at hostId holds (Attachment.held), or undefined when none is attached there. |
matchingEntries | The entries a query matches, case-insensitively, the best first: a label it starts, a word of a label it starts, a keyword it starts, then any it appears… |
patchEditor | The patch Command's work: find the element the view gave an id to and sync the attachment it holds. A missing host is not an error — the editor went away… |
redecorateEditor | Draws the decorations of the editor at hostId again; false when none is attached there. |
slashMenu | The menu the caret is in, or undefined when its text is not a slash command — the one value that decides both whether to render a menu and what Enter means,… |
slashQuery | The query the caret is in, or undefined when the text before it is not a slash command. A command opens at a block's start or after whitespace — see /head… |
toMessage | What a browser intent means to an editor. The adapter reports only plain insertions, so an insertion carrying marks is refused rather than quietly losing… |
Values
events | The editor's events as a mount: one attachment per element, released with it. The rendering registry is looked up by the host id the placement recorded… |
Message | |
slashEntries | The entries the editor offers, in menu order: the text blocks a caret can become, the standard vocabulary's quote, lists, and code block, then the marks it… |
Interfaces
EditorDrawing | How an attached editor draws: its rendering registry and what it draws over the document. |
SlashEntry | The slash menu's vocabulary (§123, §124 §11): what opens a menu, what it offers, what a query matches, and what a chosen entry sends. An entry carries one… |
SlashMenu | What a menu shows for one caret: its query, what matches, and what Enter would send. |
Types
EditorEvent | What the DOM can ask for: the vocabulary without the patch acknowledgement, which only the Command produces. The adapter's stream is typed by this, so a… |