@json-to-office/shared-docx 0.6.0 → 0.8.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 (41) hide show
  1. package/dist/{chunk-6SLVQATI.js → chunk-3AJ5NHUF.js} +2 -2
  2. package/dist/{chunk-YQECZGRR.js → chunk-7PK36JXG.js} +2 -2
  3. package/dist/chunk-F5IGGVWN.js +1339 -0
  4. package/dist/chunk-F5IGGVWN.js.map +1 -0
  5. package/dist/{chunk-V4L4S6ZS.js → chunk-JYGWHRMY.js} +2 -2
  6. package/dist/{chunk-L5TZFC47.js → chunk-M4OD7UER.js} +4 -42
  7. package/dist/chunk-M4OD7UER.js.map +1 -0
  8. package/dist/{chunk-22VYYAC2.js → chunk-MQ7KNRW2.js} +6 -4
  9. package/dist/{chunk-22VYYAC2.js.map → chunk-MQ7KNRW2.js.map} +1 -1
  10. package/dist/{chunk-OE5JFL7S.js → chunk-QEDASPGD.js} +8 -6
  11. package/dist/{chunk-OE5JFL7S.js.map → chunk-QEDASPGD.js.map} +1 -1
  12. package/dist/{chunk-SK6LSPFN.js → chunk-RFNU2AYT.js} +2 -2
  13. package/dist/chunk-S5KMAUDZ.js +645 -0
  14. package/dist/chunk-S5KMAUDZ.js.map +1 -0
  15. package/dist/{chunk-ABVYMFDA.js → chunk-VQXTI6WF.js} +2 -2
  16. package/dist/index.d.ts +220 -1
  17. package/dist/index.js +16 -14
  18. package/dist/index.js.map +1 -1
  19. package/dist/schemas/api.js +4 -3
  20. package/dist/schemas/component-defaults.d.ts +448 -0
  21. package/dist/schemas/component-defaults.js +24 -0
  22. package/dist/schemas/component-defaults.js.map +1 -0
  23. package/dist/schemas/component-registry.js +2 -1
  24. package/dist/schemas/components.d.ts +436 -0
  25. package/dist/schemas/components.js +13 -11
  26. package/dist/schemas/document.js +5 -4
  27. package/dist/schemas/export.js +3 -2
  28. package/dist/schemas/generator.js +3 -2
  29. package/dist/schemas/theme.d.ts +4 -444
  30. package/dist/schemas/theme.js +12 -12
  31. package/dist/validation/unified/index.d.ts +223 -0
  32. package/dist/validation/unified/index.js +6 -5
  33. package/package.json +2 -2
  34. package/dist/chunk-L5TZFC47.js.map +0 -1
  35. package/dist/chunk-PN6JT3KF.js +0 -1926
  36. package/dist/chunk-PN6JT3KF.js.map +0 -1
  37. /package/dist/{chunk-6SLVQATI.js.map → chunk-3AJ5NHUF.js.map} +0 -0
  38. /package/dist/{chunk-YQECZGRR.js.map → chunk-7PK36JXG.js.map} +0 -0
  39. /package/dist/{chunk-V4L4S6ZS.js.map → chunk-JYGWHRMY.js.map} +0 -0
  40. /package/dist/{chunk-SK6LSPFN.js.map → chunk-RFNU2AYT.js.map} +0 -0
  41. /package/dist/{chunk-ABVYMFDA.js.map → chunk-VQXTI6WF.js.map} +0 -0
@@ -9,6 +9,7 @@ import { ThemeConfigSchema } from '../../schemas/theme.js';
9
9
  import { ColumnsPropsSchema, HeadingPropsSchema, ImagePropsSchema, ListPropsSchema, ParagraphPropsSchema, ReportPropsSchema, SectionPropsSchema, StatisticPropsSchema, TablePropsSchema } from '../../schemas/components.js';
10
10
  import { CustomComponentDefinitionSchema } from '../../schemas/custom-components.js';
11
11
  import '../../schemas/font.js';
12
+ import '../../schemas/component-defaults.js';
12
13
 
