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
blockHandle | The 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… |
blockStyleMenu | The 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… |
blockStyles | The 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… |
codeToolbar | The 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… |
commandPalette | The 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… |
editorStatus | The 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… |
findReplace | The 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… |
footnotePreview | The 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… |
formattingToolbar | The toolbar as a slot view, with the APG toolbar's keys: one tab stop (the control roving names, else the first), ArrowLeft and ArrowRight (mirrored under… |
isRichTextIcon | Whether a name, such as a slash entry's id, has a drawing in the set. |
linkEdit | The 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… |
linkEditor | The 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,… |
markToolbar | The 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… |
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… |
richTextIcon | An icon as inline SVG, size CSS pixels square, in the text's color. |
richTextIconUrl | An 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. |
slashEntries | The entries this package offers: the editor's catalogue, each Message passed through wrap — the seam the toolbar takes too, because the caller usually… |
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,… |
slashMenuView | |
slashMove | The 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… |
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… |
sourceEditor | The 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… |
sourcePreview | The 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… |
stepMatch | The 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. |
tableOfContents | The contents as a slot view; nothing is drawn for a document with no headings. |
tableToolbar | The 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
BlockHandleSlots | The elements the handle publishes: its wrapper, the grip it is dragged by, and its two moves. |
BlockStyleMenuSlots | The 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… |
BlockStyleSlots | The elements the picker publishes: its wrapper, its row, and one button per style. |
CodeToolbarSlots | The elements the toolbar publishes: its wrapper, the language picker, and the Copy button. |
CommandPaletteSlots | The elements the palette publishes: its wrapper, the search field, the list, and its options. |
EditorStatusSlots | The elements the status line publishes: its wrapper, the counts, and one item per problem. |
FindReplaceSlots | The elements the bar publishes: its wrapper, its two fields, the count, and its buttons. |
FootnotePreviewSlots | The elements the preview publishes: its card, the label field, the note's text, and the button. |
FormattingToolbarSlots | The elements the toolbar publishes. anchor holds a menu's trigger and its panel. |
InsertEntry | Builds an insert entry: InsertEntry.Editor({ entry }) or InsertEntry.App({ id, label, message }). |
LinkEditorSlots | The elements the editor publishes: its wrapper, the address field, and its two buttons. |
MarkToolbarSlots | The elements the toolbar publishes: its wrapper, its row, and one button per mark. |
SlashMenuSlots | The 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… |
SourceEditorSlots | The elements the editor publishes: its wrapper, the text, the warnings, and the way back. |
SourcePreviewSlots | The preview publishes one element: the rendered draft. |
standardFormattingItems | What a plain bar offers: the marks foldkit-richtext ships, the lists and the quote. |
TableOfContentsSlots | The 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… |
TableToolbarSlots | The elements the toolbar publishes: its wrapper, its row, and one button per change. |
Interfaces
ApplicationControl | A control of the application's own in the bar: it joins the same tab stop and the same arrow keys, in the place items gives it. message is what a press… |
BlockHandleInput | |
BlockStyleInput | |
BlockStyleMenuInput | |
CodeLanguage | A language the picker offers: the language prop's value, and what the picker shows. |
CodeToolbarInput | |
CommandPaletteInput | |
EditorStatusInput | |
FindReplaceInput | |
FootnotePreviewInput | |
FormattingToolbarInput | |
FormattingWords | The words the toolbar draws and names its controls by; a caller overrides any of them. |
LinkEditorInput | |
MarkToolbarInput | |
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. |
SlashMenuInput | |
SourceEditorInput | |
SourcePreviewInput | |
TableOfContentsInput | |
TableToolbarInput |
Types
FormattingItem | One control, in the order drawn. A mark is a mark of the document's vocabulary, by name: the toolbar cannot know which marks an application declared, so it… |
FormattingMenu | The popups a control opens; the caller keeps which one is open, and draws link's own editor. |
RichTextIconName | The names of the drawings in the set. |