@json-to-office/shared 1.1.0 → 1.2.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.
@@ -164,7 +164,7 @@ function fixSchemaReferences(schema, rootDefinitionName = "ComponentDefinition")
164
164
  }
165
165
  function convertToJsonSchema(schema, options = {}) {
166
166
  const {
167
- $schema = "https://json-schema.org/draft-07/schema#",
167
+ $schema = "http://json-schema.org/draft-07/schema#",
168
168
  $id,
169
169
  title,
170
170
  description,
@@ -219,7 +219,7 @@ function convertToJsonSchema(schema, options = {}) {
219
219
  }
220
220
  function createComponentSchema(name, config, containerNames, componentDefinitionSchema, rootDefinitionName = "ComponentDefinition") {
221
221
  const componentStructure = {
222
- $schema: "https://json-schema.org/draft-07/schema#",
222
+ $schema: "http://json-schema.org/draft-07/schema#",
223
223
  $id: `${name}.schema.json`,
224
224
  title: config.title,
225
225
  description: config.description,
@@ -294,4 +294,4 @@ export {
294
294
  exportSchemaToFile,
295
295
  createComponentSchemaObject
296
296
  };
297
- //# sourceMappingURL=chunk-BS2BBPVA.js.map
297
+ //# sourceMappingURL=chunk-6TNT7DGC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas/schema-utils.ts","../src/schemas/discriminated-unions.ts"],"sourcesContent":["import { Type, TSchema } from '@sinclair/typebox';\nimport { restructureNameDiscriminatedUnions } from './discriminated-unions';\nimport type { ComponentDefinition } from '../types/components';\n\nexport interface ComponentSchemaConfig {\n schema: TSchema;\n title: string;\n description: string;\n requiresName?: boolean;\n enhanceForRichContent?: boolean;\n}\n\nfunction replaceRefs(\n obj: Record<string, unknown>,\n target: string,\n replacement: string\n): void {\n if (typeof obj !== 'object' || obj === null) return;\n if (Array.isArray(obj)) {\n obj.forEach((item) => {\n if (typeof item === 'object' && item !== null) {\n replaceRefs(item as Record<string, unknown>, target, replacement);\n }\n });\n return;\n }\n if (obj.$ref === target) {\n obj.$ref = replacement;\n }\n for (const value of Object.values(obj)) {\n if (typeof value === 'object' && value !== null) {\n replaceRefs(value as Record<string, unknown>, target, replacement);\n }\n }\n}\n\n/**\n * Resolve the bare `$ref` values TypeBox leaves behind into JSON Pointers.\n *\n * `rootDefinitionName` is only the fallback for a reference that names nothing\n * hoisted. A schema may carry several recursive definitions — the DOCX\n * document schema carries one per renderer — so a bare reference that matches\n * an actual definition resolves to *that* one, which is what keeps the two\n * renderer views from collapsing into whichever was walked last.\n */\nexport function fixSchemaReferences(\n schema: Record<string, unknown>,\n rootDefinitionName = 'ComponentDefinition'\n): void {\n const definitionNames = new Set(\n Object.keys(\n (schema.definitions as Record<string, unknown> | undefined) ?? {}\n )\n );\n // Undefined when nothing by either name was hoisted. Substituting the root\n // name regardless is how a reference to a definition that does not exist got\n // written, and Ajv refuses to compile a schema containing one — so an\n // unresolved reference is dropped rather than invented.\n const definitionRef = (name: string): string | undefined => {\n const target = definitionNames.has(name) ? name : rootDefinitionName;\n return definitionNames.has(target) ? `#/definitions/${target}` : undefined;\n };\n const isBareDefinitionRef = (value: unknown): value is string =>\n typeof value === 'string' &&\n (/^T\\d+$/.test(value) ||\n value === rootDefinitionName ||\n definitionNames.has(value));\n\n function traverse(obj: Record<string, unknown>, path = ''): void {\n if (typeof obj !== 'object' || obj === null) return;\n\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = path ? `${path}.${key}` : key;\n\n if (value && typeof value === 'object') {\n const schemaValue = value as Record<string, unknown>;\n\n // Only when there is something to point at. A schema that holds\n // components without embedding their definition (the theme schema\n // holds `componentDefaults` but cannot carry a renderer's component\n // union) keeps its untyped item: a `$ref` to a definition that was\n // never hoisted is unresolvable, and Ajv refuses to compile the whole\n // schema over it.\n if (\n schemaValue.type === 'array' &&\n schemaValue.items &&\n Object.keys(schemaValue.items).length === 0 &&\n definitionNames.has(rootDefinitionName)\n ) {\n schemaValue.items = {\n $ref: `#/definitions/${rootDefinitionName}`,\n };\n }\n\n if (\n schemaValue.type === 'array' &&\n schemaValue.items &&\n typeof schemaValue.items === 'object' &&\n '$ref' in schemaValue.items &&\n isBareDefinitionRef(\n (schemaValue.items as Record<string, unknown>).$ref\n )\n ) {\n const name = (schemaValue.items as Record<string, unknown>)\n .$ref as string;\n const ref = definitionRef(name);\n // Untyped rather than dangling when the target was never hoisted.\n schemaValue.items = ref ? { $ref: ref } : {};\n }\n\n if (isBareDefinitionRef(schemaValue.$ref)) {\n const ref = definitionRef(schemaValue.$ref as string);\n if (ref) schemaValue.$ref = ref;\n else delete schemaValue.$ref;\n }\n\n if (\n key === '$id' &&\n isBareDefinitionRef(value) &&\n currentPath !== `definitions.${value}.$id`\n ) {\n delete obj[key];\n continue;\n }\n\n traverse(value as Record<string, unknown>, currentPath);\n }\n }\n }\n\n traverse(schema);\n}\n\nexport function convertToJsonSchema(\n schema: TSchema,\n options: {\n $schema?: string;\n $id?: string;\n title?: string;\n description?: string;\n definitions?: Record<string, unknown>;\n } = {}\n): Record<string, unknown> {\n const {\n $schema = 'http://json-schema.org/draft-07/schema#',\n $id,\n title,\n description,\n definitions = {},\n } = options;\n\n const schemaJson = JSON.parse(JSON.stringify(schema));\n\n if (\n schemaJson.$id &&\n typeof schemaJson.$id === 'string' &&\n /^T\\d+$/.test(schemaJson.$id)\n ) {\n const recursiveId = schemaJson.$id;\n delete schemaJson.$id;\n replaceRefs(schemaJson, recursiveId, '#');\n }\n\n const extractedDefinitions: Record<string, unknown> = { ...definitions };\n\n function extractRecursiveSchemas(\n obj: Record<string, unknown>,\n path = ''\n ): void {\n if (typeof obj !== 'object' || obj === null) return;\n\n for (const [key, value] of Object.entries(obj)) {\n if (value && typeof value === 'object') {\n const schemaValue = value as Record<string, unknown>;\n\n if (schemaValue.$id && typeof schemaValue.$id === 'string') {\n const definitionName = schemaValue.$id;\n\n if (path !== `definitions.${definitionName}`) {\n const { $id: _id, ...schemaWithoutId } = schemaValue; // eslint-disable-line @typescript-eslint/no-unused-vars\n extractedDefinitions[definitionName] = schemaWithoutId;\n obj[key] = { $ref: `#/definitions/${definitionName}` };\n extractRecursiveSchemas(\n schemaWithoutId,\n `definitions.${definitionName}`\n );\n continue;\n }\n }\n\n extractRecursiveSchemas(\n value as Record<string, unknown>,\n path ? `${path}.${key}` : key\n );\n }\n }\n }\n\n extractRecursiveSchemas(schemaJson);\n\n const jsonSchema: Record<string, unknown> = { $schema };\n\n if ($id) jsonSchema.$id = $id;\n\n Object.assign(jsonSchema, schemaJson);\n\n jsonSchema.$schema = $schema;\n if ($id) jsonSchema.$id = $id;\n if (title !== undefined) jsonSchema.title = title;\n if (description !== undefined) jsonSchema.description = description;\n\n if (Object.keys(extractedDefinitions).length > 0) {\n jsonSchema.definitions = extractedDefinitions;\n }\n\n fixSchemaReferences(jsonSchema);\n restructureNameDiscriminatedUnions(jsonSchema);\n\n return jsonSchema;\n}\n\nexport function createComponentSchema(\n name: string,\n config: ComponentSchemaConfig,\n containerNames: string[],\n componentDefinitionSchema?: TSchema,\n // The definition the recursive children reference. Callers whose component\n // union is renderer-specific pass that renderer's name so the embedded\n // definition and the `$ref` pointing at it agree.\n rootDefinitionName = 'ComponentDefinition'\n): Record<string, unknown> {\n const componentStructure: Record<string, unknown> = {\n $schema: 'http://json-schema.org/draft-07/schema#',\n $id: `${name}.schema.json`,\n title: config.title,\n description: config.description,\n type: 'object',\n required: ['name', 'props'],\n properties: {\n name: {\n type: 'string',\n const: name,\n description: `Component name identifier (must be \"${name}\")`,\n },\n id: {\n type: 'string',\n description: 'Optional unique identifier for the component',\n },\n props: JSON.parse(JSON.stringify(config.schema)),\n },\n };\n\n if (containerNames.includes(name)) {\n (componentStructure.properties as Record<string, unknown>).children = {\n type: 'array',\n description: 'Children within this container',\n items: {\n $ref: `#/definitions/${rootDefinitionName}`,\n },\n };\n\n if (componentDefinitionSchema) {\n componentStructure.definitions = {\n [rootDefinitionName]: JSON.parse(\n JSON.stringify(componentDefinitionSchema)\n ),\n };\n }\n }\n\n fixSchemaReferences(componentStructure, rootDefinitionName);\n componentStructure.additionalProperties = false;\n\n return componentStructure;\n}\n\nexport async function exportSchemaToFile(\n schema: Record<string, unknown>,\n outputPath: string,\n options: { prettyPrint?: boolean } = {}\n): Promise<void> {\n const { prettyPrint = true } = options;\n const jsonSchema = prettyPrint\n ? JSON.stringify(schema, null, 2)\n : JSON.stringify(schema);\n const fs = await import('fs/promises');\n await fs.writeFile(outputPath, jsonSchema, 'utf-8');\n}\n\n/**\n * Create a TypeBox schema object for any component definition.\n * Works for both docx and pptx components.\n */\nexport function createComponentSchemaObject(\n component: ComponentDefinition,\n recursiveRef?: 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.',\n })\n ),\n };\n\n if (component.special?.hasSchemaField) {\n schema.$schema = Type.Optional(Type.String({ format: 'uri' }));\n }\n\n schema.props = component.propsSchema;\n\n if (component.hasChildren && recursiveRef) {\n schema.children = Type.Optional(Type.Array(recursiveRef));\n }\n\n return Type.Object(schema, { additionalProperties: false });\n}\n","/**\n * Canonical `if/then` restructuring for name-discriminated component unions.\n *\n * The generators export component unions as a flat `anyOf`. Schema-driven\n * editors (Monaco, VS Code — vscode-json-languageservice) resolve a partially\n * typed node against an `anyOf` by picking the single best-matching branch:\n * while typing `{ \"name\": | }`, every branch requiring `props` fails\n * validation, so its name const never reached autocomplete, and diagnostics\n * reported one arbitrary branch's complaints (\"Value must be \\\"heading\\\"\",\n * \"Missing property \\\"props\\\"\") instead of the real problem.\n *\n * This transform rewrites each such union — at JSON-Schema export time only,\n * the runtime TypeBox validators are untouched — into the standard\n * discriminated-union dispatch:\n *\n * {\n * type: \"object\",\n * required: [\"name\"],\n * properties: { name: { anyOf: [{ const, description }, …] } },\n * allOf: [\n * { if: { properties: { name: { const } }, required: [\"name\"] },\n * then: <branch> },\n * …\n * ]\n * }\n *\n * The accepted set of documents is exactly the same — `properties.name` is\n * the enum the branches already imply, and each `then` is the original\n * branch — but editors now behave deterministically:\n * - completing `name` offers every component, with its description\n * - an empty object reports only `Missing property \"name\"`\n * - a wrong name reports only `Value is not accepted. Valid values: …`\n * - a valid name activates exactly its branch for keys, props and errors\n *\n * Standard draft-07 keywords only, so ajv and every schema-aware editor\n * agree. Versioned plugin branches share a name; they stay grouped in a\n * small `anyOf` inside their `then`, containing best-match ambiguity to the\n * component's own versions.\n */\n\ninterface SchemaNode {\n [key: string]: unknown;\n}\n\ninterface NameConstEntry {\n const: string;\n type: 'string';\n description?: string;\n}\n\n/** A union branch shaped `{ properties: { name: { const: \"...\" } } }`. */\nfunction branchNameConst(branch: unknown): string | undefined {\n if (typeof branch !== 'object' || branch === null || Array.isArray(branch))\n return undefined;\n const name = ((branch as SchemaNode).properties as SchemaNode | undefined)\n ?.name as SchemaNode | undefined;\n return typeof name?.const === 'string' ? name.const : undefined;\n}\n\n/** True when the branch also discriminates on a `version` const (plugins). */\nfunction isVersionedBranch(branch: SchemaNode): boolean {\n const version = (branch.properties as SchemaNode | undefined)?.version as\n | SchemaNode\n | undefined;\n return typeof version?.const === 'string';\n}\n\nfunction branchRequiresName(branch: SchemaNode): boolean {\n return Array.isArray(branch.required) && branch.required.includes('name');\n}\n\n/** Group branches by their name const, preserving union order. */\nfunction groupByName(branches: SchemaNode[]): Map<string, SchemaNode[]> {\n const groups = new Map<string, SchemaNode[]>();\n for (const branch of branches) {\n const name = branchNameConst(branch)!;\n const group = groups.get(name);\n if (group) group.push(branch);\n else groups.set(name, [branch]);\n }\n return groups;\n}\n\nfunction nameEntry(name: string, group: SchemaNode[]): NameConstEntry {\n // Versioned plugins repeat the same name across version branches; the\n // un-versioned fallback carries the cleanest component description.\n const source =\n group.find(\n (b) => !isVersionedBranch(b) && typeof b.description === 'string'\n ) ?? group.find((b) => typeof b.description === 'string');\n return {\n const: name,\n type: 'string',\n ...(source ? { description: source.description as string } : {}),\n };\n}\n\n/**\n * Walk a JSON Schema and restructure every `anyOf` union whose branches are\n * all name-discriminated objects into the `if/then` dispatch shape above.\n *\n * Mutates in place. Conservative by design — a union is only restructured\n * when the rewrite is provably equivalent:\n * - every branch is an object with a `name` const that lists `name` as\n * required (unions containing `$ref` or free-form branches are left alone;\n * a `$ref`'s target union is restructured where it is defined)\n * - the node declares no `properties`, `allOf`, `if`, `required`,\n * `additionalProperties` or `type` of its own that the rewrite would have\n * to merge with\n * - at least two distinct names; single-name unions (a versioned plugin's\n * variants) validate and complete fine as a plain anyOf\n */\nexport function restructureNameDiscriminatedUnions(schema: unknown): void {\n const visited = new WeakSet<object>();\n\n function walk(node: unknown): void {\n if (typeof node !== 'object' || node === null) return;\n if (visited.has(node)) return;\n visited.add(node);\n\n if (Array.isArray(node)) {\n node.forEach(walk);\n return;\n }\n\n const obj = node as SchemaNode;\n const anyOf = obj.anyOf;\n const isCandidate =\n Array.isArray(anyOf) &&\n anyOf.length >= 2 &&\n anyOf.every(\n (b) => branchNameConst(b) !== undefined && branchRequiresName(b)\n ) &&\n obj.properties === undefined &&\n obj.allOf === undefined &&\n obj.if === undefined &&\n obj.required === undefined &&\n // A sibling `additionalProperties` evaluates against the node's own\n // (absent) `properties`; declaring `name` here would change what it\n // rejects, so such unions are left alone.\n obj.additionalProperties === undefined &&\n (obj.type === undefined || obj.type === 'object');\n // Dispatch needs at least two distinct names. Same-name groups (a\n // versioned plugin's variants) stay a plain anyOf — restructuring them\n // would recurse forever on the group it just created.\n const groups = isCandidate ? groupByName(anyOf as SchemaNode[]) : undefined;\n if (groups && groups.size >= 2) {\n obj.type = 'object';\n obj.required = ['name'];\n obj.properties = {\n name: {\n anyOf: [...groups.entries()].map(([name, group]) =>\n nameEntry(name, group)\n ),\n },\n };\n obj.allOf = [...groups.entries()].map(([name, group]) => ({\n if: {\n properties: { name: { const: name } },\n required: ['name'],\n },\n then: group.length === 1 ? group[0] : { anyOf: group },\n }));\n delete obj.anyOf;\n }\n\n for (const value of Object.values(obj)) walk(value);\n }\n\n walk(schema);\n}\n\n/**\n * Iterate the component branches of an exported union, whichever shape it is\n * in — the flat `anyOf` the generators emit, or the `if/then` dispatch this\n * module rewrites it into. For consumers that post-process branch objects\n * (description enhancement, theme-name injection, …).\n */\nexport function unionBranches(schema: unknown): SchemaNode[] {\n if (typeof schema !== 'object' || schema === null) return [];\n const obj = schema as SchemaNode;\n if (Array.isArray(obj.anyOf)) {\n return obj.anyOf.filter(\n (b): b is SchemaNode => typeof b === 'object' && b !== null\n );\n }\n if (Array.isArray(obj.allOf)) {\n return obj.allOf.flatMap((entry): SchemaNode[] => {\n const then = (entry as SchemaNode | null)?.then;\n if (typeof then !== 'object' || then === null) return [];\n const inner = (then as SchemaNode).anyOf;\n return Array.isArray(inner)\n ? inner.filter(\n (b): b is SchemaNode => typeof b === 'object' && b !== null\n )\n : [then as SchemaNode];\n });\n }\n return [];\n}\n"],"mappings":";AAAA,SAAS,YAAqB;;;ACmD9B,SAAS,gBAAgB,QAAqC;AAC5D,MAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,MAAM,QAAQ,MAAM;AACvE,WAAO;AACT,QAAM,OAAS,OAAsB,YACjC;AACJ,SAAO,OAAO,MAAM,UAAU,WAAW,KAAK,QAAQ;AACxD;AAGA,SAAS,kBAAkB,QAA6B;AACtD,QAAM,UAAW,OAAO,YAAuC;AAG/D,SAAO,OAAO,SAAS,UAAU;AACnC;AAEA,SAAS,mBAAmB,QAA6B;AACvD,SAAO,MAAM,QAAQ,OAAO,QAAQ,KAAK,OAAO,SAAS,SAAS,MAAM;AAC1E;AAGA,SAAS,YAAY,UAAmD;AACtE,QAAM,SAAS,oBAAI,IAA0B;AAC7C,aAAW,UAAU,UAAU;AAC7B,UAAM,OAAO,gBAAgB,MAAM;AACnC,UAAM,QAAQ,OAAO,IAAI,IAAI;AAC7B,QAAI,MAAO,OAAM,KAAK,MAAM;AAAA,QACvB,QAAO,IAAI,MAAM,CAAC,MAAM,CAAC;AAAA,EAChC;AACA,SAAO;AACT;AAEA,SAAS,UAAU,MAAc,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ZKD5BAMU.js";
37
+ import {
38
+ FeatureRequirementCollector,
39
+ RendererRegistry,
40
+ UnsupportedRendererFeatureError,
41
+ assertNever,
42
+ assertRendererSupports,
43
+ diagnoseUnsupportedFeatures,
44
+ partitionDiagnostics,
45
+ rendererError,
46
+ rendererWarning
47
+ } from "./chunk-JM5KTMNL.js";
37
48
  import {
38
49
  convertToJsonSchema,
39
50
  createComponentSchema,
@@ -42,7 +53,7 @@ import {
42
53
  fixSchemaReferences,
43
54
  restructureNameDiscriminatedUnions,
44
55
  unionBranches
45
- } from "./chunk-BS2BBPVA.js";
56
+ } from "./chunk-6TNT7DGC.js";
46
57
  import {
47
58
  FontFamilyNameSchema,
48
59
  FontRegistryEntrySchema,
@@ -51,17 +62,6 @@ import {
51
62
  SAFE_FONTS,
52
63
  isSafeFont
53
64
  } from "./chunk-6KUQYVPT.js";
54
- import {
55
- FeatureRequirementCollector,
56
- RendererRegistry,
57
- UnsupportedRendererFeatureError,
58
- assertNever,
59
- assertRendererSupports,
60
- diagnoseUnsupportedFeatures,
61
- partitionDiagnostics,
62
- rendererError,
63
- rendererWarning
64
- } from "./chunk-JM5KTMNL.js";
65
65
  import {
66
66
  compareSemver,
67
67
  isValidSemver,
@@ -4,7 +4,7 @@ import {
4
4
  createComponentSchemaObject,
5
5
  exportSchemaToFile,
6
6
  fixSchemaReferences
7
- } from "../chunk-BS2BBPVA.js";
7
+ } from "../chunk-6TNT7DGC.js";
8
8
  export {
9
9
  convertToJsonSchema,
10
10
  createComponentSchema,
@@ -454,7 +454,36 @@ interface PptxSlideContentComponentDescriptor<TName extends string = string, TPr
454
454
  readonly hasChildren: false;
455
455
  readonly category: 'content';
456
456
  readonly description: string;
457
+ /**
458
+ * Force `props` to stay required even though the props schema accepts `{}`.
459
+ *
460
+ * Only for components whose content requirement is real but inexpressible in
461
+ * a single TypeBox object — see `pptxComponentRequiresProps`.
462
+ */
463
+ readonly propsRequired?: boolean;
457
464
  }
465
+ /**
466
+ * Whether a PPTX component must carry a `props` key.
467
+ *
468
+ * The default answer is the props schema's own: a schema that accepts `{}`
469
+ * demands nothing, so the key adds nothing and may be omitted (this mirrors
470
+ * `demandsProps` in shared-docx). Two components override it, because their
471
+ * content requirement is a rule a single TypeBox object cannot state: `text`
472
+ * needs exactly one of `text`/`runs` and `image` exactly one of
473
+ * `path`/`base64`/`svg`, so both leave every field optional and are still
474
+ * unrenderable empty. Declaring it here rather than in each consumer is what
475
+ * keeps the published schema and the runtime validator asking for the same
476
+ * key — they both call this.
477
+ *
478
+ * The override is what the published schema has always said for both, so it is
479
+ * the runtime that moved to meet it. Reading the schema's own answer instead
480
+ * would have loosened the published contract on `image` — a change to what
481
+ * agents are told, made to fix a disagreement about what they are told.
482
+ */
483
+ declare function pptxComponentRequiresProps(component: {
484
+ readonly propsSchema: TSchema;
485
+ readonly propsRequired?: boolean;
486
+ }): boolean;
458
487
  /**
459
488
  * Single source of truth for PPTX leaf content, in public schema order.
460
489
  */
@@ -538,6 +567,7 @@ declare const PPTX_SLIDE_CONTENT_COMPONENTS: readonly [{
538
567
  }>;
539
568
  readonly hasChildren: false;
540
569
  readonly category: "content";
570
+ readonly propsRequired: true;
541
571
  readonly description: "Text element - displays text with formatting, positioning and styling options.";
542
572
  }, {
543
573
  readonly name: "image";
@@ -579,6 +609,7 @@ declare const PPTX_SLIDE_CONTENT_COMPONENTS: readonly [{
579
609
  }>;
580
610
  readonly hasChildren: false;
581
611
  readonly category: "content";
612
+ readonly propsRequired: true;
582
613
  readonly description: "Image element - displays images from file path, URL, or base64 data.";
583
614
  }, {
584
615
  readonly name: "shape";
@@ -914,7 +945,82 @@ declare const PptxSlideContentSchema: _sinclair_typebox.TUnion<[_sinclair_typebo
914
945
  rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
915
946
  }>>;
916
947
  style: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"title" | "subtitle" | "heading1" | "heading2" | "heading3" | "body" | "caption">[]>>;
917
- }>;
948
+ }> | _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
949
+ text: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
950
+ runs: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TObject<{
951
+ text: _sinclair_typebox.TString;
952
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
953
+ bold: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
954
+ fontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
955
+ italic: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
956
+ underline: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TObject<{
957
+ style: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"sng">, _sinclair_typebox.TLiteral<"dbl">, _sinclair_typebox.TLiteral<"dash">, _sinclair_typebox.TLiteral<"dotted">]>>;
958
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
959
+ }>]>>;
960
+ strike: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
961
+ fontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
962
+ fontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
963
+ superscript: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
964
+ subscript: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
965
+ charSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
966
+ breakLine: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
967
+ }>>>;
968
+ x: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
969
+ y: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
970
+ w: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
971
+ h: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
972
+ fontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
973
+ fontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
974
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
975
+ bold: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
976
+ fontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
977
+ italic: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
978
+ underline: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TObject<{
979
+ style: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"sng">, _sinclair_typebox.TLiteral<"dbl">, _sinclair_typebox.TLiteral<"dash">, _sinclair_typebox.TLiteral<"dotted">]>>;
980
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
981
+ }>]>>;
982
+ strike: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
983
+ language: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
984
+ align: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">]>>;
985
+ valign: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"top">, _sinclair_typebox.TLiteral<"middle">, _sinclair_typebox.TLiteral<"bottom">]>>;
986
+ breakLine: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
987
+ bullet: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TObject<{
988
+ type: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"bullet">, _sinclair_typebox.TLiteral<"number">]>>;
989
+ style: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
990
+ startAt: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
991
+ }>]>>;
992
+ margin: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TArray<_sinclair_typebox.TNumber>]>>;
993
+ rotate: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
994
+ shadow: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
995
+ type: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"outer">, _sinclair_typebox.TLiteral<"inner">]>>;
996
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TString, ...(_sinclair_typebox.TLiteral<"text" | "primary" | "secondary" | "accent" | "background" | "text2" | "background2" | "accent4" | "accent5" | "accent6"> | _sinclair_typebox.TLiteral<"accent1" | "accent2" | "accent3" | "tx1" | "tx2" | "bg1" | "bg2">)[]]>>;
997
+ blur: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
998
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
999
+ angle: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1000
+ opacity: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1001
+ }>>;
1002
+ fill: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1003
+ color: _sinclair_typebox.TString;
1004
+ transparency: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1005
+ }>>;
1006
+ hyperlink: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1007
+ url: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1008
+ slide: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1009
+ tooltip: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1010
+ }>>;
1011
+ lineSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1012
+ lineSpacingMultiple: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1013
+ charSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1014
+ paraSpaceBefore: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1015
+ paraSpaceAfter: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1016
+ grid: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1017
+ column: _sinclair_typebox.TNumber;
1018
+ row: _sinclair_typebox.TNumber;
1019
+ columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1020
+ rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1021
+ }>>;
1022
+ style: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"title" | "subtitle" | "heading1" | "heading2" | "heading3" | "body" | "caption">[]>>;
1023
+ }>>;
918
1024
  }>, _sinclair_typebox.TObject<{
919
1025
  name: _sinclair_typebox.TLiteral<"image">;
920
1026
  id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
@@ -954,7 +1060,42 @@ declare const PptxSlideContentSchema: _sinclair_typebox.TUnion<[_sinclair_typebo
954
1060
  columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
955
1061
  rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
956
1062
  }>>;
957
- }>;
1063
+ }> | _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1064
+ path: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1065
+ base64: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1066
+ svg: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1067
+ x: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1068
+ y: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1069
+ w: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1070
+ h: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1071
+ sizing: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1072
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"contain">, _sinclair_typebox.TLiteral<"cover">, _sinclair_typebox.TLiteral<"crop">]>;
1073
+ w: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1074
+ h: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1075
+ }>>;
1076
+ rotate: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1077
+ rounding: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1078
+ shadow: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1079
+ type: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"outer">, _sinclair_typebox.TLiteral<"inner">]>>;
1080
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TString, ...(_sinclair_typebox.TLiteral<"text" | "primary" | "secondary" | "accent" | "background" | "text2" | "background2" | "accent4" | "accent5" | "accent6"> | _sinclair_typebox.TLiteral<"accent1" | "accent2" | "accent3" | "tx1" | "tx2" | "bg1" | "bg2">)[]]>>;
1081
+ blur: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1082
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1083
+ angle: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1084
+ opacity: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1085
+ }>>;
1086
+ hyperlink: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1087
+ url: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1088
+ slide: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1089
+ tooltip: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1090
+ }>>;
1091
+ alt: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1092
+ grid: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1093
+ column: _sinclair_typebox.TNumber;
1094
+ row: _sinclair_typebox.TNumber;
1095
+ columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1096
+ rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1097
+ }>>;
1098
+ }>>;
958
1099
  }>, _sinclair_typebox.TObject<{
959
1100
  name: _sinclair_typebox.TLiteral<"shape">;
960
1101
  id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
@@ -1031,7 +1172,79 @@ declare const PptxSlideContentSchema: _sinclair_typebox.TUnion<[_sinclair_typebo
1031
1172
  rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1032
1173
  }>>;
1033
1174
  style: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"title" | "subtitle" | "heading1" | "heading2" | "heading3" | "body" | "caption">[]>>;
1034
- }>;
1175
+ }> | _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1176
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"rect">, _sinclair_typebox.TLiteral<"roundRect">, _sinclair_typebox.TLiteral<"ellipse">, _sinclair_typebox.TLiteral<"triangle">, _sinclair_typebox.TLiteral<"diamond">, _sinclair_typebox.TLiteral<"pentagon">, _sinclair_typebox.TLiteral<"hexagon">, _sinclair_typebox.TLiteral<"star5">, _sinclair_typebox.TLiteral<"star6">, _sinclair_typebox.TLiteral<"line">, _sinclair_typebox.TLiteral<"arc">, _sinclair_typebox.TLiteral<"pie">, _sinclair_typebox.TLiteral<"blockArc">, _sinclair_typebox.TLiteral<"chord">, _sinclair_typebox.TLiteral<"arrow">, _sinclair_typebox.TLiteral<"chevron">, _sinclair_typebox.TLiteral<"cloud">, _sinclair_typebox.TLiteral<"heart">, _sinclair_typebox.TLiteral<"lightning">]>;
1177
+ x: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1178
+ y: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1179
+ w: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1180
+ h: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1181
+ fill: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1182
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1183
+ transparency: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1184
+ gradient: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1185
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"linear">, _sinclair_typebox.TLiteral<"radial">]>;
1186
+ angle: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1187
+ stops: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
1188
+ color: _sinclair_typebox.TString;
1189
+ pos: _sinclair_typebox.TNumber;
1190
+ transparency: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1191
+ }>>;
1192
+ focus: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"topLeft">, _sinclair_typebox.TLiteral<"topRight">, _sinclair_typebox.TLiteral<"bottomLeft">, _sinclair_typebox.TLiteral<"bottomRight">]>>;
1193
+ }>>;
1194
+ pattern: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1195
+ preset: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"pct5" | "pct10" | "pct20" | "pct25" | "pct30" | "pct40" | "pct50" | "pct60" | "pct70" | "pct75" | "pct80" | "pct90" | "horz" | "vert" | "ltHorz" | "ltVert" | "dkHorz" | "dkVert" | "narHorz" | "narVert" | "dashHorz" | "dashVert" | "cross" | "dnDiag" | "upDiag" | "ltDnDiag" | "ltUpDiag" | "dkDnDiag" | "dkUpDiag" | "wdDnDiag" | "wdUpDiag" | "dashDnDiag" | "dashUpDiag" | "diagCross" | "smCheck" | "lgCheck" | "smGrid" | "lgGrid" | "dotGrid" | "smConfetti" | "lgConfetti" | "horzBrick" | "diagBrick" | "solidDmnd" | "openDmnd" | "dotDmnd" | "plaid" | "sphere" | "weave" | "divot" | "shingle" | "wave" | "trellis" | "zigZag">[]>;
1196
+ foreground: _sinclair_typebox.TString;
1197
+ background: _sinclair_typebox.TString;
1198
+ }>>;
1199
+ }>>;
1200
+ line: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1201
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1202
+ width: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1203
+ dashType: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"solid">, _sinclair_typebox.TLiteral<"dash">, _sinclair_typebox.TLiteral<"dot">, _sinclair_typebox.TLiteral<"dashDot">]>>;
1204
+ }>>;
1205
+ text: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
1206
+ text: _sinclair_typebox.TString;
1207
+ fontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1208
+ fontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1209
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1210
+ bold: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1211
+ fontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1212
+ italic: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1213
+ breakLine: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1214
+ spaceBefore: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1215
+ spaceAfter: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1216
+ charSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1217
+ }>>]>>;
1218
+ fontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1219
+ fontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1220
+ fontColor: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1221
+ charSpacing: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1222
+ bold: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1223
+ fontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1224
+ italic: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1225
+ align: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">]>>;
1226
+ valign: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"top">, _sinclair_typebox.TLiteral<"middle">, _sinclair_typebox.TLiteral<"bottom">]>>;
1227
+ rotate: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1228
+ angleRange: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TNumber>>;
1229
+ flipH: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1230
+ flipV: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1231
+ shadow: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1232
+ type: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"outer">, _sinclair_typebox.TLiteral<"inner">]>>;
1233
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TString, ...(_sinclair_typebox.TLiteral<"text" | "primary" | "secondary" | "accent" | "background" | "text2" | "background2" | "accent4" | "accent5" | "accent6"> | _sinclair_typebox.TLiteral<"accent1" | "accent2" | "accent3" | "tx1" | "tx2" | "bg1" | "bg2">)[]]>>;
1234
+ blur: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1235
+ offset: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1236
+ angle: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1237
+ opacity: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1238
+ }>>;
1239
+ rectRadius: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1240
+ grid: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1241
+ column: _sinclair_typebox.TNumber;
1242
+ row: _sinclair_typebox.TNumber;
1243
+ columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1244
+ rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1245
+ }>>;
1246
+ style: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"title" | "subtitle" | "heading1" | "heading2" | "heading3" | "body" | "caption">[]>>;
1247
+ }>>;
1035
1248
  }>, _sinclair_typebox.TObject<{
1036
1249
  name: _sinclair_typebox.TLiteral<"table">;
1037
1250
  id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
@@ -1080,7 +1293,51 @@ declare const PptxSlideContentSchema: _sinclair_typebox.TUnion<[_sinclair_typebo
1080
1293
  columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1081
1294
  rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1082
1295
  }>>;
1083
- }>;
1296
+ }> | _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1297
+ rows: _sinclair_typebox.TArray<_sinclair_typebox.TArray<_sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TObject<{
1298
+ text: _sinclair_typebox.TString;
1299
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1300
+ fill: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1301
+ fontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1302
+ fontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1303
+ bold: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1304
+ fontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1305
+ italic: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1306
+ align: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">]>>;
1307
+ valign: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"top">, _sinclair_typebox.TLiteral<"middle">, _sinclair_typebox.TLiteral<"bottom">]>>;
1308
+ colspan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1309
+ rowspan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1310
+ margin: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TArray<_sinclair_typebox.TNumber>]>>;
1311
+ }>]>>>;
1312
+ x: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1313
+ y: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1314
+ w: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1315
+ h: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1316
+ colW: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TArray<_sinclair_typebox.TNumber>]>>;
1317
+ rowH: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TArray<_sinclair_typebox.TNumber>]>>;
1318
+ border: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1319
+ type: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"solid">, _sinclair_typebox.TLiteral<"dash">, _sinclair_typebox.TLiteral<"dot">, _sinclair_typebox.TLiteral<"none">]>>;
1320
+ pt: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1321
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1322
+ }>>;
1323
+ fill: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1324
+ fontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1325
+ fontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1326
+ fontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1327
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1328
+ align: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"left">, _sinclair_typebox.TLiteral<"center">, _sinclair_typebox.TLiteral<"right">]>>;
1329
+ valign: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"top">, _sinclair_typebox.TLiteral<"middle">, _sinclair_typebox.TLiteral<"bottom">]>>;
1330
+ autoPage: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1331
+ autoPageRepeatHeader: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1332
+ margin: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TArray<_sinclair_typebox.TNumber>]>>;
1333
+ borderRadius: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1334
+ grid: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1335
+ column: _sinclair_typebox.TNumber;
1336
+ row: _sinclair_typebox.TNumber;
1337
+ columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1338
+ rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1339
+ }>>;
1340
+ }>>;
1084
1341
  }>, _sinclair_typebox.TObject<{
1085
1342
  name: _sinclair_typebox.TLiteral<"highcharts">;
1086
1343
  id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
@@ -1109,7 +1366,31 @@ declare const PptxSlideContentSchema: _sinclair_typebox.TUnion<[_sinclair_typebo
1109
1366
  columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1110
1367
  rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1111
1368
  }>>;
1112
- }>;
1369
+ }> | _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1370
+ options: _sinclair_typebox.TIntersect<[_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>, _sinclair_typebox.TObject<{
1371
+ chart: _sinclair_typebox.TObject<{
1372
+ width: _sinclair_typebox.TNumber;
1373
+ height: _sinclair_typebox.TNumber;
1374
+ }>;
1375
+ }>]>;
1376
+ scale: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1377
+ serverUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1378
+ resources: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1379
+ css: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1380
+ js: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1381
+ files: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TString>>;
1382
+ }>>;
1383
+ x: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1384
+ y: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1385
+ w: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1386
+ h: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1387
+ grid: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1388
+ column: _sinclair_typebox.TNumber;
1389
+ row: _sinclair_typebox.TNumber;
1390
+ columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1391
+ rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1392
+ }>>;
1393
+ }>>;
1113
1394
  }>, _sinclair_typebox.TObject<{
1114
1395
  name: _sinclair_typebox.TLiteral<"chart">;
1115
1396
  id: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
@@ -1199,8 +1480,93 @@ declare const PptxSlideContentSchema: _sinclair_typebox.TUnion<[_sinclair_typebo
1199
1480
  columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1200
1481
  rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1201
1482
  }>>;
1202
- }>;
1483
+ }> | _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1484
+ type: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"area">, _sinclair_typebox.TLiteral<"bar">, _sinclair_typebox.TLiteral<"bar3D">, _sinclair_typebox.TLiteral<"bubble">, _sinclair_typebox.TLiteral<"doughnut">, _sinclair_typebox.TLiteral<"line">, _sinclair_typebox.TLiteral<"pie">, _sinclair_typebox.TLiteral<"radar">, _sinclair_typebox.TLiteral<"scatter">]>;
1485
+ data: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
1486
+ name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1487
+ labels: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TString>>;
1488
+ values: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TNumber>>;
1489
+ sizes: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TNumber>>;
1490
+ }>>;
1491
+ showLegend: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1492
+ showTitle: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1493
+ showValue: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1494
+ showPercent: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1495
+ showLabel: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1496
+ showSerName: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1497
+ title: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1498
+ titleFontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1499
+ titleColor: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1500
+ titleFontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1501
+ titleFontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1502
+ chartColors: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TString>>;
1503
+ dataBorder: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1504
+ pt: _sinclair_typebox.TNumber;
1505
+ color: _sinclair_typebox.TString;
1506
+ }>>;
1507
+ legendPos: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"b">, _sinclair_typebox.TLiteral<"l">, _sinclair_typebox.TLiteral<"r">, _sinclair_typebox.TLiteral<"t">, _sinclair_typebox.TLiteral<"tr">]>>;
1508
+ legendFontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1509
+ legendFontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1510
+ legendFontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1511
+ legendColor: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1512
+ catAxisTitle: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1513
+ catAxisHidden: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1514
+ catAxisLabelRotate: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1515
+ catAxisLabelFontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1516
+ catAxisLabelColor: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1517
+ catAxisLabelFontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1518
+ catAxisLabelFontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1519
+ catGridLine: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1520
+ style: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"solid">, _sinclair_typebox.TLiteral<"dash">, _sinclair_typebox.TLiteral<"dot">, _sinclair_typebox.TLiteral<"none">]>>;
1521
+ size: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1522
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1523
+ }>>;
1524
+ valAxisTitle: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1525
+ valAxisHidden: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1526
+ valAxisMinVal: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1527
+ valAxisMaxVal: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1528
+ valAxisLabelFormatCode: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1529
+ valAxisMajorUnit: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1530
+ valAxisLabelColor: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1531
+ valAxisLabelFontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1532
+ valAxisLabelFontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1533
+ valAxisLabelFontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1534
+ valGridLine: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1535
+ style: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"solid">, _sinclair_typebox.TLiteral<"dash">, _sinclair_typebox.TLiteral<"dot">, _sinclair_typebox.TLiteral<"none">]>>;
1536
+ size: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1537
+ color: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1538
+ }>>;
1539
+ catAxisLineShow: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1540
+ valAxisLineShow: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1541
+ barDir: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"bar">, _sinclair_typebox.TLiteral<"col">]>>;
1542
+ barGrouping: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"clustered">, _sinclair_typebox.TLiteral<"stacked">, _sinclair_typebox.TLiteral<"percentStacked">]>>;
1543
+ barGapWidthPct: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1544
+ barOverlapPct: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1545
+ lineSmooth: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1546
+ lineDataSymbol: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"circle">, _sinclair_typebox.TLiteral<"dash">, _sinclair_typebox.TLiteral<"diamond">, _sinclair_typebox.TLiteral<"dot">, _sinclair_typebox.TLiteral<"none">, _sinclair_typebox.TLiteral<"square">, _sinclair_typebox.TLiteral<"triangle">]>>;
1547
+ lineSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1548
+ lineDataSymbolSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1549
+ firstSliceAng: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1550
+ holeSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1551
+ radarStyle: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"standard">, _sinclair_typebox.TLiteral<"marker">, _sinclair_typebox.TLiteral<"filled">]>>;
1552
+ dataLabelColor: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1553
+ dataLabelFontSize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1554
+ dataLabelFontFace: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
1555
+ dataLabelFontWeight: _sinclair_typebox.TOptional<_sinclair_typebox.TInteger>;
1556
+ dataLabelFontBold: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
1557
+ dataLabelPosition: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"b">, _sinclair_typebox.TLiteral<"bestFit">, _sinclair_typebox.TLiteral<"ctr">, _sinclair_typebox.TLiteral<"l">, _sinclair_typebox.TLiteral<"r">, _sinclair_typebox.TLiteral<"t">, _sinclair_typebox.TLiteral<"inEnd">, _sinclair_typebox.TLiteral<"outEnd">]>>;
1558
+ x: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1559
+ y: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1560
+ w: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1561
+ h: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString]>>;
1562
+ grid: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
1563
+ column: _sinclair_typebox.TNumber;
1564
+ row: _sinclair_typebox.TNumber;
1565
+ columnSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1566
+ rowSpan: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
1567
+ }>>;
1568
+ }>>;
1203
1569
  }>]>;
