@json-to-office/shared-docx 1.2.0 → 1.4.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 (44) hide show
  1. package/dist/{chunk-BBFR3RRN.js → chunk-37G3V2NS.js} +3 -3
  2. package/dist/{chunk-TODYYVZ4.js → chunk-74WV6KFK.js} +2 -2
  3. package/dist/{chunk-OP5PCDNN.js → chunk-BCZ26ZVH.js} +2 -2
  4. package/dist/{chunk-NAZDY3PK.js → chunk-CBH763W5.js} +4 -4
  5. package/dist/{chunk-B4STXH5L.js → chunk-EGT7UWOS.js} +2 -2
  6. package/dist/{chunk-5KOKA5GY.js → chunk-KGQAQE4S.js} +9 -2
  7. package/dist/{chunk-5KOKA5GY.js.map → chunk-KGQAQE4S.js.map} +1 -1
  8. package/dist/{chunk-SOI64OJZ.js → chunk-NPI34OFV.js} +6 -6
  9. package/dist/{chunk-6B3LHADB.js → chunk-PZ6RN72D.js} +2 -2
  10. package/dist/chunk-PZ6RN72D.js.map +1 -0
  11. package/dist/{chunk-MYLVUQCN.js → chunk-RPVVIG43.js} +2 -2
  12. package/dist/{chunk-A2K66URO.js → chunk-YWLLE44T.js} +161 -24
  13. package/dist/chunk-YWLLE44T.js.map +1 -0
  14. package/dist/{chunk-VX2J2KWA.js → chunk-ZKBTTJN6.js} +17 -4
  15. package/dist/chunk-ZKBTTJN6.js.map +1 -0
  16. package/dist/{chunk-45I2NASU.js → chunk-ZKFPP7QB.js} +3 -3
  17. package/dist/index.d.ts +18 -5
  18. package/dist/index.js +15 -12
  19. package/dist/index.js.map +1 -1
  20. package/dist/schemas/api.js +7 -7
  21. package/dist/schemas/component-defaults.js +2 -2
  22. package/dist/schemas/component-registry.d.ts +9 -0
  23. package/dist/schemas/component-registry.js +5 -5
  24. package/dist/schemas/components.d.ts +88 -1
  25. package/dist/schemas/components.js +8 -6
  26. package/dist/schemas/document.js +8 -8
  27. package/dist/schemas/export.js +6 -6
  28. package/dist/schemas/generator.js +6 -6
  29. package/dist/schemas/renderer.js +2 -2
  30. package/dist/schemas/theme.d.ts +0 -3
  31. package/dist/schemas/theme.js +3 -3
  32. package/dist/validation/unified/index.js +8 -8
  33. package/package.json +5 -5
  34. package/dist/chunk-6B3LHADB.js.map +0 -1
  35. package/dist/chunk-A2K66URO.js.map +0 -1
  36. package/dist/chunk-VX2J2KWA.js.map +0 -1
  37. /package/dist/{chunk-BBFR3RRN.js.map → chunk-37G3V2NS.js.map} +0 -0
  38. /package/dist/{chunk-TODYYVZ4.js.map → chunk-74WV6KFK.js.map} +0 -0
  39. /package/dist/{chunk-OP5PCDNN.js.map → chunk-BCZ26ZVH.js.map} +0 -0
  40. /package/dist/{chunk-NAZDY3PK.js.map → chunk-CBH763W5.js.map} +0 -0
  41. /package/dist/{chunk-B4STXH5L.js.map → chunk-EGT7UWOS.js.map} +0 -0
  42. /package/dist/{chunk-SOI64OJZ.js.map → chunk-NPI34OFV.js.map} +0 -0
  43. /package/dist/{chunk-MYLVUQCN.js.map → chunk-RPVVIG43.js.map} +0 -0
  44. /package/dist/{chunk-45I2NASU.js.map → chunk-ZKFPP7QB.js.map} +0 -0
@@ -2,10 +2,10 @@ import {
2
2
  DOCX_RENDERER_IDS,
3
3
  VisualPropsSchema,
4
4
  docxPropsSchemaForRenderer
5
- } from "./chunk-5KOKA5GY.js";
5
+ } from "./chunk-KGQAQE4S.js";
6
6
  import {
7
7
  ThemeOverridesSchema
8
- } from "./chunk-45I2NASU.js";
8
+ } from "./chunk-ZKFPP7QB.js";
9
9
  import {
10
10
  ColumnsPropsSchema,
11
11
  ComponentDefaultsSchema,
@@ -18,17 +18,19 @@ import {
18
18
  TablePropsSchema,
19
19
  createSectionPropsSchema,
20
20
  createTablePropsSchema
21
- } from "./chunk-OP5PCDNN.js";
21
+ } from "./chunk-BCZ26ZVH.js";
22
22
  import {
23
- FloatingPropertiesSchema
24
- } from "./chunk-VX2J2KWA.js";
23
+ AlignmentSchema,
24
+ FloatingPropertiesSchema,
25
+ SpacingSchema
26
+ } from "./chunk-ZKBTTJN6.js";
25
27
  import {
26
28
  HexColorSchema,
27
29
  NoProofWordsSchema
28
30
  } from "./chunk-7TTAAYQ5.js";
29
31
 
30
32
  // src/schemas/component-registry.ts
31
- import { Type as Type5 } from "@sinclair/typebox";
33
+ import { Type as Type6 } from "@sinclair/typebox";
32
34
 
33
35
  // src/schemas/components/report.ts
34
36
  import { Type } from "@sinclair/typebox";
@@ -518,6 +520,123 @@ var HighchartsPropsSchema = Type4.Object({
518
520
  )
519
521
  });
520
522
 