13
14
  /**
14
15
  * Theme validation implementation
@@ -111,6 +112,228 @@ declare function getValidationSummary(result: ValidationResult): string;
111
112
  declare const COMPONENT_SCHEMA_MAP: {
112
113
  readonly report: _sinclair_typebox.TObject<{
113
114
  theme: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
115
+ componentDefaults: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
116
+ heading: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
117
+ text: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
118
+ level: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<1>, _sinclair_typebox.TLiteral<2>, _sinclair_typebox.TLiteral<3>, _sinclair_typebox.TLiteral<4>, _sinclair_typebox.TLiteral<5>, _sinclair_typebox.TLiteral<6>]>>;
119
+ font: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
120
+ size: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
121
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
122
+ bold: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
123
+ italic: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
124
+ underline: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
125
+ lineSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
126
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"single">, _sinclair_typebox.TLiteral<"atLeast">, _sinclair_typebox.TLiteral<"exactly">, _sinclair_typebox.TLiteral<"double">, _sinclair_typebox.TLiteral<"multiple">]>;
127
+ value: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
128
+ }>>;
129
+ spacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
130
+ before: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
131
+ after: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
132
+ }>>;
133
+ characterSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
134
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"condensed">, _sinclair_typebox.TLiteral<"expanded">]>;
135
+ value: _sinclair_typebox.TNumber;
136
+ }>>;
137
+ family: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
138
+ }>>;
139
+ alignment: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">, _sinclair_typebox.TLiteral<"justify">]>>;
140
+ spacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
141
+ before: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
142
+ after: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
143
+ }>>;
144
+ lineSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TObject<{
145
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"single">, _sinclair_typebox.TLiteral<"atLeast">, _sinclair_typebox.TLiteral<"exactly">, _sinclair_typebox.TLiteral<"double">, _sinclair_typebox.TLiteral<"multiple">]>;
146
+ value: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
147
+ }>]>>;
148
+ pageBreak: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
149
+ columnBreak: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
150
+ numbering: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
151
+ keepNext: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
152
+ keepLines: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
153
+ }>>;
154
+ paragraph: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
155
+ text: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
156
+ font: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
157
+ size: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
158
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
159
+ bold: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
160
+ italic: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
161
+ underline: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
162
+ lineSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
163
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"single">, _sinclair_typebox.TLiteral<"atLeast">, _sinclair_typebox.TLiteral<"exactly">, _sinclair_typebox.TLiteral<"double">, _sinclair_typebox.TLiteral<"multiple">]>;
164
+ value: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
165
+ }>>;
166
+ spacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
167
+ before: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
168
+ after: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
169
+ }>>;
170
+ characterSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
171
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"condensed">, _sinclair_typebox.TLiteral<"expanded">]>;
172
+ value: _sinclair_typebox.TNumber;
173
+ }>>;
174
+ family: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
175
+ }>>;
176
+ themeStyle: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
177
+ boldColor: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
178
+ spacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
179
+ before: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
180
+ after: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
181
+ }>>;
182
+ alignment: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">, _sinclair_typebox.TLiteral<"justify">]>>;
183
+ pageBreak: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
184
+ columnBreak: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
185
+ floating: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
186
+ horizontalPosition: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
187
+ relative: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"margin">, _sinclair_typebox.TLiteral<"page">, _sinclair_typebox.TLiteral<"text">]>>;
188
+ align: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">, _sinclair_typebox.TLiteral<"inside">, _sinclair_typebox.TLiteral<"outside">]>>;
189
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
190
+ }>>;
191
+ verticalPosition: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
192
+ relative: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"margin">, _sinclair_typebox.TLiteral<"page">, _sinclair_typebox.TLiteral<"text">]>>;
193
+ align: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"top">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"bottom">, _sinclair_typebox.TLiteral<"inside">, _sinclair_typebox.TLiteral<"outside">]>>;
194
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
195
+ }>>;
196
+ wrap: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
197
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"around">, _sinclair_typebox.TLiteral<"none">, _sinclair_typebox.TLiteral<"notBeside">, _sinclair_typebox.TLiteral<"through">, _sinclair_typebox.TLiteral<"tight">, _sinclair_typebox.TLiteral<"auto">]>;
198
+ }>>;
199
+ lockAnchor: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
200
+ width: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
201
+ height: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
202
+ }>>;
203
+ keepNext: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
204
+ keepLines: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
205
+ id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
206
+ }>>;
207
+ image: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
208
+ path: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
209
+ base64: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
210
+ alt: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
211
+ width: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
212
+ height: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
213
+ widthRelativeTo: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"content">, _sinclair_typebox.TLiteral<"page">]>>;
214
+ heightRelativeTo: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"content">, _sinclair_typebox.TLiteral<"page">]>>;
215
+ alignment: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">]>>;
216
+ caption: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
217
+ spacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
218
+ before: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
219
+ after: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
220
+ }>>;
221
+ floating: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
222
+ horizontalPosition: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
223
+ relative: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"character">, _sinclair_typebox.TLiteral<"column">, _sinclair_typebox.TLiteral<"margin">, _sinclair_typebox.TLiteral<"page">, _sinclair_typebox.TLiteral<"text">]>>;
224
+ align: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">, _sinclair_typebox.TLiteral<"inside">, _sinclair_typebox.TLiteral<"outside">]>>;
225
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
226
+ }>>;
227
+ verticalPosition: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
228
+ relative: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"margin">, _sinclair_typebox.TLiteral<"page">, _sinclair_typebox.TLiteral<"paragraph">, _sinclair_typebox.TLiteral<"line">, _sinclair_typebox.TLiteral<"text">]>>;
229
+ align: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"top">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"bottom">, _sinclair_typebox.TLiteral<"inside">, _sinclair_typebox.TLiteral<"outside">]>>;
230
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
231
+ }>>;
232
+ wrap: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
233
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"none">, _sinclair_typebox.TLiteral<"square">, _sinclair_typebox.TLiteral<"topAndBottom">, _sinclair_typebox.TLiteral<"around">, _sinclair_typebox.TLiteral<"tight">, _sinclair_typebox.TLiteral<"through">]>;
234
+ side: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"bothSides">, _sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"right">, _sinclair_typebox.TLiteral<"largest">]>>;
235
+ margins: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
236
+ top: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
237
+ bottom: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
238
+ left: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
239
+ right: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
240
+ }>>;
241
+ }>>;
242
+ allowOverlap: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
243
+ behindDocument: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
244
+ lockAnchor: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
245
+ layoutInCell: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
246
+ zIndex: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
247
+ rotation: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
248
+ visibility: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"hidden">, _sinclair_typebox.TLiteral<"inherit">]>>;
249
+ }>>;
250
+ keepNext: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
251
+ keepLines: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
252
+ }>>;
253
+ statistic: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
254
+ number: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
255
+ description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
256
+ unit: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
257
+ format: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
258
+ trend: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"up">, _sinclair_typebox.TLiteral<"down">, _sinclair_typebox.TLiteral<"neutral">]>>;
259
+ trendValue: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TNumber]>>;
260
+ alignment: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">]>>;
261
+ spacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
262
+ before: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
263
+ after: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
264
+ }>>;
265
+ size: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"small">, _sinclair_typebox.TLiteral<"medium">, _sinclair_typebox.TLiteral<"large">]>>;
266
+ }>>;
267
+ table: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{}>>;
268
+ section: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
269
+ title: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
270
+ level: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
271
+ header: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TArray<TSchema | _sinclair_typebox.TAny>, _sinclair_typebox.TLiteral<"linkToPrevious">]>>;
272
+ footer: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TArray<TSchema | _sinclair_typebox.TAny>, _sinclair_typebox.TLiteral<"linkToPrevious">]>>;
273
+ pageBreak: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
274
+ spacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
275
+ before: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
276
+ after: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
277
+ }>>;
278
+ page: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
279
+ size: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"A4">, _sinclair_typebox.TLiteral<"A3">, _sinclair_typebox.TLiteral<"LETTER">, _sinclair_typebox.TLiteral<"LEGAL">, _sinclair_typebox.TObject<{
280
+ width: _sinclair_typebox.TNumber;
281
+ height: _sinclair_typebox.TNumber;
282
+ }>]>>;
283
+ margins: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
284
+ top: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
285
+ bottom: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
286
+ left: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
287
+ right: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
288
+ header: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
289
+ footer: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
290
+ gutter: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
291
+ }>>;
292
+ }>>;
293
+ }>>;
294
+ columns: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
295
+ columns: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
296
+ width: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TLiteral<"auto">]>>;
297
+ gap: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
298
+ }>>]>>;
299
+ gap: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
300
+ }>>;
301
+ list: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
302
+ items: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TObject<{
303
+ text: _sinclair_typebox.TString;
304
+ level: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
305
+ }>]>>>;
306
+ reference: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
307
+ levels: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TObject<{
308
+ level: _sinclair_typebox.TNumber;
309
+ format: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"decimal">, _sinclair_typebox.TLiteral<"upperRoman">, _sinclair_typebox.TLiteral<"lowerRoman">, _sinclair_typebox.TLiteral<"upperLetter">, _sinclair_typebox.TLiteral<"lowerLetter">, _sinclair_typebox.TLiteral<"bullet">, _sinclair_typebox.TLiteral<"ordinal">, _sinclair_typebox.TLiteral<"cardinalText">, _sinclair_typebox.TLiteral<"ordinalText">, _sinclair_typebox.TLiteral<"hex">, _sinclair_typebox.TLiteral<"chicago">, _sinclair_typebox.TLiteral<"ideographDigital">, _sinclair_typebox.TLiteral<"japaneseCounting">, _sinclair_typebox.TLiteral<"aiueo">, _sinclair_typebox.TLiteral<"iroha">, _sinclair_typebox.TLiteral<"decimalFullWidth">, _sinclair_typebox.TLiteral<"decimalHalfWidth">, _sinclair_typebox.TLiteral<"japaneseLegal">, _sinclair_typebox.TLiteral<"japaneseDigitalTenThousand">, _sinclair_typebox.TLiteral<"decimalEnclosedCircle">, _sinclair_typebox.TLiteral<"decimalFullWidth2">, _sinclair_typebox.TLiteral<"aiueoFullWidth">, _sinclair_typebox.TLiteral<"irohaFullWidth">, _sinclair_typebox.TLiteral<"decimalZero">, _sinclair_typebox.TLiteral<"ganada">, _sinclair_typebox.TLiteral<"chosung">, _sinclair_typebox.TLiteral<"decimalEnclosedFullstop">, _sinclair_typebox.TLiteral<"decimalEnclosedParen">, _sinclair_typebox.TLiteral<"decimalEnclosedCircleChinese">, _sinclair_typebox.TLiteral<"ideographEnclosedCircle">, _sinclair_typebox.TLiteral<"ideographTraditional">, _sinclair_typebox.TLiteral<"ideographZodiac">, _sinclair_typebox.TLiteral<"ideographZodiacTraditional">, _sinclair_typebox.TLiteral<"taiwaneseCounting">, _sinclair_typebox.TLiteral<"ideographLegalTraditional">, _sinclair_typebox.TLiteral<"taiwaneseCountingThousand">, _sinclair_typebox.TLiteral<"taiwaneseDigital">, _sinclair_typebox.TLiteral<"chineseCounting">, _sinclair_typebox.TLiteral<"chineseLegalSimplified">, _sinclair_typebox.TLiteral<"chineseCountingThousand">, _sinclair_typebox.TLiteral<"koreanDigital">, _sinclair_typebox.TLiteral<"koreanCounting">, _sinclair_typebox.TLiteral<"koreanLegal">, _sinclair_typebox.TLiteral<"koreanDigital2">, _sinclair_typebox.TLiteral<"vietnameseCounting">, _sinclair_typebox.TLiteral<"russianLower">, _sinclair_typebox.TLiteral<"russianUpper">, _sinclair_typebox.TLiteral<"none">, _sinclair_typebox.TLiteral<"numberInDash">, _sinclair_typebox.TLiteral<"hebrew1">, _sinclair_typebox.TLiteral<"hebrew2">, _sinclair_typebox.TLiteral<"arabicAlpha">, _sinclair_typebox.TLiteral<"arabicAbjad">, _sinclair_typebox.TLiteral<"hindiVowels">, _sinclair_typebox.TLiteral<"hindiConsonants">, _sinclair_typebox.TLiteral<"hindiNumbers">, _sinclair_typebox.TLiteral<"hindiCounting">, _sinclair_typebox.TLiteral<"thaiLetters">, _sinclair_typebox.TLiteral<"thaiNumbers">, _sinclair_typebox.TLiteral<"thaiCounting">]>>;
310
+ /**
311
+ * Validate a custom component configuration with a custom schema.
312
+ * Delegates to @json-to-office/shared/plugin to avoid duplication.
313
+ */
314
+ text: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
315
+ alignment: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"start">, _sinclair_typebox.TLiteral<"end">, _sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"right">, _sinclair_typebox.TLiteral<"center">]>>;
316
+ indent: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
317
+ left: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
318
+ hanging: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
319
+ }>>;
320
+ start: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
321
+ }>>>;
322
+ format: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"decimal">, _sinclair_typebox.TLiteral<"upperRoman">, _sinclair_typebox.TLiteral<"lowerRoman">, _sinclair_typebox.TLiteral<"upperLetter">, _sinclair_typebox.TLiteral<"lowerLetter">, _sinclair_typebox.TLiteral<"bullet">, _sinclair_typebox.TLiteral<"ordinal">, _sinclair_typebox.TLiteral<"cardinalText">, _sinclair_typebox.TLiteral<"ordinalText">, _sinclair_typebox.TLiteral<"hex">, _sinclair_typebox.TLiteral<"chicago">, _sinclair_typebox.TLiteral<"ideographDigital">, _sinclair_typebox.TLiteral<"japaneseCounting">, _sinclair_typebox.TLiteral<"aiueo">, _sinclair_typebox.TLiteral<"iroha">, _sinclair_typebox.TLiteral<"decimalFullWidth">, _sinclair_typebox.TLiteral<"decimalHalfWidth">, _sinclair_typebox.TLiteral<"japaneseLegal">, _sinclair_typebox.TLiteral<"japaneseDigitalTenThousand">, _sinclair_typebox.TLiteral<"decimalEnclosedCircle">, _sinclair_typebox.TLiteral<"decimalFullWidth2">, _sinclair_typebox.TLiteral<"aiueoFullWidth">, _sinclair_typebox.TLiteral<"irohaFullWidth">, _sinclair_typebox.TLiteral<"decimalZero">, _sinclair_typebox.TLiteral<"ganada">, _sinclair_typebox.TLiteral<"chosung">, _sinclair_typebox.TLiteral<"decimalEnclosedFullstop">, _sinclair_typebox.TLiteral<"decimalEnclosedParen">, _sinclair_typebox.TLiteral<"decimalEnclosedCircleChinese">, _sinclair_typebox.TLiteral<"ideographEnclosedCircle">, _sinclair_typebox.TLiteral<"ideographTraditional">, _sinclair_typebox.TLiteral<"ideographZodiac">, _sinclair_typebox.TLiteral<"ideographZodiacTraditional">, _sinclair_typebox.TLiteral<"taiwaneseCounting">, _sinclair_typebox.TLiteral<"ideographLegalTraditional">, _sinclair_typebox.TLiteral<"taiwaneseCountingThousand">, _sinclair_typebox.TLiteral<"taiwaneseDigital">, _sinclair_typebox.TLiteral<"chineseCounting">, _sinclair_typebox.TLiteral<"chineseLegalSimplified">, _sinclair_typebox.TLiteral<"chineseCountingThousand">, _sinclair_typebox.TLiteral<"koreanDigital">, _sinclair_typebox.TLiteral<"koreanCounting">, _sinclair_typebox.TLiteral<"koreanLegal">, _sinclair_typebox.TLiteral<"koreanDigital2">, _sinclair_typebox.TLiteral<"vietnameseCounting">, _sinclair_typebox.TLiteral<"russianLower">, _sinclair_typebox.TLiteral<"russianUpper">, _sinclair_typebox.TLiteral<"none">, _sinclair_typebox.TLiteral<"numberInDash">, _sinclair_typebox.TLiteral<"hebrew1">, _sinclair_typebox.TLiteral<"hebrew2">, _sinclair_typebox.TLiteral<"arabicAlpha">, _sinclair_typebox.TLiteral<"arabicAbjad">, _sinclair_typebox.TLiteral<"hindiVowels">, _sinclair_typebox.TLiteral<"hindiConsonants">, _sinclair_typebox.TLiteral<"hindiNumbers">, _sinclair_typebox.TLiteral<"hindiCounting">, _sinclair_typebox.TLiteral<"thaiLetters">, _sinclair_typebox.TLiteral<"thaiNumbers">, _sinclair_typebox.TLiteral<"thaiCounting">]>, _sinclair_typebox.TLiteral<"numbered">, _sinclair_typebox.TLiteral<"none">]>>;
323
+ bullet: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
324
+ start: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
325
+ spacing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
326
+ before: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
327
+ after: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
328
+ item: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
329
+ }>>;
330
+ alignment: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">, _sinclair_typebox.TLiteral<"justify">]>>;
331
+ indent: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TObject<{
332
+ left: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
333
+ hanging: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
334
+ }>]>>;
335
+ }>>;
336
+ }>>;
114
337
  metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
