Rich text / API

foldkit-mixins-richtext

foldkit-mixins-richtext — the editor's chrome, drawn through slots (§35, §120).

The editor's Bundle renders one host element and nothing else (§29); the marks toolbar beside it is the application's chrome. This package draws that chrome as a SlotView, so every element it makes is a slot an application styles or extends the way it does any other view. It cannot wrap marksToolbar: a slot's contributions resolve at the element the view creates (§120). The two share markActive instead.

Functions

blockHandleThe handle as a slot view. The grip drags the block wherever RichText.moveTargets allows (blockDrag), and is keyed by the block, since a Mount reads its…
blockStyleMenuThe same styles as blockStyles, in the space of one button: the trigger names the style the selection's block has ("Text style" where none applies, as in a…
blockStylesThe block style picker as a slot view. The button for the style the selection's block has is pressed; none is in a code block, or at a heading level the…
codeToolbarThe code block toolbar as a slot view. The picker shows the block's language, and a language the list does not name is offered as itself, so choosing…
commandPaletteThe palette as a slot view: a combobox field over a listbox of the matches. ArrowUp and ArrowDown move the highlight, wrapping; Home and End stay the…
editorStatusThe status line as a slot view. Each problem carries its code, and its node when it has one, as data attributes, so a Style can mark a kind and a Behavior…
findReplaceThe bar as a slot view. Enter in the find field goes to the next match and Shift+Enter to the previous one; Escape in either field closes it. Replace…
footnotePreviewThe preview as a slot view, drawn while the caret is in a footnote reference and nothing otherwise. The label field renames the footnote when it changes…
isRichTextIconWhether a name, such as a slash entry's id, has a drawing in the set.
linkEditThe edit applying a draft makes: the selection linked, or the link around the caret changed, to RichText.safeUrl(draft). None when the policy refuses the…
linkEditorThe link editor as a slot view. Applying needs an address the URL policy accepts (RichText.safeUrl), which is what it sends, and something to link: a range,…
markToolbarThe mark toolbar as a slot view. A Style or Behavior attaches to MarkToolbarSlots; each button renders with its mark as the slot item's id, so a Behavior…
matchingEntriesThe 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…
richTextIconAn icon as inline SVG, size CSS pixels square, in the text's color.
richTextIconUrlAn icon as a CSS url(…), for markup that cannot hold an element of its own, such as a rendering's adornment: a stylesheet masks it over the text's color.
slashEntriesThe entries this package offers: the editor's catalogue, each Message passed through wrap — the seam the toolbar takes too, because the caller usually…
slashMenuThe 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,…
slashMenuView
slashMoveThe index an arrow — or Home, or End — moves the highlight to among the current matches, or undefined when the key moves nothing. The rule is…
slashQueryThe 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…
sourceEditorThe source editor as a slot view: a text area holding the draft, then — once the draft is edited — one warning per thing switching back would lose or…
sourcePreviewThe draft as the document it would become, for split mode: drawn beside sourceEditor, it shows what switching back would commit. It is the read-only…
stepMatchThe index a step from current lands on among count matches, wrapping at either end, so Enter keeps cycling through them as a browser's find does.
tableOfContentsThe contents as a slot view; nothing is drawn for a document with no headings.
tableToolbarThe table toolbar as a slot view. Every button is disabled outside a table, so a caller can draw it always or only while RichText.tableAt finds the caret in…

Values

BlockHandleSlotsThe elements the handle publishes: its wrapper, the grip it is dragged by, and its two moves.
BlockStyleMenuSlotsThe elements the style menu publishes: its wrapper, the trigger that names the current style, the menu, and one item per style with its icon, label and the…
BlockStyleSlotsThe elements the picker publishes: its wrapper, its row, and one button per style.
CodeToolbarSlotsThe elements the toolbar publishes: its wrapper, the language picker, and the Copy button.
CommandPaletteSlotsThe elements the palette publishes: its wrapper, the search field, the list, and its options.
EditorStatusSlotsThe elements the status line publishes: its wrapper, the counts, and one item per problem.
FindReplaceSlotsThe elements the bar publishes: its wrapper, its two fields, the count, and its buttons.
FootnotePreviewSlotsThe elements the preview publishes: its card, the label field, the note's text, and the button.
LinkEditorSlotsThe elements the editor publishes: its wrapper, the address field, and its two buttons.
MarkToolbarSlotsThe elements the toolbar publishes: its wrapper, its row, and one button per mark.
SlashMenuSlotsThe elements the menu publishes: its wrapper, its list, a heading over each group, one item per match with its icon, label and description, and what shows…
SourceEditorSlotsThe elements the editor publishes: its wrapper, the text, the warnings, and the way back.
SourcePreviewSlotsThe preview publishes one element: the rendered draft.
TableOfContentsSlotsThe elements the contents publish: the nav, its list, and one entry per heading. An entry carries its depth as --fk-toc-level (1 for the shallowest level…
TableToolbarSlotsThe elements the toolbar publishes: its wrapper, its row, and one button per change.

Interfaces

BlockHandleInput
BlockStyleInput
BlockStyleMenuInput
CodeLanguageA language the picker offers: the language prop's value, and what the picker shows.
CodeToolbarInput
CommandPaletteInput
EditorStatusInput
FindReplaceInput
FootnotePreviewInput
LinkEditorInput
MarkToolbarInput
SlashEntryThe 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…
SlashMenuWhat a menu shows for one caret: its query, what matches, and what Enter would send.
SlashMenuInput
SourceEditorInput
SourcePreviewInput
TableOfContentsInput
TableToolbarInput

Types

RichTextIconNameThe names of the drawings in the set.