Rich text / foldkit-richtext-dom/input

richTextInput

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

function richTextInput(
  hostId: string,
  placement?: EditorPlacement,
): ReturnType<typeof control<RichText.Document>>
function richTextInput<A>(
  hostId: string,
  placement: EditorPlacement,
  options: {
    readonly codec: RichTextCodec<A>
  },
): ReturnType<typeof control<A>>

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, and a codec is never asked about one (it may give a blank value instead). With a codec the key holds what it converts to (value) and from (fill); the editor holds a document either way.