@json-to-office/shared-docx 0.3.0 → 0.6.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.
Files changed (43) hide show
  1. package/dist/{chunk-YNBTESFN.js → chunk-22VYYAC2.js} +4 -8
  2. package/dist/chunk-22VYYAC2.js.map +1 -0
  3. package/dist/{chunk-S4EFGCIC.js → chunk-6SLVQATI.js} +2 -2
  4. package/dist/{chunk-EDYWA2KA.js → chunk-ABVYMFDA.js} +2 -2
  5. package/dist/{chunk-F5LVWDTY.js → chunk-JOXJOD2C.js} +6 -1
  6. package/dist/chunk-JOXJOD2C.js.map +1 -0
  7. package/dist/{chunk-DEIEJUY4.js → chunk-L5TZFC47.js} +16 -10
  8. package/dist/chunk-L5TZFC47.js.map +1 -0
  9. package/dist/{chunk-GGNGVIZO.js → chunk-OE5JFL7S.js} +5 -17
  10. package/dist/chunk-OE5JFL7S.js.map +1 -0
  11. package/dist/{chunk-3D6HY6AC.js → chunk-PN6JT3KF.js} +236 -284
  12. package/dist/chunk-PN6JT3KF.js.map +1 -0
  13. package/dist/{chunk-WJA5TGNI.js → chunk-SK6LSPFN.js} +2 -2
  14. package/dist/{chunk-AMVS7BRX.js → chunk-V4L4S6ZS.js} +2 -10
  15. package/dist/{chunk-AMVS7BRX.js.map → chunk-V4L4S6ZS.js.map} +1 -1
  16. package/dist/{chunk-CVI7GFWX.js → chunk-YQECZGRR.js} +2 -2
  17. package/dist/chunk-YQECZGRR.js.map +1 -0
  18. package/dist/index.d.ts +14 -62
  19. package/dist/index.js +10 -30
  20. package/dist/index.js.map +1 -1
  21. package/dist/schemas/api.js +4 -4
  22. package/dist/schemas/component-registry.js +2 -2
  23. package/dist/schemas/components.d.ts +21 -48
  24. package/dist/schemas/components.js +3 -7
  25. package/dist/schemas/document.js +5 -5
  26. package/dist/schemas/export.js +3 -3
  27. package/dist/schemas/font.d.ts +3 -1
  28. package/dist/schemas/font.js +3 -1
  29. package/dist/schemas/generator.js +3 -3
  30. package/dist/schemas/theme.d.ts +24 -24
  31. package/dist/schemas/theme.js +4 -4
  32. package/dist/validation/unified/index.d.ts +14 -35
  33. package/dist/validation/unified/index.js +6 -10
  34. package/package.json +1 -1
  35. package/dist/chunk-3D6HY6AC.js.map +0 -1
  36. package/dist/chunk-CVI7GFWX.js.map +0 -1
  37. package/dist/chunk-DEIEJUY4.js.map +0 -1
  38. package/dist/chunk-F5LVWDTY.js.map +0 -1
  39. package/dist/chunk-GGNGVIZO.js.map +0 -1
  40. package/dist/chunk-YNBTESFN.js.map +0 -1
  41. /package/dist/{chunk-S4EFGCIC.js.map → chunk-6SLVQATI.js.map} +0 -0
  42. /package/dist/{chunk-EDYWA2KA.js.map → chunk-ABVYMFDA.js.map} +0 -0
  43. /package/dist/{chunk-WJA5TGNI.js.map → chunk-SK6LSPFN.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schemas/component-registry.ts","../src/schemas/components/report.ts","../src/schemas/components/section.ts","../src/schemas/components/common.ts","../src/schemas/components/columns.ts","../src/schemas/components/heading.ts","../src/schemas/components/paragraph.ts","../src/schemas/components/text-box.ts","../src/schemas/components/image.ts","../src/schemas/components/statistic.ts","../src/schemas/components/table.ts","../src/schemas/components/header.ts","../src/schemas/components/footer.ts","../src/schemas/components/list.ts","../src/schemas/components/toc.ts","../src/schemas/components/highcharts.ts"],"sourcesContent":["/**\n * Component Registry - SINGLE SOURCE OF TRUTH\n *\n * This is the ONLY place where standard components are defined.\n * All schema generators MUST use this registry.\n *\n * Adding a new component: Add it to STANDARD_COMPONENTS_REGISTRY below.\n * It will automatically be included in:\n * - StandardComponentDefinitionSchema (components.ts)\n * - ComponentDefinitionSchema (components.ts)\n * - generateUnifiedDocumentSchema (generator.ts)\n * - Monaco editor autocomplete\n * - Build-time JSON schemas\n */\n\nimport { Type, TSchema } from '@sinclair/typebox';\n// Import directly from individual component files to avoid circular dependency\n// (components.ts imports from this file, so we can't import from components.ts)\nimport { ReportPropsSchema } from './components/report';\nimport {\n SectionPropsSchema,\n createSectionPropsSchema,\n} from './components/section';\nimport { ColumnsPropsSchema } from './components/columns';\nimport { HeadingPropsSchema } from './components/heading';\nimport { ParagraphPropsSchema } from './components/paragraph';\nimport { TextBoxPropsSchema } from './components/text-box';\nimport { ImagePropsSchema } from './components/image';\nimport { StatisticPropsSchema } from './components/statistic';\nimport { TablePropsSchema, createTablePropsSchema } from './components/table';\nimport { HeaderPropsSchema } from './components/header';\nimport { FooterPropsSchema } from './components/footer';\nimport { ListPropsSchema } from './components/list';\nimport { TocPropsSchema } from './components/toc';\nimport { HighchartsPropsSchema } from './components/highcharts';\n\n/**\n * Component definition with metadata\n */\nexport interface StandardComponentDefinition {\n /** Component name identifier (e.g., 'heading', 'text', 'toc') */\n name: string;\n /** TypeBox schema for the component's props */\n propsSchema: TSchema;\n /** Whether this component can contain children */\n hasChildren: boolean;\n /**\n * Names of standard components allowed as direct children.\n * Only meaningful when hasChildren is true.\n * Plugin components are always allowed in addition to these.\n * Omit to allow the full recursive union (backward-compat).\n */\n allowedChildren?: readonly string[];\n /**\n * Factory that builds props with a live recursive ref (e.g., for section\n * header/footer, table cell content). When present and a recursive ref is\n * available, used instead of the static `propsSchema`.\n */\n createPropsSchema?: (recursiveRef: TSchema) => TSchema;\n /** Component category for organization */\n category: 'container' | 'content' | 'layout';\n /** Human-readable description */\n description: string;\n /** Special flags for this component */\n special?: {\n /** Has $schema field (only 'docx') */\n hasSchemaField?: boolean;\n };\n}\n\n/**\n * SINGLE SOURCE OF TRUTH for all standard components\n *\n * This is the ONLY place where standard components are defined.\n * All schema generators MUST use this registry.\n *\n * IMPORTANT: When adding a new component:\n * 1. Add the component definition to this array\n * 2. Import its props schema at the top of this file\n * 3. That's it! The component will automatically appear everywhere.\n */\nexport const STANDARD_COMPONENTS_REGISTRY: readonly StandardComponentDefinition[] =\n [\n // ========================================================================\n // Container Components (can contain children)\n // ========================================================================\n {\n name: 'docx',\n propsSchema: ReportPropsSchema,\n hasChildren: true,\n allowedChildren: ['section'],\n category: 'container',\n description:\n 'Main document container - defines the overall document structure. Required as the root component.',\n special: {\n hasSchemaField: true, // Only docx root has $schema field\n },\n },\n {\n name: 'section',\n propsSchema: SectionPropsSchema,\n createPropsSchema: createSectionPropsSchema,\n hasChildren: true,\n allowedChildren: [\n 'heading',\n 'paragraph',\n 'image',\n 'statistic',\n 'table',\n 'list',\n 'toc',\n 'highcharts',\n 'columns',\n 'text-box',\n ],\n category: 'container',\n description:\n 'Section container - groups related content with optional title. Use for organizing document structure.',\n },\n {\n name: 'columns',\n propsSchema: ColumnsPropsSchema,\n hasChildren: true,\n allowedChildren: [\n 'heading',\n 'paragraph',\n 'image',\n 'statistic',\n 'table',\n 'list',\n 'toc',\n 'highcharts',\n 'text-box',\n ],\n category: 'layout',\n description:\n 'Multi-column layout - arranges content in 2-4 columns. Great for side-by-side content.',\n },\n {\n name: 'text-box',\n propsSchema: TextBoxPropsSchema,\n hasChildren: true,\n allowedChildren: ['heading', 'paragraph', 'image'],\n category: 'layout',\n description:\n 'Floating text container - allows positioning text anywhere on the page with absolute or relative positioning.',\n },\n\n // ========================================================================\n // Content Components (leaf nodes, no children)\n // ========================================================================\n {\n name: 'heading',\n propsSchema: HeadingPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Heading text - supports levels 1-6 for document hierarchy. Level 1 is largest.',\n },\n {\n name: 'paragraph',\n propsSchema: ParagraphPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Paragraph text - supports formatting like bold, italic, and color. Main content element.',\n },\n {\n name: 'image',\n propsSchema: ImagePropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Image element - displays images with optional caption. Supports various formats.',\n },\n {\n name: 'statistic',\n propsSchema: StatisticPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Statistic display - shows a number with description. Perfect for KPIs and metrics.',\n },\n {\n name: 'table',\n propsSchema: TablePropsSchema,\n createPropsSchema: createTablePropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Data table - displays tabular data with headers. Supports formatting and alignment.',\n },\n {\n name: 'header',\n propsSchema: HeaderPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Page header - appears at the top of pages. Can include text and page numbers.',\n },\n {\n name: 'footer',\n propsSchema: FooterPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Page footer - appears at the bottom of pages. Can include text and page numbers.',\n },\n {\n name: 'list',\n propsSchema: ListPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'List element - bulleted or numbered list items. Supports nested lists.',\n },\n {\n name: 'toc',\n propsSchema: TocPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles.',\n },\n {\n name: 'highcharts',\n propsSchema: HighchartsPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options.',\n },\n ] as const;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Get a component definition by name\n */\nexport function getStandardComponent(\n name: string\n): StandardComponentDefinition | undefined {\n return STANDARD_COMPONENTS_REGISTRY.find((c) => c.name === name);\n}\n\n/**\n * Get all standard component names\n */\nexport function getAllStandardComponentNames(): readonly string[] {\n return STANDARD_COMPONENTS_REGISTRY.map((c) => c.name);\n}\n\n/**\n * Get components by category\n */\nexport function getComponentsByCategory(\n category: StandardComponentDefinition['category']\n): readonly StandardComponentDefinition[] {\n return STANDARD_COMPONENTS_REGISTRY.filter((c) => c.category === category);\n}\n\n/**\n * Get container components (components that can have children)\n */\nexport function getContainerComponents(): readonly StandardComponentDefinition[] {\n return STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n}\n\n/**\n * Get content components (components that cannot have children)\n */\nexport function getContentComponents(): readonly StandardComponentDefinition[] {\n return STANDARD_COMPONENTS_REGISTRY.filter((c) => !c.hasChildren);\n}\n\n/**\n * Check if a component name is a standard component\n */\nexport function isStandardComponent(name: string): boolean {\n return STANDARD_COMPONENTS_REGISTRY.some((c) => c.name === name);\n}\n\n// ============================================================================\n// Schema Generation Helpers\n// ============================================================================\n\n/**\n * Generate TypeBox schema object for a component.\n *\n * @param component - Component definition from the registry\n * @param childrenType - Schema for children items. For containers this should be\n * a narrowed union of allowed children; for leaves omit it.\n * @returns TypeBox schema object for the component\n */\nexport function createComponentSchemaObject(\n component: StandardComponentDefinition,\n childrenType?: TSchema,\n selfRef?: TSchema\n): TSchema {\n const schema: Record<string, TSchema> = {\n name: Type.Literal(component.name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(\n Type.Boolean({\n default: true,\n description:\n 'When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion.',\n })\n ),\n };\n\n // Special handling for report component (has $schema field)\n if (component.special?.hasSchemaField) {\n schema.$schema = Type.Optional(Type.String({ format: 'uri' }));\n }\n\n // selfRef (full union) is intentionally passed to createPropsSchema so that\n // header/footer sub-schemas and table cell content can reference any component.\n schema.props =\n component.createPropsSchema && selfRef\n ? component.createPropsSchema(selfRef)\n : component.propsSchema;\n\n // Add children support if applicable\n if (component.hasChildren && childrenType) {\n schema.children = Type.Optional(Type.Array(childrenType));\n }\n\n return Type.Object(schema, { additionalProperties: false });\n}\n\n/**\n * Generate an array of TypeBox schemas for all standard components.\n * Uses a flat recursive ref for all containers (legacy behavior).\n *\n * @param recursiveRef - Optional recursive reference for children\n * @returns Array of TypeBox schemas for all components in the registry\n */\nexport function createAllComponentSchemas(\n recursiveRef?: TSchema\n): readonly TSchema[] {\n return STANDARD_COMPONENTS_REGISTRY.map((component) =>\n createComponentSchemaObject(component, recursiveRef)\n );\n}\n\n/**\n * Build all standard component schemas with per-container narrowed children.\n *\n * Resolves containers in dependency order so each container's children union\n * only references its allowedChildren. Plugin schemas are always included in\n * every container's children.\n *\n * @param selfRef - The Type.Recursive self-reference (used as fallback and for plugin children)\n * @param pluginSchemas - Plugin component schemas (always allowed in all containers)\n * @returns schemas array and a byName map for direct lookups\n */\nexport function createAllComponentSchemasNarrowed(\n selfRef: TSchema,\n pluginSchemas: TSchema[] = []\n): { schemas: TSchema[]; byName: Map<string, TSchema> } {\n // Phase 1: Build leaf (non-container) component schemas — no children\n // selfRef is passed so factories (e.g. table) can wire up recursive refs.\n const leafSchemas = new Map<string, TSchema>();\n for (const comp of STANDARD_COMPONENTS_REGISTRY) {\n if (!comp.hasChildren) {\n leafSchemas.set(\n comp.name,\n createComponentSchemaObject(comp, undefined, selfRef)\n );\n }\n }\n\n // Phase 2: Resolve containers in dependency order\n const containers = STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n const resolved = new Map<string, TSchema>();\n const pending = [...containers];\n\n while (pending.length > 0) {\n const before = pending.length;\n for (let i = pending.length - 1; i >= 0; i--) {\n const comp = pending[i];\n\n if (!comp.allowedChildren) {\n // No allowedChildren declared — fallback to full recursive ref\n resolved.set(\n comp.name,\n createComponentSchemaObject(comp, selfRef, selfRef)\n );\n pending.splice(i, 1);\n continue;\n }\n\n // Check if all container dependencies are resolved\n const containerDeps = comp.allowedChildren.filter((name) =>\n containers.some((c) => c.name === name)\n );\n if (!containerDeps.every((d) => resolved.has(d))) continue;\n\n // Build narrowed children union\n const childSchemas = comp.allowedChildren\n .map((name) => resolved.get(name) ?? leafSchemas.get(name))\n .filter((s): s is TSchema => s !== undefined);\n\n const allChildSchemas = [...childSchemas, ...pluginSchemas];\n const childrenType =\n allChildSchemas.length === 1\n ? allChildSchemas[0]\n : Type.Union(allChildSchemas);\n\n resolved.set(\n comp.name,\n createComponentSchemaObject(comp, childrenType, selfRef)\n );\n pending.splice(i, 1);\n }\n\n if (pending.length === before) {\n throw new Error(\n `Circular allowedChildren among: ${pending.map((c) => c.name).join(', ')}`\n );\n }\n }\n\n // Combine: containers (resolved) + leaves\n const byName = new Map([...resolved, ...leafSchemas]);\n return { schemas: [...byName.values()], byName };\n}\n","/**\n * Report Component Schema\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\n\n// Create a function to generate ReportPropsSchema with recursive component reference\nexport const createReportPropsSchema = (_moduleRef?: TSchema) =>\n Type.Object(\n {\n theme: Type.Optional(\n Type.String({\n description: 'Theme name to apply (default: \"minimal\")',\n examples: ['minimal', 'corporate', 'modern'],\n default: 'minimal',\n })\n ),\n metadata: Type.Optional(\n Type.Object(\n {\n title: Type.Optional(\n Type.String({\n description: 'Document title',\n examples: ['Annual Report 2024', 'Technical Documentation'],\n })\n ),\n subtitle: Type.Optional(\n Type.String({\n description: 'Document subtitle',\n })\n ),\n description: Type.Optional(Type.String()),\n author: Type.Optional(Type.String()),\n company: Type.Optional(Type.String()),\n date: Type.Optional(Type.String()),\n created: Type.Optional(Type.String({ format: 'date-time' })),\n modified: Type.Optional(Type.String({ format: 'date-time' })),\n version: Type.Optional(Type.String()),\n tags: Type.Optional(Type.Array(Type.String())),\n },\n {\n description:\n 'Document metadata (title, author, company, dates, etc.)',\n additionalProperties: false,\n }\n )\n ),\n },\n {\n description: 'Report component props',\n additionalProperties: false,\n }\n );\n\nexport const ReportPropsSchema = createReportPropsSchema();\n\nexport type ReportProps = Static<typeof ReportPropsSchema>;\n","/**\n * Section Component Schema\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\nimport { SpacingSchema } from './common';\n\n// Create a function to generate SectionPropsSchema with recursive component reference\nexport const createSectionPropsSchema = (moduleRef?: TSchema) =>\n Type.Object(\n {\n title: Type.Optional(\n Type.String({\n description: 'Section title (optional)',\n })\n ),\n level: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 9,\n description: 'Heading level for section title (1-9)',\n default: 1,\n })\n ),\n header: Type.Optional(\n Type.Union([\n Type.Array(moduleRef || Type.Any(), {\n description: 'Section header modules',\n }),\n Type.Literal('linkToPrevious', {\n description: 'Link header to previous section',\n }),\n ])\n ),\n footer: Type.Optional(\n Type.Union([\n Type.Array(moduleRef || Type.Any(), {\n description: 'Section footer modules',\n }),\n Type.Literal('linkToPrevious', {\n description: 'Link footer to previous section',\n }),\n ])\n ),\n pageBreak: Type.Optional(\n Type.Boolean({\n description: 'Insert page break before section',\n default: true,\n })\n ),\n spacing: Type.Optional(SpacingSchema),\n page: Type.Optional(\n Type.Object(\n {\n size: Type.Optional(\n Type.Union([\n Type.Literal('A4'),\n Type.Literal('A3'),\n Type.Literal('LETTER'),\n Type.Literal('LEGAL'),\n Type.Object({\n width: Type.Number({ minimum: 0 }),\n height: Type.Number({ minimum: 0 }),\n }),\n ])\n ),\n margins: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(Type.Number({ minimum: 0 })),\n bottom: Type.Optional(Type.Number({ minimum: 0 })),\n left: Type.Optional(Type.Number({ minimum: 0 })),\n right: Type.Optional(Type.Number({ minimum: 0 })),\n header: Type.Optional(Type.Number({ minimum: 0 })),\n footer: Type.Optional(Type.Number({ minimum: 0 })),\n gutter: Type.Optional(Type.Number({ minimum: 0 })),\n },\n {\n additionalProperties: false,\n }\n )\n ),\n },\n {\n description:\n 'Page configuration override for this section (overrides theme page settings)',\n additionalProperties: false,\n }\n )\n ),\n },\n {\n description: 'Section component props',\n additionalProperties: false,\n }\n );\n\nexport const SectionPropsSchema = createSectionPropsSchema();\n\nexport type SectionProps = Static<typeof SectionPropsSchema>;\n","/**\n * Common Types and Schemas for Components\n *\n * Shared type definitions used across multiple component schemas.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { HexColorSchema } from '../font';\n\n// ============================================================================\n// Common Types\n// ============================================================================\n\nexport const AlignmentSchema = Type.Union(\n [Type.Literal('left'), Type.Literal('center'), Type.Literal('right')],\n { description: 'Text alignment options' }\n);\n\nexport const JustifiedAlignmentSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('justify'),\n ],\n { description: 'Text alignment options including justify' }\n);\n\nexport const HeadingLevelSchema = Type.Union(\n [\n Type.Literal(1),\n Type.Literal(2),\n Type.Literal(3),\n Type.Literal(4),\n Type.Literal(5),\n Type.Literal(6),\n ],\n { description: 'Heading level (1-6)' }\n);\n\nexport const SpacingSchema = Type.Object(\n {\n before: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing before element in points',\n })\n ),\n after: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing after element in points',\n })\n ),\n },\n {\n description: 'Spacing configuration',\n additionalProperties: false,\n }\n);\n\nexport const ListSpacingSchema = Type.Object(\n {\n before: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing before list in points',\n })\n ),\n after: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing after list in points',\n })\n ),\n item: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing between list items in points',\n })\n ),\n },\n {\n description: 'List spacing configuration with item spacing',\n additionalProperties: false,\n }\n);\n\nexport const MarginsSchema = Type.Object(\n {\n top: Type.Optional(Type.Number({ minimum: 0 })),\n bottom: Type.Optional(Type.Number({ minimum: 0 })),\n left: Type.Optional(Type.Number({ minimum: 0 })),\n right: Type.Optional(Type.Number({ minimum: 0 })),\n },\n { description: 'Margin configuration' }\n);\n\nexport const BorderSchema = Type.Object(\n {\n style: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dashed'),\n Type.Literal('dotted'),\n Type.Literal('double'),\n Type.Literal('none'),\n ])\n ),\n width: Type.Optional(Type.Number({ minimum: 0 })),\n color: Type.Optional(HexColorSchema),\n },\n { description: 'Border configuration' }\n);\n\nexport const LineSpacingSchema = Type.Object(\n {\n type: Type.Union([\n Type.Literal('single'),\n Type.Literal('atLeast'),\n Type.Literal('exactly'),\n Type.Literal('double'),\n Type.Literal('multiple'),\n ]),\n value: Type.Optional(Type.Number({ minimum: 0 })),\n },\n { description: 'Line spacing configuration' }\n);\n\nexport const IndentSchema = Type.Object(\n {\n left: Type.Optional(Type.Number({ minimum: 0 })),\n hanging: Type.Optional(Type.Number({ minimum: 0 })),\n },\n { description: 'Indentation configuration' }\n);\n\n// ============================================================================\n// Floating Positioning Schemas (shared between image, text-box components)\n// ============================================================================\n\nexport const HorizontalPositionRelativeFromSchema = Type.Union(\n [\n Type.Literal('character'),\n Type.Literal('column'),\n Type.Literal('margin'),\n Type.Literal('page'),\n Type.Literal('text'), // VML compatibility for text-box\n ],\n {\n description: 'Horizontal position relative to',\n }\n);\n\nexport const VerticalPositionRelativeFromSchema = Type.Union(\n [\n Type.Literal('margin'),\n Type.Literal('page'),\n Type.Literal('paragraph'),\n Type.Literal('line'),\n Type.Literal('text'), // VML compatibility for text-box\n ],\n {\n description: 'Vertical position relative to',\n }\n);\n\nexport const HorizontalPositionAlignSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('inside'),\n Type.Literal('outside'),\n ],\n {\n description: 'Horizontal alignment',\n }\n);\n\nexport const VerticalPositionAlignSchema = Type.Union(\n [\n Type.Literal('top'),\n Type.Literal('center'),\n Type.Literal('bottom'),\n Type.Literal('inside'),\n Type.Literal('outside'),\n ],\n {\n description: 'Vertical alignment',\n }\n);\n\nexport const TextWrappingTypeSchema = Type.Union(\n [\n Type.Literal('none'),\n Type.Literal('square'),\n Type.Literal('topAndBottom'),\n Type.Literal('around'), // VML compatibility for text-box\n Type.Literal('tight'), // VML compatibility for text-box\n Type.Literal('through'), // VML compatibility for text-box\n ],\n {\n description: 'Text wrapping type',\n }\n);\n\nexport const TextWrappingSideSchema = Type.Union(\n [\n Type.Literal('bothSides'),\n Type.Literal('left'),\n Type.Literal('right'),\n Type.Literal('largest'),\n ],\n {\n description: 'Text wrapping side',\n }\n);\n\nexport const FloatingPropertiesSchema = Type.Object(\n {\n horizontalPosition: Type.Optional(\n Type.Object(\n {\n relative: Type.Optional(HorizontalPositionRelativeFromSchema),\n align: Type.Optional(HorizontalPositionAlignSchema),\n offset: Type.Optional(\n Type.Number({\n description: 'Horizontal offset in twips (1/20 of a point)',\n })\n ),\n },\n {\n description:\n 'Horizontal positioning (use either align or offset, not both)',\n }\n )\n ),\n verticalPosition: Type.Optional(\n Type.Object(\n {\n relative: Type.Optional(VerticalPositionRelativeFromSchema),\n align: Type.Optional(VerticalPositionAlignSchema),\n offset: Type.Optional(\n Type.Number({\n description: 'Vertical offset in twips (1/20 of a point)',\n })\n ),\n },\n {\n description:\n 'Vertical positioning (use either align or offset, not both)',\n }\n )\n ),\n wrap: Type.Optional(\n Type.Object(\n {\n type: TextWrappingTypeSchema,\n side: Type.Optional(TextWrappingSideSchema),\n margins: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(\n Type.Number({ description: 'Top margin in twips' })\n ),\n bottom: Type.Optional(\n Type.Number({ description: 'Bottom margin in twips' })\n ),\n left: Type.Optional(\n Type.Number({ description: 'Left margin in twips' })\n ),\n right: Type.Optional(\n Type.Number({ description: 'Right margin in twips' })\n ),\n },\n {\n description: 'Distance from text margins',\n }\n )\n ),\n },\n {\n description: 'Text wrapping configuration',\n }\n )\n ),\n allowOverlap: Type.Optional(\n Type.Boolean({\n description: 'Allow element to overlap with other elements',\n })\n ),\n behindDocument: Type.Optional(\n Type.Boolean({\n description: 'Place element behind document text',\n })\n ),\n lockAnchor: Type.Optional(\n Type.Boolean({\n description: 'Lock the anchor position',\n })\n ),\n layoutInCell: Type.Optional(\n Type.Boolean({\n description: 'Layout element within table cell',\n })\n ),\n zIndex: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Z-order for overlapping elements (must be non-negative)',\n })\n ),\n rotation: Type.Optional(\n Type.Number({\n description: 'Rotation angle in degrees',\n })\n ),\n visibility: Type.Optional(\n Type.Union([Type.Literal('hidden'), Type.Literal('inherit')], {\n description: 'Visibility of the floating element',\n })\n ),\n },\n {\n description: 'Floating element properties',\n }\n);\n\nexport type HorizontalPositionRelativeFrom = Static<\n typeof HorizontalPositionRelativeFromSchema\n>;\nexport type VerticalPositionRelativeFrom = Static<\n typeof VerticalPositionRelativeFromSchema\n>;\nexport type HorizontalPositionAlign = Static<\n typeof HorizontalPositionAlignSchema\n>;\nexport type VerticalPositionAlign = Static<typeof VerticalPositionAlignSchema>;\nexport type TextWrappingType = Static<typeof TextWrappingTypeSchema>;\nexport type TextWrappingSide = Static<typeof TextWrappingSideSchema>;\nexport type FloatingProperties = Static<typeof FloatingPropertiesSchema>;\n\nexport const NumberingSchema = Type.Object(\n {\n start: Type.Optional(Type.Number({ minimum: 1 })),\n style: Type.Optional(\n Type.Union([\n Type.Literal('decimal'),\n Type.Literal('lowerLetter'),\n Type.Literal('upperLetter'),\n Type.Literal('lowerRoman'),\n Type.Literal('upperRoman'),\n ])\n ),\n separator: Type.Optional(Type.String()),\n },\n { description: 'Numbering configuration for lists' }\n);\n\n// ============================================================================\n// Base Component Props (common fields across all components)\n// ============================================================================\n// Note: BaseComponentFields is currently empty as common properties\n// (className, style, hidden, condition) are not implemented in the rendering engine.\n// These were removed to accurately reflect actual capabilities.\n\nconst BaseComponentFields = {};\n\n// Export BaseComponentPropsSchema\nexport const BaseComponentPropsSchema = Type.Object(BaseComponentFields, {\n description: 'Base component props',\n additionalProperties: true,\n});\n\n// Export BaseComponentFields for use in component definitions\nexport { BaseComponentFields };\n\n// ============================================================================\n// TypeScript Types\n// ============================================================================\n\nexport type Alignment = Static<typeof AlignmentSchema>;\nexport type JustifiedAlignment = Static<typeof JustifiedAlignmentSchema>;\nexport type HeadingLevel = Static<typeof HeadingLevelSchema>;\nexport type Spacing = Static<typeof SpacingSchema>;\nexport type ListSpacing = Static<typeof ListSpacingSchema>;\nexport type LineSpacing = Static<typeof LineSpacingSchema>;\nexport type Indent = Static<typeof IndentSchema>;\nexport type Numbering = Static<typeof NumberingSchema>;\nexport type Margins = Static<typeof MarginsSchema>;\nexport type Border = Static<typeof BorderSchema>;\nexport type BaseComponentProps = Static<typeof BaseComponentPropsSchema>;\n","/**\n * Columns Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\n\n// Single column descriptor\nconst ColumnDescriptorSchema = Type.Object(\n {\n width: Type.Optional(\n Type.Union([\n Type.Number({\n minimum: 1,\n description: 'Column width in points',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Column width as percentage of available width (e.g., \"30%\")',\n }),\n Type.Literal('auto', {\n description:\n 'Auto width: consume remaining space after fixed widths and gaps',\n }),\n ])\n ),\n gap: Type.Optional(\n Type.Union([\n Type.Number({\n minimum: 0,\n description: 'Gap after this column in points',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Gap after this column as percentage of available width (e.g., \"5%\")',\n }),\n ])\n ),\n },\n { additionalProperties: false }\n);\n\nexport const ColumnsPropsSchema = Type.Object(\n {\n columns: Type.Union([\n Type.Number({\n minimum: 1,\n description:\n 'Number of equal-width columns (converter will normalize to array)',\n }),\n Type.Array(ColumnDescriptorSchema, {\n minItems: 1,\n description:\n 'List of columns in order; width and gap can be points, percentages, or auto width',\n }),\n ]),\n gap: Type.Optional(\n Type.Union([\n Type.Number({\n minimum: 0,\n description:\n 'Default gap applied after each column except the last (points)',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Default gap applied after each column except the last as percentage of available width (e.g., \"5%\")',\n }),\n ])\n ),\n },\n {\n description: 'Columns component props',\n additionalProperties: false,\n }\n);\n\nexport type ColumnsProps = Static<typeof ColumnsPropsSchema>;\n","/**\n * Heading Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FontDefinitionSchema } from '../font';\nimport {\n HeadingLevelSchema,\n JustifiedAlignmentSchema,\n SpacingSchema,\n LineSpacingSchema,\n} from './common';\n\nexport const HeadingPropsSchema = Type.Object(\n {\n text: Type.String({\n description: 'Heading text (required)',\n }),\n level: Type.Optional(HeadingLevelSchema),\n // Local font override: allows customizing family/size/color/bold/italic/underline\n // without modifying theme styles. Supports partial overrides.\n font: Type.Optional(Type.Partial(FontDefinitionSchema)),\n alignment: Type.Optional(JustifiedAlignmentSchema),\n spacing: Type.Optional(SpacingSchema),\n lineSpacing: Type.Optional(\n Type.Union([Type.Number({ minimum: 0 }), LineSpacingSchema])\n ),\n pageBreak: Type.Optional(\n Type.Boolean({\n description: 'Insert page break before heading',\n })\n ),\n columnBreak: Type.Optional(\n Type.Boolean({\n description: 'Insert column break before heading',\n })\n ),\n numbering: Type.Optional(\n Type.Boolean({\n description: 'Include in numbering',\n })\n ),\n keepNext: Type.Optional(\n Type.Boolean({\n description: 'Keep heading with next paragraph on same page',\n })\n ),\n keepLines: Type.Optional(\n Type.Boolean({\n description: 'Keep all lines of heading together on same page',\n })\n ),\n },\n {\n description: 'Heading component props',\n additionalProperties: false,\n }\n);\n\nexport type HeadingProps = Static<typeof HeadingPropsSchema>;\n","/**\n * Paragraph Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { SpacingSchema } from './common';\nimport { FontDefinitionSchema } from '../font';\n\n// Frame wrapping type schema\nconst FrameWrapTypeSchema = Type.Union(\n [\n Type.Literal('around'),\n Type.Literal('none'),\n Type.Literal('notBeside'),\n Type.Literal('through'),\n Type.Literal('tight'),\n Type.Literal('auto'),\n ],\n {\n description: 'Frame text wrapping type',\n }\n);\n\n// Frame anchor type schema\nconst FrameAnchorTypeSchema = Type.Union(\n [Type.Literal('margin'), Type.Literal('page'), Type.Literal('text')],\n {\n description: 'Frame anchor type',\n }\n);\n\n// Frame horizontal position alignment schema\nconst FrameHorizontalAlignSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('inside'),\n Type.Literal('outside'),\n ],\n {\n description: 'Frame horizontal alignment',\n }\n);\n\n// Frame vertical position alignment schema\nconst FrameVerticalAlignSchema = Type.Union(\n [\n Type.Literal('top'),\n Type.Literal('center'),\n Type.Literal('bottom'),\n Type.Literal('inside'),\n Type.Literal('outside'),\n ],\n {\n description: 'Frame vertical alignment',\n }\n);\n\n// Floating frame properties schema\nconst FloatingFramePropertiesSchema = Type.Object(\n {\n horizontalPosition: Type.Optional(\n Type.Object(\n {\n relative: Type.Optional(FrameAnchorTypeSchema),\n align: Type.Optional(FrameHorizontalAlignSchema),\n offset: Type.Optional(\n Type.Number({\n description: 'Horizontal offset in twips (1/20 of a point)',\n })\n ),\n },\n {\n description:\n 'Horizontal positioning (use either align or offset, not both)',\n }\n )\n ),\n verticalPosition: Type.Optional(\n Type.Object(\n {\n relative: Type.Optional(FrameAnchorTypeSchema),\n align: Type.Optional(FrameVerticalAlignSchema),\n offset: Type.Optional(\n Type.Number({\n description: 'Vertical offset in twips (1/20 of a point)',\n })\n ),\n },\n {\n description:\n 'Vertical positioning (use either align or offset, not both)',\n }\n )\n ),\n wrap: Type.Optional(\n Type.Object(\n {\n type: FrameWrapTypeSchema,\n },\n {\n description: 'Text wrapping configuration',\n }\n )\n ),\n lockAnchor: Type.Optional(\n Type.Boolean({\n description: 'Lock the anchor position',\n })\n ),\n width: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Frame width in twips (DXA units)',\n })\n ),\n height: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Frame height in twips (DXA units)',\n })\n ),\n },\n {\n description: 'Floating text frame properties',\n }\n);\n\n// Alignment type schema (paragraph-level, not font-level)\nconst AlignmentSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('justify'),\n ],\n {\n description: 'Paragraph text alignment',\n }\n);\n\nexport const ParagraphPropsSchema = Type.Object(\n {\n text: Type.String({\n description: 'Text content (required)',\n }),\n // New nested font object, aligned with theme's FontDefinitionSchema\n // Allow partial overrides (family not required when overriding a subset)\n font: Type.Optional(Type.Partial(FontDefinitionSchema)),\n // Optional reference to a named style from theme.styles (e.g., 'heading1', 'normal')\n themeStyle: Type.Optional(Type.String()),\n // Rich-text decoration color for bold segments (kept as top-level behavior option)\n boldColor: Type.Optional(Type.String()),\n // Paragraph spacing (in points) — limited paragraph-level option allowed\n spacing: Type.Optional(SpacingSchema),\n // Paragraph alignment (moved from font to config level)\n alignment: Type.Optional(AlignmentSchema),\n pageBreak: Type.Optional(\n Type.Boolean({\n description: 'Insert page break before paragraph',\n })\n ),\n columnBreak: Type.Optional(\n Type.Boolean({\n description: 'Insert column break before paragraph',\n })\n ),\n floating: Type.Optional(FloatingFramePropertiesSchema),\n keepNext: Type.Optional(\n Type.Boolean({\n description: 'Keep paragraph with next paragraph on same page',\n })\n ),\n keepLines: Type.Optional(\n Type.Boolean({\n description: 'Keep all lines of paragraph together on same page',\n })\n ),\n id: Type.Optional(\n Type.String({\n description: 'Unique identifier for internal linking (bookmark anchor)',\n })\n ),\n },\n {\n description:\n 'Paragraph component props (font nested for theme consistency; no flat font properties)',\n additionalProperties: false,\n }\n);\n\nexport type ParagraphProps = Static<typeof ParagraphPropsSchema>;\n","/**\n * Text Box Component Schema\n * A floating container that can hold child components (e.g., text, image, columns)\n *\n * Positioning API mirrors existing floating options from text/image for consistency.\n *\n * **Nested Columns Support:**\n * When a `columns` component is nested inside a `text-box`, it automatically renders\n * as a multi-column table instead of a section-level column layout. This allows\n * for columnar content within floating or inline containers.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FloatingPropertiesSchema } from './common';\nimport { HexColorSchema } from '../font';\n\nexport const TextBoxPropsSchema = Type.Object(\n {\n width: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Text box width in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Text box width as percentage (e.g., \"50%\") relative to content width',\n }),\n ],\n {\n description:\n 'Text box width in pixels (number) or as percentage string (e.g., \"50%\")',\n }\n )\n ),\n height: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Text box height in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Text box height as percentage (e.g., \"50%\") relative to content height',\n }),\n ],\n {\n description:\n 'Text box height in pixels (number) or as percentage string (e.g., \"50%\")',\n }\n )\n ),\n floating: Type.Optional(FloatingPropertiesSchema),\n style: Type.Optional(\n Type.Object(\n {\n padding: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(Type.Number({ minimum: 0 })),\n right: Type.Optional(Type.Number({ minimum: 0 })),\n bottom: Type.Optional(Type.Number({ minimum: 0 })),\n left: Type.Optional(Type.Number({ minimum: 0 })),\n },\n { additionalProperties: false }\n )\n ),\n border: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(\n // Reuse border schema semantics: style/width/color\n Type.Object({\n style: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dashed'),\n Type.Literal('dotted'),\n Type.Literal('double'),\n Type.Literal('none'),\n ])\n ),\n width: Type.Optional(Type.Number({ minimum: 0 })),\n color: Type.Optional(HexColorSchema),\n })\n ),\n right: Type.Optional(\n Type.Object({\n style: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dashed'),\n Type.Literal('dotted'),\n Type.Literal('double'),\n Type.Literal('none'),\n ])\n ),\n width: Type.Optional(Type.Number({ minimum: 0 })),\n color: Type.Optional(HexColorSchema),\n })\n ),\n bottom: Type.Optional(\n Type.Object({\n style: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dashed'),\n Type.Literal('dotted'),\n Type.Literal('double'),\n Type.Literal('none'),\n ])\n ),\n width: Type.Optional(Type.Number({ minimum: 0 })),\n color: Type.Optional(HexColorSchema),\n })\n ),\n left: Type.Optional(\n Type.Object({\n style: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dashed'),\n Type.Literal('dotted'),\n Type.Literal('double'),\n Type.Literal('none'),\n ])\n ),\n width: Type.Optional(Type.Number({ minimum: 0 })),\n color: Type.Optional(HexColorSchema),\n })\n ),\n },\n { additionalProperties: false }\n )\n ),\n shading: Type.Optional(\n Type.Object(\n {\n fill: Type.Optional(Type.String()),\n },\n { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n);\n\nexport type TextBoxProps = Static<typeof TextBoxPropsSchema>;\n","/**\n * Image Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n AlignmentSchema,\n SpacingSchema,\n FloatingPropertiesSchema,\n} from './common';\n\nexport const ImagePropsSchema = Type.Object(\n {\n path: Type.Optional(\n Type.String({\n description:\n 'Image source URL or file path (mutually exclusive with base64)',\n })\n ),\n base64: Type.Optional(\n Type.String({\n description:\n 'Base64-encoded image data in data URI format (e.g., \"data:image/png;base64,iVBORw0KGgo...\") (mutually exclusive with path)',\n })\n ),\n alt: Type.Optional(\n Type.String({\n description: 'Alternative text for accessibility',\n })\n ),\n width: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Image width in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Image width as percentage (e.g., \"90%\") relative to widthRelativeTo (defaults to content width)',\n }),\n ],\n {\n description:\n 'Image width in pixels (number) or as percentage string (e.g., \"90%\")',\n default: '100%',\n }\n )\n ),\n height: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Image height in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Image height as percentage (e.g., \"90%\") relative to heightRelativeTo (defaults to content height)',\n }),\n ],\n {\n description:\n 'Image height in pixels (number) or as percentage string (e.g., \"90%\")',\n }\n )\n ),\n widthRelativeTo: Type.Optional(\n Type.Union([Type.Literal('content'), Type.Literal('page')], {\n description:\n 'Reference for width percentages: content (page width minus margins) or page (full page width)',\n default: 'content',\n })\n ),\n heightRelativeTo: Type.Optional(\n Type.Union([Type.Literal('content'), Type.Literal('page')], {\n description:\n 'Reference for height percentages: content (page height minus margins) or page (full page height)',\n default: 'content',\n })\n ),\n alignment: Type.Optional(AlignmentSchema),\n caption: Type.Optional(\n Type.String({\n description:\n 'Image caption (supports rich text with **bold**, *italic*, ***both***)',\n })\n ),\n spacing: Type.Optional(SpacingSchema),\n floating: Type.Optional(FloatingPropertiesSchema),\n keepNext: Type.Optional(\n Type.Boolean({\n description: 'Keep paragraph with next paragraph on same page',\n })\n ),\n keepLines: Type.Optional(\n Type.Boolean({\n description: 'Keep all lines of paragraph together on same page',\n })\n ),\n },\n {\n description: 'Image component props',\n additionalProperties: false,\n }\n);\n\nexport type ImageProps = Static<typeof ImagePropsSchema>;\n","/**\n * Statistic Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { AlignmentSchema, SpacingSchema } from './common';\n\nexport const StatisticPropsSchema = Type.Object(\n {\n number: Type.String({\n description: 'Statistic number/value (required)',\n }),\n description: Type.String({\n description: 'Statistic description (required)',\n }),\n unit: Type.Optional(\n Type.String({\n description: 'Unit of measurement',\n })\n ),\n format: Type.Optional(\n Type.String({\n description: 'Number format pattern',\n })\n ),\n trend: Type.Optional(\n Type.Union([\n Type.Literal('up'),\n Type.Literal('down'),\n Type.Literal('neutral'),\n ])\n ),\n trendValue: Type.Optional(Type.Union([Type.String(), Type.Number()])),\n alignment: Type.Optional(AlignmentSchema),\n spacing: Type.Optional(SpacingSchema),\n size: Type.Optional(\n Type.Union([\n Type.Literal('small'),\n Type.Literal('medium'),\n Type.Literal('large'),\n ])\n ),\n },\n {\n description: 'Statistic component props',\n additionalProperties: false,\n }\n);\n\nexport type StatisticProps = Static<typeof StatisticPropsSchema>;\n","/**\n * Table Component Schema\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\nimport { HexColorSchema } from '../font';\n\n// Define Cell type - can be plain text or a component definition\nconst CellContentSchema = Type.Recursive((This) =>\n Type.Union([\n Type.String(),\n Type.Object(\n {\n name: Type.String(),\n props: Type.Object({}, { additionalProperties: true }),\n children: Type.Optional(Type.Array(This)),\n },\n { additionalProperties: false }\n ),\n ])\n);\n\n// Horizontal alignment schema\nconst HorizontalAlignmentSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('justify'),\n ],\n { description: 'Horizontal text alignment' }\n);\n\n// Vertical alignment schema\nconst VerticalAlignmentSchema = Type.Union(\n [Type.Literal('top'), Type.Literal('middle'), Type.Literal('bottom')],\n { description: 'Vertical cell alignment' }\n);\n\n// Font configuration schema\nconst FontConfigSchema = Type.Object({\n family: Type.Optional(Type.String({ description: 'Font family name' })),\n size: Type.Optional(\n Type.Number({ minimum: 0, description: 'Font size in points' })\n ),\n bold: Type.Optional(Type.Boolean({ description: 'Bold text' })),\n italic: Type.Optional(Type.Boolean({ description: 'Italic text' })),\n underline: Type.Optional(Type.Boolean({ description: 'Underlined text' })),\n});\n\n// Border color - can be a single string or an object with sides\nconst BorderColorSchema = Type.Union([\n Type.String({ description: 'Border color for all sides (hex without #)' }),\n Type.Object({\n bottom: Type.Optional(\n Type.String({ description: 'Bottom border color (hex without #)' })\n ),\n top: Type.Optional(\n Type.String({ description: 'Top border color (hex without #)' })\n ),\n right: Type.Optional(\n Type.String({ description: 'Right border color (hex without #)' })\n ),\n left: Type.Optional(\n Type.String({ description: 'Left border color (hex without #)' })\n ),\n }),\n]);\n\n// Border size - can be a single number or an object with sides\nconst BorderSizeSchema = Type.Union([\n Type.Number({\n minimum: 0,\n description: 'Border size for all sides in points',\n }),\n Type.Object({\n bottom: Type.Optional(\n Type.Number({ minimum: 0, description: 'Bottom border size in points' })\n ),\n top: Type.Optional(\n Type.Number({ minimum: 0, description: 'Top border size in points' })\n ),\n right: Type.Optional(\n Type.Number({ minimum: 0, description: 'Right border size in points' })\n ),\n left: Type.Optional(\n Type.Number({ minimum: 0, description: 'Left border size in points' })\n ),\n }),\n]);\n\n// Hide borders - can be a boolean or an object with sides\nconst HideBordersSchema = Type.Union([\n Type.Boolean({\n description: 'Hide all borders when true',\n }),\n Type.Object(\n {\n bottom: Type.Optional(\n Type.Boolean({ description: 'Hide bottom border' })\n ),\n top: Type.Optional(Type.Boolean({ description: 'Hide top border' })),\n right: Type.Optional(Type.Boolean({ description: 'Hide right border' })),\n left: Type.Optional(Type.Boolean({ description: 'Hide left border' })),\n insideHorizontal: Type.Optional(\n Type.Boolean({ description: 'Hide horizontal borders between rows' })\n ),\n insideVertical: Type.Optional(\n Type.Boolean({ description: 'Hide vertical borders between columns' })\n ),\n },\n { description: 'Selectively hide specific borders' }\n ),\n]);\n\n// Padding - can be a single number or an object with sides\nconst PaddingSchema = Type.Union([\n Type.Number({ minimum: 0, description: 'Padding for all sides in points' }),\n Type.Object({\n bottom: Type.Optional(\n Type.Number({ minimum: 0, description: 'Bottom padding in points' })\n ),\n top: Type.Optional(\n Type.Number({ minimum: 0, description: 'Top padding in points' })\n ),\n right: Type.Optional(\n Type.Number({ minimum: 0, description: 'Right padding in points' })\n ),\n left: Type.Optional(\n Type.Number({ minimum: 0, description: 'Left padding in points' })\n ),\n }),\n]);\n\n// Cell defaults configuration\nconst CellDefaultsSchema = Type.Object({\n color: Type.Optional(HexColorSchema),\n backgroundColor: Type.Optional(HexColorSchema),\n horizontalAlignment: Type.Optional(HorizontalAlignmentSchema),\n verticalAlignment: Type.Optional(VerticalAlignmentSchema),\n font: Type.Optional(FontConfigSchema),\n borderColor: Type.Optional(BorderColorSchema),\n borderSize: Type.Optional(BorderSizeSchema),\n padding: Type.Optional(PaddingSchema),\n height: Type.Optional(\n Type.Number({ minimum: 0, description: 'Cell height in points' })\n ),\n});\n\n/**\n * Build TablePropsSchema with a given cell-content type.\n * Called with `CellContentSchema` for the static export below, and with a\n * live recursive ref at schema-generation time.\n */\nexport function createTablePropsSchema(componentRef: TSchema): TSchema {\n const cellContent = Type.Union([Type.String(), componentRef]);\n\n const cellFields = {\n color: Type.Optional(HexColorSchema),\n backgroundColor: Type.Optional(HexColorSchema),\n horizontalAlignment: Type.Optional(HorizontalAlignmentSchema),\n verticalAlignment: Type.Optional(VerticalAlignmentSchema),\n font: Type.Optional(FontConfigSchema),\n borderColor: Type.Optional(BorderColorSchema),\n borderSize: Type.Optional(BorderSizeSchema),\n padding: Type.Optional(PaddingSchema),\n height: Type.Optional(\n Type.Number({ minimum: 0, description: 'Cell height in points' })\n ),\n };\n\n const headerSchema = Type.Object({\n ...cellFields,\n content: Type.Optional(cellContent),\n });\n\n const cellSchema = Type.Object({\n ...cellFields,\n content: Type.Optional(cellContent),\n });\n\n const columnSchema = Type.Object({\n width: Type.Optional(\n Type.Union([\n Type.Number({\n minimum: 0,\n description:\n 'Column width in points. When set on some columns, remaining columns will automatically share the leftover table space equally. Leave undefined to distribute space evenly among unspecified columns.',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Column width as percentage of available width (e.g., \"40%\")',\n }),\n ])\n ),\n cellDefaults: Type.Optional(CellDefaultsSchema),\n header: Type.Optional(headerSchema),\n cells: Type.Optional(Type.Array(cellSchema)),\n });\n\n return Type.Object(\n {\n borderColor: Type.Optional(BorderColorSchema),\n borderSize: Type.Optional(BorderSizeSchema),\n hideBorders: Type.Optional(HideBordersSchema),\n cellDefaults: Type.Optional(CellDefaultsSchema),\n headerCellDefaults: Type.Optional(CellDefaultsSchema),\n width: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Table width in percentage (0-100)',\n })\n ),\n columns: Type.Array(columnSchema, {\n description: 'Table columns with headers and cells',\n minItems: 1,\n }),\n keepInOnePage: Type.Optional(\n Type.Boolean({\n description:\n 'Keep table rows together on the same page by setting keepNext on all paragraphs',\n })\n ),\n keepNext: Type.Optional(\n Type.Boolean({\n description:\n 'Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false.',\n })\n ),\n repeatHeaderOnPageBreak: Type.Optional(\n Type.Boolean({\n description:\n 'Repeat the header row on each page when the table spans multiple pages. Defaults to false.',\n default: true,\n })\n ),\n },\n {\n description: 'Table component props with column-based structure',\n }\n );\n}\n\n// Static version for validators, type inference, and theme defaults.\nexport const TablePropsSchema = createTablePropsSchema(CellContentSchema);\n\nexport type TableProps = Static<typeof TablePropsSchema>;\n","/**\n * Header Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { AlignmentSchema } from './common';\n\nexport const HeaderPropsSchema = Type.Object(\n {\n text: Type.Optional(\n Type.String({\n description: 'Header text',\n })\n ),\n logo: Type.Optional(\n Type.String({\n description: 'Logo image URL or path',\n })\n ),\n alignment: Type.Optional(AlignmentSchema),\n position: Type.Optional(\n Type.Union([Type.Literal('top'), Type.Literal('bottom')])\n ),\n firstPage: Type.Optional(\n Type.Boolean({\n description: 'Show header on first page',\n })\n ),\n oddPages: Type.Optional(\n Type.Boolean({\n description: 'Show header on odd pages',\n })\n ),\n evenPages: Type.Optional(\n Type.Boolean({\n description: 'Show header on even pages',\n })\n ),\n showPageNumbers: Type.Optional(Type.Boolean()),\n showDate: Type.Optional(Type.Boolean()),\n height: Type.Optional(Type.Number({ minimum: 0 })),\n },\n {\n description: 'Document header configuration',\n additionalProperties: false,\n }\n);\n\nexport type HeaderProps = Static<typeof HeaderPropsSchema>;\n","/**\n * Footer Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { AlignmentSchema } from './common';\n\nexport const FooterPropsSchema = Type.Object(\n {\n text: Type.Optional(\n Type.String({\n description: 'Footer text',\n })\n ),\n alignment: Type.Optional(AlignmentSchema),\n position: Type.Optional(\n Type.Union([Type.Literal('top'), Type.Literal('bottom')])\n ),\n firstPage: Type.Optional(\n Type.Boolean({\n description: 'Show footer on first page',\n })\n ),\n oddPages: Type.Optional(\n Type.Boolean({\n description: 'Show footer on odd pages',\n })\n ),\n evenPages: Type.Optional(\n Type.Boolean({\n description: 'Show footer on even pages',\n })\n ),\n showPageNumbers: Type.Optional(Type.Boolean()),\n showDate: Type.Optional(Type.Boolean()),\n height: Type.Optional(Type.Number({ minimum: 0 })),\n },\n {\n description: 'Document footer configuration',\n additionalProperties: false,\n }\n);\n\nexport type FooterProps = Static<typeof FooterPropsSchema>;\n","/**\n * List Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n ListSpacingSchema,\n JustifiedAlignmentSchema,\n IndentSchema,\n} from './common';\n\n/**\n * Level format options for docx numbering\n * Maps to docx LevelFormat enum\n */\nexport const LevelFormatSchema = Type.Union(\n [\n Type.Literal('decimal'),\n Type.Literal('upperRoman'),\n Type.Literal('lowerRoman'),\n Type.Literal('upperLetter'),\n Type.Literal('lowerLetter'),\n Type.Literal('bullet'),\n Type.Literal('ordinal'),\n Type.Literal('cardinalText'),\n Type.Literal('ordinalText'),\n Type.Literal('hex'),\n Type.Literal('chicago'),\n Type.Literal('ideographDigital'),\n Type.Literal('japaneseCounting'),\n Type.Literal('aiueo'),\n Type.Literal('iroha'),\n Type.Literal('decimalFullWidth'),\n Type.Literal('decimalHalfWidth'),\n Type.Literal('japaneseLegal'),\n Type.Literal('japaneseDigitalTenThousand'),\n Type.Literal('decimalEnclosedCircle'),\n Type.Literal('decimalFullWidth2'),\n Type.Literal('aiueoFullWidth'),\n Type.Literal('irohaFullWidth'),\n Type.Literal('decimalZero'),\n Type.Literal('ganada'),\n Type.Literal('chosung'),\n Type.Literal('decimalEnclosedFullstop'),\n Type.Literal('decimalEnclosedParen'),\n Type.Literal('decimalEnclosedCircleChinese'),\n Type.Literal('ideographEnclosedCircle'),\n Type.Literal('ideographTraditional'),\n Type.Literal('ideographZodiac'),\n Type.Literal('ideographZodiacTraditional'),\n Type.Literal('taiwaneseCounting'),\n Type.Literal('ideographLegalTraditional'),\n Type.Literal('taiwaneseCountingThousand'),\n Type.Literal('taiwaneseDigital'),\n Type.Literal('chineseCounting'),\n Type.Literal('chineseLegalSimplified'),\n Type.Literal('chineseCountingThousand'),\n Type.Literal('koreanDigital'),\n Type.Literal('koreanCounting'),\n Type.Literal('koreanLegal'),\n Type.Literal('koreanDigital2'),\n Type.Literal('vietnameseCounting'),\n Type.Literal('russianLower'),\n Type.Literal('russianUpper'),\n Type.Literal('none'),\n Type.Literal('numberInDash'),\n Type.Literal('hebrew1'),\n Type.Literal('hebrew2'),\n Type.Literal('arabicAlpha'),\n Type.Literal('arabicAbjad'),\n Type.Literal('hindiVowels'),\n Type.Literal('hindiConsonants'),\n Type.Literal('hindiNumbers'),\n Type.Literal('hindiCounting'),\n Type.Literal('thaiLetters'),\n Type.Literal('thaiNumbers'),\n Type.Literal('thaiCounting'),\n ],\n {\n description: 'Number or bullet format for list levels',\n }\n);\n\n/**\n * Configuration for a single numbering level\n */\nexport const ListLevelPropsSchema = Type.Object(\n {\n level: Type.Number({\n minimum: 0,\n maximum: 8,\n description: 'Nesting level (0 = root, 1 = first sublevel, etc.)',\n }),\n format: Type.Optional(LevelFormatSchema),\n text: Type.Optional(\n Type.String({\n description:\n 'Number format string (e.g., \"%1.\" for \"1.\", \"%1)\" for \"1)\", custom bullet character for bullet format)',\n })\n ),\n alignment: Type.Optional(\n Type.Union(\n [\n Type.Literal('start'),\n Type.Literal('end'),\n Type.Literal('left'),\n Type.Literal('right'),\n Type.Literal('center'),\n ],\n {\n description: 'Alignment of the numbering/bullet',\n }\n )\n ),\n indent: Type.Optional(IndentSchema),\n start: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Starting number for this level (default: 1)',\n })\n ),\n },\n {\n description: 'Configuration for a single list level',\n }\n);\n\nexport const ListPropsSchema = Type.Object(\n {\n items: Type.Array(\n Type.Union([\n Type.String(),\n Type.Object({\n text: Type.String(),\n level: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 8,\n description: 'Nesting level for this item',\n })\n ),\n }),\n ]),\n {\n description: 'List items (required)',\n minItems: 1,\n }\n ),\n reference: Type.Optional(\n Type.String({\n description:\n 'Unique reference ID for this numbering configuration (auto-generated if not provided)',\n })\n ),\n levels: Type.Optional(\n Type.Array(ListLevelPropsSchema, {\n description: 'Configuration for each nesting level',\n minItems: 1,\n maxItems: 9,\n })\n ),\n // Simplified options for common use cases (when levels not specified)\n format: Type.Optional(\n Type.Union(\n [LevelFormatSchema, Type.Literal('numbered'), Type.Literal('none')],\n {\n description:\n 'Format for level 0 (simplified option when levels not specified)',\n }\n )\n ),\n bullet: Type.Optional(\n Type.String({\n description:\n 'Custom bullet character (simplified option when levels not specified)',\n })\n ),\n start: Type.Optional(\n Type.Number({\n minimum: 1,\n description:\n 'Starting number for level 0 (simplified option when levels not specified)',\n })\n ),\n spacing: Type.Optional(ListSpacingSchema),\n alignment: Type.Optional(JustifiedAlignmentSchema),\n indent: Type.Optional(\n Type.Union([Type.Number({ minimum: 0 }), IndentSchema])\n ),\n },\n {\n description: 'List component props',\n additionalProperties: false,\n }\n);\n\nexport type LevelFormat = Static<typeof LevelFormatSchema>;\nexport type ListLevelProps = Static<typeof ListLevelPropsSchema>;\nexport type ListProps = Static<typeof ListPropsSchema>;\n","/**\n * Table of Contents Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\n\nexport const TocStyleSchema = Type.Union(\n [Type.Literal('numeric'), Type.Literal('bullet'), Type.Literal('none')],\n { description: 'TOC numbering style' }\n);\n\nexport const TocScopeSchema = Type.Union(\n [Type.Literal('document'), Type.Literal('section')],\n { description: 'TOC scope: document-wide or section-only' }\n);\n\nexport const TocStyleMappingSchema = Type.Object(\n {\n styleId: Type.String({\n description: 'Custom style ID matching a key in theme.styles',\n }),\n level: Type.Number({\n minimum: 1,\n maximum: 6,\n description: 'TOC level (1-6) to assign to this style',\n }),\n },\n {\n description: 'Mapping of custom style to TOC level',\n additionalProperties: false,\n }\n);\n\nexport const TocDepthRangeSchema = Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to include in TOC. Specify at least one of \"from\" or \"to\".',\n additionalProperties: false,\n }\n);\n\nexport const TocPropsSchema = Type.Object(\n {\n pageBreak: Type.Optional(\n Type.Boolean({\n description: 'Insert page break before TOC block',\n })\n ),\n depth: Type.Optional(\n Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to include in TOC. Specify \"from\", \"to\", or both. Defaults: from=1, to=3',\n additionalProperties: false,\n default: { to: 3 },\n }\n )\n ),\n pageNumbersDepth: Type.Optional(\n Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to show page numbers. Specify \"from\", \"to\", or both. When specified, page numbers are hidden for entries outside this range.',\n additionalProperties: false,\n }\n )\n ),\n numberingStyle: Type.Optional(TocStyleSchema),\n title: Type.Optional(\n Type.String({\n description: 'TOC heading title',\n })\n ),\n includePageNumbers: Type.Optional(\n Type.Boolean({\n default: true,\n description: 'Show page numbers next to entries',\n })\n ),\n numberSeparator: Type.Optional(\n Type.Boolean({\n default: true,\n description:\n 'Use tab separator between entry and page number. True applies \"\\\\t\" (default), false applies \" \"',\n })\n ),\n scope: Type.Optional(\n Type.Union([TocScopeSchema, Type.Literal('auto')], {\n default: 'auto',\n description:\n 'TOC scope: \"document\" for entire document, \"section\" for parent section only, \"auto\" for automatic detection (section if inside section, otherwise document)',\n })\n ),\n styles: Type.Optional(\n Type.Array(TocStyleMappingSchema, {\n description:\n 'Custom style mappings for TOC entries. Maps custom theme styles to TOC levels.',\n })\n ),\n },\n {\n description: 'Table of Contents component props',\n additionalProperties: false,\n }\n);\n\nexport type TocProps = Static<typeof TocPropsSchema>;\n","/**\n * Highcharts Component Schema\n *\n * Standard module for rendering charts using Highcharts export server.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\n\n/**\n * Highcharts component props schema\n * Accepts options that will be passed to Highcharts export server\n */\nexport const HighchartsPropsSchema = Type.Object({\n // Highcharts chart options - can be anything but must at least have chart.width and chart.height\n options: Type.Intersect([\n Type.Record(Type.String(), Type.Unknown()),\n Type.Object({\n chart: Type.Object({\n width: Type.Number(),\n height: Type.Number(),\n }),\n }),\n ]),\n // Optional scale factor for export\n scale: Type.Optional(Type.Number()),\n // Optional Highcharts Export Server URL override\n serverUrl: Type.Optional(Type.String({ description: 'Highcharts Export Server URL (default: http://localhost:7801)' })),\n // Optional width for rendering (overrides chart width)\n width: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Image width in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Image width as percentage (e.g., \"90%\") relative to content width',\n }),\n ],\n {\n description:\n 'Rendered image width in pixels (number) or as percentage string (e.g., \"90%\")',\n }\n )\n ),\n // Optional height for rendering (overrides chart height)\n height: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Image height in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Image height as percentage (e.g., \"90%\") relative to content height',\n }),\n ],\n {\n description:\n 'Rendered image height in pixels (number) or as percentage string (e.g., \"90%\")',\n }\n )\n ),\n});\n\nexport type HighchartsProps = Static<typeof HighchartsPropsSchema>;\n"],"mappings":";;;;;;AAeA,SAAS,QAAAA,cAAqB;;;ACX9B,SAAS,YAA6B;AAG/B,IAAM,0BAA0B,CAAC,eACtC,KAAK;AAAA,EACH;AAAA,IACE,OAAO,KAAK;AAAA,MACV,KAAK,OAAO;AAAA,QACV,aAAa;AAAA,QACb,UAAU,CAAC,WAAW,aAAa,QAAQ;AAAA,QAC3C,SAAS;AAAA,MACX,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AG,cAAc,GAAG,aAAa;AAC1D,YAAM,eACJ,gBAAgB,WAAW,IACvB,gBAAgB,CAAC,IACjBA,OAAK,MAAM,eAAe;AAEhC,eAAS;AAAA,QACP,KAAK;AAAA,QACL,4BAA4B,MAAM,cAAc,OAAO;AAAA,MACzD;AACA,cAAQ,OAAO,GAAG,CAAC;AAAA,IACrB;AAEA,QAAI,QAAQ,WAAW,QAAQ;AAC7B,YAAM,IAAI;AAAA,QACR,mCAAmC,QAAQ,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;AAAA,MAC1E;AAAA,IACF;AAAA,EACF;AAGA,QAAM,SAAS,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC;AACpD,SAAO,EAAE,SAAS,CAAC,GAAG,OAAO,OAAO,CAAC,GAAG,OAAO;AACjD;","names":["Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","AlignmentSchema","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schemas/components.ts"],"sourcesContent":["/**\n * TypeBox Component Schemas\n *\n * Complete component definitions with discriminated unions for perfect\n * JSON schema autocompletion and validation.\n *\n * IMPORTANT: Standard components are defined in component-registry.ts (SINGLE SOURCE OF TRUTH).\n * This file uses that registry to generate TypeBox schemas.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n createAllComponentSchemas,\n createAllComponentSchemasNarrowed,\n} from './component-registry';\n\n// Re-export all schemas from individual component files\nexport * from './components/common';\nexport * from './components/report';\nexport * from './components/section';\nexport * from './components/columns';\nexport * from './components/heading';\nexport * from './components/paragraph';\nexport * from './components/image';\nexport * from './components/highcharts';\nexport * from './components/statistic';\nexport * from './components/table';\nexport * from './components/header';\nexport * from './components/footer';\nexport * from './components/list';\nexport * from './components/toc';\nexport * from './components/text-box';\n\n// ============================================================================\n// Component Definitions with Discriminated Union\n// ============================================================================\n\n// StandardComponentDefinitionSchema - Union of all standard component types\n// Generated from the component registry (SINGLE SOURCE OF TRUTH)\nexport const StandardComponentDefinitionSchema = Type.Union(\n // Use Type.Any() for non-recursive standard components\n // Convert readonly array to mutable array for Type.Union\n [...createAllComponentSchemas(Type.Any())],\n {\n discriminator: { propertyName: 'name' },\n description: 'Standard component definition with discriminated union',\n }\n);\n\nexport const ComponentDefinitionSchema = Type.Recursive((This) =>\n Type.Union(\n [\n // Standard components from registry with per-container narrowed children\n ...createAllComponentSchemasNarrowed(This).schemas,\n ],\n {\n discriminator: { propertyName: 'name' },\n description: 'Component definition with discriminated union',\n }\n )\n);\n\n// ============================================================================\n// TypeScript Types\n// ============================================================================\n\nexport type ComponentDefinition = Static<typeof ComponentDefinitionSchema>;\n"],"mappings":";;;;;;AAUA,SAAS,YAAoB;AA6BtB,IAAM,oCAAoC,KAAK;AAAA;AAAA;AAAA,EAGpD,CAAC,GAAG,0BAA0B,KAAK,IAAI,CAAC,CAAC;AAAA,EACzC;AAAA,IACE,eAAe,EAAE,cAAc,OAAO;AAAA,IACtC,aAAa;AAAA,EACf;AACF;AAEO,IAAM,4BAA4B,KAAK;AAAA,EAAU,CAAC,SACvD,KAAK;AAAA,IACH;AAAA;AAAA,MAEE,GAAG,kCAAkC,IAAI,EAAE;AAAA,IAC7C;AAAA,IACA;AAAA,MACE,eAAe,EAAE,cAAc,OAAO;AAAA,MACtC,aAAa;AAAA,IACf;AAAA,EACF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schemas/theme.ts"],"sourcesContent":["/**\n * Theme Schema Definitions using TypeBox\n * This file provides TypeBox schemas for theme configuration validation\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FontDefinitionSchema, TextFormattingPropertiesSchema, HexColorSchema } from './font';\nimport { IndentSchema } from './components/common';\n\n// ============================================================================\n// Document Margins Schema\n// ============================================================================\n\nexport const DocumentMarginsSchema = Type.Object(\n {\n top: Type.Number({ minimum: 0 }),\n bottom: Type.Number({ minimum: 0 }),\n left: Type.Number({ minimum: 0 }),\n right: Type.Number({ minimum: 0 }),\n header: Type.Number({ minimum: 0 }),\n footer: Type.Number({ minimum: 0 }),\n gutter: Type.Number({ minimum: 0 }),\n },\n { description: 'Document margin configuration' }\n);\n\n// ============================================================================\n// Page Dimensions Schema\n// ============================================================================\n\nexport const PageDimensionsSchema = Type.Object(\n {\n width: Type.Number({ minimum: 0 }),\n height: Type.Number({ minimum: 0 }),\n },\n { description: 'Page dimensions in twips' }\n);\n\n// ============================================================================\n// Page Schema (replaces PageSetupSchema)\n// ============================================================================\n\nexport const PageSchema = Type.Object(\n {\n size: Type.Union(\n [\n Type.Literal('A4'),\n Type.Literal('A3'),\n Type.Literal('LETTER'),\n Type.Literal('LEGAL'),\n Type.Object({\n width: Type.Number({ minimum: 0 }),\n height: Type.Number({ minimum: 0 }),\n }),\n ],\n { description: 'Standard page size or custom dimensions' }\n ),\n margins: DocumentMarginsSchema,\n },\n {\n description: 'Page configuration including dimensions and margins',\n additionalProperties: false,\n }\n);\n\n// ============================================================================\n// Text formatting and font schemas now imported from './font' to avoid cycles\n\n// ============================================================================\n// Fonts Schema\n// ============================================================================\n\nexport const FontsSchema = Type.Object(\n {\n heading: FontDefinitionSchema,\n body: FontDefinitionSchema,\n mono: FontDefinitionSchema,\n light: FontDefinitionSchema,\n },\n { description: 'Font definitions for different text types' }\n);\n\n// ============================================================================\n// Style Definitions Schema\n// ============================================================================\n\n// Paragraph border style support (matches docx BorderStyle)\nconst BorderStyleSchema = Type.Union(\n [\n Type.Literal('single'),\n Type.Literal('dashDotStroked'),\n Type.Literal('dashed'),\n Type.Literal('dashSmallGap'),\n Type.Literal('dotDash'),\n Type.Literal('dotDotDash'),\n Type.Literal('dotted'),\n Type.Literal('double'),\n Type.Literal('doubleWave'),\n Type.Literal('inset'),\n Type.Literal('nil'),\n Type.Literal('none'),\n Type.Literal('outset'),\n Type.Literal('thick'),\n Type.Literal('thickThinLargeGap'),\n Type.Literal('thickThinMediumGap'),\n Type.Literal('thickThinSmallGap'),\n Type.Literal('thinThickLargeGap'),\n Type.Literal('thinThickMediumGap'),\n Type.Literal('thinThickSmallGap'),\n Type.Literal('thinThickThinLargeGap'),\n Type.Literal('thinThickThinMediumGap'),\n Type.Literal('thinThickThinSmallGap'),\n Type.Literal('threeDEmboss'),\n Type.Literal('threeDEngrave'),\n Type.Literal('triple'),\n Type.Literal('wave'),\n ],\n { description: 'Paragraph border style' }\n);\n\nconst BorderDefinitionSchema = Type.Object(\n {\n style: BorderStyleSchema,\n size: Type.Number({\n minimum: 0,\n description: 'Width in eighths of a point (docx sz)',\n }),\n color: HexColorSchema,\n space: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Space between text and border in points',\n })\n ),\n },\n {\n additionalProperties: false,\n description: 'Paragraph border side definition',\n }\n);\n\nconst BordersSchema = Type.Object(\n {\n top: Type.Optional(BorderDefinitionSchema),\n bottom: Type.Optional(BorderDefinitionSchema),\n left: Type.Optional(BorderDefinitionSchema),\n right: Type.Optional(BorderDefinitionSchema),\n },\n { additionalProperties: false, description: 'Paragraph borders (per side)' }\n);\n\n// Alignment schema for paragraph-level alignment (used in styles)\nconst AlignmentSchema = Type.Optional(\n Type.Union([\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('justify'),\n ])\n);\n\n/**\n * Style properties schema that extends text formatting properties\n * with additional style-specific properties (priority, baseStyle, etc.)\n */\nconst StylePropertiesSchema = Type.Object(\n {\n font: Type.Optional(\n Type.Union([\n Type.Literal('heading'),\n Type.Literal('body'),\n Type.Literal('mono'),\n Type.Literal('light'),\n ])\n ),\n ...TextFormattingPropertiesSchema.properties,\n // Paragraph-level alignment (not a font property)\n alignment: AlignmentSchema,\n // Additional properties specific to styles\n priority: Type.Optional(Type.Number()),\n baseStyle: Type.Optional(Type.String()),\n followingStyle: Type.Optional(Type.String()),\n widowControl: Type.Optional(Type.Boolean()),\n keepNext: Type.Optional(Type.Boolean()),\n keepLinesTogether: Type.Optional(Type.Boolean()),\n outlineLevel: Type.Optional(Type.Number()),\n borders: Type.Optional(BordersSchema),\n indent: Type.Optional(IndentSchema),\n },\n { additionalProperties: false }\n);\n\n// ============================================================================\n// Tab Stop Schema\n// ============================================================================\n\n/**\n * Tab stop leader types matching docx.js LeaderType\n */\nconst TabStopLeaderSchema = Type.Union(\n [\n Type.Literal('dot'),\n Type.Literal('hyphen'),\n Type.Literal('middleDot'),\n Type.Literal('none'),\n Type.Literal('underscore'),\n ],\n {\n description:\n 'Tab leader style: dot (dotted), hyphen (dashed), middleDot, none (blank), or underscore',\n }\n);\n\n/**\n * Tab stop type matching docx.js TabStopType\n */\nconst TabStopTypeSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('right'),\n Type.Literal('center'),\n Type.Literal('bar'),\n Type.Literal('clear'),\n Type.Literal('decimal'),\n Type.Literal('end'),\n Type.Literal('num'),\n Type.Literal('start'),\n ],\n {\n description: 'Tab stop alignment type',\n }\n);\n\n/**\n * Tab stop definition schema\n */\nconst TabStopDefinitionSchema = Type.Object(\n {\n type: TabStopTypeSchema,\n position: Type.Union([\n Type.Number({\n description:\n 'Tab stop position in twips (1/1440 inch). Common: 9026 for right-aligned at page margin',\n }),\n Type.Literal('max', {\n description: 'Use maximum position (TabStopPosition.MAX = 9026 twips)',\n }),\n ]),\n leader: Type.Optional(TabStopLeaderSchema),\n },\n {\n description:\n 'Tab stop configuration with position, alignment, and optional leader',\n additionalProperties: false,\n }\n);\n\n/**\n * TOC style properties schema that extends text formatting properties\n * but EXCLUDES baseStyle to prevent unwanted coupling with Heading styles\n */\nconst TocStylePropertiesSchema = Type.Object(\n {\n font: Type.Optional(\n Type.Union([\n Type.Literal('heading'),\n Type.Literal('body'),\n Type.Literal('mono'),\n Type.Literal('light'),\n ])\n ),\n ...TextFormattingPropertiesSchema.properties,\n // Paragraph-level alignment (not a font property)\n alignment: AlignmentSchema,\n // Tab stops for controlling TOC entry formatting (leader dots, alignment, etc.)\n tabStops: Type.Optional(\n Type.Array(TabStopDefinitionSchema, {\n description:\n 'Tab stops for TOC entries. Use right-aligned tab with leader to create dotted lines to page numbers.',\n default: [{ type: 'right', position: 'max', leader: 'none' }],\n })\n ),\n // Additional properties specific to styles (baseStyle intentionally excluded)\n priority: Type.Optional(Type.Number()),\n followingStyle: Type.Optional(Type.String()),\n widowControl: Type.Optional(Type.Boolean()),\n keepNext: Type.Optional(Type.Boolean()),\n keepLinesTogether: Type.Optional(Type.Boolean()),\n outlineLevel: Type.Optional(Type.Number()),\n borders: Type.Optional(BordersSchema),\n indent: Type.Optional(IndentSchema),\n },\n { additionalProperties: false }\n);\n\nexport const StyleDefinitionsSchema = Type.Object(\n {\n normal: Type.Optional(StylePropertiesSchema),\n heading1: Type.Optional(StylePropertiesSchema),\n heading2: Type.Optional(StylePropertiesSchema),\n heading3: Type.Optional(StylePropertiesSchema),\n heading4: Type.Optional(StylePropertiesSchema),\n heading5: Type.Optional(StylePropertiesSchema),\n heading6: Type.Optional(StylePropertiesSchema),\n title: Type.Optional(StylePropertiesSchema),\n subtitle: Type.Optional(StylePropertiesSchema),\n // TOC entry styles (used by Word to format TOC entries)\n // Note: TOC styles use TocStylePropertiesSchema which excludes baseStyle to prevent coupling with Headings\n TOC1: Type.Optional(TocStylePropertiesSchema),\n TOC2: Type.Optional(TocStylePropertiesSchema),\n TOC3: Type.Optional(TocStylePropertiesSchema),\n TOC4: Type.Optional(TocStylePropertiesSchema),\n TOC5: Type.Optional(TocStylePropertiesSchema),\n TOC6: Type.Optional(TocStylePropertiesSchema),\n },\n {\n additionalProperties: StylePropertiesSchema,\n description:\n 'Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles.',\n }\n);\n\n// ============================================================================\n// Heading Definition Schema\n// ============================================================================\n\n/**\n * Heading definition schema that uses the same properties as StylePropertiesSchema\n * but adds a required 'level' field.\n */\nexport const HeadingDefinitionSchema = Type.Object(\n {\n level: Type.Union([\n Type.Literal(1),\n Type.Literal(2),\n Type.Literal(3),\n Type.Literal(4),\n Type.Literal(5),\n Type.Literal(6),\n ]),\n ...StylePropertiesSchema.properties,\n },\n { additionalProperties: false }\n);\n\n// ============================================================================\n// Component Defaults Schemas\n// ============================================================================\n\n// Import component props schemas from components.ts\nimport {\n HeadingPropsSchema,\n ParagraphPropsSchema,\n ImagePropsSchema,\n StatisticPropsSchema,\n TablePropsSchema,\n SectionPropsSchema,\n ColumnsPropsSchema,\n ListPropsSchema,\n} from './components';\n\n// Create component defaults by making all fields optional (Type.Partial)\nexport const HeadingComponentDefaultsSchema = Type.Partial(HeadingPropsSchema);\nexport const ParagraphComponentDefaultsSchema =\n Type.Partial(ParagraphPropsSchema);\nexport const ImageComponentDefaultsSchema = Type.Partial(ImagePropsSchema);\nexport const StatisticComponentDefaultsSchema =\n Type.Partial(StatisticPropsSchema);\nexport const TableComponentDefaultsSchema = Type.Partial(TablePropsSchema);\nexport const SectionComponentDefaultsSchema = Type.Partial(SectionPropsSchema);\nexport const ColumnsComponentDefaultsSchema = Type.Partial(ColumnsPropsSchema);\nexport const ListComponentDefaultsSchema = Type.Partial(ListPropsSchema);\n\nexport const ComponentDefaultsSchema = Type.Object(\n {\n heading: Type.Optional(HeadingComponentDefaultsSchema),\n paragraph: Type.Optional(ParagraphComponentDefaultsSchema),\n image: Type.Optional(ImageComponentDefaultsSchema),\n statistic: Type.Optional(StatisticComponentDefaultsSchema),\n table: Type.Optional(TableComponentDefaultsSchema),\n section: Type.Optional(SectionComponentDefaultsSchema),\n columns: Type.Optional(ColumnsComponentDefaultsSchema),\n list: Type.Optional(ListComponentDefaultsSchema),\n },\n { additionalProperties: true } // TODO: add a way to add strict custom component defaults when the plugin/registry paradigm will be implemented\n);\n\n// ============================================================================\n// Theme Config Schema\n// ============================================================================\n\nexport const ThemeConfigSchema = Type.Object(\n {\n $schema: Type.Optional(Type.String()),\n name: Type.String(),\n displayName: Type.String(),\n description: Type.String(),\n version: Type.String(),\n colors: Type.Object(\n {\n primary: HexColorSchema,\n secondary: HexColorSchema,\n accent: HexColorSchema,\n text: HexColorSchema,\n background: HexColorSchema,\n border: HexColorSchema,\n // Additional semantic color names\n textPrimary: HexColorSchema,\n textSecondary: HexColorSchema,\n textMuted: HexColorSchema,\n borderPrimary: HexColorSchema,\n borderSecondary: HexColorSchema,\n backgroundPrimary: HexColorSchema,\n backgroundSecondary: HexColorSchema,\n },\n { additionalProperties: false }\n ),\n fonts: FontsSchema,\n page: PageSchema,\n styles: Type.Optional(StyleDefinitionsSchema),\n componentDefaults: Type.Optional(ComponentDefaultsSchema),\n },\n {\n additionalProperties: false,\n description: 'Theme configuration',\n }\n);\n\n// ============================================================================\n// TypeScript Types\n// ============================================================================\n\nexport type ThemeConfigJson = Static<typeof ThemeConfigSchema>;\nexport type DocumentMargins = Static<typeof DocumentMarginsSchema>;\nexport type PageDimensions = Static<typeof PageDimensionsSchema>;\nexport type Page = Static<typeof PageSchema>;\nexport type FontDefinition = Static<typeof FontDefinitionSchema>;\nexport type Fonts = Static<typeof FontsSchema>;\nexport type StyleDefinitions = Static<typeof StyleDefinitionsSchema>;\nexport type HeadingDefinition = Static<typeof HeadingDefinitionSchema>;\nexport type HeadingComponentDefaults = Static<\n typeof HeadingComponentDefaultsSchema\n>;\nexport type ParagraphComponentDefaults = Static<\n typeof ParagraphComponentDefaultsSchema\n>;\nexport type ImageComponentDefaults = Static<\n typeof ImageComponentDefaultsSchema\n>;\nexport type StatisticComponentDefaults = Static<\n typeof StatisticComponentDefaultsSchema\n>;\nexport type TableComponentDefaults = Static<\n typeof TableComponentDefaultsSchema\n>;\nexport type SectionComponentDefaults = Static<\n typeof SectionComponentDefaultsSchema\n>;\nexport type ColumnsComponentDefaults = Static<\n typeof ColumnsComponentDefaultsSchema\n>;\nexport type ListComponentDefaults = Static<typeof ListComponentDefaultsSchema>;\nexport type ComponentDefaults = Static<typeof ComponentDefaultsSchema>;\n\n// ============================================================================\n// Validation Function\n// ============================================================================\n\nimport { Value } from '@sinclair/typebox/value';\n\nexport function isValidThemeConfig(data: unknown): data is ThemeConfigJson {\n return Value.Check(ThemeConfigSchema, data);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,SAAS,YAAoB;AA+c7B,SAAS,aAAa;AAvcf,IAAM,wBAAwB,KAAK;AAAA,EACxC;AAAA,IACE,KAAK,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAC/B,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAClC,MAAM,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAChC,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IACjC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAClC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAClC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,EACpC;AAAA,EACA,EAAE,aAAa,gCAAgC;AACjD;AAMO,IAAM,uBAAuB,KAAK;AAAA,EACvC;AAAA,IACE,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IACjC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,EACpC;AAAA,EACA,EAAE,aAAa,2BAA2B;AAC5C;AAMO,IAAM,aAAa,KAAK;AAAA,EAC7B;AAAA,IACE,MAAM,KAAK;AAAA,MACT;AAAA,QACE,KAAK,QAAQ,IAAI;AAAA,QACjB,KAAK,QAAQ,IAAI;AAAA,QACjB,KAAK,QAAQ,QAAQ;AAAA,QACrB,KAAK,QAAQ,OAAO;AAAA,QACpB,KAAK,OAAO;AAAA,UACV,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,UACjC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,QACpC,CAAC;AAAA,MACH;AAAA,MACA,EAAE,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AAK,SAAS,gCAAgC;AAAA,IACzD,OAAO,KAAK,SAAS,4BAA4B;AAAA,IACjD,WAAW,KAAK,SAAS,gCAAgC;AAAA,IACzD,OAAO,KAAK,SAAS,4BAA4B;AAAA,IACjD,SAAS,KAAK,SAAS,8BAA8B;AAAA,IACrD,SAAS,KAAK,SAAS,8BAA8B;AAAA,IACrD,MAAM,KAAK,SAAS,2BAA2B;AAAA,EACjD;AAAA,EACA,EAAE,sBAAsB,KAAK;AAAA;AAC/B;AAMO,IAAM,oBAAoB,KAAK;AAAA,EACpC;AAAA,IACE,SAAS,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,IACpC,MAAM,KAAK,OAAO;AAAA,IAClB,aAAa,KAAK,OAAO;AAAA,IACzB,aAAa,KAAK,OAAO;AAAA,IACzB,SAAS,KAAK,OAAO;AAAA,IACrB,QAAQ,KAAK;AAAA,MACX;AAAA,QACE,SAAS;AAAA,QACT,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,QAAQ;AAAA;AAAA,QAER,aAAa;AAAA,QACb,eAAe;AAAA,QACf,WAAW;AAAA,QACX,eAAe;AAAA,QACf,iBAAiB;AAAA,QACjB,mBAAmB;AAAA,QACnB,qBAAqB;AAAA,MACvB;AAAA,MACA,EAAE,sBAAsB,MAAM;AAAA,IAChC;AAAA,IACA,OAAO;AAAA,IACP,MAAM;AAAA,IACN,QAAQ,KAAK,SAAS,sBAAsB;AAAA,IAC5C,mBAAmB,KAAK,SAAS,uBAAuB;AAAA,EAC1D;AAAA,EACA;AAAA,IACE,sBAAsB;AAAA,IACtB,aAAa;AAAA,EACf;AACF;AA4CO,SAAS,mBAAmB,MAAwC;AACzE,SAAO,MAAM,MAAM,mBAAmB,IAAI;AAC5C;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schemas/font.ts"],"sourcesContent":["/**\n * Font-related Schemas (shared)\n * Extracted to avoid circular dependencies between theme and module schemas.\n */\n\nimport { Type } from '@sinclair/typebox';\n\n// ----------------------------------------------------------------------------\n// Shared Color Schema\n// ----------------------------------------------------------------------------\n\n/** Hex color with # prefix (e.g. \"#000000\") or a theme color name (e.g. \"primary\") */\nexport const HexColorSchema = Type.String({\n pattern: '^(#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$',\n description: 'Hex color with # prefix (e.g. \"#000000\") or theme color name',\n});\n\n// ----------------------------------------------------------------------------\n// Shared Text Formatting Properties\n// ----------------------------------------------------------------------------\n\n/**\n * Shared schema for text formatting properties.\n * Used as base for both font definitions and style definitions.\n */\nexport const TextFormattingPropertiesSchema = Type.Object(\n {\n size: Type.Optional(Type.Number({ minimum: 8, maximum: 72 })),\n color: Type.Optional(HexColorSchema),\n bold: Type.Optional(Type.Boolean()),\n italic: Type.Optional(Type.Boolean()),\n underline: Type.Optional(Type.Boolean()),\n lineSpacing: Type.Optional(\n Type.Object({\n type: Type.Union([\n Type.Literal('single'),\n Type.Literal('atLeast'),\n Type.Literal('exactly'),\n Type.Literal('double'),\n Type.Literal('multiple'),\n ]),\n value: Type.Optional(Type.Number({ minimum: 0 })),\n })\n ),\n spacing: Type.Optional(\n Type.Object({\n before: Type.Optional(Type.Number({ minimum: 0 })),\n after: Type.Optional(Type.Number({ minimum: 0 })),\n })\n ),\n characterSpacing: Type.Optional(\n Type.Object({\n type: Type.Union([Type.Literal('condensed'), Type.Literal('expanded')]),\n value: Type.Number(),\n })\n ),\n },\n { additionalProperties: false }\n);\n\n// ----------------------------------------------------------------------------\n// Font Definition Schema\n// ----------------------------------------------------------------------------\n\n/**\n * Font definition schema with full text formatting properties.\n * All properties except 'family' are optional.\n */\nexport const FontDefinitionSchema = Type.Object(\n {\n family: Type.String(),\n ...TextFormattingPropertiesSchema.properties,\n },\n {\n description:\n 'Font definition with family and optional formatting properties',\n additionalProperties: false,\n }\n);\n"],"mappings":";AAKA,SAAS,YAAY;AAOd,IAAM,iBAAiB,KAAK,OAAO;AAAA,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AAO;AAAA,IACpB,GAAG,+BAA+B;AAAA,EACpC;AAAA,EACA;AAAA,IACE,aACE;AAAA,IACF,sBAAsB;AAAA,EACxB;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/validation/unified/index.ts","../src/validation/unified/error-formatter-config.ts","../src/validation/unified/theme-validator.ts","../src/validation/unified/component-validator.ts"],"sourcesContent":["/**\n * Unified validation facade\n * Simple, clean API for all validation needs\n */\n\n// Format-agnostic types re-exported from @json-to-office/shared\nexport type { ValidationError, ValidationResult } from '@json-to-office/shared';\n\n// Docx-specific extended types (local)\nexport type {\n ValidationOptions,\n JsonValidationResult,\n ThemeValidationResult,\n DocumentValidationResult,\n ComponentValidationResult,\n EnhancedValueError,\n} from './types';\n\n// Format-agnostic error utilities re-exported from @json-to-office/shared\nexport {\n transformValueError,\n transformValueErrors,\n calculatePosition,\n formatErrorSummary,\n groupErrorsByPath,\n createJsonParseError,\n} from '@json-to-office/shared';\n\n// Docx-specific error transformer (local, extends shared with docx-specific messages)\nexport {\n transformValueError as transformDocxValueError,\n transformValueErrors as transformDocxValueErrors,\n} from './error-transformer';\n\n// Export deep validation utilities (docx-specific)\nexport {\n deepValidateDocument,\n comprehensiveValidateDocument,\n} from './deep-validator';\n\n// Format-agnostic schema utilities re-exported from @json-to-office/shared\nexport {\n isUnionSchema,\n isObjectSchema,\n isLiteralSchema,\n getObjectSchemaPropertyNames,\n getLiteralValue,\n extractStandardComponentNames,\n clearComponentNamesCache,\n getSchemaMetadata,\n} from '@json-to-office/shared';\n\n// Format-agnostic error formatter config re-exported from @json-to-office/shared\nexport {\n type ErrorFormatterConfig,\n DEFAULT_ERROR_CONFIG,\n ERROR_EMOJIS,\n createErrorConfig,\n formatErrorMessage,\n} from '@json-to-office/shared';\n\n// Docx-specific error formatter extras (local)\nexport { ERROR_TEMPLATES, DOC_LINKS } from './error-formatter-config';\n\n// Export base validator utilities\nexport {\n validateAgainstSchema,\n validateJson,\n validateBatch,\n validateWithEnhancement,\n createValidator,\n createJsonValidator,\n isValidationSuccess,\n getValidationSummary,\n} from './base-validator';\n\n// Export document validation\nexport {\n validateDocument,\n validateJsonDocument,\n isValidDocument,\n createDocumentValidator,\n documentValidator,\n strictDocumentValidator,\n // Legacy compatibility\n validateJsonComponent,\n validateDocumentWithSchema,\n} from './document-validator';\n\n// Export theme validation\nexport {\n validateTheme,\n validateThemeJson,\n validateThemeWithEnhancement,\n isValidTheme,\n createThemeValidator,\n themeValidator,\n strictThemeValidator,\n getThemeName,\n isThemeConfig,\n} from './theme-validator';\n\n// Export component validation\nexport {\n validateComponent,\n validateComponentDefinition,\n validateCustomComponentProps,\n validateComponents,\n isStandardComponentName,\n createComponentValidator,\n componentValidator,\n strictComponentValidator,\n // Type guards\n isReportProps,\n isSectionProps,\n isHeadingProps,\n isParagraphProps,\n isColumnsProps,\n isImageProps,\n isStatisticProps,\n isTableProps,\n isHeaderProps,\n isFooterProps,\n isListProps,\n isCustomComponentProps,\n // Types\n type StandardComponentName,\n} from './component-validator';\n\n// Import the validators we need\nimport {\n documentValidator,\n strictDocumentValidator,\n} from './document-validator';\nimport { themeValidator, strictThemeValidator } from './theme-validator';\nimport {\n componentValidator,\n strictComponentValidator,\n} from './component-validator';\n\n/**\n * Simple validation API\n * The main entry point for most validation needs\n */\nexport const validate = {\n // Document validation\n document: (data: unknown) => documentValidator.validate(data),\n jsonDocument: (jsonInput: string | object) =>\n documentValidator.validateJson(jsonInput),\n\n // Theme validation\n theme: (data: unknown) => themeValidator.validate(data),\n jsonTheme: (jsonInput: string | object) =>\n themeValidator.validateJson(jsonInput),\n\n // Component validation\n component: (name: string, props: unknown) =>\n componentValidator.validate(name, props),\n componentDefinition: (component: unknown) =>\n componentValidator.validateDefinition(component),\n\n // Batch operations\n components: (components: Array<{ name: string; props: unknown }>) =>\n components.map((c) => componentValidator.validate(c.name, c.props)),\n\n // Type checking (non-throwing)\n isDocument: (data: unknown) => {\n const result = documentValidator.validate(data);\n return result.valid;\n },\n isTheme: (data: unknown) => {\n const result = themeValidator.validate(data);\n return result.valid;\n },\n isComponent: (name: string, props: unknown) => {\n const result = componentValidator.validate(name, props);\n return result.valid;\n },\n};\n\n/**\n * Strict validation API\n * For cases where you want no cleaning or defaults\n */\nexport const validateStrict = {\n document: (data: unknown) => strictDocumentValidator.validate(data),\n jsonDocument: (jsonInput: string | object) =>\n strictDocumentValidator.validateJson(jsonInput),\n theme: (data: unknown) => strictThemeValidator.validate(data),\n jsonTheme: (jsonInput: string | object) =>\n strictThemeValidator.validateJson(jsonInput),\n component: (name: string, props: unknown) =>\n strictComponentValidator.validate(name, props),\n componentDefinition: (component: unknown) =>\n strictComponentValidator.validateDefinition(component),\n};\n","/**\n * Error Formatter Configuration\n * Configurable error message formatting options\n */\n\n/**\n * Error formatter configuration options\n */\nexport interface ErrorFormatterConfig {\n /**\n * Include emoji indicators in error messages\n * Default: true (false in CI environments)\n */\n includeEmojis?: boolean;\n\n /**\n * Verbosity level for error messages\n * - minimal: Just the error message\n * - normal: Error message with path\n * - detailed: Full error with suggestions and context\n * Default: 'normal'\n */\n verbosity?: 'minimal' | 'normal' | 'detailed';\n\n /**\n * Include suggestions for fixing errors\n * Default: true\n */\n includeSuggestions?: boolean;\n\n /**\n * Include stack trace or error path\n * Default: true\n */\n includePath?: boolean;\n\n /**\n * Maximum error message length (0 = unlimited)\n * Default: 0\n */\n maxMessageLength?: number;\n\n /**\n * Include links to documentation\n * Default: false\n */\n includeDocLinks?: boolean;\n\n /**\n * Terminal color support\n * Default: auto-detected\n */\n colorSupport?: boolean;\n}\n\n/**\n * Get default configuration\n * Evaluates environment variables at call time, not module load time\n */\nfunction getDefaultConfig(): Required<ErrorFormatterConfig> {\n return {\n includeEmojis: !isCI(),\n verbosity: 'normal',\n includeSuggestions: true,\n includePath: true,\n maxMessageLength: 0,\n includeDocLinks: false,\n colorSupport: hasColorSupport(),\n };\n}\n\n/**\n * Default configuration (for backward compatibility)\n */\nexport const DEFAULT_ERROR_CONFIG: Required<ErrorFormatterConfig> =\n getDefaultConfig();\n\n/**\n * Error message templates\n */\nexport const ERROR_TEMPLATES = {\n UNION_NO_MATCH: 'Value doesn\\'t match any of the expected formats',\n TYPE_MISMATCH: 'Expected {expected} but got {actual}',\n MISSING_REQUIRED: 'Missing required field \\'{field}\\'',\n UNKNOWN_PROPERTY: 'Unknown property \\'{property}\\'',\n INVALID_FORMAT: 'Invalid {type} format',\n PATTERN_MISMATCH: 'Value doesn\\'t match the required pattern',\n} as const;\n\n/**\n * Emoji indicators for different error types\n */\nexport const ERROR_EMOJIS = {\n ERROR: '❌',\n WARNING: '⚠️',\n INFO: 'ℹ️',\n SUGGESTION: '💡',\n FIX: '🔧',\n LINK: '🔗',\n} as const;\n\n/**\n * Documentation links for common errors\n */\nexport const DOC_LINKS = {\n MODULE_TYPES: 'https://docs.json-to-docx.com/modules',\n THEME_CONFIG: 'https://docs.json-to-docx.com/themes',\n VALIDATION: 'https://docs.json-to-docx.com/validation',\n} as const;\n\n/**\n * Detect if running in CI environment\n */\nfunction isCI(): boolean {\n // Check if we're in a Node environment\n if (typeof process === 'undefined' || !process.env) {\n return false;\n }\n\n return !!(\n process.env.CI ||\n process.env.CONTINUOUS_INTEGRATION ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.CIRCLECI ||\n process.env.TRAVIS ||\n process.env.JENKINS_URL\n );\n}\n\n/**\n * Detect terminal color support\n */\nfunction hasColorSupport(): boolean {\n // Check if we're in a Node environment\n if (typeof process === 'undefined') {\n return false;\n }\n\n // Check for explicit NO_COLOR env var\n if (process.env?.NO_COLOR) {\n return false;\n }\n\n // Check for explicit FORCE_COLOR env var\n if (process.env?.FORCE_COLOR) {\n return true;\n }\n\n // Check if stdout is a TTY\n if (process.stdout?.isTTY) {\n return true;\n }\n\n // Default to no color in CI environments\n return !isCI();\n}\n\n/**\n * Create a configuration with defaults\n */\nexport function createErrorConfig(\n config?: ErrorFormatterConfig\n): Required<ErrorFormatterConfig> {\n // Get fresh defaults that evaluate environment at call time\n const defaults = getDefaultConfig();\n return {\n ...defaults,\n ...config,\n };\n}\n\n/**\n * Format an error message based on configuration\n */\nexport function formatErrorMessage(\n message: string,\n config: ErrorFormatterConfig = {}\n): string {\n const finalConfig = createErrorConfig(config);\n\n let formatted = message;\n\n // Remove emojis if not wanted\n if (!finalConfig.includeEmojis) {\n Object.values(ERROR_EMOJIS).forEach((emoji) => {\n formatted = formatted.replace(new RegExp(emoji, 'g'), '');\n });\n // Clean up extra spaces\n formatted = formatted.replace(/\\s+/g, ' ').trim();\n }\n\n // Truncate if needed\n if (\n finalConfig.maxMessageLength > 0 &&\n formatted.length > finalConfig.maxMessageLength\n ) {\n formatted =\n formatted.substring(0, finalConfig.maxMessageLength - 3) + '...';\n }\n\n return formatted;\n}\n","/**\n * Theme validation implementation\n * Single source of truth for all theme validation\n */\n\nimport type { Static } from '@sinclair/typebox';\nimport { ThemeConfigSchema } from '../../schemas/theme';\nimport type { ValidationOptions } from './types';\nimport { validateAgainstSchema, validateJson } from './base-validator';\n\n// Re-export ThemeValidationResult type\nexport type { ThemeValidationResult } from './types';\nimport type { ThemeValidationResult } from './types';\n\n/**\n * Validate a theme configuration object\n */\nexport function validateTheme(\n data: unknown,\n options?: ValidationOptions\n): ThemeValidationResult {\n // Handle string input (theme name)\n if (typeof data === 'string') {\n // This is just a theme name, not a theme config\n // It will be resolved later by the theme resolver\n return {\n valid: true,\n themeName: data,\n };\n }\n\n const result = validateAgainstSchema(ThemeConfigSchema, data, options);\n\n // Add theme-specific metadata\n const themeResult: ThemeValidationResult = {\n ...result,\n };\n\n // Extract theme name if present\n if (result.valid && result.data) {\n const theme = result.data as any;\n if (theme.name) {\n themeResult.themeName = theme.name;\n }\n }\n\n return themeResult;\n}\n\n/**\n * Validate a theme JSON string or object\n * This replaces all three validateThemeJson implementations\n */\nexport function validateThemeJson(\n jsonInput: string | object,\n options?: ValidationOptions\n): ThemeValidationResult {\n const result = validateJson(ThemeConfigSchema, jsonInput, options);\n\n // Add theme-specific metadata\n const themeResult: ThemeValidationResult = {\n ...result,\n };\n\n // Extract theme name if present\n if (result.valid && result.data) {\n const theme = result.data as any;\n\n // Inject default $schema if missing and it's an object\n if (typeof theme === 'object' && !theme.$schema) {\n theme.$schema = './json-schemas/theme.schema.json';\n }\n\n if (theme.name) {\n themeResult.themeName = theme.name;\n }\n }\n\n return themeResult;\n}\n\n/**\n * Validate theme with enhanced error messages\n */\nexport function validateThemeWithEnhancement(\n data: unknown,\n options?: ValidationOptions\n): ThemeValidationResult {\n const result = validateTheme(data, options);\n\n // Enhance errors with theme-specific suggestions\n if (!result.valid && result.errors) {\n result.errors = result.errors.map((error) => {\n // Add specific suggestions for common theme errors\n if (error.path.includes('colors') && !error.suggestion) {\n error.suggestion = 'Colors must be valid hex, rgb, or named colors';\n }\n if (error.path.includes('fonts') && !error.suggestion) {\n error.suggestion = 'Fonts must include size and family properties';\n }\n if (error.path.includes('headings') && !error.suggestion) {\n error.suggestion = 'Headings must be an array of 6 style definitions';\n }\n return error;\n });\n }\n\n return result;\n}\n\n/**\n * Type guard for valid theme result\n */\nexport function isValidTheme(\n result: ThemeValidationResult\n): result is ThemeValidationResult & {\n valid: true;\n data: Static<typeof ThemeConfigSchema>;\n} {\n return result.valid === true && result.data !== undefined;\n}\n\n/**\n * Create a theme validator with default options\n */\nexport function createThemeValidator(defaultOptions?: ValidationOptions) {\n return {\n validate: (data: unknown, options?: ValidationOptions) =>\n validateTheme(data, { ...defaultOptions, ...options }),\n validateJson: (jsonInput: string | object, options?: ValidationOptions) =>\n validateThemeJson(jsonInput, { ...defaultOptions, ...options }),\n validateWithEnhancement: (data: unknown, options?: ValidationOptions) =>\n validateThemeWithEnhancement(data, { ...defaultOptions, ...options }),\n };\n}\n\n// Export convenient validators with common configurations\nexport const themeValidator = createThemeValidator({\n clean: true,\n applyDefaults: true,\n});\n\nexport const strictThemeValidator = createThemeValidator({\n clean: false,\n applyDefaults: false,\n maxErrors: 10,\n});\n\n/**\n * Get theme name from data\n */\nexport function getThemeName(data: unknown): string | undefined {\n if (typeof data === 'string') {\n return data;\n }\n\n if (typeof data === 'object' && data !== null && 'name' in data) {\n const theme = data as any;\n if (typeof theme.name === 'string') {\n return theme.name;\n }\n }\n\n return undefined;\n}\n\n/**\n * Check if theme config is valid (basic check without full validation)\n */\nexport function isThemeConfig(data: unknown): boolean {\n if (!data || typeof data !== 'object') {\n return false;\n }\n\n const theme = data as any;\n return !!(theme.colors && theme.fonts);\n}\n","/**\n * Component validation implementation\n * Single source of truth for all component validation\n */\n\nimport { Value } from '@sinclair/typebox/value';\nimport type { Static, TSchema } from '@sinclair/typebox';\nimport { validateCustomComponentProps as sharedValidateCustomComponentProps } from '@json-to-office/shared/plugin';\nimport {\n ReportPropsSchema,\n SectionPropsSchema,\n HeadingPropsSchema,\n ParagraphPropsSchema,\n ColumnsPropsSchema,\n ImagePropsSchema,\n StatisticPropsSchema,\n TablePropsSchema,\n HeaderPropsSchema,\n FooterPropsSchema,\n ListPropsSchema,\n ComponentDefinitionSchema,\n} from '../../schemas/components';\nimport { CustomComponentDefinitionSchema } from '../../schemas/custom-components';\nimport type { ComponentValidationResult, ValidationOptions } from './types';\nimport { validateAgainstSchema } from './base-validator';\n\n// Map of standard component names to their schemas\nconst COMPONENT_SCHEMA_MAP = {\n report: ReportPropsSchema,\n section: SectionPropsSchema,\n heading: HeadingPropsSchema,\n paragraph: ParagraphPropsSchema,\n columns: ColumnsPropsSchema,\n image: ImagePropsSchema,\n statistic: StatisticPropsSchema,\n table: TablePropsSchema,\n header: HeaderPropsSchema,\n footer: FooterPropsSchema,\n list: ListPropsSchema,\n custom: CustomComponentDefinitionSchema,\n} as const;\n\nexport type StandardComponentName = keyof typeof COMPONENT_SCHEMA_MAP;\n\n/**\n * Validate a component configuration by type\n */\nexport function validateComponent<T extends StandardComponentName>(\n name: T,\n props: unknown,\n options?: ValidationOptions\n): ComponentValidationResult<any> {\n const schema = COMPONENT_SCHEMA_MAP[name];\n\n if (!schema) {\n // Unknown component type, try custom component schema\n const customResult = validateAgainstSchema(\n CustomComponentDefinitionSchema,\n props,\n options\n );\n\n return {\n ...customResult,\n success: customResult.valid, // Add success for backward compatibility\n componentName: name,\n isCustomComponent: true,\n };\n }\n\n const result = validateAgainstSchema(schema, props, options);\n\n return {\n ...result,\n success: result.valid, // Add success for backward compatibility\n componentName: name,\n isCustomComponent: name === 'custom',\n };\n}\n\n/**\n * Validate a complete component definition (including nested children)\n */\nexport function validateComponentDefinition(\n component: unknown,\n options?: ValidationOptions\n): ComponentValidationResult {\n const result = validateAgainstSchema(\n ComponentDefinitionSchema,\n component,\n options\n );\n\n // Add component-specific metadata\n const componentResult: ComponentValidationResult = {\n ...result,\n };\n\n if (result.valid && result.data) {\n const comp = result.data as any;\n componentResult.componentName = comp.name;\n componentResult.isCustomComponent = !isStandardComponentName(comp.name);\n }\n\n return componentResult;\n}\n\n/**\n * Validate a custom component configuration with a custom schema.\n * Delegates to @json-to-office/shared/plugin to avoid duplication.\n */\nexport function validateCustomComponentProps<T>(\n componentSchema: TSchema,\n config: unknown,\n options?: ValidationOptions\n): ComponentValidationResult<T> {\n return sharedValidateCustomComponentProps<T>(\n componentSchema,\n config,\n options\n );\n}\n\n/**\n * Batch validate multiple components\n */\nexport function validateComponents(\n components: Array<{ name: string; props: unknown }>,\n options?: ValidationOptions\n): ComponentValidationResult[] {\n return components.map(({ name, props }) => {\n if (isStandardComponentName(name)) {\n return validateComponent(name, props, options);\n }\n return validateComponent('custom', props, options);\n });\n}\n\n/**\n * Type guards for component names\n */\nexport function isStandardComponentName(\n name: string\n): name is StandardComponentName {\n return name in COMPONENT_SCHEMA_MAP;\n}\n\nexport function isReportProps(\n config: unknown\n): config is Static<typeof ReportPropsSchema> {\n return Value.Check(ReportPropsSchema, config);\n}\n\nexport function isSectionProps(\n config: unknown\n): config is Static<typeof SectionPropsSchema> {\n return Value.Check(SectionPropsSchema, config);\n}\n\nexport function isHeadingProps(\n config: unknown\n): config is Static<typeof HeadingPropsSchema> {\n return Value.Check(HeadingPropsSchema, config);\n}\n\nexport function isParagraphProps(\n config: unknown\n): config is Static<typeof ParagraphPropsSchema> {\n return Value.Check(ParagraphPropsSchema, config);\n}\n\nexport function isColumnsProps(\n config: unknown\n): config is Static<typeof ColumnsPropsSchema> {\n return Value.Check(ColumnsPropsSchema, config);\n}\n\nexport function isImageProps(\n config: unknown\n): config is Static<typeof ImagePropsSchema> {\n return Value.Check(ImagePropsSchema, config);\n}\n\nexport function isStatisticProps(\n config: unknown\n): config is Static<typeof StatisticPropsSchema> {\n return Value.Check(StatisticPropsSchema, config);\n}\n\nexport function isTableProps(\n config: unknown\n): config is Static<typeof TablePropsSchema> {\n return Value.Check(TablePropsSchema, config);\n}\n\nexport function isHeaderProps(\n config: unknown\n): config is Static<typeof HeaderPropsSchema> {\n return Value.Check(HeaderPropsSchema, config);\n}\n\nexport function isFooterProps(\n config: unknown\n): config is Static<typeof FooterPropsSchema> {\n return Value.Check(FooterPropsSchema, config);\n}\n\nexport function isListProps(\n config: unknown\n): config is Static<typeof ListPropsSchema> {\n return Value.Check(ListPropsSchema, config);\n}\n\nexport function isCustomComponentProps(\n config: unknown\n): config is Static<typeof CustomComponentDefinitionSchema> {\n return Value.Check(CustomComponentDefinitionSchema, config);\n}\n\n/**\n * Create a component validator with default options\n */\nexport function createComponentValidator(defaultOptions?: ValidationOptions) {\n return {\n validate: (name: string, props: unknown, options?: ValidationOptions) => {\n if (isStandardComponentName(name)) {\n return validateComponent(name, props, {\n ...defaultOptions,\n ...options,\n });\n }\n return validateComponent('custom', props, {\n ...defaultOptions,\n ...options,\n });\n },\n validateDefinition: (component: unknown, options?: ValidationOptions) =>\n validateComponentDefinition(component, { ...defaultOptions, ...options }),\n validateCustom: <T>(\n schema: TSchema,\n config: unknown,\n options?: ValidationOptions\n ) =>\n validateCustomComponentProps<T>(schema, config, {\n ...defaultOptions,\n ...options,\n }),\n };\n}\n\n// Export convenient validators with common configurations\nexport const componentValidator = createComponentValidator({\n clean: true,\n applyDefaults: true,\n});\n\nexport const strictComponentValidator = createComponentValidator({\n clean: false,\n applyDefaults: false,\n maxErrors: 10,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAeP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EAEE,wBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACAP,SAAS,mBAAmD;AAC1D,SAAO;AAAA,IACL,eAAe,CAAC,KAAK;AAAA,IACrB,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,cAAc,gBAAgB;AAAA,EAChC;AACF;AAKO,IAAM,uBACX,iBAAiB;AAKZ,IAAM,kBAAkB;AAAA,EAC7B,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,kBAAkB;AACpB;AAiBO,IAAM,YAAY;AAAA,EACvB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,YAAY;AACd;AAKA,SAAS,OAAgB;AAEvB,MAAI,OAAO,YAAY,eAAe,CAAC,QAAQ,KAAK;AAClD,WAAO;AAAA,EACT;AAEA,SAAO,CAAC,EACN,QAAQ,IAAI,MACZ,QAAQ,IAAI,0BACZ,QAAQ,IAAI,kBACZ,QAAQ,IAAI,aACZ,QAAQ,IAAI,YACZ,QAAQ,IAAI,UACZ,QAAQ,IAAI;AAEhB;AAKA,SAAS,kBAA2B;AAElC,MAAI,OAAO,YAAY,aAAa;AAClC,WAAO;AAAA,EACT;AAGA,MAAI,QAAQ,KAAK,UAAU;AACzB,WA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B,SAAS,IAAI;AAAA,EAClE,cAAc,CAAC,cACb,wBAAwB,aAAa,SAAS;AAAA,EAChD,OAAO,CAAC,SAAkB,qBAAqB,SAAS,IAAI;AAAA,EAC5D,WAAW,CAAC,cACV,qBAAqB,aAAa,SAAS;AAAA,EAC7C,WAAW,CAAC,MAAc,UACxB,yBAAyB,SAAS,MAAM,KAAK;AAAA,EAC/C,qBAAqB,CAAC,cACpB,yBAAyB,mBAAmB,SAAS;AACzD;","names":["DEFAULT_ERROR_CONFIG"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/validation/unified/error-transformer.ts","../src/validation/unified/deep-validator.ts","../src/validation/unified/base-validator.ts","../src/validation/unified/document-validator.ts"],"sourcesContent":["/**\n * Unified error transformation utilities\n * Converts TypeBox ValueError objects to standardized ValidationError format\n */\n\nimport type { ValueError } from '@sinclair/typebox/value';\nimport type { ValidationError } from '@json-to-office/shared';\nimport { ReportPropsSchema } from '../../schemas/components/report';\nimport {\n isObjectSchema,\n getObjectSchemaPropertyNames,\n getLiteralValue,\n type ErrorFormatterConfig,\n createErrorConfig,\n formatErrorMessage,\n ERROR_EMOJIS,\n} from '@json-to-office/shared';\n\n/**\n * Generate enhanced error message based on error type and context\n */\nfunction generateEnhancedMessage(\n error: ValueError,\n _config: Required<ErrorFormatterConfig>\n): string {\n const typeStr = String(error.type || '');\n const path = error.path || 'root';\n\n // Handle union errors specially - these are the most common and least helpful\n if (typeStr === '62' || typeStr === 'union') {\n return generateUnionErrorMessage(error);\n }\n\n // Handle additional properties error\n if (error.message?.includes('additionalProperties')) {\n return generateAdditionalPropertiesMessage(error);\n }\n\n // Handle missing required properties\n if (error.message?.includes('Required property')) {\n return generateRequiredPropertyMessage(error);\n }\n\n // Handle type mismatches\n if (\n typeStr === 'string' ||\n typeStr === 'number' ||\n typeStr === 'boolean' ||\n typeStr === 'array' ||\n typeStr === 'object'\n ) {\n return generateTypeMismatchMessage(error);\n }\n\n // Handle literal value errors\n if (typeStr === 'literal') {\n return generateLiteralErrorMessage(error);\n }\n\n // Handle pattern/regex errors\n if (typeStr === 'pattern' || typeStr === 'RegExp') {\n return generatePatternErrorMessage(error);\n }\n\n // Default to original message with some context\n return `At ${path}: ${error.message}`;\n}\n\n/**\n * Generate message for union validation errors\n */\nfunction generateUnionErrorMessage(error: ValueError): string {\n const path = error.path || 'root';\n const value = error.value;\n\n // Try to determine what the user was attempting\n if (path === 'root' || path === '/' || path === '/jsonDefinition') {\n // Root level or jsonDefinition union error - likely a document type issue\n if (value && typeof value === 'object') {\n if ('name' in value) {\n const name = value.name;\n if (name === 'docx') {\n return 'Document structure appears valid but contains invalid component configurations. Check each component for errors.';\n }\n return `Unknown document name '${name}'. Expected 'docx'.`;\n }\n\n // Missing name field\n const valueAny = value as Record<string, unknown>;\n if ('children' in value && Array.isArray(valueAny.children)) {\n return 'Document is missing required \\'name\\' field. Add \"name\": \"docx\" at the root level.';\n }\n\n // Check if it might be a theme\n if ('name' in value || 'styles' in value) {\n return 'This appears to be a theme configuration. Use --type theme or ensure proper document structure.';\n }\n }\n return 'Invalid document structure. Expected a document with name=\"docx\" or a theme configuration.';\n }\n\n // Component-level union error\n if (path.includes('/children/')) {\n if (value && typeof value === 'object' && 'name' in value) {\n const componentType = (value as any).name;\n return `Invalid component configuration for type '${componentType}'. Check that all required fields are present and correctly formatted.`;\n }\n return 'Invalid component structure. Each component must have a \"name\" field and valid configuration.';\n }\n\n // Default union error message\n return `Value at ${path} doesn't match any of the expected formats. Check the structure and required fields.`;\n}\n\n/**\n * Generate message for additional properties errors\n */\nfunction generateAdditionalPropertiesMessage(error: ValueError): string {\n const path = error.path || 'root';\n const value = error.value;\n\n if (typeof value === 'object' && value !== null) {\n // Try to identify the unknown properties\n const schema = error.schema;\n if (schema && isObjectSchema(schema)) {\n const knownProps = getObjectSchemaPropertyNames(schema);\n const actualProps = Object.keys(value);\n const unknownProps = actualProps.filter((p) => !knownProps.includes(p));\n\n if (unknownProps.length > 0) {\n return (\n `Unknown properties at ${path}: ${unknownProps.join(', ')}. ` +\n `Allowed properties are: ${knownProps.join(', ')}`\n );\n }\n }\n }\n\n return `Additional properties not allowed at ${path}. Check for typos or unsupported fields.`;\n}\n\n/**\n * Generate message for required property errors\n */\nfunction generateRequiredPropertyMessage(error: ValueError): string {\n const path = error.path || 'root';\n const match = error.message?.match(/Required property '([^']+)'/);\n\n if (match) {\n const propName = match[1];\n return `Missing required field '${propName}' at ${path}. This field is mandatory for this configuration.`;\n }\n\n return `Missing required property at ${path}. Check that all mandatory fields are present.`;\n}\n\n/**\n * Generate message for type mismatch errors\n */\nfunction generateTypeMismatchMessage(error: ValueError): string {\n const path = error.path || 'root';\n const expectedType = String(error.type);\n const actualType = Array.isArray(error.value) ? 'array' : typeof error.value;\n\n // Provide context-specific messages\n if (path.includes('alignment')) {\n return `Invalid alignment value at ${path}. Expected one of: left, center, right, justify`;\n }\n\n if (path.includes('color')) {\n return `Invalid color value at ${path}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`;\n }\n\n if (path.includes('fontSize') || path.includes('size')) {\n return `Invalid size value at ${path}. Expected a number (in points)`;\n }\n\n if (\n path.includes('margin') ||\n path.includes('padding') ||\n path.includes('spacing')\n ) {\n return `Invalid spacing value at ${path}. Expected a number or spacing object with top/bottom/left/right`;\n }\n\n return `Type mismatch at ${path}: Expected ${expectedType} but got ${actualType}`;\n}\n\n/**\n * Generate message for literal value errors\n */\nfunction generateLiteralErrorMessage(error: ValueError): string {\n const path = error.path || 'root';\n const expected = error.schema\n ? JSON.stringify(getLiteralValue(error.schema))\n : 'specific value';\n const actual = JSON.stringify(error.value);\n\n return `Invalid value at ${path}: Expected exactly ${expected} but got ${actual}`;\n}\n\n/**\n * Generate message for pattern/regex errors\n */\nfunction generatePatternErrorMessage(error: ValueError): string {\n const path = error.path || 'root';\n\n // Try to provide helpful context based on the path\n if (path.includes('email')) {\n return `Invalid email format at ${path}. Use format: user@example.com`;\n }\n\n if (path.includes('url') || path.includes('link')) {\n return `Invalid URL format at ${path}. Use format: https://example.com`;\n }\n\n if (path.includes('date')) {\n return `Invalid date format at ${path}. Use ISO format: YYYY-MM-DD`;\n }\n\n if (path.includes('phone')) {\n return `Invalid phone number format at ${path}`;\n }\n\n return `Value at ${path} doesn't match the required pattern`;\n}\n\n/**\n * Transform TypeBox ValueError to standardized ValidationError\n */\nexport function transformValueError(\n error: ValueError,\n jsonString?: string,\n config?: ErrorFormatterConfig\n): ValidationError {\n const formatterConfig = createErrorConfig(config);\n\n // Generate enhanced message based on error type\n const enhancedMessage = generateEnhancedMessage(error, formatterConfig);\n\n const baseError: ValidationError = {\n path: error.path || 'root',\n message: formatErrorMessage(\n enhancedMessage || error.message,\n formatterConfig\n ),\n code: String(error.type || 'validation_error'),\n value: error.value,\n };\n\n // Add suggestion if available and configured\n if (formatterConfig.includeSuggestions) {\n const suggestion = getSuggestion(error, formatterConfig);\n if (suggestion) {\n baseError.suggestion = formatErrorMessage(suggestion, formatterConfig);\n }\n }\n\n // Calculate line and column if JSON string is provided\n if (jsonString && error.path) {\n const position = calculatePosition(jsonString, error.path);\n if (position) {\n baseError.line = position.line;\n baseError.column = position.column;\n }\n }\n\n return baseError;\n}\n\n/**\n * Transform multiple TypeBox errors to ValidationError array\n * Enhanced to collect ALL errors, not just stopping at union failures\n */\nexport function transformValueErrors(\n errors: ValueError[],\n options?: {\n jsonString?: string;\n maxErrors?: number;\n }\n): ValidationError[] {\n const maxErrors = options?.maxErrors ?? Number.MAX_SAFE_INTEGER;\n const result: ValidationError[] = [];\n const seenPaths = new Set<string>();\n\n // Collect all errors, but avoid duplicates at the same path\n for (const error of errors) {\n if (result.length >= maxErrors) break;\n\n // Create a unique key for this error based on path and type\n const errorKey = `${error.path}:${error.type}`;\n\n // Skip if we've already seen an error at this exact path and type\n // This helps avoid duplicate union errors while still showing all unique issues\n if (!seenPaths.has(errorKey)) {\n seenPaths.add(errorKey);\n result.push(transformValueError(error, options?.jsonString, undefined));\n }\n }\n\n return result;\n}\n\n/**\n * Calculate line and column position in JSON string\n */\nexport function calculatePosition(\n jsonString: string,\n path: string\n): { line: number; column: number } | null {\n try {\n // Convert path like \"/children/0/props/title\" to searchable parts\n const pathParts = path.split('/').filter(Boolean);\n if (pathParts.length === 0) {\n return { line: 1, column: 1 };\n }\n\n // Try to find the last part of the path in the JSON\n const lastPart = pathParts[pathParts.length - 1];\n const searchPattern = `\"${lastPart}\"`;\n const index = jsonString.indexOf(searchPattern);\n\n if (index === -1) {\n // Try to find just the value if it's a property name\n return { line: 1, column: 1 };\n }\n\n // Calculate line and column from index\n const beforeError = jsonString.substring(0, index);\n const lines = beforeError.split('\\n');\n const line = lines.length;\n const column = lines[lines.length - 1].length + 1;\n\n return { line, column };\n } catch {\n return null;\n }\n}\n\n/**\n * Get helpful suggestion based on error type and context\n */\nfunction getSuggestion(\n error: ValueError,\n config: Required<ErrorFormatterConfig>\n): string | undefined {\n const { type, path, value } = error;\n const typeStr = String(type);\n\n // Enhanced suggestions for union errors\n if (typeStr === '62' || typeStr === 'union') {\n if (path === 'root' || path === '/') {\n if (value && typeof value === 'object') {\n if (!('name' in value)) {\n const msg = 'Add a \"name\" field with value \"docx\" for documents';\n return config.includeEmojis ? `${ERROR_EMOJIS.FIX} ${msg}` : msg;\n }\n if ('props' in value && typeof value.props === 'object') {\n const knownFields = getObjectSchemaPropertyNames(ReportPropsSchema);\n return `Review the props section for unsupported fields. Allowed fields: ${knownFields.join(', ')}`;\n }\n }\n return 'Ensure the document has proper structure: { \"name\": \"docx\", \"props\": {...}, \"children\": [...] }';\n }\n if (path?.includes('/children/')) {\n return 'Check that the component has a valid \"name\" and all required fields for that component type';\n }\n return 'Review the structure and ensure all required fields are present with correct types';\n }\n\n // Suggestions for additional properties errors\n if (error.message?.includes('additionalProperties')) {\n return 'Remove any unknown or unsupported fields. Check documentation for allowed properties.';\n }\n\n // Suggestions for required properties\n if (error.message?.includes('Required property')) {\n return 'Add the missing required field to fix this error';\n }\n\n // Type-specific suggestions\n if (typeStr === 'string') {\n if (path?.includes('alignment')) {\n return 'Use one of: left, center, right, justify';\n }\n if (path?.includes('color')) {\n return 'Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)';\n }\n return 'Provide a text string value';\n }\n\n if (typeStr === 'number') {\n if (path?.includes('fontSize') || path?.includes('size')) {\n return 'Use a number in points (e.g., 12, 14, 16)';\n }\n if (path?.includes('margin') || path?.includes('padding')) {\n return 'Use a number for spacing in points';\n }\n return 'Provide a numeric value';\n }\n\n if (typeStr === 'boolean') {\n return 'Use true or false (without quotes)';\n }\n\n if (typeStr === 'array') {\n if (path?.includes('children') || path?.includes('modules')) {\n return 'Provide an array of component objects, each with a \"name\" field';\n }\n return 'Provide an array/list of values using square brackets []';\n }\n\n if (typeStr === 'object') {\n return 'Provide an object with key-value pairs using curly braces {}';\n }\n\n if (typeStr === 'literal') {\n const expected = error.schema\n ? JSON.stringify(getLiteralValue(error.schema))\n : 'specific value';\n return `Use exactly this value: ${expected}`;\n }\n\n if (typeStr === 'pattern' || typeStr === 'RegExp') {\n if (path?.includes('email')) {\n return 'Use valid email format: user@example.com';\n }\n if (path?.includes('url')) {\n return 'Use valid URL format: https://example.com';\n }\n if (path?.includes('date')) {\n return 'Use ISO date format: YYYY-MM-DD';\n }\n return 'Ensure the value matches the required format';\n }\n\n // Path-based suggestions\n if (path?.includes('name') || path?.includes('type')) {\n return 'Use a valid component name: docx, section, columns, heading, paragraph, image, statistic, table, header, footer, list, toc, text-box, or highcharts';\n }\n\n return undefined;\n}\n\n/**\n * Format validation errors as a summary string\n */\nexport function formatErrorSummary(errors: ValidationError[]): string {\n if (errors.length === 0) return 'No errors';\n\n if (errors.length === 1) {\n return errors[0].message;\n }\n\n const summary = errors\n .slice(0, 3)\n .map((e) => `${e.path}: ${e.message}`)\n .join(', ');\n\n if (errors.length > 3) {\n return `${summary} and ${errors.length - 3} more...`;\n }\n\n return summary;\n}\n\n/**\n * Group errors by path for better reporting\n */\nexport function groupErrorsByPath(\n errors: ValidationError[]\n): Map<string, ValidationError[]> {\n const grouped = new Map<string, ValidationError[]>();\n\n for (const error of errors) {\n const path = error.path || 'root';\n const group = grouped.get(path) || [];\n group.push(error);\n grouped.set(path, group);\n }\n\n return grouped;\n}\n\n/**\n * Create a JSON parse error\n */\nexport function createJsonParseError(\n error: Error,\n jsonString: string\n): ValidationError {\n // Try to extract position from error message\n const match = error.message.match(/position (\\d+)/);\n const position = match ? parseInt(match[1], 10) : 0;\n\n let line = 1;\n let column = 1;\n\n if (position > 0) {\n const lines = jsonString.substring(0, position).split('\\n');\n line = lines.length;\n column = lines[lines.length - 1].length + 1;\n }\n\n return {\n path: 'root',\n message: `JSON Parse Error: ${error.message}`,\n code: 'json_parse_error',\n line,\n column,\n suggestion: 'Check for missing commas, quotes, or brackets',\n };\n}\n","/**\n * Deep validation utilities for collecting ALL errors in nested structures\n * This bypasses TypeBox's union short-circuiting to provide comprehensive error reporting\n */\n\nimport { Value } from '@sinclair/typebox/value';\nimport type { TSchema } from '@sinclair/typebox';\nimport type { ValidationError } from '@json-to-office/shared';\nimport {\n ReportPropsSchema,\n SectionPropsSchema,\n HeadingPropsSchema,\n ParagraphPropsSchema,\n TablePropsSchema,\n ImagePropsSchema,\n ListPropsSchema,\n StatisticPropsSchema,\n ColumnsPropsSchema,\n HeaderPropsSchema,\n FooterPropsSchema,\n} from '../../schemas/components';\nimport { CustomComponentDefinitionSchema } from '../../schemas/custom-components';\nimport { transformValueErrors } from './error-transformer';\n\n// Map of component names to their schemas\nconst COMPONENT_SCHEMAS: Record<string, TSchema> = {\n report: ReportPropsSchema,\n section: SectionPropsSchema,\n heading: HeadingPropsSchema,\n paragraph: ParagraphPropsSchema,\n table: TablePropsSchema,\n image: ImagePropsSchema,\n list: ListPropsSchema,\n statistic: StatisticPropsSchema,\n columns: ColumnsPropsSchema,\n header: HeaderPropsSchema,\n footer: FooterPropsSchema,\n custom: CustomComponentDefinitionSchema,\n};\n\n/**\n * Deep validate a document to collect ALL errors, not just union-level errors\n */\nexport function deepValidateDocument(data: any): ValidationError[] {\n const allErrors: ValidationError[] = [];\n\n // Validate the document structure\n if (!data || typeof data !== 'object') {\n allErrors.push({\n path: 'root',\n message: 'Document must be an object',\n code: 'invalid_type',\n });\n return allErrors;\n }\n\n // Check name field\n if (!data.name) {\n allErrors.push({\n path: '/name',\n message: 'Missing required field \"name\"',\n code: 'required_property',\n });\n } else if (data.name !== 'docx') {\n allErrors.push({\n path: '/name',\n message: `Invalid name \"${data.name}\". Expected \"docx\"`,\n code: 'invalid_value',\n });\n }\n\n // Validate props section if present and name is docx\n if (data.name === 'docx' && data.props) {\n const propsErrors = validateComponentProps('docx', data.props, '/props');\n allErrors.push(...propsErrors);\n }\n\n // Validate children array\n if (!data.children) {\n allErrors.push({\n path: '/children',\n message: 'Missing required field \"children\"',\n code: 'required_property',\n });\n } else if (!Array.isArray(data.children)) {\n allErrors.push({\n path: '/children',\n message: 'Field \"children\" must be an array',\n code: 'invalid_type',\n });\n } else {\n // Validate each child component\n data.children.forEach((child: any, index: number) => {\n const childPath = `/children/${index}`;\n\n if (!child || typeof child !== 'object') {\n allErrors.push({\n path: childPath,\n message: 'Component must be an object',\n code: 'invalid_type',\n });\n return;\n }\n\n // Check component name\n if (!child.name) {\n allErrors.push({\n path: `${childPath}/name`,\n message: 'Component missing required field \"name\"',\n code: 'required_property',\n });\n return;\n }\n\n // Validate component props based on name\n if (child.props) {\n const componentErrors = validateComponentProps(\n child.name,\n child.props,\n `${childPath}/props`\n );\n allErrors.push(...componentErrors);\n } else if (child.name !== 'custom') {\n // Most components require props\n allErrors.push({\n path: `${childPath}/props`,\n message: 'Component missing required field \"props\"',\n code: 'required_property',\n });\n }\n\n // Special handling for section components (recursive)\n if (child.name === 'section' && child.children) {\n if (!Array.isArray(child.children)) {\n allErrors.push({\n path: `${childPath}/children`,\n message: 'Section children must be an array',\n code: 'invalid_type',\n });\n } else {\n // Recursively validate nested components\n child.children.forEach((nestedChild: any, nestedIndex: number) => {\n const nestedChildPath = `${childPath}/children/${nestedIndex}`;\n if (!nestedChild || typeof nestedChild !== 'object') {\n allErrors.push({\n path: nestedChildPath,\n message: 'Nested component must be an object',\n code: 'invalid_type',\n });\n return;\n }\n\n if (!nestedChild.name) {\n allErrors.push({\n path: `${nestedChildPath}/name`,\n message: 'Nested component missing required field \"name\"',\n code: 'required_property',\n });\n } else {\n if (nestedChild.props) {\n const nestedErrors = validateComponentProps(\n nestedChild.name,\n nestedChild.props,\n `${nestedChildPath}/props`\n );\n allErrors.push(...nestedErrors);\n } else if (nestedChild.name !== 'custom') {\n // Most components require props\n allErrors.push({\n path: `${nestedChildPath}/props`,\n message: 'Component missing required field \"props\"',\n code: 'required_property',\n });\n }\n }\n });\n }\n }\n });\n }\n\n return allErrors;\n}\n\n/**\n * Validate a component's props against its schema\n */\nfunction validateComponentProps(\n componentName: string,\n props: any,\n basePath: string\n): ValidationError[] {\n const errors: ValidationError[] = [];\n\n // Get the schema for this component\n const schema = COMPONENT_SCHEMAS[componentName];\n if (!schema) {\n // Unknown component type\n errors.push({\n path: basePath.replace('/props', '/name'),\n message: `Unknown component \"${componentName}\"`,\n code: 'unknown_component',\n });\n return errors;\n }\n\n // Use TypeBox to validate against the specific schema\n if (!Value.Check(schema, props)) {\n const valueErrors = [...Value.Errors(schema, props)];\n const transformedErrors = transformValueErrors(valueErrors, {\n maxErrors: 100,\n });\n\n // Adjust paths to be relative to the document root\n transformedErrors.forEach((error) => {\n // Combine base path with error path\n const fullPath =\n error.path === 'root'\n ? basePath\n : `${basePath}${error.path.startsWith('/') ? error.path : '/' + error.path}`;\n\n errors.push({\n ...error,\n path: fullPath,\n });\n });\n }\n\n return errors;\n}\n\n/**\n * Combine deep validation with standard validation\n */\nexport function comprehensiveValidateDocument(\n data: any,\n existingErrors: ValidationError[] = []\n): ValidationError[] {\n // First, get deep validation errors\n const deepErrors = deepValidateDocument(data);\n\n // If we got specific errors from deep validation, prefer those\n if (deepErrors.length > 0) {\n // Filter out any generic \"invalid component configurations\" errors\n const filteredExisting = existingErrors.filter(\n (e) =>\n !e.message.includes('invalid module configurations') &&\n !e.message.includes('invalid component configurations')\n );\n\n // Combine and deduplicate\n const allErrors = [...filteredExisting, ...deepErrors];\n const uniqueErrors = deduplicateErrors(allErrors);\n\n return uniqueErrors;\n }\n\n // Otherwise return the existing errors\n return existingErrors;\n}\n\n/**\n * Deduplicate errors by path and message\n */\nfunction deduplicateErrors(errors: ValidationError[]): ValidationError[] {\n const seen = new Set<string>();\n const unique: ValidationError[] = [];\n\n for (const error of errors) {\n const key = `${error.path}:${error.message}`;\n if (!seen.has(key)) {\n seen.add(key);\n unique.push(error);\n }\n }\n\n return unique;\n}\n","/**\n * Base validator implementation\n * Core validation logic that eliminates duplication across the codebase\n */\n\nimport { Value } from '@sinclair/typebox/value';\nimport type { Static, TSchema } from '@sinclair/typebox';\nimport type {\n ValidationResult,\n ValidationOptions,\n JsonValidationResult,\n} from './types';\nimport {\n transformValueErrors,\n createJsonParseError,\n formatErrorSummary,\n} from '@json-to-office/shared';\n\n/**\n * Base validation function that all specific validators use\n * This eliminates the repeated Value.Check -> Value.Errors -> map pattern\n */\nexport function validateAgainstSchema<T extends TSchema>(\n schema: T,\n data: unknown,\n options?: ValidationOptions\n): ValidationResult<Static<T>> {\n try {\n // Check if data matches the schema\n if (!Value.Check(schema, data)) {\n // Collect ALL errors (not just the first one)\n const errors = [...Value.Errors(schema, data)];\n const transformedErrors = transformValueErrors(errors, {\n jsonString: options?.jsonString,\n maxErrors: options?.maxErrors || 100, // Default to 100 if not specified\n });\n\n return {\n valid: false,\n errors: transformedErrors,\n };\n }\n\n // Data is valid, apply transformations if requested\n let processedData = data;\n\n if (options?.clean) {\n // Remove unknown properties\n processedData = Value.Clean(schema, Value.Clone(processedData));\n }\n\n if (options?.applyDefaults) {\n // Apply default values\n processedData = Value.Default(schema, processedData);\n }\n\n return {\n valid: true,\n data: processedData as Static<T>,\n };\n } catch (error) {\n // Handle unexpected errors\n return {\n valid: false,\n errors: [\n {\n path: 'root',\n message:\n error instanceof Error ? error.message : 'Unknown validation error',\n code: 'validation_exception',\n },\n ],\n };\n }\n}\n\n/**\n * Validate JSON string or object with schema\n */\nexport function validateJson<T extends TSchema>(\n schema: T,\n jsonInput: string | object,\n options?: ValidationOptions\n): JsonValidationResult<Static<T>> {\n // Handle string input\n if (typeof jsonInput === 'string') {\n // Basic input validation\n if (!jsonInput.trim()) {\n return {\n valid: false,\n errors: [\n {\n path: 'root',\n message: 'Input must be a non-empty string',\n code: 'empty_input',\n },\n ],\n isJsonError: true,\n };\n }\n\n // Try to parse JSON\n let parsed: unknown;\n try {\n parsed = JSON.parse(jsonInput);\n } catch (error) {\n if (error instanceof Error) {\n return {\n valid: false,\n errors: [createJsonParseError(error, jsonInput)],\n isJsonError: true,\n };\n }\n return {\n valid: false,\n errors: [\n {\n path: 'root',\n message: 'Failed to parse JSON',\n code: 'json_parse_error',\n },\n ],\n isJsonError: true,\n };\n }\n\n // Validate parsed object with position calculation\n const result = validateAgainstSchema(schema, parsed, {\n ...options,\n jsonString: jsonInput,\n calculatePosition: true,\n });\n\n return {\n ...result,\n parsed,\n isJsonError: false,\n };\n }\n\n // Handle object input directly\n const result = validateAgainstSchema(schema, jsonInput, options);\n return {\n ...result,\n parsed: jsonInput,\n isJsonError: false,\n };\n}\n\n/**\n * Batch validate multiple items\n */\nexport function validateBatch<T extends TSchema>(\n schema: T,\n items: unknown[],\n options?: ValidationOptions\n): ValidationResult<Static<T>[]> {\n const results: Static<T>[] = [];\n const allErrors: any[] = [];\n let hasErrors = false;\n\n for (let i = 0; i < items.length; i++) {\n const result = validateAgainstSchema(schema, items[i], options);\n\n if (result.valid && result.data) {\n results.push(result.data);\n } else {\n hasErrors = true;\n if (result.errors) {\n // Prefix errors with item index\n const prefixedErrors = result.errors.map((e) => ({\n ...e,\n path: `[${i}]${e.path ? '/' + e.path : ''}`,\n }));\n allErrors.push(...prefixedErrors);\n }\n }\n\n // Stop if we've hit the max errors\n if (options?.maxErrors && allErrors.length >= options.maxErrors) {\n break;\n }\n }\n\n if (hasErrors) {\n return {\n valid: false,\n errors: allErrors.slice(0, options?.maxErrors),\n };\n }\n\n return {\n valid: true,\n data: results,\n };\n}\n\n/**\n * Validate with custom error enhancement\n */\nexport function validateWithEnhancement<T extends TSchema>(\n schema: T,\n data: unknown,\n enhancer: (errors: any[]) => any[],\n options?: ValidationOptions\n): ValidationResult<Static<T>> {\n const result = validateAgainstSchema(schema, data, options);\n\n if (!result.valid && result.errors) {\n result.errors = enhancer(result.errors);\n }\n\n return result;\n}\n\n/**\n * Create a validator function for a specific schema\n */\nexport function createValidator<T extends TSchema>(\n schema: T,\n defaultOptions?: ValidationOptions\n) {\n return (data: unknown, options?: ValidationOptions) => {\n return validateAgainstSchema(schema, data, {\n ...defaultOptions,\n ...options,\n });\n };\n}\n\n/**\n * Create a JSON validator function for a specific schema\n */\nexport function createJsonValidator<T extends TSchema>(\n schema: T,\n defaultOptions?: ValidationOptions\n) {\n return (jsonInput: string | object, options?: ValidationOptions) => {\n return validateJson(schema, jsonInput, {\n ...defaultOptions,\n ...options,\n });\n };\n}\n\n/**\n * Utility to check if validation result is successful with type guard\n */\nexport function isValidationSuccess<T>(\n result: ValidationResult<T>\n): result is ValidationResult<T> & { valid: true; data: T } {\n return result.valid === true && result.data !== undefined;\n}\n\n/**\n * Get validation error summary\n */\nexport function getValidationSummary(result: ValidationResult): string {\n if (result.valid) {\n return 'Validation successful';\n }\n\n if (!result.errors || result.errors.length === 0) {\n return 'Validation failed with unknown error';\n }\n\n return formatErrorSummary(result.errors);\n}\n","/**\n * Document validation implementation\n * Single source of truth for all document validation\n */\n\nimport type { Static } from '@sinclair/typebox';\nimport {\n ComponentDefinitionSchema,\n StandardComponentDefinitionSchema,\n} from '../../schemas/components';\nimport { extractStandardComponentNames } from '@json-to-office/shared';\nimport { comprehensiveValidateDocument } from './deep-validator';\n\n// JsonComponentDefinitionSchema is just an alias for ComponentDefinitionSchema\nconst JsonComponentDefinitionSchema = ComponentDefinitionSchema;\nimport type { DocumentValidationResult, ValidationOptions } from './types';\nimport { validateAgainstSchema, validateJson } from './base-validator';\n\n/**\n * Validate a document/report component definition\n */\nexport function validateDocument(\n data: unknown,\n options?: ValidationOptions\n): DocumentValidationResult {\n const result = validateAgainstSchema(ComponentDefinitionSchema, data, options);\n\n // If validation failed, use deep validation to get all detailed errors\n let finalErrors = result.errors || [];\n if (!result.valid && data) {\n finalErrors = comprehensiveValidateDocument(data, result.errors);\n }\n\n // Add document-specific metadata\n const documentResult: DocumentValidationResult = {\n ...result,\n documentType: 'docx',\n errors: finalErrors, // Use the comprehensive errors\n };\n\n // Check if document has custom components\n if (result.valid && result.data) {\n const doc = result.data as any;\n if (doc.children && Array.isArray(doc.children)) {\n const hasCustom = doc.children.some(\n (c: any) => !isStandardComponentName(c.name)\n );\n documentResult.hasCustomComponents = hasCustom;\n }\n }\n\n return documentResult;\n}\n\n/**\n * Validate a JSON document (string or object)\n */\nexport function validateJsonDocument(\n jsonInput: string | object,\n options?: ValidationOptions\n): DocumentValidationResult {\n // Use the JSON-specific schema which includes the $schema field\n const result = validateJson(JsonComponentDefinitionSchema, jsonInput, options);\n\n // If validation failed, use deep validation to get all detailed errors\n let finalErrors = result.errors || [];\n if (!result.valid && result.parsed) {\n finalErrors = comprehensiveValidateDocument(result.parsed, result.errors);\n }\n\n // Add document-specific metadata\n const documentResult: DocumentValidationResult = {\n ...result,\n documentType: 'docx',\n errors: finalErrors, // Use the comprehensive errors\n };\n\n // Check for custom components\n if (result.valid && result.data) {\n const doc = result.data as any;\n if (doc.children && Array.isArray(doc.children)) {\n const hasCustom = doc.children.some(\n (c: any) => !isStandardComponentName(c.name)\n );\n documentResult.hasCustomComponents = hasCustom;\n }\n }\n\n return documentResult;\n}\n\n/**\n * Type guard for document validation result\n */\nexport function isValidDocument(\n result: DocumentValidationResult\n): result is DocumentValidationResult & {\n valid: true;\n data: Static<typeof ComponentDefinitionSchema>;\n} {\n return result.valid === true && result.data !== undefined;\n}\n\n/**\n * Extract standard component names from the schema (cached)\n */\nfunction getStandardComponentNames(): string[] {\n return extractStandardComponentNames(StandardComponentDefinitionSchema);\n}\n\n/**\n * Check if a component name is standard\n */\nfunction isStandardComponentName(name: string): boolean {\n const standardNames = getStandardComponentNames();\n return standardNames.includes(name);\n}\n\n/**\n * Create a document validator with default options\n */\nexport function createDocumentValidator(defaultOptions?: ValidationOptions) {\n return {\n validate: (data: unknown, options?: ValidationOptions) =>\n validateDocument(data, { ...defaultOptions, ...options }),\n validateJson: (jsonInput: string | object, options?: ValidationOptions) =>\n validateJsonDocument(jsonInput, { ...defaultOptions, ...options }),\n };\n}\n\n// Export convenient validators with common configurations\nexport const documentValidator = createDocumentValidator({\n clean: true,\n applyDefaults: true,\n maxErrors: 100, // Collect up to 100 errors to show all validation issues\n});\n\nexport const strictDocumentValidator = createDocumentValidator({\n clean: false,\n applyDefaults: false,\n maxErrors: 100, // Increased from 10 to show more errors\n});\n\n/**\n * Legacy compatibility exports\n */\nexport const validateJsonComponent = validateJsonDocument;\nexport const validateDocumentWithSchema = validateDocument;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,wBACP,OACA,SACQ;AACR,QAAM,UAAU,OAAO,MAAM,QAAQ,EAAE;AACvC,QAAM,OAAO,MAAM,QAAQ;AAG3B,MAAI,YAAY,QAAQ,YAAY,SAAS;AAC3C,WAAO,0BAA0B,KAAK;AAAA,EACxC;AAGA,MAAI,MAAM,SAAS,SAAS,sBAAsB,GAAG;AACnD,WAAO,oCAAoC,KAAK;AAAA,EAClD;AAGA,MAAI,MAAM,SAAS,SAAS,mBAAmB,GAAG;AAChD,WAAO,gCAAgC,KAAK;AAAA,EAC9C;AAGA,MACE,YAAY,YACZ,YAAY,YACZ,YAAY,aACZ,YAAY,WACZ,YAAY,UACZ;AACA,W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