Rich text / foldkit-richtext-dom/input

richTextInput

function · packages/richtext-dom/src/input.ts:71

function richTextInput(hostId: string, placement?: EditorPlacement): BundleControl<{ 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< …;

A form control editing a document, placed at hostId with everything editorAt places (EditorPlacement). A blank document (RichText.isBlank) is nothing entered, so a required key refuses it.