Rich text / foldkit-richtext-dom/input
EditorInput
const · packages/richtext-dom/src/input.ts:42
| 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 |
Its full type
const EditorInput: Bundle.Bundle<"RichTextInput", { 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 { read …;The editor with its document in its own Model: no parent, so no OutMessage.
In the guides
- As a form controlRich text / foldkit-richtext-dom