import { z } from "zod"; import type { BlockMdxConfig } from "../types.js"; /** * Pure (React-free) part of the shared `question-form` and `visual-questions` * blocks: their data schema and MDX round-trip config. Lives in core so any * app's server/shared registry and the client spec (`question-form.tsx`) * consume one definition. Keeping it React-free means importing it into a server * module never pulls React into the Nitro/SSR bundle. * * `question-form` is the general-purpose respondent-facing form (Open Questions, * single/multi/freeform answers, recommended options, optional inline * wireframe/diagram previews). `visual-questions` is the same data shape and UI, * branded for an explicit visual-intake flow before a plan. Both originated in * the plan template (the data shape mirrors the legacy `visual-questions` block) * before moving here, so their MDX `tag` + attribute encoding MUST match the * historical `` / `` * forms so stored `.mdx` round-trips byte-compatibly. * * The per-option `wireframe`/`diagram` previews stay opaque (`unknown`) at the * core layer: the core block renders them through `ctx.renderBlock` (the same * nested-block seam tabs/columns use) so core never imports an app's wireframe * or diagram renderer. Each app supplies the matching `wireframe`/`diagram` * block spec and shape. */ export type QuestionMode = "single" | "multi" | "freeform"; export interface QuestionFormOption { id: string; label: string; detail?: string; /** Authored recommendation only (not a runtime answer). */ recommended?: boolean; /** * Optional inline visual previews for this option. Kept opaque at the core * layer; rendered via `ctx.renderBlock` as a nested `wireframe`/`diagram` * block so core stays app-agnostic. Apps validate the concrete shape with * their own wireframe/diagram schemas. */ wireframe?: unknown; diagram?: unknown; } export interface QuestionFormQuestion { id: string; title: string; subtitle?: string; mode: QuestionMode; options?: QuestionFormOption[]; allowOther?: boolean; placeholder?: string; required?: boolean; } export interface QuestionFormData { questions: QuestionFormQuestion[]; submitLabel?: string; } /** `visual-questions` shares the exact `question-form` data shape. */ export type VisualQuestionsData = QuestionFormData; export declare const questionFormSchema: z.ZodType; /** `visual-questions` validates with the same schema as `question-form`. */ export declare const visualQuestionsSchema: z.ZodType; /** * MDX config: `questions` and `submitLabel` are both attributes (the questions * array is JSON-encoded by the shared `prop()` encoder). Mirrors the legacy * `` encoding so stored `.mdx` * round-trips byte-compatibly. */ export declare const questionFormMdx: BlockMdxConfig; /** `visual-questions` uses the historical `` tag. */ export declare const visualQuestionsMdx: BlockMdxConfig; //# sourceMappingURL=question-form.config.d.ts.map