@json-to-office/shared-pptx 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XDLNPMWK.js → chunk-EXPOJ55X.js} +3 -4
- package/dist/chunk-EXPOJ55X.js.map +1 -0
- package/dist/{chunk-DFXFF2IE.js → chunk-KRLDFNJM.js} +2 -2
- package/dist/{chunk-2YEV3CJF.js → chunk-OSHLAL7B.js} +3 -7
- package/dist/chunk-OSHLAL7B.js.map +1 -0
- package/dist/{chunk-ETHMRQYH.js → chunk-WQAPVKW2.js} +3 -3
- package/dist/{chunk-UCBH6X6Z.js → chunk-ZIDB7UMH.js} +2 -2
- package/dist/index.js +5 -5
- package/dist/schemas/component-registry.js +2 -2
- package/dist/schemas/component-union.js +3 -3
- package/dist/schemas/components.js +3 -3
- package/dist/schemas/document.js +4 -4
- package/dist/schemas/generator.js +3 -3
- package/dist/schemas/renderer.d.ts +1 -2
- package/dist/schemas/renderer.js +1 -3
- package/package.json +2 -2
- package/dist/chunk-2YEV3CJF.js.map +0 -1
- package/dist/chunk-XDLNPMWK.js.map +0 -1
- /package/dist/{chunk-DFXFF2IE.js.map → chunk-KRLDFNJM.js.map} +0 -0
- /package/dist/{chunk-ETHMRQYH.js.map → chunk-WQAPVKW2.js.map} +0 -0
- /package/dist/{chunk-UCBH6X6Z.js.map → chunk-ZIDB7UMH.js.map} +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PPTX_RENDERER_IDS,
|
|
3
|
-
isPptxComponentSupported,
|
|
4
3
|
pptxPropsSchemaForRenderer
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OSHLAL7B.js";
|
|
6
5
|
import {
|
|
7
6
|
ColorValueSchema,
|
|
8
7
|
GridConfigSchema,
|
|
@@ -457,7 +456,7 @@ function createAllPptxComponentSchemas(recursiveRef) {
|
|
|
457
456
|
function createAllPptxComponentSchemasNarrowed(selfRef, pluginSchemas = [], profile) {
|
|
458
457
|
const leafSchemas = /* @__PURE__ */ new Map();
|
|
459
458
|
for (const comp of PPTX_STANDARD_COMPONENTS_REGISTRY) {
|
|
460
|
-
if (!comp.hasChildren
|
|
459
|
+
if (!comp.hasChildren) {
|
|
461
460
|
leafSchemas.set(
|
|
462
461
|
comp.name,
|
|
463
462
|
createPptxComponentSchemaObject(comp, void 0, selfRef, profile)
|
|
@@ -530,4 +529,4 @@ export {
|
|
|
530
529
|
createAllPptxComponentSchemas,
|
|
531
530
|
createAllPptxComponentSchemasNarrowed
|
|
532
531
|
};
|
|
533
|
-
//# sourceMappingURL=chunk-
|
|
532
|
+
//# sourceMappingURL=chunk-EXPOJ55X.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/component-registry.ts","../src/schemas/components/presentation.ts","../src/schemas/components/template.ts","../src/schemas/components/common.ts","../src/schemas/components/slide.ts"],"sourcesContent":["/**\n * PPTX Component Registry - SINGLE SOURCE OF TRUTH\n *\n * This is the ONLY place where standard PPTX components are defined.\n * All schema generators MUST use this registry.\n */\n\nimport { Type, TSchema } from '@sinclair/typebox';\nimport {\n PPTX_SLIDE_CONTENT_COMPONENTS,\n pptxComponentRequiresProps,\n} from '@json-to-office/shared/schemas/slide-content';\nimport {\n PPTX_RENDERER_IDS,\n pptxPropsSchemaForRenderer,\n type PptxRendererId,\n} from './renderer';\n\n/**\n * Component definition with metadata\n */\nexport interface PptxStandardComponentDefinition {\n name: string;\n propsSchema: TSchema;\n hasChildren: boolean;\n /**\n * Names of standard components allowed as direct children.\n * Only meaningful when hasChildren is true.\n * Plugin components are always allowed in addition to these.\n * Omit to allow the full recursive union (backward-compat).\n */\n allowedChildren?: readonly string[];\n hasPlaceholders?: boolean;\n category: 'container' | 'content' | 'layout';\n description: string;\n /**\n * Force `props` to stay required even though the props schema accepts `{}`.\n * See `pptxComponentRequiresProps` for when that is legitimate.\n */\n propsRequired?: boolean;\n special?: {\n hasSchemaField?: boolean;\n };\n}\nimport { PresentationPropsSchema } from './components/presentation';\nimport { SlidePropsSchema } from './components/slide';\n\n/**\n * SINGLE SOURCE OF TRUTH for all standard PPTX components\n */\nexport const PPTX_STANDARD_COMPONENTS_REGISTRY: readonly PptxStandardComponentDefinition[] =\n [\n // ========================================================================\n // Container Components (can contain children)\n // ========================================================================\n {\n name: 'pptx',\n propsSchema: PresentationPropsSchema,\n hasChildren: true,\n allowedChildren: ['slide'],\n category: 'container',\n // Every presentation prop is optional, but the root is where a deck\n // states its title, size and theme, and both the published schema and\n // the deep validator have always demanded the key. Keeping it required\n // is a decision, not the schema's own answer, so it is declared.\n propsRequired: true,\n description:\n 'Main presentation container - defines the overall presentation structure. Required as the root component.',\n special: {\n hasSchemaField: true,\n },\n },\n {\n name: 'slide',\n propsSchema: SlidePropsSchema,\n hasChildren: true,\n allowedChildren: PPTX_SLIDE_CONTENT_COMPONENTS.map(({ name }) => name),\n hasPlaceholders: true,\n category: 'container',\n // No `propsRequired`: every slide prop is optional and nothing outside\n // the schema asks for one, so `{ \"name\": \"slide\", \"children\": [...] }`\n // is a whole slide and the published schema says so.\n description:\n 'Slide container - groups content elements on a single slide.',\n },\n\n // Content components are canonical in @json-to-office/shared so DOCX\n // visuals can reuse the exact schemas without depending on shared-pptx.\n ...PPTX_SLIDE_CONTENT_COMPONENTS,\n ] as const;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\nexport function getPptxStandardComponent(\n name: string\n): PptxStandardComponentDefinition | undefined {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.find((c) => c.name === name);\n}\n\nexport function getAllPptxComponentNames(): readonly string[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.map((c) => c.name);\n}\n\nexport function getPptxComponentsByCategory(\n category: PptxStandardComponentDefinition['category']\n): readonly PptxStandardComponentDefinition[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => c.category === category\n );\n}\n\nexport function getPptxContainerComponents(): readonly PptxStandardComponentDefinition[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n}\n\nexport function getPptxContentComponents(): readonly PptxStandardComponentDefinition[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter((c) => !c.hasChildren);\n}\n\nexport function isPptxStandardComponent(name: string): boolean {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.some((c) => c.name === name);\n}\n\n/**\n * Whether this component must carry a `props` key — the one answer both the\n * published schema and the deep validator read.\n *\n * Re-exported from `@json-to-office/shared` so the registry is the single\n * place a consumer has to look: the rule is the props schema's own (a schema\n * that accepts `{}` demands nothing) unless the definition overrides it.\n */\nexport { pptxComponentRequiresProps };\n\n// ============================================================================\n// Schema Generation Helpers\n// ============================================================================\n\nexport function createPptxComponentSchemaObject(\n component: PptxStandardComponentDefinition,\n recursiveRef?: TSchema,\n placeholderRef?: TSchema,\n profile?: { renderer: PptxRendererId; requireDiscriminator: boolean }\n): TSchema {\n const schema: Record<string, TSchema> = {\n name: Type.Literal(component.name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(\n Type.Boolean({\n default: true,\n description:\n 'When false, this component is filtered out and not rendered. Defaults to true.',\n })\n ),\n };\n\n if (component.special?.hasSchemaField) {\n schema.$schema = Type.Optional(Type.String({ format: 'uri' }));\n schema.renderer = profile\n ? profile.requireDiscriminator\n ? Type.Literal(profile.renderer, {\n description: 'Renderer backend for this presentation',\n })\n : Type.Optional(\n Type.Literal(profile.renderer, {\n description: 'Renderer backend. Omitted defaults to \"pptxgenjs\".',\n })\n )\n : Type.Optional(\n Type.Union(\n PPTX_RENDERER_IDS.map((renderer) => Type.Literal(renderer)),\n {\n description: 'Renderer backend. Omitted defaults to \"pptxgenjs\".',\n }\n )\n );\n }\n\n schema.props = profile\n ? pptxPropsSchemaForRenderer(\n component.name,\n component.propsSchema,\n profile.renderer\n )\n : component.propsSchema;\n\n if (component.hasChildren && recursiveRef) {\n schema.children = Type.Optional(Type.Array(recursiveRef));\n }\n\n if (\n component.hasPlaceholders &&\n (placeholderRef ?? recursiveRef) &&\n profile?.renderer !== 'office-open'\n ) {\n const baseProperties = (schema.props as any).properties ?? {};\n const phRef = placeholderRef ?? recursiveRef!;\n schema.props = Type.Object(\n {\n ...baseProperties,\n placeholders: Type.Optional(\n Type.Record(Type.String(), phRef, {\n description:\n 'Content for named placeholders: { \"title\": { \"name\": \"text\", ... } }',\n })\n ),\n },\n {\n additionalProperties: false,\n description: (component.propsSchema as any).description,\n }\n );\n }\n\n // Optionality is decided from the canonical definition, never from the\n // pruned/placeholder-augmented copy above: the deep validator checks the\n // canonical schema, so reading anything else here is how the published\n // schema and the runtime would start disagreeing about the same document.\n if (!pptxComponentRequiresProps(component)) {\n schema.props = Type.Optional(schema.props);\n }\n\n return Type.Object(schema, {\n additionalProperties: false,\n description: component.description,\n });\n}\n\nexport function createAllPptxComponentSchemas(\n recursiveRef?: TSchema\n): readonly TSchema[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.map((component) =>\n createPptxComponentSchemaObject(component, recursiveRef)\n );\n}\n\n/**\n * Build all standard PPTX component schemas with per-container narrowed children.\n *\n * Resolves containers in dependency order so each container's children union\n * only references its allowedChildren. Plugin schemas are always included in\n * every container's children.\n *\n * @param selfRef - The Type.Recursive self-reference (fallback and for plugin children)\n * @param pluginSchemas - Plugin component schemas (always allowed in all containers)\n * @returns Array of TypeBox schemas with narrowed children per container\n */\nexport function createAllPptxComponentSchemasNarrowed(\n selfRef: TSchema,\n pluginSchemas: TSchema[] = [],\n profile?: { renderer: PptxRendererId; requireDiscriminator: boolean }\n): TSchema[] {\n // Phase 1: Build leaf (non-container) component schemas — no children\n const leafSchemas = new Map<string, TSchema>();\n for (const comp of PPTX_STANDARD_COMPONENTS_REGISTRY) {\n if (!comp.hasChildren) {\n leafSchemas.set(\n comp.name,\n createPptxComponentSchemaObject(comp, undefined, selfRef, profile)\n );\n }\n }\n\n // Phase 2: Resolve containers in dependency order\n const containers = PPTX_STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => c.hasChildren\n );\n const resolved = new Map<string, TSchema>();\n const pending = [...containers];\n\n while (pending.length > 0) {\n const before = pending.length;\n for (let i = pending.length - 1; i >= 0; i--) {\n const comp = pending[i];\n\n if (!comp.allowedChildren) {\n // No allowedChildren declared — fallback to full recursive ref\n resolved.set(\n comp.name,\n createPptxComponentSchemaObject(comp, selfRef, selfRef, profile)\n );\n pending.splice(i, 1);\n continue;\n }\n\n // Check if all container dependencies are resolved\n const containerDeps = comp.allowedChildren.filter((name) =>\n containers.some((c) => c.name === name)\n );\n if (!containerDeps.every((d) => resolved.has(d))) continue;\n\n // Build narrowed children union\n const childSchemas = comp.allowedChildren\n .map((name) => resolved.get(name) ?? leafSchemas.get(name))\n .filter((s): s is TSchema => s !== undefined);\n\n const allChildSchemas = [...childSchemas, ...pluginSchemas];\n const childrenType =\n allChildSchemas.length === 1\n ? allChildSchemas[0]\n : Type.Union(allChildSchemas);\n\n // Placeholders hold what `children` holds: a named slot is a position\n // for a content component, not a second way into the tree. Passing the\n // narrowed union rather than `selfRef` is what stops the published\n // schema from accepting a `slide` — or the `pptx` root — as a\n // placeholder value, which the deep walk also refuses.\n resolved.set(\n comp.name,\n createPptxComponentSchemaObject(\n comp,\n childrenType,\n childrenType,\n profile\n )\n );\n pending.splice(i, 1);\n }\n\n if (pending.length === before) {\n throw new Error(\n `Circular allowedChildren among: ${pending.map((c) => c.name).join(', ')}`\n );\n }\n }\n\n // Combine: containers (resolved) + leaves\n return [...resolved.values(), ...leafSchemas.values()];\n}\n","/**\n * Presentation Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FontRegistrySchema } from '@json-to-office/shared';\nimport { TemplateSlideDefinitionSchema } from './template';\nimport { GridConfigSchema, ThemeConfigSchema } from '../theme';\nimport { PptxComponentDefaultsSchema } from '../component-defaults';\n\nexport const PresentationPropsSchema = Type.Object(\n {\n title: Type.Optional(\n Type.String({ description: 'Presentation title metadata' })\n ),\n author: Type.Optional(\n Type.String({ description: 'Presentation author metadata' })\n ),\n subject: Type.Optional(\n Type.String({ description: 'Presentation subject metadata' })\n ),\n company: Type.Optional(\n Type.String({ description: 'Company name metadata' })\n ),\n theme: Type.Optional(\n Type.Union(\n [\n Type.String({\n description: 'Theme name to apply (default: \"default\")',\n default: 'default',\n }),\n ThemeConfigSchema,\n ],\n {\n description:\n 'Theme to apply: a built-in/custom theme name (default: ' +\n '\"default\"), or an inline theme config object so the document ' +\n 'stays self-contained',\n }\n )\n ),\n fontRegistry: Type.Optional(FontRegistrySchema),\n slideWidth: Type.Optional(\n Type.Number({\n description: 'Slide width in inches (default: 10)',\n default: 10,\n })\n ),\n slideHeight: Type.Optional(\n Type.Number({\n description: 'Slide height in inches (default: 7.5)',\n default: 7.5,\n })\n ),\n rtlMode: Type.Optional(\n Type.Boolean({ description: 'Right-to-left text direction' })\n ),\n language: Type.Optional(\n Type.String({\n pattern: '^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$',\n description:\n 'Default presentation language (BCP-47 tag, e.g. \"en-US\"). Sets the spell-check language for all text; individual text components can override it.',\n examples: ['en-US', 'fr-FR', 'de-DE', 'it-IT', 'es-ES'],\n })\n ),\n pageNumberFormat: Type.Optional(\n Type.Union([Type.Literal('9'), Type.Literal('09')], {\n description:\n 'Format for {PAGE_NUMBER} placeholders: \"9\" = bare number (default), \"09\" = zero-padded',\n default: '9',\n })\n ),\n componentDefaults: Type.Optional(PptxComponentDefaultsSchema),\n grid: Type.Optional(GridConfigSchema),\n templates: Type.Optional(\n Type.Array(TemplateSlideDefinitionSchema, {\n description: 'Template slide definitions (reusable slide templates)',\n })\n ),\n },\n {\n description: 'Presentation container props',\n additionalProperties: false,\n }\n);\n\nexport type PresentationProps = Static<typeof PresentationPropsSchema>;\n","/**\n * Template Slide Definition Schemas\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\nimport { SlideBackgroundSchema, GridPositionSchema } from './common';\nimport { ColorValueSchema, GridConfigSchema } from '../theme';\nimport { TextPropsSchema } from './text';\nimport { PptxImagePropsSchema } from './image';\nimport { ShapePropsSchema } from './shape';\nimport { PptxTablePropsSchema } from './table';\nimport { PptxChartPropsSchema } from './chart';\nimport { PptxHighchartsPropsSchema } from './highcharts';\n\n// Position helpers (number in inches OR percentage string e.g. \"50%\")\nconst Coord = Type.Union([\n Type.Number({ description: 'Position/size in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Position/size as percentage of slide dimension (e.g., \"50%\")',\n }),\n]);\n\n// Helper: wrap a props schema into { name, props } component format\nfunction contentComponent(name: string, propsSchema: TSchema) {\n return Type.Object({\n name: Type.Literal(name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(Type.Boolean({\n default: true,\n description: 'When false, this component is filtered out and not rendered. Defaults to true.',\n })),\n props: propsSchema,\n }, { additionalProperties: false });\n}\n\n// Content component union — same { name, props } format as slide children\nconst TemplateObjectComponentSchema = Type.Union([\n contentComponent('text', TextPropsSchema),\n contentComponent('image', PptxImagePropsSchema),\n contentComponent('shape', ShapePropsSchema),\n contentComponent('table', PptxTablePropsSchema),\n contentComponent('chart', PptxChartPropsSchema),\n contentComponent('highcharts', PptxHighchartsPropsSchema),\n], {\n discriminator: { propertyName: 'name' },\n description: 'Fixed component on a template slide (same format as slide children)',\n});\n\n// Defaults schema — partial component stub (carries styling props, not content)\n// Discriminated union so Monaco can autocomplete prop names per component type\nfunction defaultsComponent(name: string, propsSchema: TSchema) {\n return Type.Object({\n name: Type.Literal(name),\n props: Type.Partial(propsSchema, { description: 'Default props inherited by the component placed in this placeholder' }),\n }, { additionalProperties: false });\n}\n\nconst PlaceholderDefaultsSchema = Type.Union([\n defaultsComponent('text', TextPropsSchema),\n defaultsComponent('image', PptxImagePropsSchema),\n defaultsComponent('shape', ShapePropsSchema),\n defaultsComponent('table', PptxTablePropsSchema),\n defaultsComponent('chart', PptxChartPropsSchema),\n defaultsComponent('highcharts', PptxHighchartsPropsSchema),\n], {\n discriminator: { propertyName: 'name' },\n description: 'Partial component stub — styling defaults only',\n});\n\n// Placeholder definition\nexport const PlaceholderDefinitionSchema = Type.Object({\n name: Type.String({ description: 'Unique placeholder name' }),\n x: Type.Optional(Coord),\n y: Type.Optional(Coord),\n w: Type.Optional(Coord),\n h: Type.Optional(Coord),\n grid: Type.Optional(GridPositionSchema),\n defaults: Type.Optional(PlaceholderDefaultsSchema),\n}, { additionalProperties: false, description: 'Placeholder on a template slide — defaults is a component stub whose props are inherited by the actual component' });\n\n// Template slide definition\nexport const TemplateSlideDefinitionSchema = Type.Object({\n name: Type.String({ description: 'Unique template slide name' }),\n background: Type.Optional(SlideBackgroundSchema),\n margin: Type.Optional(Type.Union([\n Type.Number({ description: 'Margin in inches (all sides)' }),\n Type.Array(Type.Number(), { minItems: 4, maxItems: 4, description: 'Margin [top, right, bottom, left] in inches' }),\n ])),\n slideNumber: Type.Optional(Type.Object({\n x: Coord, y: Coord,\n w: Type.Optional(Coord),\n h: Type.Optional(Coord),\n color: Type.Optional(ColorValueSchema),\n fontSize: Type.Optional(Type.Number({ description: 'Slide number font size in points' })),\n }, { additionalProperties: false, description: 'Slide number position and styling' })),\n objects: Type.Optional(Type.Array(TemplateObjectComponentSchema, { description: 'Fixed components (logos, footers, decorations) — same { name, props } format as slide children' })),\n placeholders: Type.Optional(Type.Array(PlaceholderDefinitionSchema, { description: 'Placeholder regions for slide content' })),\n grid: Type.Optional(GridConfigSchema),\n}, { additionalProperties: false, description: 'Template slide definition (reusable slide template)' });\n\nexport type PlaceholderDefinition = Static<typeof PlaceholderDefinitionSchema>;\nexport type TemplateSlideDefinition = Static<typeof TemplateSlideDefinitionSchema>;\n","/**\n * Common Types and Schemas for PPTX Components\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n ColorValueSchema,\n GradientFillSchema,\n} from '@json-to-office/shared/schemas/slide-content';\n\nexport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n ShadowSchema,\n GridPositionSchema,\n} from '@json-to-office/shared/schemas/slide-content';\n\nexport type {\n PptxAlignment,\n VerticalAlignment,\n Shadow,\n GridPosition,\n} from '@json-to-office/shared/schemas/slide-content';\n\nexport const PositionSchema = Type.Object(\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 position as percentage (e.g., \"10%\")',\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 position as percentage (e.g., \"10%\")',\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 (e.g., \"80%\")',\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 (e.g., \"20%\")',\n }),\n ])\n ),\n },\n {\n description: 'Position and size in inches or percentages',\n additionalProperties: false,\n }\n);\n\nexport const SlideBackgroundSchema = Type.Object(\n {\n color: Type.Optional(ColorValueSchema),\n gradient: Type.Optional(GradientFillSchema),\n image: Type.Optional(\n Type.Object(\n {\n path: Type.Optional(\n Type.String({ description: 'Image file path or URL' })\n ),\n base64: Type.Optional(\n Type.String({ description: 'Base64-encoded image data' })\n ),\n },\n { description: 'Background image', additionalProperties: false }\n )\n ),\n },\n {\n description: 'Slide background configuration',\n additionalProperties: false,\n }\n);\n\nexport const TransitionSchema = Type.Object(\n {\n type: Type.Optional(\n Type.Union(\n [\n Type.Literal('fade'),\n Type.Literal('push'),\n Type.Literal('wipe'),\n Type.Literal('zoom'),\n Type.Literal('none'),\n ],\n { description: 'Transition effect type' }\n )\n ),\n speed: Type.Optional(\n Type.Union(\n [Type.Literal('slow'), Type.Literal('medium'), Type.Literal('fast')],\n { description: 'Transition speed' }\n )\n ),\n },\n {\n description: 'Slide transition configuration',\n additionalProperties: false,\n }\n);\n\nexport type Position = Static<typeof PositionSchema>;\nexport type SlideBackground = Static<typeof SlideBackgroundSchema>;\nexport type Transition = Static<typeof TransitionSchema>;\n","/**\n * Slide Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { SlideBackgroundSchema, TransitionSchema } from './common';\n\nexport const SlidePropsSchema = Type.Object(\n {\n meta: Type.Optional(\n Type.Object(\n {\n title: Type.Optional(\n Type.String({\n description:\n 'Authoring label for this slide, shown in editors and outlines. Never rendered — slide content is unaffected.',\n })\n ),\n },\n {\n additionalProperties: false,\n description: 'Authoring metadata; has no effect on the presentation.',\n }\n )\n ),\n background: Type.Optional(SlideBackgroundSchema),\n transition: Type.Optional(TransitionSchema),\n notes: Type.Optional(\n Type.String({ description: 'Speaker notes for this slide' })\n ),\n layout: Type.Optional(\n Type.String({\n description: 'Slide layout name (e.g., \"Title Slide\", \"Blank\")',\n })\n ),\n hidden: Type.Optional(\n Type.Boolean({ description: 'Hide this slide from presentation' })\n ),\n template: Type.Optional(\n Type.String({ description: 'Template slide name to apply' })\n ),\n // Note: `placeholders` is added dynamically by the component registry\n // with the recursive component ref, to avoid circular imports.\n },\n {\n description: 'Slide container props',\n additionalProperties: false,\n }\n);\n\nexport type SlideProps = Static<typeof SlidePropsSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,SAAS,QAAAA,aAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACPP,SAAS,QAAAC,aAAoB;AAC7B,SAAS,0BAA0B;;;ACDnC,SAAS,QAAAC,aAA6B;;;ACAtC,SAAS,YAAoB;AAC7B;AAAA,EACE,oBAAAC;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASA,IAAM,iB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AAC,MAAM,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;AAAA,MAC1E;AAAA,IACF;AAAA,EACF;AAGA,SAAO,CAAC,GAAG,SAAS,OAAO,GAAG,GAAG,YAAY,OAAO,CAAC;AACvD;","names":["Type","Type","Type","ColorValueSchema","Type","Type","Type","Type","Type"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAllPptxComponentSchemas,
|
|
3
3
|
createAllPptxComponentSchemasNarrowed
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EXPOJ55X.js";
|
|
5
5
|
|
|
6
6
|
// src/schemas/component-union.ts
|
|
7
7
|
import { Type } from "@sinclair/typebox";
|
|
@@ -25,4 +25,4 @@ export {
|
|
|
25
25
|
PptxComponentDefinitionSchema,
|
|
26
26
|
PptxSlideContentSchema
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-KRLDFNJM.js.map
|
|
@@ -38,9 +38,6 @@ function pptxPropsSchemaForRenderer(componentName, schema, renderer) {
|
|
|
38
38
|
syncRequired(copy);
|
|
39
39
|
return copy;
|
|
40
40
|
}
|
|
41
|
-
function isPptxComponentSupported(componentName, renderer) {
|
|
42
|
-
return renderer !== "office-open" || componentName !== "chart";
|
|
43
|
-
}
|
|
44
41
|
function collectPptxRendererErrors(data) {
|
|
45
42
|
if (!data || typeof data !== "object" || Array.isArray(data)) return [];
|
|
46
43
|
const root = data;
|
|
@@ -85,8 +82,8 @@ function collectPptxRendererErrors(data) {
|
|
|
85
82
|
unsupported(`${path}/props/placeholders`, "placeholders");
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
|
-
if (node.name === "chart") {
|
|
89
|
-
unsupported(path
|
|
85
|
+
if (node.name === "chart" && props?.type === "bubble") {
|
|
86
|
+
unsupported(`${path}/props/type`, "bubble charts");
|
|
90
87
|
}
|
|
91
88
|
if (node.name === "image") {
|
|
92
89
|
const fields = {
|
|
@@ -186,7 +183,6 @@ export {
|
|
|
186
183
|
PPTX_RENDERER_IDS,
|
|
187
184
|
DEFAULT_PPTX_RENDERER_ID,
|
|
188
185
|
pptxPropsSchemaForRenderer,
|
|
189
|
-
isPptxComponentSupported,
|
|
190
186
|
collectPptxRendererErrors
|
|
191
187
|
};
|
|
192
|
-
//# sourceMappingURL=chunk-
|
|
188
|
+
//# sourceMappingURL=chunk-OSHLAL7B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/renderer.ts"],"sourcesContent":["import type { TSchema } from '@sinclair/typebox';\nimport type { ValidationError } from '@json-to-office/shared';\n\nexport const PPTX_RENDERER_IDS = ['pptxgenjs', 'office-open'] as const;\nexport type PptxRendererId = (typeof PPTX_RENDERER_IDS)[number];\nexport const DEFAULT_PPTX_RENDERER_ID: PptxRendererId = 'pptxgenjs';\n\n/**\n * Renderer-specific view of one canonical component props schema.\n *\n * This is intentionally a pruning pass rather than a second schema tree. The\n * compiler capability gate remains authoritative for requirements that depend\n * on resolved assets or expanded custom components.\n */\nexport function pptxPropsSchemaForRenderer(\n componentName: string,\n schema: TSchema,\n renderer: PptxRendererId\n): TSchema {\n const copy = cloneSchema(schema);\n const properties = objectProperties(copy);\n\n if (renderer === 'pptxgenjs') {\n if (componentName === 'slide') delete properties?.transition;\n return copy;\n }\n\n switch (componentName) {\n case 'pptx':\n delete properties?.templates;\n break;\n case 'slide':\n delete properties?.template;\n break;\n case 'image':\n for (const key of ['svg', 'sizing', 'rotate', 'rounding', 'hyperlink']) {\n delete properties?.[key];\n }\n break;\n case 'shape':\n delete properties?.flipV;\n break;\n case 'table':\n for (const key of [\n 'autoPage',\n 'autoPageRepeatHeader',\n 'margin',\n 'borderRadius',\n ]) {\n delete properties?.[key];\n }\n pruneOfficeOpenTableCells(copy);\n break;\n }\n\n syncRequired(copy);\n return copy;\n}\n\n/** Static renderer-profile diagnostics used by CLI/library validation. */\nexport function collectPptxRendererErrors(data: unknown): ValidationError[] {\n if (!data || typeof data !== 'object' || Array.isArray(data)) return [];\n const root = data as Record<string, any>;\n const renderer = root.renderer ?? DEFAULT_PPTX_RENDERER_ID;\n\n if (!PPTX_RENDERER_IDS.includes(renderer)) {\n return [\n {\n path: '/renderer',\n message: `Invalid renderer \"${String(renderer)}\". Expected \"pptxgenjs\" or \"office-open\".`,\n code: 'invalid_value',\n },\n ];\n }\n\n const errors: ValidationError[] = [];\n const unsupported = (path: string, feature: string): void => {\n errors.push({\n path,\n message: `The \"${renderer}\" renderer does not support ${feature}.`,\n code: 'unsupported_renderer_feature',\n });\n };\n\n const visit = (node: any, path: string): void => {\n if (Array.isArray(node)) {\n node.forEach((entry, index) => visit(entry, `${path}/${index}`));\n return;\n }\n if (!node || typeof node !== 'object') return;\n\n const props = node.props;\n if (renderer === 'pptxgenjs') {\n if (node.name === 'slide' && props?.transition !== undefined) {\n unsupported(`${path}/props/transition`, 'slide transitions');\n }\n } else {\n if (node.name === 'pptx' && props?.templates !== undefined) {\n unsupported(`${path}/props/templates`, 'masters/templates');\n }\n if (node.name === 'slide') {\n if (props?.template !== undefined) {\n unsupported(`${path}/props/template`, 'masters/templates');\n }\n if (props?.placeholders !== undefined) {\n unsupported(`${path}/props/placeholders`, 'placeholders');\n }\n }\n // Every chart type but one. `@office-open` spells a bubble series as\n // `xValues`/`yValues`/`bubbleSize` rather than categories and values,\n // and there is no unambiguous reading of a category label as a numeric\n // x — so it is refused rather than guessed at. Reaching the backend with\n // the wrong shape throws a TypeError from inside it, which is the worst\n // of the three outcomes.\n if (node.name === 'chart' && props?.type === 'bubble') {\n unsupported(`${path}/props/type`, 'bubble charts');\n }\n if (node.name === 'image') {\n const fields: Record<string, string> = {\n svg: 'SVG images',\n sizing: 'image cropping',\n rotate: 'image transforms',\n rounding: 'image rounding',\n hyperlink: 'element hyperlinks',\n };\n for (const [field, feature] of Object.entries(fields)) {\n if (props?.[field] !== undefined) {\n unsupported(`${path}/props/${field}`, feature);\n }\n }\n }\n if (node.name === 'shape' && props?.flipV !== undefined) {\n unsupported(`${path}/props/flipV`, 'vertical flipping');\n }\n if (node.name === 'table') {\n const fields: Record<string, string> = {\n autoPage: 'table auto-pagination',\n autoPageRepeatHeader: 'table auto-pagination',\n margin: 'table insets',\n borderRadius: 'rounded table corners',\n };\n for (const [field, feature] of Object.entries(fields)) {\n if (props?.[field] !== undefined) {\n unsupported(`${path}/props/${field}`, feature);\n }\n }\n if (Array.isArray(props?.rows)) {\n props.rows.forEach((row: unknown[], rowIndex: number) => {\n if (!Array.isArray(row)) return;\n row.forEach((cell, cellIndex) => {\n if (!cell || typeof cell !== 'object') return;\n for (const [field, feature] of [\n ['colspan', 'merged table cells'],\n ['rowspan', 'merged table cells'],\n ['margin', 'table insets'],\n ] as const) {\n if ((cell as Record<string, unknown>)[field] !== undefined) {\n unsupported(\n `${path}/props/rows/${rowIndex}/${cellIndex}/${field}`,\n feature\n );\n }\n }\n });\n });\n }\n }\n }\n\n for (const [key, value] of Object.entries(node)) {\n if (key !== 'renderer') visit(value, `${path}/${key}`);\n }\n };\n\n visit(root, '');\n return errors;\n}\n\nfunction pruneOfficeOpenTableCells(schema: TSchema): void {\n const rows = objectProperties(schema)?.rows as any;\n const cellUnion = rows?.items?.items;\n const branches = cellUnion?.anyOf;\n if (!Array.isArray(branches)) return;\n for (const branch of branches) {\n const properties = objectProperties(branch);\n if (!properties?.text) continue;\n delete properties.colspan;\n delete properties.rowspan;\n delete properties.margin;\n syncRequired(branch);\n }\n}\n\nfunction objectProperties(\n schema: unknown\n): Record<string, TSchema> | undefined {\n if (!schema || typeof schema !== 'object') return undefined;\n return (schema as { properties?: Record<string, TSchema> }).properties;\n}\n\nfunction syncRequired(schema: TSchema): void {\n const properties = objectProperties(schema);\n const required = (schema as { required?: string[] }).required;\n if (!properties || !required) return;\n const next = required.filter((key) => key in properties);\n if (next.length > 0) (schema as { required?: string[] }).required = next;\n else delete (schema as { required?: string[] }).required;\n}\n\nfunction cloneSchema<T>(value: T): T {\n if (Array.isArray(value)) return value.map(cloneSchema) as T;\n if (!value || typeof value !== 'object') return value;\n const copy = Object.create(Object.getPrototypeOf(value));\n for (const key of Reflect.ownKeys(value as object)) {\n copy[key] = cloneSchema((value as any)[key]);\n }\n return copy;\n}\n"],"mappings":";AAGO,IAAM,oBAAoB,CAAC,aAAa,aAAa;AAErD,IAAM,2BAA2C;AASjD,SAAS,2BACd,eACA,QACA,UACS;AACT,QAAM,OAAO,YAAY,MAAM;AAC/B,QAAM,aAAa,iBAAiB,IAAI;AAExC,MAAI,aAAa,aAAa;AAC5B,QAAI,kBAAkB,QAAS,QAAO,YAAY;AAClD,WAAO;AAAA,EACT;AAEA,UAAQ,eAAe;AAAA,IACrB,KAAK;AACH,aAAO,YAAY;AACnB;AAAA,IACF,KAAK;AACH,aAAO,YAAY;AACnB;AAAA,IACF,KAAK;AACH,iBAAW,OAAO,CAAC,OAAO,UAAU,UAAU,YAAY,WAAW,GAAG;AACtE,eAAO,aAAa,GAAG;AAAA,MACzB;AACA;AAAA,IACF,KAAK;AACH,aAAO,YAAY;AACnB;AAAA,IACF,KAAK;AACH,iBAAW,OAAO;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,GAAG;AACD,eAAO,aAAa,GAAG;AAAA,MACzB;AACA,gCAA0B,IAAI;AAC9B;AAAA,EACJ;AAEA,eAAa,IAAI;AACjB,SAAO;AACT;AAGO,SAAS,0BAA0B,MAAkC;AAC1E,MAAI,CAAC,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,EAAG,QAAO,CAAC;AACtE,QAAM,OAAO;AACb,QAAM,WAAW,KAAK,YAAY;AAElC,MAAI,CAAC,kBAAkB,SAAS,QAAQ,GAAG;AACzC,WAAO;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,SAAS,qBAAqB,OAAO,QAAQ,CAAC;AAAA,QAC9C,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QA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
DEFAULT_PPTX_RENDERER_ID,
|
|
6
6
|
PPTX_RENDERER_IDS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OSHLAL7B.js";
|
|
8
8
|
|
|
9
9
|
// src/schemas/generator.ts
|
|
10
10
|
import { Type } from "@sinclair/typebox";
|
|
@@ -82,4 +82,4 @@ function generateRendererSchema(customComponents, renderer, requireDiscriminator
|
|
|
82
82
|
export {
|
|
83
83
|
generateUnifiedDocumentSchema
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-WQAPVKW2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PptxComponentDefinitionSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KRLDFNJM.js";
|
|
4
4
|
|
|
5
5
|
// src/schemas/document.ts
|
|
6
6
|
var PptxJsonComponentDefinitionSchema = PptxComponentDefinitionSchema;
|
|
@@ -18,4 +18,4 @@ export {
|
|
|
18
18
|
PptxJsonComponentDefinitionSchema,
|
|
19
19
|
PPTX_JSON_SCHEMA_URLS
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-ZIDB7UMH.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PPTX_JSON_SCHEMA_URLS,
|
|
3
3
|
PptxJsonComponentDefinitionSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZIDB7UMH.js";
|
|
5
5
|
import "./chunk-J4OT5Y5B.js";
|
|
6
6
|
import {
|
|
7
7
|
PptxComponentDefinitionSchema,
|
|
8
8
|
PptxSlideContentSchema,
|
|
9
9
|
PptxStandardComponentDefinitionSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KRLDFNJM.js";
|
|
11
11
|
import {
|
|
12
12
|
PPTX_BASE_SCHEMA_METADATA,
|
|
13
13
|
PPTX_COMPONENT_METADATA
|
|
14
14
|
} from "./chunk-RV7W3UXU.js";
|
|
15
15
|
import {
|
|
16
16
|
generateUnifiedDocumentSchema
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WQAPVKW2.js";
|
|
18
18
|
import {
|
|
19
19
|
PPTX_STANDARD_COMPONENTS_REGISTRY,
|
|
20
20
|
PositionSchema,
|
|
@@ -33,12 +33,12 @@ import {
|
|
|
33
33
|
getPptxStandardComponent,
|
|
34
34
|
isPptxStandardComponent,
|
|
35
35
|
pptxComponentRequiresProps
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-EXPOJ55X.js";
|
|
37
37
|
import {
|
|
38
38
|
DEFAULT_PPTX_RENDERER_ID,
|
|
39
39
|
PPTX_RENDERER_IDS,
|
|
40
40
|
collectPptxRendererErrors
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-OSHLAL7B.js";
|
|
42
42
|
import {
|
|
43
43
|
ColorValueSchema,
|
|
44
44
|
SEMANTIC_COLOR_ALIASES,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
getPptxStandardComponent,
|
|
11
11
|
isPptxStandardComponent,
|
|
12
12
|
pptxComponentRequiresProps
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-EXPOJ55X.js";
|
|
14
|
+
import "../chunk-OSHLAL7B.js";
|
|
15
15
|
import "../chunk-N6CABSXM.js";
|
|
16
16
|
import "../chunk-7CKCXKN7.js";
|
|
17
17
|
export {
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
PptxComponentDefinitionSchema,
|
|
3
3
|
PptxSlideContentSchema,
|
|
4
4
|
PptxStandardComponentDefinitionSchema
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-KRLDFNJM.js";
|
|
6
|
+
import "../chunk-EXPOJ55X.js";
|
|
7
|
+
import "../chunk-OSHLAL7B.js";
|
|
8
8
|
import "../chunk-N6CABSXM.js";
|
|
9
9
|
import "../chunk-7CKCXKN7.js";
|
|
10
10
|
export {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
PptxComponentDefinitionSchema,
|
|
4
4
|
PptxSlideContentSchema,
|
|
5
5
|
PptxStandardComponentDefinitionSchema
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-KRLDFNJM.js";
|
|
7
7
|
import {
|
|
8
8
|
GridPositionSchema,
|
|
9
9
|
PositionSchema,
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
SlidePropsSchema,
|
|
15
15
|
TransitionSchema,
|
|
16
16
|
VerticalAlignmentSchema
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-EXPOJ55X.js";
|
|
18
|
+
import "../chunk-OSHLAL7B.js";
|
|
19
19
|
import "../chunk-N6CABSXM.js";
|
|
20
20
|
import {
|
|
21
21
|
GradientFillSchema,
|
package/dist/schemas/document.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PPTX_JSON_SCHEMA_URLS,
|
|
3
3
|
PptxJsonComponentDefinitionSchema
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ZIDB7UMH.js";
|
|
5
5
|
import "../chunk-J4OT5Y5B.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-KRLDFNJM.js";
|
|
7
|
+
import "../chunk-EXPOJ55X.js";
|
|
8
|
+
import "../chunk-OSHLAL7B.js";
|
|
9
9
|
import "../chunk-N6CABSXM.js";
|
|
10
10
|
import "../chunk-7CKCXKN7.js";
|
|
11
11
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateUnifiedDocumentSchema
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-WQAPVKW2.js";
|
|
4
|
+
import "../chunk-EXPOJ55X.js";
|
|
5
|
+
import "../chunk-OSHLAL7B.js";
|
|
6
6
|
import "../chunk-N6CABSXM.js";
|
|
7
7
|
import "../chunk-7CKCXKN7.js";
|
|
8
8
|
export {
|
|
@@ -12,8 +12,7 @@ declare const DEFAULT_PPTX_RENDERER_ID: PptxRendererId;
|
|
|
12
12
|
* on resolved assets or expanded custom components.
|
|
13
13
|
*/
|
|
14
14
|
declare function pptxPropsSchemaForRenderer(componentName: string, schema: TSchema, renderer: PptxRendererId): TSchema;
|
|
15
|
-
declare function isPptxComponentSupported(componentName: string, renderer: PptxRendererId): boolean;
|
|
16
15
|
/** Static renderer-profile diagnostics used by CLI/library validation. */
|
|
17
16
|
declare function collectPptxRendererErrors(data: unknown): ValidationError[];
|
|
18
17
|
|
|
19
|
-
export { DEFAULT_PPTX_RENDERER_ID, PPTX_RENDERER_IDS, type PptxRendererId, collectPptxRendererErrors,
|
|
18
|
+
export { DEFAULT_PPTX_RENDERER_ID, PPTX_RENDERER_IDS, type PptxRendererId, collectPptxRendererErrors, pptxPropsSchemaForRenderer };
|
package/dist/schemas/renderer.js
CHANGED
|
@@ -2,14 +2,12 @@ import {
|
|
|
2
2
|
DEFAULT_PPTX_RENDERER_ID,
|
|
3
3
|
PPTX_RENDERER_IDS,
|
|
4
4
|
collectPptxRendererErrors,
|
|
5
|
-
isPptxComponentSupported,
|
|
6
5
|
pptxPropsSchemaForRenderer
|
|
7
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-OSHLAL7B.js";
|
|
8
7
|
export {
|
|
9
8
|
DEFAULT_PPTX_RENDERER_ID,
|
|
10
9
|
PPTX_RENDERER_IDS,
|
|
11
10
|
collectPptxRendererErrors,
|
|
12
|
-
isPptxComponentSupported,
|
|
13
11
|
pptxPropsSchemaForRenderer
|
|
14
12
|
};
|
|
15
13
|
//# sourceMappingURL=renderer.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@json-to-office/shared-pptx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "PPTX-specific schemas, component registry and validation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@sinclair/typebox": "0.34.38",
|
|
27
|
-
"@json-to-office/shared": "^1.
|
|
27
|
+
"@json-to-office/shared": "^1.3.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "20.11.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/renderer.ts"],"sourcesContent":["import type { TSchema } from '@sinclair/typebox';\nimport type { ValidationError } from '@json-to-office/shared';\n\nexport const PPTX_RENDERER_IDS = ['pptxgenjs', 'office-open'] as const;\nexport type PptxRendererId = (typeof PPTX_RENDERER_IDS)[number];\nexport const DEFAULT_PPTX_RENDERER_ID: PptxRendererId = 'pptxgenjs';\n\n/**\n * Renderer-specific view of one canonical component props schema.\n *\n * This is intentionally a pruning pass rather than a second schema tree. The\n * compiler capability gate remains authoritative for requirements that depend\n * on resolved assets or expanded custom components.\n */\nexport function pptxPropsSchemaForRenderer(\n componentName: string,\n schema: TSchema,\n renderer: PptxRendererId\n): TSchema {\n const copy = cloneSchema(schema);\n const properties = objectProperties(copy);\n\n if (renderer === 'pptxgenjs') {\n if (componentName === 'slide') delete properties?.transition;\n return copy;\n }\n\n switch (componentName) {\n case 'pptx':\n delete properties?.templates;\n break;\n case 'slide':\n delete properties?.template;\n break;\n case 'image':\n for (const key of ['svg', 'sizing', 'rotate', 'rounding', 'hyperlink']) {\n delete properties?.[key];\n }\n break;\n case 'shape':\n delete properties?.flipV;\n break;\n case 'table':\n for (const key of [\n 'autoPage',\n 'autoPageRepeatHeader',\n 'margin',\n 'borderRadius',\n ]) {\n delete properties?.[key];\n }\n pruneOfficeOpenTableCells(copy);\n break;\n }\n\n syncRequired(copy);\n return copy;\n}\n\nexport function isPptxComponentSupported(\n componentName: string,\n renderer: PptxRendererId\n): boolean {\n return renderer !== 'office-open' || componentName !== 'chart';\n}\n\n/** Static renderer-profile diagnostics used by CLI/library validation. */\nexport function collectPptxRendererErrors(data: unknown): ValidationError[] {\n if (!data || typeof data !== 'object' || Array.isArray(data)) return [];\n const root = data as Record<string, any>;\n const renderer = root.renderer ?? DEFAULT_PPTX_RENDERER_ID;\n\n if (!PPTX_RENDERER_IDS.includes(renderer)) {\n return [\n {\n path: '/renderer',\n message: `Invalid renderer \"${String(renderer)}\". Expected \"pptxgenjs\" or \"office-open\".`,\n code: 'invalid_value',\n },\n ];\n }\n\n const errors: ValidationError[] = [];\n const unsupported = (path: string, feature: string): void => {\n errors.push({\n path,\n message: `The \"${renderer}\" renderer does not support ${feature}.`,\n code: 'unsupported_renderer_feature',\n });\n };\n\n const visit = (node: any, path: string): void => {\n if (Array.isArray(node)) {\n node.forEach((entry, index) => visit(entry, `${path}/${index}`));\n return;\n }\n if (!node || typeof node !== 'object') return;\n\n const props = node.props;\n if (renderer === 'pptxgenjs') {\n if (node.name === 'slide' && props?.transition !== undefined) {\n unsupported(`${path}/props/transition`, 'slide transitions');\n }\n } else {\n if (node.name === 'pptx' && props?.templates !== undefined) {\n unsupported(`${path}/props/templates`, 'masters/templates');\n }\n if (node.name === 'slide') {\n if (props?.template !== undefined) {\n unsupported(`${path}/props/template`, 'masters/templates');\n }\n if (props?.placeholders !== undefined) {\n unsupported(`${path}/props/placeholders`, 'placeholders');\n }\n }\n if (node.name === 'chart') {\n unsupported(path || '/', 'native editable charts');\n }\n if (node.name === 'image') {\n const fields: Record<string, string> = {\n svg: 'SVG images',\n sizing: 'image cropping',\n rotate: 'image transforms',\n rounding: 'image rounding',\n hyperlink: 'element hyperlinks',\n };\n for (const [field, feature] of Object.entries(fields)) {\n if (props?.[field] !== undefined) {\n unsupported(`${path}/props/${field}`, feature);\n }\n }\n }\n if (node.name === 'shape' && props?.flipV !== undefined) {\n unsupported(`${path}/props/flipV`, 'vertical flipping');\n }\n if (node.name === 'table') {\n const fields: Record<string, string> = {\n autoPage: 'table auto-pagination',\n autoPageRepeatHeader: 'table auto-pagination',\n margin: 'table insets',\n borderRadius: 'rounded table corners',\n };\n for (const [field, feature] of Object.entries(fields)) {\n if (props?.[field] !== undefined) {\n unsupported(`${path}/props/${field}`, feature);\n }\n }\n if (Array.isArray(props?.rows)) {\n props.rows.forEach((row: unknown[], rowIndex: number) => {\n if (!Array.isArray(row)) return;\n row.forEach((cell, cellIndex) => {\n if (!cell || typeof cell !== 'object') return;\n for (const [field, feature] of [\n ['colspan', 'merged table cells'],\n ['rowspan', 'merged table cells'],\n ['margin', 'table insets'],\n ] as const) {\n if ((cell as Record<string, unknown>)[field] !== undefined) {\n unsupported(\n `${path}/props/rows/${rowIndex}/${cellIndex}/${field}`,\n feature\n );\n }\n }\n });\n });\n }\n }\n }\n\n for (const [key, value] of Object.entries(node)) {\n if (key !== 'renderer') visit(value, `${path}/${key}`);\n }\n };\n\n visit(root, '');\n return errors;\n}\n\nfunction pruneOfficeOpenTableCells(schema: TSchema): void {\n const rows = objectProperties(schema)?.rows as any;\n const cellUnion = rows?.items?.items;\n const branches = cellUnion?.anyOf;\n if (!Array.isArray(branches)) return;\n for (const branch of branches) {\n const properties = objectProperties(branch);\n if (!properties?.text) continue;\n delete properties.colspan;\n delete properties.rowspan;\n delete properties.margin;\n syncRequired(branch);\n }\n}\n\nfunction objectProperties(\n schema: unknown\n): Record<string, TSchema> | undefined {\n if (!schema || typeof schema !== 'object') return undefined;\n return (schema as { properties?: Record<string, TSchema> }).properties;\n}\n\nfunction syncRequired(schema: TSchema): void {\n const properties = objectProperties(schema);\n const required = (schema as { required?: string[] }).required;\n if (!properties || !required) return;\n const next = required.filter((key) => key in properties);\n if (next.length > 0) (schema as { required?: string[] }).required = next;\n else delete (schema as { required?: string[] }).required;\n}\n\nfunction cloneSchema<T>(value: T): T {\n if (Array.isArray(value)) return value.map(cloneSchema) as T;\n if (!value || typeof value !== 'object') return value;\n const copy = Object.create(Object.getPrototypeOf(value));\n for (const key of Reflect.ownKeys(value as object)) {\n copy[key] = cloneSchema((value as any)[key]);\n }\n return copy;\n}\n"],"mappings":";AAGO,IAAM,oBAAoB,CAAC,aAAa,aAAa;AAErD,IAAM,2BAA2C;AASjD,SAAS,2BACd,eACA,QACA,UACS;AACT,QAAM,OAAO,YAAY,MAAM;AAC/B,QAAM,aAAa,iBAAiB,IAAI;AAExC,MAAI,aAAa,aAAa;AAC5B,QAAI,kBAAkB,QAAS,QAAO,YAAY;AAClD,WAAO;AAAA,EACT;AAEA,UAAQ,eAAe;AAAA,IACrB,KAAK;AACH,aAAO,YAAY;AACnB;AAAA,IACF,KAAK;AACH,aAAO,YAAY;AACnB;AAAA,IACF,KAAK;AACH,iBAAW,OAAO,CAAC,OAAO,UAAU,UAAU,YAAY,WAAW,GAAG;AACtE,eAAO,aAAa,GAAG;AAAA,MACzB;AACA;AAAA,IACF,KAAK;AACH,aAAO,YAAY;AACnB;AAAA,IACF,KAAK;AACH,iBAAW,OAAO;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,GAAG;AACD,eAAO,aAAa,GAAG;AAAA,MACzB;AACA,gCAA0B,IAAI;AAC9B;AAAA,EACJ;AAEA,eAAa,IAAI;AACjB,SAAO;AACT;AAEO,SAAS,yBACd,eACA,UACS;AACT,SAAO,aAAa,iBAAiB,kBAAkB;AACzD;AAGO,SAAS,0BAA0B,MAAkC;AAC1E,MAAI,CAAC,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,EAAG,QAAO,CAAC;AACtE,QAAM,OAAO;AACb,QAAM,WAAW,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AAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/component-registry.ts","../src/schemas/components/presentation.ts","../src/schemas/components/template.ts","../src/schemas/components/common.ts","../src/schemas/components/slide.ts"],"sourcesContent":["/**\n * PPTX Component Registry - SINGLE SOURCE OF TRUTH\n *\n * This is the ONLY place where standard PPTX components are defined.\n * All schema generators MUST use this registry.\n */\n\nimport { Type, TSchema } from '@sinclair/typebox';\nimport {\n PPTX_SLIDE_CONTENT_COMPONENTS,\n pptxComponentRequiresProps,\n} from '@json-to-office/shared/schemas/slide-content';\nimport {\n PPTX_RENDERER_IDS,\n isPptxComponentSupported,\n pptxPropsSchemaForRenderer,\n type PptxRendererId,\n} from './renderer';\n\n/**\n * Component definition with metadata\n */\nexport interface PptxStandardComponentDefinition {\n name: string;\n propsSchema: TSchema;\n hasChildren: boolean;\n /**\n * Names of standard components allowed as direct children.\n * Only meaningful when hasChildren is true.\n * Plugin components are always allowed in addition to these.\n * Omit to allow the full recursive union (backward-compat).\n */\n allowedChildren?: readonly string[];\n hasPlaceholders?: boolean;\n category: 'container' | 'content' | 'layout';\n description: string;\n /**\n * Force `props` to stay required even though the props schema accepts `{}`.\n * See `pptxComponentRequiresProps` for when that is legitimate.\n */\n propsRequired?: boolean;\n special?: {\n hasSchemaField?: boolean;\n };\n}\nimport { PresentationPropsSchema } from './components/presentation';\nimport { SlidePropsSchema } from './components/slide';\n\n/**\n * SINGLE SOURCE OF TRUTH for all standard PPTX components\n */\nexport const PPTX_STANDARD_COMPONENTS_REGISTRY: readonly PptxStandardComponentDefinition[] =\n [\n // ========================================================================\n // Container Components (can contain children)\n // ========================================================================\n {\n name: 'pptx',\n propsSchema: PresentationPropsSchema,\n hasChildren: true,\n allowedChildren: ['slide'],\n category: 'container',\n // Every presentation prop is optional, but the root is where a deck\n // states its title, size and theme, and both the published schema and\n // the deep validator have always demanded the key. Keeping it required\n // is a decision, not the schema's own answer, so it is declared.\n propsRequired: true,\n description:\n 'Main presentation container - defines the overall presentation structure. Required as the root component.',\n special: {\n hasSchemaField: true,\n },\n },\n {\n name: 'slide',\n propsSchema: SlidePropsSchema,\n hasChildren: true,\n allowedChildren: PPTX_SLIDE_CONTENT_COMPONENTS.map(({ name }) => name),\n hasPlaceholders: true,\n category: 'container',\n // No `propsRequired`: every slide prop is optional and nothing outside\n // the schema asks for one, so `{ \"name\": \"slide\", \"children\": [...] }`\n // is a whole slide and the published schema says so.\n description:\n 'Slide container - groups content elements on a single slide.',\n },\n\n // Content components are canonical in @json-to-office/shared so DOCX\n // visuals can reuse the exact schemas without depending on shared-pptx.\n ...PPTX_SLIDE_CONTENT_COMPONENTS,\n ] as const;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\nexport function getPptxStandardComponent(\n name: string\n): PptxStandardComponentDefinition | undefined {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.find((c) => c.name === name);\n}\n\nexport function getAllPptxComponentNames(): readonly string[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.map((c) => c.name);\n}\n\nexport function getPptxComponentsByCategory(\n category: PptxStandardComponentDefinition['category']\n): readonly PptxStandardComponentDefinition[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => c.category === category\n );\n}\n\nexport function getPptxContainerComponents(): readonly PptxStandardComponentDefinition[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter((c) => c.hasChildren);\n}\n\nexport function getPptxContentComponents(): readonly PptxStandardComponentDefinition[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.filter((c) => !c.hasChildren);\n}\n\nexport function isPptxStandardComponent(name: string): boolean {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.some((c) => c.name === name);\n}\n\n/**\n * Whether this component must carry a `props` key — the one answer both the\n * published schema and the deep validator read.\n *\n * Re-exported from `@json-to-office/shared` so the registry is the single\n * place a consumer has to look: the rule is the props schema's own (a schema\n * that accepts `{}` demands nothing) unless the definition overrides it.\n */\nexport { pptxComponentRequiresProps };\n\n// ============================================================================\n// Schema Generation Helpers\n// ============================================================================\n\nexport function createPptxComponentSchemaObject(\n component: PptxStandardComponentDefinition,\n recursiveRef?: TSchema,\n placeholderRef?: TSchema,\n profile?: { renderer: PptxRendererId; requireDiscriminator: boolean }\n): TSchema {\n const schema: Record<string, TSchema> = {\n name: Type.Literal(component.name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(\n Type.Boolean({\n default: true,\n description:\n 'When false, this component is filtered out and not rendered. Defaults to true.',\n })\n ),\n };\n\n if (component.special?.hasSchemaField) {\n schema.$schema = Type.Optional(Type.String({ format: 'uri' }));\n schema.renderer = profile\n ? profile.requireDiscriminator\n ? Type.Literal(profile.renderer, {\n description: 'Renderer backend for this presentation',\n })\n : Type.Optional(\n Type.Literal(profile.renderer, {\n description: 'Renderer backend. Omitted defaults to \"pptxgenjs\".',\n })\n )\n : Type.Optional(\n Type.Union(\n PPTX_RENDERER_IDS.map((renderer) => Type.Literal(renderer)),\n {\n description: 'Renderer backend. Omitted defaults to \"pptxgenjs\".',\n }\n )\n );\n }\n\n schema.props = profile\n ? pptxPropsSchemaForRenderer(\n component.name,\n component.propsSchema,\n profile.renderer\n )\n : component.propsSchema;\n\n if (component.hasChildren && recursiveRef) {\n schema.children = Type.Optional(Type.Array(recursiveRef));\n }\n\n if (\n component.hasPlaceholders &&\n (placeholderRef ?? recursiveRef) &&\n profile?.renderer !== 'office-open'\n ) {\n const baseProperties = (schema.props as any).properties ?? {};\n const phRef = placeholderRef ?? recursiveRef!;\n schema.props = Type.Object(\n {\n ...baseProperties,\n placeholders: Type.Optional(\n Type.Record(Type.String(), phRef, {\n description:\n 'Content for named placeholders: { \"title\": { \"name\": \"text\", ... } }',\n })\n ),\n },\n {\n additionalProperties: false,\n description: (component.propsSchema as any).description,\n }\n );\n }\n\n // Optionality is decided from the canonical definition, never from the\n // pruned/placeholder-augmented copy above: the deep validator checks the\n // canonical schema, so reading anything else here is how the published\n // schema and the runtime would start disagreeing about the same document.\n if (!pptxComponentRequiresProps(component)) {\n schema.props = Type.Optional(schema.props);\n }\n\n return Type.Object(schema, {\n additionalProperties: false,\n description: component.description,\n });\n}\n\nexport function createAllPptxComponentSchemas(\n recursiveRef?: TSchema\n): readonly TSchema[] {\n return PPTX_STANDARD_COMPONENTS_REGISTRY.map((component) =>\n createPptxComponentSchemaObject(component, recursiveRef)\n );\n}\n\n/**\n * Build all standard PPTX component schemas with per-container narrowed children.\n *\n * Resolves containers in dependency order so each container's children union\n * only references its allowedChildren. Plugin schemas are always included in\n * every container's children.\n *\n * @param selfRef - The Type.Recursive self-reference (fallback and for plugin children)\n * @param pluginSchemas - Plugin component schemas (always allowed in all containers)\n * @returns Array of TypeBox schemas with narrowed children per container\n */\nexport function createAllPptxComponentSchemasNarrowed(\n selfRef: TSchema,\n pluginSchemas: TSchema[] = [],\n profile?: { renderer: PptxRendererId; requireDiscriminator: boolean }\n): TSchema[] {\n // Phase 1: Build leaf (non-container) component schemas — no children\n const leafSchemas = new Map<string, TSchema>();\n for (const comp of PPTX_STANDARD_COMPONENTS_REGISTRY) {\n if (\n !comp.hasChildren &&\n (!profile || isPptxComponentSupported(comp.name, profile.renderer))\n ) {\n leafSchemas.set(\n comp.name,\n createPptxComponentSchemaObject(comp, undefined, selfRef, profile)\n );\n }\n }\n\n // Phase 2: Resolve containers in dependency order\n const containers = PPTX_STANDARD_COMPONENTS_REGISTRY.filter(\n (c) => c.hasChildren\n );\n const resolved = new Map<string, TSchema>();\n const pending = [...containers];\n\n while (pending.length > 0) {\n const before = pending.length;\n for (let i = pending.length - 1; i >= 0; i--) {\n const comp = pending[i];\n\n if (!comp.allowedChildren) {\n // No allowedChildren declared — fallback to full recursive ref\n resolved.set(\n comp.name,\n createPptxComponentSchemaObject(comp, selfRef, selfRef, profile)\n );\n pending.splice(i, 1);\n continue;\n }\n\n // Check if all container dependencies are resolved\n const containerDeps = comp.allowedChildren.filter((name) =>\n containers.some((c) => c.name === name)\n );\n if (!containerDeps.every((d) => resolved.has(d))) continue;\n\n // Build narrowed children union\n const childSchemas = comp.allowedChildren\n .map((name) => resolved.get(name) ?? leafSchemas.get(name))\n .filter((s): s is TSchema => s !== undefined);\n\n const allChildSchemas = [...childSchemas, ...pluginSchemas];\n const childrenType =\n allChildSchemas.length === 1\n ? allChildSchemas[0]\n : Type.Union(allChildSchemas);\n\n // Placeholders hold what `children` holds: a named slot is a position\n // for a content component, not a second way into the tree. Passing the\n // narrowed union rather than `selfRef` is what stops the published\n // schema from accepting a `slide` — or the `pptx` root — as a\n // placeholder value, which the deep walk also refuses.\n resolved.set(\n comp.name,\n createPptxComponentSchemaObject(\n comp,\n childrenType,\n childrenType,\n profile\n )\n );\n pending.splice(i, 1);\n }\n\n if (pending.length === before) {\n throw new Error(\n `Circular allowedChildren among: ${pending.map((c) => c.name).join(', ')}`\n );\n }\n }\n\n // Combine: containers (resolved) + leaves\n return [...resolved.values(), ...leafSchemas.values()];\n}\n","/**\n * Presentation Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { FontRegistrySchema } from '@json-to-office/shared';\nimport { TemplateSlideDefinitionSchema } from './template';\nimport { GridConfigSchema, ThemeConfigSchema } from '../theme';\nimport { PptxComponentDefaultsSchema } from '../component-defaults';\n\nexport const PresentationPropsSchema = Type.Object(\n {\n title: Type.Optional(\n Type.String({ description: 'Presentation title metadata' })\n ),\n author: Type.Optional(\n Type.String({ description: 'Presentation author metadata' })\n ),\n subject: Type.Optional(\n Type.String({ description: 'Presentation subject metadata' })\n ),\n company: Type.Optional(\n Type.String({ description: 'Company name metadata' })\n ),\n theme: Type.Optional(\n Type.Union(\n [\n Type.String({\n description: 'Theme name to apply (default: \"default\")',\n default: 'default',\n }),\n ThemeConfigSchema,\n ],\n {\n description:\n 'Theme to apply: a built-in/custom theme name (default: ' +\n '\"default\"), or an inline theme config object so the document ' +\n 'stays self-contained',\n }\n )\n ),\n fontRegistry: Type.Optional(FontRegistrySchema),\n slideWidth: Type.Optional(\n Type.Number({\n description: 'Slide width in inches (default: 10)',\n default: 10,\n })\n ),\n slideHeight: Type.Optional(\n Type.Number({\n description: 'Slide height in inches (default: 7.5)',\n default: 7.5,\n })\n ),\n rtlMode: Type.Optional(\n Type.Boolean({ description: 'Right-to-left text direction' })\n ),\n language: Type.Optional(\n Type.String({\n pattern: '^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$',\n description:\n 'Default presentation language (BCP-47 tag, e.g. \"en-US\"). Sets the spell-check language for all text; individual text components can override it.',\n examples: ['en-US', 'fr-FR', 'de-DE', 'it-IT', 'es-ES'],\n })\n ),\n pageNumberFormat: Type.Optional(\n Type.Union([Type.Literal('9'), Type.Literal('09')], {\n description:\n 'Format for {PAGE_NUMBER} placeholders: \"9\" = bare number (default), \"09\" = zero-padded',\n default: '9',\n })\n ),\n componentDefaults: Type.Optional(PptxComponentDefaultsSchema),\n grid: Type.Optional(GridConfigSchema),\n templates: Type.Optional(\n Type.Array(TemplateSlideDefinitionSchema, {\n description: 'Template slide definitions (reusable slide templates)',\n })\n ),\n },\n {\n description: 'Presentation container props',\n additionalProperties: false,\n }\n);\n\nexport type PresentationProps = Static<typeof PresentationPropsSchema>;\n","/**\n * Template Slide Definition Schemas\n */\n\nimport { Type, Static, TSchema } from '@sinclair/typebox';\nimport { SlideBackgroundSchema, GridPositionSchema } from './common';\nimport { ColorValueSchema, GridConfigSchema } from '../theme';\nimport { TextPropsSchema } from './text';\nimport { PptxImagePropsSchema } from './image';\nimport { ShapePropsSchema } from './shape';\nimport { PptxTablePropsSchema } from './table';\nimport { PptxChartPropsSchema } from './chart';\nimport { PptxHighchartsPropsSchema } from './highcharts';\n\n// Position helpers (number in inches OR percentage string e.g. \"50%\")\nconst Coord = Type.Union([\n Type.Number({ description: 'Position/size in inches' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Position/size as percentage of slide dimension (e.g., \"50%\")',\n }),\n]);\n\n// Helper: wrap a props schema into { name, props } component format\nfunction contentComponent(name: string, propsSchema: TSchema) {\n return Type.Object({\n name: Type.Literal(name),\n id: Type.Optional(Type.String()),\n enabled: Type.Optional(Type.Boolean({\n default: true,\n description: 'When false, this component is filtered out and not rendered. Defaults to true.',\n })),\n props: propsSchema,\n }, { additionalProperties: false });\n}\n\n// Content component union — same { name, props } format as slide children\nconst TemplateObjectComponentSchema = Type.Union([\n contentComponent('text', TextPropsSchema),\n contentComponent('image', PptxImagePropsSchema),\n contentComponent('shape', ShapePropsSchema),\n contentComponent('table', PptxTablePropsSchema),\n contentComponent('chart', PptxChartPropsSchema),\n contentComponent('highcharts', PptxHighchartsPropsSchema),\n], {\n discriminator: { propertyName: 'name' },\n description: 'Fixed component on a template slide (same format as slide children)',\n});\n\n// Defaults schema — partial component stub (carries styling props, not content)\n// Discriminated union so Monaco can autocomplete prop names per component type\nfunction defaultsComponent(name: string, propsSchema: TSchema) {\n return Type.Object({\n name: Type.Literal(name),\n props: Type.Partial(propsSchema, { description: 'Default props inherited by the component placed in this placeholder' }),\n }, { additionalProperties: false });\n}\n\nconst PlaceholderDefaultsSchema = Type.Union([\n defaultsComponent('text', TextPropsSchema),\n defaultsComponent('image', PptxImagePropsSchema),\n defaultsComponent('shape', ShapePropsSchema),\n defaultsComponent('table', PptxTablePropsSchema),\n defaultsComponent('chart', PptxChartPropsSchema),\n defaultsComponent('highcharts', PptxHighchartsPropsSchema),\n], {\n discriminator: { propertyName: 'name' },\n description: 'Partial component stub — styling defaults only',\n});\n\n// Placeholder definition\nexport const PlaceholderDefinitionSchema = Type.Object({\n name: Type.String({ description: 'Unique placeholder name' }),\n x: Type.Optional(Coord),\n y: Type.Optional(Coord),\n w: Type.Optional(Coord),\n h: Type.Optional(Coord),\n grid: Type.Optional(GridPositionSchema),\n defaults: Type.Optional(PlaceholderDefaultsSchema),\n}, { additionalProperties: false, description: 'Placeholder on a template slide — defaults is a component stub whose props are inherited by the actual component' });\n\n// Template slide definition\nexport const TemplateSlideDefinitionSchema = Type.Object({\n name: Type.String({ description: 'Unique template slide name' }),\n background: Type.Optional(SlideBackgroundSchema),\n margin: Type.Optional(Type.Union([\n Type.Number({ description: 'Margin in inches (all sides)' }),\n Type.Array(Type.Number(), { minItems: 4, maxItems: 4, description: 'Margin [top, right, bottom, left] in inches' }),\n ])),\n slideNumber: Type.Optional(Type.Object({\n x: Coord, y: Coord,\n w: Type.Optional(Coord),\n h: Type.Optional(Coord),\n color: Type.Optional(ColorValueSchema),\n fontSize: Type.Optional(Type.Number({ description: 'Slide number font size in points' })),\n }, { additionalProperties: false, description: 'Slide number position and styling' })),\n objects: Type.Optional(Type.Array(TemplateObjectComponentSchema, { description: 'Fixed components (logos, footers, decorations) — same { name, props } format as slide children' })),\n placeholders: Type.Optional(Type.Array(PlaceholderDefinitionSchema, { description: 'Placeholder regions for slide content' })),\n grid: Type.Optional(GridConfigSchema),\n}, { additionalProperties: false, description: 'Template slide definition (reusable slide template)' });\n\nexport type PlaceholderDefinition = Static<typeof PlaceholderDefinitionSchema>;\nexport type TemplateSlideDefinition = Static<typeof TemplateSlideDefinitionSchema>;\n","/**\n * Common Types and Schemas for PPTX Components\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport {\n ColorValueSchema,\n GradientFillSchema,\n} from '@json-to-office/shared/schemas/slide-content';\n\nexport {\n PptxAlignmentSchema,\n VerticalAlignmentSchema,\n ShadowSchema,\n GridPositionSchema,\n} from '@json-to-office/shared/schemas/slide-content';\n\nexport type {\n PptxAlignment,\n VerticalAlignment,\n Shadow,\n GridPosition,\n} from '@json-to-office/shared/schemas/slide-content';\n\nexport const PositionSchema = Type.Object(\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 position as percentage (e.g., \"10%\")',\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 position as percentage (e.g., \"10%\")',\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 (e.g., \"80%\")',\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 (e.g., \"20%\")',\n }),\n ])\n ),\n },\n {\n description: 'Position and size in inches or percentages',\n additionalProperties: false,\n }\n);\n\nexport const SlideBackgroundSchema = Type.Object(\n {\n color: Type.Optional(ColorValueSchema),\n gradient: Type.Optional(GradientFillSchema),\n image: Type.Optional(\n Type.Object(\n {\n path: Type.Optional(\n Type.String({ description: 'Image file path or URL' })\n ),\n base64: Type.Optional(\n Type.String({ description: 'Base64-encoded image data' })\n ),\n },\n { description: 'Background image', additionalProperties: false }\n )\n ),\n },\n {\n description: 'Slide background configuration',\n additionalProperties: false,\n }\n);\n\nexport const TransitionSchema = Type.Object(\n {\n type: Type.Optional(\n Type.Union(\n [\n Type.Literal('fade'),\n Type.Literal('push'),\n Type.Literal('wipe'),\n Type.Literal('zoom'),\n Type.Literal('none'),\n ],\n { description: 'Transition effect type' }\n )\n ),\n speed: Type.Optional(\n Type.Union(\n [Type.Literal('slow'), Type.Literal('medium'), Type.Literal('fast')],\n { description: 'Transition speed' }\n )\n ),\n },\n {\n description: 'Slide transition configuration',\n additionalProperties: false,\n }\n);\n\nexport type Position = Static<typeof PositionSchema>;\nexport type SlideBackground = Static<typeof SlideBackgroundSchema>;\nexport type Transition = Static<typeof TransitionSchema>;\n","/**\n * Slide Component Schema\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { SlideBackgroundSchema, TransitionSchema } from './common';\n\nexport const SlidePropsSchema = Type.Object(\n {\n meta: Type.Optional(\n Type.Object(\n {\n title: Type.Optional(\n Type.String({\n description:\n 'Authoring label for this slide, shown in editors and outlines. Never rendered — slide content is unaffected.',\n })\n ),\n },\n {\n additionalProperties: false,\n description: 'Authoring metadata; has no effect on the presentation.',\n }\n )\n ),\n background: Type.Optional(SlideBackgroundSchema),\n transition: Type.Optional(TransitionSchema),\n notes: Type.Optional(\n Type.String({ description: 'Speaker notes for this slide' })\n ),\n layout: Type.Optional(\n Type.String({\n description: 'Slide layout name (e.g., \"Title Slide\", \"Blank\")',\n })\n ),\n hidden: Type.Optional(\n Type.Boolean({ description: 'Hide this slide from presentation' })\n ),\n template: Type.Optional(\n Type.String({ description: 'Template slide name to apply' })\n ),\n // Note: `placeholders` is added dynamically by the component registry\n // with the recursive component ref, to avoid circular imports.\n },\n {\n description: 'Slide container props',\n additionalProperties: false,\n }\n);\n\nexport type SlideProps = Static<typeof SlidePropsSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,QAAAA,aAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACPP,SAAS,QAAAC,aAAoB;AAC7B,SAAS,0BAA0B;;;ACDnC,SAAS,QAAAC,aAA6B;;;ACAtC,SAAS,YAAoB;AAC7B;AAAA,EACE,oBAAAC;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASA,IAAM,iBAAiB,KAAK;AAAA,EACjC;AAAA,IACE,GAAG,KAAK;AAAA,MACN,KAAK,MAAM;AAAA,QACT,KAAK,OAAO,EAAE,aAAa,uBAAuB,CAAC;AAAA,QACnD,KAAK,OAAO;AAAA,UACV,SAAS;AAAA,UACT,aAAa;AAAA,QACf,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,IACA,GAAG,KAAK;AAAA,MACN,KAAK,MAAM;AAAA,QACT,KAAK,OAAO,EAAE,aAAa,uBAAuB,CAAC;AAAA,QACnD,KAAK,OAAO;AAAA,UACV,SAAS;AAAA,UACT,aAAa;AAAA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KAAK,GAAG,KAAK;AAC5C,YAAM,OAAO,QAAQ,CAAC;AAEtB,UAAI,CAAC,KAAK,iBAAiB;AAEzB,iBAAS;AAAA,UACP,KAAK;AAAA,UACL,gCAAgC,MAAM,SAAS,SAAS,OAAO;AAAA,QACjE;AACA,gBAAQ,OAAO,GAAG,CAAC;AACnB;AAAA,MACF;AAGA,YAAM,gBAAgB,KAAK,gBAAgB;AAAA,QAAO,CAAC,SACjD,WAAW,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AAAA,MACxC;AACA,UAAI,CAAC,cAAc,MAAM,CAAC,MAAM,SAAS,IAAI,CAAC,CAAC,EAAG;AAGlD,YAAM,eAAe,KAAK,gBACvB,IAAI,CAAC,SAAS,SAAS,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,EACzD,OAAO,CAAC,MAAoB,MAAM,MAAS;AAE9C,YAAM,kBAAkB,CAAC,GAAG,cAAc,GAAG,aAAa;AAC1D,YAAM,eACJ,gBAAgB,WAAW,IACvB,gBAAgB,CAAC,IACjBA,MAAK,MAAM,eAAe;AAOhC,eAAS;AAAA,QACP,KAAK;AAAA,QACL;AAAA,UACE;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AACA,cAAQ,OAAO,GAAG,CAAC;AAAA,IACrB;AAEA,QAAI,QAAQ,WAAW,QAAQ;AAC7B,YAAM,IAAI;AAAA,QACR,mCAAmC,QAAQ,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;AAAA,MAC1E;AAAA,IACF;AAAA,EACF;AAGA,SAAO,CAAC,GAAG,SAAS,OAAO,GAAG,GAAG,YAAY,OAAO,CAAC;AACvD;","names":["Type","Type","Type","ColorValueSchema","Type","Type","Type","Type","Type"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|