@json-to-office/core-docx 0.1.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 (169) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +9 -0
  3. package/dist/cache/index.d.ts +7 -0
  4. package/dist/cache/index.d.ts.map +1 -0
  5. package/dist/cache/key-generator.d.ts +34 -0
  6. package/dist/cache/key-generator.d.ts.map +1 -0
  7. package/dist/components/columns.d.ts +12 -0
  8. package/dist/components/columns.d.ts.map +1 -0
  9. package/dist/components/footer.d.ts +12 -0
  10. package/dist/components/footer.d.ts.map +1 -0
  11. package/dist/components/header.d.ts +12 -0
  12. package/dist/components/header.d.ts.map +1 -0
  13. package/dist/components/heading.d.ts +12 -0
  14. package/dist/components/heading.d.ts.map +1 -0
  15. package/dist/components/highcharts.d.ts +21 -0
  16. package/dist/components/highcharts.d.ts.map +1 -0
  17. package/dist/components/image.d.ts +12 -0
  18. package/dist/components/image.d.ts.map +1 -0
  19. package/dist/components/index.d.ts +19 -0
  20. package/dist/components/index.d.ts.map +1 -0
  21. package/dist/components/list.d.ts +12 -0
  22. package/dist/components/list.d.ts.map +1 -0
  23. package/dist/components/paragraph.d.ts +12 -0
  24. package/dist/components/paragraph.d.ts.map +1 -0
  25. package/dist/components/section.d.ts +12 -0
  26. package/dist/components/section.d.ts.map +1 -0
  27. package/dist/components/statistic.d.ts +12 -0
  28. package/dist/components/statistic.d.ts.map +1 -0
  29. package/dist/components/table.d.ts +13 -0
  30. package/dist/components/table.d.ts.map +1 -0
  31. package/dist/components/text-box.d.ts +9 -0
  32. package/dist/components/text-box.d.ts.map +1 -0
  33. package/dist/components/text-space-after.d.ts +35 -0
  34. package/dist/components/text-space-after.d.ts.map +1 -0
  35. package/dist/components/toc/index.d.ts +30 -0
  36. package/dist/components/toc/index.d.ts.map +1 -0
  37. package/dist/core/cached-render.d.ts +46 -0
  38. package/dist/core/cached-render.d.ts.map +1 -0
  39. package/dist/core/content.d.ts +263 -0
  40. package/dist/core/content.d.ts.map +1 -0
  41. package/dist/core/generator.d.ts +93 -0
  42. package/dist/core/generator.d.ts.map +1 -0
  43. package/dist/core/index.d.ts +14 -0
  44. package/dist/core/index.d.ts.map +1 -0
  45. package/dist/core/layout.d.ts +107 -0
  46. package/dist/core/layout.d.ts.map +1 -0
  47. package/dist/core/render.d.ts +26 -0
  48. package/dist/core/render.d.ts.map +1 -0
  49. package/dist/core/structure.d.ts +67 -0
  50. package/dist/core/structure.d.ts.map +1 -0
  51. package/dist/examples/test-spacing-debug.d.ts +2 -0
  52. package/dist/examples/test-spacing-debug.d.ts.map +1 -0
  53. package/dist/examples/test-spacing.d.ts +6 -0
  54. package/dist/examples/test-spacing.d.ts.map +1 -0
  55. package/dist/index.d.ts +20 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +7726 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/json/filesystem.d.ts +81 -0
  60. package/dist/json/filesystem.d.ts.map +1 -0
  61. package/dist/json/index.d.ts +6 -0
  62. package/dist/json/index.d.ts.map +1 -0
  63. package/dist/json/normalizer.d.ts +30 -0
  64. package/dist/json/normalizer.d.ts.map +1 -0
  65. package/dist/json/parser.d.ts +9 -0
  66. package/dist/json/parser.d.ts.map +1 -0
  67. package/dist/plugin/createComponent.d.ts +113 -0
  68. package/dist/plugin/createComponent.d.ts.map +1 -0
  69. package/dist/plugin/createDocumentGenerator.d.ts +18 -0
  70. package/dist/plugin/createDocumentGenerator.d.ts.map +1 -0
  71. package/dist/plugin/example/columns-layout.component.d.ts +29 -0
  72. package/dist/plugin/example/columns-layout.component.d.ts.map +1 -0
  73. package/dist/plugin/example/index.d.ts +6 -0
  74. package/dist/plugin/example/index.d.ts.map +1 -0
  75. package/dist/plugin/example/index.js +7449 -0
  76. package/dist/plugin/example/index.js.map +1 -0
  77. package/dist/plugin/example/nested-section.component.d.ts +16 -0
  78. package/dist/plugin/example/nested-section.component.d.ts.map +1 -0
  79. package/dist/plugin/example/plugin-demo.json +103 -0
  80. package/dist/plugin/example/text-space-after.component.d.ts +22 -0
  81. package/dist/plugin/example/text-space-after.component.d.ts.map +1 -0
  82. package/dist/plugin/example/weather.component.d.ts +29 -0
  83. package/dist/plugin/example/weather.component.d.ts.map +1 -0
  84. package/dist/plugin/index.d.ts +35 -0
  85. package/dist/plugin/index.d.ts.map +1 -0
  86. package/dist/plugin/schema.d.ts +30 -0
  87. package/dist/plugin/schema.d.ts.map +1 -0
  88. package/dist/plugin/types.d.ts +144 -0
  89. package/dist/plugin/types.d.ts.map +1 -0
  90. package/dist/plugin/validation.d.ts +45 -0
  91. package/dist/plugin/validation.d.ts.map +1 -0
  92. package/dist/plugin/version-resolver.d.ts +10 -0
  93. package/dist/plugin/version-resolver.d.ts.map +1 -0
  94. package/dist/styles/index.d.ts +13 -0
  95. package/dist/styles/index.d.ts.map +1 -0
  96. package/dist/styles/theme-resolver.d.ts +6 -0
  97. package/dist/styles/theme-resolver.d.ts.map +1 -0
  98. package/dist/styles/theme-validator.d.ts +7 -0
  99. package/dist/styles/theme-validator.d.ts.map +1 -0
  100. package/dist/styles/themeToDocxAdapter.d.ts +22 -0
  101. package/dist/styles/themeToDocxAdapter.d.ts.map +1 -0
  102. package/dist/styles/utils/borderUtils.d.ts +88 -0
  103. package/dist/styles/utils/borderUtils.d.ts.map +1 -0
  104. package/dist/styles/utils/cellUtils.d.ts +55 -0
  105. package/dist/styles/utils/cellUtils.d.ts.map +1 -0
  106. package/dist/styles/utils/colorUtils.d.ts +27 -0
  107. package/dist/styles/utils/colorUtils.d.ts.map +1 -0
  108. package/dist/styles/utils/componentDefaults.d.ts +97 -0
  109. package/dist/styles/utils/componentDefaults.d.ts.map +1 -0
  110. package/dist/styles/utils/layoutUtils.d.ts +87 -0
  111. package/dist/styles/utils/layoutUtils.d.ts.map +1 -0
  112. package/dist/styles/utils/styleHelpers.d.ts +90 -0
  113. package/dist/styles/utils/styleHelpers.d.ts.map +1 -0
  114. package/dist/templates/documents/index.d.ts +34 -0
  115. package/dist/templates/documents/index.d.ts.map +1 -0
  116. package/dist/templates/documents/proposal.docx.json +171 -0
  117. package/dist/templates/documents/quarterly-report.docx.json +117 -0
  118. package/dist/templates/documents/technical-guide.docx.json +178 -0
  119. package/dist/templates/themes/corporate.docx.theme.json +118 -0
  120. package/dist/templates/themes/index.d.ts +5765 -0
  121. package/dist/templates/themes/index.d.ts.map +1 -0
  122. package/dist/templates/themes/minimal.docx.theme.json +194 -0
  123. package/dist/templates/themes/modern.docx.theme.json +115 -0
  124. package/dist/themes/defaults.d.ts +1300 -0
  125. package/dist/themes/defaults.d.ts.map +1 -0
  126. package/dist/themes/json/index.d.ts +44 -0
  127. package/dist/themes/json/index.d.ts.map +1 -0
  128. package/dist/themes/json/loader.d.ts +26 -0
  129. package/dist/themes/json/loader.d.ts.map +1 -0
  130. package/dist/themes/json/parser.d.ts +25 -0
  131. package/dist/themes/json/parser.d.ts.map +1 -0
  132. package/dist/themes/json/validator.d.ts +35 -0
  133. package/dist/themes/json/validator.d.ts.map +1 -0
  134. package/dist/tsconfig.tsbuildinfo +1 -0
  135. package/dist/types/index.d.ts +158 -0
  136. package/dist/types/index.d.ts.map +1 -0
  137. package/dist/types/plugin.d.ts +67 -0
  138. package/dist/types/plugin.d.ts.map +1 -0
  139. package/dist/utils/alignmentUtils.d.ts +10 -0
  140. package/dist/utils/alignmentUtils.d.ts.map +1 -0
  141. package/dist/utils/bookmarkRegistry.d.ts +49 -0
  142. package/dist/utils/bookmarkRegistry.d.ts.map +1 -0
  143. package/dist/utils/docxImagePositioning.d.ts +18 -0
  144. package/dist/utils/docxImagePositioning.d.ts.map +1 -0
  145. package/dist/utils/environment.d.ts +14 -0
  146. package/dist/utils/environment.d.ts.map +1 -0
  147. package/dist/utils/exampleRunner.d.ts +17 -0
  148. package/dist/utils/exampleRunner.d.ts.map +1 -0
  149. package/dist/utils/fixFloatingImageIds.d.ts +18 -0
  150. package/dist/utils/fixFloatingImageIds.d.ts.map +1 -0
  151. package/dist/utils/formatters.d.ts +2 -0
  152. package/dist/utils/formatters.d.ts.map +1 -0
  153. package/dist/utils/imageUtils.d.ts +84 -0
  154. package/dist/utils/imageUtils.d.ts.map +1 -0
  155. package/dist/utils/numberingConfig.d.ts +84 -0
  156. package/dist/utils/numberingConfig.d.ts.map +1 -0
  157. package/dist/utils/placeholderImage.d.ts +31 -0
  158. package/dist/utils/placeholderImage.d.ts.map +1 -0
  159. package/dist/utils/placeholderProcessor.d.ts +58 -0
  160. package/dist/utils/placeholderProcessor.d.ts.map +1 -0
  161. package/dist/utils/textParser.d.ts +35 -0
  162. package/dist/utils/textParser.d.ts.map +1 -0
  163. package/dist/utils/unicode.d.ts +6 -0
  164. package/dist/utils/unicode.d.ts.map +1 -0
  165. package/dist/utils/warningsDocument.d.ts +17 -0
  166. package/dist/utils/warningsDocument.d.ts.map +1 -0
  167. package/dist/utils/widthUtils.d.ts +27 -0
  168. package/dist/utils/widthUtils.d.ts.map +1 -0
  169. package/package.json +88 -0
