@agent-native/core 0.43.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +71 -10
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.js +1 -1
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +2 -13
- package/dist/cli/recap.js.map +1 -1
- package/dist/cli/skills.d.ts +2 -2
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +13 -13
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +76 -18
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/blocks/index.d.ts +0 -2
- package/dist/client/blocks/index.d.ts.map +1 -1
- package/dist/client/blocks/index.js +0 -2
- package/dist/client/blocks/index.js.map +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.js +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -1
- package/dist/client/blocks/library/ApiEndpointBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/ApiEndpointBlock.js +1 -1
- package/dist/client/blocks/library/ApiEndpointBlock.js.map +1 -1
- package/dist/client/blocks/library/DiffBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/DiffBlock.js +68 -24
- package/dist/client/blocks/library/DiffBlock.js.map +1 -1
- package/dist/client/blocks/library/FileTreeBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/FileTreeBlock.js +4 -0
- package/dist/client/blocks/library/FileTreeBlock.js.map +1 -1
- package/dist/client/blocks/library/annotation-rail.d.ts +0 -19
- package/dist/client/blocks/library/annotation-rail.d.ts.map +1 -1
- package/dist/client/blocks/library/annotation-rail.js +0 -19
- package/dist/client/blocks/library/annotation-rail.js.map +1 -1
- package/dist/client/blocks/library/code-tabs.js +1 -1
- package/dist/client/blocks/library/code-tabs.js.map +1 -1
- package/dist/client/blocks/library/server-specs.d.ts.map +1 -1
- package/dist/client/blocks/library/server-specs.js +0 -10
- package/dist/client/blocks/library/server-specs.js.map +1 -1
- package/dist/client/blocks/library/specs.d.ts.map +1 -1
- package/dist/client/blocks/library/specs.js +0 -2
- package/dist/client/blocks/library/specs.js.map +1 -1
- package/dist/client/blocks/library/wireframe.config.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe.config.js +19 -2
- package/dist/client/blocks/library/wireframe.config.js.map +1 -1
- package/dist/client/blocks/mdx.d.ts.map +1 -1
- package/dist/client/blocks/mdx.js +11 -0
- package/dist/client/blocks/mdx.js.map +1 -1
- package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/DragHandle.js +35 -72
- package/dist/client/rich-markdown-editor/DragHandle.js.map +1 -1
- package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/RegistryBlockNode.js +1 -1
- package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +1 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +9 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.js +3 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -1
- package/dist/client/rich-markdown-editor/extensions.d.ts +13 -1
- package/dist/client/rich-markdown-editor/extensions.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/extensions.js +4 -2
- package/dist/client/rich-markdown-editor/extensions.js.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js +11 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +30 -14
- package/dist/server/poll.js.map +1 -1
- package/dist/styles/blocks.css +10 -2
- package/dist/templates/default/.agents/skills/storing-data/SKILL.md +2 -0
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +141 -0
- package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +2 -0
- package/package.json +1 -1
- package/src/templates/default/.agents/skills/storing-data/SKILL.md +2 -0
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +141 -0
- package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +2 -0
- package/dist/client/blocks/library/decision.config.d.ts +0 -37
- package/dist/client/blocks/library/decision.config.d.ts.map +0 -1
- package/dist/client/blocks/library/decision.config.js +0 -32
- package/dist/client/blocks/library/decision.config.js.map +0 -1
- package/dist/client/blocks/library/decision.d.ts +0 -19
- package/dist/client/blocks/library/decision.d.ts.map +0 -1
- package/dist/client/blocks/library/decision.js +0 -119
- package/dist/client/blocks/library/decision.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-specs.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/server-specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAsB,MAAM,gBAAgB,CAAC;AAEpE,8EAA8E;AAC9E,iFAAiF;AACjF,iFAAiF;AACjF,OAAO,EACL,eAAe,EACf,YAAY,GAEb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAkB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EACL,cAAc,EACd,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,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AC;IACH,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { defineBlock, type BlockSpec } from \"../types.js\";\nimport { registerBlocks, type BlockRegistry } from \"../registry.js\";\n\n// React-free schema + MDX config for the standard library. The matching React\n// `Read`/`Edit` live in the full client entry; the server path only ever touches\n// `spec.schema` / `spec.mdx`, so these configs register with a render-only stub.\nimport {\n checklistSchema,\n checklistMdx,\n type ChecklistData,\n} from \"./checklist.config.js\";\nimport { tableSchema, tableMdx, type TableData } from \"./table.config.js\";\nimport { codeSchema, codeMdx, type CodeData } from \"./code.config.js\";\nimport {\n codeTabsSchema,\n codeTabsMdx,\n type CodeTabsData,\n} from \"./code-tabs.config.js\";\nimport { htmlSchema, htmlMdx, type HtmlBlockData } from \"./html.config.js\";\nimport { tabsSchema, tabsMdx, type TabsData } from \"./tabs.config.js\";\nimport {\n columnsSchema,\n columnsMdx,\n type ColumnsData,\n} from \"./columns.config.js\";\nimport {\n calloutSchema,\n calloutMdx,\n type CalloutData,\n} from \"./callout.config.js\";\nimport {\n decisionSchema,\n decisionMdx,\n type DecisionData,\n} from \"./decision.config.js\";\nimport {\n questionFormSchema,\n questionFormMdx,\n visualQuestionsSchema,\n visualQuestionsMdx,\n type QuestionFormData,\n type VisualQuestionsData,\n} from \"./question-form.config.js\";\nimport {\n diagramSchema,\n diagramMdx,\n type DiagramData,\n} from \"./diagram.config.js\";\nimport {\n wireframeSchema,\n wireframeMdx,\n type WireframeData,\n} from \"./wireframe.config.js\";\nimport {\n mermaidSchema,\n mermaidMdx,\n type MermaidData,\n} from \"./mermaid.config.js\";\nimport {\n apiEndpointSchema,\n apiEndpointMdx,\n type ApiEndpointData,\n} from \"./api-endpoint.config.js\";\nimport {\n openApiSpecSchema,\n openApiSpecMdx,\n type OpenApiSpecData,\n} from \"./openapi-spec.config.js\";\nimport {\n dataModelSchema,\n dataModelMdx,\n type DataModelData,\n} from \"./data-model.config.js\";\nimport { diffSchema, diffMdx, type DiffData } from \"./diff.config.js\";\nimport {\n fileTreeSchema,\n fileTreeMdx,\n type FileTreeData,\n} from \"./file-tree.config.js\";\nimport {\n jsonExplorerSchema,\n jsonExplorerMdx,\n type JsonExplorerData,\n} from \"./json-explorer.config.js\";\nimport {\n annotatedCodeSchema,\n annotatedCodeMdx,\n type AnnotatedCodeData,\n} from \"./annotated-code.config.js\";\n\n/** Render-only stub for server / agent registries (never invoked off-browser). */\nconst ServerReadStub = () => null;\n\n/**\n * Canonical React-free specs for the standard library, used by BOTH apps' server\n * / shared registries (`plan-block-registry.ts`, `nfm-registry.ts`). Each carries\n * only the parts the server path touches — `schema` + `mdx` + metadata for the\n * agent schema export — with a render-only `Read` stub. The full client specs\n * (with real React `Read`/`Edit`) live in `./specs.tsx`; both share the identical\n * `schema`/`mdx` config so inline source can never drift from what renders.\n *\n * `table` keeps the core default `type` here; content's server registry renames\n * it to `table-block` via {@link LibraryBlockConfigOverrides}. The descriptions\n * are the neutral agent-schema phrasing; an app that curates a longer\n * description for a block (e.g. plan's hand-drawn Mermaid, plan's detailed file\n * tree) passes an override rather than re-authoring the spec.\n */\nexport const libraryBlockConfigs: BlockSpec<any>[] = [\n defineBlock<ChecklistData>({\n type: \"checklist\",\n schema: checklistSchema,\n mdx: checklistMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Checklist\",\n description:\n \"A list of toggleable items, each with a label and an optional note.\",\n }),\n defineBlock<TableData>({\n type: \"table\",\n schema: tableSchema,\n mdx: tableMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Table\",\n description:\n \"A simple grid with header columns and string rows for comparisons, parameters, or structured lists.\",\n }),\n defineBlock<CodeData>({\n type: \"code\",\n schema: codeSchema,\n mdx: codeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Code\",\n description:\n \"A single syntax-highlighted code snippet (Notion-style: one border, hover language switcher + copy, collapse-to-N lines). Put several in a `tabs` block for a file rail.\",\n }),\n defineBlock<CodeTabsData>({\n type: \"code-tabs\",\n schema: codeTabsSchema,\n mdx: codeTabsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Code tabs\",\n description:\n \"A vertical file tab rail of syntax-highlighted code snippets, one tab per file with an optional language and caption.\",\n }),\n defineBlock<HtmlBlockData>({\n type: \"custom-html\",\n schema: htmlSchema,\n mdx: htmlMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"HTML / Tailwind\",\n description:\n \"An author-supplied HTML (with optional CSS) fragment rendered in a sandboxed iframe, with inline source editing.\",\n }),\n defineBlock<TabsData>({\n type: \"tabs\",\n schema: tabsSchema,\n mdx: tabsMdx,\n Read: ServerReadStub,\n placement: [\"block\", \"inline\"],\n label: \"Tabs\",\n description:\n \"A top or side tab container; each tab holds its own list of blocks.\",\n }),\n defineBlock<ColumnsData>({\n type: \"columns\",\n schema: columnsSchema,\n mdx: columnsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Columns\",\n description:\n \"A multi-column side-by-side layout container; each column holds its own list of blocks. Ideal for before/after or current/target comparisons.\",\n }),\n defineBlock<CalloutData>({\n type: \"callout\",\n schema: calloutSchema,\n mdx: calloutMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Callout\",\n description:\n \"An emphasized note with a tone (info/decision/risk/warning/success) and a markdown body.\",\n }),\n defineBlock<DecisionData>({\n type: \"decision\",\n schema: decisionSchema,\n mdx: decisionMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Decision\",\n description:\n \"A decision prompt with editable option cards and an authored recommended choice.\",\n }),\n defineBlock<QuestionFormData>({\n type: \"question-form\",\n schema: questionFormSchema,\n mdx: questionFormMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Question form\",\n description:\n \"An interactive respondent-facing form block for open questions, single-choice or multi-choice option rows, freeform answers, recommended options, and optional wireframe/diagram previews.\",\n }),\n defineBlock<VisualQuestionsData>({\n type: \"visual-questions\",\n schema: visualQuestionsSchema,\n mdx: visualQuestionsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Visual questions\",\n description:\n \"A visual-intake question block with the same editable question/option shape as question-form.\",\n }),\n defineBlock<DiagramData>({\n type: \"diagram\",\n schema: diagramSchema,\n mdx: diagramMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diagram\",\n description:\n \"A flexible inline architecture/code diagram. Prefer html/css with SVG or semantic HTML for polished two-dimensional layouts; use .diagram-* primitives and --wf-* tokens for theme/sketch compatibility. Legacy nodes/edges are only for simple previews.\",\n }),\n defineBlock<WireframeData>({\n type: \"wireframe\",\n schema: wireframeSchema,\n mdx: wireframeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Wireframe\",\n description:\n \"A sketch wireframe of one screen built from kit primitives (or an HTML mockup), rendered in a chosen surface frame (desktop/mobile/popover/panel/browser).\",\n }),\n defineBlock<MermaidData>({\n type: \"mermaid\",\n schema: mermaidSchema,\n mdx: mermaidMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diagram (Mermaid)\",\n description:\n \"A Mermaid diagram (flowchart, sequence, etc.) defined as text and rendered as a diagram.\",\n }),\n defineBlock<ApiEndpointData>({\n type: \"api-endpoint\",\n schema: apiEndpointSchema,\n mdx: apiEndpointMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"API endpoint\",\n description:\n \"A Swagger-style API endpoint reference: a colored method pill + path, collapsed by default, expanding to params, request body, and per-status response examples.\",\n }),\n defineBlock<OpenApiSpecData>({\n type: \"openapi-spec\",\n schema: openApiSpecSchema,\n mdx: openApiSpecMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"OpenAPI spec\",\n description:\n \"A whole-document API specification / Redoc / Swagger-UI-style API reference rendered from a complete OpenAPI 3 / Swagger 2 spec (JSON).\",\n }),\n defineBlock<DataModelData>({\n type: \"data-model\",\n schema: dataModelSchema,\n mdx: dataModelMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Data model\",\n description:\n \"A schema modeling / ERD / dbdiagram-style data model: entity cards with typed fields (PK/FK/nullable flags) and interactive foreign-key relations.\",\n }),\n defineBlock<DiffData>({\n type: \"diff\",\n schema: diffSchema,\n mdx: diffMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diff\",\n description:\n \"A GitHub-style before/after line diff for a file, with unified or split view and added/removed line highlighting.\",\n }),\n defineBlock<FileTreeData>({\n type: \"file-tree\",\n schema: fileTreeSchema,\n mdx: fileTreeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"File tree\",\n description:\n \"A VS Code / GitHub-explorer file and change tree with per-file change badges, notes, and code snippets.\",\n }),\n defineBlock<JsonExplorerData>({\n type: \"json-explorer\",\n schema: jsonExplorerSchema,\n mdx: jsonExplorerMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"JSON explorer\",\n description:\n \"A collapsible browser-devtools / Postman-style JSON tree with type-colored values and expand/collapse.\",\n }),\n defineBlock<AnnotatedCodeData>({\n type: \"annotated-code\",\n schema: annotatedCodeSchema,\n mdx: annotatedCodeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Annotated code\",\n description:\n \"A line-numbered code walkthrough whose line ranges carry anchored explanatory notes.\",\n }),\n];\n\n/**\n * Per-block overrides for {@link registerLibraryBlockConfigs}, keyed by canonical\n * `type`. Servers tweak only the agent-facing fields that legitimately differ:\n * content re-types `table` → `table-block`; plan curates a longer Mermaid and\n * file-tree description. The `schema` / `mdx` config always stays shared.\n */\nexport type LibraryBlockConfigOverrides = Record<\n string,\n Partial<\n Pick<BlockSpec<any>, \"type\" | \"label\" | \"description\" | \"notionCompatible\">\n >\n>;\n\n/**\n * Register the React-free standard-library config stubs into a server / shared\n * {@link BlockRegistry}. Both `plan-block-registry.ts` and `nfm-registry.ts` call\n * this, then register only their app-specific block configs (plan adds callout /\n * diagram / wireframe / question-form) on top — so the shared library lives in\n * exactly one place across browser AND server registries.\n */\nexport function registerLibraryBlockConfigs(\n registry: BlockRegistry,\n options: { overrides?: LibraryBlockConfigOverrides } = {},\n): void {\n const overrides = options.overrides ?? {};\n const specs = libraryBlockConfigs.map((spec) => {\n const override = overrides[spec.type];\n return override ? ({ ...spec, ...override } as BlockSpec<any>) : spec;\n });\n registerBlocks(registry, specs);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"server-specs.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/server-specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAsB,MAAM,gBAAgB,CAAC;AAEpE,8EAA8E;AAC9E,iFAAiF;AACjF,iFAAiF;AACjF,OAAO,EACL,eAAe,EACf,YAAY,GAEb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAkB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EACL,cAAc,EACd,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,OAAO,EAAsB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EACL,aAAa,EACb,UAAU,GAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,UAAU,GAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,GAGnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,UAAU,GAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,YAAY,GAEb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,UAAU,GAE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AgB;QACvB,WAAW,EACT,sFAAsF;KACzF,CAAC;CACH,CAAC;AAeF;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAuB,EACvB,UAAuD,EAAE;IAEzD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7C,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,CAAC,CAAE,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAqB,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC,CAAC,CAAC;IACH,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { defineBlock, type BlockSpec } from \"../types.js\";\nimport { registerBlocks, type BlockRegistry } from \"../registry.js\";\n\n// React-free schema + MDX config for the standard library. The matching React\n// `Read`/`Edit` live in the full client entry; the server path only ever touches\n// `spec.schema` / `spec.mdx`, so these configs register with a render-only stub.\nimport {\n checklistSchema,\n checklistMdx,\n type ChecklistData,\n} from \"./checklist.config.js\";\nimport { tableSchema, tableMdx, type TableData } from \"./table.config.js\";\nimport { codeSchema, codeMdx, type CodeData } from \"./code.config.js\";\nimport {\n codeTabsSchema,\n codeTabsMdx,\n type CodeTabsData,\n} from \"./code-tabs.config.js\";\nimport { htmlSchema, htmlMdx, type HtmlBlockData } from \"./html.config.js\";\nimport { tabsSchema, tabsMdx, type TabsData } from \"./tabs.config.js\";\nimport {\n columnsSchema,\n columnsMdx,\n type ColumnsData,\n} from \"./columns.config.js\";\nimport {\n calloutSchema,\n calloutMdx,\n type CalloutData,\n} from \"./callout.config.js\";\nimport {\n questionFormSchema,\n questionFormMdx,\n visualQuestionsSchema,\n visualQuestionsMdx,\n type QuestionFormData,\n type VisualQuestionsData,\n} from \"./question-form.config.js\";\nimport {\n diagramSchema,\n diagramMdx,\n type DiagramData,\n} from \"./diagram.config.js\";\nimport {\n wireframeSchema,\n wireframeMdx,\n type WireframeData,\n} from \"./wireframe.config.js\";\nimport {\n mermaidSchema,\n mermaidMdx,\n type MermaidData,\n} from \"./mermaid.config.js\";\nimport {\n apiEndpointSchema,\n apiEndpointMdx,\n type ApiEndpointData,\n} from \"./api-endpoint.config.js\";\nimport {\n openApiSpecSchema,\n openApiSpecMdx,\n type OpenApiSpecData,\n} from \"./openapi-spec.config.js\";\nimport {\n dataModelSchema,\n dataModelMdx,\n type DataModelData,\n} from \"./data-model.config.js\";\nimport { diffSchema, diffMdx, type DiffData } from \"./diff.config.js\";\nimport {\n fileTreeSchema,\n fileTreeMdx,\n type FileTreeData,\n} from \"./file-tree.config.js\";\nimport {\n jsonExplorerSchema,\n jsonExplorerMdx,\n type JsonExplorerData,\n} from \"./json-explorer.config.js\";\nimport {\n annotatedCodeSchema,\n annotatedCodeMdx,\n type AnnotatedCodeData,\n} from \"./annotated-code.config.js\";\n\n/** Render-only stub for server / agent registries (never invoked off-browser). */\nconst ServerReadStub = () => null;\n\n/**\n * Canonical React-free specs for the standard library, used by BOTH apps' server\n * / shared registries (`plan-block-registry.ts`, `nfm-registry.ts`). Each carries\n * only the parts the server path touches — `schema` + `mdx` + metadata for the\n * agent schema export — with a render-only `Read` stub. The full client specs\n * (with real React `Read`/`Edit`) live in `./specs.tsx`; both share the identical\n * `schema`/`mdx` config so inline source can never drift from what renders.\n *\n * `table` keeps the core default `type` here; content's server registry renames\n * it to `table-block` via {@link LibraryBlockConfigOverrides}. The descriptions\n * are the neutral agent-schema phrasing; an app that curates a longer\n * description for a block (e.g. plan's hand-drawn Mermaid, plan's detailed file\n * tree) passes an override rather than re-authoring the spec.\n */\nexport const libraryBlockConfigs: BlockSpec<any>[] = [\n defineBlock<ChecklistData>({\n type: \"checklist\",\n schema: checklistSchema,\n mdx: checklistMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Checklist\",\n description:\n \"A list of toggleable items, each with a label and an optional note.\",\n }),\n defineBlock<TableData>({\n type: \"table\",\n schema: tableSchema,\n mdx: tableMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Table\",\n description:\n \"A simple grid with header columns and string rows for comparisons, parameters, or structured lists.\",\n }),\n defineBlock<CodeData>({\n type: \"code\",\n schema: codeSchema,\n mdx: codeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Code\",\n description:\n \"A single syntax-highlighted code snippet (Notion-style: one border, hover language switcher + copy, collapse-to-N lines). Put several in a `tabs` block for a file rail.\",\n }),\n defineBlock<CodeTabsData>({\n type: \"code-tabs\",\n schema: codeTabsSchema,\n mdx: codeTabsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Code tabs\",\n description:\n \"A vertical file tab rail of syntax-highlighted code snippets, one tab per file with an optional language and caption.\",\n }),\n defineBlock<HtmlBlockData>({\n type: \"custom-html\",\n schema: htmlSchema,\n mdx: htmlMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"HTML / Tailwind\",\n description:\n \"An author-supplied HTML (with optional CSS) fragment rendered in a sandboxed iframe, with inline source editing.\",\n }),\n defineBlock<TabsData>({\n type: \"tabs\",\n schema: tabsSchema,\n mdx: tabsMdx,\n Read: ServerReadStub,\n placement: [\"block\", \"inline\"],\n label: \"Tabs\",\n description:\n \"A top or side tab container; each tab holds its own list of blocks.\",\n }),\n defineBlock<ColumnsData>({\n type: \"columns\",\n schema: columnsSchema,\n mdx: columnsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Columns\",\n description:\n \"A multi-column side-by-side layout container; each column holds its own list of blocks. Ideal for before/after or current/target comparisons.\",\n }),\n defineBlock<CalloutData>({\n type: \"callout\",\n schema: calloutSchema,\n mdx: calloutMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Callout\",\n description:\n \"An emphasized note with a tone (info/decision/risk/warning/success) and a markdown body.\",\n }),\n defineBlock<QuestionFormData>({\n type: \"question-form\",\n schema: questionFormSchema,\n mdx: questionFormMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Question form\",\n description:\n \"An interactive respondent-facing form block for open questions, single-choice or multi-choice option rows, freeform answers, recommended options, and optional wireframe/diagram previews.\",\n }),\n defineBlock<VisualQuestionsData>({\n type: \"visual-questions\",\n schema: visualQuestionsSchema,\n mdx: visualQuestionsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Visual questions\",\n description:\n \"A visual-intake question block with the same editable question/option shape as question-form.\",\n }),\n defineBlock<DiagramData>({\n type: \"diagram\",\n schema: diagramSchema,\n mdx: diagramMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diagram\",\n description:\n \"A flexible inline architecture/code diagram. Prefer html/css with SVG or semantic HTML for polished two-dimensional layouts; use .diagram-* primitives and --wf-* tokens for theme/sketch compatibility. Legacy nodes/edges are only for simple previews.\",\n }),\n defineBlock<WireframeData>({\n type: \"wireframe\",\n schema: wireframeSchema,\n mdx: wireframeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Wireframe\",\n description:\n \"A sketch wireframe of one screen built from kit primitives (or an HTML mockup), rendered in a chosen surface frame (desktop/mobile/popover/panel/browser).\",\n }),\n defineBlock<MermaidData>({\n type: \"mermaid\",\n schema: mermaidSchema,\n mdx: mermaidMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diagram (Mermaid)\",\n description:\n \"A Mermaid diagram (flowchart, sequence, etc.) defined as text and rendered as a diagram.\",\n }),\n defineBlock<ApiEndpointData>({\n type: \"api-endpoint\",\n schema: apiEndpointSchema,\n mdx: apiEndpointMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"API endpoint\",\n description:\n \"A Swagger-style API endpoint reference: a colored method pill + path, collapsed by default, expanding to params, request body, and per-status response examples.\",\n }),\n defineBlock<OpenApiSpecData>({\n type: \"openapi-spec\",\n schema: openApiSpecSchema,\n mdx: openApiSpecMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"OpenAPI spec\",\n description:\n \"A whole-document API specification / Redoc / Swagger-UI-style API reference rendered from a complete OpenAPI 3 / Swagger 2 spec (JSON).\",\n }),\n defineBlock<DataModelData>({\n type: \"data-model\",\n schema: dataModelSchema,\n mdx: dataModelMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Data model\",\n description:\n \"A schema modeling / ERD / dbdiagram-style data model: entity cards with typed fields (PK/FK/nullable flags) and interactive foreign-key relations.\",\n }),\n defineBlock<DiffData>({\n type: \"diff\",\n schema: diffSchema,\n mdx: diffMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diff\",\n description:\n \"A GitHub-style before/after line diff for a file, with unified or split view and added/removed line highlighting.\",\n }),\n defineBlock<FileTreeData>({\n type: \"file-tree\",\n schema: fileTreeSchema,\n mdx: fileTreeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"File tree\",\n description:\n \"A VS Code / GitHub-explorer file and change tree with per-file change badges, notes, and code snippets.\",\n }),\n defineBlock<JsonExplorerData>({\n type: \"json-explorer\",\n schema: jsonExplorerSchema,\n mdx: jsonExplorerMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"JSON explorer\",\n description:\n \"A collapsible browser-devtools / Postman-style JSON tree with type-colored values and expand/collapse.\",\n }),\n defineBlock<AnnotatedCodeData>({\n type: \"annotated-code\",\n schema: annotatedCodeSchema,\n mdx: annotatedCodeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Annotated code\",\n description:\n \"A line-numbered code walkthrough whose line ranges carry anchored explanatory notes.\",\n }),\n];\n\n/**\n * Per-block overrides for {@link registerLibraryBlockConfigs}, keyed by canonical\n * `type`. Servers tweak only the agent-facing fields that legitimately differ:\n * content re-types `table` → `table-block`; plan curates a longer Mermaid and\n * file-tree description. The `schema` / `mdx` config always stays shared.\n */\nexport type LibraryBlockConfigOverrides = Record<\n string,\n Partial<\n Pick<BlockSpec<any>, \"type\" | \"label\" | \"description\" | \"notionCompatible\">\n >\n>;\n\n/**\n * Register the React-free standard-library config stubs into a server / shared\n * {@link BlockRegistry}. Both `plan-block-registry.ts` and `nfm-registry.ts` call\n * this, then register only their app-specific block configs (plan adds callout /\n * diagram / wireframe / question-form) on top — so the shared library lives in\n * exactly one place across browser AND server registries.\n */\nexport function registerLibraryBlockConfigs(\n registry: BlockRegistry,\n options: { overrides?: LibraryBlockConfigOverrides } = {},\n): void {\n const overrides = options.overrides ?? {};\n const specs = libraryBlockConfigs.map((spec) => {\n const override = overrides[spec.type];\n return override ? ({ ...spec, ...override } as BlockSpec<any>) : spec;\n });\n registerBlocks(registry, specs);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/specs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/specs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAgQpE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,GAAG,CAAC,EAc7C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC,MAAM,EACN,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CAAC,CAAC,CAC1E,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,qBAAqB,CAAA;CAAO,GAClD,IAAI,CAON"}
|
|
@@ -9,7 +9,6 @@ import { htmlBlock } from "./html.js";
|
|
|
9
9
|
import { tabsBlock } from "./tabs.js";
|
|
10
10
|
import { columnsBlock } from "./columns.js";
|
|
11
11
|
import { calloutBlock } from "./callout.js";
|
|
12
|
-
import { decisionBlock } from "./decision.js";
|
|
13
12
|
import { questionFormBlock, visualQuestionsBlock } from "./question-form.js";
|
|
14
13
|
import { diagramBlock } from "./diagram.js";
|
|
15
14
|
import { wireframeBlock } from "./wireframe.js";
|
|
@@ -221,7 +220,6 @@ export const libraryBlockSpecs = [
|
|
|
221
220
|
tabsBlock,
|
|
222
221
|
columnsBlock,
|
|
223
222
|
calloutBlock,
|
|
224
|
-
decisionBlock,
|
|
225
223
|
questionFormBlock,
|
|
226
224
|
visualQuestionsBlock,
|
|
227
225
|
diagramBlock,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/specs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAsB,MAAM,gBAAgB,CAAC;AAEpE,iFAAiF;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,M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EAAE,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { defineBlock, type BlockSpec } from \"../types.js\";\nimport { registerBlocks, type BlockRegistry } from \"../registry.js\";\n\n// Pre-built standard library specs (schema + mdx + React Read/Edit all bundled).\nimport { checklistBlock } from \"./checklist.js\";\nimport { tableBlock } from \"./table.js\";\nimport { codeBlock } from \"./code.js\";\nimport { codeTabsBlock } from \"./code-tabs.js\";\nimport { htmlBlock } from \"./html.js\";\nimport { tabsBlock } from \"./tabs.js\";\nimport { columnsBlock } from \"./columns.js\";\nimport { calloutBlock } from \"./callout.js\";\nimport { decisionBlock } from \"./decision.js\";\nimport { questionFormBlock, visualQuestionsBlock } from \"./question-form.js\";\nimport { diagramBlock } from \"./diagram.js\";\nimport { wireframeBlock } from \"./wireframe.js\";\n\n// Dev-doc blocks: React-free schema + MDX config paired with the shared React\n// Read/Edit renderers. Composed into full specs below with canonical metadata.\nimport {\n mermaidSchema,\n mermaidMdx,\n type MermaidData,\n} from \"./mermaid.config.js\";\nimport { MermaidRead, MermaidEdit } from \"./MermaidBlock.js\";\nimport {\n apiEndpointSchema,\n apiEndpointMdx,\n type ApiEndpointData,\n} from \"./api-endpoint.config.js\";\nimport { ApiEndpointRead, ApiEndpointEdit } from \"./ApiEndpointBlock.js\";\nimport {\n openApiSpecSchema,\n openApiSpecMdx,\n type OpenApiSpecData,\n} from \"./openapi-spec.config.js\";\nimport { OpenApiSpecRead, OpenApiSpecEdit } from \"./OpenApiSpecBlock.js\";\nimport {\n dataModelSchema,\n dataModelMdx,\n type DataModelData,\n} from \"./data-model.config.js\";\nimport { DataModelRead, DataModelEdit } from \"./DataModelBlock.js\";\nimport { diffSchema, diffMdx, type DiffData } from \"./diff.config.js\";\nimport { DiffRead, DiffEdit } from \"./DiffBlock.js\";\nimport {\n fileTreeSchema,\n fileTreeMdx,\n type FileTreeData,\n} from \"./file-tree.config.js\";\nimport { FileTreeRead, FileTreeEdit } from \"./FileTreeBlock.js\";\nimport {\n jsonExplorerSchema,\n jsonExplorerMdx,\n JSON_EXPLORER_DEFAULT_COLLAPSED_DEPTH,\n type JsonExplorerData,\n} from \"./json-explorer.config.js\";\nimport { JsonExplorerRead, JsonExplorerEdit } from \"./JsonExplorerBlock.js\";\nimport {\n annotatedCodeSchema,\n annotatedCodeMdx,\n type AnnotatedCodeData,\n} from \"./annotated-code.config.js\";\nimport { AnnotatedCodeRead, AnnotatedCodeEdit } from \"./AnnotatedCodeBlock.js\";\n\n/**\n * Canonical specs for the standard library's dev-doc blocks (Mermaid, API\n * endpoint, OpenAPI spec, data model, diff, file tree, JSON explorer,\n * annotated code).\n * Each pairs the shared React-free schema/MDX config\n * with the shared React `Read`/`Edit` renderers and the canonical\n * label/description/editSurface/empty metadata. Apps that need a slightly\n * different label/description/empty for a block pass an override to\n * {@link registerLibraryBlocks} rather than re-authoring the whole spec.\n *\n * The six fully pre-built standard specs (checklist, table, code-tabs, html,\n * tabs, columns) already bundle their metadata in their own modules, so they are appended\n * by {@link libraryBlockSpecs} rather than re-declared here.\n */\n// Typed `BlockSpec<any>[]` (not `BlockSpec<unknown>[]`) so the per-block generic\n// data types coexist in one array — mirroring `registerBlocks`' own signature,\n// where `childrenField: keyof TData` would otherwise collapse to `never`.\nconst devDocBlockSpecs: BlockSpec<any>[] = [\n defineBlock<MermaidData>({\n type: \"mermaid\",\n schema: mermaidSchema,\n mdx: mermaidMdx,\n Read: MermaidRead,\n Edit: MermaidEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Diagram (Mermaid)\",\n description:\n \"A Mermaid diagram (flowchart, sequence, etc.) defined as text and rendered as a diagram.\",\n empty: () => ({\n source:\n \"flowchart TD\\n A[Start] --> B{Decision}\\n B -->|Yes| C[Do it]\\n B -->|No| D[Skip]\",\n }),\n }),\n defineBlock<ApiEndpointData>({\n type: \"api-endpoint\",\n schema: apiEndpointSchema,\n mdx: apiEndpointMdx,\n Read: ApiEndpointRead,\n Edit: ApiEndpointEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"API endpoint\",\n description:\n \"A Swagger-style API endpoint reference: a colored method pill + path, collapsed by default, expanding to params, request body, and per-status response examples.\",\n empty: () => ({ method: \"GET\", path: \"/api/resource\" }),\n }),\n defineBlock<OpenApiSpecData>({\n type: \"openapi-spec\",\n schema: openApiSpecSchema,\n mdx: openApiSpecMdx,\n Read: OpenApiSpecRead,\n Edit: OpenApiSpecEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"OpenAPI spec\",\n description:\n \"A whole-document API specification / Redoc / Swagger-UI-style API reference rendered from a complete OpenAPI 3 / Swagger 2 spec (JSON): operations grouped by tag, each a collapsible row expanding to params, request body, and per-status responses, with $ref models resolved.\",\n empty: () => ({\n spec: JSON.stringify(\n {\n openapi: \"3.0.0\",\n info: { title: \"Example API\", version: \"1.0.0\" },\n tags: [{ name: \"widgets\", description: \"Manage widgets\" }],\n paths: {\n \"/widgets\": {\n get: {\n tags: [\"widgets\"],\n summary: \"List widgets\",\n responses: { \"200\": { description: \"OK\" } },\n },\n },\n },\n },\n null,\n 2,\n ),\n }),\n }),\n defineBlock<DataModelData>({\n type: \"data-model\",\n schema: dataModelSchema,\n mdx: dataModelMdx,\n Read: DataModelRead,\n Edit: DataModelEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Data model\",\n description:\n \"A schema modeling / ERD / dbdiagram-style data model: entity cards with typed fields (PK/FK/nullable flags) and interactive foreign-key relations.\",\n empty: () => ({\n entities: [\n {\n id: \"e_user\",\n name: \"User\",\n fields: [\n { name: \"id\", type: \"uuid\", pk: true },\n { name: \"email\", type: \"text\" },\n ],\n },\n ],\n }),\n }),\n defineBlock<DiffData>({\n type: \"diff\",\n schema: diffSchema,\n mdx: diffMdx,\n Read: DiffRead,\n Edit: DiffEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Diff\",\n description:\n \"A GitHub-style before/after line diff for a file, with unified or split (side-by-side) view, added/removed line highlighting, and collapsible unchanged runs.\",\n empty: () => ({\n before: \"function add(a, b) {\\n return a + b;\\n}\",\n after: \"function add(a: number, b: number): number {\\n return a + b;\\n}\",\n language: \"ts\",\n }),\n }),\n defineBlock<FileTreeData>({\n type: \"file-tree\",\n schema: fileTreeSchema,\n mdx: fileTreeMdx,\n Read: FileTreeRead,\n Edit: FileTreeEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"File tree\",\n description:\n \"A VS Code / GitHub-explorer file and change tree derived from slash-delimited paths, with per-file change badges (added/modified/removed/renamed), notes, and code snippets.\",\n empty: () => ({\n entries: [\n {\n path: \"src/index.ts\",\n change: \"modified\",\n note: \"Wire the new route here.\",\n },\n { path: \"src/routes/git.ts\", change: \"added\" },\n ],\n }),\n }),\n defineBlock<JsonExplorerData>({\n type: \"json-explorer\",\n schema: jsonExplorerSchema,\n mdx: jsonExplorerMdx,\n Read: JsonExplorerRead,\n Edit: JsonExplorerEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"JSON explorer\",\n description:\n \"A collapsible browser-devtools / Postman-style JSON tree with type-colored values and expand/collapse.\",\n empty: () => ({\n json: JSON.stringify(\n {\n id: \"abc123\",\n active: true,\n tags: [\"alpha\", \"beta\"],\n meta: { count: 2, owner: null },\n },\n null,\n 2,\n ),\n collapsedDepth: JSON_EXPLORER_DEFAULT_COLLAPSED_DEPTH,\n }),\n }),\n defineBlock<AnnotatedCodeData>({\n type: \"annotated-code\",\n schema: annotatedCodeSchema,\n mdx: annotatedCodeMdx,\n Read: AnnotatedCodeRead,\n Edit: AnnotatedCodeEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Annotated code\",\n description:\n \"A line-numbered code walkthrough whose line ranges carry anchored explanatory notes (Stripe-docs / Sourcegraph explain-this-code style).\",\n empty: () => ({\n filename: \"src/server/auth.ts\",\n language: \"ts\",\n code: \"export function resolveAuth(provider: string) {\\n const cfg = providers[provider];\\n return cfg.token;\\n}\",\n annotations: [\n {\n lines: \"2\",\n label: \"Lookup\",\n note: \"Resolves the provider config by key.\",\n },\n ],\n }),\n }),\n];\n\n/**\n * The full standard library spec set, in registration order: the fully pre-built\n * specs (checklist, table, code-tabs, html, tabs, columns) followed by the eight\n * dev-doc specs. This is the single list both the plan and content browser\n * registries register — adding a library block here lands in both apps.\n */\nexport const libraryBlockSpecs: BlockSpec<any>[] = [\n checklistBlock,\n tableBlock,\n codeBlock,\n codeTabsBlock,\n htmlBlock,\n tabsBlock,\n columnsBlock,\n calloutBlock,\n decisionBlock,\n questionFormBlock,\n visualQuestionsBlock,\n diagramBlock,\n wireframeBlock,\n ...devDocBlockSpecs,\n];\n\n/**\n * Per-block metadata overrides for {@link registerLibraryBlocks}, keyed by the\n * canonical block `type`. Lets an app tweak the few fields that legitimately\n * differ (a `type` rename, a tweaked `description` or `empty` seed) without\n * re-authoring the spec. Anything omitted keeps the canonical value, so the\n * schema / MDX config and the React `Read`/`Edit` renderers always stay shared.\n */\nexport type LibraryBlockOverrides = Record<\n string,\n Partial<Pick<BlockSpec<any>, \"type\" | \"label\" | \"description\" | \"empty\">>\n>;\n\n/**\n * Register the standard library block specs into a {@link BlockRegistry}. Both\n * the plan and content browser registries call this, then register only their\n * own app-specific blocks on top — so the shared library lives in exactly one\n * place. Pass `overrides` (keyed by canonical `type`) for the small per-app\n * differences (content re-types `table` → `table-block`; each app phrases the\n * Mermaid description and seeds the OpenAPI example a little differently).\n */\nexport function registerLibraryBlocks(\n registry: BlockRegistry,\n options: { overrides?: LibraryBlockOverrides } = {},\n): void {\n const overrides = options.overrides ?? {};\n const specs = libraryBlockSpecs.map((spec) => {\n const override = overrides[spec.type];\n return override ? ({ ...spec, ...override } as BlockSpec<any>) : spec;\n });\n registerBlocks(registry, specs);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"specs.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/specs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAA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D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3C,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,CAAC,CAAE,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAqB,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC,CAAC,CAAC;IACH,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { defineBlock, type BlockSpec } from \"../types.js\";\nimport { registerBlocks, type BlockRegistry } from \"../registry.js\";\n\n// Pre-built standard library specs (schema + mdx + React Read/Edit all bundled).\nimport { checklistBlock } from \"./checklist.js\";\nimport { tableBlock } from \"./table.js\";\nimport { codeBlock } from \"./code.js\";\nimport { codeTabsBlock } from \"./code-tabs.js\";\nimport { htmlBlock } from \"./html.js\";\nimport { tabsBlock } from \"./tabs.js\";\nimport { columnsBlock } from \"./columns.js\";\nimport { calloutBlock } from \"./callout.js\";\nimport { questionFormBlock, visualQuestionsBlock } from \"./question-form.js\";\nimport { diagramBlock } from \"./diagram.js\";\nimport { wireframeBlock } from \"./wireframe.js\";\n\n// Dev-doc blocks: React-free schema + MDX config paired with the shared React\n// Read/Edit renderers. Composed into full specs below with canonical metadata.\nimport {\n mermaidSchema,\n mermaidMdx,\n type MermaidData,\n} from \"./mermaid.config.js\";\nimport { MermaidRead, MermaidEdit } from \"./MermaidBlock.js\";\nimport {\n apiEndpointSchema,\n apiEndpointMdx,\n type ApiEndpointData,\n} from \"./api-endpoint.config.js\";\nimport { ApiEndpointRead, ApiEndpointEdit } from \"./ApiEndpointBlock.js\";\nimport {\n openApiSpecSchema,\n openApiSpecMdx,\n type OpenApiSpecData,\n} from \"./openapi-spec.config.js\";\nimport { OpenApiSpecRead, OpenApiSpecEdit } from \"./OpenApiSpecBlock.js\";\nimport {\n dataModelSchema,\n dataModelMdx,\n type DataModelData,\n} from \"./data-model.config.js\";\nimport { DataModelRead, DataModelEdit } from \"./DataModelBlock.js\";\nimport { diffSchema, diffMdx, type DiffData } from \"./diff.config.js\";\nimport { DiffRead, DiffEdit } from \"./DiffBlock.js\";\nimport {\n fileTreeSchema,\n fileTreeMdx,\n type FileTreeData,\n} from \"./file-tree.config.js\";\nimport { FileTreeRead, FileTreeEdit } from \"./FileTreeBlock.js\";\nimport {\n jsonExplorerSchema,\n jsonExplorerMdx,\n JSON_EXPLORER_DEFAULT_COLLAPSED_DEPTH,\n type JsonExplorerData,\n} from \"./json-explorer.config.js\";\nimport { JsonExplorerRead, JsonExplorerEdit } from \"./JsonExplorerBlock.js\";\nimport {\n annotatedCodeSchema,\n annotatedCodeMdx,\n type AnnotatedCodeData,\n} from \"./annotated-code.config.js\";\nimport { AnnotatedCodeRead, AnnotatedCodeEdit } from \"./AnnotatedCodeBlock.js\";\n\n/**\n * Canonical specs for the standard library's dev-doc blocks (Mermaid, API\n * endpoint, OpenAPI spec, data model, diff, file tree, JSON explorer,\n * annotated code).\n * Each pairs the shared React-free schema/MDX config\n * with the shared React `Read`/`Edit` renderers and the canonical\n * label/description/editSurface/empty metadata. Apps that need a slightly\n * different label/description/empty for a block pass an override to\n * {@link registerLibraryBlocks} rather than re-authoring the whole spec.\n *\n * The six fully pre-built standard specs (checklist, table, code-tabs, html,\n * tabs, columns) already bundle their metadata in their own modules, so they are appended\n * by {@link libraryBlockSpecs} rather than re-declared here.\n */\n// Typed `BlockSpec<any>[]` (not `BlockSpec<unknown>[]`) so the per-block generic\n// data types coexist in one array — mirroring `registerBlocks`' own signature,\n// where `childrenField: keyof TData` would otherwise collapse to `never`.\nconst devDocBlockSpecs: BlockSpec<any>[] = [\n defineBlock<MermaidData>({\n type: \"mermaid\",\n schema: mermaidSchema,\n mdx: mermaidMdx,\n Read: MermaidRead,\n Edit: MermaidEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Diagram (Mermaid)\",\n description:\n \"A Mermaid diagram (flowchart, sequence, etc.) defined as text and rendered as a diagram.\",\n empty: () => ({\n source:\n \"flowchart TD\\n A[Start] --> B{Decision}\\n B -->|Yes| C[Do it]\\n B -->|No| D[Skip]\",\n }),\n }),\n defineBlock<ApiEndpointData>({\n type: \"api-endpoint\",\n schema: apiEndpointSchema,\n mdx: apiEndpointMdx,\n Read: ApiEndpointRead,\n Edit: ApiEndpointEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"API endpoint\",\n description:\n \"A Swagger-style API endpoint reference: a colored method pill + path, collapsed by default, expanding to params, request body, and per-status response examples.\",\n empty: () => ({ method: \"GET\", path: \"/api/resource\" }),\n }),\n defineBlock<OpenApiSpecData>({\n type: \"openapi-spec\",\n schema: openApiSpecSchema,\n mdx: openApiSpecMdx,\n Read: OpenApiSpecRead,\n Edit: OpenApiSpecEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"OpenAPI spec\",\n description:\n \"A whole-document API specification / Redoc / Swagger-UI-style API reference rendered from a complete OpenAPI 3 / Swagger 2 spec (JSON): operations grouped by tag, each a collapsible row expanding to params, request body, and per-status responses, with $ref models resolved.\",\n empty: () => ({\n spec: JSON.stringify(\n {\n openapi: \"3.0.0\",\n info: { title: \"Example API\", version: \"1.0.0\" },\n tags: [{ name: \"widgets\", description: \"Manage widgets\" }],\n paths: {\n \"/widgets\": {\n get: {\n tags: [\"widgets\"],\n summary: \"List widgets\",\n responses: { \"200\": { description: \"OK\" } },\n },\n },\n },\n },\n null,\n 2,\n ),\n }),\n }),\n defineBlock<DataModelData>({\n type: \"data-model\",\n schema: dataModelSchema,\n mdx: dataModelMdx,\n Read: DataModelRead,\n Edit: DataModelEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Data model\",\n description:\n \"A schema modeling / ERD / dbdiagram-style data model: entity cards with typed fields (PK/FK/nullable flags) and interactive foreign-key relations.\",\n empty: () => ({\n entities: [\n {\n id: \"e_user\",\n name: \"User\",\n fields: [\n { name: \"id\", type: \"uuid\", pk: true },\n { name: \"email\", type: \"text\" },\n ],\n },\n ],\n }),\n }),\n defineBlock<DiffData>({\n type: \"diff\",\n schema: diffSchema,\n mdx: diffMdx,\n Read: DiffRead,\n Edit: DiffEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Diff\",\n description:\n \"A GitHub-style before/after line diff for a file, with unified or split (side-by-side) view, added/removed line highlighting, and collapsible unchanged runs.\",\n empty: () => ({\n before: \"function add(a, b) {\\n return a + b;\\n}\",\n after: \"function add(a: number, b: number): number {\\n return a + b;\\n}\",\n language: \"ts\",\n }),\n }),\n defineBlock<FileTreeData>({\n type: \"file-tree\",\n schema: fileTreeSchema,\n mdx: fileTreeMdx,\n Read: FileTreeRead,\n Edit: FileTreeEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"File tree\",\n description:\n \"A VS Code / GitHub-explorer file and change tree derived from slash-delimited paths, with per-file change badges (added/modified/removed/renamed), notes, and code snippets.\",\n empty: () => ({\n entries: [\n {\n path: \"src/index.ts\",\n change: \"modified\",\n note: \"Wire the new route here.\",\n },\n { path: \"src/routes/git.ts\", change: \"added\" },\n ],\n }),\n }),\n defineBlock<JsonExplorerData>({\n type: \"json-explorer\",\n schema: jsonExplorerSchema,\n mdx: jsonExplorerMdx,\n Read: JsonExplorerRead,\n Edit: JsonExplorerEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"JSON explorer\",\n description:\n \"A collapsible browser-devtools / Postman-style JSON tree with type-colored values and expand/collapse.\",\n empty: () => ({\n json: JSON.stringify(\n {\n id: \"abc123\",\n active: true,\n tags: [\"alpha\", \"beta\"],\n meta: { count: 2, owner: null },\n },\n null,\n 2,\n ),\n collapsedDepth: JSON_EXPLORER_DEFAULT_COLLAPSED_DEPTH,\n }),\n }),\n defineBlock<AnnotatedCodeData>({\n type: \"annotated-code\",\n schema: annotatedCodeSchema,\n mdx: annotatedCodeMdx,\n Read: AnnotatedCodeRead,\n Edit: AnnotatedCodeEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Annotated code\",\n description:\n \"A line-numbered code walkthrough whose line ranges carry anchored explanatory notes (Stripe-docs / Sourcegraph explain-this-code style).\",\n empty: () => ({\n filename: \"src/server/auth.ts\",\n language: \"ts\",\n code: \"export function resolveAuth(provider: string) {\\n const cfg = providers[provider];\\n return cfg.token;\\n}\",\n annotations: [\n {\n lines: \"2\",\n label: \"Lookup\",\n note: \"Resolves the provider config by key.\",\n },\n ],\n }),\n }),\n];\n\n/**\n * The full standard library spec set, in registration order: the fully pre-built\n * specs (checklist, table, code-tabs, html, tabs, columns) followed by the eight\n * dev-doc specs. This is the single list both the plan and content browser\n * registries register — adding a library block here lands in both apps.\n */\nexport const libraryBlockSpecs: BlockSpec<any>[] = [\n checklistBlock,\n tableBlock,\n codeBlock,\n codeTabsBlock,\n htmlBlock,\n tabsBlock,\n columnsBlock,\n calloutBlock,\n questionFormBlock,\n visualQuestionsBlock,\n diagramBlock,\n wireframeBlock,\n ...devDocBlockSpecs,\n];\n\n/**\n * Per-block metadata overrides for {@link registerLibraryBlocks}, keyed by the\n * canonical block `type`. Lets an app tweak the few fields that legitimately\n * differ (a `type` rename, a tweaked `description` or `empty` seed) without\n * re-authoring the spec. Anything omitted keeps the canonical value, so the\n * schema / MDX config and the React `Read`/`Edit` renderers always stay shared.\n */\nexport type LibraryBlockOverrides = Record<\n string,\n Partial<Pick<BlockSpec<any>, \"type\" | \"label\" | \"description\" | \"empty\">>\n>;\n\n/**\n * Register the standard library block specs into a {@link BlockRegistry}. Both\n * the plan and content browser registries call this, then register only their\n * own app-specific blocks on top — so the shared library lives in exactly one\n * place. Pass `overrides` (keyed by canonical `type`) for the small per-app\n * differences (content re-types `table` → `table-block`; each app phrases the\n * Mermaid description and seeds the OpenAPI example a little differently).\n */\nexport function registerLibraryBlocks(\n registry: BlockRegistry,\n options: { overrides?: LibraryBlockOverrides } = {},\n): void {\n const overrides = options.overrides ?? {};\n const specs = libraryBlockSpecs.map((spec) => {\n const override = overrides[spec.type];\n return override ? ({ ...spec, ...override } as BlockSpec<any>) : spec;\n });\n registerBlocks(registry, specs);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wireframe.config.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/wireframe.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AAMH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzD,gFAAgF;AAChF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC;AAE3E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,SAAS,GACT,KAAK,GACL,KAAK,GACL,SAAS,GACT,SAAS,GACT,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,GACP,KAAK,GACL,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,IAAI,GACJ,WAAW,GACX,KAAK,GACL,SAAS,CAAC;AAEd;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,yEAAyE;IACzE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,eAAe,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAG3B,IAAI,CA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MAAM,CAAA;KAAE,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EAMhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAAe,EA8B/C,CAAC;AAkFF,eAAO,MAAM,eAAe,EAuBG,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AAMxD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,eAAe,EACnB,IAAI,EAAE,MAAM,GACX,MAAM,CAMR;
|
|
1
|
+
{"version":3,"file":"wireframe.config.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/wireframe.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AAMH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzD,gFAAgF;AAChF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC;AAE3E;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR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Y,EAAE,cAAc,CAAC,aAAa,CAWtD,CAAC"}
|
|
@@ -223,6 +223,23 @@ function stringAttr(node, name) {
|
|
|
223
223
|
const value = attributeValue(findAttribute(node, name));
|
|
224
224
|
return typeof value === "string" ? value : undefined;
|
|
225
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Resolve a required-when-present string attribute on a `<Screen>`. If the
|
|
228
|
+
* attribute is absent we return undefined, but if it is present yet cannot be
|
|
229
|
+
* resolved to a string (e.g. a number, an object, or an unevaluable expression)
|
|
230
|
+
* we THROW so a malformed wireframe fails the import instead of silently
|
|
231
|
+
* dropping the value and rendering an empty wireframe.
|
|
232
|
+
*/
|
|
233
|
+
function requiredStringAttr(node, name) {
|
|
234
|
+
const attr = findAttribute(node, name);
|
|
235
|
+
if (!attr)
|
|
236
|
+
return undefined;
|
|
237
|
+
const value = attributeValue(attr);
|
|
238
|
+
if (typeof value !== "string") {
|
|
239
|
+
throw new Error(`Wireframe <Screen> attribute "${name}" must resolve to a string, got ${typeof value}. Use a quoted string or a static template literal.`);
|
|
240
|
+
}
|
|
241
|
+
return value;
|
|
242
|
+
}
|
|
226
243
|
function boolAttr(node, name) {
|
|
227
244
|
const value = attributeValue(findAttribute(node, name));
|
|
228
245
|
return typeof value === "boolean" ? value : undefined;
|
|
@@ -257,8 +274,8 @@ function parseScreen(node, idContext) {
|
|
|
257
274
|
surface: stringAttr(node, "surface") ?? "desktop",
|
|
258
275
|
renderMode: stringAttr(node, "renderMode"),
|
|
259
276
|
caption: stringAttr(node, "caption"),
|
|
260
|
-
html:
|
|
261
|
-
css:
|
|
277
|
+
html: requiredStringAttr(node, "html"),
|
|
278
|
+
css: requiredStringAttr(node, "css"),
|
|
262
279
|
skeleton: boolAttr(node, "skeleton"),
|
|
263
280
|
screen: (node.children ?? [])
|
|
264
281
|
.map((child, index) => parseWireframeNode(child, `${idContext}-screen-${index}`))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wireframe.config.js","sourceRoot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AAS,WAAW,KAAK,EAAE,CAAC,CAC1D;aACA,MAAM,CAAC,OAAO,CAAoB;KACtC,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAEhF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkC;IACzD,GAAG,EAAE,gBAAgB;IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACnB,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACrD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;IAClD,aAAa,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,UAAgC,CAAC;QAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QACvD,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxC,CAAC;CACF,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { prop, attributeValue } from \"../mdx.js\";\nimport type { BlockMdxConfig } from \"../types.js\";\n\n/**\n * Pure (React-free) part of the shared `wireframe` block: its data shape, zod\n * schema, the stable node-id helper, and the nested-MDX round-trip config. Lives\n * in core so BOTH apps' server/shared registries and the client spec\n * (`wireframe.tsx`) consume one definition; importing it into a server module\n * never pulls React into the Nitro/SSR bundle.\n *\n * The wireframe block originated in the plan template. The vocabulary\n * (`PlanWireframe*` names, the `el` set, the `--wf-*` token contract) and the\n * MDX encoding (`<WireframeBlock>…<Screen>…</Screen></WireframeBlock>` with kit\n * component names `FrameScreen`/`Row`/`Col`/…) are preserved EXACTLY so stored\n * plans round-trip byte-compatibly and existing node ids never change.\n *\n * The wireframe is NESTED MDX, not a flat-attribute or prose block: its body is\n * a `<Screen surface caption>…kit-tree…</Screen>` subtree. So the config uses\n * `serializeChildren`/`parseChildren` (the registry's nested-MDX path) rather\n * than `toAttrs`/`childrenField`.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Vocabulary (decoupled copy of the plan-content wireframe types) */\n/* -------------------------------------------------------------------------- */\n\nexport type WireframeSurface =\n | \"desktop\"\n | \"mobile\"\n | \"popover\"\n | \"panel\"\n | \"browser\";\n\nexport type WireframeRenderMode = \"wireframe\" | \"design\";\n\n/** Tone keyword reused across screen primitives. The renderer maps to color. */\nexport type WireframeTone = \"default\" | \"accent\" | \"warn\" | \"ok\" | \"muted\";\n\n/**\n * Names of the kit primitives. Component-like (MDX-friendly). The renderer maps\n * each to a flex kit component. Layout is ALWAYS flex; row/col/sidebar/main set\n * the flex direction.\n */\nexport type WireframeElName =\n | \"screen\"\n | \"browserBar\"\n | \"statusBar\"\n | \"toolbar\"\n | \"row\"\n | \"col\"\n | \"sidebar\"\n | \"navItem\"\n | \"main\"\n | \"title\"\n | \"text\"\n | \"lines\"\n | \"section\"\n | \"taskRow\"\n | \"chips\"\n | \"chip\"\n | \"pill\"\n | \"check\"\n | \"field\"\n | \"btn\"\n | \"fab\"\n | \"card\"\n | \"column\"\n | \"avatar\"\n | \"iconSquare\"\n | \"kv\"\n | \"searchBar\"\n | \"box\"\n | \"divider\";\n\n/**\n * A single node in the wireframe kit tree. `el` is the primitive name; the\n * remaining props are the union of every primitive's props (kept permissive so\n * the model can compose freely). `children` nests other nodes. `id` is a stable\n * node id used by node-addressable patch ops (auto-assigned on create).\n *\n * There is intentionally NO x/y/width/height here — wireframe internals are\n * geometry-free and laid out by the renderer with flex.\n */\nexport type WireframeNode = {\n /** Stable id for node-addressable patches; auto-assigned when absent. */\n id?: string;\n el: WireframeElName;\n children?: WireframeNode[];\n\n // Generic content props\n text?: string;\n value?: string;\n label?: string;\n placeholder?: string;\n title?: string;\n\n // Styling-by-intent (semantic only; renderer owns actual color/size)\n tone?: WireframeTone;\n color?: WireframeTone;\n weight?: \"normal\" | \"medium\" | \"bold\";\n active?: boolean;\n done?: boolean;\n emphasis?: boolean;\n full?: boolean;\n solid?: boolean;\n dashed?: boolean;\n dot?: boolean;\n script?: boolean;\n area?: boolean;\n shape?: \"square\" | \"circle\";\n\n // Numeric / structured props\n count?: number;\n prio?: number;\n n?: number;\n widths?: number[];\n icon?: string;\n\n // taskRow specifics\n note?: string;\n due?: string;\n dueTone?: WireframeTone;\n\n // Collection props (chips, kv)\n items?: Array<{\n label: string;\n active?: boolean;\n count?: number;\n dot?: boolean;\n }>;\n rows?: Array<{ k: string; v: string }>;\n};\n\nexport interface WireframeData {\n surface: WireframeSurface;\n /** `design` renders full-fidelity branded HTML/CSS instead of a sketch. */\n renderMode?: WireframeRenderMode;\n caption?: string;\n /**\n * Neutral, textless loading register. The renderer drops borders, the sketch\n * outline, and color, rendering soft placeholder geometry only.\n */\n skeleton?: boolean;\n /**\n * PRIMARY content: a self-contained HTML mockup of the screen (sanitized\n * fragment — no document/script/style tags). The renderer owns the surface\n * aspect, the dark/light theme, the hand-drawn font, and the rough overlay.\n * When `html` is set, `screen` is ignored.\n */\n html?: string;\n /** Optional scoped CSS for the html mockup (sanitized fragment). */\n css?: string;\n /** Kit-tree screen. Used when `html` is absent. */\n screen?: WireframeNode[];\n}\n\nexport const WIREFRAME_SURFACES: WireframeSurface[] = [\n \"desktop\",\n \"mobile\",\n \"popover\",\n \"panel\",\n \"browser\",\n];\n\nexport const WIREFRAME_EL_NAMES: WireframeElName[] = [\n \"screen\",\n \"browserBar\",\n \"statusBar\",\n \"toolbar\",\n \"row\",\n \"col\",\n \"sidebar\",\n \"navItem\",\n \"main\",\n \"title\",\n \"text\",\n \"lines\",\n \"section\",\n \"taskRow\",\n \"chips\",\n \"chip\",\n \"pill\",\n \"check\",\n \"field\",\n \"btn\",\n \"fab\",\n \"card\",\n \"column\",\n \"avatar\",\n \"iconSquare\",\n \"kv\",\n \"searchBar\",\n \"box\",\n \"divider\",\n];\n\n/* -------------------------------------------------------------------------- */\n/* Schema (mirrors the plan-content wireframeDataSchema) */\n/* -------------------------------------------------------------------------- */\n\nconst toneSchema = z.enum([\"default\", \"accent\", \"warn\", \"ok\", \"muted\"]);\nconst elNameSchema = z.enum(\n WIREFRAME_EL_NAMES as [WireframeElName, ...WireframeElName[]],\n);\nconst idSchema = z.string().trim().min(1).max(120);\n\n/**\n * Reject full-document HTML (html/head/body/script/style tags) in the `html` /\n * `css` fields. Wireframe content must be a bounded fragment; document or script\n * tags are a stored-XSS and layout-escape hazard.\n */\nfunction noFullHtmlDocument(value: string): boolean {\n return !/<\\s*(?:!doctype|html|head|body|script|style)\\b/i.test(value);\n}\n\nconst wireframeNodeSchema: z.ZodType<WireframeNode> = z.lazy(() =>\n z\n .object({\n id: idSchema.optional(),\n el: elNameSchema,\n children: z.array(wireframeNodeSchema).max(60).optional(),\n\n text: z.string().trim().max(400).optional(),\n value: z.string().trim().max(400).optional(),\n label: z.string().trim().max(200).optional(),\n placeholder: z.string().trim().max(200).optional(),\n title: z.string().trim().max(200).optional(),\n\n tone: toneSchema.optional(),\n color: toneSchema.optional(),\n weight: z.enum([\"normal\", \"medium\", \"bold\"]).optional(),\n active: z.boolean().optional(),\n done: z.boolean().optional(),\n emphasis: z.boolean().optional(),\n full: z.boolean().optional(),\n solid: z.boolean().optional(),\n dashed: z.boolean().optional(),\n dot: z.boolean().optional(),\n script: z.boolean().optional(),\n area: z.boolean().optional(),\n shape: z.enum([\"square\", \"circle\"]).optional(),\n\n count: z.number().int().min(0).max(9_999).optional(),\n prio: z.number().int().min(0).max(9).optional(),\n n: z.number().int().min(0).max(20).optional(),\n widths: z.array(z.number().min(0).max(100)).max(20).optional(),\n icon: z.string().trim().max(40).optional(),\n\n note: z.string().trim().max(400).optional(),\n due: z.string().trim().max(120).optional(),\n dueTone: toneSchema.optional(),\n\n items: z\n .array(\n z.object({\n label: z.string().trim().min(1).max(200),\n active: z.boolean().optional(),\n count: z.number().int().min(0).max(9_999).optional(),\n dot: z.boolean().optional(),\n }),\n )\n .max(40)\n .optional(),\n rows: z\n .array(\n z.object({\n k: z.string().trim().min(1).max(200),\n v: z.string().trim().max(400),\n }),\n )\n .max(40)\n .optional(),\n })\n .passthrough(),\n) as z.ZodType<WireframeNode>;\n\nexport const wireframeSchema = z\n .object({\n surface: z.enum([\"desktop\", \"mobile\", \"popover\", \"panel\", \"browser\"]),\n renderMode: z.enum([\"wireframe\", \"design\"]).optional(),\n caption: z.string().trim().max(400).optional(),\n skeleton: z.boolean().optional(),\n html: z\n .string()\n .max(40_000)\n .refine(noFullHtmlDocument, {\n message:\n \"Wireframe html must be a bounded fragment without html/head/body/script/style tags.\",\n })\n .optional(),\n css: z\n .string()\n .max(20_000)\n .refine(noFullHtmlDocument, {\n message: \"Wireframe css must not include document or script tags.\",\n })\n .optional(),\n screen: z.array(wireframeNodeSchema).max(200).optional(),\n })\n .passthrough() as unknown as z.ZodType<WireframeData>;\n\n/* -------------------------------------------------------------------------- */\n/* Stable node-id derivation (verbatim from plan-mdx.ts) */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Derive a stable node id from the element name and tree path. Re-runs identically\n * to the legacy plan derivation so stored plans round-trip without changing ids.\n */\nexport function createStableWireframeNodeId(\n el: WireframeElName,\n path: string,\n): string {\n return `node-${el}-${path}`\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 80);\n}\n\n/* -------------------------------------------------------------------------- */\n/* Kit node <-> MDX component name maps (mirrors plan-mdx.ts NODE_TO_COMPONENT) */\n/* -------------------------------------------------------------------------- */\n\nconst NODE_TO_COMPONENT: Record<WireframeElName, string> = {\n screen: \"FrameScreen\",\n browserBar: \"BrowserBar\",\n statusBar: \"StatusBar\",\n toolbar: \"Toolbar\",\n row: \"Row\",\n col: \"Col\",\n sidebar: \"Sidebar\",\n navItem: \"NavItem\",\n main: \"Main\",\n title: \"Title\",\n text: \"Text\",\n lines: \"Lines\",\n section: \"SectionLabel\",\n taskRow: \"TaskRow\",\n chips: \"Chips\",\n chip: \"Chip\",\n pill: \"Pill\",\n check: \"Check\",\n field: \"Field\",\n btn: \"Btn\",\n fab: \"Fab\",\n card: \"Card\",\n column: \"Column\",\n avatar: \"Avatar\",\n iconSquare: \"IconSquare\",\n kv: \"KV\",\n searchBar: \"SearchBar\",\n box: \"Box\",\n divider: \"Divider\",\n};\n\nconst COMPONENT_TO_NODE = Object.fromEntries(\n Object.entries(NODE_TO_COMPONENT).map(([el, component]) => [component, el]),\n) as Record<string, WireframeElName>;\n\n/* -------------------------------------------------------------------------- */\n/* Serialize (verbatim port of plan-mdx.ts serializeNode/serializeScreen) */\n/* -------------------------------------------------------------------------- */\n\nfunction serializeNode(node: WireframeNode, indent = \"\"): string {\n const name = NODE_TO_COMPONENT[node.el] ?? \"Box\";\n const attrs = Object.entries(node)\n .filter(([key]) => key !== \"children\" && key !== \"el\")\n .map(([key, value]) => prop(key, value))\n .join(\"\");\n if (!node.children?.length) return `${indent}<${name}${attrs} />`;\n const children = node.children\n .map((child) => serializeNode(child, `${indent} `))\n .join(\"\\n\");\n return `${indent}<${name}${attrs}>\\n${children}\\n${indent}</${name}>`;\n}\n\n/**\n * Serialize the wireframe data to its inner `<Screen>` MDX subtree. The registry\n * serializer wraps this between the `<WireframeBlock …>` open/close tags, so the\n * total output equals the legacy `serializeBlock` wireframe branch exactly.\n */\nfunction serializeScreen(data: WireframeData): string {\n const attrs = [\n prop(\"surface\", data.surface),\n prop(\"renderMode\", data.renderMode),\n prop(\"caption\", data.caption),\n prop(\"html\", data.html),\n prop(\"css\", data.css),\n prop(\"skeleton\", data.skeleton),\n ].join(\"\");\n const children = (data.screen ?? [])\n .map((node) => serializeNode(node, \" \"))\n .join(\"\\n\");\n if (!children) return `<Screen${attrs} />`;\n return `<Screen${attrs}>\\n${children}\\n</Screen>`;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Parse (verbatim port of plan-mdx.ts parseScreen/parseWireframeNode) */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Minimal MDX AST node shape used while walking the wireframe subtree. Declared\n * standalone (not an intersection with `MdxJsxNode`, whose `children` is\n * `unknown[]`) so recursive `children` stays narrowed to `WireframeMdxNode`.\n */\ntype WireframeMdxNode = {\n type: string;\n name?: string;\n attributes?: Array<{\n type: string;\n name?: string;\n value?: string | null | { type: string; value: string; data?: unknown };\n }>;\n children?: WireframeMdxNode[];\n};\n\nfunction elementName(node: WireframeMdxNode | undefined): string | undefined {\n return node?.type === \"mdxJsxFlowElement\" ||\n node?.type === \"mdxJsxTextElement\"\n ? node.name\n : undefined;\n}\n\nfunction findAttribute(node: WireframeMdxNode, name: string) {\n return node.attributes?.find(\n (attr) => attr.type === \"mdxJsxAttribute\" && attr.name === name,\n );\n}\n\nfunction stringAttr(node: WireframeMdxNode, name: string): string | undefined {\n const value = attributeValue(findAttribute(node, name));\n return typeof value === \"string\" ? value : undefined;\n}\n\nfunction boolAttr(node: WireframeMdxNode, name: string): boolean | undefined {\n const value = attributeValue(findAttribute(node, name));\n return typeof value === \"boolean\" ? value : undefined;\n}\n\nfunction parseWireframeNode(\n node: WireframeMdxNode,\n path = \"node\",\n): WireframeNode | null {\n const component = elementName(node);\n if (!component) return null;\n const el = COMPONENT_TO_NODE[component];\n if (!el) return null;\n const attrs = node.attributes ?? [];\n const parsed: WireframeNode = { el };\n for (const attr of attrs) {\n if (attr.type !== \"mdxJsxAttribute\") continue;\n const value = attributeValue(attr);\n if (value !== undefined)\n (parsed as Record<string, unknown>)[attr.name as string] = value;\n }\n parsed.el = el;\n parsed.id ??= createStableWireframeNodeId(el, path);\n const children = (node.children ?? [])\n .map((child, index) => parseWireframeNode(child, `${path}-${index}`))\n .filter(Boolean) as WireframeNode[];\n if (children.length > 0) parsed.children = children;\n return parsed;\n}\n\nfunction parseScreen(node: WireframeMdxNode, idContext: string): WireframeData {\n return {\n surface:\n (stringAttr(node, \"surface\") as WireframeData[\"surface\"]) ?? \"desktop\",\n renderMode: stringAttr(node, \"renderMode\") as WireframeData[\"renderMode\"],\n caption: stringAttr(node, \"caption\"),\n html: stringAttr(node, \"html\"),\n css: stringAttr(node, \"css\"),\n skeleton: boolAttr(node, \"skeleton\"),\n screen: (node.children ?? [])\n .map((child, index) =>\n parseWireframeNode(child, `${idContext}-screen-${index}`),\n )\n .filter(Boolean) as WireframeNode[],\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* MDX config */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Registry MDX config for the wireframe block. `tag` matches the legacy\n * `WireframeBlock`. The block has no flat attributes (`toAttrs` → `{}`); all data\n * lives in the nested `<Screen>` subtree handled by `serializeChildren` /\n * `parseChildren`. The registry serializer wraps `serializeChildren` between the\n * `<WireframeBlock>` open/close, producing the exact legacy bytes. On parse, the\n * registry passes the already-extended `${idContext}-${blockId}` to\n * `parseChildren` — the same id base the legacy `parseScreen` receives — so node\n * ids are reproduced identically.\n */\nexport const wireframeMdx: BlockMdxConfig<WireframeData> = {\n tag: \"WireframeBlock\",\n toAttrs: () => ({}),\n fromAttrs: () => ({ surface: \"desktop\", screen: [] }),\n serializeChildren: (data) => serializeScreen(data),\n parseChildren: (childNodes, idContext) => {\n const nodes = childNodes as WireframeMdxNode[];\n const screen = nodes.find((child) => elementName(child) === \"Screen\");\n if (!screen) return { surface: \"desktop\", screen: [] };\n return parseScreen(screen, idContext);\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"wireframe.config.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/wireframe.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AA4JjD,MAAM,CAAC,MAAM,kBAA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KAAK,CAAC;QACpC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;QACpC,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;aAC1B,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACpB,kBAAkB,CAAC,KAAK,EAAE,GAAG,SAAS,WAAW,KAAK,EAAE,CAAC,CAC1D;aACA,MAAM,CAAC,OAAO,CAAoB;KACtC,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAEhF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkC;IACzD,GAAG,EAAE,gBAAgB;IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACnB,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACrD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;IAClD,aAAa,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,UAAgC,CAAC;QAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QACvD,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxC,CAAC;CACF,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { prop, attributeValue } from \"../mdx.js\";\nimport type { BlockMdxConfig } from \"../types.js\";\n\n/**\n * Pure (React-free) part of the shared `wireframe` block: its data shape, zod\n * schema, the stable node-id helper, and the nested-MDX round-trip config. Lives\n * in core so BOTH apps' server/shared registries and the client spec\n * (`wireframe.tsx`) consume one definition; importing it into a server module\n * never pulls React into the Nitro/SSR bundle.\n *\n * The wireframe block originated in the plan template. The vocabulary\n * (`PlanWireframe*` names, the `el` set, the `--wf-*` token contract) and the\n * MDX encoding (`<WireframeBlock>…<Screen>…</Screen></WireframeBlock>` with kit\n * component names `FrameScreen`/`Row`/`Col`/…) are preserved EXACTLY so stored\n * plans round-trip byte-compatibly and existing node ids never change.\n *\n * The wireframe is NESTED MDX, not a flat-attribute or prose block: its body is\n * a `<Screen surface caption>…kit-tree…</Screen>` subtree. So the config uses\n * `serializeChildren`/`parseChildren` (the registry's nested-MDX path) rather\n * than `toAttrs`/`childrenField`.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Vocabulary (decoupled copy of the plan-content wireframe types) */\n/* -------------------------------------------------------------------------- */\n\nexport type WireframeSurface =\n | \"desktop\"\n | \"mobile\"\n | \"popover\"\n | \"panel\"\n | \"browser\";\n\nexport type WireframeRenderMode = \"wireframe\" | \"design\";\n\n/** Tone keyword reused across screen primitives. The renderer maps to color. */\nexport type WireframeTone = \"default\" | \"accent\" | \"warn\" | \"ok\" | \"muted\";\n\n/**\n * Names of the kit primitives. Component-like (MDX-friendly). The renderer maps\n * each to a flex kit component. Layout is ALWAYS flex; row/col/sidebar/main set\n * the flex direction.\n */\nexport type WireframeElName =\n | \"screen\"\n | \"browserBar\"\n | \"statusBar\"\n | \"toolbar\"\n | \"row\"\n | \"col\"\n | \"sidebar\"\n | \"navItem\"\n | \"main\"\n | \"title\"\n | \"text\"\n | \"lines\"\n | \"section\"\n | \"taskRow\"\n | \"chips\"\n | \"chip\"\n | \"pill\"\n | \"check\"\n | \"field\"\n | \"btn\"\n | \"fab\"\n | \"card\"\n | \"column\"\n | \"avatar\"\n | \"iconSquare\"\n | \"kv\"\n | \"searchBar\"\n | \"box\"\n | \"divider\";\n\n/**\n * A single node in the wireframe kit tree. `el` is the primitive name; the\n * remaining props are the union of every primitive's props (kept permissive so\n * the model can compose freely). `children` nests other nodes. `id` is a stable\n * node id used by node-addressable patch ops (auto-assigned on create).\n *\n * There is intentionally NO x/y/width/height here — wireframe internals are\n * geometry-free and laid out by the renderer with flex.\n */\nexport type WireframeNode = {\n /** Stable id for node-addressable patches; auto-assigned when absent. */\n id?: string;\n el: WireframeElName;\n children?: WireframeNode[];\n\n // Generic content props\n text?: string;\n value?: string;\n label?: string;\n placeholder?: string;\n title?: string;\n\n // Styling-by-intent (semantic only; renderer owns actual color/size)\n tone?: WireframeTone;\n color?: WireframeTone;\n weight?: \"normal\" | \"medium\" | \"bold\";\n active?: boolean;\n done?: boolean;\n emphasis?: boolean;\n full?: boolean;\n solid?: boolean;\n dashed?: boolean;\n dot?: boolean;\n script?: boolean;\n area?: boolean;\n shape?: \"square\" | \"circle\";\n\n // Numeric / structured props\n count?: number;\n prio?: number;\n n?: number;\n widths?: number[];\n icon?: string;\n\n // taskRow specifics\n note?: string;\n due?: string;\n dueTone?: WireframeTone;\n\n // Collection props (chips, kv)\n items?: Array<{\n label: string;\n active?: boolean;\n count?: number;\n dot?: boolean;\n }>;\n rows?: Array<{ k: string; v: string }>;\n};\n\nexport interface WireframeData {\n surface: WireframeSurface;\n /** `design` renders full-fidelity branded HTML/CSS instead of a sketch. */\n renderMode?: WireframeRenderMode;\n caption?: string;\n /**\n * Neutral, textless loading register. The renderer drops borders, the sketch\n * outline, and color, rendering soft placeholder geometry only.\n */\n skeleton?: boolean;\n /**\n * PRIMARY content: a self-contained HTML mockup of the screen (sanitized\n * fragment — no document/script/style tags). The renderer owns the surface\n * aspect, the dark/light theme, the hand-drawn font, and the rough overlay.\n * When `html` is set, `screen` is ignored.\n */\n html?: string;\n /** Optional scoped CSS for the html mockup (sanitized fragment). */\n css?: string;\n /** Kit-tree screen. Used when `html` is absent. */\n screen?: WireframeNode[];\n}\n\nexport const WIREFRAME_SURFACES: WireframeSurface[] = [\n \"desktop\",\n \"mobile\",\n \"popover\",\n \"panel\",\n \"browser\",\n];\n\nexport const WIREFRAME_EL_NAMES: WireframeElName[] = [\n \"screen\",\n \"browserBar\",\n \"statusBar\",\n \"toolbar\",\n \"row\",\n \"col\",\n \"sidebar\",\n \"navItem\",\n \"main\",\n \"title\",\n \"text\",\n \"lines\",\n \"section\",\n \"taskRow\",\n \"chips\",\n \"chip\",\n \"pill\",\n \"check\",\n \"field\",\n \"btn\",\n \"fab\",\n \"card\",\n \"column\",\n \"avatar\",\n \"iconSquare\",\n \"kv\",\n \"searchBar\",\n \"box\",\n \"divider\",\n];\n\n/* -------------------------------------------------------------------------- */\n/* Schema (mirrors the plan-content wireframeDataSchema) */\n/* -------------------------------------------------------------------------- */\n\nconst toneSchema = z.enum([\"default\", \"accent\", \"warn\", \"ok\", \"muted\"]);\nconst elNameSchema = z.enum(\n WIREFRAME_EL_NAMES as [WireframeElName, ...WireframeElName[]],\n);\nconst idSchema = z.string().trim().min(1).max(120);\n\n/**\n * Reject full-document HTML (html/head/body/script/style tags) in the `html` /\n * `css` fields. Wireframe content must be a bounded fragment; document or script\n * tags are a stored-XSS and layout-escape hazard.\n */\nfunction noFullHtmlDocument(value: string): boolean {\n return !/<\\s*(?:!doctype|html|head|body|script|style)\\b/i.test(value);\n}\n\nconst wireframeNodeSchema: z.ZodType<WireframeNode> = z.lazy(() =>\n z\n .object({\n id: idSchema.optional(),\n el: elNameSchema,\n children: z.array(wireframeNodeSchema).max(60).optional(),\n\n text: z.string().trim().max(400).optional(),\n value: z.string().trim().max(400).optional(),\n label: z.string().trim().max(200).optional(),\n placeholder: z.string().trim().max(200).optional(),\n title: z.string().trim().max(200).optional(),\n\n tone: toneSchema.optional(),\n color: toneSchema.optional(),\n weight: z.enum([\"normal\", \"medium\", \"bold\"]).optional(),\n active: z.boolean().optional(),\n done: z.boolean().optional(),\n emphasis: z.boolean().optional(),\n full: z.boolean().optional(),\n solid: z.boolean().optional(),\n dashed: z.boolean().optional(),\n dot: z.boolean().optional(),\n script: z.boolean().optional(),\n area: z.boolean().optional(),\n shape: z.enum([\"square\", \"circle\"]).optional(),\n\n count: z.number().int().min(0).max(9_999).optional(),\n prio: z.number().int().min(0).max(9).optional(),\n n: z.number().int().min(0).max(20).optional(),\n widths: z.array(z.number().min(0).max(100)).max(20).optional(),\n icon: z.string().trim().max(40).optional(),\n\n note: z.string().trim().max(400).optional(),\n due: z.string().trim().max(120).optional(),\n dueTone: toneSchema.optional(),\n\n items: z\n .array(\n z.object({\n label: z.string().trim().min(1).max(200),\n active: z.boolean().optional(),\n count: z.number().int().min(0).max(9_999).optional(),\n dot: z.boolean().optional(),\n }),\n )\n .max(40)\n .optional(),\n rows: z\n .array(\n z.object({\n k: z.string().trim().min(1).max(200),\n v: z.string().trim().max(400),\n }),\n )\n .max(40)\n .optional(),\n })\n .passthrough(),\n) as z.ZodType<WireframeNode>;\n\nexport const wireframeSchema = z\n .object({\n surface: z.enum([\"desktop\", \"mobile\", \"popover\", \"panel\", \"browser\"]),\n renderMode: z.enum([\"wireframe\", \"design\"]).optional(),\n caption: z.string().trim().max(400).optional(),\n skeleton: z.boolean().optional(),\n html: z\n .string()\n .max(40_000)\n .refine(noFullHtmlDocument, {\n message:\n \"Wireframe html must be a bounded fragment without html/head/body/script/style tags.\",\n })\n .optional(),\n css: z\n .string()\n .max(20_000)\n .refine(noFullHtmlDocument, {\n message: \"Wireframe css must not include document or script tags.\",\n })\n .optional(),\n screen: z.array(wireframeNodeSchema).max(200).optional(),\n })\n .passthrough() as unknown as z.ZodType<WireframeData>;\n\n/* -------------------------------------------------------------------------- */\n/* Stable node-id derivation (verbatim from plan-mdx.ts) */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Derive a stable node id from the element name and tree path. Re-runs identically\n * to the legacy plan derivation so stored plans round-trip without changing ids.\n */\nexport function createStableWireframeNodeId(\n el: WireframeElName,\n path: string,\n): string {\n return `node-${el}-${path}`\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 80);\n}\n\n/* -------------------------------------------------------------------------- */\n/* Kit node <-> MDX component name maps (mirrors plan-mdx.ts NODE_TO_COMPONENT) */\n/* -------------------------------------------------------------------------- */\n\nconst NODE_TO_COMPONENT: Record<WireframeElName, string> = {\n screen: \"FrameScreen\",\n browserBar: \"BrowserBar\",\n statusBar: \"StatusBar\",\n toolbar: \"Toolbar\",\n row: \"Row\",\n col: \"Col\",\n sidebar: \"Sidebar\",\n navItem: \"NavItem\",\n main: \"Main\",\n title: \"Title\",\n text: \"Text\",\n lines: \"Lines\",\n section: \"SectionLabel\",\n taskRow: \"TaskRow\",\n chips: \"Chips\",\n chip: \"Chip\",\n pill: \"Pill\",\n check: \"Check\",\n field: \"Field\",\n btn: \"Btn\",\n fab: \"Fab\",\n card: \"Card\",\n column: \"Column\",\n avatar: \"Avatar\",\n iconSquare: \"IconSquare\",\n kv: \"KV\",\n searchBar: \"SearchBar\",\n box: \"Box\",\n divider: \"Divider\",\n};\n\nconst COMPONENT_TO_NODE = Object.fromEntries(\n Object.entries(NODE_TO_COMPONENT).map(([el, component]) => [component, el]),\n) as Record<string, WireframeElName>;\n\n/* -------------------------------------------------------------------------- */\n/* Serialize (verbatim port of plan-mdx.ts serializeNode/serializeScreen) */\n/* -------------------------------------------------------------------------- */\n\nfunction serializeNode(node: WireframeNode, indent = \"\"): string {\n const name = NODE_TO_COMPONENT[node.el] ?? \"Box\";\n const attrs = Object.entries(node)\n .filter(([key]) => key !== \"children\" && key !== \"el\")\n .map(([key, value]) => prop(key, value))\n .join(\"\");\n if (!node.children?.length) return `${indent}<${name}${attrs} />`;\n const children = node.children\n .map((child) => serializeNode(child, `${indent} `))\n .join(\"\\n\");\n return `${indent}<${name}${attrs}>\\n${children}\\n${indent}</${name}>`;\n}\n\n/**\n * Serialize the wireframe data to its inner `<Screen>` MDX subtree. The registry\n * serializer wraps this between the `<WireframeBlock …>` open/close tags, so the\n * total output equals the legacy `serializeBlock` wireframe branch exactly.\n */\nfunction serializeScreen(data: WireframeData): string {\n const attrs = [\n prop(\"surface\", data.surface),\n prop(\"renderMode\", data.renderMode),\n prop(\"caption\", data.caption),\n prop(\"html\", data.html),\n prop(\"css\", data.css),\n prop(\"skeleton\", data.skeleton),\n ].join(\"\");\n const children = (data.screen ?? [])\n .map((node) => serializeNode(node, \" \"))\n .join(\"\\n\");\n if (!children) return `<Screen${attrs} />`;\n return `<Screen${attrs}>\\n${children}\\n</Screen>`;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Parse (verbatim port of plan-mdx.ts parseScreen/parseWireframeNode) */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Minimal MDX AST node shape used while walking the wireframe subtree. Declared\n * standalone (not an intersection with `MdxJsxNode`, whose `children` is\n * `unknown[]`) so recursive `children` stays narrowed to `WireframeMdxNode`.\n */\ntype WireframeMdxNode = {\n type: string;\n name?: string;\n attributes?: Array<{\n type: string;\n name?: string;\n value?: string | null | { type: string; value: string; data?: unknown };\n }>;\n children?: WireframeMdxNode[];\n};\n\nfunction elementName(node: WireframeMdxNode | undefined): string | undefined {\n return node?.type === \"mdxJsxFlowElement\" ||\n node?.type === \"mdxJsxTextElement\"\n ? node.name\n : undefined;\n}\n\nfunction findAttribute(node: WireframeMdxNode, name: string) {\n return node.attributes?.find(\n (attr) => attr.type === \"mdxJsxAttribute\" && attr.name === name,\n );\n}\n\nfunction stringAttr(node: WireframeMdxNode, name: string): string | undefined {\n const value = attributeValue(findAttribute(node, name));\n return typeof value === \"string\" ? value : undefined;\n}\n\n/**\n * Resolve a required-when-present string attribute on a `<Screen>`. If the\n * attribute is absent we return undefined, but if it is present yet cannot be\n * resolved to a string (e.g. a number, an object, or an unevaluable expression)\n * we THROW so a malformed wireframe fails the import instead of silently\n * dropping the value and rendering an empty wireframe.\n */\nfunction requiredStringAttr(\n node: WireframeMdxNode,\n name: string,\n): string | undefined {\n const attr = findAttribute(node, name);\n if (!attr) return undefined;\n const value = attributeValue(attr);\n if (typeof value !== \"string\") {\n throw new Error(\n `Wireframe <Screen> attribute \"${name}\" must resolve to a string, got ${typeof value}. Use a quoted string or a static template literal.`,\n );\n }\n return value;\n}\n\nfunction boolAttr(node: WireframeMdxNode, name: string): boolean | undefined {\n const value = attributeValue(findAttribute(node, name));\n return typeof value === \"boolean\" ? value : undefined;\n}\n\nfunction parseWireframeNode(\n node: WireframeMdxNode,\n path = \"node\",\n): WireframeNode | null {\n const component = elementName(node);\n if (!component) return null;\n const el = COMPONENT_TO_NODE[component];\n if (!el) return null;\n const attrs = node.attributes ?? [];\n const parsed: WireframeNode = { el };\n for (const attr of attrs) {\n if (attr.type !== \"mdxJsxAttribute\") continue;\n const value = attributeValue(attr);\n if (value !== undefined)\n (parsed as Record<string, unknown>)[attr.name as string] = value;\n }\n parsed.el = el;\n parsed.id ??= createStableWireframeNodeId(el, path);\n const children = (node.children ?? [])\n .map((child, index) => parseWireframeNode(child, `${path}-${index}`))\n .filter(Boolean) as WireframeNode[];\n if (children.length > 0) parsed.children = children;\n return parsed;\n}\n\nfunction parseScreen(node: WireframeMdxNode, idContext: string): WireframeData {\n return {\n surface:\n (stringAttr(node, \"surface\") as WireframeData[\"surface\"]) ?? \"desktop\",\n renderMode: stringAttr(node, \"renderMode\") as WireframeData[\"renderMode\"],\n caption: stringAttr(node, \"caption\"),\n html: requiredStringAttr(node, \"html\"),\n css: requiredStringAttr(node, \"css\"),\n skeleton: boolAttr(node, \"skeleton\"),\n screen: (node.children ?? [])\n .map((child, index) =>\n parseWireframeNode(child, `${idContext}-screen-${index}`),\n )\n .filter(Boolean) as WireframeNode[],\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* MDX config */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Registry MDX config for the wireframe block. `tag` matches the legacy\n * `WireframeBlock`. The block has no flat attributes (`toAttrs` → `{}`); all data\n * lives in the nested `<Screen>` subtree handled by `serializeChildren` /\n * `parseChildren`. The registry serializer wraps `serializeChildren` between the\n * `<WireframeBlock>` open/close, producing the exact legacy bytes. On parse, the\n * registry passes the already-extended `${idContext}-${blockId}` to\n * `parseChildren` — the same id base the legacy `parseScreen` receives — so node\n * ids are reproduced identically.\n */\nexport const wireframeMdx: BlockMdxConfig<WireframeData> = {\n tag: \"WireframeBlock\",\n toAttrs: () => ({}),\n fromAttrs: () => ({ surface: \"desktop\", screen: [] }),\n serializeChildren: (data) => serializeScreen(data),\n parseChildren: (childNodes, idContext) => {\n const nodes = childNodes as WireframeMdxNode[];\n const screen = nodes.find((child) => elementName(child) === \"Screen\");\n if (!screen) return { surface: \"desktop\", screen: [] };\n return parseScreen(screen, idContext);\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../../src/client/blocks/mdx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAgB,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;GAOG;AAMH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAErD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAazD;AAMD,yEAAyE;AACzE,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,iBAAiB,CAAC;CAC3C,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../../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OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,EACpB,KAAK,EAAE,iBAAiB,GACvB,MAAM,CA+BR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAmBxC"}
|
|
@@ -79,6 +79,17 @@ function literalNodeValue(node) {
|
|
|
79
79
|
return undefined;
|
|
80
80
|
if (node.type === "Literal")
|
|
81
81
|
return node.value;
|
|
82
|
+
if (node.type === "TemplateLiteral") {
|
|
83
|
+
// A template literal WITH `${…}` interpolations can't be evaluated
|
|
84
|
+
// statically — fail loudly so the import errors instead of falling through
|
|
85
|
+
// to a confusing JSON parse error or silently dropping the attribute.
|
|
86
|
+
if ((node.expressions?.length ?? 0) > 0) {
|
|
87
|
+
throw new Error("Template literal attribute values may not contain ${…} expressions; use a static string.");
|
|
88
|
+
}
|
|
89
|
+
// A template literal with no expressions is a static string:
|
|
90
|
+
// `<div>hi</div>` → "<div>hi</div>".
|
|
91
|
+
return node.quasis?.[0]?.value?.cooked ?? "";
|
|
92
|
+
}
|
|
82
93
|
if (node.type === "ArrayExpression") {
|
|
83
94
|
return (node.elements ?? []).map((item) => literalNodeValue(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G,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,IAAa,CAAC;IAClB,IAAI,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACvD,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CACzC,IAAI,CAAC,QAAQ,IAAI,EAAE,EACnB,GAAG,SAAS,IAAI,IAAI,CAAC,EAAE,EAAE,CAC1B,CAAC;QACF,IAAI,GAAG,EAAE,GAAI,SAAoB,EAAE,GAAI,YAAuB,EAAE,CAAC;IACnE,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import type { BlockSpec, BlockAttrReader, MdxAttrValue } from \"./types.js\";\nimport type { BlockRegistry } from \"./registry.js\";\n\n/**\n * Registry-driven MDX serialize/parse, plus the shared encoder primitives that\n * are the round-trip contract. This module is React-free so the server MDX\n * adapter (`plan-mdx.ts`) and the agent schema export can import it. The encoder\n * + estree literal walker are kept BYTE-FOR-BYTE identical to the originals in\n * `plan-mdx.ts` — `plan-mdx.ts` re-imports them so nothing else there changes\n * and stored `.mdx` files round-trip the same.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Serialize-side encoder primitives (moved verbatim from plan-mdx.ts) */\n/* -------------------------------------------------------------------------- */\n\nexport function jsonExpression(value: unknown): string {\n return JSON.stringify(value, null, 2);\n}\n\nexport function escapeAttr(value: string): string {\n return value\n .replace(/&/g, \"&\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\");\n}\n\n/**\n * Encode a single attribute. Returns \"\" (the attribute is dropped) for\n * undefined/null; a bare/`={false}` flag for booleans; `={n}` for numbers; a\n * quoted string when it matches the safe charset and is short, else a JSON\n * expression. Objects/arrays always serialize as a JSON expression.\n */\nexport function prop(name: string, value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"boolean\") {\n return value ? ` ${name}` : ` ${name}={false}`;\n }\n if (typeof value === \"number\") return ` ${name}={${value}}`;\n if (typeof value === \"string\") {\n if (/^[\\w .:/@#,+()[\\]-]+$/.test(value) && value.length < 140) {\n return ` ${name}=\"${escapeAttr(value)}\"`;\n }\n return ` ${name}={${jsonExpression(value)}}`;\n }\n return ` ${name}={${jsonExpression(value)}}`;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Parse-side attribute resolution (moved verbatim from plan-mdx.ts) */\n/* -------------------------------------------------------------------------- */\n\n/** Minimal MDX AST node shape (subset of the remark-mdx jsx element). */\nexport type MdxAttrNode = {\n type: string;\n name?: string;\n value?: string | null | MdxAttrExpression;\n};\n\ntype MdxAttrExpression = {\n type: string;\n value: string;\n data?: unknown;\n};\n\ntype EstreeNode = {\n type: string;\n value?: unknown;\n name?: string;\n expression?: EstreeNode;\n body?: EstreeNode[];\n elements?: Array<EstreeNode | null>;\n properties?: EstreeNode[];\n key?: EstreeNode;\n computed?: boolean;\n argument?: EstreeNode;\n operator?: string;\n};\n\nexport type MdxJsxNode = {\n type: string;\n name?: string;\n attributes?: MdxAttrNode[];\n children?: unknown[];\n [key: string]: unknown;\n};\n\nfunction findAttribute(\n node: MdxJsxNode,\n name: string,\n): MdxAttrNode | undefined {\n return node.attributes?.find(\n (attr) => attr.type === \"mdxJsxAttribute\" && attr.name === name,\n );\n}\n\nexport function attributeValue(attr: MdxAttrNode | undefined): unknown {\n if (!attr) return undefined;\n if (attr.value === null || attr.value === undefined) return true;\n if (typeof attr.value === \"string\") return attr.value;\n const astValue = literalExpressionValue(attr.value);\n if (astValue !== undefined) return astValue;\n const expression = attr.value.value.trim();\n if (!expression) return undefined;\n if (expression === \"undefined\") return undefined;\n try {\n return JSON.parse(expression);\n } catch {\n throw new Error(\n `Unsupported MDX attribute expression for \"${attr.name}\": {${expression}}. Use literal values or valid JSON.`,\n );\n }\n}\n\nfunction literalExpressionValue(expression: MdxAttrExpression): unknown {\n const estree = (expression.data as { estree?: EstreeNode } | undefined)\n ?.estree;\n const statement = estree?.body?.[0];\n if (!statement || statement.type !== \"ExpressionStatement\") return undefined;\n return literalNodeValue(statement.expression);\n}\n\nfunction literalNodeValue(node: EstreeNode | undefined | null): unknown {\n if (!node) return undefined;\n if (node.type === \"Literal\") return node.value;\n if (node.type === \"ArrayExpression\") {\n return (node.elements ?? []).map((item) => literalNodeValue(item));\n }\n if (node.type === \"ObjectExpression\") {\n const out: Record<string, unknown> = {};\n for (const property of node.properties ?? []) {\n if (property.type !== \"Property\" || property.computed) return undefined;\n const key = property.key;\n const rawKey =\n key?.type === \"Identifier\"\n ? key.name\n : key?.type === \"Literal\" && typeof key.value === \"string\"\n ? key.value\n : undefined;\n if (!rawKey) return undefined;\n const value = literalNodeValue(property.value as EstreeNode | undefined);\n if (value !== undefined) out[rawKey] = value;\n }\n return out;\n }\n if (node.type === \"UnaryExpression\") {\n const value = literalNodeValue(node.argument);\n if (typeof value !== \"number\") return undefined;\n if (node.operator === \"-\") return -value;\n if (node.operator === \"+\") return value;\n }\n if (node.type === \"Identifier\") {\n if (node.name === \"undefined\") return undefined;\n if (node.name === \"NaN\") return Number.NaN;\n if (node.name === \"Infinity\") return Infinity;\n }\n return undefined;\n}\n\n/** Build a {@link BlockAttrReader} bound to one parsed JSX node. */\nexport function createAttrReader(node: MdxJsxNode): BlockAttrReader {\n const read = (name: string) => attributeValue(findAttribute(node, name));\n return {\n raw: read,\n string(name) {\n const value = read(name);\n return typeof value === \"string\" ? value : undefined;\n },\n number(name) {\n const value = read(name);\n return typeof value === \"number\" ? value : undefined;\n },\n bool(name) {\n const value = read(name);\n return typeof value === \"boolean\" ? value : undefined;\n },\n array(name) {\n const value = read(name);\n return Array.isArray(value) ? (value as never[]) : undefined;\n },\n object(name) {\n const value = read(name);\n return value && typeof value === \"object\" ? (value as never) : undefined;\n },\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* Registry serialize / parse */\n/* -------------------------------------------------------------------------- */\n\n/** The base-attribute + body shape every block carries. */\nexport interface SerializableBlock {\n id: string;\n title?: string;\n summary?: string;\n editable?: boolean;\n data: unknown;\n}\n\n/** Base block attributes parsed from a node, before the type-specific data. */\nexport interface ParsedBlockBase {\n id: string;\n title?: string;\n summary?: string;\n editable?: boolean;\n}\n\n/**\n * Serialize a block to its MDX element using its spec. Byte output MUST match\n * the legacy `serializeBlock` for every converted block: base attrs\n * (`id,title,summary,editable`) first, then the spec's `toAttrs` in insertion\n * order, then either nested children, prose children, or self-closing.\n */\nexport function serializeSpecBlock(\n spec: BlockSpec<any>,\n block: SerializableBlock,\n): string {\n const base =\n prop(\"id\", block.id) +\n prop(\"title\", block.title) +\n prop(\"summary\", block.summary) +\n prop(\"editable\", block.editable);\n\n const attrs = spec.mdx.toAttrs(block.data);\n const childrenField = spec.mdx.childrenField;\n const attrStr = Object.entries(attrs)\n .filter(([key]) => key !== childrenField)\n .map(([key, value]) => prop(key, value as MdxAttrValue | undefined))\n .join(\"\");\n\n const tag = spec.mdx.tag;\n\n // Custom nested-MDX children (e.g. wireframe Screen/kit tree).\n if (spec.mdx.serializeChildren) {\n return `<${tag}${base}${attrStr}>\\n${spec.mdx.serializeChildren(block.data)}\\n</${tag}>`;\n }\n\n // Prose children (rich-text, callout): body is a trimmed markdown string.\n if (childrenField) {\n const body = String(\n (block.data as Record<string, unknown>)[childrenField] ?? \"\",\n ).trim();\n return `<${tag}${base}${attrStr}>\\n\\n${body}\\n\\n</${tag}>`;\n }\n\n // Self-closing structured block.\n return `<${tag}${base}${attrStr} />`;\n}\n\n/**\n * Parse one MDX JSX node into a block via the registry, if its tag is\n * registered. Returns `null` for unregistered tags so the caller can fall back\n * to its legacy parser. `base` is the already-extracted id/title/summary/\n * editable; `children` is the stringified prose children.\n */\nexport function parseSpecBlock(\n registry: BlockRegistry,\n node: MdxJsxNode,\n base: ParsedBlockBase,\n children: string,\n idContext: string,\n): { type: string; data: unknown } | null {\n const tag = node.name;\n if (!tag) return null;\n const spec = registry.getByTag(tag);\n if (!spec) return null;\n\n const reader = createAttrReader(node);\n let data: unknown;\n if (spec.mdx.parseChildren) {\n const fromAttrs = spec.mdx.fromAttrs(reader, children);\n const fromChildren = spec.mdx.parseChildren(\n node.children ?? [],\n `${idContext}-${base.id}`,\n );\n data = { ...(fromAttrs as object), ...(fromChildren as object) };\n } else {\n data = spec.mdx.fromAttrs(reader, children);\n }\n return { type: spec.type, data };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mdx.js","sourceRoot":"","sources":["../../../src/client/blocks/mdx.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,KAAc;IAC/C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IACrD,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,UAA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,CAAC;QACN,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import type { BlockSpec, BlockAttrReader, MdxAttrValue } from \"./types.js\";\nimport type { BlockRegistry } from \"./registry.js\";\n\n/**\n * Registry-driven MDX serialize/parse, plus the shared encoder primitives that\n * are the round-trip contract. This module is React-free so the server MDX\n * adapter (`plan-mdx.ts`) and the agent schema export can import it. The encoder\n * + estree literal walker are kept BYTE-FOR-BYTE identical to the originals in\n * `plan-mdx.ts` — `plan-mdx.ts` re-imports them so nothing else there changes\n * and stored `.mdx` files round-trip the same.\n */\n\n/* -------------------------------------------------------------------------- */\n/* Serialize-side encoder primitives (moved verbatim from plan-mdx.ts) */\n/* -------------------------------------------------------------------------- */\n\nexport function jsonExpression(value: unknown): string {\n return JSON.stringify(value, null, 2);\n}\n\nexport function escapeAttr(value: string): string {\n return value\n .replace(/&/g, \"&\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\");\n}\n\n/**\n * Encode a single attribute. Returns \"\" (the attribute is dropped) for\n * undefined/null; a bare/`={false}` flag for booleans; `={n}` for numbers; a\n * quoted string when it matches the safe charset and is short, else a JSON\n * expression. Objects/arrays always serialize as a JSON expression.\n */\nexport function prop(name: string, value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"boolean\") {\n return value ? ` ${name}` : ` ${name}={false}`;\n }\n if (typeof value === \"number\") return ` ${name}={${value}}`;\n if (typeof value === \"string\") {\n if (/^[\\w .:/@#,+()[\\]-]+$/.test(value) && value.length < 140) {\n return ` ${name}=\"${escapeAttr(value)}\"`;\n }\n return ` ${name}={${jsonExpression(value)}}`;\n }\n return ` ${name}={${jsonExpression(value)}}`;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Parse-side attribute resolution (moved verbatim from plan-mdx.ts) */\n/* -------------------------------------------------------------------------- */\n\n/** Minimal MDX AST node shape (subset of the remark-mdx jsx element). */\nexport type MdxAttrNode = {\n type: string;\n name?: string;\n value?: string | null | MdxAttrExpression;\n};\n\ntype MdxAttrExpression = {\n type: string;\n value: string;\n data?: unknown;\n};\n\ntype EstreeTemplateElement = {\n type: string;\n value?: { cooked?: string | null; raw?: string };\n};\n\ntype EstreeNode = {\n type: string;\n value?: unknown;\n name?: string;\n expression?: EstreeNode;\n body?: EstreeNode[];\n elements?: Array<EstreeNode | null>;\n properties?: EstreeNode[];\n key?: EstreeNode;\n computed?: boolean;\n argument?: EstreeNode;\n operator?: string;\n quasis?: EstreeTemplateElement[];\n expressions?: EstreeNode[];\n};\n\nexport type MdxJsxNode = {\n type: string;\n name?: string;\n attributes?: MdxAttrNode[];\n children?: unknown[];\n [key: string]: unknown;\n};\n\nfunction findAttribute(\n node: MdxJsxNode,\n name: string,\n): MdxAttrNode | undefined {\n return node.attributes?.find(\n (attr) => attr.type === \"mdxJsxAttribute\" && attr.name === name,\n );\n}\n\nexport function attributeValue(attr: MdxAttrNode | undefined): unknown {\n if (!attr) return undefined;\n if (attr.value === null || attr.value === undefined) return true;\n if (typeof attr.value === \"string\") return attr.value;\n const astValue = literalExpressionValue(attr.value);\n if (astValue !== undefined) return astValue;\n const expression = attr.value.value.trim();\n if (!expression) return undefined;\n if (expression === \"undefined\") return undefined;\n try {\n return JSON.parse(expression);\n } catch {\n throw new Error(\n `Unsupported MDX attribute expression for \"${attr.name}\": {${expression}}. Use literal values or valid JSON.`,\n );\n }\n}\n\nfunction literalExpressionValue(expression: MdxAttrExpression): unknown {\n const estree = (expression.data as { estree?: EstreeNode } | undefined)\n ?.estree;\n const statement = estree?.body?.[0];\n if (!statement || statement.type !== \"ExpressionStatement\") return undefined;\n return literalNodeValue(statement.expression);\n}\n\nfunction literalNodeValue(node: EstreeNode | undefined | null): unknown {\n if (!node) return undefined;\n if (node.type === \"Literal\") return node.value;\n if (node.type === \"TemplateLiteral\") {\n // A template literal WITH `${…}` interpolations can't be evaluated\n // statically — fail loudly so the import errors instead of falling through\n // to a confusing JSON parse error or silently dropping the attribute.\n if ((node.expressions?.length ?? 0) > 0) {\n throw new Error(\n \"Template literal attribute values may not contain ${…} expressions; use a static string.\",\n );\n }\n // A template literal with no expressions is a static string:\n // `<div>hi</div>` → \"<div>hi</div>\".\n return node.quasis?.[0]?.value?.cooked ?? \"\";\n }\n if (node.type === \"ArrayExpression\") {\n return (node.elements ?? []).map((item) => literalNodeValue(item));\n }\n if (node.type === \"ObjectExpression\") {\n const out: Record<string, unknown> = {};\n for (const property of node.properties ?? []) {\n if (property.type !== \"Property\" || property.computed) return undefined;\n const key = property.key;\n const rawKey =\n key?.type === \"Identifier\"\n ? key.name\n : key?.type === \"Literal\" && typeof key.value === \"string\"\n ? key.value\n : undefined;\n if (!rawKey) return undefined;\n const value = literalNodeValue(property.value as EstreeNode | undefined);\n if (value !== undefined) out[rawKey] = value;\n }\n return out;\n }\n if (node.type === \"UnaryExpression\") {\n const value = literalNodeValue(node.argument);\n if (typeof value !== \"number\") return undefined;\n if (node.operator === \"-\") return -value;\n if (node.operator === \"+\") return value;\n }\n if (node.type === \"Identifier\") {\n if (node.name === \"undefined\") return undefined;\n if (node.name === \"NaN\") return Number.NaN;\n if (node.name === \"Infinity\") return Infinity;\n }\n return undefined;\n}\n\n/** Build a {@link BlockAttrReader} bound to one parsed JSX node. */\nexport function createAttrReader(node: MdxJsxNode): BlockAttrReader {\n const read = (name: string) => attributeValue(findAttribute(node, name));\n return {\n raw: read,\n string(name) {\n const value = read(name);\n return typeof value === \"string\" ? value : undefined;\n },\n number(name) {\n const value = read(name);\n return typeof value === \"number\" ? value : undefined;\n },\n bool(name) {\n const value = read(name);\n return typeof value === \"boolean\" ? value : undefined;\n },\n array(name) {\n const value = read(name);\n return Array.isArray(value) ? (value as never[]) : undefined;\n },\n object(name) {\n const value = read(name);\n return value && typeof value === \"object\" ? (value as never) : undefined;\n },\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* Registry serialize / parse */\n/* -------------------------------------------------------------------------- */\n\n/** The base-attribute + body shape every block carries. */\nexport interface SerializableBlock {\n id: string;\n title?: string;\n summary?: string;\n editable?: boolean;\n data: unknown;\n}\n\n/** Base block attributes parsed from a node, before the type-specific data. */\nexport interface ParsedBlockBase {\n id: string;\n title?: string;\n summary?: string;\n editable?: boolean;\n}\n\n/**\n * Serialize a block to its MDX element using its spec. Byte output MUST match\n * the legacy `serializeBlock` for every converted block: base attrs\n * (`id,title,summary,editable`) first, then the spec's `toAttrs` in insertion\n * order, then either nested children, prose children, or self-closing.\n */\nexport function serializeSpecBlock(\n spec: BlockSpec<any>,\n block: SerializableBlock,\n): string {\n const base =\n prop(\"id\", block.id) +\n prop(\"title\", block.title) +\n prop(\"summary\", block.summary) +\n prop(\"editable\", block.editable);\n\n const attrs = spec.mdx.toAttrs(block.data);\n const childrenField = spec.mdx.childrenField;\n const attrStr = Object.entries(attrs)\n .filter(([key]) => key !== childrenField)\n .map(([key, value]) => prop(key, value as MdxAttrValue | undefined))\n .join(\"\");\n\n const tag = spec.mdx.tag;\n\n // Custom nested-MDX children (e.g. wireframe Screen/kit tree).\n if (spec.mdx.serializeChildren) {\n return `<${tag}${base}${attrStr}>\\n${spec.mdx.serializeChildren(block.data)}\\n</${tag}>`;\n }\n\n // Prose children (rich-text, callout): body is a trimmed markdown string.\n if (childrenField) {\n const body = String(\n (block.data as Record<string, unknown>)[childrenField] ?? \"\",\n ).trim();\n return `<${tag}${base}${attrStr}>\\n\\n${body}\\n\\n</${tag}>`;\n }\n\n // Self-closing structured block.\n return `<${tag}${base}${attrStr} />`;\n}\n\n/**\n * Parse one MDX JSX node into a block via the registry, if its tag is\n * registered. Returns `null` for unregistered tags so the caller can fall back\n * to its legacy parser. `base` is the already-extracted id/title/summary/\n * editable; `children` is the stringified prose children.\n */\nexport function parseSpecBlock(\n registry: BlockRegistry,\n node: MdxJsxNode,\n base: ParsedBlockBase,\n children: string,\n idContext: string,\n): { type: string; data: unknown } | null {\n const tag = node.name;\n if (!tag) return null;\n const spec = registry.getByTag(tag);\n if (!spec) return null;\n\n const reader = createAttrReader(node);\n let data: unknown;\n if (spec.mdx.parseChildren) {\n const fromAttrs = spec.mdx.fromAttrs(reader, children);\n const fromChildren = spec.mdx.parseChildren(\n node.children ?? [],\n `${idContext}-${base.id}`,\n );\n data = { ...(fromAttrs as object), ...(fromChildren as object) };\n } else {\n data = spec.mdx.fromAttrs(reader, children);\n }\n return { type: spec.type, data };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragHandle.d.ts","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/DragHandle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQzC,OAAO,KAAK,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC,2BAA2B,CAAC;AAE7E,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC9B,IAAI,EAAE,UAAU,CAAC;QACjB,IAAI,EAAE,eAAe,CAAC;QACtB,GAAG,EAAE,MAAM,CAAC;KACb,KAAK,OAAO,CAAC;IACd;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,CACxB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE;QACP,IAAI,EAAE,UAAU,CAAC;QACjB,IAAI,EAAE,eAAe,CAAC;QACtB,GAAG,EAAE,MAAM,CAAC;QACZ,UAAU,EAAE,UAAU,CAAC;KACxB,KACE,IAAI,CAAC;IACV;;;;;;OAMG;IACH,UA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