import { z } from "zod"; import type { BlockMdxConfig, BlockVisualFrame } from "../types.js"; /** * Pure (React-free) part of the shared `wireframe` block: its data shape, zod * schema, the stable node-id helper, and the nested-MDX round-trip config. Lives * in core so BOTH apps' server/shared registries and the client spec * (`wireframe.tsx`) consume one definition; importing it into a server module * never pulls React into the Nitro/SSR bundle. * * The wireframe block originated in the plan template. The vocabulary * (`PlanWireframe*` names, the `el` set, the `--wf-*` token contract) and the * MDX encoding (`` with kit * component names `FrameScreen`/`Row`/`Col`/…) are preserved EXACTLY so stored * plans round-trip byte-compatibly and existing node ids never change. * * The wireframe is NESTED MDX, not a flat-attribute or prose block: its body is * a `…kit-tree…` subtree. So the config uses * `serializeChildren`/`parseChildren` (the registry's nested-MDX path) rather * than `toAttrs`/`childrenField`. */ export type WireframeSurface = "desktop" | "mobile" | "popover" | "panel" | "browser"; export type WireframeRenderMode = "wireframe" | "design"; /** Tone keyword reused across screen primitives. The renderer maps to color. */ export type WireframeTone = "default" | "accent" | "warn" | "ok" | "muted"; /** * Names of the kit primitives. Component-like (MDX-friendly). The renderer maps * each to a flex kit component. Layout is ALWAYS flex; row/col/sidebar/main set * the flex direction. */ export type WireframeElName = "screen" | "browserBar" | "statusBar" | "toolbar" | "row" | "col" | "sidebar" | "navItem" | "main" | "title" | "text" | "lines" | "section" | "taskRow" | "chips" | "chip" | "pill" | "check" | "field" | "btn" | "fab" | "card" | "column" | "avatar" | "iconSquare" | "kv" | "searchBar" | "box" | "divider"; /** * A single node in the wireframe kit tree. `el` is the primitive name; the * remaining props are the union of every primitive's props (kept permissive so * the model can compose freely). `children` nests other nodes. `id` is a stable * node id used by node-addressable patch ops (auto-assigned on create). * * There is intentionally NO x/y/width/height here — wireframe internals are * geometry-free and laid out by the renderer with flex. */ export type WireframeNode = { /** Stable id for node-addressable patches; auto-assigned when absent. */ id?: string; el: WireframeElName; children?: WireframeNode[]; text?: string; value?: string; label?: string; placeholder?: string; title?: string; tone?: WireframeTone; color?: WireframeTone; weight?: "normal" | "medium" | "bold"; active?: boolean; done?: boolean; emphasis?: boolean; full?: boolean; solid?: boolean; dashed?: boolean; dot?: boolean; script?: boolean; area?: boolean; shape?: "square" | "circle"; count?: number; prio?: number; n?: number; widths?: number[]; icon?: string; note?: string; due?: string; dueTone?: WireframeTone; items?: Array<{ label: string; active?: boolean; count?: number; dot?: boolean; }>; rows?: Array<{ k: string; v: string; }>; }; export interface WireframeData { surface: WireframeSurface; /** `design` renders full-fidelity branded HTML/CSS instead of a sketch. */ renderMode?: WireframeRenderMode; caption?: string; /** Outer surface frame. `auto` lets the host choose the right default. */ frame?: BlockVisualFrame; /** * Neutral, textless loading register. The renderer drops borders, the sketch * outline, and color, rendering soft placeholder geometry only. */ skeleton?: boolean; /** * PRIMARY content: a self-contained HTML mockup of the screen (sanitized * fragment — no document/script/style tags). The renderer owns the surface * aspect, the dark/light theme, the hand-drawn font, and the rough overlay. * When `html` is set, `screen` is ignored. */ html?: string; /** Optional scoped CSS for the html mockup (sanitized fragment). */ css?: string; /** Kit-tree screen. Used when `html` is absent. */ screen?: WireframeNode[]; } export declare const WIREFRAME_SURFACES: WireframeSurface[]; export declare const WIREFRAME_EL_NAMES: WireframeElName[]; export declare const wireframeSchema: z.ZodType; /** * Derive a stable node id from the element name and tree path. Re-runs identically * to the legacy plan derivation so stored plans round-trip without changing ids. */ export declare function createStableWireframeNodeId(el: WireframeElName, path: string): string; /** * Registry MDX config for the wireframe block. `tag` matches the legacy * `WireframeBlock`. The block has no flat attributes (`toAttrs` → `{}`); all data * lives in the nested `` subtree handled by `serializeChildren` / * `parseChildren`. The registry serializer wraps `serializeChildren` between the * `` open/close, producing the exact legacy bytes. On parse, the * registry passes the already-extended `${idContext}-${blockId}` to * `parseChildren` — the same id base the legacy `parseScreen` receives — so node * ids are reproduced identically. */ export declare const wireframeMdx: BlockMdxConfig; //# sourceMappingURL=wireframe.config.d.ts.map