115
338
  title: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
116
339
  subtitle: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
@@ -48,8 +48,8 @@ import {
48
48
  validateTheme,
49
49
  validateThemeJson,
50
50
  validateThemeWithEnhancement
51
- } from "../../chunk-OE5JFL7S.js";
52
- import "../../chunk-L5TZFC47.js";
51
+ } from "../../chunk-QEDASPGD.js";
52
+ import "../../chunk-M4OD7UER.js";
53
53
  import {
54
54
  comprehensiveValidateDocument,
55
55
  createDocumentValidator,
@@ -71,10 +71,11 @@ import {
71
71
  validateJsonComponent,
72
72
  validateJsonDocument,
73
73
  validateWithEnhancement
74
- } from "../../chunk-22VYYAC2.js";
75
- import "../../chunk-YQECZGRR.js";
74
+ } from "../../chunk-MQ7KNRW2.js";
75
+ import "../../chunk-7PK36JXG.js";
76
76
  import "../../chunk-VP3X6DBP.js";
77
- import "../../chunk-PN6JT3KF.js";
77
+ import "../../chunk-S5KMAUDZ.js";
78
+ import "../../chunk-F5IGGVWN.js";
78
79
  import "../../chunk-JOXJOD2C.js";
79
80
  export {
80
81
  DEFAULT_ERROR_CONFIG,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-to-office/shared-docx",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "DOCX-specific schemas, component registry and validation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@sinclair/typebox": "0.34.38",
32
32
  "docx": "9.5.1",
33
- "@json-to-office/shared": "^0.2.0"
33
+ "@json-to-office/shared": "^0.8.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "20.11.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schemas/theme.ts"],"sourcesContent":["/**\n * Theme Schema Definitions using TypeBox\n * This file provides TypeBox schemas for theme configuration validation\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n FontDefinitionSchema,\n TextFormattingPropertiesSchema,\n HexColorSchema,\n} from './font';\nimport { IndentSchema } from './components/common';\n\n// ============================================================================\n// Document Margins Schema\n// ============================================================================\n\nexport const DocumentMarginsSchema = Type.Object(\n {\n top: Type.Number({ minimum: 0 }),\n bottom: Type.Number({ minimum: 0 }),\n left: Type.Number({ minimum: 0 }),\n right: Type.Number({ minimum: 0 }),\n header: Type.Number({ minimum: 0 }),\n footer: Type.Number({ minimum: 0 }),\n gutter: Type.Number({ minimum: 0 }),\n },\n { additionalProperties: false, description: 'Document margin configuration' }\n);\n\n// ============================================================================\n// Page Dimensions Schema\n// ============================================================================\n\nexport const PageDimensionsSchema = Type.Object(\n {\n width: Type.Number({ minimum: 0 }),\n height: Type.Number({ minimum: 0 }),\n },\n { additionalProperties: false, description: 'Page dimensions in twips' }\n);\n\n// ============================================================================\n// Page Schema (replaces PageSetupSchema)\n// ============================================================================\n\nexport const PageSchema = Type.Object(\n {\n size: Type.Union(\n [\n Type.Literal('A4'),\n Type.Literal('A3'),\n Type.Literal('LETTER'),\n Type.Literal('LEGAL'),\n Type.Object(\n {\n width: Type.Number({ minimum: 0 }),\n height: Type.Number({ minimum: 0 }),\n },\n { additionalProperties: false }\n ),\n ],\n { description: 'Standard page size or custom dimensions' }\n ),\n margins: DocumentMarginsSchema,\n },\n {\n description: 'Page configuration including dimensions and margins',\n additionalProperties: false,\n }\n);\n\n// ============================================================================\n// Text formatting and font schemas now imported from './font' to avoid cycles\n\n// ============================================================================\n// Fonts Schema\n// ============================================================================\n\nexport const FontsSchema = Type.Object(\n {\n heading: FontDefinitionSchema,\n body: FontDefinitionSchema,\n mono: FontDefinitionSchema,\n light: FontDefinitionSchema,\n },\n {\n additionalProperties: false,\n description: 'Font definitions for different text types',\n }\n);\n\n// ============================================================================\n// Style Definitions Schema\n// ============================================================================\n\n// Paragraph border style support (matches docx BorderStyle)\nconst BorderStyleSchema = Type.Union(\n [\n Type.Literal('single'),\n Type.Literal('dashDotStroked'),\n Type.Literal('dashed'),\n Type.Literal('dashSmallGap'),\n Type.Literal('dotDash'),\n Type.Literal('dotDotDash'),\n Type.Literal('dotted'),\n Type.Literal('double'),\n Type.Literal('doubleWave'),\n Type.Literal('inset'),\n Type.Literal('nil'),\n Type.Literal('none'),\n Type.Literal('outset'),\n Type.Literal('thick'),\n Type.Literal('thickThinLargeGap'),\n Type.Literal('thickThinMediumGap'),\n Type.Literal('thickThinSmallGap'),\n Type.Literal('thinThickLargeGap'),\n Type.Literal('thinThickMediumGap'),\n Type.Literal('thinThickSmallGap'),\n Type.Literal('thinThickThinLargeGap'),\n Type.Literal('thinThickThinMediumGap'),\n Type.Literal('thinThickThinSmallGap'),\n Type.Literal('threeDEmboss'),\n Type.Literal('threeDEngrave'),\n Type.Literal('triple'),\n Type.Literal('wave'),\n ],\n { description: 'Paragraph border style' }\n);\n\nconst BorderDefinitionSchema = Type.Object(\n {\n style: BorderStyleSchema,\n size: Type.Number({\n minimum: 0,\n description: 'Width in eighths of a point (docx sz)',\n }),\n color: HexColorSchema,\n space: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Space between text and border in points',\n })\n ),\n },\n {\n additionalProperties: false,\n description: 'Paragraph border side definition',\n }\n);\n\nconst BordersSchema = Type.Object(\n {\n top: Type.Optional(BorderDefinitionSchema),\n bottom: Type.Optional(BorderDefinitionSchema),\n left: Type.Optional(BorderDefinitionSchema),\n right: Type.Optional(BorderDefinitionSchema),\n },\n { additionalProperties: false, description: 'Paragraph borders (per side)' }\n);\n\n// Alignment schema for paragraph-level alignment (used in styles)\nconst AlignmentSchema = Type.Optional(\n Type.Union([\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('justify'),\n ])\n);\n\n/**\n * Style properties schema that extends text formatting properties\n * with additional style-specific properties (priority, baseStyle, etc.)\n */\nconst StylePropertiesSchema = Type.Object(\n {\n font: Type.Optional(\n Type.Union([\n Type.Literal('heading'),\n Type.Literal('body'),\n Type.Literal('mono'),\n Type.Literal('light'),\n ])\n ),\n ...TextFormattingPropertiesSchema.properties,\n // Paragraph-level alignment (not a font property)\n alignment: AlignmentSchema,\n // Additional properties specific to styles\n priority: Type.Optional(Type.Number()),\n baseStyle: Type.Optional(Type.String()),\n followingStyle: Type.Optional(Type.String()),\n widowControl: Type.Optional(Type.Boolean()),\n keepNext: Type.Optional(Type.Boolean()),\n keepLinesTogether: Type.Optional(Type.Boolean()),\n outlineLevel: Type.Optional(Type.Number()),\n borders: Type.Optional(BordersSchema),\n indent: Type.Optional(IndentSchema),\n },\n { additionalProperties: false }\n);\n\n// ============================================================================\n// Tab Stop Schema\n// ============================================================================\n\n/**\n * Tab stop leader types matching docx.js LeaderType\n */\nconst TabStopLeaderSchema = Type.Union(\n [\n Type.Literal('dot'),\n Type.Literal('hyphen'),\n Type.Literal('middleDot'),\n Type.Literal('none'),\n Type.Literal('underscore'),\n ],\n {\n description:\n 'Tab leader style: dot (dotted), hyphen (dashed), middleDot, none (blank), or underscore',\n }\n);\n\n/**\n * Tab stop type matching docx.js TabStopType\n */\nconst TabStopTypeSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('right'),\n Type.Literal('center'),\n Type.Literal('bar'),\n Type.Literal('clear'),\n Type.Literal('decimal'),\n Type.Literal('end'),\n Type.Literal('num'),\n Type.Literal('start'),\n ],\n {\n description: 'Tab stop alignment type',\n }\n);\n\n/**\n * Tab stop definition schema\n */\nconst TabStopDefinitionSchema = Type.Object(\n {\n type: TabStopTypeSchema,\n position: Type.Union([\n Type.Number({\n description:\n 'Tab stop position in twips (1/1440 inch). Common: 9026 for right-aligned at page margin',\n }),\n Type.Literal('max', {\n description: 'Use maximum position (TabStopPosition.MAX = 9026 twips)',\n }),\n ]),\n leader: Type.Optional(TabStopLeaderSchema),\n },\n {\n description:\n 'Tab stop configuration with position, alignment, and optional leader',\n additionalProperties: false,\n }\n);\n\n/**\n * TOC style properties schema that extends text formatting properties\n * but EXCLUDES baseStyle to prevent unwanted coupling with Heading styles\n */\nconst TocStylePropertiesSchema = Type.Object(\n {\n font: Type.Optional(\n Type.Union([\n Type.Literal('heading'),\n Type.Literal('body'),\n Type.Literal('mono'),\n Type.Literal('light'),\n ])\n ),\n ...TextFormattingPropertiesSchema.properties,\n // Paragraph-level alignment (not a font property)\n alignment: AlignmentSchema,\n // Tab stops for controlling TOC entry formatting (leader dots, alignment, etc.)\n tabStops: Type.Optional(\n Type.Array(TabStopDefinitionSchema, {\n description:\n 'Tab stops for TOC entries. Use right-aligned tab with leader to create dotted lines to page numbers.',\n default: [{ type: 'right', position: 'max', leader: 'none' }],\n })\n ),\n // Additional properties specific to styles (baseStyle intentionally excluded)\n priority: Type.Optional(Type.Number()),\n followingStyle: Type.Optional(Type.String()),\n widowControl: Type.Optional(Type.Boolean()),\n keepNext: Type.Optional(Type.Boolean()),\n keepLinesTogether: Type.Optional(Type.Boolean()),\n outlineLevel: Type.Optional(Type.Number()),\n borders: Type.Optional(BordersSchema),\n indent: Type.Optional(IndentSchema),\n },\n { additionalProperties: false }\n);\n\nexport const StyleDefinitionsSchema = Type.Object(\n {\n normal: Type.Optional(StylePropertiesSchema),\n heading1: Type.Optional(StylePropertiesSchema),\n heading2: Type.Optional(StylePropertiesSchema),\n heading3: Type.Optional(StylePropertiesSchema),\n heading4: Type.Optional(StylePropertiesSchema),\n heading5: Type.Optional(StylePropertiesSchema),\n heading6: Type.Optional(StylePropertiesSchema),\n title: Type.Optional(StylePropertiesSchema),\n subtitle: Type.Optional(StylePropertiesSchema),\n // TOC entry styles (used by Word to format TOC entries)\n // Note: TOC styles use TocStylePropertiesSchema which excludes baseStyle to prevent coupling with Headings\n TOC1: Type.Optional(TocStylePropertiesSchema),\n TOC2: Type.Optional(TocStylePropertiesSchema),\n TOC3: Type.Optional(TocStylePropertiesSchema),\n TOC4: Type.Optional(TocStylePropertiesSchema),\n TOC5: Type.Optional(TocStylePropertiesSchema),\n TOC6: Type.Optional(TocStylePropertiesSchema),\n },\n {\n additionalProperties: StylePropertiesSchema,\n description:\n 'Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles.',\n }\n);\n\n// ============================================================================\n// Heading Definition Schema\n// ============================================================================\n\n/**\n * Heading definition schema that uses the same properties as StylePropertiesSchema\n * but adds a required 'level' field.\n */\nexport const HeadingDefinitionSchema = Type.Object(\n {\n level: Type.Union([\n Type.Literal(1),\n Type.Literal(2),\n Type.Literal(3),\n Type.Literal(4),\n Type.Literal(5),\n Type.Literal(6),\n ]),\n ...StylePropertiesSchema.properties,\n },\n { additionalProperties: false }\n);\n\n// ============================================================================\n// Component Defaults Schemas\n// ============================================================================\n\n// Import component props schemas from components.ts\nimport {\n HeadingPropsSchema,\n ParagraphPropsSchema,\n ImagePropsSchema,\n StatisticPropsSchema,\n TablePropsSchema,\n SectionPropsSchema,\n ColumnsPropsSchema,\n ListPropsSchema,\n} from './components';\n\n// Create component defaults by making all fields optional (Type.Partial)\nexport const HeadingComponentDefaultsSchema = Type.Partial(HeadingPropsSchema);\nexport const ParagraphComponentDefaultsSchema =\n Type.Partial(ParagraphPropsSchema);\nexport const ImageComponentDefaultsSchema = Type.Partial(ImagePropsSchema);\nexport const StatisticComponentDefaultsSchema =\n Type.Partial(StatisticPropsSchema);\nexport const TableComponentDefaultsSchema = Type.Partial(TablePropsSchema);\nexport const SectionComponentDefaultsSchema = Type.Partial(SectionPropsSchema);\nexport const ColumnsComponentDefaultsSchema = Type.Partial(ColumnsPropsSchema);\nexport const ListComponentDefaultsSchema = Type.Partial(ListPropsSchema);\n\nexport const ComponentDefaultsSchema = Type.Object(\n {\n heading: Type.Optional(HeadingComponentDefaultsSchema),\n paragraph: Type.Optional(ParagraphComponentDefaultsSchema),\n image: Type.Optional(ImageComponentDefaultsSchema),\n statistic: Type.Optional(StatisticComponentDefaultsSchema),\n table: Type.Optional(TableComponentDefaultsSchema),\n section: Type.Optional(SectionComponentDefaultsSchema),\n columns: Type.Optional(ColumnsComponentDefaultsSchema),\n list: Type.Optional(ListComponentDefaultsSchema),\n },\n { additionalProperties: true } // TODO: add a way to add strict custom component defaults when the plugin/registry paradigm will be implemented\n);\n\n// ============================================================================\n// Theme Config Schema\n// ============================================================================\n\nexport const ThemeConfigSchema = Type.Object(\n {\n $schema: Type.Optional(Type.String()),\n name: Type.String(),\n displayName: Type.String(),\n description: Type.String(),\n version: Type.String(),\n colors: Type.Object(\n {\n primary: HexColorSchema,\n secondary: HexColorSchema,\n accent: HexColorSchema,\n text: HexColorSchema,\n background: HexColorSchema,\n border: HexColorSchema,\n // Additional semantic color names\n textPrimary: HexColorSchema,\n textSecondary: HexColorSchema,\n textMuted: HexColorSchema,\n borderPrimary: HexColorSchema,\n borderSecondary: HexColorSchema,\n backgroundPrimary: HexColorSchema,\n backgroundSecondary: HexColorSchema,\n },\n { additionalProperties: false }\n ),\n fonts: FontsSchema,\n page: PageSchema,\n styles: Type.Optional(StyleDefinitionsSchema),\n componentDefaults: Type.Optional(ComponentDefaultsSchema),\n },\n {\n additionalProperties: false,\n description: 'Theme configuration',\n }\n);\n\n// ============================================================================\n// TypeScript Types\n// ============================================================================\n\nexport type ThemeConfigJson = Static<typeof ThemeConfigSchema>;\nexport type DocumentMargins = Static<typeof DocumentMarginsSchema>;\nexport type PageDimensions = Static<typeof PageDimensionsSchema>;\nexport type Page = Static<typeof PageSchema>;\nexport type FontDefinition = Static<typeof FontDefinitionSchema>;\nexport type Fonts = Static<typeof FontsSchema>;\nexport type StyleDefinitions = Static<typeof StyleDefinitionsSchema>;\nexport type HeadingDefinition = Static<typeof HeadingDefinitionSchema>;\nexport type HeadingComponentDefaults = Static<\n typeof HeadingComponentDefaultsSchema\n>;\nexport type ParagraphComponentDefaults = Static<\n typeof ParagraphComponentDefaultsSchema\n>;\nexport type ImageComponentDefaults = Static<\n typeof ImageComponentDefaultsSchema\n>;\nexport type StatisticComponentDefaults = Static<\n typeof StatisticComponentDefaultsSchema\n>;\nexport type TableComponentDefaults = Static<\n typeof TableComponentDefaultsSchema\n>;\nexport type SectionComponentDefaults = Static<\n typeof SectionComponentDefaultsSchema\n>;\nexport type ColumnsComponentDefaults = Static<\n typeof ColumnsComponentDefaultsSchema\n>;\nexport type ListComponentDefaults = Static<typeof ListComponentDefaultsSchema>;\nexport type ComponentDefaults = Static<typeof ComponentDefaultsSchema>;\n\n// ============================================================================\n// Validation Function\n// ============================================================================\n\nimport { Value } from '@sinclair/typebox/value';\n\nexport function isValidThemeConfig(data: unknown): data is ThemeConfigJson {\n return Value.Check(ThemeConfigSchema, data);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,SAAS,YAAoB;AAyd7B,SAAS,aAAa;AA7cf,IAAM,wBAAwB,KAAK;AAAA,EACxC;AAAA,IACE,KAAK,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAC/B,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAClC,MAAM,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAChC,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IACjC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAClC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IAClC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,EACpC;AAAA,EACA,EAAE,sBAAsB,OAAO,aAAa,gCAAgC;AAC9E;AAMO,IAAM,uBAAuB,KAAK;AAAA,EACvC;AAAA,IACE,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,IACjC,QAAQ,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,EACpC;AAAA,EACA,EAAE,sBAAsB,OAAO,aAAa,2BAA2B;AACzE;AAMO,IAAM,aAAa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