@json-to-office/shared-docx 0.17.0 → 0.18.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-G6C2WMTW.js → chunk-3E47TLLP.js} +2 -2
- package/dist/{chunk-CVIUFVXH.js → chunk-6CAIEW25.js} +2 -2
- package/dist/{chunk-XVCODWSU.js → chunk-AIEN4MDJ.js} +2 -2
- package/dist/{chunk-V5DHEETI.js → chunk-AKHPKRU5.js} +47 -3
- package/dist/chunk-AKHPKRU5.js.map +1 -0
- package/dist/{chunk-TTT3L236.js → chunk-CV7HBUPT.js} +2 -2
- package/dist/{chunk-WIWVYW2G.js → chunk-CYBFQ2VM.js} +16 -3
- package/dist/{chunk-WIWVYW2G.js.map → chunk-CYBFQ2VM.js.map} +1 -1
- package/dist/{chunk-WZPPVJN6.js → chunk-JWBBT2MK.js} +2 -2
- package/dist/{chunk-Y5KKRSXX.js → chunk-N22J6K24.js} +2 -2
- package/dist/{chunk-NRDLQSF3.js → chunk-UPVW437P.js} +8 -3
- package/dist/chunk-UPVW437P.js.map +1 -0
- package/dist/{chunk-3XWQYKTW.js → chunk-ZFCRP5GT.js} +6 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10 -10
- package/dist/schemas/api.js +4 -4
- package/dist/schemas/component-defaults.d.ts +2 -0
- package/dist/schemas/component-defaults.js +1 -1
- package/dist/schemas/component-registry.js +2 -2
- package/dist/schemas/components.d.ts +8 -0
- package/dist/schemas/components.js +3 -3
- package/dist/schemas/document.js +5 -5
- package/dist/schemas/export.js +3 -3
- package/dist/schemas/generator.js +3 -3
- package/dist/schemas/theme.d.ts +1 -0
- package/dist/schemas/theme.js +2 -2
- package/dist/validation/unified/index.d.ts +2 -0
- package/dist/validation/unified/index.js +6 -6
- package/package.json +2 -2
- package/dist/chunk-NRDLQSF3.js.map +0 -1
- package/dist/chunk-V5DHEETI.js.map +0 -1
- /package/dist/{chunk-G6C2WMTW.js.map → chunk-3E47TLLP.js.map} +0 -0
- /package/dist/{chunk-CVIUFVXH.js.map → chunk-6CAIEW25.js.map} +0 -0
- /package/dist/{chunk-XVCODWSU.js.map → chunk-AIEN4MDJ.js.map} +0 -0
- /package/dist/{chunk-TTT3L236.js.map → chunk-CV7HBUPT.js.map} +0 -0
- /package/dist/{chunk-WZPPVJN6.js.map → chunk-JWBBT2MK.js.map} +0 -0
- /package/dist/{chunk-Y5KKRSXX.js.map → chunk-N22J6K24.js.map} +0 -0
- /package/dist/{chunk-3XWQYKTW.js.map → chunk-ZFCRP5GT.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAllComponentSchemas,
|
|
3
3
|
createAllComponentSchemasNarrowed
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CYBFQ2VM.js";
|
|
5
5
|
|
|
6
6
|
// src/schemas/components.ts
|
|
7
7
|
import { Type } from "@sinclair/typebox";
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
StandardComponentDefinitionSchema,
|
|
32
32
|
ComponentDefinitionSchema
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-3E47TLLP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentDefinitionSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3E47TLLP.js";
|
|
4
4
|
|
|
5
5
|
// src/schemas/api.ts
|
|
6
6
|
import { Type } from "@sinclair/typebox";
|
|
@@ -94,4 +94,4 @@ export {
|
|
|
94
94
|
GenerateDocumentResponseSchema,
|
|
95
95
|
ValidateDocumentResponseSchema
|
|
96
96
|
};
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-6CAIEW25.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentDefaultsSchema,
|
|
3
3
|
IndentSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UPVW437P.js";
|
|
5
5
|
import {
|
|
6
6
|
FontDefinitionSchema,
|
|
7
7
|
HexColorSchema,
|
|
@@ -329,4 +329,4 @@ export {
|
|
|
329
329
|
ThemeConfigSchema,
|
|
330
330
|
isValidThemeConfig
|
|
331
331
|
};
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
332
|
+
//# sourceMappingURL=chunk-AIEN4MDJ.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentDefinitionSchema,
|
|
3
3
|
StandardComponentDefinitionSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3E47TLLP.js";
|
|
5
5
|
import {
|
|
6
6
|
CustomComponentDefinitionSchema
|
|
7
7
|
} from "./chunk-7GGTZ4TA.js";
|
|
8
8
|
import {
|
|
9
9
|
ReportPropsSchema,
|
|
10
10
|
STANDARD_COMPONENTS_REGISTRY
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CYBFQ2VM.js";
|
|
12
12
|
|
|
13
13
|
// src/validation/unified/error-transformer.ts
|
|
14
14
|
import {
|
|
@@ -291,6 +291,40 @@ var ROOT_COMPONENT_NAMES = new Set(
|
|
|
291
291
|
(c) => Boolean(c.special?.hasSchemaField)
|
|
292
292
|
).map((c) => c.name)
|
|
293
293
|
);
|
|
294
|
+
var IMAGE_SOURCE_FIELDS = ["path", "base64", "svg"];
|
|
295
|
+
function presentImageSources(props) {
|
|
296
|
+
if (!props || typeof props !== "object") return [];
|
|
297
|
+
const p = props;
|
|
298
|
+
return IMAGE_SOURCE_FIELDS.filter((f) => {
|
|
299
|
+
const v = p[f];
|
|
300
|
+
return typeof v === "string" && v.trim().length > 0;
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
function collectImageSourceConflicts(data) {
|
|
304
|
+
const errors = [];
|
|
305
|
+
const visit = (node, path) => {
|
|
306
|
+
if (Array.isArray(node)) {
|
|
307
|
+
node.forEach((item, i) => visit(item, `${path}/${i}`));
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (!node || typeof node !== "object") return;
|
|
311
|
+
if (node.name === "image") {
|
|
312
|
+
const present = presentImageSources(node.props);
|
|
313
|
+
if (present.length > 1) {
|
|
314
|
+
errors.push({
|
|
315
|
+
path: `${path}/props`,
|
|
316
|
+
message: `Image component accepts only one source, but found ${present.map((f) => `"${f}"`).join(", ")}. Use exactly one of "path", "base64", or "svg".`,
|
|
317
|
+
code: "mutually_exclusive"
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
for (const key of Object.keys(node)) {
|
|
322
|
+
visit(node[key], `${path}/${key}`);
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
visit(data, "");
|
|
326
|
+
return errors;
|
|
327
|
+
}
|
|
294
328
|
function deepValidateDocument(data, opts = {}) {
|
|
295
329
|
const allErrors = [];
|
|
296
330
|
if (!data || typeof data !== "object") {
|
|
@@ -666,6 +700,11 @@ function validateDocument(data, options) {
|
|
|
666
700
|
finalValid = true;
|
|
667
701
|
}
|
|
668
702
|
}
|
|
703
|
+
const sourceConflicts = collectImageSourceConflicts(data);
|
|
704
|
+
if (sourceConflicts.length > 0) {
|
|
705
|
+
finalErrors = [...finalErrors, ...sourceConflicts];
|
|
706
|
+
finalValid = false;
|
|
707
|
+
}
|
|
669
708
|
const resolvedData = result.data ?? (finalValid ? data : void 0);
|
|
670
709
|
const documentResult = {
|
|
671
710
|
...result,
|
|
@@ -702,6 +741,11 @@ function validateJsonDocument(jsonInput, options) {
|
|
|
702
741
|
finalValid = true;
|
|
703
742
|
}
|
|
704
743
|
}
|
|
744
|
+
const sourceConflicts = collectImageSourceConflicts(result.parsed);
|
|
745
|
+
if (sourceConflicts.length > 0) {
|
|
746
|
+
finalErrors = [...finalErrors, ...sourceConflicts];
|
|
747
|
+
finalValid = false;
|
|
748
|
+
}
|
|
705
749
|
const resolvedData = result.data ?? (finalValid ? result.parsed : void 0);
|
|
706
750
|
const documentResult = {
|
|
707
751
|
...result,
|
|
@@ -774,4 +818,4 @@ export {
|
|
|
774
818
|
validateJsonComponent,
|
|
775
819
|
validateDocumentWithSchema
|
|
776
820
|
};
|
|
777
|
-
//# sourceMappingURL=chunk-
|
|
821
|
+
//# sourceMappingURL=chunk-AKHPKRU5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/validation/unified/error-transformer.ts","../src/validation/unified/deep-validator.ts","../src/validation/unified/base-validator.ts","../src/validation/unified/document-validator.ts"],"sourcesContent":["/**\n * Unified error transformation utilities\n * Converts TypeBox ValueError objects to standardized ValidationError format\n */\n\nimport type { ValueError } from '@sinclair/typebox/value';\nimport type { ValidationError } from '@json-to-office/shared';\nimport { ReportPropsSchema } from '../../schemas/components/report';\nimport {\n isObjectSchema,\n getObjectSchemaPropertyNames,\n getLiteralValue,\n type ErrorFormatterConfig,\n createErrorConfig,\n formatErrorMessage,\n ERROR_EMOJIS,\n} from '@json-to-office/shared';\n\n/**\n * Generate enhanced error message based on error type and context\n */\nfunction generateEnhancedMessage(\n error: ValueError,\n _config: Required<ErrorFormatterConfig>\n): string {\n const typeStr = String(error.type || '');\n const path = error.path || 'root';\n\n // Handle union errors specially - these are the most common and least helpful\n if (typeStr === '62' || typeStr === 'union') {\n return generateUnionErrorMessage(error);\n }\n\n // Handle additional properties error\n if (error.message?.includes('additionalProperties')) {\n return generateAdditionalPropertiesMessage(error);\n }\n\n // Handle missing required properties\n if (error.message?.includes('Required property')) {\n return generateRequiredPropertyMessage(error);\n }\n\n // Handle type mismatches\n if (\n typeStr === 'string' ||\n typeStr === 'number' ||\n typeStr === 'boolean' ||\n typeStr === 'array' ||\n typeStr === 'object'\n ) {\n return generateTypeMismatchMessage(error);\n }\n\n // Handle literal value errors\n if (typeStr === 'literal') {\n return generateLiteralErrorMessage(error);\n }\n\n // Handle pattern/regex errors\n if (typeStr === 'pattern' || typeStr === 'RegExp') {\n return generatePatternErrorMessage(error);\n }\n\n // Default to original message with some context\n return `At ${path}: ${error.message}`;\n}\n\n/**\n * Generate message for union validation errors\n */\nfunction generateUnionErrorMessage(error: ValueError): string {\n const path = error.path || 'root';\n const value = error.value;\n\n // Try to determine what the user was attempting\n if (path === 'root' || path === '/' || path === '/jsonDefinition') {\n // Root level or jsonDefinition union error - likely a document type issue\n if (value && typeof value === 'object') {\n if ('name' in value) {\n const name = value.name;\n if (name === 'docx') {\n return 'Document structure appears valid but contains invalid component configurations. Check each component for errors.';\n }\n return `Unknown document name '${name}'. Expected 'docx'.`;\n }\n\n // Missing name field\n const valueAny = value as Record<string, unknown>;\n if ('children' in value && Array.isArray(valueAny.children)) {\n return 'Document is missing required \\'name\\' field. Add \"name\": \"docx\" at the root level.';\n }\n\n // Check if it might be a theme\n if ('name' in value || 'styles' in value) {\n return 'This appears to be a theme configuration. Use --type theme or ensure proper document structure.';\n }\n }\n return 'Invalid document structure. Expected a document with name=\"docx\" or a theme configuration.';\n }\n\n // Component-level union error\n if (path.includes('/children/')) {\n if (value && typeof value === 'object' && 'name' in value) {\n const componentType = (value as any).name;\n return `Invalid component configuration for type '${componentType}'. Check that all required fields are present and correctly formatted.`;\n }\n return 'Invalid component structure. Each component must have a \"name\" field and valid configuration.';\n }\n\n // Default union error message\n return `Value at ${path} doesn't match any of the expected formats. Check the structure and required fields.`;\n}\n\n/**\n * Generate message for additional properties errors\n */\nfunction generateAdditionalPropertiesMessage(error: ValueError): string {\n const path = error.path || 'root';\n const value = error.value;\n\n if (typeof value === 'object' && value !== null) {\n // Try to identify the unknown properties\n const schema = error.schema;\n if (schema && isObjectSchema(schema)) {\n const knownProps = getObjectSchemaPropertyNames(schema);\n const actualProps = Object.keys(value);\n const unknownProps = actualProps.filter((p) => !knownProps.includes(p));\n\n if (unknownProps.length > 0) {\n return (\n `Unknown properties at ${path}: ${unknownProps.join(', ')}. ` +\n `Allowed properties are: ${knownProps.join(', ')}`\n );\n }\n }\n }\n\n return `Additional properties not allowed at ${path}. Check for typos or unsupported fields.`;\n}\n\n/**\n * Generate message for required property errors\n */\nfunction generateRequiredPropertyMessage(error: ValueError): string {\n const path = error.path || 'root';\n const match = error.message?.match(/Required property '([^']+)'/);\n\n if (match) {\n const propName = match[1];\n return `Missing required field '${propName}' at ${path}. This field is mandatory for this configuration.`;\n }\n\n return `Missing required property at ${path}. Check that all mandatory fields are present.`;\n}\n\n/**\n * Generate message for type mismatch errors\n */\nfunction generateTypeMismatchMessage(error: ValueError): string {\n const path = error.path || 'root';\n const expectedType = String(error.type);\n const actualType = Array.isArray(error.value) ? 'array' : typeof error.value;\n\n // Provide context-specific messages\n if (path.includes('alignment')) {\n return `Invalid alignment value at ${path}. Expected one of: left, center, right, justify`;\n }\n\n if (path.includes('color')) {\n return `Invalid color value at ${path}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`;\n }\n\n if (path.includes('fontSize') || path.includes('size')) {\n return `Invalid size value at ${path}. Expected a number (in points)`;\n }\n\n if (\n path.includes('margin') ||\n path.includes('padding') ||\n path.includes('spacing')\n ) {\n return `Invalid spacing value at ${path}. Expected a number or spacing object with top/bottom/left/right`;\n }\n\n return `Type mismatch at ${path}: Expected ${expectedType} but got ${actualType}`;\n}\n\n/**\n * Generate message for literal value errors\n */\nfunction generateLiteralErrorMessage(error: ValueError): string {\n const path = error.path || 'root';\n const expected = error.schema\n ? JSON.stringify(getLiteralValue(error.schema))\n : 'specific value';\n const actual = JSON.stringify(error.value);\n\n return `Invalid value at ${path}: Expected exactly ${expected} but got ${actual}`;\n}\n\n/**\n * Generate message for pattern/regex errors\n */\nfunction generatePatternErrorMessage(error: ValueError): string {\n const path = error.path || 'root';\n\n // Try to provide helpful context based on the path\n if (path.includes('email')) {\n return `Invalid email format at ${path}. Use format: user@example.com`;\n }\n\n if (path.includes('url') || path.includes('link')) {\n return `Invalid URL format at ${path}. Use format: https://example.com`;\n }\n\n if (path.includes('date')) {\n return `Invalid date format at ${path}. Use ISO format: YYYY-MM-DD`;\n }\n\n if (path.includes('phone')) {\n return `Invalid phone number format at ${path}`;\n }\n\n return `Value at ${path} doesn't match the required pattern`;\n}\n\n/**\n * Transform TypeBox ValueError to standardized ValidationError\n */\nexport function transformValueError(\n error: ValueError,\n jsonString?: string,\n config?: ErrorFormatterConfig\n): ValidationError {\n const formatterConfig = createErrorConfig(config);\n\n // Generate enhanced message based on error type\n const enhancedMessage = generateEnhancedMessage(error, formatterConfig);\n\n const baseError: ValidationError = {\n path: error.path || 'root',\n message: formatErrorMessage(\n enhancedMessage || error.message,\n formatterConfig\n ),\n code: String(error.type || 'validation_error'),\n value: error.value,\n };\n\n // Add suggestion if available and configured\n if (formatterConfig.includeSuggestions) {\n const suggestion = getSuggestion(error, formatterConfig);\n if (suggestion) {\n baseError.suggestion = formatErrorMessage(suggestion, formatterConfig);\n }\n }\n\n // Calculate line and column if JSON string is provided\n if (jsonString && error.path) {\n const position = calculatePosition(jsonString, error.path);\n if (position) {\n baseError.line = position.line;\n baseError.column = position.column;\n }\n }\n\n return baseError;\n}\n\n/**\n * Transform multiple TypeBox errors to ValidationError array\n * Enhanced to collect ALL errors, not just stopping at union failures\n */\nexport function transformValueErrors(\n errors: ValueError[],\n options?: {\n jsonString?: string;\n maxErrors?: number;\n }\n): ValidationError[] {\n const maxErrors = options?.maxErrors ?? Number.MAX_SAFE_INTEGER;\n const result: ValidationError[] = [];\n const seenPaths = new Set<string>();\n\n // Collect all errors, but avoid duplicates at the same path\n for (const error of errors) {\n if (result.length >= maxErrors) break;\n\n // Create a unique key for this error based on path and type\n const errorKey = `${error.path}:${error.type}`;\n\n // Skip if we've already seen an error at this exact path and type\n // This helps avoid duplicate union errors while still showing all unique issues\n if (!seenPaths.has(errorKey)) {\n seenPaths.add(errorKey);\n result.push(transformValueError(error, options?.jsonString, undefined));\n }\n }\n\n return result;\n}\n\n/**\n * Calculate line and column position in JSON string\n */\nexport function calculatePosition(\n jsonString: string,\n path: string\n): { line: number; column: number } | null {\n try {\n // Convert path like \"/children/0/props/title\" to searchable parts\n const pathParts = path.split('/').filter(Boolean);\n if (pathParts.length === 0) {\n return { line: 1, column: 1 };\n }\n\n // Try to find the last part of the path in the JSON\n const lastPart = pathParts[pathParts.length - 1];\n const searchPattern = `\"${lastPart}\"`;\n const index = jsonString.indexOf(searchPattern);\n\n if (index === -1) {\n // Try to find just the value if it's a property name\n return { line: 1, column: 1 };\n }\n\n // Calculate line and column from index\n const beforeError = jsonString.substring(0, index);\n const lines = beforeError.split('\\n');\n const line = lines.length;\n const column = lines[lines.length - 1].length + 1;\n\n return { line, column };\n } catch {\n return null;\n }\n}\n\n/**\n * Get helpful suggestion based on error type and context\n */\nfunction getSuggestion(\n error: ValueError,\n config: Required<ErrorFormatterConfig>\n): string | undefined {\n const { type, path, value } = error;\n const typeStr = String(type);\n\n // Enhanced suggestions for union errors\n if (typeStr === '62' || typeStr === 'union') {\n if (path === 'root' || path === '/') {\n if (value && typeof value === 'object') {\n if (!('name' in value)) {\n const msg = 'Add a \"name\" field with value \"docx\" for documents';\n return config.includeEmojis ? `${ERROR_EMOJIS.FIX} ${msg}` : msg;\n }\n if ('props' in value && typeof value.props === 'object') {\n const knownFields = getObjectSchemaPropertyNames(ReportPropsSchema);\n return `Review the props section for unsupported fields. Allowed fields: ${knownFields.join(', ')}`;\n }\n }\n return 'Ensure the document has proper structure: { \"name\": \"docx\", \"props\": {...}, \"children\": [...] }';\n }\n if (path?.includes('/children/')) {\n return 'Check that the component has a valid \"name\" and all required fields for that component type';\n }\n return 'Review the structure and ensure all required fields are present with correct types';\n }\n\n // Suggestions for additional properties errors\n if (error.message?.includes('additionalProperties')) {\n return 'Remove any unknown or unsupported fields. Check documentation for allowed properties.';\n }\n\n // Suggestions for required properties\n if (error.message?.includes('Required property')) {\n return 'Add the missing required field to fix this error';\n }\n\n // Type-specific suggestions\n if (typeStr === 'string') {\n if (path?.includes('alignment')) {\n return 'Use one of: left, center, right, justify';\n }\n if (path?.includes('color')) {\n return 'Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)';\n }\n return 'Provide a text string value';\n }\n\n if (typeStr === 'number') {\n if (path?.includes('fontSize') || path?.includes('size')) {\n return 'Use a number in points (e.g., 12, 14, 16)';\n }\n if (path?.includes('margin') || path?.includes('padding')) {\n return 'Use a number for spacing in points';\n }\n return 'Provide a numeric value';\n }\n\n if (typeStr === 'boolean') {\n return 'Use true or false (without quotes)';\n }\n\n if (typeStr === 'array') {\n if (path?.includes('children') || path?.includes('modules')) {\n return 'Provide an array of component objects, each with a \"name\" field';\n }\n return 'Provide an array/list of values using square brackets []';\n }\n\n if (typeStr === 'object') {\n return 'Provide an object with key-value pairs using curly braces {}';\n }\n\n if (typeStr === 'literal') {\n const expected = error.schema\n ? JSON.stringify(getLiteralValue(error.schema))\n : 'specific value';\n return `Use exactly this value: ${expected}`;\n }\n\n if (typeStr === 'pattern' || typeStr === 'RegExp') {\n if (path?.includes('email')) {\n return 'Use valid email format: user@example.com';\n }\n if (path?.includes('url')) {\n return 'Use valid URL format: https://example.com';\n }\n if (path?.includes('date')) {\n return 'Use ISO date format: YYYY-MM-DD';\n }\n return 'Ensure the value matches the required format';\n }\n\n // Path-based suggestions\n if (path?.includes('name') || path?.includes('type')) {\n return 'Use a valid component name: docx, section, columns, heading, paragraph, image, statistic, table, list, toc, text-box, highcharts, or visual';\n }\n\n return undefined;\n}\n\n/**\n * Format validation errors as a summary string\n */\nexport function formatErrorSummary(errors: ValidationError[]): string {\n if (errors.length === 0) return 'No errors';\n\n if (errors.length === 1) {\n return errors[0].message;\n }\n\n const summary = errors\n .slice(0, 3)\n .map((e) => `${e.path}: ${e.message}`)\n .join(', ');\n\n if (errors.length > 3) {\n return `${summary} and ${errors.length - 3} more...`;\n }\n\n return summary;\n}\n\n/**\n * Group errors by path for better reporting\n */\nexport function groupErrorsByPath(\n errors: ValidationError[]\n): Map<string, ValidationError[]> {\n const grouped = new Map<string, ValidationError[]>();\n\n for (const error of errors) {\n const path = error.path || 'root';\n const group = grouped.get(path) || [];\n group.push(error);\n grouped.set(path, group);\n }\n\n return grouped;\n}\n\n/**\n * Create a JSON parse error\n */\nexport function createJsonParseError(\n error: Error,\n jsonString: string\n): ValidationError {\n // Try to extract position from error message\n const match = error.message.match(/position (\\d+)/);\n const position = match ? parseInt(match[1], 10) : 0;\n\n let line = 1;\n let column = 1;\n\n if (position > 0) {\n const lines = jsonString.substring(0, position).split('\\n');\n line = lines.length;\n column = lines[lines.length - 1].length + 1;\n }\n\n return {\n path: 'root',\n message: `JSON Parse Error: ${error.message}`,\n code: 'json_parse_error',\n line,\n column,\n suggestion: 'Check for missing commas, quotes, or brackets',\n };\n}\n","/**\n * Deep validation utilities for collecting ALL errors in nested structures\n * This bypasses TypeBox's union short-circuiting to provide comprehensive error reporting\n */\n\nimport { Value } from '@sinclair/typebox/value';\nimport type { TSchema } from '@sinclair/typebox';\nimport type { ValidationError } from '@json-to-office/shared';\nimport { STANDARD_COMPONENTS_REGISTRY } from '../../schemas/component-registry';\nimport { CustomComponentDefinitionSchema } from '../../schemas/custom-components';\nimport { transformValueErrors } from './error-transformer';\n\n// Map of component names to their props schemas, sourced from the registry.\n// This stays in sync as new standard components are added, so the document\n// root ('docx') and every standard child component are recognized here.\nconst COMPONENT_SCHEMAS: Record<string, TSchema> = Object.fromEntries([\n ...STANDARD_COMPONENTS_REGISTRY.map((c) => [c.name, c.propsSchema]),\n ['custom', CustomComponentDefinitionSchema],\n]);\n\n// Root component names that may appear at the top of a document.\nconst ROOT_COMPONENT_NAMES = new Set(\n STANDARD_COMPONENTS_REGISTRY.filter((c) =>\n Boolean(c.special?.hasSchemaField)\n ).map((c) => c.name)\n);\n\n/**\n * Options that tune deep validation.\n *\n * `knownCustomNames` — names of registered plugin components. The deep\n * validator neither flags these as \"unknown component\" nor validates their\n * props here; the plugin layer validates custom props version-aware separately.\n *\n * `allowUnknownFields` — when true, unknown properties are stripped before the\n * per-component check instead of being rejected. The escape hatch for callers\n * migrating onto strict schemas.\n */\nexport interface DeepValidateOptions {\n knownCustomNames?: Set<string>;\n allowUnknownFields?: boolean;\n}\n\n// Image source fields that are mutually exclusive: exactly one may be set.\nconst IMAGE_SOURCE_FIELDS = ['path', 'base64', 'svg'] as const;\n\n/**\n * Names of the image source fields that carry a non-empty value on a props object.\n */\nexport function presentImageSources(props: unknown): string[] {\n if (!props || typeof props !== 'object') return [];\n const p = props as Record<string, unknown>;\n return IMAGE_SOURCE_FIELDS.filter((f) => {\n const v = p[f];\n return typeof v === 'string' && v.trim().length > 0;\n });\n}\n\n/**\n * Collect \"more than one image source\" conflicts anywhere in a document.\n *\n * `path`, `base64`, and `svg` are mutually exclusive on the image component, but\n * all three are optional fields on a single object schema — so a multi-source\n * payload passes TypeBox's structural check and would otherwise be silently\n * resolved by runtime precedence (svg > base64 > path). This walk runs\n * unconditionally and rejects such payloads. It traverses every nested value, so\n * images inside columns, table cells, text boxes, headers/footers, and sections\n * are all covered regardless of container shape.\n */\nexport function collectImageSourceConflicts(data: unknown): ValidationError[] {\n const errors: ValidationError[] = [];\n\n const visit = (node: any, path: string): void => {\n if (Array.isArray(node)) {\n node.forEach((item, i) => visit(item, `${path}/${i}`));\n return;\n }\n if (!node || typeof node !== 'object') return;\n\n if (node.name === 'image') {\n const present = presentImageSources(node.props);\n if (present.length > 1) {\n errors.push({\n path: `${path}/props`,\n message: `Image component accepts only one source, but found ${present\n .map((f) => `\"${f}\"`)\n .join(', ')}. Use exactly one of \"path\", \"base64\", or \"svg\".`,\n code: 'mutually_exclusive',\n });\n }\n }\n\n for (const key of Object.keys(node)) {\n visit(node[key], `${path}/${key}`);\n }\n };\n\n visit(data, '');\n return errors;\n}\n\n/**\n * Deep validate a document to collect ALL errors, not just union-level errors\n */\nexport function deepValidateDocument(\n data: any,\n opts: DeepValidateOptions = {}\n): ValidationError[] {\n const allErrors: ValidationError[] = [];\n\n // Validate the document structure\n if (!data || typeof data !== 'object') {\n allErrors.push({\n path: 'root',\n message: 'Document must be an object',\n code: 'invalid_type',\n });\n return allErrors;\n }\n\n // Check name field\n if (!data.name) {\n allErrors.push({\n path: '/name',\n message: 'Missing required field \"name\"',\n code: 'required_property',\n });\n } else if (!ROOT_COMPONENT_NAMES.has(data.name)) {\n const expected = [...ROOT_COMPONENT_NAMES].map((n) => `\"${n}\"`).join(', ');\n allErrors.push({\n path: '/name',\n message: `Invalid name \"${data.name}\". Expected ${expected}`,\n code: 'invalid_value',\n });\n }\n\n // Validate props section when the key is present so explicit `null` (or any\n // falsy non-object) is checked against the component's schema instead of\n // silently passing.\n if (ROOT_COMPONENT_NAMES.has(data.name) && 'props' in data) {\n const propsErrors = validateComponentProps(\n data.name,\n data.props,\n '/props',\n opts\n );\n allErrors.push(...propsErrors);\n }\n\n // Validate children array\n if (!data.children) {\n allErrors.push({\n path: '/children',\n message: 'Missing required field \"children\"',\n code: 'required_property',\n });\n } else if (!Array.isArray(data.children)) {\n allErrors.push({\n path: '/children',\n message: 'Field \"children\" must be an array',\n code: 'invalid_type',\n });\n } else {\n // Validate each child component\n data.children.forEach((child: any, index: number) => {\n const childPath = `/children/${index}`;\n\n if (!child || typeof child !== 'object') {\n allErrors.push({\n path: childPath,\n message: 'Component must be an object',\n code: 'invalid_type',\n });\n return;\n }\n\n // Check component name\n if (!child.name) {\n allErrors.push({\n path: `${childPath}/name`,\n message: 'Component missing required field \"name\"',\n code: 'required_property',\n });\n return;\n }\n\n // Registered plugin components are validated version-aware by the plugin\n // layer; skip them here so they are neither flagged as unknown nor\n // checked against a standard schema.\n if (opts.knownCustomNames?.has(child.name)) {\n return;\n }\n\n // Validate props against the component's schema. When props is omitted,\n // validate an empty object so the schema decides whether props are\n // required (e.g. `section` needs none; `heading` requires text+level)\n // rather than assuming every component requires a props field.\n if (child.props != null) {\n allErrors.push(\n ...validateComponentProps(\n child.name,\n child.props,\n `${childPath}/props`,\n opts\n )\n );\n } else if (child.name !== 'custom') {\n allErrors.push(\n ...validateComponentProps(child.name, {}, `${childPath}/props`, opts)\n );\n }\n\n // Special handling for section components (recursive)\n if (child.name === 'section' && child.children) {\n if (!Array.isArray(child.children)) {\n allErrors.push({\n path: `${childPath}/children`,\n message: 'Section children must be an array',\n code: 'invalid_type',\n });\n } else {\n // Recursively validate nested components\n child.children.forEach((nestedChild: any, nestedIndex: number) => {\n const nestedChildPath = `${childPath}/children/${nestedIndex}`;\n if (!nestedChild || typeof nestedChild !== 'object') {\n allErrors.push({\n path: nestedChildPath,\n message: 'Nested component must be an object',\n code: 'invalid_type',\n });\n return;\n }\n\n if (!nestedChild.name) {\n allErrors.push({\n path: `${nestedChildPath}/name`,\n message: 'Nested component missing required field \"name\"',\n code: 'required_property',\n });\n } else if (opts.knownCustomNames?.has(nestedChild.name)) {\n // Registered plugin component — validated separately.\n } else if (nestedChild.props != null) {\n allErrors.push(\n ...validateComponentProps(\n nestedChild.name,\n nestedChild.props,\n `${nestedChildPath}/props`,\n opts\n )\n );\n } else if (nestedChild.name !== 'custom') {\n allErrors.push(\n ...validateComponentProps(\n nestedChild.name,\n {},\n `${nestedChildPath}/props`,\n opts\n )\n );\n }\n });\n }\n }\n });\n }\n\n return allErrors;\n}\n\n/**\n * Validate a component's props against its schema\n */\nfunction validateComponentProps(\n componentName: string,\n props: any,\n basePath: string,\n opts: DeepValidateOptions = {}\n): ValidationError[] {\n const errors: ValidationError[] = [];\n\n // Get the schema for this component\n const schema = COMPONENT_SCHEMAS[componentName];\n if (!schema) {\n // Unknown component type\n errors.push({\n path: basePath.replace('/props', '/name'),\n message: `Unknown component \"${componentName}\"`,\n code: 'unknown_component',\n });\n return errors;\n }\n\n // When unknown fields are explicitly allowed, strip them before checking so\n // additionalProperties:false no longer rejects — required/typed fields are\n // still enforced.\n const toCheck = opts.allowUnknownFields\n ? Value.Clean(schema, Value.Clone(props))\n : props;\n\n // Use TypeBox to validate against the specific schema\n if (!Value.Check(schema, toCheck)) {\n const valueErrors = [...Value.Errors(schema, toCheck)];\n const transformedErrors = transformValueErrors(valueErrors, {\n maxErrors: 100,\n });\n\n // Adjust paths to be relative to the document root\n transformedErrors.forEach((error) => {\n // Combine base path with error path\n const fullPath =\n error.path === 'root'\n ? basePath\n : `${basePath}${error.path.startsWith('/') ? error.path : '/' + error.path}`;\n\n errors.push({\n ...error,\n path: fullPath,\n });\n });\n }\n\n return errors;\n}\n\n/**\n * Combine deep validation with standard validation.\n *\n * Deep validation produces precise, path-aware errors. TypeBox's discriminated-\n * union check, by contrast, often collapses any failure under the root document\n * into a single generic \"Invalid component configuration for 'docx'\" message at\n * `root` — useful as a signal that something is wrong, but actionable only via\n * the deep-validator's output. We always strip that catch-all so it doesn't\n * appear alongside (or, worse, instead of) the real diagnostics.\n */\nexport function comprehensiveValidateDocument(\n data: any,\n existingErrors: ValidationError[] = [],\n opts: DeepValidateOptions = {}\n): ValidationError[] {\n const deepErrors = deepValidateDocument(data, opts);\n\n const filteredExisting = existingErrors.filter(\n (e) => !isGenericUnionCatchAll(e)\n );\n\n return deduplicateErrors([...filteredExisting, ...deepErrors]);\n}\n\n/**\n * Detect TypeBox's generic union/discriminator catch-all error at the document\n * root. These messages name the component type ('docx') but give no actionable\n * detail — the deep validator emits the actual path-level errors instead.\n */\nfunction isGenericUnionCatchAll(error: ValidationError): boolean {\n const atRoot = !error.path || error.path === 'root' || error.path === '/';\n if (!atRoot) return false;\n const msg = error.message || '';\n return (\n /invalid (component|module) configurations?/i.test(msg) ||\n /invalid document structure/i.test(msg)\n );\n}\n\n/**\n * Deduplicate errors by path and message\n */\nfunction deduplicateErrors(errors: ValidationError[]): ValidationError[] {\n const seen = new Set<string>();\n const unique: ValidationError[] = [];\n\n for (const error of errors) {\n const key = `${error.path}:${error.message}`;\n if (!seen.has(key)) {\n seen.add(key);\n unique.push(error);\n }\n }\n\n return unique;\n}\n","/**\n * Base validator implementation\n * Core validation logic that eliminates duplication across the codebase\n */\n\nimport { Value } from '@sinclair/typebox/value';\nimport type { Static, TSchema } from '@sinclair/typebox';\nimport type {\n ValidationResult,\n ValidationOptions,\n JsonValidationResult,\n} from './types';\nimport {\n transformValueErrors,\n createJsonParseError,\n formatErrorSummary,\n} from '@json-to-office/shared';\n\n/**\n * Base validation function that all specific validators use\n * This eliminates the repeated Value.Check -> Value.Errors -> map pattern\n */\nexport function validateAgainstSchema<T extends TSchema>(\n schema: T,\n data: unknown,\n options?: ValidationOptions\n): ValidationResult<Static<T>> {\n try {\n // Check if data matches the schema\n if (!Value.Check(schema, data)) {\n // Collect ALL errors (not just the first one)\n const errors = [...Value.Errors(schema, data)];\n const transformedErrors = transformValueErrors(errors, {\n jsonString: options?.jsonString,\n maxErrors: options?.maxErrors || 100, // Default to 100 if not specified\n });\n\n return {\n valid: false,\n errors: transformedErrors,\n };\n }\n\n // Data is valid, apply transformations if requested\n let processedData = data;\n\n if (options?.clean) {\n // Remove unknown properties\n processedData = Value.Clean(schema, Value.Clone(processedData));\n }\n\n if (options?.applyDefaults) {\n // Apply default values\n processedData = Value.Default(schema, processedData);\n }\n\n return {\n valid: true,\n data: processedData as Static<T>,\n };\n } catch (error) {\n // Handle unexpected errors\n return {\n valid: false,\n errors: [\n {\n path: 'root',\n message:\n error instanceof Error ? error.message : 'Unknown validation error',\n code: 'validation_exception',\n },\n ],\n };\n }\n}\n\n/**\n * Validate JSON string or object with schema\n */\nexport function validateJson<T extends TSchema>(\n schema: T,\n jsonInput: string | object,\n options?: ValidationOptions\n): JsonValidationResult<Static<T>> {\n // Handle string input\n if (typeof jsonInput === 'string') {\n // Basic input validation\n if (!jsonInput.trim()) {\n return {\n valid: false,\n errors: [\n {\n path: 'root',\n message: 'Input must be a non-empty string',\n code: 'empty_input',\n },\n ],\n isJsonError: true,\n };\n }\n\n // Try to parse JSON\n let parsed: unknown;\n try {\n parsed = JSON.parse(jsonInput);\n } catch (error) {\n if (error instanceof Error) {\n return {\n valid: false,\n errors: [createJsonParseError(error, jsonInput)],\n isJsonError: true,\n };\n }\n return {\n valid: false,\n errors: [\n {\n path: 'root',\n message: 'Failed to parse JSON',\n code: 'json_parse_error',\n },\n ],\n isJsonError: true,\n };\n }\n\n // Validate parsed object with position calculation\n const result = validateAgainstSchema(schema, parsed, {\n ...options,\n jsonString: jsonInput,\n calculatePosition: true,\n });\n\n return {\n ...result,\n parsed,\n isJsonError: false,\n };\n }\n\n // Handle object input directly\n const result = validateAgainstSchema(schema, jsonInput, options);\n return {\n ...result,\n parsed: jsonInput,\n isJsonError: false,\n };\n}\n\n/**\n * Batch validate multiple items\n */\nexport function validateBatch<T extends TSchema>(\n schema: T,\n items: unknown[],\n options?: ValidationOptions\n): ValidationResult<Static<T>[]> {\n const results: Static<T>[] = [];\n const allErrors: any[] = [];\n let hasErrors = false;\n\n for (let i = 0; i < items.length; i++) {\n const result = validateAgainstSchema(schema, items[i], options);\n\n if (result.valid && result.data) {\n results.push(result.data);\n } else {\n hasErrors = true;\n if (result.errors) {\n // Prefix errors with item index\n const prefixedErrors = result.errors.map((e) => ({\n ...e,\n path: `[${i}]${e.path ? '/' + e.path : ''}`,\n }));\n allErrors.push(...prefixedErrors);\n }\n }\n\n // Stop if we've hit the max errors\n if (options?.maxErrors && allErrors.length >= options.maxErrors) {\n break;\n }\n }\n\n if (hasErrors) {\n return {\n valid: false,\n errors: allErrors.slice(0, options?.maxErrors),\n };\n }\n\n return {\n valid: true,\n data: results,\n };\n}\n\n/**\n * Validate with custom error enhancement\n */\nexport function validateWithEnhancement<T extends TSchema>(\n schema: T,\n data: unknown,\n enhancer: (errors: any[]) => any[],\n options?: ValidationOptions\n): ValidationResult<Static<T>> {\n const result = validateAgainstSchema(schema, data, options);\n\n if (!result.valid && result.errors) {\n result.errors = enhancer(result.errors);\n }\n\n return result;\n}\n\n/**\n * Create a validator function for a specific schema\n */\nexport function createValidator<T extends TSchema>(\n schema: T,\n defaultOptions?: ValidationOptions\n) {\n return (data: unknown, options?: ValidationOptions) => {\n return validateAgainstSchema(schema, data, {\n ...defaultOptions,\n ...options,\n });\n };\n}\n\n/**\n * Create a JSON validator function for a specific schema\n */\nexport function createJsonValidator<T extends TSchema>(\n schema: T,\n defaultOptions?: ValidationOptions\n) {\n return (jsonInput: string | object, options?: ValidationOptions) => {\n return validateJson(schema, jsonInput, {\n ...defaultOptions,\n ...options,\n });\n };\n}\n\n/**\n * Utility to check if validation result is successful with type guard\n */\nexport function isValidationSuccess<T>(\n result: ValidationResult<T>\n): result is ValidationResult<T> & { valid: true; data: T } {\n return result.valid === true && result.data !== undefined;\n}\n\n/**\n * Get validation error summary\n */\nexport function getValidationSummary(result: ValidationResult): string {\n if (result.valid) {\n return 'Validation successful';\n }\n\n if (!result.errors || result.errors.length === 0) {\n return 'Validation failed with unknown error';\n }\n\n return formatErrorSummary(result.errors);\n}\n","/**\n * Document validation implementation\n * Single source of truth for all document validation\n */\n\nimport type { Static } from '@sinclair/typebox';\nimport {\n ComponentDefinitionSchema,\n StandardComponentDefinitionSchema,\n} from '../../schemas/components';\nimport { extractStandardComponentNames } from '@json-to-office/shared';\nimport {\n comprehensiveValidateDocument,\n collectImageSourceConflicts,\n} from './deep-validator';\n\n// JsonComponentDefinitionSchema is just an alias for ComponentDefinitionSchema\nconst JsonComponentDefinitionSchema = ComponentDefinitionSchema;\nimport type { DocumentValidationResult, ValidationOptions } from './types';\nimport { validateAgainstSchema, validateJson } from './base-validator';\n\n/**\n * Validate a document/report component definition\n */\nexport function validateDocument(\n data: unknown,\n options?: ValidationOptions\n): DocumentValidationResult {\n const result = validateAgainstSchema(\n ComponentDefinitionSchema,\n data,\n options\n );\n\n // If validation failed, use deep validation to get all detailed errors\n let finalErrors = result.errors || [];\n let finalValid = result.valid;\n if (!result.valid && data) {\n finalErrors = comprehensiveValidateDocument(data, result.errors, {\n allowUnknownFields: options?.allowUnknownFields,\n knownCustomNames: options?.knownCustomNames,\n });\n // If TypeBox's union check produced only generic catch-all errors and the\n // deep validator finds nothing actionable, treat the document as valid.\n if (finalErrors.length === 0) {\n finalValid = true;\n }\n }\n\n // Image source mutual-exclusivity is a semantic rule the structural schema\n // cannot express, so it runs unconditionally — a multi-source image passes\n // the TypeBox check above.\n const sourceConflicts = collectImageSourceConflicts(data);\n if (sourceConflicts.length > 0) {\n finalErrors = [...finalErrors, ...sourceConflicts];\n finalValid = false;\n }\n\n // Add document-specific metadata. Keep `data` populated whenever `valid` is\n // true so `isValidDocument()` (which requires both) stays consistent — when\n // TypeBox failed and the deep validator cleared the doc, fall back to the\n // original input as the data payload.\n const resolvedData =\n result.data ??\n (finalValid\n ? (data as Static<typeof ComponentDefinitionSchema>)\n : undefined);\n const documentResult: DocumentValidationResult = {\n ...result,\n valid: finalValid,\n documentType: 'docx',\n errors: finalErrors,\n data: resolvedData,\n };\n\n // Check if document has custom components\n if (finalValid) {\n const doc = resolvedData as any;\n if (doc && doc.children && Array.isArray(doc.children)) {\n const hasCustom = doc.children.some(\n (c: any) => !isStandardComponentName(c.name)\n );\n documentResult.hasCustomComponents = hasCustom;\n }\n }\n\n return documentResult;\n}\n\n/**\n * Validate a JSON document (string or object)\n */\nexport function validateJsonDocument(\n jsonInput: string | object,\n options?: ValidationOptions\n): DocumentValidationResult {\n // Use the JSON-specific schema which includes the $schema field\n const result = validateJson(\n JsonComponentDefinitionSchema,\n jsonInput,\n options\n );\n\n // If validation failed, use deep validation to get all detailed errors\n let finalErrors = result.errors || [];\n let finalValid = result.valid;\n if (!result.valid && result.parsed) {\n finalErrors = comprehensiveValidateDocument(result.parsed, result.errors, {\n allowUnknownFields: options?.allowUnknownFields,\n knownCustomNames: options?.knownCustomNames,\n });\n if (finalErrors.length === 0) {\n finalValid = true;\n }\n }\n\n // Image source mutual-exclusivity (see validateDocument) — runs always.\n const sourceConflicts = collectImageSourceConflicts(result.parsed);\n if (sourceConflicts.length > 0) {\n finalErrors = [...finalErrors, ...sourceConflicts];\n finalValid = false;\n }\n\n // Add document-specific metadata. Keep `data` populated whenever `valid` is\n // true so `isValidDocument()` (which requires both) stays consistent — when\n // TypeBox failed and the deep validator cleared the doc, fall back to the\n // parsed input as the data payload.\n const resolvedData =\n result.data ??\n (finalValid\n ? (result.parsed as Static<typeof ComponentDefinitionSchema>)\n : undefined);\n const documentResult: DocumentValidationResult = {\n ...result,\n valid: finalValid,\n documentType: 'docx',\n errors: finalErrors,\n data: resolvedData,\n };\n\n // Check for custom components\n if (finalValid) {\n const doc = resolvedData as any;\n if (doc && doc.children && Array.isArray(doc.children)) {\n const hasCustom = doc.children.some(\n (c: any) => !isStandardComponentName(c.name)\n );\n documentResult.hasCustomComponents = hasCustom;\n }\n }\n\n return documentResult;\n}\n\n/**\n * Type guard for document validation result\n */\nexport function isValidDocument(\n result: DocumentValidationResult\n): result is DocumentValidationResult & {\n valid: true;\n data: Static<typeof ComponentDefinitionSchema>;\n} {\n return result.valid === true && result.data !== undefined;\n}\n\n/**\n * Extract standard component names from the schema (cached)\n */\nfunction getStandardComponentNames(): string[] {\n return extractStandardComponentNames(StandardComponentDefinitionSchema);\n}\n\n/**\n * Check if a component name is standard\n */\nfunction isStandardComponentName(name: string): boolean {\n const standardNames = getStandardComponentNames();\n return standardNames.includes(name);\n}\n\n/**\n * Create a document validator with default options\n */\nexport function createDocumentValidator(defaultOptions?: ValidationOptions) {\n return {\n validate: (data: unknown, options?: ValidationOptions) =>\n validateDocument(data, { ...defaultOptions, ...options }),\n validateJson: (jsonInput: string | object, options?: ValidationOptions) =>\n validateJsonDocument(jsonInput, { ...defaultOptions, ...options }),\n };\n}\n\n// Export convenient validators with common configurations\nexport const documentValidator = createDocumentValidator({\n clean: true,\n applyDefaults: true,\n maxErrors: 100, // Collect up to 100 errors to show all validation issues\n});\n\nexport const strictDocumentValidator = createDocumentValidator({\n clean: false,\n applyDefaults: false,\n maxErrors: 100, // Increased from 10 to show more errors\n});\n\n/**\n * Legacy compatibility exports\n */\nexport const validateJsonComponent = validateJsonDocument;\nexport const validateDocumentWithSchema = validateDocument;\n"],"mappings":";;;;;;;;;;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AA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AAG,gBAAgB,GAAG,QAAQ,CAAC;AAAA,EACrE;AACF;AAGO,IAAM,oBAAoB,wBAAwB;AAAA,EACvD,OAAO;AAAA,EACP,eAAe;AAAA,EACf,WAAW;AAAA;AACb,CAAC;AAEM,IAAM,0BAA0B,wBAAwB;AAAA,EAC7D,OAAO;AAAA,EACP,eAAe;AAAA,EACf,WAAW;AAAA;AACb,CAAC;AAKM,IAAM,wBAAwB;AAC9B,IAAM,6BAA6B;","names":["Value","transformValueErrors","result"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentDefinitionSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3E47TLLP.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-CV7HBUPT.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
TablePropsSchema,
|
|
14
14
|
createSectionPropsSchema,
|
|
15
15
|
createTablePropsSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UPVW437P.js";
|
|
17
17
|
import {
|
|
18
18
|
HexColorSchema
|
|
19
19
|
} from "./chunk-B66TAIK6.js";
|
|
@@ -385,8 +385,21 @@ var HighchartsPropsSchema = Type4.Object({
|
|
|
385
385
|
]),
|
|
386
386
|
// Optional scale factor for export
|
|
387
387
|
scale: Type4.Optional(Type4.Number()),
|
|
388
|
+
// Optional resources forwarded verbatim to the export server (CSS/JS/files).
|
|
389
|
+
// Notably enables @font-face rules so charts render in custom fonts.
|
|
390
|
+
resources: Type4.Optional(
|
|
391
|
+
Type4.Object({
|
|
392
|
+
css: Type4.Optional(Type4.String()),
|
|
393
|
+
js: Type4.Optional(Type4.String()),
|
|
394
|
+
files: Type4.Optional(Type4.Array(Type4.String()))
|
|
395
|
+
})
|
|
396
|
+
),
|
|
388
397
|
// Optional Highcharts Export Server URL override
|
|
389
|
-
serverUrl: Type4.Optional(
|
|
398
|
+
serverUrl: Type4.Optional(
|
|
399
|
+
Type4.String({
|
|
400
|
+
description: "Highcharts Export Server URL (default: http://localhost:7801)"
|
|
401
|
+
})
|
|
402
|
+
),
|
|
390
403
|
// Optional width for rendering (overrides chart width)
|
|
391
404
|
width: Type4.Optional(
|
|
392
405
|
Type4.Union(
|
|
@@ -796,4 +809,4 @@ export {
|
|
|
796
809
|
createAllComponentSchemas,
|
|
797
810
|
createAllComponentSchemasNarrowed
|
|
798
811
|
};
|
|
799
|
-
//# sourceMappingURL=chunk-
|
|
812
|
+
//# sourceMappingURL=chunk-CYBFQ2VM.js.map
|
|
@@ -1 +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';\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 * Generate TypeBox schema object for a component.\n *\n * @param component - Component definition from the registry\n * @param childrenType - Schema for children items. For containers this should be\n * a narrowed union of allowed children; for leaves omit it.\n * @returns TypeBox schema object for the component\n */\nexport function createComponentSchemaObject(\n component: StandardComponentDefinition,\n childrenType?: TSchema,\n selfRef?: TSchema\n): TSchema {\n const schema: Record<string, TSchema> = {\n name: Type.Literal(component.name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(\n Type.Boolean({\n default: true,\n description:\n 'When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion.',\n })\n ),\n };\n\n // Special handling for report component (has $schema field)\n if (component.special?.hasSchemaField) {\n schema.$schema = Type.Optional(Type.String({ format: 'uri' }));\n }\n\n // selfRef (full union) is intentionally passed to createPropsSchema so that\n // header/footer sub-schemas and table cell content can reference any component.\n schema.props =\n component.createPropsSchema && selfRef\n ? component.createPropsSchema(selfRef)\n : component.propsSchema;\n\n // Add children support if applicable\n if (component.hasChildren && childrenType) {\n schema.children = Type.Optional(Type.Array(childrenType));\n }\n\n return Type.Object(schema, { additionalProperties: false });\n}\n\n/**\n * Generate an array of TypeBox schemas for all standard components.\n * Uses a flat recursive ref for all containers (legacy behavior).\n *\n * @param recursiveRef - Optional recursive reference for children\n * @returns Array of TypeBox schemas for all components in the registry\n */\nexport function createAllComponentSchemas(\n recursiveRef?: TSchema\n): readonly TSchema[] {\n return STANDARD_COMPONENTS_REGISTRY.map((component) =>\n createComponentSchemaObject(component, recursiveRef)\n );\n}\n\n/**\n * Build all standard component schemas with per-container narrowed children.\n *\n * Resolves containers in dependency order so each container's children union\n * only references its allowedChildren. Plugin schemas are always included in\n * every container's children.\n *\n * @param selfRef - The Type.Recursive self-reference (used as fallback and for plugin children)\n * @param pluginSchemas - Plugin component schemas (always allowed in all containers)\n * @returns schemas array and a byName map for direct lookups\n */\nexport function createAllComponentSchemasNarrowed(\n selfRef: TSchema,\n pluginSchemas: TSchema[] = []\n): { schemas: TSchema[]; byName: Map<string, TSchema> } {\n // Phase 1: Build leaf (non-container) component schemas — no children\n // selfRef is passed so factories (e.g. table) can wire up recursive refs.\n const leafSchemas = new Map<string, TSchema>();\n for (const comp of STANDARD_COMPONENTS_REGISTRY) {\n if (!comp.hasChildren) {\n leafSchemas.set(\n comp.name,\n createComponentSchemaObject(comp, undefined, selfRef)\n );\n }\n }\n\n // Phase 2: Resolve containers in dependency order\n const containers = STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n const resolved = new Map<string, TSchema>();\n const pending = [...containers];\n\n while (pending.length > 0) {\n const before = pending.length;\n for (let i = pending.length - 1; i >= 0; i--) {\n const comp = pending[i];\n\n if (!comp.allowedChildren) {\n // No allowedChildren declared — fallback to full recursive ref\n resolved.set(\n comp.name,\n createComponentSchemaObject(comp, selfRef, selfRef)\n );\n pending.splice(i, 1);\n continue;\n }\n\n // Check if all container dependencies are resolved\n const containerDeps = comp.allowedChildren.filter((name) =>\n containers.some((c) => c.name === name)\n );\n if (!containerDeps.every((d) => resolved.has(d))) continue;\n\n // Build narrowed children union\n const childSchemas = comp.allowedChildren\n .map((name) => resolved.get(name) ?? leafSchemas.get(name))\n .filter((s): s is TSchema => s !== undefined);\n\n const allChildSchemas = [...childSchemas, ...pluginSchemas];\n const childrenType =\n allChildSchemas.length === 1\n ? allChildSchemas[0]\n : Type.Union(allChildSchemas);\n\n resolved.set(\n comp.name,\n createComponentSchemaObject(comp, childrenType, selfRef)\n );\n pending.splice(i, 1);\n }\n\n if (pending.length === before) {\n throw new Error(\n `Circular allowedChildren among: ${pending.map((c) => c.name).join(', ')}`\n );\n }\n }\n\n // Combine: containers (resolved) + leaves\n const byName = new Map([...resolved, ...leafSchemas]);\n return { schemas: [...byName.values()], byName };\n}\n","/**\n * Report Component Schema\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\nimport { ComponentDefaultsSchema } from '../component-defaults';\n\n// Create a function to generate ReportPropsSchema with recursive component reference\nexport const createReportPropsSchema = (_moduleRef?: TSchema) =>\n Type.Object(\n {\n theme: Type.Optional(\n Type.String({\n description: 'Theme name to apply (default: \"minimal\")',\n examples: ['minimal', 'corporate', 'modern'],\n default: 'minimal',\n })\n ),\n componentDefaults: Type.Optional(ComponentDefaultsSchema),\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(Type.String()),\n date: Type.Optional(Type.String()),\n created: Type.Optional(Type.String({ format: 'date-time' })),\n modified: Type.Optional(Type.String({ format: 'date-time' })),\n version: Type.Optional(Type.String()),\n tags: Type.Optional(Type.Array(Type.String())),\n },\n {\n description:\n 'Document metadata (title, author, company, dates, etc.)',\n additionalProperties: false,\n }\n )\n ),\n },\n {\n description: 'Report component props',\n additionalProperties: false,\n }\n );\n\nexport const ReportPropsSchema = createReportPropsSchema();\n\nexport type ReportProps = Static<typeof ReportPropsSchema>;\n","/**\n * Text Box Component Schema\n * A floating container that can hold child components (e.g., text, image, columns)\n *\n * Positioning API mirrors existing floating options from text/image for consistency.\n *\n * **Nested Columns Support:**\n * When a `columns` component is nested inside a `text-box`, it automatically renders\n * as a multi-column table instead of a section-level column layout. This allows\n * for columnar content within floating or inline containers.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FloatingPropertiesSchema } from './common';\nimport { HexColorSchema } from '../font';\n\nexport const TextBoxPropsSchema = Type.Object(\n {\n width: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Text box width in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Text box width as percentage (e.g., \"50%\") relative to content width',\n }),\n ],\n {\n description:\n 'Text box width in pixels (number) or as percentage string (e.g., \"50%\")',\n }\n )\n ),\n height: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Text box height in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Text box height as percentage (e.g., \"50%\") relative to content height',\n }),\n ],\n {\n description:\n 'Text box height in pixels (number) or as percentage string (e.g., \"50%\")',\n }\n )\n ),\n floating: Type.Optional(FloatingPropertiesSchema),\n style: Type.Optional(\n Type.Object(\n {\n padding: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(Type.Number({ minimum: 0 })),\n right: Type.Optional(Type.Number({ minimum: 0 })),\n bottom: Type.Optional(Type.Number({ minimum: 0 })),\n left: Type.Optional(Type.Number({ minimum: 0 })),\n },\n { additionalProperties: false }\n )\n ),\n border: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(\n // Reuse border schema semantics: style/width/color\n Type.Object(\n {\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 fill: Type.Optional(Type.String()),\n },\n { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n);\n\nexport type TextBoxProps = Static<typeof TextBoxPropsSchema>;\n","/**\n * Table of Contents Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\n\nexport const TocStyleSchema = Type.Union(\n [Type.Literal('numeric'), Type.Literal('bullet'), Type.Literal('none')],\n { description: 'TOC numbering style' }\n);\n\nexport const TocScopeSchema = Type.Union(\n [Type.Literal('document'), Type.Literal('section')],\n { description: 'TOC scope: document-wide or section-only' }\n);\n\nexport const TocStyleMappingSchema = Type.Object(\n {\n styleId: Type.String({\n description: 'Custom style ID matching a key in theme.styles',\n }),\n level: Type.Number({\n minimum: 1,\n maximum: 6,\n description: 'TOC level (1-6) to assign to this style',\n }),\n },\n {\n description: 'Mapping of custom style to TOC level',\n additionalProperties: false,\n }\n);\n\nexport const TocDepthRangeSchema = Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to include in TOC. Specify at least one of \"from\" or \"to\".',\n additionalProperties: false,\n }\n);\n\nexport const TocPropsSchema = Type.Object(\n {\n pageBreak: Type.Optional(\n Type.Boolean({\n description: 'Insert page break before TOC block',\n })\n ),\n depth: Type.Optional(\n Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to include in TOC. Specify \"from\", \"to\", or both. Defaults: from=1, to=3',\n additionalProperties: false,\n default: { to: 3 },\n }\n )\n ),\n pageNumbersDepth: Type.Optional(\n Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to show page numbers. Specify \"from\", \"to\", or both. When specified, page numbers are hidden for entries outside this range.',\n additionalProperties: false,\n }\n )\n ),\n numberingStyle: Type.Optional(TocStyleSchema),\n title: Type.Optional(\n Type.String({\n description: 'TOC heading title',\n })\n ),\n includePageNumbers: Type.Optional(\n Type.Boolean({\n default: true,\n description: 'Show page numbers next to entries',\n })\n ),\n numberSeparator: Type.Optional(\n Type.Boolean({\n default: true,\n description:\n 'Use tab separator between entry and page number. True applies \"\\\\t\" (default), false applies \" \"',\n })\n ),\n scope: Type.Optional(\n Type.Union([TocScopeSchema, Type.Literal('auto')], {\n default: 'auto',\n description:\n 'TOC scope: \"document\" for entire document, \"section\" for parent section only, \"auto\" for automatic detection (section if inside section, otherwise document)',\n })\n ),\n styles: Type.Optional(\n Type.Array(TocStyleMappingSchema, {\n description:\n 'Custom style mappings for TOC entries. Maps custom theme styles to TOC levels.',\n })\n ),\n },\n {\n description: 'Table of Contents component props',\n additionalProperties: false,\n }\n);\n\nexport type TocProps = Static<typeof TocPropsSchema>;\n","/**\n * Highcharts Component Schema\n *\n * Standard module for rendering charts using Highcharts export server.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\n\n/**\n * Highcharts component props schema\n * Accepts options that will be passed to Highcharts export server\n */\nexport const HighchartsPropsSchema = Type.Object({\n // Highcharts chart options - can be anything but must at least have chart.width and chart.height\n options: Type.Intersect([\n Type.Record(Type.String(), Type.Unknown()),\n Type.Object({\n chart: Type.Object({\n width: Type.Number(),\n height: Type.Number(),\n }),\n }),\n ]),\n // Optional scale factor for export\n scale: Type.Optional(Type.Number()),\n // Optional Highcharts Export Server URL override\n serverUrl: Type.Optional(Type.String({ description: 'Highcharts Export Server URL (default: http://localhost:7801)' })),\n // Optional width for rendering (overrides chart width)\n width: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Image width in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Image width as percentage (e.g., \"90%\") relative to content width',\n }),\n ],\n {\n description:\n 'Rendered image width in pixels (number) or as percentage string (e.g., \"90%\")',\n }\n )\n ),\n // Optional height for rendering (overrides chart height)\n height: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Image height in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Image height as percentage (e.g., \"90%\") relative to content height',\n }),\n ],\n {\n description:\n 'Rendered image height in pixels (number) or as percentage string (e.g., \"90%\")',\n }\n )\n ),\n});\n\nexport type HighchartsProps = Static<typeof HighchartsPropsSchema>;\n","/**\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-pptx';\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-pptx) — 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,Y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gBAAgB;AAAA,QAAO,CAAC,SACjD,WAAW,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AAAA,MACxC;AACA,UAAI,CAAC,cAAc,MAAM,CAAC,MAAM,SAAS,IAAI,CAAC,CAAC,EAAG;AAGlD,YAAM,eAAe,KAAK,gBACvB,IAAI,CAAC,SAAS,SAAS,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,EACzD,OAAO,CAAC,MAAoB,MAAM,MAAS;AAE9C,YAAM,kBAAkB,CAAC,GAAG,cAAc,GAAG,aAAa;AAC1D,YAAM,eACJ,gBAAgB,WAAW,IACvB,gBAAgB,CAAC,IACjBA,MAAK,MAAM,eAAe;AAEhC,eAAS;AAAA,QACP,KAAK;AAAA,QACL,4BAA4B,MAAM,cAAc,OAAO;AAAA,MACzD;AACA,cAAQ,OAAO,GAAG,CAAC;AAAA,IACrB;AAEA,QAAI,QAAQ,WAAW,QAAQ;AAC7B,YAAM,IAAI;AAAA,QACR,mCAAmC,QAAQ,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;AAAA,MAC1E;AAAA,IACF;AAAA,EACF;AAGA,QAAM,SAAS,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC;AACpD,SAAO,EAAE,SAAS,CAAC,GAAG,OAAO,OAAO,CAAC,GAAG,OAAO;AACjD;","names":["Type","Type","Type","Type","Type","Type","Type","Type"]}
|
|
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';\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 * Generate TypeBox schema object for a component.\n *\n * @param component - Component definition from the registry\n * @param childrenType - Schema for children items. For containers this should be\n * a narrowed union of allowed children; for leaves omit it.\n * @returns TypeBox schema object for the component\n */\nexport function createComponentSchemaObject(\n component: StandardComponentDefinition,\n childrenType?: TSchema,\n selfRef?: TSchema\n): TSchema {\n const schema: Record<string, TSchema> = {\n name: Type.Literal(component.name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(\n Type.Boolean({\n default: true,\n description:\n 'When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion.',\n })\n ),\n };\n\n // Special handling for report component (has $schema field)\n if (component.special?.hasSchemaField) {\n schema.$schema = Type.Optional(Type.String({ format: 'uri' }));\n }\n\n // selfRef (full union) is intentionally passed to createPropsSchema so that\n // header/footer sub-schemas and table cell content can reference any component.\n schema.props =\n component.createPropsSchema && selfRef\n ? component.createPropsSchema(selfRef)\n : component.propsSchema;\n\n // Add children support if applicable\n if (component.hasChildren && childrenType) {\n schema.children = Type.Optional(Type.Array(childrenType));\n }\n\n return Type.Object(schema, { additionalProperties: false });\n}\n\n/**\n * Generate an array of TypeBox schemas for all standard components.\n * Uses a flat recursive ref for all containers (legacy behavior).\n *\n * @param recursiveRef - Optional recursive reference for children\n * @returns Array of TypeBox schemas for all components in the registry\n */\nexport function createAllComponentSchemas(\n recursiveRef?: TSchema\n): readonly TSchema[] {\n return STANDARD_COMPONENTS_REGISTRY.map((component) =>\n createComponentSchemaObject(component, recursiveRef)\n );\n}\n\n/**\n * Build all standard component schemas with per-container narrowed children.\n *\n * Resolves containers in dependency order so each container's children union\n * only references its allowedChildren. Plugin schemas are always included in\n * every container's children.\n *\n * @param selfRef - The Type.Recursive self-reference (used as fallback and for plugin children)\n * @param pluginSchemas - Plugin component schemas (always allowed in all containers)\n * @returns schemas array and a byName map for direct lookups\n */\nexport function createAllComponentSchemasNarrowed(\n selfRef: TSchema,\n pluginSchemas: TSchema[] = []\n): { schemas: TSchema[]; byName: Map<string, TSchema> } {\n // Phase 1: Build leaf (non-container) component schemas — no children\n // selfRef is passed so factories (e.g. table) can wire up recursive refs.\n const leafSchemas = new Map<string, TSchema>();\n for (const comp of STANDARD_COMPONENTS_REGISTRY) {\n if (!comp.hasChildren) {\n leafSchemas.set(\n comp.name,\n createComponentSchemaObject(comp, undefined, selfRef)\n );\n }\n }\n\n // Phase 2: Resolve containers in dependency order\n const containers = STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n const resolved = new Map<string, TSchema>();\n const pending = [...containers];\n\n while (pending.length > 0) {\n const before = pending.length;\n for (let i = pending.length - 1; i >= 0; i--) {\n const comp = pending[i];\n\n if (!comp.allowedChildren) {\n // No allowedChildren declared — fallback to full recursive ref\n resolved.set(\n comp.name,\n createComponentSchemaObject(comp, selfRef, selfRef)\n );\n pending.splice(i, 1);\n continue;\n }\n\n // Check if all container dependencies are resolved\n const containerDeps = comp.allowedChildren.filter((name) =>\n containers.some((c) => c.name === name)\n );\n if (!containerDeps.every((d) => resolved.has(d))) continue;\n\n // Build narrowed children union\n const childSchemas = comp.allowedChildren\n .map((name) => resolved.get(name) ?? leafSchemas.get(name))\n .filter((s): s is TSchema => s !== undefined);\n\n const allChildSchemas = [...childSchemas, ...pluginSchemas];\n const childrenType =\n allChildSchemas.length === 1\n ? allChildSchemas[0]\n : Type.Union(allChildSchemas);\n\n resolved.set(\n comp.name,\n createComponentSchemaObject(comp, childrenType, selfRef)\n );\n pending.splice(i, 1);\n }\n\n if (pending.length === before) {\n throw new Error(\n `Circular allowedChildren among: ${pending.map((c) => c.name).join(', ')}`\n );\n }\n }\n\n // Combine: containers (resolved) + leaves\n const byName = new Map([...resolved, ...leafSchemas]);\n return { schemas: [...byName.values()], byName };\n}\n","/**\n * Report Component Schema\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\nimport { ComponentDefaultsSchema } from '../component-defaults';\n\n// Create a function to generate ReportPropsSchema with recursive component reference\nexport const createReportPropsSchema = (_moduleRef?: TSchema) =>\n Type.Object(\n {\n theme: Type.Optional(\n Type.String({\n description: 'Theme name to apply (default: \"minimal\")',\n examples: ['minimal', 'corporate', 'modern'],\n default: 'minimal',\n })\n ),\n componentDefaults: Type.Optional(ComponentDefaultsSchema),\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(Type.String()),\n date: Type.Optional(Type.String()),\n created: Type.Optional(Type.String({ format: 'date-time' })),\n modified: Type.Optional(Type.String({ format: 'date-time' })),\n version: Type.Optional(Type.String()),\n tags: Type.Optional(Type.Array(Type.String())),\n },\n {\n description:\n 'Document metadata (title, author, company, dates, etc.)',\n additionalProperties: false,\n }\n )\n ),\n },\n {\n description: 'Report component props',\n additionalProperties: false,\n }\n );\n\nexport const ReportPropsSchema = createReportPropsSchema();\n\nexport type ReportProps = Static<typeof ReportPropsSchema>;\n","/**\n * Text Box Component Schema\n * A floating container that can hold child components (e.g., text, image, columns)\n *\n * Positioning API mirrors existing floating options from text/image for consistency.\n *\n * **Nested Columns Support:**\n * When a `columns` component is nested inside a `text-box`, it automatically renders\n * as a multi-column table instead of a section-level column layout. This allows\n * for columnar content within floating or inline containers.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FloatingPropertiesSchema } from './common';\nimport { HexColorSchema } from '../font';\n\nexport const TextBoxPropsSchema = Type.Object(\n {\n width: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Text box width in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Text box width as percentage (e.g., \"50%\") relative to content width',\n }),\n ],\n {\n description:\n 'Text box width in pixels (number) or as percentage string (e.g., \"50%\")',\n }\n )\n ),\n height: Type.Optional(\n Type.Union(\n [\n Type.Number({\n minimum: 1,\n description: 'Text box height in pixels',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Text box height as percentage (e.g., \"50%\") relative to content height',\n }),\n ],\n {\n description:\n 'Text box height in pixels (number) or as percentage string (e.g., \"50%\")',\n }\n )\n ),\n floating: Type.Optional(FloatingPropertiesSchema),\n style: Type.Optional(\n Type.Object(\n {\n padding: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(Type.Number({ minimum: 0 })),\n right: Type.Optional(Type.Number({ minimum: 0 })),\n bottom: Type.Optional(Type.Number({ minimum: 0 })),\n left: Type.Optional(Type.Number({ minimum: 0 })),\n },\n { additionalProperties: false }\n )\n ),\n border: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(\n // Reuse border schema semantics: style/width/color\n Type.Object(\n {\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 fill: Type.Optional(Type.String()),\n },\n { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n )\n ),\n },\n { additionalProperties: false }\n);\n\nexport type TextBoxProps = Static<typeof TextBoxPropsSchema>;\n","/**\n * Table of Contents Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\n\nexport const TocStyleSchema = Type.Union(\n [Type.Literal('numeric'), Type.Literal('bullet'), Type.Literal('none')],\n { description: 'TOC numbering style' }\n);\n\nexport const TocScopeSchema = Type.Union(\n [Type.Literal('document'), Type.Literal('section')],\n { description: 'TOC scope: document-wide or section-only' }\n);\n\nexport const TocStyleMappingSchema = Type.Object(\n {\n styleId: Type.String({\n description: 'Custom style ID matching a key in theme.styles',\n }),\n level: Type.Number({\n minimum: 1,\n maximum: 6,\n description: 'TOC level (1-6) to assign to this style',\n }),\n },\n {\n description: 'Mapping of custom style to TOC level',\n additionalProperties: false,\n }\n);\n\nexport const TocDepthRangeSchema = Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to include in TOC. Specify at least one of \"from\" or \"to\".',\n additionalProperties: false,\n }\n);\n\nexport const TocPropsSchema = Type.Object(\n {\n pageBreak: Type.Optional(\n Type.Boolean({\n description: 'Insert page break before TOC block',\n })\n ),\n depth: Type.Optional(\n Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to include in TOC. Specify \"from\", \"to\", or both. Defaults: from=1, to=3',\n additionalProperties: false,\n default: { to: 3 },\n }\n )\n ),\n pageNumbersDepth: Type.Optional(\n Type.Object(\n {\n from: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 1,\n description:\n 'Starting heading level (1-6). Defaults to 1 if not specified.',\n })\n ),\n to: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 6,\n default: 3,\n description:\n 'Ending heading level (1-6). Defaults to 3 if not specified.',\n })\n ),\n },\n {\n description:\n 'Range of heading levels to show page numbers. Specify \"from\", \"to\", or both. When specified, page numbers are hidden for entries outside this range.',\n additionalProperties: false,\n }\n )\n ),\n numberingStyle: Type.Optional(TocStyleSchema),\n title: Type.Optional(\n Type.String({\n description: 'TOC heading title',\n })\n ),\n includePageNumbers: Type.Optional(\n Type.Boolean({\n default: true,\n description: 'Show page numbers next to entries',\n })\n ),\n numberSeparator: Type.Optional(\n Type.Boolean({\n default: true,\n description:\n 'Use tab separator between entry and page number. True applies \"\\\\t\" (default), false applies \" \"',\n })\n ),\n scope: Type.Optional(\n Type.Union([TocScopeSchema, Type.Literal('auto')], {\n default: 'auto',\n description:\n 'TOC scope: \"document\" for entire document, \"section\" for parent section only, \"auto\" for automatic detection (section if inside section, otherwise document)',\n })\n ),\n styles: Type.Optional(\n Type.Array(TocStyleMappingSchema, {\n description:\n 'Custom style mappings for TOC entries. Maps custom theme styles to TOC levels.',\n })\n ),\n },\n {\n description: 'Table of Contents component props',\n additionalProperties: false,\n }\n);\n\nexport type TocProps = Static<typeof TocPropsSchema>;\n","/**\n * Highcharts Component Schema\n *\n * Standard module for rendering charts using Highcharts export server.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\n\n/**\n * Highcharts component props schema\n * Accepts options that will be passed to Highcharts export server\n */\nexport const HighchartsPropsSchema = Type.Object({\n // Highcharts chart options - can be anything but must at least have chart.width and chart.height\n options: Type.Intersect([\n Type.Record(Type.String(), Type.Unknown()),\n Type.Object({\n chart: Type.Object({\n width: Type.Number(),\n height: Type.Number(),\n }),\n }),\n ]),\n // Optional scale factor for export\n scale: Type.Optional(Type.Number()),\n // Optional 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-pptx';\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-pptx) — 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;AAI/B,IAAM,0BAA0B,CAAC,eACtC,KAAK;AAAA,EACH;AAAA,IACE,OAAO,KAAK;AAAA,MACV,KAAK,OAAO;AAAA,QACV,aAAa;AAAA,QACb,UAAU,CAAC,WAAW,aAAa,QAAQ;AAAA,QAC3C,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,IACA,mBAAmB,KAAK,SAAS,uBAAuB;AAAA,IACxD,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,SAAS,KAA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,MAAM,cAAc,OAAO;AAAA,MACzD;AACA,cAAQ,OAAO,GAAG,CAAC;AAAA,IACrB;AAEA,QAAI,QAAQ,WAAW,QAAQ;AAC7B,YAAM,IAAI;AAAA,QACR,mCAAmC,QAAQ,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;AAAA,MAC1E;AAAA,IACF;AAAA,EACF;AAGA,QAAM,SAAS,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,CAAC;AACpD,SAAO,EAAE,SAAS,CAAC,GAAG,OAAO,OAAO,CAAC,GAAG,OAAO;AACjD;","names":["Type","Type","Type","Type","Type","Type","Type","Type"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getContainerComponents
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CYBFQ2VM.js";
|
|
4
4
|
|
|
5
5
|
// src/schemas/export.ts
|
|
6
6
|
function fixSchemaReferences(schema, rootDefinitionName = "ComponentDefinition") {
|
|
@@ -272,4 +272,4 @@ export {
|
|
|
272
272
|
BASE_SCHEMA_METADATA,
|
|
273
273
|
THEME_SCHEMA_METADATA
|
|
274
274
|
};
|
|
275
|
-
//# sourceMappingURL=chunk-
|
|
275
|
+
//# sourceMappingURL=chunk-JWBBT2MK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAllComponentSchemasNarrowed,
|
|
3
3
|
getStandardComponent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CYBFQ2VM.js";
|
|
5
5
|
|
|
6
6
|
// src/schemas/generator.ts
|
|
7
7
|
import { Type } from "@sinclair/typebox";
|
|
@@ -128,4 +128,4 @@ function generateUnifiedDocumentSchema(options = {}) {
|
|
|
128
128
|
export {
|
|
129
129
|
generateUnifiedDocumentSchema
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-N22J6K24.js.map
|