523
+ // src/schemas/components/chart.ts
524
+ import { Type as Type5 } from "@sinclair/typebox";
525
+ var ChartTypeSchema = Type5.Union(
526
+ [
527
+ Type5.Literal("area"),
528
+ Type5.Literal("bar"),
529
+ Type5.Literal("column"),
530
+ Type5.Literal("doughnut"),
531
+ Type5.Literal("line"),
532
+ Type5.Literal("pie"),
533
+ Type5.Literal("radar"),
534
+ Type5.Literal("scatter")
535
+ ],
536
+ { description: "Chart type" }
537
+ );
538
+ var ChartDataSeriesSchema = Type5.Object(
539
+ {
540
+ name: Type5.Optional(Type5.String({ description: "Series name" })),
541
+ labels: Type5.Optional(
542
+ Type5.Array(Type5.String(), {
543
+ description: "Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."
544
+ })
545
+ ),
546
+ values: Type5.Optional(
547
+ Type5.Array(Type5.Number(), {
548
+ description: "Data values, one per label. Needed on every series \u2014 see `labels`."
549
+ })
550
+ )
551
+ },
552
+ { additionalProperties: false }
553
+ );
554
+ var ChartPropsSchema = Type5.Object(
555
+ {
556
+ type: ChartTypeSchema,
557
+ data: Type5.Array(ChartDataSeriesSchema, {
558
+ description: "Chart data series",
559
+ minItems: 1
560
+ }),
561
+ // Title
562
+ title: Type5.Optional(Type5.String({ description: "Chart title text" })),
563
+ showTitle: Type5.Optional(
564
+ Type5.Boolean({
565
+ description: "Show the chart title. Defaults to true when `title` is set."
566
+ })
567
+ ),
568
+ // Legend
569
+ showLegend: Type5.Optional(
570
+ Type5.Boolean({ description: "Show chart legend" })
571
+ ),
572
+ legendPos: Type5.Optional(
573
+ Type5.Union(
574
+ [
575
+ Type5.Literal("b"),
576
+ Type5.Literal("l"),
577
+ Type5.Literal("r"),
578
+ Type5.Literal("t"),
579
+ Type5.Literal("tr")
580
+ ],
581
+ { description: "Legend position" }
582
+ )
583
+ ),
584
+ // Series colors
585
+ chartColors: Type5.Optional(
586
+ Type5.Array(Type5.String(), {
587
+ description: "Series colors (hex or semantic theme names). Defaults to the theme palette."
588
+ })
589
+ ),
590
+ // Axis titles
591
+ catAxisTitle: Type5.Optional(
592
+ Type5.String({ description: "Category axis title" })
593
+ ),
594
+ valAxisTitle: Type5.Optional(
595
+ Type5.String({ description: "Value axis title" })
596
+ ),
597
+ // Flow placement — the same vocabulary as `image` and `highcharts`.
598
+ width: Type5.Optional(
599
+ Type5.Number({
600
+ minimum: 0,
601
+ exclusiveMinimum: 0,
602
+ description: "Chart width in inches. Defaults to the content width."
603
+ })
604
+ ),
605
+ height: Type5.Optional(
606
+ Type5.Number({
607
+ minimum: 0,
608
+ exclusiveMinimum: 0,
609
+ description: "Chart height in inches. Defaults to 3."
610
+ })
611
+ ),
612
+ alignment: Type5.Optional(AlignmentSchema),
613
+ caption: Type5.Optional(
614
+ Type5.String({
615
+ description: "Chart caption (supports rich text with **bold**, *italic*, ***both***)"
616
+ })
617
+ ),
618
+ alt: Type5.Optional(
619
+ Type5.String({ description: "Alternative text for accessibility" })
620
+ ),
621
+ spacing: Type5.Optional(SpacingSchema),
622
+ floating: Type5.Optional(FloatingPropertiesSchema),
623
+ keepNext: Type5.Optional(
624
+ Type5.Boolean({
625
+ description: "Keep paragraph with next paragraph on same page"
626
+ })
627
+ ),
628
+ keepLines: Type5.Optional(
629
+ Type5.Boolean({
630
+ description: "Keep all lines of paragraph together on same page"
631
+ })
632
+ )
633
+ },
634
+ {
635
+ description: 'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".',
636
+ additionalProperties: false
637
+ }
638
+ );
639
+
521
640
  // src/schemas/component-registry.ts