package/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wiseair srl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # @json-to-office/core-docx
2
+
3
+ Core DOCX document generation engine.
4
+
5
+ > **Internal package** — used by other @json-to-office packages. You probably want [`@json-to-office/json-to-docx`](../json-to-docx) or [`@json-to-office/json-to-pptx`](../json-to-pptx) instead.
6
+
7
+ ## License
8
+
9
+ [MIT](../../LICENSE)
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Cache Module Exports
3
+ * Re-exports format-agnostic cache from shared + local key-generator
4
+ */
5
+ export * from '@json-to-office/shared/cache';
6
+ export { CacheKeyGenerator } from './key-generator';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Cache Key Generator
3
+ * Generates deterministic cache keys for components
4
+ */
5
+ import { ComponentDefinition, RenderContext } from '../types';
6
+ import { CacheKeyOptions } from '@json-to-office/shared/cache';
7
+ /**
8
+ * Cache key generator with deterministic hashing
9
+ */
10
+ export declare class CacheKeyGenerator {
11
+ private readonly version;
12
+ constructor(version?: string);
13
+ /**
14
+ * Generate cache key for a component
15
+ */
16
+ generateKey(component: ComponentDefinition, context: RenderContext, options?: CacheKeyOptions): string;
17
+ /**
18
+ * Hash component props
19
+ */
20
+ hashProps(props: any): string;
21
+ /**
22
+ * Hash render context
23
+ */
24
+ private hashContext;
25
+ /**
26
+ * Normalize object for consistent hashing
27
+ */
28
+ private normalizeObject;
29
+ /**
30
+ * Create hash
31
+ */
32
+ private hash;
33
+ }
34
+ //# sourceMappingURL=key-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-generator.d.ts","sourceRoot":"","sources":["../../src/cache/key-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,GAAE,MAAc;IAInC;;OAEG;IACH,WAAW,CACT,SAAS,EAAE,mBAAmB,EAC9B,OAAO,EAAE,aAAa,EACtB,OAAO,GAAE,eAAoB,GAC5B,MAAM;IA0BT;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM;IAU7B;;OAEG;IACH,OAAO,CAAC,WAAW;IAWnB;;OAEG;IACH,OAAO,CAAC,eAAe;IAyBvB;;OAEG;IACH,OAAO,CAAC,IAAI;CAGb"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Columns Component
3
+ * Standard component for rendering content in columns layout
4
+ */
5
+ import { Paragraph, Table } from 'docx';
6
+ import { ComponentDefinition, RenderContext } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render columns component
10
+ */
11
+ export declare function renderColumnsComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string, context: RenderContext): Promise<(Paragraph | Table)[]>;
12
+ //# sourceMappingURL=columns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../src/components/columns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,KAAK,EAON,MAAM,MAAM,CAAC;AACd,OAAO,EACL,mBAAmB,EACnB,aAAa,EAGd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AASxC;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,CA6BhC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Footer Component
3
+ * Standard component for rendering footer elements in documents
4
+ */
5
+ import { Paragraph } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render footer component
10
+ */
11
+ export declare function renderFooterComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string): Paragraph[];
12
+ //# sourceMappingURL=footer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/components/footer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAW,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AAI1D;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,CAqBb"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Header Component
3
+ * Standard component for rendering header elements in documents
4
+ */
5
+ import { Paragraph } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render header component
10
+ */
11
+ export declare function renderHeaderComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string): Paragraph[];
12
+ //# sourceMappingURL=header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/components/header.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAW,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AAI1D;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,CAqBb"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Heading Component
3
+ * Standard component for rendering heading elements in documents
4
+ */
5
+ import { Paragraph } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render heading component
10
+ */
11
+ export declare function renderHeadingComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string): Paragraph[];
12
+ //# sourceMappingURL=heading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/components/heading.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAsB,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQxC;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,CAiDb"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Highcharts Component
3
+ * Standard component for generating charts using Highcharts Export Server
4
+ */
5
+ import { Paragraph, Table } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ export type { HighchartsProps } from '@json-to-office/shared-docx';
9
+ /**
10
+ * Chart generation result
11
+ */
12
+ export interface ChartGenerationResult {
13
+ base64DataUri: string;
14
+ width: number;
15
+ height: number;
16
+ }
17
+ /**
18
+ * Render highcharts component
19
+ */
20
+ export declare function renderHighchartsComponent(component: ComponentDefinition, theme: ThemeConfig, _themeName: string): Promise<(Paragraph | Table)[]>;
21
+ //# sourceMappingURL=highcharts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highcharts.d.ts","sourceRoot":"","sources":["../../src/components/highcharts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAyB,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQxC,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AA+DD;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,CA6BhC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Image Component
3
+ * Standard component for rendering images in documents
4
+ */
5
+ import { Paragraph } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render image component
10
+ */
11
+ export declare function renderImageComponent(component: ComponentDefinition, theme: ThemeConfig): Promise<Paragraph[]>;
12
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/components/image.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAoB,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,SAAS,EAAE,CAAC,CA2BtB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Standard and Custom Components
3
+ * This folder contains all components that extend the document generator
4
+ */
5
+ export { renderHeadingComponent } from './heading';
6
+ export { renderParagraphComponent } from './paragraph';
7
+ export { renderListComponent } from './list';
8
+ export { renderImageComponent } from './image';
9
+ export { renderTextBoxComponent } from './text-box';
10
+ export { renderTableComponent } from './table';
11
+ export { renderSectionComponent } from './section';
12
+ export { renderColumnsComponent } from './columns';
13
+ export { renderStatisticComponent } from './statistic';
14
+ export { renderHeaderComponent } from './header';
15
+ export { renderFooterComponent } from './footer';
16
+ export { renderTocComponent } from './toc';
17
+ export { renderHighchartsComponent } from './highcharts';
18
+ export { textSpaceAfterComponent } from './text-space-after';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * List Component
3
+ * Standard component for rendering list elements in documents
4
+ */
5
+ import { Paragraph } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render list component
10
+ */
11
+ export declare function renderListComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string): Paragraph[];
12
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/components/list.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAmB,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAqJxC;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,CA4Cb"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Paragraph Component
3
+ * Standard component for rendering paragraph content in documents
4
+ */
5
+ import { Paragraph } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render paragraph component
10
+ */
11
+ export declare function renderParagraphComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string): Paragraph[];
12
+ //# sourceMappingURL=paragraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../src/components/paragraph.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAwB,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AA8DxC;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,SAAS,EAAE,CAiIb"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Section Component
3
+ * Standard component for rendering document sections with child components
4
+ */
5
+ import { Paragraph, Table } from 'docx';
6
+ import { ComponentDefinition, RenderContext } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render section component with bookmark support for scoped TOCs
10
+ */
11
+ export declare function renderSectionComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string, context: RenderContext): Promise<(Paragraph | Table)[]>;
12
+ //# sourceMappingURL=section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/components/section.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAA8B,MAAM,MAAM,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAexC;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,CA0DhC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Statistic Component
3
+ * Standard component for rendering statistic displays in documents
4
+ */
5
+ import { Paragraph } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render statistic component
10
+ */
11
+ export declare function renderStatisticComponent(component: ComponentDefinition, theme: ThemeConfig): Paragraph[];
12
+ //# sourceMappingURL=statistic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistic.d.ts","sourceRoot":"","sources":["../../src/components/statistic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAwB,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,GACjB,SAAS,EAAE,CAkBb"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Table Component
3
+ * Standard component for rendering tables in documents
4
+ */
5
+ import { Table } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ /**
9
+ * Render table component
10
+ * Supports new column-based format with cell defaults and legacy headers/rows format
11
+ */
12
+ export declare function renderTableComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string): Promise<Table[]>;
13
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAoB,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AA6ExC;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,KAAK,EAAE,CAAC,CAyDlB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Text Box Component
3
+ * Floating container that groups child paragraphs (from text/image components)
4
+ */
5
+ import { Paragraph, Table } from 'docx';
6
+ import { ComponentDefinition } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ export declare function renderTextBoxComponent(component: ComponentDefinition, theme: ThemeConfig, themeName: string, _context: import('../types').RenderContext): Promise<(Paragraph | Table)[]>;
9
+ //# sourceMappingURL=text-box.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-box.d.ts","sourceRoot":"","sources":["../../src/components/text-box.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,KAAK,EASN,MAAM,MAAM,CAAC;AACd,OAAO,EACL,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAkFxC,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,UAAU,EAAE,aAAa,GACzC,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,CAqGhC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Text Space After Custom Component
3
+ * A text component with hardcoded spacing after the paragraph
4
+ *
5
+ * This component is provided as an example of the legacy custom component system.
6
+ * For new custom components, use the plugin system instead:
7
+ * @see packages/core/src/plugin/example/ for modern examples
8
+ */
9
+ import { Static } from '@sinclair/typebox';
10
+ import type { ComponentDefinition } from '@json-to-office/shared-docx';
11
+ /**
12
+ * Props schema for text-space-after component
13
+ */
14
+ declare const TextSpaceAfterPropsSchema: import("@sinclair/typebox").TObject<{
15
+ text: import("@sinclair/typebox").TString;
16
+ spacing: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
17
+ before: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
18
+ after: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
19
+ }>>;
20
+ }>;
21
+ export type TextSpaceAfterProps = Static<typeof TextSpaceAfterPropsSchema>;
22
+ /**
23
+ * Text space after component - adds hardcoded spacing after paragraphs
24
+ */
25
+ export declare const textSpaceAfterComponent: import("../plugin/createComponent").CustomComponent<ComponentDefinition, {
26
+ '1.0.0': import("../plugin/createComponent").ComponentVersion<import("@json-to-office/shared-docx").ParagraphComponent, import("@sinclair/typebox").TObject<{
27
+ text: import("@sinclair/typebox").TString;
28
+ spacing: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
29
+ before: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
30
+ after: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
31
+ }>>;
32
+ }>>;
33
+ }, "text-space-after">;
34
+ export {};
35
+ //# sourceMappingURL=text-space-after.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-space-after.d.ts","sourceRoot":"","sources":["../../src/components/text-space-after.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;GAEG;AACH,QAAA,MAAM,yBAAyB;;;;;;EAW7B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;sBAuBlC,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Table of Contents Component
3
+ * Renders TOC using Word's native TableOfContents field with bookmark scoping support
4
+ */
5
+ import { Paragraph, TableOfContents } from 'docx';
6
+ import type { TocProps } from '@json-to-office/shared-docx';
7
+ import type { ThemeConfig } from '../../styles';
8
+ import type { RenderContext } from '../../types';
9
+ export interface TocComponentDefinition {
10
+ name: 'toc';
11
+ id?: string;
12
+ props: TocProps;
13
+ }
14
+ /**
15
+ * Render TOC component using Word's native TableOfContents field with bookmark scoping
16
+ *
17
+ * This creates a dynamic TOC that:
18
+ * - Auto-populates with headings from configured scope
19
+ * - Updates automatically when document structure changes
20
+ * - Includes clickable hyperlinks to content
21
+ * - Shows page numbers (if enabled)
22
+ * - Respects configured depth limits
23
+ *
24
+ * Scope behavior:
25
+ * - scope: 'document' → Scans entire document (default when TOC is at report level)
26
+ * - scope: 'section' → Scans only parent section content (uses bookmark)
27
+ * - scope: 'auto' → Automatically detects: section if inside section, otherwise document
28
+ */
29
+ export declare function renderTocComponent(component: TocComponentDefinition, theme: ThemeConfig, context?: RenderContext): (Paragraph | TableOfContents)[];
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toc/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,eAAe,EAIhB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,KAAK,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,QAAQ,CAAC;CACjB;AAyCD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,sBAAsB,EACjC,KAAK,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,CAAC,SAAS,GAAG,eAAe,CAAC,EAAE,CA+MjC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Cached component rendering system
3
+ * Provides caching layer for component rendering operations
4
+ */
5
+ import { Paragraph, Table, TableOfContents, Textbox } from 'docx';
6
+ import { ComponentDefinition, RenderContext } from '../types';
7
+ import { ThemeConfig } from '../styles';
8
+ import { MemoryCache } from '../cache';
9
+ /**
10
+ * Initialize the component cache
11
+ */
12
+ export declare function initializeComponentCache(cache?: MemoryCache): void;
13
+ /**
14
+ * Get the component cache instance
15
+ */
16
+ export declare function getComponentCache(): MemoryCache | null;
17
+ /**
18
+ * Clear the component cache
19
+ */
20
+ export declare function clearComponentCache(): Promise<void>;
21
+ /**
22
+ * Render a component with caching
23
+ */
24
+ export declare function renderComponentWithCache(component: ComponentDefinition, theme: ThemeConfig, themeName: string, context: RenderContext, bypassCache?: boolean): Promise<(Paragraph | Table | TableOfContents | Textbox)[]>;
25
+ /**
26
+ * Warm the cache with frequently used components
27
+ */
28
+ export declare function warmComponentCache(components: Array<{
29
+ component: ComponentDefinition;
30
+ theme: ThemeConfig;
31
+ themeName: string;
32
+ context: RenderContext;
33
+ }>): Promise<void>;
34
+ /**
35
+ * Get component cache statistics
36
+ */
37
+ export declare function getComponentCacheStats(): import("@json-to-office/shared/cache").CacheStatistics | null;
38
+ /**
39
+ * Export component cache for persistence
40
+ */
41
+ export declare function exportComponentCache(): Promise<Map<string, unknown> | null>;
42
+ /**
43
+ * Import component cache from persistence
44
+ */
45
+ export declare function importComponentCache(data: Map<string, unknown>): Promise<void>;
46
+ //# sourceMappingURL=cached-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cached-render.d.ts","sourceRoot":"","sources":["../../src/core/cached-render.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,WAAW,EAIZ,MAAM,UAAU,CAAC;AAkBlB;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CA4BlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,GAAG,IAAI,CAEtD;AAED;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAIzD;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,EACtB,WAAW,UAAQ,GAClB,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,GAAG,eAAe,GAAG,OAAO,CAAC,EAAE,CAAC,CA8E5D;AAKD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,KAAK,CAAC;IAChB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC,GACD,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;GAEG;AACH,wBAAgB,sBAAsB,kEAMrC;AAED;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,GAAG,CACvD,MAAM,EACN,OAAO,CACR,GAAG,IAAI,CAAC,CAgBR;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GACzB,OAAO,CAAC,IAAI,CAAC,CAQf"}