/** * Section model for the generic DocumentEditor. * * A "document" here is a typed, multi-part content record — e.g. a marketing * draft = blog markdown + LinkedIn text + SEO fields + sources. Each part is a * {@link DocSection} with a `kind` that decides how it renders + edits. Kept * framework-free so the pure mappers in `./sections` (and any Node/LLM caller) * can import it without dragging React. */ /** How a section renders + edits. */ export type DocSectionKind = 'markdown' | 'text' | 'structured' | 'list'; /** * One editable part of a document. * `value` is typed by `kind`: * - `markdown` / `text` → `string` * - `structured` → `Record` * - `list` → `string[]` */ export interface DocSection { /** Stable id — usually the source attribute name (`blog`, `linkedin`, `seo`, `sources`). */ key: string; /** Human label shown above the section. */ label: string; kind: DocSectionKind; /** The section's current value (shape depends on `kind`). */ value: unknown; placeholder?: string; /** This one section is read-only even when the editor is editable. */ readOnly?: boolean; }