Architectural layer
- Lexical (engine layer)
- Engine + product
- SpineEditor
- Engine
Engine ↔ Engine + product
@lexical/react, decorator nodes, ready-made plugins, Yjs collab). SpineEditor sits at the engine layer only — framework-neutral, focused on the pipeline contract.@lexical/react provides a clean component API and decorator nodes for embedding React components inside the document.@lexical/yjs.editor.update(() => ...) callbacks. SpineEditor compiles every Intent into an explicit Plan, then a Transaction — both plain, serializable data you can inspect, log, or replay.Lexical:
import { $createParagraphNode, $getRoot, $createTextNode } from "lexical";
editor.update(() => {
const root = $getRoot();
const paragraph = $createParagraphNode();
paragraph.append($createTextNode("Hello"));
root.append(paragraph);
});SpineEditor:
import { branchNode, fragment, textNode } from "@spine-editor/core";
engine.dispatch({
kind: "insertFragment",
parentPath: [],
index: engine.state.doc.root.children.length,
fragment: fragment([
branchNode("paragraph", [textNode("Hello")]),
]),
});