1204
1570
  type PptxSlideContent = Static<typeof PptxSlideContentSchema>;
1205
1571
 
1206
- export { ColorValueSchema, type GradientFill, GradientFillSchema, type GradientStop, GradientStopSchema, type GridPosition, GridPositionSchema, PATTERN_FILL_PRESETS, PPTX_SLIDE_CONTENT_COMPONENTS, type PatternFill, PatternFillSchema, type PptxAlignment, PptxAlignmentSchema, type PptxChartProps, PptxChartPropsSchema, type PptxHighchartsProps, PptxHighchartsPropsSchema, type PptxImageProps, PptxImagePropsSchema, type PptxSlideContent, type PptxSlideContentComponentDescriptor, type PptxSlideContentComponentName, PptxSlideContentSchema, type PptxTableProps, PptxTablePropsSchema, SEMANTIC_COLOR_ALIASES, SEMANTIC_COLOR_NAMES, STYLE_NAMES, type Shadow, ShadowSchema, type ShapeProps, ShapePropsSchema, type ShapeType, ShapeTypeSchema, type StyleName, StyleNameSchema, type TextProps, TextPropsSchema, type TextRun, TextRunSchema, type TextSegment, TextSegmentSchema, type VerticalAlignment, VerticalAlignmentSchema };
1572
+ export { ColorValueSchema, type GradientFill, GradientFillSchema, type GradientStop, GradientStopSchema, type GridPosition, GridPositionSchema, PATTERN_FILL_PRESETS, PPTX_SLIDE_CONTENT_COMPONENTS, type PatternFill, PatternFillSchema, type PptxAlignment, PptxAlignmentSchema, type PptxChartProps, PptxChartPropsSchema, type PptxHighchartsProps, PptxHighchartsPropsSchema, type PptxImageProps, PptxImagePropsSchema, type PptxSlideContent, type PptxSlideContentComponentDescriptor, type PptxSlideContentComponentName, PptxSlideContentSchema, type PptxTableProps, PptxTablePropsSchema, SEMANTIC_COLOR_ALIASES, SEMANTIC_COLOR_NAMES, STYLE_NAMES, type Shadow, ShadowSchema, type ShapeProps, ShapePropsSchema, type ShapeType, ShapeTypeSchema, type StyleName, StyleNameSchema, type TextProps, TextPropsSchema, type TextRun, TextRunSchema, type TextSegment, TextSegmentSchema, type VerticalAlignment, VerticalAlignmentSchema, pptxComponentRequiresProps };
@@ -1065,9 +1065,12 @@ var PptxHighchartsPropsSchema = Type7.Object(
1065
1065
 
1066
1066
  // src/schemas/slide-content/chart.ts
1067
1067
  import { Type as Type8 } from "@sinclair/typebox";
1068
- var PositionValue = Type8.Union([
1069
- Type8.Number(),
1070
- Type8.String({ pattern: "^\\d+(\\.\\d+)?%$" })
1068
+ var positionValue = (inches, percent) => Type8.Union([
1069
+ Type8.Number({ description: inches }),
1070
+ Type8.String({
1071
+ pattern: "^\\d+(\\.\\d+)?%$",
1072
+ description: percent
1073
+ })
1071
1074
  ]);
1072
1075
  var ChartTypeSchema = Type8.Union(
1073
1076
  [
@@ -1087,10 +1090,14 @@ var ChartDataSeriesSchema = Type8.Object(
1087
1090
  {
1088
1091
  name: Type8.Optional(Type8.String({ description: "Series name" })),
1089
1092
  labels: Type8.Optional(
1090
- Type8.Array(Type8.String(), { description: "Category labels" })
1093
+ Type8.Array(Type8.String(), {
1094
+ description: "Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."
1095
+ })
1091
1096
  ),
1092
1097
  values: Type8.Optional(
1093
- Type8.Array(Type8.Number(), { description: "Data values" })
1098
+ Type8.Array(Type8.Number(), {
1099
+ description: "Data values, one per label. Needed on every series \u2014 see `labels`."
1100
+ })
1094
1101
  ),
1095
1102
  sizes: Type8.Optional(
1096
1103
  Type8.Array(Type8.Number(), {
@@ -1406,10 +1413,10 @@ var PptxChartPropsSchema = Type8.Object(
1406
1413
  )
1407
1414
  ),
1408
1415
  // Positioning
1409
- x: Type8.Optional(PositionValue),
1410
- y: Type8.Optional(PositionValue),
1411
- w: Type8.Optional(PositionValue),
1412
- h: Type8.Optional(PositionValue),
1416
+ x: Type8.Optional(positionValue("X position in inches", "X as percentage")),
1417
+ y: Type8.Optional(positionValue("Y position in inches", "Y as percentage")),
1418
+ w: Type8.Optional(positionValue("Width in inches", "Width as percentage")),
1419
+ h: Type8.Optional(positionValue("Height in inches", "Height as percentage")),
1413
1420
  grid: Type8.Optional(GridPositionSchema)
1414
1421
  },
1415
1422
  {
@@ -1419,12 +1426,20 @@ var PptxChartPropsSchema = Type8.Object(
1419
1426
  );
1420
1427
 
1421
1428
  // src/schemas/slide-content.ts
1429
+ function pptxComponentRequiresProps(component) {
1430
+ if (component.propsRequired !== void 0) return component.propsRequired;
1431
+ const schema = component.propsSchema;
1432
+ return schema.type !== "object" || (schema.required?.length ?? 0) > 0;
1433
+ }
1422
1434
  var PPTX_SLIDE_CONTENT_COMPONENTS = [
1423
1435
  {
1424
1436
  name: "text",
1425
1437
  propsSchema: TextPropsSchema,
1426
1438
  hasChildren: false,
1427
1439
  category: "content",
1440
+ // `text` XOR `runs`: both optional in the schema, one of them mandatory in
1441
+ // fact (validation/text-content-conflicts.ts rejects neither and both).
1442
+ propsRequired: true,
1428
1443
  description: "Text element - displays text with formatting, positioning and styling options."
1429
1444
  },
1430
1445
  {
@@ -1432,6 +1447,15 @@ var PPTX_SLIDE_CONTENT_COMPONENTS = [
1432
1447
  propsSchema: PptxImagePropsSchema,
1433
1448
  hasChildren: false,
1434
1449
  category: "content",
1450
+ // One of `path`/`base64`/`svg`, so same shape as `text`: a source is
1451
+ // mandatory in fact and optional in the schema. Unlike `text` this is only
1452
+ // half enforced — the missing key is caught, an empty props object is not,
1453
+ // because `image` has no analogue of validation/text-content-conflicts.ts
1454
+ // and a sourceless image is an IMAGE_NO_SOURCE warning at generation, not
1455
+ // an error. The flag is still not the guess: `image` has required `props`
1456
+ // in the published schema since it was first generated, so dropping it
1457
+ // here would loosen that contract rather than tighten the runtime.
1458
+ propsRequired: true,
1435
1459
  description: "Image element - displays images from file path, URL, or base64 data."
1436
1460
  },
1437
1461
  {
@@ -1474,7 +1498,7 @@ function createSlideContentComponentSchema(component) {
1474
1498
  description: "When false, this component is filtered out and not rendered. Defaults to true."
1475
1499
  })
1476
1500
  ),
1477
- props: component.propsSchema
1501
+ props: pptxComponentRequiresProps(component) ? component.propsSchema : Type9.Optional(component.propsSchema)
1478
1502
  },
1479
1503
  { additionalProperties: false, description: component.description }
1480
1504
  );
@@ -1518,6 +1542,7 @@ export {
1518
1542
  TextPropsSchema,
1519
1543
  TextRunSchema,
1520
1544
  TextSegmentSchema,
1521
- VerticalAlignmentSchema
1545
+ VerticalAlignmentSchema,
1546
+ pptxComponentRequiresProps
1522
1547
  };
1523
1548
  //# sourceMappingURL=slide-content.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/slide-content.ts","../../src/schemas/slide-content/text.ts","../../src/schemas/slide-content/common.ts","../../src/schemas/slide-content/theme.ts","../../src/schemas/slide-content/image.ts","../../src/schemas/slide-content/shape.ts","../../src/schemas/slide-content/table.ts","../../src/schemas/slide-content/highcharts.ts","../../src/schemas/slide-content/chart.ts"],"sourcesContent":["/**\n * Canonical schemas for leaf content rendered on a PPTX slide.\n *\n * Kept in the format-agnostic shared package because DOCX visuals embed the\n * same content model without depending on the full PPTX schema package.\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\nimport { TextPropsSchema } from './slide-content/text';\nimport { PptxImagePropsSchema } from './slide-content/image';\nimport { ShapePropsSchema } from './slide-content/shape';\nimport { PptxTablePropsSchema } from './slide-content/table';\nimport { PptxHighchartsPropsSchema } from './slide-content/highcharts';\nimport { PptxChartPropsSchema } from './slide-content/chart';\n\nexport * from './slide-content/common';\nexport * from './slide-content/theme';\nexport * from './slide-content/text';\nexport * from './slide-content/image';\nexport * from './slide-content/shape';\nexport * from './slide-content/table';\nexport * from './slide-content/highcharts';\nexport * from './slide-content/chart';\n\nexport interface PptxSlideContentComponentDescriptor<\n TName extends string = string,\n TPropsSchema extends TSchema = TSchema,\n> {\n readonly name: TName;\n readonly propsSchema: TPropsSchema;\n readonly hasChildren: false;\n readonly category: 'content';\n readonly description: string;\n}\n\n/**\n * Single source of truth for PPTX leaf content, in public schema order.\n */\nexport const PPTX_SLIDE_CONTENT_COMPONENTS = [\n {\n name: 'text',\n propsSchema: TextPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Text element - displays text with formatting, positioning and styling options.',\n },\n {\n name: 'image',\n propsSchema: PptxImagePropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Image element - displays images from file path, URL, or base64 data.',\n },\n {\n name: 'shape',\n propsSchema: ShapePropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Shape element - draws geometric shapes with optional text, fill, and line styling.',\n },\n {\n name: 'table',\n propsSchema: PptxTablePropsSchema,\n hasChildren: false,\n category: 'content',\n description: 'Table element - displays tabular data with rows and columns.',\n },\n {\n name: 'highcharts',\n propsSchema: PptxHighchartsPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Highcharts element - renders charts via Highcharts Export Server.',\n },\n {\n name: 'chart',\n propsSchema: PptxChartPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Native PowerPoint chart - editable, scalable, no external server needed.',\n },\n] as const satisfies readonly PptxSlideContentComponentDescriptor[];\n\nexport type PptxSlideContentComponentName =\n (typeof PPTX_SLIDE_CONTENT_COMPONENTS)[number]['name'];\n\nfunction createSlideContentComponentSchema<\n const TName extends string,\n const TPropsSchema extends TSchema,\n>(component: PptxSlideContentComponentDescriptor<TName, TPropsSchema>) {\n return Type.Object(\n {\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.',\n })\n ),\n props: component.propsSchema,\n },\n { additionalProperties: false, description: component.description }\n );\n}\n\n/**\n * A single PPTX slide content element. The explicit id lets JSON-Schema export\n * hoist the union into one shared definition when DOCX visuals embed it.\n */\nexport const PptxSlideContentSchema = Type.Union(\n [\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[0]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[1]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[2]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[3]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[4]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[5]),\n ],\n {\n $id: 'PptxSlideContent',\n discriminator: { propertyName: 'name' },\n description:\n 'A single PPTX slide content element (text, image, shape, table, highcharts, or chart).',\n }\n);\n\nexport type PptxSlideContent = Static<typeof PptxSlideContentSchema>;\n","/**\n * Text Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FontFamilyNameSchema } from '../font-catalog';\nimport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n ShadowSchema,\n GridPositionSchema,\n} from './common';\nimport { StyleNameSchema } from './theme';\n\nexport const TextRunSchema = Type.Object(\n {\n text: Type.String({ description: 'Run text content' }),\n color: Type.Optional(\n Type.String({\n description: 'Run color (hex without # or semantic theme name)',\n })\n ),\n bold: Type.Optional(Type.Boolean({ description: 'Bold run' })),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Per-run weight (100–900). Overrides `bold` when set — renderer picks the closest embedded variant via CSS font-matching.',\n })\n ),\n italic: Type.Optional(Type.Boolean({ description: 'Italic run' })),\n underline: Type.Optional(\n Type.Union([\n Type.Boolean({ description: 'Simple underline toggle' }),\n Type.Object(\n {\n style: Type.Optional(\n Type.Union([\n Type.Literal('sng'),\n Type.Literal('dbl'),\n Type.Literal('dash'),\n Type.Literal('dotted'),\n ])\n ),\n color: Type.Optional(\n Type.String({ description: 'Underline color (hex)' })\n ),\n },\n { additionalProperties: false }\n ),\n ])\n ),\n strike: Type.Optional(Type.Boolean({ description: 'Strikethrough run' })),\n fontSize: Type.Optional(\n Type.Number({ minimum: 1, description: 'Run font size in points' })\n ),\n fontFace: Type.Optional(Type.String({ description: 'Run font family' })),\n superscript: Type.Optional(\n Type.Boolean({ description: 'Render run as superscript' })\n ),\n subscript: Type.Optional(\n Type.Boolean({ description: 'Render run as subscript' })\n ),\n charSpacing: Type.Optional(\n Type.Number({ description: 'Character spacing in points' })\n ),\n breakLine: Type.Optional(\n Type.Boolean({ description: 'Insert line break after this run' })\n ),\n },\n {\n description:\n 'A styled text run. Run options override component-level defaults.',\n additionalProperties: false,\n }\n);\n\nexport type TextRun = Static<typeof TextRunSchema>;\n\nexport const TextPropsSchema = Type.Object(\n {\n text: Type.Optional(\n Type.String({\n description:\n 'Text content to display. Mutually exclusive with `runs` — set exactly one of the two.',\n })\n ),\n runs: Type.Optional(\n Type.Array(TextRunSchema, {\n minItems: 1,\n description:\n 'Rich text runs with per-run styling, rendered as one text block. Mutually exclusive with `text` — set exactly one of the two. Component-level props (align, valign, fill, lineSpacing, position…) still apply to the whole block.',\n })\n ),\n x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n fontSize: Type.Optional(\n Type.Number({ minimum: 1, description: 'Font size in points' })\n ),\n fontFace: Type.Optional(FontFamilyNameSchema),\n color: Type.Optional(\n Type.String({ description: 'Text color (hex without #, e.g., \"FF0000\")' })\n ),\n bold: Type.Optional(Type.Boolean({ description: 'Bold text' })),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Per-run weight (100–900). Renderer picks the closest embedded variant via CSS font-matching and references it through a synthetic family alias. Overrides `bold` when set.',\n })\n ),\n italic: Type.Optional(Type.Boolean({ description: 'Italic text' })),\n underline: Type.Optional(\n Type.Union([\n Type.Boolean({ description: 'Simple underline toggle' }),\n Type.Object(\n {\n style: Type.Optional(\n Type.Union([\n Type.Literal('sng'),\n Type.Literal('dbl'),\n Type.Literal('dash'),\n Type.Literal('dotted'),\n ])\n ),\n color: Type.Optional(\n Type.String({ description: 'Underline color (hex)' })\n ),\n },\n { additionalProperties: false }\n ),\n ])\n ),\n strike: Type.Optional(Type.Boolean({ description: 'Strikethrough text' })),\n language: Type.Optional(\n Type.String({\n pattern: '^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$',\n description:\n 'Language tag (BCP-47, e.g. \"en-US\", \"fr-FR\") for spell-checking this text. Overrides the presentation default.',\n examples: ['en-US', 'fr-FR', 'de-DE', 'it-IT', 'es-ES'],\n })\n ),\n align: Type.Optional(PptxAlignmentSchema),\n valign: Type.Optional(VerticalAlignmentSchema),\n breakLine: Type.Optional(\n Type.Boolean({ description: 'Add line break after text' })\n ),\n bullet: Type.Optional(\n Type.Union([\n Type.Boolean({ description: 'Enable default bullet' }),\n Type.Object(\n {\n type: Type.Optional(\n Type.Union([Type.Literal('bullet'), Type.Literal('number')])\n ),\n style: Type.Optional(\n Type.String({ description: 'Bullet character or style' })\n ),\n startAt: Type.Optional(\n Type.Number({ description: 'Starting number for numbered lists' })\n ),\n },\n { additionalProperties: false }\n ),\n ])\n ),\n margin: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Margin in points (all sides)' }),\n Type.Array(Type.Number(), {\n description: 'Margins as [top, right, bottom, left] in points',\n minItems: 4,\n maxItems: 4,\n }),\n ])\n ),\n rotate: Type.Optional(\n Type.Number({ description: 'Rotation angle in degrees' })\n ),\n shadow: Type.Optional(ShadowSchema),\n fill: Type.Optional(\n Type.Object(\n {\n color: Type.String({ description: 'Fill color (hex without #)' }),\n transparency: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Fill transparency (0-100)',\n })\n ),\n },\n { additionalProperties: false }\n )\n ),\n hyperlink: Type.Optional(\n Type.Object(\n {\n url: Type.Optional(Type.String({ description: 'Hyperlink URL' })),\n slide: Type.Optional(\n Type.Number({ description: 'Slide number to link to' })\n ),\n tooltip: Type.Optional(\n Type.String({ description: 'Hyperlink tooltip' })\n ),\n },\n { additionalProperties: false }\n )\n ),\n lineSpacing: Type.Optional(\n Type.Number({ description: 'Line spacing in points' })\n ),\n lineSpacingMultiple: Type.Optional(\n Type.Number({\n minimum: 0.1,\n maximum: 10,\n description:\n 'Line spacing as a multiple of the font size (e.g. 0.9 = 90%). Takes precedence over lineSpacing.',\n })\n ),\n charSpacing: Type.Optional(\n Type.Number({\n description:\n 'Character spacing in points (positive = wider, negative = tighter)',\n })\n ),\n paraSpaceBefore: Type.Optional(\n Type.Number({ description: 'Space before paragraph in points' })\n ),\n paraSpaceAfter: Type.Optional(\n Type.Number({ description: 'Space after paragraph in points' })\n ),\n grid: Type.Optional(GridPositionSchema),\n style: Type.Optional(StyleNameSchema),\n },\n {\n description: 'Text component props',\n additionalProperties: false,\n }\n);\n\nexport type TextProps = Static<typeof TextPropsSchema>;\n","/**\n * Common Types and Schemas for PPTX Components\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { ColorValueSchema } from './theme';\n\nexport const PptxAlignmentSchema = Type.Union(\n [Type.Literal('left'), Type.Literal('center'), Type.Literal('right')],\n { description: 'Horizontal alignment options' }\n);\n\nexport const VerticalAlignmentSchema = Type.Union(\n [Type.Literal('top'), Type.Literal('middle'), Type.Literal('bottom')],\n { description: 'Vertical alignment options' }\n);\n\nexport const ShadowSchema = Type.Object(\n {\n type: Type.Optional(\n Type.Union([Type.Literal('outer'), Type.Literal('inner')], {\n description: 'Shadow type',\n })\n ),\n color: Type.Optional(ColorValueSchema),\n blur: Type.Optional(\n Type.Number({ description: 'Shadow blur radius in points' })\n ),\n offset: Type.Optional(\n Type.Number({ description: 'Shadow offset in points' })\n ),\n angle: Type.Optional(\n Type.Number({ description: 'Shadow angle in degrees' })\n ),\n opacity: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 1,\n description: 'Shadow opacity (0-1)',\n })\n ),\n },\n {\n description: 'Shadow configuration',\n additionalProperties: false,\n }\n);\n\nexport const GridPositionSchema = Type.Object(\n {\n column: Type.Number({\n minimum: 0,\n description: 'Starting column (0-indexed)',\n }),\n row: Type.Number({ minimum: 0, description: 'Starting row (0-indexed)' }),\n columnSpan: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Number of columns to span (default: 1)',\n })\n ),\n rowSpan: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Number of rows to span (default: 1)',\n })\n ),\n },\n { additionalProperties: false, description: 'Grid-based positioning' }\n);\n\nexport type GridPosition = Static<typeof GridPositionSchema>;\n\n// ============================================================================\n// TypeScript Types\n// ============================================================================\n\nexport type PptxAlignment = Static<typeof PptxAlignmentSchema>;\nexport type VerticalAlignment = Static<typeof VerticalAlignmentSchema>;\nexport type Shadow = Static<typeof ShadowSchema>;\n","/**\n * Theme primitives shared by PPTX slide content embedded across formats.\n */\n\nimport { Type } from '@sinclair/typebox';\n\nconst HexColorSchema = Type.String({\n pattern: '^#?[0-9A-Fa-f]{6}$',\n description: 'Hex color (e.g. #FF0000)',\n});\n\nexport const SEMANTIC_COLOR_NAMES = [\n 'primary',\n 'secondary',\n 'accent',\n 'background',\n 'text',\n 'text2',\n 'background2',\n 'accent4',\n 'accent5',\n 'accent6',\n] as const;\n\n/** PowerPoint XML aliases that resolve to canonical semantic names at runtime */\nexport const SEMANTIC_COLOR_ALIASES = [\n 'accent1',\n 'accent2',\n 'accent3',\n 'tx1',\n 'tx2',\n 'bg1',\n 'bg2',\n] as const;\n\nexport const ColorValueSchema = Type.Union(\n [\n HexColorSchema,\n ...SEMANTIC_COLOR_NAMES.map((name) => Type.Literal(name)),\n ...SEMANTIC_COLOR_ALIASES.map((name) => Type.Literal(name)),\n ],\n { description: 'Hex color or semantic theme color name' }\n);\n\nexport const STYLE_NAMES = [\n 'title',\n 'subtitle',\n 'heading1',\n 'heading2',\n 'heading3',\n 'body',\n 'caption',\n] as const;\n\nexport const StyleNameSchema = Type.Union(\n STYLE_NAMES.map((name) => Type.Literal(name)),\n { description: 'Predefined style name' }\n);\n\nexport type StyleName = (typeof STYLE_NAMES)[number];\n","/**\n * Image Component Schema (PPTX)\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { ShadowSchema, GridPositionSchema } from './common';\n\nexport const PptxImagePropsSchema = Type.Object(\n {\n path: Type.Optional(\n Type.String({\n description:\n 'Image file path or URL (mutually exclusive with base64 and svg)',\n })\n ),\n base64: Type.Optional(\n Type.String({\n description:\n 'Base64-encoded image data in data URI format (mutually exclusive with path and svg)',\n })\n ),\n svg: Type.Optional(\n Type.String({\n description:\n 'Raw inline SVG markup, e.g. \"<svg xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"0 0 24 24\\\\\">...</svg>\" (mutually exclusive with path and base64). Wrapped into an image/svg+xml data URI and embedded as a vector (PowerPoint 2016+); intrinsic size taken from the SVG viewBox/width/height when w/h omitted.',\n })\n ),\n x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n sizing: Type.Optional(\n Type.Object(\n {\n type: Type.Union(\n [\n Type.Literal('contain'),\n Type.Literal('cover'),\n Type.Literal('crop'),\n ],\n { description: 'Image sizing strategy' }\n ),\n w: Type.Optional(\n Type.Number({ description: 'Target width in inches' })\n ),\n h: Type.Optional(\n Type.Number({ description: 'Target height in inches' })\n ),\n },\n { description: 'Image sizing options', additionalProperties: false }\n )\n ),\n rotate: Type.Optional(\n Type.Number({ description: 'Rotation angle in degrees' })\n ),\n rounding: Type.Optional(\n Type.Boolean({ description: 'Apply rounded corners to image' })\n ),\n shadow: Type.Optional(ShadowSchema),\n hyperlink: Type.Optional(\n Type.Object(\n {\n url: Type.Optional(Type.String({ description: 'Hyperlink URL' })),\n slide: Type.Optional(\n Type.Number({ description: 'Slide number to link to' })\n ),\n tooltip: Type.Optional(\n Type.String({ description: 'Hyperlink tooltip' })\n ),\n },\n { additionalProperties: false }\n )\n ),\n alt: Type.Optional(\n Type.String({ description: 'Alternative text for accessibility' })\n ),\n grid: Type.Optional(GridPositionSchema),\n },\n {\n description: 'PPTX image component props',\n additionalProperties: false,\n }\n);\n\nexport type PptxImageProps = Static<typeof PptxImagePropsSchema>;\n","/**\n * Shape Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n ShadowSchema,\n GridPositionSchema,\n} from './common';\nimport { StyleNameSchema } from './theme';\n\nexport const ShapeTypeSchema = Type.Union(\n [\n Type.Literal('rect'),\n Type.Literal('roundRect'),\n Type.Literal('ellipse'),\n Type.Literal('triangle'),\n Type.Literal('diamond'),\n Type.Literal('pentagon'),\n Type.Literal('hexagon'),\n Type.Literal('star5'),\n Type.Literal('star6'),\n Type.Literal('line'),\n Type.Literal('arc'),\n Type.Literal('pie'),\n Type.Literal('blockArc'),\n Type.Literal('chord'),\n Type.Literal('arrow'),\n Type.Literal('chevron'),\n Type.Literal('cloud'),\n Type.Literal('heart'),\n Type.Literal('lightning'),\n ],\n { description: 'Shape type' }\n);\n\nexport const TextSegmentSchema = Type.Object(\n {\n text: Type.String(),\n fontSize: Type.Optional(Type.Number({ minimum: 1 })),\n fontFace: Type.Optional(Type.String()),\n color: Type.Optional(\n Type.String({\n description: 'Segment color (hex without # or semantic name)',\n })\n ),\n bold: Type.Optional(Type.Boolean()),\n fontWeight: Type.Optional(Type.Integer({ minimum: 100, maximum: 900 })),\n italic: Type.Optional(Type.Boolean()),\n breakLine: Type.Optional(\n Type.Boolean({ description: 'Insert line break after this segment' })\n ),\n spaceBefore: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Space before paragraph in points',\n })\n ),\n spaceAfter: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Space after paragraph in points',\n })\n ),\n charSpacing: Type.Optional(\n Type.Number({ description: 'Character spacing in points' })\n ),\n },\n { additionalProperties: false }\n);\n\nexport type TextSegment = Static<typeof TextSegmentSchema>;\n\n/**\n * OOXML `a:pattFill` preset names (ST_PresetPatternVal).\n */\nexport const PATTERN_FILL_PRESETS = [\n 'pct5',\n 'pct10',\n 'pct20',\n 'pct25',\n 'pct30',\n 'pct40',\n 'pct50',\n 'pct60',\n 'pct70',\n 'pct75',\n 'pct80',\n 'pct90',\n 'horz',\n 'vert',\n 'ltHorz',\n 'ltVert',\n 'dkHorz',\n 'dkVert',\n 'narHorz',\n 'narVert',\n 'dashHorz',\n 'dashVert',\n 'cross',\n 'dnDiag',\n 'upDiag',\n 'ltDnDiag',\n 'ltUpDiag',\n 'dkDnDiag',\n 'dkUpDiag',\n 'wdDnDiag',\n 'wdUpDiag',\n 'dashDnDiag',\n 'dashUpDiag',\n 'diagCross',\n 'smCheck',\n 'lgCheck',\n 'smGrid',\n 'lgGrid',\n 'dotGrid',\n 'smConfetti',\n 'lgConfetti',\n 'horzBrick',\n 'diagBrick',\n 'solidDmnd',\n 'openDmnd',\n 'dotDmnd',\n 'plaid',\n 'sphere',\n 'weave',\n 'divot',\n 'shingle',\n 'wave',\n 'trellis',\n 'zigZag',\n] as const;\n\nexport const GradientStopSchema = Type.Object(\n {\n color: Type.String({\n description: 'Stop color (hex without # or semantic theme name)',\n }),\n pos: Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Stop position along the gradient (0-100)',\n }),\n transparency: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Stop transparency (0-100)',\n })\n ),\n },\n { additionalProperties: false, description: 'Gradient color stop' }\n);\n\nexport const GradientFillSchema = Type.Object(\n {\n type: Type.Union([Type.Literal('linear'), Type.Literal('radial')], {\n description: 'Gradient type',\n }),\n angle: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 360,\n description:\n 'Gradient angle in degrees for linear gradients (0 = left→right, 90 = top→bottom). Default: 0.',\n })\n ),\n stops: Type.Array(GradientStopSchema, {\n minItems: 2,\n description: 'Gradient color stops (at least 2)',\n }),\n focus: Type.Optional(\n Type.Union(\n [\n Type.Literal('center'),\n Type.Literal('topLeft'),\n Type.Literal('topRight'),\n Type.Literal('bottomLeft'),\n Type.Literal('bottomRight'),\n ],\n {\n description: 'Focus point for radial gradients (default: \"center\")',\n }\n )\n ),\n },\n { additionalProperties: false, description: 'Gradient fill configuration' }\n);\n\nexport const PatternFillSchema = Type.Object(\n {\n preset: Type.Union(\n PATTERN_FILL_PRESETS.map((p) => Type.Literal(p)),\n { description: 'OOXML pattern preset name (a:pattFill prst value)' }\n ),\n foreground: Type.String({\n description: 'Pattern foreground color (hex without # or semantic name)',\n }),\n background: Type.String({\n description: 'Pattern background color (hex without # or semantic name)',\n }),\n },\n { additionalProperties: false, description: 'Pattern fill configuration' }\n);\n\nexport type GradientStop = Static<typeof GradientStopSchema>;\nexport type GradientFill = Static<typeof GradientFillSchema>;\nexport type PatternFill = Static<typeof PatternFillSchema>;\n\nexport const ShapePropsSchema = Type.Object(\n {\n type: ShapeTypeSchema,\n x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n fill: Type.Optional(\n Type.Object(\n {\n color: Type.Optional(\n Type.String({ description: 'Fill color (hex without #)' })\n ),\n transparency: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Fill transparency (0-100)',\n })\n ),\n gradient: Type.Optional(GradientFillSchema),\n pattern: Type.Optional(PatternFillSchema),\n },\n { additionalProperties: false }\n )\n ),\n line: Type.Optional(\n Type.Object(\n {\n color: Type.Optional(\n Type.String({ description: 'Line color (hex without #)' })\n ),\n width: Type.Optional(\n Type.Number({ minimum: 0, description: 'Line width in points' })\n ),\n dashType: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dash'),\n Type.Literal('dot'),\n Type.Literal('dashDot'),\n ])\n ),\n },\n { additionalProperties: false }\n )\n ),\n text: Type.Optional(\n Type.Union(\n [\n Type.String({ description: 'Plain text' }),\n Type.Array(TextSegmentSchema, {\n description: 'Rich text segments with per-segment formatting',\n }),\n ],\n { description: 'Text content inside the shape' }\n )\n ),\n fontSize: Type.Optional(\n Type.Number({ minimum: 1, description: 'Font size for shape text' })\n ),\n fontFace: Type.Optional(\n Type.String({ description: 'Font family for shape text' })\n ),\n fontColor: Type.Optional(\n Type.String({ description: 'Font color for shape text (hex without #)' })\n ),\n charSpacing: Type.Optional(\n Type.Number({ description: 'Character spacing in points for shape text' })\n ),\n bold: Type.Optional(Type.Boolean({ description: 'Bold shape text' })),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description: 'Per-shape weight (100–900). Overrides `bold` when set.',\n })\n ),\n italic: Type.Optional(Type.Boolean({ description: 'Italic shape text' })),\n align: Type.Optional(PptxAlignmentSchema),\n valign: Type.Optional(VerticalAlignmentSchema),\n rotate: Type.Optional(\n Type.Number({ description: 'Rotation angle in degrees' })\n ),\n angleRange: Type.Optional(\n Type.Array(Type.Number(), {\n minItems: 2,\n maxItems: 2,\n description:\n 'Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)',\n })\n ),\n flipH: Type.Optional(\n Type.Boolean({ description: 'Flip shape horizontally' })\n ),\n flipV: Type.Optional(\n Type.Boolean({ description: 'Flip shape vertically' })\n ),\n shadow: Type.Optional(ShadowSchema),\n rectRadius: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Corner radius for roundRect shape in inches',\n })\n ),\n grid: Type.Optional(GridPositionSchema),\n style: Type.Optional(StyleNameSchema),\n },\n {\n description: 'Shape component props',\n additionalProperties: false,\n }\n);\n\nexport type ShapeType = Static<typeof ShapeTypeSchema>;\nexport type ShapeProps = Static<typeof ShapePropsSchema>;\n","/**\n * Table Component Schema (PPTX)\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n GridPositionSchema,\n} from './common';\n\nconst PptxTableCellSchema = Type.Union([\n Type.String({ description: 'Simple text cell' }),\n Type.Object(\n {\n text: Type.String({ description: 'Cell text content' }),\n color: Type.Optional(\n Type.String({ description: 'Text color (hex without #)' })\n ),\n fill: Type.Optional(\n Type.String({ description: 'Cell background color (hex without #)' })\n ),\n fontSize: Type.Optional(\n Type.Number({ description: 'Font size in points' })\n ),\n fontFace: Type.Optional(Type.String({ description: 'Font family' })),\n bold: Type.Optional(Type.Boolean({ description: 'Bold text' })),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description: 'Per-cell weight (100–900). Overrides `bold` when set.',\n })\n ),\n italic: Type.Optional(Type.Boolean({ description: 'Italic text' })),\n align: Type.Optional(PptxAlignmentSchema),\n valign: Type.Optional(VerticalAlignmentSchema),\n colspan: Type.Optional(\n Type.Number({ minimum: 1, description: 'Column span' })\n ),\n rowspan: Type.Optional(\n Type.Number({ minimum: 1, description: 'Row span' })\n ),\n margin: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Margin in points (all sides)' }),\n Type.Array(Type.Number(), { minItems: 4, maxItems: 4 }),\n ])\n ),\n },\n { additionalProperties: false }\n ),\n]);\n\nexport const PptxTablePropsSchema = Type.Object(\n {\n rows: Type.Array(\n Type.Array(PptxTableCellSchema, { description: 'Row of cells' }),\n { description: 'Table rows (array of arrays)', minItems: 1 }\n ),\n x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n colW: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Uniform column width in inches' }),\n Type.Array(Type.Number(), {\n description: 'Individual column widths in inches',\n }),\n ])\n ),\n rowH: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Uniform row height in inches' }),\n Type.Array(Type.Number(), {\n description: 'Individual row heights in inches',\n }),\n ])\n ),\n border: Type.Optional(\n Type.Object(\n {\n type: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dash'),\n Type.Literal('dot'),\n Type.Literal('none'),\n ])\n ),\n pt: Type.Optional(\n Type.Number({ minimum: 0, description: 'Border width in points' })\n ),\n color: Type.Optional(\n Type.String({ description: 'Border color (hex without #)' })\n ),\n },\n { additionalProperties: false }\n )\n ),\n fill: Type.Optional(\n Type.String({ description: 'Table background color (hex without #)' })\n ),\n fontSize: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Default font size for all cells',\n })\n ),\n fontFace: Type.Optional(\n Type.String({ description: 'Default font family for all cells' })\n ),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Default weight for all cells (100–900). Same sub-family aliasing as the per-cell `fontWeight`; a cell that sets its own `fontWeight` or `bold` opts out.',\n })\n ),\n color: Type.Optional(\n Type.String({\n description: 'Default text color for all cells (hex without #)',\n })\n ),\n align: Type.Optional(PptxAlignmentSchema),\n valign: Type.Optional(VerticalAlignmentSchema),\n autoPage: Type.Optional(\n Type.Boolean({\n description:\n 'Auto-paginate table across multiple slides when content overflows',\n })\n ),\n autoPageRepeatHeader: Type.Optional(\n Type.Boolean({\n description: 'Repeat first row as header on each auto-paged slide',\n })\n ),\n margin: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Cell margin in points (all sides)' }),\n Type.Array(Type.Number(), { minItems: 4, maxItems: 4 }),\n ])\n ),\n borderRadius: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Rounded corner radius in inches. Renders a roundRect shape behind the table.',\n })\n ),\n grid: Type.Optional(GridPositionSchema),\n },\n {\n description: 'PPTX table component props',\n additionalProperties: false,\n }\n);\n\nexport type PptxTableProps = Static<typeof PptxTablePropsSchema>;\n","/**\n * Highcharts Component Schema (PPTX)\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { GridPositionSchema } from './common';\n\nexport const PptxHighchartsPropsSchema = Type.Object(\n {\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 scale: Type.Optional(Type.Number()),\n serverUrl: Type.Optional(\n Type.String({\n description:\n 'Highcharts Export Server URL (default: http://localhost:7801)',\n })\n ),\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 x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n grid: Type.Optional(GridPositionSchema),\n },\n {\n description: 'PPTX Highcharts component props',\n additionalProperties: false,\n }\n);\n\nexport type PptxHighchartsProps = Static<typeof PptxHighchartsPropsSchema>;\n","/**\n * Chart Component Schema (PPTX) — native PowerPoint charts via pptxgenjs\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { GridPositionSchema } from './common';\n\nconst PositionValue = Type.Union([\n Type.Number(),\n Type.String({ pattern: '^\\\\d+(\\\\.\\\\d+)?%$' }),\n]);\n\nconst ChartTypeSchema = Type.Union(\n [\n Type.Literal('area'),\n Type.Literal('bar'),\n Type.Literal('bar3D'),\n Type.Literal('bubble'),\n Type.Literal('doughnut'),\n Type.Literal('line'),\n Type.Literal('pie'),\n Type.Literal('radar'),\n Type.Literal('scatter'),\n ],\n { description: 'Chart type' }\n);\n\nconst ChartDataSeriesSchema = Type.Object(\n {\n name: Type.Optional(Type.String({ description: 'Series name' })),\n labels: Type.Optional(\n Type.Array(Type.String(), { description: 'Category labels' })\n ),\n values: Type.Optional(\n Type.Array(Type.Number(), { description: 'Data values' })\n ),\n sizes: Type.Optional(\n Type.Array(Type.Number(), {\n description: 'Bubble sizes (bubble charts only)',\n })\n ),\n },\n { additionalProperties: false }\n);\n\nconst ChartGridLineSchema = Type.Object(\n {\n style: Type.Optional(\n Type.Union(\n [\n Type.Literal('solid'),\n Type.Literal('dash'),\n Type.Literal('dot'),\n Type.Literal('none'),\n ],\n { description: 'Grid line style' }\n )\n ),\n size: Type.Optional(\n Type.Number({ minimum: 0, description: 'Grid line width (points)' })\n ),\n color: Type.Optional(\n Type.String({ description: 'Grid line color (hex or semantic)' })\n ),\n },\n { additionalProperties: false, description: 'Axis grid line styling' }\n);\n\nexport const PptxChartPropsSchema = Type.Object(\n {\n type: ChartTypeSchema,\n data: Type.Array(ChartDataSeriesSchema, {\n description: 'Chart data series',\n minItems: 1,\n }),\n\n // Display toggles\n showLegend: Type.Optional(\n Type.Boolean({ description: 'Show chart legend' })\n ),\n showTitle: Type.Optional(Type.Boolean({ description: 'Show chart title' })),\n showValue: Type.Optional(Type.Boolean({ description: 'Show data values' })),\n showPercent: Type.Optional(\n Type.Boolean({ description: 'Show percentages (pie/doughnut)' })\n ),\n showLabel: Type.Optional(\n Type.Boolean({ description: 'Show category labels on data points' })\n ),\n showSerName: Type.Optional(\n Type.Boolean({ description: 'Show series name on data points' })\n ),\n\n // Title\n title: Type.Optional(Type.String({ description: 'Chart title text' })),\n titleFontSize: Type.Optional(\n Type.Number({ description: 'Title font size (points)' })\n ),\n titleColor: Type.Optional(\n Type.String({ description: 'Title color (hex or semantic)' })\n ),\n titleFontFace: Type.Optional(\n Type.String({ description: 'Title font face' })\n ),\n titleFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Title weight (100–900). Rendered as a sub-family alias — see `dataLabelFontWeight`.',\n })\n ),\n\n // Chart colors\n chartColors: Type.Optional(\n Type.Array(Type.String(), {\n description:\n 'Series colors (hex or semantic theme names). Defaults to theme palette.',\n })\n ),\n\n // Data element border (bars/slices/areas)\n dataBorder: Type.Optional(\n Type.Object(\n {\n pt: Type.Number({\n minimum: 0,\n description: 'Border width (points)',\n }),\n color: Type.String({\n description: 'Border color (hex or semantic)',\n }),\n },\n {\n additionalProperties: false,\n description: 'Outline on data elements (bars, slices, areas)',\n }\n )\n ),\n\n // Legend\n legendPos: Type.Optional(\n Type.Union(\n [\n Type.Literal('b'),\n Type.Literal('l'),\n Type.Literal('r'),\n Type.Literal('t'),\n Type.Literal('tr'),\n ],\n { description: 'Legend position' }\n )\n ),\n legendFontSize: Type.Optional(\n Type.Number({ description: 'Legend font size' })\n ),\n legendFontFace: Type.Optional(\n Type.String({ description: 'Legend font face' })\n ),\n legendFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Legend weight (100–900). Rendered as a sub-family alias — see `dataLabelFontWeight`. PowerPoint gives the legend no bold toggle, so 400 and 700 both render Regular (700 warns).',\n })\n ),\n legendColor: Type.Optional(\n Type.String({ description: 'Legend text color' })\n ),\n\n // Category axis\n catAxisTitle: Type.Optional(\n Type.String({ description: 'Category axis title' })\n ),\n catAxisHidden: Type.Optional(\n Type.Boolean({ description: 'Hide category axis' })\n ),\n catAxisLabelRotate: Type.Optional(\n Type.Number({ description: 'Category axis label rotation (degrees)' })\n ),\n catAxisLabelFontSize: Type.Optional(\n Type.Number({ description: 'Category axis label font size' })\n ),\n catAxisLabelColor: Type.Optional(\n Type.String({\n description: 'Category axis label color (hex or semantic)',\n })\n ),\n catAxisLabelFontFace: Type.Optional(\n Type.String({ description: 'Category axis label font face' })\n ),\n catAxisLabelFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Category axis label weight (100–900). Rendered as a sub-family alias — see `dataLabelFontWeight`.',\n })\n ),\n catGridLine: Type.Optional(ChartGridLineSchema),\n\n // Value axis\n valAxisTitle: Type.Optional(\n Type.String({ description: 'Value axis title' })\n ),\n valAxisHidden: Type.Optional(\n Type.Boolean({ description: 'Hide value axis' })\n ),\n valAxisMinVal: Type.Optional(\n Type.Number({ description: 'Value axis minimum' })\n ),\n valAxisMaxVal: Type.Optional(\n Type.Number({ description: 'Value axis maximum' })\n ),\n valAxisLabelFormatCode: Type.Optional(\n Type.String({\n description: 'Value axis label format (e.g. \"$0.00\", \"#%\")',\n })\n ),\n valAxisMajorUnit: Type.Optional(\n Type.Number({ description: 'Value axis major unit / tick interval' })\n ),\n valAxisLabelColor: Type.Optional(\n Type.String({ description: 'Value axis label color (hex or semantic)' })\n ),\n valAxisLabelFontFace: Type.Optional(\n Type.String({ description: 'Value axis label font face' })\n ),\n valAxisLabelFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Value axis label weight (100–900). Rendered as a sub-family alias — see `dataLabelFontWeight`.',\n })\n ),\n valAxisLabelFontSize: Type.Optional(\n Type.Number({ description: 'Value axis label font size' })\n ),\n valGridLine: Type.Optional(ChartGridLineSchema),\n catAxisLineShow: Type.Optional(\n Type.Boolean({ description: 'Show the category axis line' })\n ),\n valAxisLineShow: Type.Optional(\n Type.Boolean({ description: 'Show the value axis line' })\n ),\n\n // Bar-specific\n barDir: Type.Optional(\n Type.Union([Type.Literal('bar'), Type.Literal('col')], {\n description:\n 'Bar direction: \"bar\" (horizontal) or \"col\" (vertical, default)',\n })\n ),\n barGrouping: Type.Optional(\n Type.Union(\n [\n Type.Literal('clustered'),\n Type.Literal('stacked'),\n Type.Literal('percentStacked'),\n ],\n { description: 'Bar grouping style' }\n )\n ),\n barGapWidthPct: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 500,\n description: 'Bar gap width (0-500%)',\n })\n ),\n barOverlapPct: Type.Optional(\n Type.Number({\n minimum: -100,\n maximum: 100,\n description:\n 'Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap.',\n })\n ),\n\n // Line-specific\n lineSmooth: Type.Optional(Type.Boolean({ description: 'Smooth lines' })),\n lineDataSymbol: Type.Optional(\n Type.Union(\n [\n Type.Literal('circle'),\n Type.Literal('dash'),\n Type.Literal('diamond'),\n Type.Literal('dot'),\n Type.Literal('none'),\n Type.Literal('square'),\n Type.Literal('triangle'),\n ],\n { description: 'Line data point marker symbol' }\n )\n ),\n lineSize: Type.Optional(\n Type.Number({ description: 'Line width (points)' })\n ),\n lineDataSymbolSize: Type.Optional(\n Type.Number({\n minimum: 2,\n maximum: 72,\n description: 'Line data point marker size (points)',\n })\n ),\n\n // Pie/doughnut-specific\n firstSliceAng: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 359,\n description: 'Angle of first slice (degrees)',\n })\n ),\n holeSize: Type.Optional(\n Type.Number({\n minimum: 10,\n maximum: 90,\n description: 'Doughnut hole size (%)',\n })\n ),\n\n // Radar-specific\n radarStyle: Type.Optional(\n Type.Union(\n [\n Type.Literal('standard'),\n Type.Literal('marker'),\n Type.Literal('filled'),\n ],\n { description: 'Radar chart style' }\n )\n ),\n\n // Data labels\n dataLabelColor: Type.Optional(\n Type.String({ description: 'Data label text color' })\n ),\n dataLabelFontSize: Type.Optional(\n Type.Number({ description: 'Data label font size' })\n ),\n dataLabelFontFace: Type.Optional(\n Type.String({ description: 'Data label font face' })\n ),\n dataLabelFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Data label weight (100–900); overrides `dataLabelFontBold`. PowerPoint chart labels carry no numeric weight, so a non-RIBBI weight renders by rewriting the font face to the matching sub-family (\"Inter\" at 300 → \"Inter Light\") — 400 and 700 stay on the family and use the bold toggle. Falls back to the theme body font when the sibling font face is unset.',\n })\n ),\n dataLabelFontBold: Type.Optional(\n Type.Boolean({ description: 'Bold data labels' })\n ),\n dataLabelPosition: Type.Optional(\n Type.Union(\n [\n Type.Literal('b'),\n Type.Literal('bestFit'),\n Type.Literal('ctr'),\n Type.Literal('l'),\n Type.Literal('r'),\n Type.Literal('t'),\n Type.Literal('inEnd'),\n Type.Literal('outEnd'),\n ],\n { description: 'Data label position' }\n )\n ),\n\n // Positioning\n x: Type.Optional(PositionValue),\n y: Type.Optional(PositionValue),\n w: Type.Optional(PositionValue),\n h: Type.Optional(PositionValue),\n grid: Type.Optional(GridPositionSchema),\n },\n {\n description: 'Native PowerPoint chart component props',\n additionalProperties: false,\n }\n);\n\nexport type PptxChartProps = Static<typeof PptxChartPropsSchema>;\n"],"mappings":";;;;;AAOA,SAAS,QAAAA,aAA6B;;;ACHtC,SAAS,QAAAC,aAAoB;;;ACA7B,SAAS,QAAAC,aAAoB;;;ACA7B,SAAS,YAAY;AAErB,IAAM,iBAAiB,KAAK,OAAO;AAAA,EACjC,SAAS;AAAA,EACT,aAAa;AACf,CAAC;AAEM,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,mBAAmB,KAAK;AAAA,EACnC;AAAA,IACE;AAAA,IACA,GAAG,qBAAqB,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC;AAAA,IACxD,GAAG,uB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V,aACE;AAAA,EACJ;AACF;AAKA,SAAS,kCAGP,WAAqE;AACrE,SAAOC,MAAK;AAAA,IACV;AAAA,MACE,MAAMA,MAAK,QAAQ,UAAU,IAAI;AAAA,MACjC,IAAIA,MAAK,SAASA,MAAK,OAAO,CAAC;AAAA,MAC/B,SAASA,MAAK;AAAA,QACZA,MAAK,QAAQ;AAAA,UACX,SAAS;AAAA,UACT,aACE;AAAA,QACJ,CAAC;AAAA,MACH;AAAA,MACA,OAAO,UAAU;AAAA,IACnB;AAAA,IACA,EAAE,sBAAsB,OAAO,aAAa,UAAU,YAAY;AAAA,EACpE;AACF;AAMO,IAAM,yBAAyBA,MAAK;AAAA,EACzC;AAAA,IACE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,eAAe,EAAE,cAAc,OAAO;AAAA,IACtC,aACE;AAAA,EACJ;AACF;","names":["Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type"]}
1
+ {"version":3,"sources":["../../src/schemas/slide-content.ts","../../src/schemas/slide-content/text.ts","../../src/schemas/slide-content/common.ts","../../src/schemas/slide-content/theme.ts","../../src/schemas/slide-content/image.ts","../../src/schemas/slide-content/shape.ts","../../src/schemas/slide-content/table.ts","../../src/schemas/slide-content/highcharts.ts","../../src/schemas/slide-content/chart.ts"],"sourcesContent":["/**\n * Canonical schemas for leaf content rendered on a PPTX slide.\n *\n * Kept in the format-agnostic shared package because DOCX visuals embed the\n * same content model without depending on the full PPTX schema package.\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\nimport { TextPropsSchema } from './slide-content/text';\nimport { PptxImagePropsSchema } from './slide-content/image';\nimport { ShapePropsSchema } from './slide-content/shape';\nimport { PptxTablePropsSchema } from './slide-content/table';\nimport { PptxHighchartsPropsSchema } from './slide-content/highcharts';\nimport { PptxChartPropsSchema } from './slide-content/chart';\n\nexport * from './slide-content/common';\nexport * from './slide-content/theme';\nexport * from './slide-content/text';\nexport * from './slide-content/image';\nexport * from './slide-content/shape';\nexport * from './slide-content/table';\nexport * from './slide-content/highcharts';\nexport * from './slide-content/chart';\n\nexport interface PptxSlideContentComponentDescriptor<\n TName extends string = string,\n TPropsSchema extends TSchema = TSchema,\n> {\n readonly name: TName;\n readonly propsSchema: TPropsSchema;\n readonly hasChildren: false;\n readonly category: 'content';\n readonly description: string;\n /**\n * Force `props` to stay required even though the props schema accepts `{}`.\n *\n * Only for components whose content requirement is real but inexpressible in\n * a single TypeBox object — see `pptxComponentRequiresProps`.\n */\n readonly propsRequired?: boolean;\n}\n\n/**\n * Whether a PPTX component must carry a `props` key.\n *\n * The default answer is the props schema's own: a schema that accepts `{}`\n * demands nothing, so the key adds nothing and may be omitted (this mirrors\n * `demandsProps` in shared-docx). Two components override it, because their\n * content requirement is a rule a single TypeBox object cannot state: `text`\n * needs exactly one of `text`/`runs` and `image` exactly one of\n * `path`/`base64`/`svg`, so both leave every field optional and are still\n * unrenderable empty. Declaring it here rather than in each consumer is what\n * keeps the published schema and the runtime validator asking for the same\n * key — they both call this.\n *\n * The override is what the published schema has always said for both, so it is\n * the runtime that moved to meet it. Reading the schema's own answer instead\n * would have loosened the published contract on `image` — a change to what\n * agents are told, made to fix a disagreement about what they are told.\n */\nexport function pptxComponentRequiresProps(component: {\n readonly propsSchema: TSchema;\n readonly propsRequired?: boolean;\n}): boolean {\n if (component.propsRequired !== undefined) return component.propsRequired;\n const schema = component.propsSchema as {\n type?: string;\n required?: readonly string[];\n };\n return schema.type !== 'object' || (schema.required?.length ?? 0) > 0;\n}\n\n/**\n * Single source of truth for PPTX leaf content, in public schema order.\n */\nexport const PPTX_SLIDE_CONTENT_COMPONENTS = [\n {\n name: 'text',\n propsSchema: TextPropsSchema,\n hasChildren: false,\n category: 'content',\n // `text` XOR `runs`: both optional in the schema, one of them mandatory in\n // fact (validation/text-content-conflicts.ts rejects neither and both).\n propsRequired: true,\n description:\n 'Text element - displays text with formatting, positioning and styling options.',\n },\n {\n name: 'image',\n propsSchema: PptxImagePropsSchema,\n hasChildren: false,\n category: 'content',\n // One of `path`/`base64`/`svg`, so same shape as `text`: a source is\n // mandatory in fact and optional in the schema. Unlike `text` this is only\n // half enforced — the missing key is caught, an empty props object is not,\n // because `image` has no analogue of validation/text-content-conflicts.ts\n // and a sourceless image is an IMAGE_NO_SOURCE warning at generation, not\n // an error. The flag is still not the guess: `image` has required `props`\n // in the published schema since it was first generated, so dropping it\n // here would loosen that contract rather than tighten the runtime.\n propsRequired: true,\n description:\n 'Image element - displays images from file path, URL, or base64 data.',\n },\n {\n name: 'shape',\n propsSchema: ShapePropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Shape element - draws geometric shapes with optional text, fill, and line styling.',\n },\n {\n name: 'table',\n propsSchema: PptxTablePropsSchema,\n hasChildren: false,\n category: 'content',\n description: 'Table element - displays tabular data with rows and columns.',\n },\n {\n name: 'highcharts',\n propsSchema: PptxHighchartsPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Highcharts element - renders charts via Highcharts Export Server.',\n },\n {\n name: 'chart',\n propsSchema: PptxChartPropsSchema,\n hasChildren: false,\n category: 'content',\n description:\n 'Native PowerPoint chart - editable, scalable, no external server needed.',\n },\n] as const satisfies readonly PptxSlideContentComponentDescriptor[];\n\nexport type PptxSlideContentComponentName =\n (typeof PPTX_SLIDE_CONTENT_COMPONENTS)[number]['name'];\n\nfunction createSlideContentComponentSchema<\n const TName extends string,\n const TPropsSchema extends TSchema,\n>(component: PptxSlideContentComponentDescriptor<TName, TPropsSchema>) {\n return Type.Object(\n {\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.',\n })\n ),\n props: pptxComponentRequiresProps(component)\n ? component.propsSchema\n : Type.Optional(component.propsSchema),\n },\n { additionalProperties: false, description: component.description }\n );\n}\n\n/**\n * A single PPTX slide content element. The explicit id lets JSON-Schema export\n * hoist the union into one shared definition when DOCX visuals embed it.\n */\nexport const PptxSlideContentSchema = Type.Union(\n [\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[0]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[1]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[2]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[3]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[4]),\n createSlideContentComponentSchema(PPTX_SLIDE_CONTENT_COMPONENTS[5]),\n ],\n {\n $id: 'PptxSlideContent',\n discriminator: { propertyName: 'name' },\n description:\n 'A single PPTX slide content element (text, image, shape, table, highcharts, or chart).',\n }\n);\n\nexport type PptxSlideContent = Static<typeof PptxSlideContentSchema>;\n","/**\n * Text Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FontFamilyNameSchema } from '../font-catalog';\nimport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n ShadowSchema,\n GridPositionSchema,\n} from './common';\nimport { StyleNameSchema } from './theme';\n\nexport const TextRunSchema = Type.Object(\n {\n text: Type.String({ description: 'Run text content' }),\n color: Type.Optional(\n Type.String({\n description: 'Run color (hex without # or semantic theme name)',\n })\n ),\n bold: Type.Optional(Type.Boolean({ description: 'Bold run' })),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Per-run weight (100–900). Overrides `bold` when set — renderer picks the closest embedded variant via CSS font-matching.',\n })\n ),\n italic: Type.Optional(Type.Boolean({ description: 'Italic run' })),\n underline: Type.Optional(\n Type.Union([\n Type.Boolean({ description: 'Simple underline toggle' }),\n Type.Object(\n {\n style: Type.Optional(\n Type.Union([\n Type.Literal('sng'),\n Type.Literal('dbl'),\n Type.Literal('dash'),\n Type.Literal('dotted'),\n ])\n ),\n color: Type.Optional(\n Type.String({ description: 'Underline color (hex)' })\n ),\n },\n { additionalProperties: false }\n ),\n ])\n ),\n strike: Type.Optional(Type.Boolean({ description: 'Strikethrough run' })),\n fontSize: Type.Optional(\n Type.Number({ minimum: 1, description: 'Run font size in points' })\n ),\n fontFace: Type.Optional(Type.String({ description: 'Run font family' })),\n superscript: Type.Optional(\n Type.Boolean({ description: 'Render run as superscript' })\n ),\n subscript: Type.Optional(\n Type.Boolean({ description: 'Render run as subscript' })\n ),\n charSpacing: Type.Optional(\n Type.Number({ description: 'Character spacing in points' })\n ),\n breakLine: Type.Optional(\n Type.Boolean({ description: 'Insert line break after this run' })\n ),\n },\n {\n description:\n 'A styled text run. Run options override component-level defaults.',\n additionalProperties: false,\n }\n);\n\nexport type TextRun = Static<typeof TextRunSchema>;\n\nexport const TextPropsSchema = Type.Object(\n {\n text: Type.Optional(\n Type.String({\n description:\n 'Text content to display. Mutually exclusive with `runs` — set exactly one of the two.',\n })\n ),\n runs: Type.Optional(\n Type.Array(TextRunSchema, {\n minItems: 1,\n description:\n 'Rich text runs with per-run styling, rendered as one text block. Mutually exclusive with `text` — set exactly one of the two. Component-level props (align, valign, fill, lineSpacing, position…) still apply to the whole block.',\n })\n ),\n x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n fontSize: Type.Optional(\n Type.Number({ minimum: 1, description: 'Font size in points' })\n ),\n fontFace: Type.Optional(FontFamilyNameSchema),\n color: Type.Optional(\n Type.String({ description: 'Text color (hex without #, e.g., \"FF0000\")' })\n ),\n bold: Type.Optional(Type.Boolean({ description: 'Bold text' })),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Per-run weight (100–900). Renderer picks the closest embedded variant via CSS font-matching and references it through a synthetic family alias. Overrides `bold` when set.',\n })\n ),\n italic: Type.Optional(Type.Boolean({ description: 'Italic text' })),\n underline: Type.Optional(\n Type.Union([\n Type.Boolean({ description: 'Simple underline toggle' }),\n Type.Object(\n {\n style: Type.Optional(\n Type.Union([\n Type.Literal('sng'),\n Type.Literal('dbl'),\n Type.Literal('dash'),\n Type.Literal('dotted'),\n ])\n ),\n color: Type.Optional(\n Type.String({ description: 'Underline color (hex)' })\n ),\n },\n { additionalProperties: false }\n ),\n ])\n ),\n strike: Type.Optional(Type.Boolean({ description: 'Strikethrough text' })),\n language: Type.Optional(\n Type.String({\n pattern: '^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$',\n description:\n 'Language tag (BCP-47, e.g. \"en-US\", \"fr-FR\") for spell-checking this text. Overrides the presentation default.',\n examples: ['en-US', 'fr-FR', 'de-DE', 'it-IT', 'es-ES'],\n })\n ),\n align: Type.Optional(PptxAlignmentSchema),\n valign: Type.Optional(VerticalAlignmentSchema),\n breakLine: Type.Optional(\n Type.Boolean({ description: 'Add line break after text' })\n ),\n bullet: Type.Optional(\n Type.Union([\n Type.Boolean({ description: 'Enable default bullet' }),\n Type.Object(\n {\n type: Type.Optional(\n Type.Union([Type.Literal('bullet'), Type.Literal('number')])\n ),\n style: Type.Optional(\n Type.String({ description: 'Bullet character or style' })\n ),\n startAt: Type.Optional(\n Type.Number({ description: 'Starting number for numbered lists' })\n ),\n },\n { additionalProperties: false }\n ),\n ])\n ),\n margin: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Margin in points (all sides)' }),\n Type.Array(Type.Number(), {\n description: 'Margins as [top, right, bottom, left] in points',\n minItems: 4,\n maxItems: 4,\n }),\n ])\n ),\n rotate: Type.Optional(\n Type.Number({ description: 'Rotation angle in degrees' })\n ),\n shadow: Type.Optional(ShadowSchema),\n fill: Type.Optional(\n Type.Object(\n {\n color: Type.String({ description: 'Fill color (hex without #)' }),\n transparency: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Fill transparency (0-100)',\n })\n ),\n },\n { additionalProperties: false }\n )\n ),\n hyperlink: Type.Optional(\n Type.Object(\n {\n url: Type.Optional(Type.String({ description: 'Hyperlink URL' })),\n slide: Type.Optional(\n Type.Number({ description: 'Slide number to link to' })\n ),\n tooltip: Type.Optional(\n Type.String({ description: 'Hyperlink tooltip' })\n ),\n },\n { additionalProperties: false }\n )\n ),\n lineSpacing: Type.Optional(\n Type.Number({ description: 'Line spacing in points' })\n ),\n lineSpacingMultiple: Type.Optional(\n Type.Number({\n minimum: 0.1,\n maximum: 10,\n description:\n 'Line spacing as a multiple of the font size (e.g. 0.9 = 90%). Takes precedence over lineSpacing.',\n })\n ),\n charSpacing: Type.Optional(\n Type.Number({\n description:\n 'Character spacing in points (positive = wider, negative = tighter)',\n })\n ),\n paraSpaceBefore: Type.Optional(\n Type.Number({ description: 'Space before paragraph in points' })\n ),\n paraSpaceAfter: Type.Optional(\n Type.Number({ description: 'Space after paragraph in points' })\n ),\n grid: Type.Optional(GridPositionSchema),\n style: Type.Optional(StyleNameSchema),\n },\n {\n description: 'Text component props',\n additionalProperties: false,\n }\n);\n\nexport type TextProps = Static<typeof TextPropsSchema>;\n","/**\n * Common Types and Schemas for PPTX Components\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { ColorValueSchema } from './theme';\n\nexport const PptxAlignmentSchema = Type.Union(\n [Type.Literal('left'), Type.Literal('center'), Type.Literal('right')],\n { description: 'Horizontal alignment options' }\n);\n\nexport const VerticalAlignmentSchema = Type.Union(\n [Type.Literal('top'), Type.Literal('middle'), Type.Literal('bottom')],\n { description: 'Vertical alignment options' }\n);\n\nexport const ShadowSchema = Type.Object(\n {\n type: Type.Optional(\n Type.Union([Type.Literal('outer'), Type.Literal('inner')], {\n description: 'Shadow type',\n })\n ),\n color: Type.Optional(ColorValueSchema),\n blur: Type.Optional(\n Type.Number({ description: 'Shadow blur radius in points' })\n ),\n offset: Type.Optional(\n Type.Number({ description: 'Shadow offset in points' })\n ),\n angle: Type.Optional(\n Type.Number({ description: 'Shadow angle in degrees' })\n ),\n opacity: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 1,\n description: 'Shadow opacity (0-1)',\n })\n ),\n },\n {\n description: 'Shadow configuration',\n additionalProperties: false,\n }\n);\n\nexport const GridPositionSchema = Type.Object(\n {\n column: Type.Number({\n minimum: 0,\n description: 'Starting column (0-indexed)',\n }),\n row: Type.Number({ minimum: 0, description: 'Starting row (0-indexed)' }),\n columnSpan: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Number of columns to span (default: 1)',\n })\n ),\n rowSpan: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Number of rows to span (default: 1)',\n })\n ),\n },\n { additionalProperties: false, description: 'Grid-based positioning' }\n);\n\nexport type GridPosition = Static<typeof GridPositionSchema>;\n\n// ============================================================================\n// TypeScript Types\n// ============================================================================\n\nexport type PptxAlignment = Static<typeof PptxAlignmentSchema>;\nexport type VerticalAlignment = Static<typeof VerticalAlignmentSchema>;\nexport type Shadow = Static<typeof ShadowSchema>;\n","/**\n * Theme primitives shared by PPTX slide content embedded across formats.\n */\n\nimport { Type } from '@sinclair/typebox';\n\nconst HexColorSchema = Type.String({\n pattern: '^#?[0-9A-Fa-f]{6}$',\n description: 'Hex color (e.g. #FF0000)',\n});\n\nexport const SEMANTIC_COLOR_NAMES = [\n 'primary',\n 'secondary',\n 'accent',\n 'background',\n 'text',\n 'text2',\n 'background2',\n 'accent4',\n 'accent5',\n 'accent6',\n] as const;\n\n/** PowerPoint XML aliases that resolve to canonical semantic names at runtime */\nexport const SEMANTIC_COLOR_ALIASES = [\n 'accent1',\n 'accent2',\n 'accent3',\n 'tx1',\n 'tx2',\n 'bg1',\n 'bg2',\n] as const;\n\nexport const ColorValueSchema = Type.Union(\n [\n HexColorSchema,\n ...SEMANTIC_COLOR_NAMES.map((name) => Type.Literal(name)),\n ...SEMANTIC_COLOR_ALIASES.map((name) => Type.Literal(name)),\n ],\n { description: 'Hex color or semantic theme color name' }\n);\n\nexport const STYLE_NAMES = [\n 'title',\n 'subtitle',\n 'heading1',\n 'heading2',\n 'heading3',\n 'body',\n 'caption',\n] as const;\n\nexport const StyleNameSchema = Type.Union(\n STYLE_NAMES.map((name) => Type.Literal(name)),\n { description: 'Predefined style name' }\n);\n\nexport type StyleName = (typeof STYLE_NAMES)[number];\n","/**\n * Image Component Schema (PPTX)\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { ShadowSchema, GridPositionSchema } from './common';\n\nexport const PptxImagePropsSchema = Type.Object(\n {\n path: Type.Optional(\n Type.String({\n description:\n 'Image file path or URL (mutually exclusive with base64 and svg)',\n })\n ),\n base64: Type.Optional(\n Type.String({\n description:\n 'Base64-encoded image data in data URI format (mutually exclusive with path and svg)',\n })\n ),\n svg: Type.Optional(\n Type.String({\n description:\n 'Raw inline SVG markup, e.g. \"<svg xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"0 0 24 24\\\\\">...</svg>\" (mutually exclusive with path and base64). Wrapped into an image/svg+xml data URI and embedded as a vector (PowerPoint 2016+); intrinsic size taken from the SVG viewBox/width/height when w/h omitted.',\n })\n ),\n x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n sizing: Type.Optional(\n Type.Object(\n {\n type: Type.Union(\n [\n Type.Literal('contain'),\n Type.Literal('cover'),\n Type.Literal('crop'),\n ],\n { description: 'Image sizing strategy' }\n ),\n w: Type.Optional(\n Type.Number({ description: 'Target width in inches' })\n ),\n h: Type.Optional(\n Type.Number({ description: 'Target height in inches' })\n ),\n },\n { description: 'Image sizing options', additionalProperties: false }\n )\n ),\n rotate: Type.Optional(\n Type.Number({ description: 'Rotation angle in degrees' })\n ),\n rounding: Type.Optional(\n Type.Boolean({ description: 'Apply rounded corners to image' })\n ),\n shadow: Type.Optional(ShadowSchema),\n hyperlink: Type.Optional(\n Type.Object(\n {\n url: Type.Optional(Type.String({ description: 'Hyperlink URL' })),\n slide: Type.Optional(\n Type.Number({ description: 'Slide number to link to' })\n ),\n tooltip: Type.Optional(\n Type.String({ description: 'Hyperlink tooltip' })\n ),\n },\n { additionalProperties: false }\n )\n ),\n alt: Type.Optional(\n Type.String({ description: 'Alternative text for accessibility' })\n ),\n grid: Type.Optional(GridPositionSchema),\n },\n {\n description: 'PPTX image component props',\n additionalProperties: false,\n }\n);\n\nexport type PptxImageProps = Static<typeof PptxImagePropsSchema>;\n","/**\n * Shape Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n ShadowSchema,\n GridPositionSchema,\n} from './common';\nimport { StyleNameSchema } from './theme';\n\nexport const ShapeTypeSchema = Type.Union(\n [\n Type.Literal('rect'),\n Type.Literal('roundRect'),\n Type.Literal('ellipse'),\n Type.Literal('triangle'),\n Type.Literal('diamond'),\n Type.Literal('pentagon'),\n Type.Literal('hexagon'),\n Type.Literal('star5'),\n Type.Literal('star6'),\n Type.Literal('line'),\n Type.Literal('arc'),\n Type.Literal('pie'),\n Type.Literal('blockArc'),\n Type.Literal('chord'),\n Type.Literal('arrow'),\n Type.Literal('chevron'),\n Type.Literal('cloud'),\n Type.Literal('heart'),\n Type.Literal('lightning'),\n ],\n { description: 'Shape type' }\n);\n\nexport const TextSegmentSchema = Type.Object(\n {\n text: Type.String(),\n fontSize: Type.Optional(Type.Number({ minimum: 1 })),\n fontFace: Type.Optional(Type.String()),\n color: Type.Optional(\n Type.String({\n description: 'Segment color (hex without # or semantic name)',\n })\n ),\n bold: Type.Optional(Type.Boolean()),\n fontWeight: Type.Optional(Type.Integer({ minimum: 100, maximum: 900 })),\n italic: Type.Optional(Type.Boolean()),\n breakLine: Type.Optional(\n Type.Boolean({ description: 'Insert line break after this segment' })\n ),\n spaceBefore: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Space before paragraph in points',\n })\n ),\n spaceAfter: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Space after paragraph in points',\n })\n ),\n charSpacing: Type.Optional(\n Type.Number({ description: 'Character spacing in points' })\n ),\n },\n { additionalProperties: false }\n);\n\nexport type TextSegment = Static<typeof TextSegmentSchema>;\n\n/**\n * OOXML `a:pattFill` preset names (ST_PresetPatternVal).\n */\nexport const PATTERN_FILL_PRESETS = [\n 'pct5',\n 'pct10',\n 'pct20',\n 'pct25',\n 'pct30',\n 'pct40',\n 'pct50',\n 'pct60',\n 'pct70',\n 'pct75',\n 'pct80',\n 'pct90',\n 'horz',\n 'vert',\n 'ltHorz',\n 'ltVert',\n 'dkHorz',\n 'dkVert',\n 'narHorz',\n 'narVert',\n 'dashHorz',\n 'dashVert',\n 'cross',\n 'dnDiag',\n 'upDiag',\n 'ltDnDiag',\n 'ltUpDiag',\n 'dkDnDiag',\n 'dkUpDiag',\n 'wdDnDiag',\n 'wdUpDiag',\n 'dashDnDiag',\n 'dashUpDiag',\n 'diagCross',\n 'smCheck',\n 'lgCheck',\n 'smGrid',\n 'lgGrid',\n 'dotGrid',\n 'smConfetti',\n 'lgConfetti',\n 'horzBrick',\n 'diagBrick',\n 'solidDmnd',\n 'openDmnd',\n 'dotDmnd',\n 'plaid',\n 'sphere',\n 'weave',\n 'divot',\n 'shingle',\n 'wave',\n 'trellis',\n 'zigZag',\n] as const;\n\nexport const GradientStopSchema = Type.Object(\n {\n color: Type.String({\n description: 'Stop color (hex without # or semantic theme name)',\n }),\n pos: Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Stop position along the gradient (0-100)',\n }),\n transparency: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Stop transparency (0-100)',\n })\n ),\n },\n { additionalProperties: false, description: 'Gradient color stop' }\n);\n\nexport const GradientFillSchema = Type.Object(\n {\n type: Type.Union([Type.Literal('linear'), Type.Literal('radial')], {\n description: 'Gradient type',\n }),\n angle: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 360,\n description:\n 'Gradient angle in degrees for linear gradients (0 = left→right, 90 = top→bottom). Default: 0.',\n })\n ),\n stops: Type.Array(GradientStopSchema, {\n minItems: 2,\n description: 'Gradient color stops (at least 2)',\n }),\n focus: Type.Optional(\n Type.Union(\n [\n Type.Literal('center'),\n Type.Literal('topLeft'),\n Type.Literal('topRight'),\n Type.Literal('bottomLeft'),\n Type.Literal('bottomRight'),\n ],\n {\n description: 'Focus point for radial gradients (default: \"center\")',\n }\n )\n ),\n },\n { additionalProperties: false, description: 'Gradient fill configuration' }\n);\n\nexport const PatternFillSchema = Type.Object(\n {\n preset: Type.Union(\n PATTERN_FILL_PRESETS.map((p) => Type.Literal(p)),\n { description: 'OOXML pattern preset name (a:pattFill prst value)' }\n ),\n foreground: Type.String({\n description: 'Pattern foreground color (hex without # or semantic name)',\n }),\n background: Type.String({\n description: 'Pattern background color (hex without # or semantic name)',\n }),\n },\n { additionalProperties: false, description: 'Pattern fill configuration' }\n);\n\nexport type GradientStop = Static<typeof GradientStopSchema>;\nexport type GradientFill = Static<typeof GradientFillSchema>;\nexport type PatternFill = Static<typeof PatternFillSchema>;\n\nexport const ShapePropsSchema = Type.Object(\n {\n type: ShapeTypeSchema,\n x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n fill: Type.Optional(\n Type.Object(\n {\n color: Type.Optional(\n Type.String({ description: 'Fill color (hex without #)' })\n ),\n transparency: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 100,\n description: 'Fill transparency (0-100)',\n })\n ),\n gradient: Type.Optional(GradientFillSchema),\n pattern: Type.Optional(PatternFillSchema),\n },\n { additionalProperties: false }\n )\n ),\n line: Type.Optional(\n Type.Object(\n {\n color: Type.Optional(\n Type.String({ description: 'Line color (hex without #)' })\n ),\n width: Type.Optional(\n Type.Number({ minimum: 0, description: 'Line width in points' })\n ),\n dashType: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dash'),\n Type.Literal('dot'),\n Type.Literal('dashDot'),\n ])\n ),\n },\n { additionalProperties: false }\n )\n ),\n text: Type.Optional(\n Type.Union(\n [\n Type.String({ description: 'Plain text' }),\n Type.Array(TextSegmentSchema, {\n description: 'Rich text segments with per-segment formatting',\n }),\n ],\n { description: 'Text content inside the shape' }\n )\n ),\n fontSize: Type.Optional(\n Type.Number({ minimum: 1, description: 'Font size for shape text' })\n ),\n fontFace: Type.Optional(\n Type.String({ description: 'Font family for shape text' })\n ),\n fontColor: Type.Optional(\n Type.String({ description: 'Font color for shape text (hex without #)' })\n ),\n charSpacing: Type.Optional(\n Type.Number({ description: 'Character spacing in points for shape text' })\n ),\n bold: Type.Optional(Type.Boolean({ description: 'Bold shape text' })),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description: 'Per-shape weight (100–900). Overrides `bold` when set.',\n })\n ),\n italic: Type.Optional(Type.Boolean({ description: 'Italic shape text' })),\n align: Type.Optional(PptxAlignmentSchema),\n valign: Type.Optional(VerticalAlignmentSchema),\n rotate: Type.Optional(\n Type.Number({ description: 'Rotation angle in degrees' })\n ),\n angleRange: Type.Optional(\n Type.Array(Type.Number(), {\n minItems: 2,\n maxItems: 2,\n description:\n 'Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)',\n })\n ),\n flipH: Type.Optional(\n Type.Boolean({ description: 'Flip shape horizontally' })\n ),\n flipV: Type.Optional(\n Type.Boolean({ description: 'Flip shape vertically' })\n ),\n shadow: Type.Optional(ShadowSchema),\n rectRadius: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Corner radius for roundRect shape in inches',\n })\n ),\n grid: Type.Optional(GridPositionSchema),\n style: Type.Optional(StyleNameSchema),\n },\n {\n description: 'Shape component props',\n additionalProperties: false,\n }\n);\n\nexport type ShapeType = Static<typeof ShapeTypeSchema>;\nexport type ShapeProps = Static<typeof ShapePropsSchema>;\n","/**\n * Table Component Schema (PPTX)\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n GridPositionSchema,\n} from './common';\n\nconst PptxTableCellSchema = Type.Union([\n Type.String({ description: 'Simple text cell' }),\n Type.Object(\n {\n text: Type.String({ description: 'Cell text content' }),\n color: Type.Optional(\n Type.String({ description: 'Text color (hex without #)' })\n ),\n fill: Type.Optional(\n Type.String({ description: 'Cell background color (hex without #)' })\n ),\n fontSize: Type.Optional(\n Type.Number({ description: 'Font size in points' })\n ),\n fontFace: Type.Optional(Type.String({ description: 'Font family' })),\n bold: Type.Optional(Type.Boolean({ description: 'Bold text' })),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description: 'Per-cell weight (100–900). Overrides `bold` when set.',\n })\n ),\n italic: Type.Optional(Type.Boolean({ description: 'Italic text' })),\n align: Type.Optional(PptxAlignmentSchema),\n valign: Type.Optional(VerticalAlignmentSchema),\n colspan: Type.Optional(\n Type.Number({ minimum: 1, description: 'Column span' })\n ),\n rowspan: Type.Optional(\n Type.Number({ minimum: 1, description: 'Row span' })\n ),\n margin: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Margin in points (all sides)' }),\n Type.Array(Type.Number(), { minItems: 4, maxItems: 4 }),\n ])\n ),\n },\n { additionalProperties: false }\n ),\n]);\n\nexport const PptxTablePropsSchema = Type.Object(\n {\n rows: Type.Array(\n Type.Array(PptxTableCellSchema, { description: 'Row of cells' }),\n { description: 'Table rows (array of arrays)', minItems: 1 }\n ),\n x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n colW: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Uniform column width in inches' }),\n Type.Array(Type.Number(), {\n description: 'Individual column widths in inches',\n }),\n ])\n ),\n rowH: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Uniform row height in inches' }),\n Type.Array(Type.Number(), {\n description: 'Individual row heights in inches',\n }),\n ])\n ),\n border: Type.Optional(\n Type.Object(\n {\n type: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dash'),\n Type.Literal('dot'),\n Type.Literal('none'),\n ])\n ),\n pt: Type.Optional(\n Type.Number({ minimum: 0, description: 'Border width in points' })\n ),\n color: Type.Optional(\n Type.String({ description: 'Border color (hex without #)' })\n ),\n },\n { additionalProperties: false }\n )\n ),\n fill: Type.Optional(\n Type.String({ description: 'Table background color (hex without #)' })\n ),\n fontSize: Type.Optional(\n Type.Number({\n minimum: 1,\n description: 'Default font size for all cells',\n })\n ),\n fontFace: Type.Optional(\n Type.String({ description: 'Default font family for all cells' })\n ),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Default weight for all cells (100–900). Same sub-family aliasing as the per-cell `fontWeight`; a cell that sets its own `fontWeight` or `bold` opts out.',\n })\n ),\n color: Type.Optional(\n Type.String({\n description: 'Default text color for all cells (hex without #)',\n })\n ),\n align: Type.Optional(PptxAlignmentSchema),\n valign: Type.Optional(VerticalAlignmentSchema),\n autoPage: Type.Optional(\n Type.Boolean({\n description:\n 'Auto-paginate table across multiple slides when content overflows',\n })\n ),\n autoPageRepeatHeader: Type.Optional(\n Type.Boolean({\n description: 'Repeat first row as header on each auto-paged slide',\n })\n ),\n margin: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Cell margin in points (all sides)' }),\n Type.Array(Type.Number(), { minItems: 4, maxItems: 4 }),\n ])\n ),\n borderRadius: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Rounded corner radius in inches. Renders a roundRect shape behind the table.',\n })\n ),\n grid: Type.Optional(GridPositionSchema),\n },\n {\n description: 'PPTX table component props',\n additionalProperties: false,\n }\n);\n\nexport type PptxTableProps = Static<typeof PptxTablePropsSchema>;\n","/**\n * Highcharts Component Schema (PPTX)\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { GridPositionSchema } from './common';\n\nexport const PptxHighchartsPropsSchema = Type.Object(\n {\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 scale: Type.Optional(Type.Number()),\n serverUrl: Type.Optional(\n Type.String({\n description:\n 'Highcharts Export Server URL (default: http://localhost:7801)',\n })\n ),\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 x: Type.Optional(\n Type.Union([\n Type.Number({ description: 'X position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'X as percentage',\n }),\n ])\n ),\n y: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Y position in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Y as percentage',\n }),\n ])\n ),\n w: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Width in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Width as percentage',\n }),\n ])\n ),\n h: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Height in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Height as percentage',\n }),\n ])\n ),\n grid: Type.Optional(GridPositionSchema),\n },\n {\n description: 'PPTX Highcharts component props',\n additionalProperties: false,\n }\n);\n\nexport type PptxHighchartsProps = Static<typeof PptxHighchartsPropsSchema>;\n","/**\n * Chart Component Schema (PPTX) — native PowerPoint charts via pptxgenjs\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { GridPositionSchema } from './common';\n\n/**\n * A position or size, in inches or as a percentage of the slide.\n *\n * Described per axis, exactly as `text`, `image`, `shape` and `table` describe\n * theirs: a bare number with no unit leaves an agent guessing between inches,\n * points and EMU on the one component it reaches for to chart a quarter.\n */\nconst positionValue = (inches: string, percent: string) =>\n Type.Union([\n Type.Number({ description: inches }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: percent,\n }),\n ]);\n\nconst ChartTypeSchema = Type.Union(\n [\n Type.Literal('area'),\n Type.Literal('bar'),\n Type.Literal('bar3D'),\n Type.Literal('bubble'),\n Type.Literal('doughnut'),\n Type.Literal('line'),\n Type.Literal('pie'),\n Type.Literal('radar'),\n Type.Literal('scatter'),\n ],\n { description: 'Chart type' }\n);\n\n/**\n * One series.\n *\n * `labels` and `values` are needed on EVERY series, not just the first: the\n * compiler drops the whole chart the moment one series is missing either. They\n * stay schema-optional only because the compiler still owns that refusal and\n * warns about it by name; the descriptions say so, because \"optional\" alone\n * left an agent to discover it from a rendered file with no chart in it.\n */\nconst ChartDataSeriesSchema = Type.Object(\n {\n name: Type.Optional(Type.String({ description: 'Series name' })),\n labels: Type.Optional(\n Type.Array(Type.String(), {\n description:\n 'Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart.',\n })\n ),\n values: Type.Optional(\n Type.Array(Type.Number(), {\n description:\n 'Data values, one per label. Needed on every series — see `labels`.',\n })\n ),\n sizes: Type.Optional(\n Type.Array(Type.Number(), {\n description: 'Bubble sizes (bubble charts only)',\n })\n ),\n },\n { additionalProperties: false }\n);\n\nconst ChartGridLineSchema = Type.Object(\n {\n style: Type.Optional(\n Type.Union(\n [\n Type.Literal('solid'),\n Type.Literal('dash'),\n Type.Literal('dot'),\n Type.Literal('none'),\n ],\n { description: 'Grid line style' }\n )\n ),\n size: Type.Optional(\n Type.Number({ minimum: 0, description: 'Grid line width (points)' })\n ),\n color: Type.Optional(\n Type.String({ description: 'Grid line color (hex or semantic)' })\n ),\n },\n { additionalProperties: false, description: 'Axis grid line styling' }\n);\n\nexport const PptxChartPropsSchema = Type.Object(\n {\n type: ChartTypeSchema,\n data: Type.Array(ChartDataSeriesSchema, {\n description: 'Chart data series',\n minItems: 1,\n }),\n\n // Display toggles\n showLegend: Type.Optional(\n Type.Boolean({ description: 'Show chart legend' })\n ),\n showTitle: Type.Optional(Type.Boolean({ description: 'Show chart title' })),\n showValue: Type.Optional(Type.Boolean({ description: 'Show data values' })),\n showPercent: Type.Optional(\n Type.Boolean({ description: 'Show percentages (pie/doughnut)' })\n ),\n showLabel: Type.Optional(\n Type.Boolean({ description: 'Show category labels on data points' })\n ),\n showSerName: Type.Optional(\n Type.Boolean({ description: 'Show series name on data points' })\n ),\n\n // Title\n title: Type.Optional(Type.String({ description: 'Chart title text' })),\n titleFontSize: Type.Optional(\n Type.Number({ description: 'Title font size (points)' })\n ),\n titleColor: Type.Optional(\n Type.String({ description: 'Title color (hex or semantic)' })\n ),\n titleFontFace: Type.Optional(\n Type.String({ description: 'Title font face' })\n ),\n titleFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Title weight (100–900). Rendered as a sub-family alias — see `dataLabelFontWeight`.',\n })\n ),\n\n // Chart colors\n chartColors: Type.Optional(\n Type.Array(Type.String(), {\n description:\n 'Series colors (hex or semantic theme names). Defaults to theme palette.',\n })\n ),\n\n // Data element border (bars/slices/areas)\n dataBorder: Type.Optional(\n Type.Object(\n {\n pt: Type.Number({\n minimum: 0,\n description: 'Border width (points)',\n }),\n color: Type.String({\n description: 'Border color (hex or semantic)',\n }),\n },\n {\n additionalProperties: false,\n description: 'Outline on data elements (bars, slices, areas)',\n }\n )\n ),\n\n // Legend\n legendPos: Type.Optional(\n Type.Union(\n [\n Type.Literal('b'),\n Type.Literal('l'),\n Type.Literal('r'),\n Type.Literal('t'),\n Type.Literal('tr'),\n ],\n { description: 'Legend position' }\n )\n ),\n legendFontSize: Type.Optional(\n Type.Number({ description: 'Legend font size' })\n ),\n legendFontFace: Type.Optional(\n Type.String({ description: 'Legend font face' })\n ),\n legendFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Legend weight (100–900). Rendered as a sub-family alias — see `dataLabelFontWeight`. PowerPoint gives the legend no bold toggle, so 400 and 700 both render Regular (700 warns).',\n })\n ),\n legendColor: Type.Optional(\n Type.String({ description: 'Legend text color' })\n ),\n\n // Category axis\n catAxisTitle: Type.Optional(\n Type.String({ description: 'Category axis title' })\n ),\n catAxisHidden: Type.Optional(\n Type.Boolean({ description: 'Hide category axis' })\n ),\n catAxisLabelRotate: Type.Optional(\n Type.Number({ description: 'Category axis label rotation (degrees)' })\n ),\n catAxisLabelFontSize: Type.Optional(\n Type.Number({ description: 'Category axis label font size' })\n ),\n catAxisLabelColor: Type.Optional(\n Type.String({\n description: 'Category axis label color (hex or semantic)',\n })\n ),\n catAxisLabelFontFace: Type.Optional(\n Type.String({ description: 'Category axis label font face' })\n ),\n catAxisLabelFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Category axis label weight (100–900). Rendered as a sub-family alias — see `dataLabelFontWeight`.',\n })\n ),\n catGridLine: Type.Optional(ChartGridLineSchema),\n\n // Value axis\n valAxisTitle: Type.Optional(\n Type.String({ description: 'Value axis title' })\n ),\n valAxisHidden: Type.Optional(\n Type.Boolean({ description: 'Hide value axis' })\n ),\n valAxisMinVal: Type.Optional(\n Type.Number({ description: 'Value axis minimum' })\n ),\n valAxisMaxVal: Type.Optional(\n Type.Number({ description: 'Value axis maximum' })\n ),\n valAxisLabelFormatCode: Type.Optional(\n Type.String({\n description: 'Value axis label format (e.g. \"$0.00\", \"#%\")',\n })\n ),\n valAxisMajorUnit: Type.Optional(\n Type.Number({ description: 'Value axis major unit / tick interval' })\n ),\n valAxisLabelColor: Type.Optional(\n Type.String({ description: 'Value axis label color (hex or semantic)' })\n ),\n valAxisLabelFontFace: Type.Optional(\n Type.String({ description: 'Value axis label font face' })\n ),\n valAxisLabelFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Value axis label weight (100–900). Rendered as a sub-family alias — see `dataLabelFontWeight`.',\n })\n ),\n valAxisLabelFontSize: Type.Optional(\n Type.Number({ description: 'Value axis label font size' })\n ),\n valGridLine: Type.Optional(ChartGridLineSchema),\n catAxisLineShow: Type.Optional(\n Type.Boolean({ description: 'Show the category axis line' })\n ),\n valAxisLineShow: Type.Optional(\n Type.Boolean({ description: 'Show the value axis line' })\n ),\n\n // Bar-specific\n barDir: Type.Optional(\n Type.Union([Type.Literal('bar'), Type.Literal('col')], {\n description:\n 'Bar direction: \"bar\" (horizontal) or \"col\" (vertical, default)',\n })\n ),\n barGrouping: Type.Optional(\n Type.Union(\n [\n Type.Literal('clustered'),\n Type.Literal('stacked'),\n Type.Literal('percentStacked'),\n ],\n { description: 'Bar grouping style' }\n )\n ),\n barGapWidthPct: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 500,\n description: 'Bar gap width (0-500%)',\n })\n ),\n barOverlapPct: Type.Optional(\n Type.Number({\n minimum: -100,\n maximum: 100,\n description:\n 'Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap.',\n })\n ),\n\n // Line-specific\n lineSmooth: Type.Optional(Type.Boolean({ description: 'Smooth lines' })),\n lineDataSymbol: Type.Optional(\n Type.Union(\n [\n Type.Literal('circle'),\n Type.Literal('dash'),\n Type.Literal('diamond'),\n Type.Literal('dot'),\n Type.Literal('none'),\n Type.Literal('square'),\n Type.Literal('triangle'),\n ],\n { description: 'Line data point marker symbol' }\n )\n ),\n lineSize: Type.Optional(\n Type.Number({ description: 'Line width (points)' })\n ),\n lineDataSymbolSize: Type.Optional(\n Type.Number({\n minimum: 2,\n maximum: 72,\n description: 'Line data point marker size (points)',\n })\n ),\n\n // Pie/doughnut-specific\n firstSliceAng: Type.Optional(\n Type.Number({\n minimum: 0,\n maximum: 359,\n description: 'Angle of first slice (degrees)',\n })\n ),\n holeSize: Type.Optional(\n Type.Number({\n minimum: 10,\n maximum: 90,\n description: 'Doughnut hole size (%)',\n })\n ),\n\n // Radar-specific\n radarStyle: Type.Optional(\n Type.Union(\n [\n Type.Literal('standard'),\n Type.Literal('marker'),\n Type.Literal('filled'),\n ],\n { description: 'Radar chart style' }\n )\n ),\n\n // Data labels\n dataLabelColor: Type.Optional(\n Type.String({ description: 'Data label text color' })\n ),\n dataLabelFontSize: Type.Optional(\n Type.Number({ description: 'Data label font size' })\n ),\n dataLabelFontFace: Type.Optional(\n Type.String({ description: 'Data label font face' })\n ),\n dataLabelFontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Data label weight (100–900); overrides `dataLabelFontBold`. PowerPoint chart labels carry no numeric weight, so a non-RIBBI weight renders by rewriting the font face to the matching sub-family (\"Inter\" at 300 → \"Inter Light\") — 400 and 700 stay on the family and use the bold toggle. Falls back to the theme body font when the sibling font face is unset.',\n })\n ),\n dataLabelFontBold: Type.Optional(\n Type.Boolean({ description: 'Bold data labels' })\n ),\n dataLabelPosition: Type.Optional(\n Type.Union(\n [\n Type.Literal('b'),\n Type.Literal('bestFit'),\n Type.Literal('ctr'),\n Type.Literal('l'),\n Type.Literal('r'),\n Type.Literal('t'),\n Type.Literal('inEnd'),\n Type.Literal('outEnd'),\n ],\n { description: 'Data label position' }\n )\n ),\n\n // Positioning\n x: Type.Optional(positionValue('X position in inches', 'X as percentage')),\n y: Type.Optional(positionValue('Y position in inches', 'Y as percentage')),\n w: Type.Optional(positionValue('Width in inches', 'Width as percentage')),\n h: Type.Optional(positionValue('Height in inches', 'Height as percentage')),\n grid: Type.Optional(GridPositionSchema),\n },\n {\n description: 'Native PowerPoint chart component props',\n additionalProperties: false,\n }\n);\n\nexport type PptxChartProps = Static<typeof PptxChartPropsSchema>;\n"],"mappings":";;;;;AAOA,SAAS,QAAAA,aAA6B;;;ACHtC,SAAS,QAAAC,aAAoB;;;ACA7B,SAAS,QAAAC,aAAoB;;;ACA7B,SAAS,YAAY;AAErB,IAAM,iBAAiB,KAAK,OAAO;AAAA,EACjC,SAAS;AAAA,EACT,aAAa;AACf,CAAC;AAEM,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,mBAAmB,KAAK;AAAA,EACnC;AAAA,IACE;AAAA,IACA,GAAG,qBAAqB,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC;AAAA,IACxD,GAAG,uBAAuB,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC;AAAA,EAC5D;AAAA,EACA,EAAE,aAAa,yCAAyC;AAC1D;AAEO,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,kBAAkB,KAAK;AAAA,EAClC,YAAY,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC;AAAA,EAC5C,EAAE,aAAa,wBAAwB;AACzC;;;ADlDO,IAAM,sBAAsBC,MAAK;AAAA,EACtC,CAACA,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AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,IACV,aACE;AAAA,EACJ;AACF;AAKA,SAAS,kCAGP,WAAqE;AACrE,SAAOC,MAAK;AAAA,IACV;AAAA,MACE,MAAMA,MAAK,QAAQ,UAAU,IAAI;AAAA,MACjC,IAAIA,MAAK,SAASA,MAAK,OAAO,CAAC;AAAA,MAC/B,SAASA,MAAK;AAAA,QACZA,MAAK,QAAQ;AAAA,UACX,SAAS;AAAA,UACT,aACE;AAAA,QACJ,CAAC;AAAA,MACH;AAAA,MACA,OAAO,2BAA2B,SAAS,IACvC,UAAU,cACVA,MAAK,SAAS,UAAU,WAAW;AAAA,IACzC;AAAA,IACA,EAAE,sBAAsB,OAAO,aAAa,UAAU,YAAY;AAAA,EACpE;AACF;AAMO,IAAM,yBAAyBA,MAAK;AAAA,EACzC;AAAA,IACE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,IAClE,kCAAkC,8BAA8B,CAAC,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,eAAe,EAAE,cAAc,OAAO;AAAA,IACtC,aACE;AAAA,EACJ;AACF;","names":["Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-to-office/shared",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Format-agnostic shared types, schemas and validation utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/schemas/schema-utils.ts","../src/schemas/discriminated-unions.ts"],"sourcesContent":["import { Type, TSchema } from '@sinclair/typebox';\nimport { restructureNameDiscriminatedUnions } from './discriminated-unions';\nimport type { ComponentDefinition } from '../types/components';\n\nexport interface ComponentSchemaConfig {\n schema: TSchema;\n title: string;\n description: string;\n requiresName?: boolean;\n enhanceForRichContent?: boolean;\n}\n\nfunction replaceRefs(\n obj: Record<string, unknown>,\n target: string,\n replacement: string\n): void {\n if (typeof obj !== 'object' || obj === null) return;\n if (Array.isArray(obj)) {\n obj.forEach((item) => {\n if (typeof item === 'object' && item !== null) {\n replaceRefs(item as Record<string, unknown>, target, replacement);\n }\n });\n return;\n }\n if (obj.$ref === target) {\n obj.$ref = replacement;\n }\n for (const value of Object.values(obj)) {\n if (typeof value === 'object' && value !== null) {\n replaceRefs(value as Record<string, unknown>, target, replacement);\n }\n }\n}\n\n/**\n * Resolve the bare `$ref` values TypeBox leaves behind into JSON Pointers.\n *\n * `rootDefinitionName` is only the fallback for a reference that names nothing\n * hoisted. A schema may carry several recursive definitions — the DOCX\n * document schema carries one per renderer — so a bare reference that matches\n * an actual definition resolves to *that* one, which is what keeps the two\n * renderer views from collapsing into whichever was walked last.\n */\nexport function fixSchemaReferences(\n schema: Record<string, unknown>,\n rootDefinitionName = 'ComponentDefinition'\n): void {\n const definitionNames = new Set(\n Object.keys(\n (schema.definitions as Record<string, unknown> | undefined) ?? {}\n )\n );\n // Undefined when nothing by either name was hoisted. Substituting the root\n // name regardless is how a reference to a definition that does not exist got\n // written, and Ajv refuses to compile a schema containing one — so an\n // unresolved reference is dropped rather than invented.\n const definitionRef = (name: string): string | undefined => {\n const target = definitionNames.has(name) ? name : rootDefinitionName;\n return definitionNames.has(target) ? `#/definitions/${target}` : undefined;\n };\n const isBareDefinitionRef = (value: unknown): value is string =>\n typeof value === 'string' &&\n (/^T\\d+$/.test(value) ||\n value === rootDefinitionName ||\n definitionNames.has(value));\n\n function traverse(obj: Record<string, unknown>, path = ''): void {\n if (typeof obj !== 'object' || obj === null) return;\n\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = path ? `${path}.${key}` : key;\n\n if (value && typeof value === 'object') {\n const schemaValue = value as Record<string, unknown>;\n\n // Only when there is something to point at. A schema that holds\n // components without embedding their definition (the theme schema\n // holds `componentDefaults` but cannot carry a renderer's component\n // union) keeps its untyped item: a `$ref` to a definition that was\n // never hoisted is unresolvable, and Ajv refuses to compile the whole\n // schema over it.\n if (\n schemaValue.type === 'array' &&\n schemaValue.items &&\n Object.keys(schemaValue.items).length === 0 &&\n definitionNames.has(rootDefinitionName)\n ) {\n schemaValue.items = {\n $ref: `#/definitions/${rootDefinitionName}`,\n };\n }\n\n if (\n schemaValue.type === 'array' &&\n schemaValue.items &&\n typeof schemaValue.items === 'object' &&\n '$ref' in schemaValue.items &&\n isBareDefinitionRef(\n (schemaValue.items as Record<string, unknown>).$ref\n )\n ) {\n const name = (schemaValue.items as Record<string, unknown>)\n .$ref as string;\n const ref = definitionRef(name);\n // Untyped rather than dangling when the target was never hoisted.\n schemaValue.items = ref ? { $ref: ref } : {};\n }\n\n if (isBareDefinitionRef(schemaValue.$ref)) {\n const ref = definitionRef(schemaValue.$ref as string);\n if (ref) schemaValue.$ref = ref;\n else delete schemaValue.$ref;\n }\n\n if (\n key === '$id' &&\n isBareDefinitionRef(value) &&\n currentPath !== `definitions.${value}.$id`\n ) {\n delete obj[key];\n continue;\n }\n\n traverse(value as Record<string, unknown>, currentPath);\n }\n }\n }\n\n traverse(schema);\n}\n\nexport function convertToJsonSchema(\n schema: TSchema,\n options: {\n $schema?: string;\n $id?: string;\n title?: string;\n description?: string;\n definitions?: Record<string, unknown>;\n } = {}\n): Record<string, unknown> {\n const {\n $schema = 'https://json-schema.org/draft-07/schema#',\n $id,\n title,\n description,\n definitions = {},\n } = options;\n\n const schemaJson = JSON.parse(JSON.stringify(schema));\n\n if (\n schemaJson.$id &&\n typeof schemaJson.$id === 'string' &&\n /^T\\d+$/.test(schemaJson.$id)\n ) {\n const recursiveId = schemaJson.$id;\n delete schemaJson.$id;\n replaceRefs(schemaJson, recursiveId, '#');\n }\n\n const extractedDefinitions: Record<string, unknown> = { ...definitions };\n\n function extractRecursiveSchemas(\n obj: Record<string, unknown>,\n path = ''\n ): void {\n if (typeof obj !== 'object' || obj === null) return;\n\n for (const [key, value] of Object.entries(obj)) {\n if (value && typeof value === 'object') {\n const schemaValue = value as Record<string, unknown>;\n\n if (schemaValue.$id && typeof schemaValue.$id === 'string') {\n const definitionName = schemaValue.$id;\n\n if (path !== `definitions.${definitionName}`) {\n const { $id: _id, ...schemaWithoutId } = schemaValue; // eslint-disable-line @typescript-eslint/no-unused-vars\n extractedDefinitions[definitionName] = schemaWithoutId;\n obj[key] = { $ref: `#/definitions/${definitionName}` };\n extractRecursiveSchemas(\n schemaWithoutId,\n `definitions.${definitionName}`\n );\n continue;\n }\n }\n\n extractRecursiveSchemas(\n value as Record<string, unknown>,\n path ? `${path}.${key}` : key\n );\n }\n }\n }\n\n extractRecursiveSchemas(schemaJson);\n\n const jsonSchema: Record<string, unknown> = { $schema };\n\n if ($id) jsonSchema.$id = $id;\n\n Object.assign(jsonSchema, schemaJson);\n\n jsonSchema.$schema = $schema;\n if ($id) jsonSchema.$id = $id;\n if (title !== undefined) jsonSchema.title = title;\n if (description !== undefined) jsonSchema.description = description;\n\n if (Object.keys(extractedDefinitions).length > 0) {\n jsonSchema.definitions = extractedDefinitions;\n }\n\n fixSchemaReferences(jsonSchema);\n restructureNameDiscriminatedUnions(jsonSchema);\n\n return jsonSchema;\n}\n\nexport function createComponentSchema(\n name: string,\n config: ComponentSchemaConfig,\n containerNames: string[],\n componentDefinitionSchema?: TSchema,\n // The definition the recursive children reference. Callers whose component\n // union is renderer-specific pass that renderer's name so the embedded\n // definition and the `$ref` pointing at it agree.\n rootDefinitionName = 'ComponentDefinition'\n): Record<string, unknown> {\n const componentStructure: Record<string, unknown> = {\n $schema: 'https://json-schema.org/draft-07/schema#',\n $id: `${name}.schema.json`,\n title: config.title,\n description: config.description,\n type: 'object',\n required: ['name', 'props'],\n properties: {\n name: {\n type: 'string',\n const: name,\n description: `Component name identifier (must be \"${name}\")`,\n },\n id: {\n type: 'string',\n description: 'Optional unique identifier for the component',\n },\n props: JSON.parse(JSON.stringify(config.schema)),\n },\n };\n\n if (containerNames.includes(name)) {\n (componentStructure.properties as Record<string, unknown>).children = {\n type: 'array',\n description: 'Children within this container',\n items: {\n $ref: `#/definitions/${rootDefinitionName}`,\n },\n };\n\n if (componentDefinitionSchema) {\n componentStructure.definitions = {\n [rootDefinitionName]: JSON.parse(\n JSON.stringify(componentDefinitionSchema)\n ),\n };\n }\n }\n\n fixSchemaReferences(componentStructure, rootDefinitionName);\n componentStructure.additionalProperties = false;\n\n return componentStructure;\n}\n\nexport async function exportSchemaToFile(\n schema: Record<string, unknown>,\n outputPath: string,\n options: { prettyPrint?: boolean } = {}\n): Promise<void> {\n const { prettyPrint = true } = options;\n const jsonSchema = prettyPrint\n ? JSON.stringify(schema, null, 2)\n : JSON.stringify(schema);\n const fs = await import('fs/promises');\n await fs.writeFile(outputPath, jsonSchema, 'utf-8');\n}\n\n/**\n * Create a TypeBox schema object for any component definition.\n * Works for both docx and pptx components.\n */\nexport function createComponentSchemaObject(\n component: ComponentDefinition,\n recursiveRef?: 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.',\n })\n ),\n };\n\n if (component.special?.hasSchemaField) {\n schema.$schema = Type.Optional(Type.String({ format: 'uri' }));\n }\n\n schema.props = component.propsSchema;\n\n if (component.hasChildren && recursiveRef) {\n schema.children = Type.Optional(Type.Array(recursiveRef));\n }\n\n return Type.Object(schema, { additionalProperties: false });\n}\n","/**\n * Canonical `if/then` restructuring for name-discriminated component unions.\n *\n * The generators export component unions as a flat `anyOf`. Schema-driven\n * editors (Monaco, VS Code — vscode-json-languageservice) resolve a partially\n * typed node against an `anyOf` by picking the single best-matching branch:\n * while typing `{ \"name\": | }`, every branch requiring `props` fails\n * validation, so its name const never reached autocomplete, and diagnostics\n * reported one arbitrary branch's complaints (\"Value must be \\\"heading\\\"\",\n * \"Missing property \\\"props\\\"\") instead of the real problem.\n *\n * This transform rewrites each such union — at JSON-Schema export time only,\n * the runtime TypeBox validators are untouched — into the standard\n * discriminated-union dispatch:\n *\n * {\n * type: \"object\",\n * required: [\"name\"],\n * properties: { name: { anyOf: [{ const, description }, …] } },\n * allOf: [\n * { if: { properties: { name: { const } }, required: [\"name\"] },\n * then: <branch> },\n * …\n * ]\n * }\n *\n * The accepted set of documents is exactly the same — `properties.name` is\n * the enum the branches already imply, and each `then` is the original\n * branch — but editors now behave deterministically:\n * - completing `name` offers every component, with its description\n * - an empty object reports only `Missing property \"name\"`\n * - a wrong name reports only `Value is not accepted. Valid values: …`\n * - a valid name activates exactly its branch for keys, props and errors\n *\n * Standard draft-07 keywords only, so ajv and every schema-aware editor\n * agree. Versioned plugin branches share a name; they stay grouped in a\n * small `anyOf` inside their `then`, containing best-match ambiguity to the\n * component's own versions.\n */\n\ninterface SchemaNode {\n [key: string]: unknown;\n}\n\ninterface NameConstEntry {\n const: string;\n type: 'string';\n description?: string;\n}\n\n/** A union branch shaped `{ properties: { name: { const: \"...\" } } }`. */\nfunction branchNameConst(branch: unknown): string | undefined {\n if (typeof branch !== 'object' || branch === null || Array.isArray(branch))\n return undefined;\n const name = ((branch as SchemaNode).properties as SchemaNode | undefined)\n ?.name as SchemaNode | undefined;\n return typeof name?.const === 'string' ? name.const : undefined;\n}\n\n/** True when the branch also discriminates on a `version` const (plugins). */\nfunction isVersionedBranch(branch: SchemaNode): boolean {\n const version = (branch.properties as SchemaNode | undefined)?.version as\n | SchemaNode\n | undefined;\n return typeof version?.const === 'string';\n}\n\nfunction branchRequiresName(branch: SchemaNode): boolean {\n return Array.isArray(branch.required) && branch.required.includes('name');\n}\n\n/** Group branches by their name const, preserving union order. */\nfunction groupByName(branches: SchemaNode[]): Map<string, SchemaNode[]> {\n const groups = new Map<string, SchemaNode[]>();\n for (const branch of branches) {\n const name = branchNameConst(branch)!;\n const group = groups.get(name);\n if (group) group.push(branch);\n else groups.set(name, [branch]);\n }\n return groups;\n}\n\nfunction nameEntry(name: string, group: SchemaNode[]): NameConstEntry {\n // Versioned plugins repeat the same name across version branches; the\n // un-versioned fallback carries the cleanest component description.\n const source =\n group.find(\n (b) => !isVersionedBranch(b) && typeof b.description === 'string'\n ) ?? group.find((b) => typeof b.description === 'string');\n return {\n const: name,\n type: 'string',\n ...(source ? { description: source.description as string } : {}),\n };\n}\n\n/**\n * Walk a JSON Schema and restructure every `anyOf` union whose branches are\n * all name-discriminated objects into the `if/then` dispatch shape above.\n *\n * Mutates in place. Conservative by design — a union is only restructured\n * when the rewrite is provably equivalent:\n * - every branch is an object with a `name` const that lists `name` as\n * required (unions containing `$ref` or free-form branches are left alone;\n * a `$ref`'s target union is restructured where it is defined)\n * - the node declares no `properties`, `allOf`, `if`, `required`,\n * `additionalProperties` or `type` of its own that the rewrite would have\n * to merge with\n * - at least two distinct names; single-name unions (a versioned plugin's\n * variants) validate and complete fine as a plain anyOf\n */\nexport function restructureNameDiscriminatedUnions(schema: unknown): void {\n const visited = new WeakSet<object>();\n\n function walk(node: unknown): void {\n if (typeof node !== 'object' || node === null) return;\n if (visited.has(node)) return;\n visited.add(node);\n\n if (Array.isArray(node)) {\n node.forEach(walk);\n return;\n }\n\n const obj = node as SchemaNode;\n const anyOf = obj.anyOf;\n const isCandidate =\n Array.isArray(anyOf) &&\n anyOf.length >= 2 &&\n anyOf.every(\n (b) => branchNameConst(b) !== undefined && branchRequiresName(b)\n ) &&\n obj.properties === undefined &&\n obj.allOf === undefined &&\n obj.if === undefined &&\n obj.required === undefined &&\n // A sibling `additionalProperties` evaluates against the node's own\n // (absent) `properties`; declaring `name` here would change what it\n // rejects, so such unions are left alone.\n obj.additionalProperties === undefined &&\n (obj.type === undefined || obj.type === 'object');\n // Dispatch needs at least two distinct names. Same-name groups (a\n // versioned plugin's variants) stay a plain anyOf — restructuring them\n // would recurse forever on the group it just created.\n const groups = isCandidate ? groupByName(anyOf as SchemaNode[]) : undefined;\n if (groups && groups.size >= 2) {\n obj.type = 'object';\n obj.required = ['name'];\n obj.properties = {\n name: {\n anyOf: [...groups.entries()].map(([name, group]) =>\n nameEntry(name, group)\n ),\n },\n };\n obj.allOf = [...groups.entries()].map(([name, group]) => ({\n if: {\n properties: { name: { const: name } },\n required: ['name'],\n },\n then: group.length === 1 ? group[0] : { anyOf: group },\n }));\n delete obj.anyOf;\n }\n\n for (const value of Object.values(obj)) walk(value);\n }\n\n walk(schema);\n}\n\n/**\n * Iterate the component branches of an exported union, whichever shape it is\n * in — the flat `anyOf` the generators emit, or the `if/then` dispatch this\n * module rewrites it into. For consumers that post-process branch objects\n * (description enhancement, theme-name injection, …).\n */\nexport function unionBranches(schema: unknown): SchemaNode[] {\n if (typeof schema !== 'object' || schema === null) return [];\n const obj = schema as SchemaNode;\n if (Array.isArray(obj.anyOf)) {\n return obj.anyOf.filter(\n (b): b is SchemaNode => typeof b === 'object' && b !== null\n );\n }\n if (Array.isArray(obj.allOf)) {\n return obj.allOf.flatMap((entry): SchemaNode[] => {\n const then = (entry as SchemaNode | null)?.then;\n if (typeof then !== 'object' || then === null) return [];\n const inner = (then as SchemaNode).anyOf;\n return Array.isArray(inner)\n ? inner.filter(\n (b): b is SchemaNode => typeof b === 'object' && b !== null\n )\n : [then as SchemaNode];\n });\n }\n return [];\n}\n"],"mappings":";AAAA,SAAS,YAAqB;;;ACmD9B,SAAS,gBAAgB,QAAqC;AAC5D,MAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,MAAM,QAAQ,MAAM;AACvE,WAAO;AACT,QAAM,OAAS,OAAsB,YACjC;AACJ,SAAO,OAAO,MAAM,UAAU,WAAW,KAAK,QAAQ;AACxD;AAGA,SAAS,kBAAkB,QAA6B;AACtD,QAAM,UAAW,OAAO,YAAuC;AAG/D,SAAO,OAAO,SAAS,UAAU;AACnC;AAEA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