Skip to main content

Crate taino_edit_dom

Crate taino_edit_dom 

Source
Expand description

taino-edit-dom — the contenteditable/DOM bridge for taino-edit.

Renders a taino_edit_core document into a contenteditable element, observes user edits via MutationObserver, and keeps the browser selection in sync with the core Selection.

This is the only crate in the workspace where unsafe is permitted, and only at the wasm-bindgen/web-sys FFI boundary. Each occurrence must carry an inline // SAFETY: justification.

Status: Phase 4 (DOM bridge). See ROADMAP.md.

Re-exports§

pub use decoration::Decoration;
pub use desc::ViewDesc;
pub use view::EditorView;
pub use view::ViewAction;
pub use view::ViewPlugin;

Modules§

decoration
Decorations — visual overlays applied on top of the rendered DOM without changing the document. The DOM bridge applies/removes them against the matching descriptors.
desc
ViewDesc — the bridge data structure that mirrors the document tree to DOM nodes so a state change can be diffed and patched incrementally.
position_map
Bidirectional mapping between document positions and DOM (node, offset) points, driven by the ViewDesc tree mounted on the editor’s root.
view
EditorView — mount a document into a contenteditable element and own the ViewDesc tree that mirrors it.