@json-to-office/shared-docx 0.38.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GGAJWGDI.js → chunk-G3XK537A.js} +35 -4
- package/dist/chunk-G3XK537A.js.map +1 -0
- package/dist/{chunk-OUSJFBMX.js → chunk-GT3MN2RI.js} +2 -2
- package/dist/{chunk-K2LA6WCD.js → chunk-MG2PLA6W.js} +2 -2
- package/dist/{chunk-SH3OH4OY.js → chunk-NAVRPVTN.js} +4 -4
- package/dist/{chunk-DYTUITUL.js → chunk-NZO5SZUO.js} +10 -3
- package/dist/{chunk-DYTUITUL.js.map → chunk-NZO5SZUO.js.map} +1 -1
- package/dist/chunk-T7P4TA7I.js +89 -0
- package/dist/chunk-T7P4TA7I.js.map +1 -0
- package/dist/{chunk-WDRYTKHA.js → chunk-V4HZOLMN.js} +2 -2
- package/dist/{chunk-K367M7TI.js → chunk-VEF4T6PL.js} +2 -2
- package/dist/{chunk-WOFU72HH.js → chunk-WXG3FQ5V.js} +66 -8
- package/dist/chunk-WXG3FQ5V.js.map +1 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/dist/schemas/api.js +4 -3
- package/dist/schemas/component-registry.d.ts +10 -2
- package/dist/schemas/component-registry.js +2 -1
- package/dist/schemas/components.js +3 -2
- package/dist/schemas/document.js +5 -4
- package/dist/schemas/export.js +3 -2
- package/dist/schemas/generator.js +3 -2
- package/dist/schemas/renderer.d.ts +12 -0
- package/dist/schemas/renderer.js +13 -0
- package/dist/schemas/renderer.js.map +1 -0
- package/dist/validation/unified/index.js +5 -4
- package/package.json +2 -2
- package/dist/chunk-GGAJWGDI.js.map +0 -1
- package/dist/chunk-WOFU72HH.js.map +0 -1
- /package/dist/{chunk-OUSJFBMX.js.map → chunk-GT3MN2RI.js.map} +0 -0
- /package/dist/{chunk-K2LA6WCD.js.map → chunk-MG2PLA6W.js.map} +0 -0
- /package/dist/{chunk-SH3OH4OY.js.map → chunk-NAVRPVTN.js.map} +0 -0
- /package/dist/{chunk-WDRYTKHA.js.map → chunk-V4HZOLMN.js.map} +0 -0
- /package/dist/{chunk-K367M7TI.js.map → chunk-VEF4T6PL.js.map} +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// src/schemas/renderer.ts
|
|
2
|
+
var DOCX_RENDERER_IDS = ["docxjs", "office-open"];
|
|
3
|
+
var DEFAULT_DOCX_RENDERER_ID = "docxjs";
|
|
4
|
+
function docxPropsSchemaForRenderer(schema, renderer) {
|
|
5
|
+
const copy = cloneSchema(schema);
|
|
6
|
+
if (renderer === "office-open") pruneThreadFields(copy);
|
|
7
|
+
return copy;
|
|
8
|
+
}
|
|
9
|
+
function collectDocxRendererErrors(data) {
|
|
10
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return [];
|
|
11
|
+
const root = data;
|
|
12
|
+
const renderer = root.renderer ?? DEFAULT_DOCX_RENDERER_ID;
|
|
13
|
+
if (!DOCX_RENDERER_IDS.includes(renderer)) {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
path: "/renderer",
|
|
17
|
+
message: `Invalid renderer "${String(renderer)}". Expected "docxjs" or "office-open".`,
|
|
18
|
+
code: "invalid_value"
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
if (renderer !== "office-open") return [];
|
|
23
|
+
const errors = [];
|
|
24
|
+
const visit = (node, path) => {
|
|
25
|
+
if (Array.isArray(node)) {
|
|
26
|
+
node.forEach((entry, index) => visit(entry, `${path}/${index}`));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (!node || typeof node !== "object") return;
|
|
30
|
+
const object = node;
|
|
31
|
+
const comment = object.comment;
|
|
32
|
+
if (comment && typeof comment === "object" && !Array.isArray(comment)) {
|
|
33
|
+
const value = comment;
|
|
34
|
+
for (const field of ["replies", "resolved"]) {
|
|
35
|
+
if (value[field] !== void 0) {
|
|
36
|
+
errors.push({
|
|
37
|
+
path: `${path}/comment/${field}`,
|
|
38
|
+
message: `The "office-open" renderer does not support comment threads.`,
|
|
39
|
+
code: "unsupported_renderer_feature"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
for (const [key, value] of Object.entries(object)) {
|
|
45
|
+
if (key !== "renderer") visit(value, `${path}/${key}`);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
visit(root, "");
|
|
49
|
+
return errors;
|
|
50
|
+
}
|
|
51
|
+
function pruneThreadFields(node) {
|
|
52
|
+
if (Array.isArray(node)) {
|
|
53
|
+
node.forEach(pruneThreadFields);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (!node || typeof node !== "object") return;
|
|
57
|
+
const schema = node;
|
|
58
|
+
const properties = schema.properties;
|
|
59
|
+
if (properties?.text && properties?.author && (properties.replies || properties.resolved) && typeof schema.description === "string" && schema.description.includes("Word review comment")) {
|
|
60
|
+
delete properties.replies;
|
|
61
|
+
delete properties.resolved;
|
|
62
|
+
const required = schema.required;
|
|
63
|
+
if (required) {
|
|
64
|
+
schema.required = required.filter(
|
|
65
|
+
(key) => key !== "replies" && key !== "resolved"
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
for (const key of Reflect.ownKeys(schema)) {
|
|
70
|
+
pruneThreadFields(schema[key]);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function cloneSchema(value) {
|
|
74
|
+
if (Array.isArray(value)) return value.map(cloneSchema);
|
|
75
|
+
if (!value || typeof value !== "object") return value;
|
|
76
|
+
const copy = Object.create(Object.getPrototypeOf(value));
|
|
77
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
78
|
+
copy[key] = cloneSchema(value[key]);
|
|
79
|
+
}
|
|
80
|
+
return copy;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
DOCX_RENDERER_IDS,
|
|
85
|
+
DEFAULT_DOCX_RENDERER_ID,
|
|
86
|
+
docxPropsSchemaForRenderer,
|
|
87
|
+
collectDocxRendererErrors
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=chunk-T7P4TA7I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/renderer.ts"],"sourcesContent":["import type { TSchema } from '@sinclair/typebox';\nimport type { ValidationError } from '@json-to-office/shared';\n\nexport const DOCX_RENDERER_IDS = ['docxjs', 'office-open'] as const;\nexport type DocxRendererId = (typeof DOCX_RENDERER_IDS)[number];\nexport const DEFAULT_DOCX_RENDERER_ID: DocxRendererId = 'docxjs';\n\n/** Derive one renderer view from the canonical props schema. */\nexport function docxPropsSchemaForRenderer(\n schema: TSchema,\n renderer: DocxRendererId\n): TSchema {\n const copy = cloneSchema(schema);\n if (renderer === 'office-open') pruneThreadFields(copy);\n return copy;\n}\n\n/** Static renderer-profile diagnostics used by CLI/library validation. */\nexport function collectDocxRendererErrors(data: unknown): ValidationError[] {\n if (!data || typeof data !== 'object' || Array.isArray(data)) return [];\n const root = data as Record<string, any>;\n const renderer = root.renderer ?? DEFAULT_DOCX_RENDERER_ID;\n\n if (!DOCX_RENDERER_IDS.includes(renderer)) {\n return [\n {\n path: '/renderer',\n message: `Invalid renderer \"${String(renderer)}\". Expected \"docxjs\" or \"office-open\".`,\n code: 'invalid_value',\n },\n ];\n }\n if (renderer !== 'office-open') return [];\n\n const errors: ValidationError[] = [];\n const visit = (node: unknown, path: string): void => {\n if (Array.isArray(node)) {\n node.forEach((entry, index) => visit(entry, `${path}/${index}`));\n return;\n }\n if (!node || typeof node !== 'object') return;\n const object = node as Record<string, unknown>;\n const comment = object.comment;\n if (comment && typeof comment === 'object' && !Array.isArray(comment)) {\n const value = comment as Record<string, unknown>;\n for (const field of ['replies', 'resolved'] as const) {\n if (value[field] !== undefined) {\n errors.push({\n path: `${path}/comment/${field}`,\n message: `The \"office-open\" renderer does not support comment threads.`,\n code: 'unsupported_renderer_feature',\n });\n }\n }\n }\n for (const [key, value] of Object.entries(object)) {\n if (key !== 'renderer') visit(value, `${path}/${key}`);\n }\n };\n\n visit(root, '');\n return errors;\n}\n\nfunction pruneThreadFields(node: unknown): void {\n if (Array.isArray(node)) {\n node.forEach(pruneThreadFields);\n return;\n }\n if (!node || typeof node !== 'object') return;\n const schema = node as Record<PropertyKey, any>;\n const properties = schema.properties as Record<string, TSchema> | undefined;\n if (\n properties?.text &&\n properties?.author &&\n (properties.replies || properties.resolved) &&\n typeof schema.description === 'string' &&\n schema.description.includes('Word review comment')\n ) {\n delete properties.replies;\n delete properties.resolved;\n const required = schema.required as string[] | undefined;\n if (required) {\n schema.required = required.filter(\n (key) => key !== 'replies' && key !== 'resolved'\n );\n }\n }\n for (const key of Reflect.ownKeys(schema)) {\n pruneThreadFields(schema[key]);\n }\n}\n\nfunction cloneSchema<T>(value: T): T {\n if (Array.isArray(value)) return value.map(cloneSchema) as T;\n if (!value || typeof value !== 'object') return value;\n const copy = Object.create(Object.getPrototypeOf(value));\n for (const key of Reflect.ownKeys(value as object)) {\n copy[key] = cloneSchema((value as any)[key]);\n }\n return copy;\n}\n"],"mappings":";AAGO,IAAM,oBAAoB,CAAC,UAAU,aAAa;AAElD,IAAM,2BAA2C;AAGjD,SAAS,2BACd,QACA,UACS;AACT,QAAM,OAAO,YAAY,MAAM;AAC/B,MAAI,aAAa,cAAe,mBAAkB,IAAI;AACtD,SAAO;AACT;AAGO,SAAS,0BAA0B,MAAkC;AAC1E,MAAI,CAAC,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,EAAG,QAAO,CAAC;AACtE,QAAM,OAAO;AACb,QAAM,WAAW,KAAK,YAAY;AAElC,MAAI,CAAC,kBAAkB,SAAS,QAAQ,GAAG;AACzC,WAAO;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,SAAS,qBAAqB,OAAO,QAAQ,CAAC;AAAA,QA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W,OAAO;AACxB,QAAI,UAAU;AACZ,aAAO,WAAW,SAAS;AAAA,QACzB,CAAC,QAAQ,QAAQ,aAAa,QAAQ;AAAA,MACxC;AAAA,IACF;AAAA,EACF;AACA,aAAW,OAAO,QAAQ,QAAQ,MAAM,GAAG;AACzC,sBAAkB,OAAO,GAAG,CAAC;AAAA,EAC/B;AACF;AAEA,SAAS,YAAe,OAAa;AACnC,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,IAAI,WAAW;AACtD,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,QAAM,OAAO,OAAO,OAAO,OAAO,eAAe,KAAK,CAAC;AACvD,aAAW,OAAO,QAAQ,QAAQ,KAAe,GAAG;AAClD,SAAK,GAAG,IAAI,YAAa,MAAc,GAAG,CAAC;AAAA,EAC7C;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getContainerComponents
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WXG3FQ5V.js";
|
|
4
4
|
|
|
5
5
|
// src/schemas/export.ts
|
|
6
6
|
import { restructureNameDiscriminatedUnions } from "@json-to-office/shared";
|
|
@@ -274,4 +274,4 @@ export {
|
|
|
274
274
|
BASE_SCHEMA_METADATA,
|
|
275
275
|
THEME_SCHEMA_METADATA
|
|
276
276
|
};
|
|
277
|
-
//# sourceMappingURL=chunk-
|
|
277
|
+
//# sourceMappingURL=chunk-V4HZOLMN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentDefinitionSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MG2PLA6W.js";
|
|
4
4
|
|
|
5
5
|
// src/schemas/document.ts
|
|
6
6
|
var JsonComponentDefinitionSchema = ComponentDefinitionSchema;
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
JsonComponentDefinitionSchema,
|
|
32
32
|
JSON_SCHEMA_URLS
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-VEF4T6PL.js.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DOCX_RENDERER_IDS,
|
|
3
|
+
docxPropsSchemaForRenderer
|
|
4
|
+
} from "./chunk-T7P4TA7I.js";
|
|
1
5
|
import {
|
|
2
6
|
ThemeOverridesSchema
|
|
3
7
|
} from "./chunk-ZC2I7CTZ.js";
|
|
@@ -255,7 +259,46 @@ var TextBoxPropsSchema = Type2.Object(
|
|
|
255
259
|
)
|
|
256
260
|
)
|
|
257
261
|
},
|
|
258
|
-
{
|
|
262
|
+
{
|
|
263
|
+
additionalProperties: false,
|
|
264
|
+
/**
|
|
265
|
+
* The same two shape limits `collectTextBoxShapeConflicts` enforces, said
|
|
266
|
+
* in JSON Schema so an editor can say it too.
|
|
267
|
+
*
|
|
268
|
+
* The deep validator only runs when a document is generated, so until now
|
|
269
|
+
* an author learned that a shape needs a height by pressing Run. These are
|
|
270
|
+
* plain cross-field rules, and `if`/`then` expresses them — which is what
|
|
271
|
+
* Monaco checks the buffer against, so the editor underlines the mistake
|
|
272
|
+
* while it is being made. The deep validator stays as the backstop: it
|
|
273
|
+
* carries the remediation text, and it is what the API enforces for
|
|
274
|
+
* callers who never see an editor.
|
|
275
|
+
*/
|
|
276
|
+
allOf: [
|
|
277
|
+
{
|
|
278
|
+
if: {
|
|
279
|
+
properties: { renderAs: { const: "shape" } },
|
|
280
|
+
required: ["renderAs"]
|
|
281
|
+
},
|
|
282
|
+
then: {
|
|
283
|
+
required: ["width", "height"],
|
|
284
|
+
properties: {
|
|
285
|
+
style: {
|
|
286
|
+
properties: {
|
|
287
|
+
border: {
|
|
288
|
+
properties: Object.fromEntries(
|
|
289
|
+
["top", "right", "bottom", "left"].map((side) => [
|
|
290
|
+
side,
|
|
291
|
+
{ properties: { style: { enum: ["solid", "none"] } } }
|
|
292
|
+
])
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
}
|
|
259
302
|
);
|
|
260
303
|
|
|
261
304
|
// src/schemas/components/toc.ts
|
|
@@ -752,7 +795,7 @@ function demandsProps(propsSchema) {
|
|
|
752
795
|
const schema = propsSchema;
|
|
753
796
|
return schema.type !== "object" || (schema.required?.length ?? 0) > 0;
|
|
754
797
|
}
|
|
755
|
-
function createComponentSchemaObject(component, childrenType, selfRef) {
|
|
798
|
+
function createComponentSchemaObject(component, childrenType, selfRef, profile) {
|
|
756
799
|
const schema = {
|
|
757
800
|
name: Type6.Literal(component.name),
|
|
758
801
|
id: Type6.Optional(Type6.String()),
|
|
@@ -765,8 +808,23 @@ function createComponentSchemaObject(component, childrenType, selfRef) {
|
|
|
765
808
|
};
|
|
766
809
|
if (component.special?.hasSchemaField) {
|
|
767
810
|
schema.$schema = Type6.Optional(Type6.String({ format: "uri" }));
|
|
811
|
+
schema.renderer = profile ? profile.requireDiscriminator ? Type6.Literal(profile.renderer, {
|
|
812
|
+
description: "Renderer backend for this document"
|
|
813
|
+
}) : Type6.Optional(
|
|
814
|
+
Type6.Literal(profile.renderer, {
|
|
815
|
+
description: 'Renderer backend. Omitted defaults to "docxjs".'
|
|
816
|
+
})
|
|
817
|
+
) : Type6.Optional(
|
|
818
|
+
Type6.Union(
|
|
819
|
+
DOCX_RENDERER_IDS.map((renderer) => Type6.Literal(renderer)),
|
|
820
|
+
{
|
|
821
|
+
description: 'Renderer backend. Omitted defaults to "docxjs".'
|
|
822
|
+
}
|
|
823
|
+
)
|
|
824
|
+
);
|
|
768
825
|
}
|
|
769
|
-
const
|
|
826
|
+
const basePropsSchema = component.createPropsSchema && selfRef ? component.createPropsSchema(selfRef) : component.propsSchema;
|
|
827
|
+
const propsSchema = profile ? docxPropsSchemaForRenderer(basePropsSchema, profile.renderer) : basePropsSchema;
|
|
770
828
|
schema.props = demandsProps(propsSchema) ? propsSchema : Type6.Optional(propsSchema);
|
|
771
829
|
if (component.hasChildren && childrenType) {
|
|
772
830
|
schema.children = component.special?.hasSchemaField ? Type6.Array(childrenType) : Type6.Optional(Type6.Array(childrenType));
|
|
@@ -781,13 +839,13 @@ function createAllComponentSchemas(recursiveRef) {
|
|
|
781
839
|
(component) => createComponentSchemaObject(component, recursiveRef)
|
|
782
840
|
);
|
|
783
841
|
}
|
|
784
|
-
function createAllComponentSchemasNarrowed(selfRef, pluginSchemas = []) {
|
|
842
|
+
function createAllComponentSchemasNarrowed(selfRef, pluginSchemas = [], profile) {
|
|
785
843
|
const leafSchemas = /* @__PURE__ */ new Map();
|
|
786
844
|
for (const comp of STANDARD_COMPONENTS_REGISTRY) {
|
|
787
845
|
if (!comp.hasChildren) {
|
|
788
846
|
leafSchemas.set(
|
|
789
847
|
comp.name,
|
|
790
|
-
createComponentSchemaObject(comp, void 0, selfRef)
|
|
848
|
+
createComponentSchemaObject(comp, void 0, selfRef, profile)
|
|
791
849
|
);
|
|
792
850
|
}
|
|
793
851
|
}
|
|
@@ -801,7 +859,7 @@ function createAllComponentSchemasNarrowed(selfRef, pluginSchemas = []) {
|
|
|
801
859
|
if (!comp.allowedChildren) {
|
|
802
860
|
resolved.set(
|
|
803
861
|
comp.name,
|
|
804
|
-
createComponentSchemaObject(comp, selfRef, selfRef)
|
|
862
|
+
createComponentSchemaObject(comp, selfRef, selfRef, profile)
|
|
805
863
|
);
|
|
806
864
|
pending.splice(i, 1);
|
|
807
865
|
continue;
|
|
@@ -815,7 +873,7 @@ function createAllComponentSchemasNarrowed(selfRef, pluginSchemas = []) {
|
|
|
815
873
|
const childrenType = allChildSchemas.length === 1 ? allChildSchemas[0] : Type6.Union(allChildSchemas);
|
|
816
874
|
resolved.set(
|
|
817
875
|
comp.name,
|
|
818
|
-
createComponentSchemaObject(comp, childrenType, selfRef)
|
|
876
|
+
createComponentSchemaObject(comp, childrenType, selfRef, profile)
|
|
819
877
|
);
|
|
820
878
|
pending.splice(i, 1);
|
|
821
879
|
}
|
|
@@ -853,4 +911,4 @@ export {
|
|
|
853
911
|
createAllComponentSchemas,
|
|
854
912
|
createAllComponentSchemasNarrowed
|
|
855
913
|
};
|
|
856
|
-
//# sourceMappingURL=chunk-
|
|
914
|
+
//# sourceMappingURL=chunk-WXG3FQ5V.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/visual.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 { 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 /** 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 '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 '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 - displays tabular data with headers. Supports formatting and alignment.',\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: 'visual',\n propsSchema: VisualPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Free-canvas graphic authored as a single pptx slide and embedded as a rasterized PNG. Use for infographics, diagrams and layered compositions that the document flow cannot express.',\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(basePropsSchema, profile.renderer)\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 // Phase 1: Build leaf (non-container) component schemas — no children\n // selfRef is passed so factories (e.g. table) can wire up recursive refs.\n const leafSchemas = new Map<string, TSchema>();\n for (const comp of STANDARD_COMPONENTS_REGISTRY) {\n if (!comp.hasChildren) {\n leafSchemas.set(\n comp.name,\n createComponentSchemaObject(comp, undefined, selfRef, profile)\n );\n }\n }\n\n // Phase 2: Resolve containers in dependency order\n const containers = STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n const resolved = new Map<string, TSchema>();\n const pending = [...containers];\n\n while (pending.length > 0) {\n const before = pending.length;\n for (let i = pending.length - 1; i >= 0; i--) {\n const comp = pending[i];\n\n if (!comp.allowedChildren) {\n // No allowedChildren declared — fallback to full recursive ref\n resolved.set(\n comp.name,\n createComponentSchemaObject(comp, selfRef, selfRef, 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 * Visual Component Schema\n *\n * A `visual` is a free-canvas graphic authored as a single pptx slide and\n * embedded into the document as a rasterized PNG. It unlocks absolute\n * positioning, overlapping shapes and layered art that the docx flow layout\n * cannot express — think infographics, diagrams and hero compositions.\n *\n * The pptx slide is rendered to an image by an injected rasterization service\n * (see `PptxServiceConfig` in @json-to-office/shared), exactly the way the\n * `highcharts` component offloads chart rendering to an export server. At\n * render time the component desugars to a plain `image`.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n MIN_VISUAL_DPI,\n MAX_VISUAL_DPI,\n DEFAULT_VISUAL_DPI,\n} from '@json-to-office/shared';\nimport { PptxSlideContentSchema } from '@json-to-office/shared/schemas/slide-content';\nimport {\n AlignmentSchema,\n SpacingSchema,\n FloatingPropertiesSchema,\n} from './common';\n\n/**\n * Canvas background — a solid color and/or a background image.\n * Mirrors the pptx slide background shape (kept local to avoid coupling\n * shared-docx to shared-pptx; the rasterizer forwards it verbatim).\n */\nexport const VisualCanvasBackgroundSchema = Type.Object(\n {\n color: Type.Optional(\n Type.String({\n description:\n 'Background color (hex like \"#FFFFFF\" or a theme color name)',\n })\n ),\n image: Type.Optional(\n Type.Object(\n {\n path: Type.Optional(Type.String()),\n base64: Type.Optional(Type.String()),\n },\n { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n);\n\n/**\n * The pptx canvas the visual is drawn on. Width/height are in inches and set\n * both the aspect ratio and the physical print size of the embedded image.\n */\nexport const VisualCanvasSchema = Type.Object(\n {\n width: Type.Number({\n minimum: 0.1,\n description: 'Canvas width in inches (pptx slideWidth)',\n }),\n height: Type.Number({\n minimum: 0.1,\n description: 'Canvas height in inches (pptx slideHeight)',\n }),\n theme: Type.Optional(\n Type.String({ description: 'pptx theme name applied to the slide' })\n ),\n background: Type.Optional(VisualCanvasBackgroundSchema),\n },\n {\n description: 'pptx canvas definition for the visual',\n additionalProperties: false,\n }\n);\n\n// A single pptx slide content element (text, image, shape, table, highcharts,\n// chart) is validated against the real PPTX slide-content union\n// (`PptxSlideContentSchema` from @json-to-office/shared/schemas/slide-content)\n// — same authoring\n// fidelity as a standalone `.pptx.json`. Used directly as the `elements` item\n// schema below.\n\nexport const VisualPropsSchema = Type.Object(\n {\n // ── canvas (drives aspect ratio + physical size) ──\n canvas: VisualCanvasSchema,\n // pptx slide content elements, absolutely positioned on the canvas\n elements: Type.Optional(\n Type.Array(PptxSlideContentSchema, {\n description:\n 'pptx slide content elements (text, image, shape, table, highcharts, chart), positioned with x/y/w/h in inches',\n })\n ),\n\n // ── rasterization ──\n dpi: Type.Optional(\n Type.Number({\n minimum: MIN_VISUAL_DPI,\n maximum: MAX_VISUAL_DPI,\n default: DEFAULT_VISUAL_DPI,\n description: `Raster resolution in DPI (default ${DEFAULT_VISUAL_DPI}, range ${MIN_VISUAL_DPI}-${MAX_VISUAL_DPI}). Higher = sharper + larger.`,\n })\n ),\n serverUrl: Type.Optional(\n Type.String({\n description:\n 'Rasterization service URL override (default from services.pptx)',\n })\n ),\n\n // ── placement in the document (mirrors `image`) ──\n width: Type.Optional(\n Type.Union(\n [\n Type.Number({ minimum: 1, description: 'Rendered width in pixels' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Rendered width as percentage (e.g. \"90%\")',\n }),\n ],\n {\n description:\n 'Rendered width in the document, in pixels (number) or percentage string. Defaults to the canvas physical size.',\n }\n )\n ),\n height: Type.Optional(\n Type.Union([\n Type.Number({ minimum: 1, description: 'Rendered height in pixels' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Rendered height as percentage (e.g. \"90%\")',\n }),\n ])\n ),\n alignment: Type.Optional(AlignmentSchema),\n caption: Type.Optional(\n Type.String({\n description:\n '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: 'Visual component props (pptx-rendered graphic)',\n additionalProperties: false,\n }\n);\n\nexport type VisualProps = Static<typeof VisualPropsSchema>;\nexport type VisualCanvas = Static<typeof VisualCanvasSchema>;\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;AAAA,MACb,KAAK,OAAO;AAAA,QACV,SAAS;AAAA,QACT,aACE;AAAA,QACF,UAAU,CAAC,SAAS,SAAS,SAAS,SAAS,OAAO;AAAA,MACxD,CAAC;AAAA,IACH;AAAA,IACA,cAAc,KAAK,SAAS,kBAAkB;AAAA,IAC9C,gBAAgB,KAAK;AAAA,MACnB,KAAK,QAAQ;AAAA,QACX,aACE;AAAA,MACJ,CAAC;AAAA,IACH;AAAA,IACA,UAAU,KAAK;AAAA,MACb,KAAK;AAAA,QACH;AAAA,UACE,OAAO,KAAK;AAAA,YACV,KAAK,OAAO;AAAA,cACV,aAAa;AAAA,cACb,UAAU,CAAC,sBAAsB,yBAAyB;AAAA,YAC5D,CAAC;AAAA,UACH;AAAA,UACA,UAAU,KAAK;AAAA,YACb,KAAK,OAAO;AAAA,cACV,aAAa;AAAA,YACf,CAAC;AAAA,UACH;AAAA,UACA,aAAa,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,UACxC,QAAQ,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,UACnC,SAAS,KAAK;AAAA,YACZ,KAAK,OAAO;AAAA,cACV,a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S,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"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { ValueError } from '@sinclair/typebox/value';
|
|
|
11
11
|
export { ERROR_TEMPLATES, collectIndentConflicts, collectNoteRevisionConflicts, collectTextBoxShapeConflicts, componentValidator, comprehensiveValidateDocument, createComponentValidator, createJsonValidator, createThemeValidator, createValidator, deepValidateDocument, getThemeName, getValidationSummary, isColumnsProps, isCustomComponentProps, isHeadingProps, isImageProps, isListProps, isParagraphProps, isReportProps, isSectionProps, isStandardComponentName, isStatisticProps, isTableProps, isThemeConfig, isValidTheme, isValidTheme as isValidThemeJson, isValidationSuccess, strictComponentValidator, strictThemeValidator, themeValidator, transformDocxValueError, transformDocxValueErrors, validate, validateAgainstSchema, validateBatch, validateComponent as validateComponentProps, validateCustomComponentProps, validateJson, validateStrict, validateTheme, validateThemeJson, validateThemeWithEnhancement, validateWithEnhancement } from './validation/unified/index.js';
|
|
12
12
|
import { TextSpaceAfterPropsSchema } from './schemas/custom-components.js';
|
|
13
13
|
export { CustomComponentDefinitionSchema, TextSpaceAfterComponentSchema, TextSpaceAfterProps } from './schemas/custom-components.js';
|
|
14
|
+
import { DocxRendererId } from './schemas/renderer.js';
|
|
15
|
+
export { DEFAULT_DOCX_RENDERER_ID, DOCX_RENDERER_IDS, collectDocxRendererErrors } from './schemas/renderer.js';
|
|
14
16
|
export { STANDARD_COMPONENTS_REGISTRY, getAllStandardComponentNames, getStandardComponent } from './schemas/component-registry.js';
|
|
15
17
|
export { BASE_SCHEMA_METADATA, COMPONENT_METADATA, ComponentSchemaConfig as DocxComponentSchemaConfig, THEME_SCHEMA_METADATA, convertToJsonSchema as convertDocxToJsonSchema, createComponentSchema as createDocxComponentSchema, exportSchemaToFile as exportDocxSchemaToFile, fixSchemaReferences as fixDocxSchemaReferences } from './schemas/export.js';
|
|
16
18
|
export { CustomComponentInfo, GenerateDocumentSchemaOptions, generateUnifiedDocumentSchema } from './schemas/generator.js';
|
|
@@ -2143,11 +2145,19 @@ declare const formatValidationErrorStrings: typeof formatTypeBoxErrorStrings;
|
|
|
2143
2145
|
interface ReportComponent {
|
|
2144
2146
|
name: 'docx';
|
|
2145
2147
|
id?: string;
|
|
2148
|
+
/** Renderer backend. Omitted defaults to docxjs. */
|
|
2149
|
+
renderer?: DocxRendererId;
|
|
2146
2150
|
/** When false, this component is filtered out and not rendered. Defaults to true */
|
|
2147
2151
|
enabled?: boolean;
|
|
2148
2152
|
props: Static<typeof ReportPropsSchema>;
|
|
2149
2153
|
children?: ComponentDefinition[];
|
|
2150
2154
|
}
|
|
2155
|
+
/** A document explicitly targeted at one renderer profile. */
|
|
2156
|
+
type ReportComponentFor<R extends DocxRendererId> = Omit<ReportComponent, 'renderer'> & (R extends 'docxjs' ? {
|
|
2157
|
+
renderer?: R;
|
|
2158
|
+
} : {
|
|
2159
|
+
renderer: R;
|
|
2160
|
+
});
|
|
2151
2161
|
/**
|
|
2152
2162
|
* Section component with literal name discriminator
|
|
2153
2163
|
*/
|
|
@@ -2340,4 +2350,4 @@ type ThemeName = 'minimal' | 'verizon' | 'a2a' | 'hitachi';
|
|
|
2340
2350
|
|
|
2341
2351
|
declare const SHARED_DOCX_VERSION = "1.0.0";
|
|
2342
2352
|
|
|
2343
|
-
export { type ColumnsComponent, ColumnsPropsSchema, type ComponentDefinition, ComponentDefinitionSchema, type CoreValidationResult, type DiffDocumentsOptions, type DiffDocumentsResult, type DiffSegment, type DiffSummary, ValidationError as DocumentValidationError, DocumentValidationResult, type FormattedError, type HeadingComponent, HeadingPropsSchema, type HighchartsComponent, HighchartsPropsSchema, type ImageComponent, ImagePropsSchema, JsonDocumentParser, type JsonNode, JsonParsingError, JsonValidationError, type ListComponent, ListPropsSchema, type ParagraphComponent, ParagraphPropsSchema, type ReportComponent, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateUnifiedDocumentSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G3XK537A.js";
|
|
4
4
|
import {
|
|
5
5
|
ERROR_TEMPLATES,
|
|
6
6
|
componentValidator,
|
|
@@ -31,17 +31,17 @@ import {
|
|
|
31
31
|
validateTheme,
|
|
32
32
|
validateThemeJson,
|
|
33
33
|
validateThemeWithEnhancement
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-NAVRPVTN.js";
|
|
35
35
|
import {
|
|
36
36
|
GenerateDocumentRequestSchema,
|
|
37
37
|
GenerateDocumentResponseSchema,
|
|
38
38
|
ValidateDocumentRequestSchema,
|
|
39
39
|
ValidateDocumentResponseSchema
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-GT3MN2RI.js";
|
|
41
41
|
import {
|
|
42
42
|
JSON_SCHEMA_URLS,
|
|
43
43
|
JsonComponentDefinitionSchema
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-VEF4T6PL.js";
|
|
45
45
|
import {
|
|
46
46
|
collectIndentConflicts,
|
|
47
47
|
collectNoteRevisionConflicts,
|
|
@@ -66,11 +66,11 @@ import {
|
|
|
66
66
|
validateJsonComponent,
|
|
67
67
|
validateJsonDocument,
|
|
68
68
|
validateWithEnhancement
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-NZO5SZUO.js";
|
|
70
70
|
import {
|
|
71
71
|
ComponentDefinitionSchema,
|
|
72
72
|
StandardComponentDefinitionSchema
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-MG2PLA6W.js";
|
|
74
74
|
import {
|
|
75
75
|
CustomComponentDefinitionSchema,
|
|
76
76
|
TextSpaceAfterComponentSchema,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
createComponentSchema,
|
|
85
85
|
exportSchemaToFile,
|
|
86
86
|
fixSchemaReferences
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-V4HZOLMN.js";
|
|
88
88
|
import {
|
|
89
89
|
HighchartsPropsSchema,
|
|
90
90
|
ReportPropsSchema,
|
|
@@ -96,7 +96,12 @@ import {
|
|
|
96
96
|
VisualPropsSchema,
|
|
97
97
|
getAllStandardComponentNames,
|
|
98
98
|
getStandardComponent
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-WXG3FQ5V.js";
|
|
100
|
+
import {
|
|
101
|
+
DEFAULT_DOCX_RENDERER_ID,
|
|
102
|
+
DOCX_RENDERER_IDS,
|
|
103
|
+
collectDocxRendererErrors
|
|
104
|
+
} from "./chunk-T7P4TA7I.js";
|
|
100
105
|
import {
|
|
101
106
|
ThemeConfigSchema,
|
|
102
107
|
createMinimalTheme,
|
|
@@ -1917,7 +1922,9 @@ export {
|
|
|
1917
1922
|
CommentSchema,
|
|
1918
1923
|
ComponentDefinitionSchema,
|
|
1919
1924
|
CustomComponentDefinitionSchema,
|
|
1925
|
+
DEFAULT_DOCX_RENDERER_ID,
|
|
1920
1926
|
DEFAULT_ERROR_CONFIG,
|
|
1927
|
+
DOCX_RENDERER_IDS,
|
|
1921
1928
|
ERROR_EMOJIS,
|
|
1922
1929
|
ERROR_TEMPLATES,
|
|
1923
1930
|
EndnotesSchema,
|
|
@@ -1973,6 +1980,7 @@ export {
|
|
|
1973
1980
|
VisualPropsSchema,
|
|
1974
1981
|
calculatePosition,
|
|
1975
1982
|
clearComponentNamesCache,
|
|
1983
|
+
collectDocxRendererErrors,
|
|
1976
1984
|
collectIndentConflicts,
|
|
1977
1985
|
collectNoteRevisionConflicts,
|
|
1978
1986
|
collectTextBoxShapeConflicts,
|