522
641
  var STANDARD_COMPONENTS_REGISTRY = [
523
642
  // ========================================================================
@@ -549,6 +668,7 @@ var STANDARD_COMPONENTS_REGISTRY = [
549
668
  "list",
550
669
  "toc",
551
670
  "highcharts",
671
+ "chart",
552
672
  "visual",
553
673
  "columns",
554
674
  "text-box"
@@ -569,6 +689,7 @@ var STANDARD_COMPONENTS_REGISTRY = [
569
689
  "list",
570
690
  "toc",
571
691
  "highcharts",
692
+ "chart",
572
693
  "visual",
573
694
  "text-box"
574
695
  ],
@@ -620,7 +741,7 @@ var STANDARD_COMPONENTS_REGISTRY = [
620
741
  createPropsSchema: createTablePropsSchema,
621
742
  hasChildren: false,
622
743
  category: "content",
623
- description: "Data table - displays tabular data with headers. Supports formatting and alignment."
744
+ description: "Data table, declared COLUMN-MAJOR: `props.columns[]`, each with its own `header` and its own `cells[]` running down the column. Note the PPTX `table` is the other way round \u2014 rows of cells \u2014 so a table cannot be moved between the formats unchanged."
624
745
  },
625
746
  {
626
747
  name: "list",
@@ -643,6 +764,17 @@ var STANDARD_COMPONENTS_REGISTRY = [
643
764
  category: "content",
644
765
  description: "Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options."
645
766
  },
767
+ {
768
+ name: "chart",
769
+ propsSchema: ChartPropsSchema,
770
+ hasChildren: false,
771
+ // docx.js has no chart primitive at all, so this is a backend gap rather
772
+ // than a slice boundary — the same reasoning that keeps `drawing-groups`
773
+ // off the docxjs capability set.
774
+ renderers: ["office-open"],
775
+ category: "content",
776
+ description: 'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".'
777
+ },
646
778
  {
647
779
  name: "visual",
648
780
  propsSchema: VisualPropsSchema,
@@ -675,26 +807,26 @@ function demandsProps(propsSchema) {
675
807
  }
676
808
  function createComponentSchemaObject(component, childrenType, selfRef, profile) {
677
809
  const schema = {
678
- name: Type5.Literal(component.name),
679
- id: Type5.Optional(Type5.String()),
680
- enabled: Type5.Optional(
681
- Type5.Boolean({
810
+ name: Type6.Literal(component.name),
811
+ id: Type6.Optional(Type6.String()),
812
+ enabled: Type6.Optional(
813
+ Type6.Boolean({
682
814
  default: true,
683
815
  description: "When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion."
684
816
  })
685
817
  )
686
818
  };
687
819
  if (component.special?.hasSchemaField) {
688
- schema.$schema = Type5.Optional(Type5.String({ format: "uri" }));
689
- schema.renderer = profile ? profile.requireDiscriminator ? Type5.Literal(profile.renderer, {
820
+ schema.$schema = Type6.Optional(Type6.String({ format: "uri" }));
821
+ schema.renderer = profile ? profile.requireDiscriminator ? Type6.Literal(profile.renderer, {
690
822
  description: "Renderer backend for this document"
691
- }) : Type5.Optional(
692
- Type5.Literal(profile.renderer, {
823
+ }) : Type6.Optional(
824
+ Type6.Literal(profile.renderer, {
693
825
  description: 'Renderer backend. Omitted defaults to "docxjs".'
694
826
  })
695
- ) : Type5.Optional(
696
- Type5.Union(
697
- DOCX_RENDERER_IDS.map((renderer) => Type5.Literal(renderer)),
827
+ ) : Type6.Optional(
828
+ Type6.Union(
829
+ DOCX_RENDERER_IDS.map((renderer) => Type6.Literal(renderer)),
698
830
  {
699
831
  description: 'Renderer backend. Omitted defaults to "docxjs".'
700
832
  }
@@ -707,11 +839,11 @@ function createComponentSchemaObject(component, childrenType, selfRef, profile)
707
839
  basePropsSchema,
708
840
  profile.renderer
709
841
  ) : basePropsSchema;
710
- schema.props = demandsProps(propsSchema) ? propsSchema : Type5.Optional(propsSchema);
842
+ schema.props = demandsProps(propsSchema) ? propsSchema : Type6.Optional(propsSchema);
711
843
  if (component.hasChildren && childrenType) {
712
- schema.children = component.special?.hasSchemaField ? Type5.Array(childrenType) : Type5.Optional(Type5.Array(childrenType));
844
+ schema.children = component.special?.hasSchemaField ? Type6.Array(childrenType) : Type6.Optional(Type6.Array(childrenType));
713
845
  }
714
- return Type5.Object(schema, {
846
+ return Type6.Object(schema, {
715
847
  additionalProperties: false,
716
848
  description: component.description
717
849
  });
@@ -722,8 +854,10 @@ function createAllComponentSchemas(recursiveRef) {
722
854
  );
723
855
  }
724
856
  function createAllComponentSchemasNarrowed(selfRef, pluginSchemas = [], profile) {
857
+ const drawnHere = (comp) => !profile || !comp.renderers || comp.renderers.includes(profile.renderer);
725
858
  const leafSchemas = /* @__PURE__ */ new Map();
726
859
  for (const comp of STANDARD_COMPONENTS_REGISTRY) {
860
+ if (!drawnHere(comp)) continue;
727
861
  if (!comp.hasChildren) {
728
862
  leafSchemas.set(
729
863
  comp.name,
@@ -731,7 +865,9 @@ function createAllComponentSchemasNarrowed(selfRef, pluginSchemas = [], profile)
731
865
  );
732
866
  }
733
867
  }
734
- const containers = STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);
868
+ const containers = STANDARD_COMPONENTS_REGISTRY.filter(
869
+ (c) => c.hasChildren && drawnHere(c)
870
+ );
735
871
  const resolved = /* @__PURE__ */ new Map();
736
872
  const pending = [...containers];
737
873
  while (pending.length > 0) {
@@ -752,7 +888,7 @@ function createAllComponentSchemasNarrowed(selfRef, pluginSchemas = [], profile)
752
888
  if (!containerDeps.every((d) => resolved.has(d))) continue;
753
889
  const childSchemas = comp.allowedChildren.map((name) => resolved.get(name) ?? leafSchemas.get(name)).filter((s) => s !== void 0);
754
890
  const allChildSchemas = [...childSchemas, ...pluginSchemas];
755
- const childrenType = allChildSchemas.length === 1 ? allChildSchemas[0] : Type5.Union(allChildSchemas);
891
+ const childrenType = allChildSchemas.length === 1 ? allChildSchemas[0] : Type6.Union(allChildSchemas);
756
892
  resolved.set(
757
893
  comp.name,
758
894
  createComponentSchemaObject(comp, childrenType, selfRef, profile)
@@ -779,6 +915,7 @@ export {
779
915
  TocDepthRangeSchema,
780
916
  TocPropsSchema,
781
917
  HighchartsPropsSchema,
918
+ ChartPropsSchema,
782
919
  STANDARD_COMPONENTS_REGISTRY,
783
920
  getStandardComponent,
784
921
  getAllStandardComponentNames,
@@ -790,4 +927,4 @@ export {
790
927
  createAllComponentSchemas,
791
928
  createAllComponentSchemasNarrowed
792
929
  };
793
- //# sourceMappingURL=chunk-A2K66URO.js.map
930
+ //# sourceMappingURL=chunk-YWLLE44T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas/component-registry.ts","../src/schemas/components/report.ts","../src/schemas/components/text-box.ts","../src/schemas/components/toc.ts","../src/schemas/components/highcharts.ts","../src/schemas/components/chart.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 { ListPropsSchema } from './components/list';\nimport { TocPropsSchema } from './components/toc';\nimport { HighchartsPropsSchema } from './components/highcharts';\nimport { ChartPropsSchema } from './components/chart';\nimport { VisualPropsSchema } from './components/visual';\nimport {\n DOCX_RENDERER_IDS,\n docxPropsSchemaForRenderer,\n type DocxRendererId,\n} from './renderer';\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 /**\n * The renderers that can draw this component. Omitted means all of them.\n *\n * Only for a component whose backend gap is real, not a slice boundary: a\n * component listed here disappears from the other renderers' schema branch\n * entirely, so a schema-driven editor stops offering it rather than\n * offering it and failing at render time.\n */\n renderers?: readonly DocxRendererId[];\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 'chart',\n 'visual',\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 'chart',\n 'visual',\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, declared COLUMN-MAJOR: `props.columns[]`, each with its own `header` and its own `cells[]` running down the column. Note the PPTX `table` is the other way round — rows of cells — so a table cannot be moved between the formats unchanged.',\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 {\n name: 'chart',\n propsSchema: ChartPropsSchema,\n hasChildren: false,\n // docx.js has no chart primitive at all, so this is a backend gap rather\n // than a slice boundary — the same reasoning that keeps `drawing-groups`\n // off the docxjs capability set.\n renderers: ['office-open'],\n category: 'content',\n description:\n 'Native Word chart - editable, scalable, no export server needed. Requires renderer \"office-open\".',\n },\n {\n name: 'visual',\n propsSchema: VisualPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Free-canvas graphic for infographics, diagrams and layered compositions the document flow cannot express. Rasterized from a pptx slide by default; renderMode \"native\" draws it as an editable Word drawing group (renderer \"office-open\").',\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 * True when a props schema rejects `{}`, i.e. the `props` key cannot be omitted.\n *\n * Only object schemas are inspected. Anything else (a union, a bare ref) is\n * treated as demanding props, preserving the previous stricter behavior for\n * shapes this cannot reason about.\n */\nfunction demandsProps(propsSchema: TSchema): boolean {\n const schema = propsSchema as { type?: string; required?: readonly string[] };\n return schema.type !== 'object' || (schema.required?.length ?? 0) > 0;\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 profile?: { renderer: DocxRendererId; requireDiscriminator: boolean }\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 schema.renderer = profile\n ? profile.requireDiscriminator\n ? Type.Literal(profile.renderer, {\n description: 'Renderer backend for this document',\n })\n : Type.Optional(\n Type.Literal(profile.renderer, {\n description: 'Renderer backend. Omitted defaults to \"docxjs\".',\n })\n )\n : Type.Optional(\n Type.Union(\n DOCX_RENDERER_IDS.map((renderer) => Type.Literal(renderer)),\n {\n description: 'Renderer backend. Omitted defaults to \"docxjs\".',\n }\n )\n );\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 const basePropsSchema =\n component.createPropsSchema && selfRef\n ? component.createPropsSchema(selfRef)\n : component.propsSchema;\n const propsSchema = profile\n ? docxPropsSchemaForRenderer(\n component.name,\n basePropsSchema,\n profile.renderer\n )\n : basePropsSchema;\n\n // `props` is required only when the props schema itself demands a field.\n // The runtime validator treats an omitted `props` as `{}` and lets the props\n // schema decide (see deep-validator.ts), so `section`, `toc`, `image` and\n // `text-box` are legal without the key. Exporting `props` as unconditionally\n // required reddened documents that build: the playground flagged all 23\n // propless sections in the shipped tech-report template while every runtime\n // gate stayed green. The root `docx` node already carried this fix locally in\n // generator.ts; this generalizes it to every component.\n schema.props = demandsProps(propsSchema)\n ? propsSchema\n : Type.Optional(propsSchema);\n\n // Add children support if applicable. The root component requires its\n // `children` array — deep-validator.ts enforces the same rule, but only on\n // the fallback path it takes when the TypeBox check already failed. That\n // made the rule fire only as a side effect of `props` being required, so\n // relaxing `props` above would silently retire it. Nested containers may\n // legitimately be empty.\n if (component.hasChildren && childrenType) {\n schema.children = component.special?.hasSchemaField\n ? Type.Array(childrenType)\n : Type.Optional(Type.Array(childrenType));\n }\n\n return Type.Object(schema, {\n additionalProperties: false,\n description: component.description,\n });\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 profile?: { renderer: DocxRendererId; requireDiscriminator: boolean }\n): { schemas: TSchema[]; byName: Map<string, TSchema> } {\n // A component whose `renderers` excludes this profile is not built at all,\n // so it is absent from the union *and* from every container's narrowed\n // children — `allowedChildren` maps through these maps and drops what it\n // cannot find, which keeps the two lists from disagreeing.\n const drawnHere = (comp: StandardComponentDefinition): boolean =>\n !profile || !comp.renderers || comp.renderers.includes(profile.renderer);\n\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 (!drawnHere(comp)) continue;\n if (!comp.hasChildren) {\n leafSchemas.set(\n comp.name,\n createComponentSchemaObject(comp, undefined, selfRef, profile)\n );\n }\n }\n\n // Phase 2: Resolve containers in dependency order\n const containers = STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => c.hasChildren && drawnHere(c)\n );\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, profile)\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, profile)\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';\nimport { FontRegistrySchema } from '@json-to-office/shared';\nimport { ComponentDefaultsSchema } from '../component-defaults';\nimport { NoProofWordsSchema } from '../font';\nimport { ThemeOverridesSchema } from '../theme';\n\n// Create a function to generate ReportPropsSchema with recursive component reference\nexport const createReportPropsSchema = (_componentRef?: 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 themeOverrides: Type.Optional(ThemeOverridesSchema),\n fontRegistry: Type.Optional(FontRegistrySchema),\n componentDefaults: Type.Optional(ComponentDefaultsSchema),\n language: Type.Optional(\n Type.String({\n pattern: '^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$',\n description:\n 'Default document language (BCP-47 tag, e.g. \"en-US\"). Sets Word\\'s default proofing/spell-check language; individual components can override it locally.',\n examples: ['en-US', 'fr-FR', 'de-DE', 'it-IT', 'es-ES'],\n })\n ),\n noProofWords: Type.Optional(NoProofWordsSchema),\n trackRevisions: Type.Optional(\n Type.Boolean({\n description:\n 'Open the document in track-changes mode: Word marks any further edits as revisions. Set automatically on redline documents produced by the diff engine',\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(\n Type.String({\n description:\n 'Company name, written to docProps/custom.xml (Word has no core-property slot for it)',\n })\n ),\n date: Type.Optional(\n Type.String({\n description:\n 'Document date used by {DATE}/{DATETIME} placeholders (defaults to the generation timestamp)',\n })\n ),\n version: Type.Optional(\n Type.String({\n description: 'Document version, written to docProps/custom.xml',\n examples: ['1.0', '2024.3'],\n })\n ),\n tags: Type.Optional(Type.Array(Type.String())),\n },\n {\n description:\n 'Document metadata (title, author, company, version, etc.). Package timestamps (dcterms:created/modified) are not part of this object: they come from the `generatedAt` generation option so repeated builds stay byte-identical.',\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 * 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 renderAs: Type.Optional(\n Type.Union([Type.Literal('table'), Type.Literal('shape')], {\n description:\n \"Rendering strategy. 'table' (default): borderless one-cell table — height auto-fits content, per-side borders and percentage widths resolve in Word. 'shape': native Word text box (WPS shape) — real wrap modes and z-order, but requires explicit width and height (no autofit), a single uniform border, and eagerly-resolved percentage sizes.\",\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 {\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 { additionalProperties: false }\n )\n ),\n right: Type.Optional(\n 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 { additionalProperties: false }\n )\n ),\n bottom: Type.Optional(\n 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 { additionalProperties: false }\n )\n ),\n left: Type.Optional(\n 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 { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n )\n ),\n shading: Type.Optional(\n Type.Object(\n {\n // Same domain as every other colour prop and as the border\n // colours above: resolveColor() accepts \"#RRGGBB\" or a theme\n // colour name, and throws on anything else at render time.\n fill: Type.Optional(HexColorSchema),\n },\n { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n )\n ),\n },\n {\n additionalProperties: false,\n /**\n * The same two shape limits `collectTextBoxShapeConflicts` enforces, said\n * in JSON Schema so an editor can say it too.\n *\n * The deep validator only runs when a document is generated, so until now\n * an author learned that a shape needs a height by pressing Run. These are\n * plain cross-field rules, and `if`/`then` expresses them — which is what\n * Monaco checks the buffer against, so the editor underlines the mistake\n * while it is being made. The deep validator stays as the backstop: it\n * carries the remediation text, and it is what the API enforces for\n * callers who never see an editor.\n */\n allOf: [\n {\n if: {\n properties: { renderAs: { const: 'shape' } },\n required: ['renderAs'],\n },\n then: {\n required: ['width', 'height'],\n properties: {\n style: {\n properties: {\n border: {\n properties: Object.fromEntries(\n ['top', 'right', 'bottom', 'left'].map((side) => [\n side,\n { properties: { style: { enum: ['solid', 'none'] } } },\n ])\n ),\n },\n },\n },\n },\n },\n },\n ],\n }\n);\n\nexport type TextBoxProps = Static<typeof TextBoxPropsSchema>;\n","/**\n * Table of Contents Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\n\n/**\n * Kept for back-compat only. Word's TOC field has no numbering switch, so the\n * renderer cannot apply this and logs a warning when it is set; entries inherit\n * the numbering of the heading styles they reference.\n */\nexport const TocStyleSchema = Type.Union(\n [Type.Literal('numeric'), Type.Literal('bullet'), Type.Literal('none')],\n {\n description:\n 'TOC numbering style — accepted but not applied (Word TOC fields carry no numbering switch); setting it logs a warning during generation',\n }\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 component 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 resources forwarded verbatim to the export server (CSS/JS/files).\n // Notably enables @font-face rules so charts render in custom fonts.\n resources: Type.Optional(\n Type.Object({\n css: Type.Optional(Type.String()),\n js: Type.Optional(Type.String()),\n files: Type.Optional(Type.Array(Type.String())),\n })\n ),\n // Optional Highcharts Export Server URL override\n serverUrl: Type.Optional(\n Type.String({\n description:\n 'Highcharts Export Server URL (default: http://localhost:7801)',\n })\n ),\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","/**\n * Chart Component Schema (DOCX) — a native Word chart, drawn by `office-open`.\n *\n * The sibling of the pptx `chart` component, and deliberately spelled the same\n * way: `type`, `data`, `title`, `showLegend`, `chartColors` carry identical\n * names and shapes here, so an author who has charted a slide can chart a\n * document without relearning the vocabulary. What differs is placement, and\n * only placement — a slide chart is positioned with `x`/`y`/`w`/`h`, a document\n * chart flows, so it takes the `width`/`height`/`alignment`/`caption` props\n * `image` and `highcharts` already use. The slide coordinates are refused\n * rather than ignored, because a chart that silently lands somewhere other than\n * where it was told to is worse than one that fails.\n *\n * Distinct from `highcharts`, which is a PNG from an export server. This is a\n * real chart part: editable, vector, and reachable without a service.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n AlignmentSchema,\n SpacingSchema,\n FloatingPropertiesSchema,\n} from './common';\n\n/**\n * The chart types v1 draws.\n *\n * `@office-open/core` reaches twelve; these are the ones the pptx `chart`\n * component also offers, so the two formats agree, plus `column` — which\n * PowerPoint spells as a bar with a vertical direction and Word spells as its\n * own type. `stock`, `surface`, `ofPie` and the 3-D variants are left out until\n * there is a counterpart to be consistent with.\n *\n * `bubble` is left out for a harder reason: `@office-open` spells a bubble\n * series as `xValues`/`yValues`/`bubbleSize` rather than categories and values,\n * and handing it the latter throws a TypeError from inside its own bundle.\n * There is also no unambiguous reading of a category label as a numeric x. The\n * pptx component refuses it by name for the same reason; here the type simply\n * does not exist, because `office-open` is the only renderer that draws a docx\n * chart at all.\n */\nconst ChartTypeSchema = Type.Union(\n [\n Type.Literal('area'),\n Type.Literal('bar'),\n Type.Literal('column'),\n Type.Literal('doughnut'),\n Type.Literal('line'),\n Type.Literal('pie'),\n Type.Literal('radar'),\n Type.Literal('scatter'),\n ],\n { description: 'Chart type' }\n);\n\n/**\n * One series.\n *\n * `labels` and `values` are needed on EVERY series, not just the first, and the\n * same rule and wording as the pptx component: a series missing either drops\n * the whole chart. They stay schema-optional because the compiler owns that\n * refusal and names the series that caused it.\n */\nconst ChartDataSeriesSchema = Type.Object(\n {\n name: Type.Optional(Type.String({ description: 'Series name' })),\n labels: Type.Optional(\n Type.Array(Type.String(), {\n description:\n 'Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart.',\n })\n ),\n values: Type.Optional(\n Type.Array(Type.Number(), {\n description:\n 'Data values, one per label. Needed on every series — see `labels`.',\n })\n ),\n },\n { additionalProperties: false }\n);\n\nexport const ChartPropsSchema = Type.Object(\n {\n type: ChartTypeSchema,\n data: Type.Array(ChartDataSeriesSchema, {\n description: 'Chart data series',\n minItems: 1,\n }),\n\n // Title\n title: Type.Optional(Type.String({ description: 'Chart title text' })),\n showTitle: Type.Optional(\n Type.Boolean({\n description:\n 'Show the chart title. Defaults to true when `title` is set.',\n })\n ),\n\n // Legend\n showLegend: Type.Optional(\n Type.Boolean({ description: 'Show chart legend' })\n ),\n legendPos: Type.Optional(\n Type.Union(\n [\n Type.Literal('b'),\n Type.Literal('l'),\n Type.Literal('r'),\n Type.Literal('t'),\n Type.Literal('tr'),\n ],\n { description: 'Legend position' }\n )\n ),\n\n // Series colors\n chartColors: Type.Optional(\n Type.Array(Type.String(), {\n description:\n 'Series colors (hex or semantic theme names). Defaults to the theme palette.',\n })\n ),\n\n // Axis titles\n catAxisTitle: Type.Optional(\n Type.String({ description: 'Category axis title' })\n ),\n valAxisTitle: Type.Optional(\n Type.String({ description: 'Value axis title' })\n ),\n\n // Flow placement — the same vocabulary as `image` and `highcharts`.\n width: Type.Optional(\n Type.Number({\n minimum: 0,\n exclusiveMinimum: 0,\n description: 'Chart width in inches. Defaults to the content width.',\n })\n ),\n height: Type.Optional(\n Type.Number({\n minimum: 0,\n exclusiveMinimum: 0,\n description: 'Chart height in inches. Defaults to 3.',\n })\n ),\n alignment: Type.Optional(AlignmentSchema),\n caption: Type.Optional(\n Type.String({\n description:\n 'Chart caption (supports rich text with **bold**, *italic*, ***both***)',\n })\n ),\n alt: Type.Optional(\n Type.String({ description: 'Alternative text for accessibility' })\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:\n 'Native Word chart - editable, scalable, no export server needed. Requires renderer \"office-open\".',\n additionalProperties: false,\n }\n);\n\nexport type ChartProps = Static<typeof ChartPropsSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,QAAAA,aAAqB;;;ACX9B,SAAS,YAA6B;AACtC,SAAS,0BAA0B;AAM5B,IAAM,0BAA0B,CAAC,kBACtC,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,CAAC;AAAA,IACH;AAAA,IACA,gBAAgB,KAAK,SAAS,oBAAoB;AAAA,IAClD,cAAc,KAAK,SAAS,kBAAkB;AAAA,IAC9C,mBAAmB,KAAK,SAAS,uBAAuB;AAAA,IACxD,UAAU,KAAK;AAA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vB,IAAI,CAAC,SAAS,SAAS,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,EACzD,OAAO,CAAC,MAAoB,MAAM,MAAS;AAE9C,YAAM,kBAAkB,CAAC,GAAG,cAAc,GAAG,aAAa;AAC1D,YAAM,eACJ,gBAAgB,WAAW,IACvB,gBAAgB,CAAC,IACjBA,MAAK,MAAM,eAAe;AAEhC,eAAS;AAAA,QACP,KAAK;AAAA,QACL,4BAA4B,MAAM,cAAc,SAAS,OAAO;AAAA,MAClE;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"]}
@@ -114,10 +114,23 @@ var LineSpacingSchema = Type.Object(
114
114
  );
115
115
  var IndentSchema = Type.Object(
116
116
  {
117
- left: Type.Optional(Type.Number({ minimum: 0 })),
118
- hanging: Type.Optional(Type.Number({ minimum: 0 }))
117
+ left: Type.Optional(
118
+ Type.Number({
119
+ minimum: 0,
120
+ description: "Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level."
121
+ })
122
+ ),
123
+ hanging: Type.Optional(
124
+ Type.Number({
125
+ minimum: 0,
126
+ description: "Hanging indent in points \u2014 how far the marker sits left of the text. Omit for the 18pt default."
127
+ })
128
+ )
119
129
  },
120
- { description: "Indentation configuration", additionalProperties: false }
130
+ {
131
+ description: "Indentation configuration, in points",
132
+ additionalProperties: false
133
+ }
121
134
  );
122
135
  var ParagraphIndentSchema = Type.Object(
123
136
  {
@@ -462,4 +475,4 @@ export {
462
475
  BaseComponentFields,
463
476
  BaseComponentPropsSchema
464
477
  };
465
- //# sourceMappingURL=chunk-VX2J2KWA.js.map
478
+ //# sourceMappingURL=chunk-ZKBTTJN6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas/components/common.ts"],"sourcesContent":["/**\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', additionalProperties: false }\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', additionalProperties: false }\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', additionalProperties: false }\n);\n\n/**\n * List-level indentation, in POINTS.\n *\n * Points, unlike `ParagraphIndentSchema` next door, which is twips — the two\n * have always disagreed and neither said so, which is how every bundled theme\n * came to ship `indent: 3` meaning half an inch and getting three points: the\n * marker landed outside the page margin, to the left of the body text it was\n * supposed to label.\n */\nexport const IndentSchema = Type.Object(\n {\n left: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level.',\n })\n ),\n hanging: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Hanging indent in points — how far the marker sits left of the text. Omit for the 18pt default.',\n })\n ),\n },\n {\n description: 'Indentation configuration, in points',\n additionalProperties: false,\n }\n);\n\nexport const ParagraphIndentSchema = Type.Object(\n {\n left: Type.Optional(\n Type.Number({\n description: 'Left indentation in twips (1/20 of a point)',\n })\n ),\n right: Type.Optional(\n Type.Number({\n description: 'Right indentation in twips (1/20 of a point)',\n })\n ),\n hanging: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Hanging indent in twips: first line stays at the left indent, following lines are indented. Mutually exclusive with firstLine.',\n })\n ),\n firstLine: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'First-line indent in twips: only the first line is indented. Mutually exclusive with hanging.',\n })\n ),\n },\n {\n description:\n 'Paragraph indentation (w:ind) in twips. Use either hanging or firstLine, not both.',\n additionalProperties: false,\n }\n);\n\nexport const TabStopTypeSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('right'),\n Type.Literal('center'),\n Type.Literal('decimal'),\n Type.Literal('bar'),\n ],\n { description: 'Tab stop alignment type' }\n);\n\nexport const TabStopLeaderSchema = Type.Union(\n [\n Type.Literal('dot'),\n Type.Literal('hyphen'),\n Type.Literal('underscore'),\n Type.Literal('middleDot'),\n Type.Literal('none'),\n ],\n { description: 'Leader character filling the space before the tab stop' }\n);\n\nexport const TabStopSchema = Type.Object(\n {\n type: TabStopTypeSchema,\n position: Type.Number({\n minimum: 0,\n description: 'Tab stop position in twips (1/20 of a point)',\n }),\n leader: Type.Optional(TabStopLeaderSchema),\n },\n {\n description: 'Tab stop definition (w:tab in w:tabs)',\n additionalProperties: false,\n }\n);\n\nexport const TabStopsSchema = Type.Array(TabStopSchema, {\n description:\n 'Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions.',\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.Union([\n Type.Number({\n description: 'Horizontal offset in twips (1/20 of a point)',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Horizontal offset as percentage (e.g., \"50%\") relative to page or margin width',\n }),\n ])\n ),\n },\n {\n description:\n 'Horizontal positioning (use either align or offset, not both)',\n additionalProperties: false,\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.Union([\n Type.Number({\n description: 'Vertical offset in twips (1/20 of a point)',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Vertical offset as percentage (e.g., \"50%\") relative to page or margin height',\n }),\n ])\n ),\n },\n {\n description:\n 'Vertical positioning (use either align or offset, not both)',\n additionalProperties: false,\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.Union([\n Type.Number({ description: 'Top margin in twips' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Top margin as percentage of page height',\n }),\n ])\n ),\n bottom: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Bottom margin in twips' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Bottom margin as percentage of page height',\n }),\n ])\n ),\n left: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Left margin in twips' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Left margin as percentage of page width',\n }),\n ])\n ),\n right: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Right margin in twips' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Right margin as percentage of page width',\n }),\n ])\n ),\n },\n {\n description: 'Distance from text margins',\n additionalProperties: false,\n }\n )\n ),\n },\n {\n description: 'Text wrapping configuration',\n additionalProperties: false,\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 additionalProperties: false,\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 {\n description: 'Numbering configuration for lists',\n additionalProperties: false,\n }\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 ParagraphIndent = Static<typeof ParagraphIndentSchema>;\nexport type TabStopType = Static<typeof TabStopTypeSchema>;\nexport type TabStopLeader = Static<typeof TabStopLeaderSchema>;\nexport type TabStop = Static<typeof TabStopSchema>;\nexport type TabStops = Static<typeof TabStopsSchema>;\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"],"mappings":";;;;;AAMA,SAAS,YAAoB;AAOtB,IAAM,kBAAkB,KAAK;AAAA,EAClC,CAAC,KAAK,QAAQ,MAAM,GAAG,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,OAAO,CAAC;AAAA,EACpE,EAAE,aAAa,yBAAyB;AAC1C;AAEO,IAAM,2BAA2B,KAAK;AAAA,EAC3C;AAAA,IACE,KAAK,QAAQ,MAAM;AAAA,IACnB,KAAK,QAAQ,QAAQ;AAAA,IACrB,KAAK,QAAQ,OAAO;AAAA,IACpB,KAAK,QAAQ,SAAS;AAAA,EACxB;AAAA,EACA,EAAE,aAAa,2CAA2C;AAC5D;AAEO,IAAM,qBAAqB,KAAK;AAAA,EACrC;AAAA,IACE,KAAK,QAAQ,CAAC;AAAA,IACd,KAAK,QAAQ,CAAC;AAAA,IACd,KAAK,QAAQ,CAAC;AAAA,IACd,KAAK,QAAQ,CAAC;AAAA,IACd,KAAK,QAAQ,CAAC;AAAA,IACd,KAAK,QAAQ,CAAC;AAAA,EAChB;AAAA,EACA,EAAE,aAAa,sBAAsB;AACvC;AAEO,IAAM,gBAAgB,KAAK;AAAA,EAChC;AAAA,IACE,QAAQ,KAAK;AAAA,MACX,KAAK,OAAO;AAAA,QACV,SAAS;AAAA,QACT,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAAA,IACA,OAAO,KAAK;AAAA,MACV,KAAK,OAAO;AAAA,QACV,SAAS;AAAA,QACT,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,sBAAsB;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CAAC;AAAA,IACH;AAAA,IACA,UAAU,KAAK;AAAA,MACb,KAAK,OAAO;AAAA,QACV,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAAA,IACA,YAAY,KAAK;AAAA,MACf,KAAK,MAAM,CAAC,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,SAAS,CAAC,GAAG;AAAA,QAC5D,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,sBAAsB;AAAA,EACxB;AACF;AAgBO,IAAM,kBAAkB,KAAK;AAAA,EAClC;AAAA,IACE,OAAO,KAAK,SAAS,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,IAChD,OAAO,KAAK;AAAA,MACV,KAAK,MAAM;AAAA,QACT,KAAK,QAAQ,SAAS;AAAA,QACtB,KAAK,QAAQ,aAAa;AAAA,QAC1B,KAAK,QAAQ,aAAa;AAAA,QAC1B,KAAK,QAAQ,YAAY;AAAA,QACzB,KAAK,QAAQ,YAAY;AAAA,MAC3B,CAAC;AAAA,IACH;AAAA,IACA,WAAW,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,sBAAsB;AAAA,EACxB;AACF;AASA,IAAM,sBAAsB,CAAC;AAGtB,IAAM,2BAA2B,KAAK,OAAO,qBAAqB;AAAA,EACvE,aAAa;AAAA,EACb,sBAAsB;AACxB,CAAC;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ComponentDefaultsSchema
3
- } from "./chunk-OP5PCDNN.js";
3
+ } from "./chunk-BCZ26ZVH.js";
4
4
  import {
5
5
  IndentSchema
6
- } from "./chunk-VX2J2KWA.js";
6
+ } from "./chunk-ZKBTTJN6.js";
7
7
  import {
8
8
  FontDefinitionSchema,
9
9
  HexColorSchema,
@@ -443,4 +443,4 @@ export {
443
443
  isValidThemeConfig,
444
444
  createMinimalTheme
445
445
  };
446
- //# sourceMappingURL=chunk-45I2NASU.js.map
446
+ //# sourceMappingURL=chunk-ZKFPP7QB.js.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { RevisionSegment, ComponentDefinition as ComponentDefinition$1, ComponentDefinitionSchema, ColumnsPropsSchema, ReportPropsSchema, SectionPropsSchema, HeadingPropsSchema, ParagraphPropsSchema, TextBoxPropsSchema, ImagePropsSchema, HighchartsPropsSchema, VisualPropsSchema, StatisticPropsSchema, TablePropsSchema, ListPropsSchema, TocPropsSchema } from './schemas/components.js';
2
- export { Alignment, AlignmentSchema, BaseComponentProps, BaseComponentPropsSchema, BorderSchema, ColumnsProps, Comment, CommentReply, CommentReplySchema, CommentSchema, EndnotesSchema, FootnotesSchema, HeadingLevel, HeadingLevelSchema, HeadingProps, HighchartsProps, ImageProps, Indent, IndentSchema, JustifiedAlignment, JustifiedAlignmentSchema, LineSpacing, LineSpacingSchema, ListMarkerFont, ListMarkerFontSchema, ListProps, MarginsSchema, NATIVE_RENDER_MODE, NATIVE_VISUAL_ELEMENT_NAMES, NativeVisualCanvas, NativeVisualCanvasSchema, NativeVisualElement, NativeVisualElementName, NativeVisualElementSchema, NativeVisualFill, NativeVisualImageProps, NativeVisualImagePropsSchema, NativeVisualLine, NativeVisualShapeProps, NativeVisualShapePropsSchema, NativeVisualTextProps, NativeVisualTextPropsSchema, NativeVisualTextRun, NativeVisualTextSegment, Note, NoteSchema, Numbering, NumberingSchema, ParagraphIndent, ParagraphIndentSchema, ParagraphProps, ReportProps, Revision, RevisionMark, RevisionMarkSchema, RevisionSchema, RevisionSegmentSchema, SectionProps, Spacing, SpacingSchema, StandardComponentDefinitionSchema, StatisticProps, TabStop, TabStopLeader, TabStopLeaderSchema, TabStopSchema, TabStopType, TabStopTypeSchema, TabStops, TabStopsSchema, TableProps, TextBoxProps, TocProps, VisualCanvas, VisualCanvasBackgroundSchema, VisualCanvasSchema, VisualNativeProps, VisualNativePropsSchema, VisualProps, VisualRasterProps, VisualRasterPropsSchema, isNativeVisualProps } from './schemas/components.js';
1
+ import { RevisionSegment, ComponentDefinition as ComponentDefinition$1, ComponentDefinitionSchema, ColumnsPropsSchema, ReportPropsSchema, SectionPropsSchema, HeadingPropsSchema, ParagraphPropsSchema, TextBoxPropsSchema, ImagePropsSchema, HighchartsPropsSchema, ChartPropsSchema, VisualPropsSchema, StatisticPropsSchema, TablePropsSchema, ListPropsSchema, TocPropsSchema } from './schemas/components.js';
2
+ export { Alignment, AlignmentSchema, BaseComponentProps, BaseComponentPropsSchema, BorderSchema, ChartProps, ColumnsProps, Comment, CommentReply, CommentReplySchema, CommentSchema, EndnotesSchema, FootnotesSchema, HeadingLevel, HeadingLevelSchema, HeadingProps, HighchartsProps, ImageProps, Indent, IndentSchema, JustifiedAlignment, JustifiedAlignmentSchema, LineSpacing, LineSpacingSchema, ListMarkerFont, ListMarkerFontSchema, ListProps, MarginsSchema, NATIVE_RENDER_MODE, NATIVE_VISUAL_ELEMENT_NAMES, NativeVisualCanvas, NativeVisualCanvasSchema, NativeVisualElement, NativeVisualElementName, NativeVisualElementSchema, NativeVisualFill, NativeVisualImageProps, NativeVisualImagePropsSchema, NativeVisualLine, NativeVisualShapeProps, NativeVisualShapePropsSchema, NativeVisualTextProps, NativeVisualTextPropsSchema, NativeVisualTextRun, NativeVisualTextSegment, Note, NoteSchema, Numbering, NumberingSchema, ParagraphIndent, ParagraphIndentSchema, ParagraphProps, ReportProps, Revision, RevisionMark, RevisionMarkSchema, RevisionSchema, RevisionSegmentSchema, SectionProps, Spacing, SpacingSchema, StandardComponentDefinitionSchema, StatisticProps, TabStop, TabStopLeader, TabStopLeaderSchema, TabStopSchema, TabStopType, TabStopTypeSchema, TabStops, TabStopsSchema, TableProps, TextBoxProps, TocProps, VisualCanvas, VisualCanvasBackgroundSchema, VisualCanvasSchema, VisualNativeProps, VisualNativePropsSchema, VisualProps, VisualRasterProps, VisualRasterPropsSchema, isNativeVisualProps } from './schemas/components.js';
3
3
  export { AddWarningFunction, ComponentSchemaConfig, DEFAULT_ERROR_CONFIG, ERROR_EMOJIS, ErrorFormatterConfig, GenerationWarning, ParsedSemver, ComponentDefinition as SharedComponentDefinition, ValidationError, ValidationResult, calculatePosition, clearComponentNamesCache, compareSemver, convertToJsonSchema, createComponentSchema, createErrorConfig, createJsonParseError, exportSchemaToFile, extractStandardComponentNames, fixSchemaReferences, formatErrorMessage, formatErrorSummary, getLiteralValue, getObjectSchemaPropertyNames, getSchemaMetadata, groupErrorsByPath, isLiteralSchema, isObjectSchema, isUnionSchema, isValidSemver, latestVersion, parseSemver, createComponentSchemaObject as sharedCreateComponentSchemaObject, transformValueError, transformValueErrors } from '@json-to-office/shared';
4
4
  import { DocumentValidationResult, ValidationError } from './schemas/document.js';
5
5
  export { JSON_SCHEMA_URLS, JsonComponentDefinitionSchema } from './schemas/document.js';
@@ -2230,6 +2230,19 @@ interface TableComponent {
2230
2230
  enabled?: boolean;
2231
2231
  props: Static<typeof TablePropsSchema>;
2232
2232
  }
2233
+ /**
2234
+ * Native chart component with literal name discriminator.
2235
+ *
2236
+ * Only `office-open` draws it; the schema for every other renderer omits the
2237
+ * component entirely.
2238
+ */
2239
+ interface ChartComponent {
2240
+ name: 'chart';
2241
+ id?: string;
2242
+ /** When false, this component is filtered out and not rendered. Defaults to true */
2243
+ enabled?: boolean;
2244
+ props: Static<typeof ChartPropsSchema>;
2245
+ }
2233
2246
  /**
2234
2247
  * Highcharts component with literal name discriminator
2235
2248
  */
@@ -2296,12 +2309,12 @@ interface TextSpaceAfterComponent {
2296
2309
  /**
2297
2310
  * Union of all standard component types
2298
2311
  */
2299
- type StandardComponentDefinition = ReportComponent | SectionComponent | ColumnsComponent | HeadingComponent | ParagraphComponent | TextBoxComponent | ImageComponent | HighchartsComponent | VisualComponent | StatisticComponent | TableComponent | ListComponent | TocComponent;
2312
+ type StandardComponentDefinition = ReportComponent | SectionComponent | ColumnsComponent | HeadingComponent | ParagraphComponent | TextBoxComponent | ImageComponent | HighchartsComponent | ChartComponent | VisualComponent | StatisticComponent | TableComponent | ListComponent | TocComponent;
2300
2313
  /**
2301
2314
  * Array of all standard component names.
2302
2315
  * Useful for iterating, validation, or displaying available components to users.
2303
2316
  */
2304
- declare const STANDARD_COMPONENTS: readonly ["columns", "heading", "highcharts", "image", "list", "paragraph", "docx", "section", "statistic", "table", "text-box", "toc", "visual"];
2317
+ declare const STANDARD_COMPONENTS: readonly ["chart", "columns", "heading", "highcharts", "image", "list", "paragraph", "docx", "section", "statistic", "table", "text-box", "toc", "visual"];
2305
2318
  /**
2306
2319
  * Set of all standard component names for O(1) lookup.
2307
2320
  */
@@ -2350,4 +2363,4 @@ type ThemeName = 'minimal' | 'verizon' | 'a2a' | 'hitachi';
2350
2363
 
2351
2364
  declare const SHARED_DOCX_VERSION = "1.0.0";
2352
2365
 
2353
- export { type ColumnsComponent, ColumnsPropsSchema, type ComponentDefinition, ComponentDefinitionSchema, type CoreValidationResult, type DiffDocumentsOptions, type DiffDocumentsResult, type DiffSegment, type DiffSummary, ValidationError as DocumentValidationError, DocumentValidationResult, DocxRendererId, type FormattedError, type HeadingComponent, HeadingPropsSchema, type HighchartsComponent, HighchartsPropsSchema, type ImageComponent, ImagePropsSchema, JsonDocumentParser, type JsonNode, JsonParsingError, JsonValidationError, type ListComponent, ListPropsSchema, type ParagraphComponent, ParagraphPropsSchema, type ReportComponent, type ReportComponentFor, ReportPropsSchema, RevisionSegment, SHARED_DOCX_VERSION, STANDARD_COMPONENTS, STANDARD_COMPONENTS_SET, type SectionComponent, SectionPropsSchema, type StandardComponentDefinition, type StandardComponentName, type StatisticComponent, StatisticPropsSchema, type TableComponent, TablePropsSchema, type TextBoxComponent, TextBoxPropsSchema, type TextSpaceAfterComponent, TextSpaceAfterPropsSchema, type ThemeName, type TocComponent, TocPropsSchema, type UntrackedChange, type VisualComponent, VisualPropsSchema, createValidatedComponent, diffDocuments, diffWords, formatErrorReport, formatValidationError, formatValidationErrorStrings, formatValidationErrors, getErrorSummary, getValidationContext, getValidationErrors, hasCriticalErrors, isColumnsComponent, isHeadingComponent, isHighchartsComponent, isImageComponent, isListComponent, isParagraphComponent, isReportComponent, isSectionComponent, isStatisticComponent, isTableComponent, isTextBoxComponent, isTextSpaceAfterComponent, isTocComponent, isValidComponent, isVisualComponent, parseJsonComponent, parseJsonWithLineNumbers, safeValidateComponentDefinition, safeValidateComponentProps, stripMarkdown, transformAndValidate, validateComponent, validateComponentDefinition, validateComponents };
2366
+ export { ChartPropsSchema, type ColumnsComponent, ColumnsPropsSchema, type ComponentDefinition, ComponentDefinitionSchema, type CoreValidationResult, type DiffDocumentsOptions, type DiffDocumentsResult, type DiffSegment, type DiffSummary, ValidationError as DocumentValidationError, DocumentValidationResult, DocxRendererId, type FormattedError, type HeadingComponent, HeadingPropsSchema, type HighchartsComponent, HighchartsPropsSchema, type ImageComponent, ImagePropsSchema, JsonDocumentParser, type JsonNode, JsonParsingError, JsonValidationError, type ListComponent, ListPropsSchema, type ParagraphComponent, ParagraphPropsSchema, type ReportComponent, type ReportComponentFor, ReportPropsSchema, RevisionSegment, SHARED_DOCX_VERSION, STANDARD_COMPONENTS, STANDARD_COMPONENTS_SET, type SectionComponent, SectionPropsSchema, type StandardComponentDefinition, type StandardComponentName, type StatisticComponent, StatisticPropsSchema, type TableComponent, TablePropsSchema, type TextBoxComponent, TextBoxPropsSchema, type TextSpaceAfterComponent, TextSpaceAfterPropsSchema, type ThemeName, type TocComponent, TocPropsSchema, type UntrackedChange, type VisualComponent, VisualPropsSchema, createValidatedComponent, diffDocuments, diffWords, formatErrorReport, formatValidationError, formatValidationErrorStrings, formatValidationErrors, getErrorSummary, getValidationContext, getValidationErrors, hasCriticalErrors, isColumnsComponent, isHeadingComponent, isHighchartsComponent, isImageComponent, isListComponent, isParagraphComponent, isReportComponent, isSectionComponent, isStatisticComponent, isTableComponent, isTextBoxComponent, isTextSpaceAfterComponent, isTocComponent, isValidComponent, isVisualComponent, parseJsonComponent, parseJsonWithLineNumbers, safeValidateComponentDefinition, safeValidateComponentProps, stripMarkdown, transformAndValidate, validateComponent, validateComponentDefinition, validateComponents };