Rich text / foldkit-richtext-dom/editor-bundle
Editor
const · packages/richtext-dom/src/editor-bundle.ts:615
| Args | { hostId: string } |
|---|---|
| Model | { document: { readonly version: 1; readonly children: readonly ({ readonly type: "Paragraph"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Heading"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly level: 1 | 2 | 3 | 4 | 6 | 5; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Unknown"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly originalType: string; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Node"; readonly kind: string; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonl …, selection: { readonly type: "Range"; readonly anchor: { readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly offset: number; readonly affinity: "before" | "after"; }; readonly focus: { readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly offset: number; readonly affinity: "before" | "after"; }; } | { readonly type: "Node"; readonly node: string & Brand<"foldkit-richtext/NodeId">; } | null, nextId: number, history: { readonly past: readonly { readonly document: { readonly version: 1; readonly children: readonly ({ readonly type: "Paragraph"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Heading"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly level: 1 | 2 | 3 | 4 | 6 | 5; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Unknown"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly originalType: string; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Node"; readonly kind: string; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: str …, storedMarks: readonly string[] | null, menuIndex: number, hostId: string } |
| Messages | Selected { selection: { readonly type: "Range"; readonly anchor: { readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly offset: number; readonly affinity: "before" | "after"; }; readonly focus: { readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly offset: number; readonly affinity: "before" | "after"; }; } | { readonly type: "Node"; readonly node: string & Brand<"foldkit-richtext/NodeId">; } | null }, Typed { text: string }, Entered, Pasted { slice: { readonly version: 1; readonly blocks: readonly ({ readonly type: "Paragraph"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Heading"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly level: 1 | 2 | 3 | 4 | 6 | 5; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Unknown"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly originalType: string; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Node"; readonly kind: string; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly … }, Backspace, DeletedForward, ToggledMark { mark: string }, AppliedMark { mark: string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; } }, ClearedMark { mark: string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; } }, RetypedBlock { block: { readonly type: "Paragraph"; } | { readonly type: "Heading"; readonly level: 1 | 2 | 3 | 4 | 6 | 5; } }, WrappedBlock { containers: readonly { readonly kind: string; readonly props?: { readonly [x: string]: Schema.Json; }; }[] }, ConvertedBlock { to: { readonly kind: string; readonly props?: { readonly [x: string]: Schema.Json; }; } }, LiftedBlock, MovedBlock { node: string & Brand<"foldkit-richtext/NodeId">, to: { readonly before: string & Brand<"foldkit-richtext/NodeId">; readonly after?: never; } | { readonly after: string & Brand<"foldkit-richtext/NodeId">; readonly before?: never; } }, InsertedBlock { block: { readonly type: "Paragraph"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Heading"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly level: 1 | 2 | 3 | 4 | 6 | 5; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Unknown"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly originalType: string; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Node"; readonly kind: string; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { …, to?: { readonly before: string & Brand<"foldkit-richtext/NodeId">; readonly after?: never; } | { readonly after: string & Brand<"foldkit-richtext/NodeId">; readonly before?: never; } }, DeletedBlock { node: string & Brand<"foldkit-richtext/NodeId"> }, InsertedRow { where: "before" | "after" }, InsertedColumn { where: "before" | "after" }, DeletedRow, DeletedColumn, Indented, ReplacedText { query: string, replacement: string, at?: number, caseSensitive?: boolean }, InsertedFootnote { text?: string }, RenamedFootnote { from: string, to: string }, Outdented, ActivatedAdornment { node: string & Brand<"foldkit-richtext/NodeId">, action: string }, ChangedProps { node: string & Brand<"foldkit-richtext/NodeId">, props: { readonly [x: string]: Schema.Json; } }, Undone, Redone, Patched |
| OutMessages | Edited { state: { readonly document: { readonly version: 1; readonly children: readonly ({ readonly type: "Paragraph"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Heading"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly level: 1 | 2 | 3 | 4 | 6 | 5; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Unknown"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly originalType: string; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Node"; readonly kind: string; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richt …, changeSet: RichText.ChangeSet, transactions: readonly (readonly ({ readonly type: "InsertText"; readonly at: { readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly offset: number; readonly affinity: "before" | "after"; }; readonly text: string; } | { readonly type: "DeleteText"; readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly from: number; readonly to: number; } | { readonly type: "AddMark"; readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly mark: string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; }; } | { readonly type: "RemoveMark"; readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly mark: string; } | { readonly type: "SetSelection"; readonly selection: { readonly type: "Range"; readonly anchor: { readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly offset: number; readonly affinity: "before" | "after"; }; readonly focus: { readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly offset: number; readonly affinity: "before" | "after"; }; } | { readonly type: "Node"; readonly node: string & Brand<"foldkit-richtext/NodeId">; } | null; } | { readonly type: "SplitNode"; readonly block: string & Brand<"foldkit-richtext/NodeId">; readonly node: string & Brand<"foldkit-richtext/NodeId">; readonly offset: number; readonly blockId: string & Brand<"foldkit-richtext/NodeId">; readonly textId: string & Brand<"foldkit-richtext/NodeId">; } | { readonly type: "JoinNode"; readonly into: string & Brand<"foldki … }, Replaced { state: { readonly document: { readonly version: 1; readonly children: readonly ({ readonly type: "Paragraph"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Heading"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly level: 1 | 2 | 3 | 4 | 6 | 5; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Unknown"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly originalType: string; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Node"; readonly kind: string; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richt …, changeSet: RichText.ChangeSet }, Rejected { error: string } |
Its full type
const Editor: Bundle.Bundle<"RichTextEditor", { readonly hostId: string; }, { readonly document: { readonly version: 1; readonly children: readonly ({ readonly type: "Paragraph"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Heading"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly level: 1 | 2 | 3 | 4 | 6 | 5; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Unknown"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly originalType: string; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { readonly type: "Text"; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly text: string; readonly marks: readonly (string | { readonly name: string; readonly props?: { readonly [x: string]: Schema.Json; }; })[]; }[]; } | { readonly type: "Node"; readonly kind: string; readonly id: string & Brand<"foldkit-richtext/NodeId">; readonly props: { readonly [x: string]: Schema.Json; }; readonly children: readonly { rea …;