Expand description
A rich text editor from editor.css, with Prose for rendered rich text.
The markup is Rust; the behaviour is upstream’s own editor.ts, shipped unchanged as
JavaScript and bound through DomBridge::bind_editor. Editing is selection work,
which upstream keeps out of its Rust models on purpose: where the caret is, what the
IME is composing, and how to wrap a selection without collapsing it are questions
only the browser can answer. Without a script host the editor stays plain editable
text with an inert toolbar.
Re-exports§
pub use Editor_completions::Component::Editor;pub use Prose_completions::Component::Prose;
Structs§
- Editor
Props - Properties for the
Editorcomponent. - Prose
Props - Properties for the
Prosecomponent. - Trusted
Html - HTML the application vouches for, the only kind an
Editorwill render.
Enums§
- Block
Tag - A block a toolbar button toggles on the paragraph holding the selection.
- Editor
State - Whether the document is being saved.
Constants§
- DEFAULT_
MARKS - The marks a default toolbar offers, in upstream’s order.
Functions§
- Editor
- A rich text editor: a formatting toolbar over an editable document. Toolbar buttons
report
aria-pressedacross the whole selection, so a half-bold selection reads as not bold and a click bolds the rest. The document is reported as HTML throughonchange. - Prose
- Rendered rich text: headings, lists, quotes, code, and links in upstream’s prose styles.