@officedk/pptxdk 0.1.0 → 0.2.1
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/build.d.ts +14 -76
- package/dist/build.js +69 -97
- package/dist/cli.js +1 -1
- package/dist/core/dist/capabilities/audio/audio-declaration.js +7 -0
- package/dist/core/dist/capabilities/audio/audio-source.js +172 -0
- package/dist/core/dist/capabilities/audio/entry.js +122 -0
- package/dist/core/dist/capabilities/box/box-codegen.js +83 -0
- package/dist/core/dist/capabilities/box/box-declaration.js +32 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box.js +32 -29
- package/dist/core/dist/capabilities/box/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-codegen.js +17 -22
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-import.js +1025 -471
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-labels.js +30 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-model.js +3 -3
- package/dist/{capabilities/dist/chart/preview/number-format.js → core/dist/capabilities/chart/chart-number-format.js} +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-schemas.js +216 -212
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-xml.js +41 -36
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart.js +228 -171
- package/dist/core/dist/capabilities/chart/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/axes-and-grid.js +23 -10
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/bar-column.js +1 -1
- package/dist/core/dist/capabilities/chart/preview/data-labels.js +474 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/error-bars.js +3 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/index.js +30 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/layout.js +160 -89
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/legend.js +4 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/line-area.js +4 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/markers.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/pie-doughnut.js +39 -60
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scales.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scatter.js +3 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/style.js +15 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/text-render.js +34 -24
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/trendlines.js +5 -5
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/types.js +1 -1
- package/dist/core/dist/capabilities/comment/comment-codegen.js +25 -0
- package/dist/core/dist/capabilities/comment/comment-declaration.js +37 -0
- package/dist/core/dist/capabilities/comment/comment-import.js +176 -0
- package/dist/core/dist/capabilities/comment/comment.js +141 -0
- package/dist/core/dist/capabilities/comment/entry.js +1 -0
- package/dist/core/dist/capabilities/footer-placeholder/entry.js +2 -0
- package/dist/core/dist/capabilities/footer-placeholder/footer-placeholder-codegen.js +16 -0
- package/dist/{capabilities/dist/masters → core/dist/capabilities/footer-placeholder}/footer-placeholder.js +194 -133
- package/dist/core/dist/capabilities/footer-placeholder/print-header-footer-import.js +121 -0
- package/dist/core/dist/capabilities/footer-placeholder/print-header-footer.js +123 -0
- package/dist/core/dist/capabilities/group/entry.js +2 -0
- package/dist/core/dist/capabilities/group/group-codegen.js +73 -0
- package/dist/core/dist/capabilities/group/group-declaration.js +41 -0
- package/dist/core/dist/capabilities/group/group-import.js +608 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-xml.js +4 -3
- package/dist/core/dist/capabilities/group/group.js +260 -0
- package/dist/core/dist/capabilities/image/entry.js +4 -0
- package/dist/core/dist/capabilities/image/image-codegen.js +59 -0
- package/dist/core/dist/capabilities/image/image-declaration.js +8 -0
- package/dist/core/dist/capabilities/image/image-import.js +26 -0
- package/dist/core/dist/capabilities/image/image.js +57 -0
- package/dist/core/dist/capabilities/line/entry.js +3 -0
- package/dist/core/dist/capabilities/line/line-codegen.js +88 -0
- package/dist/core/dist/capabilities/line/line-declaration.js +78 -0
- package/dist/core/dist/capabilities/line/line-import.js +424 -0
- package/dist/core/dist/capabilities/line/line-xml.js +9 -0
- package/dist/core/dist/capabilities/line/line.js +329 -0
- package/dist/core/dist/capabilities/masters/entry.js +1 -0
- package/dist/core/dist/capabilities/masters/masters-codegen.js +50 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters.js +35 -47
- package/dist/core/dist/capabilities/motion/entry.js +5 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-codegen.js +97 -51
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-import.js +653 -102
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-plan.js +317 -163
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-query.js +9 -6
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion.js +357 -108
- package/dist/core/dist/capabilities/notes/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-codegen.js +5 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-import.js +16 -13
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-schemas.js +12 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes.js +20 -42
- package/dist/{import/dist/sections.js → core/dist/capabilities/notes/sections-import.js} +5 -5
- package/dist/core/dist/capabilities/placeholder/entry.js +3 -0
- package/dist/core/dist/capabilities/placeholder/placeholder-codegen.js +44 -0
- package/dist/core/dist/capabilities/placeholder/placeholder-schemas.js +31 -0
- package/dist/core/dist/capabilities/placeholder/placeholder.js +394 -0
- package/dist/core/dist/capabilities/shape/entry.js +6 -0
- package/dist/core/dist/capabilities/shape/shape-codegen.js +112 -0
- package/dist/core/dist/capabilities/shape/shape-import.js +152 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape.js +100 -103
- package/dist/core/dist/capabilities/shared/container-slots.js +59 -0
- package/dist/core/dist/capabilities/shared/date-time.js +98 -0
- package/dist/core/dist/capabilities/shared/font/font-embedding.js +118 -0
- package/dist/core/dist/capabilities/shared/font/font-engine.js +855 -0
- package/dist/core/dist/capabilities/shared/font/font-import.js +805 -0
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-subset.js +24 -9
- package/dist/core/dist/capabilities/shared/font/font.js +72 -0
- package/dist/{capabilities/dist/shape/shape-codegen.js → core/dist/capabilities/shared/geometry-codegen.js} +4 -69
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/geometry.js +384 -123
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/identity.js +56 -38
- package/dist/core/dist/capabilities/shared/image-codegen.js +94 -0
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-decode.js +17 -56
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-schemas.js +49 -61
- package/dist/core/dist/capabilities/shared/line-match.js +78 -0
- package/dist/core/dist/capabilities/shared/media-codegen.js +86 -0
- package/dist/core/dist/capabilities/shared/media-import.js +156 -0
- package/dist/core/dist/capabilities/shared/media-placement.js +20 -0
- package/dist/core/dist/capabilities/shared/media-poster.js +50 -0
- package/dist/core/dist/capabilities/shared/media-schemas.js +60 -0
- package/dist/core/dist/capabilities/shared/media-source.js +107 -0
- package/dist/core/dist/capabilities/shared/media-trim.js +102 -0
- package/dist/core/dist/capabilities/shared/media.js +134 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/morph-api.js +5 -5
- package/dist/core/dist/capabilities/shared/motion-api.js +770 -0
- package/dist/core/dist/capabilities/shared/motion-schemas.js +353 -0
- package/dist/{capabilities/dist/image/image-import.js → core/dist/capabilities/shared/picture-import.js} +313 -168
- package/dist/core/dist/capabilities/shared/picture-xml.js +13 -0
- package/dist/core/dist/capabilities/shared/picture.js +510 -0
- package/dist/core/dist/capabilities/shared/placeholder-import.js +268 -0
- package/dist/core/dist/capabilities/shared/placeholder-roles.js +42 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/preset-definitions.js +1221 -188
- package/dist/core/dist/capabilities/shared/print-xml.js +77 -0
- package/dist/core/dist/capabilities/shared/rich-text-codegen.js +119 -0
- package/dist/core/dist/capabilities/shared/rich-text-import.js +472 -0
- package/dist/core/dist/capabilities/shared/shape-declaration.js +45 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/style-inheritance.js +26 -24
- package/dist/core/dist/capabilities/shared/text-declaration.js +31 -0
- package/dist/core/dist/capabilities/shared/text-schemas.js +241 -0
- package/dist/core/dist/capabilities/shared/text-service.js +2563 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/visual.js +441 -137
- package/dist/core/dist/capabilities/slide-background/entry.js +1 -0
- package/dist/core/dist/capabilities/slide-background/slide-background-codegen.js +15 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-import.js +12 -7
- package/dist/core/dist/capabilities/slide-background/slide-background-xml.js +33 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background.js +61 -50
- package/dist/core/dist/capabilities/table/entry.js +2 -0
- package/dist/core/dist/capabilities/table/table-codegen.js +118 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-import.js +116 -84
- package/dist/core/dist/capabilities/table/table-schemas.js +337 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-xml.js +13 -15
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table.js +284 -192
- package/dist/core/dist/capabilities/text/entry.js +3 -0
- package/dist/core/dist/capabilities/text/text-codegen.js +66 -0
- package/dist/core/dist/capabilities/text/text-import.js +468 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/text/text-xml.js +3 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/text/text.js +103 -111
- package/dist/core/dist/capabilities/transition/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-api.js +13 -16
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-codegen.js +2 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-import.js +25 -27
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition.js +23 -23
- package/dist/core/dist/capabilities/video/entry.js +77 -0
- package/dist/core/dist/capabilities/video/video-declaration.js +7 -0
- package/dist/core/dist/capabilities/video/video-source.js +42 -0
- package/dist/{codegen/dist → core/dist/codegen}/assets.js +16 -10
- package/dist/{codegen/dist → core/dist/codegen}/codegen.js +152 -140
- package/dist/{codegen/dist → core/dist/codegen}/identifiers.js +27 -1
- package/dist/{codegen/dist → core/dist/codegen}/index.js +2 -2
- package/dist/{codegen/dist → core/dist/codegen}/printer.js +23 -4
- package/dist/core/dist/document/all.js +41 -0
- package/dist/core/dist/document/default.js +10 -0
- package/dist/core/dist/document/document.js +218 -0
- package/dist/core/dist/document/index.js +62 -0
- package/dist/core/dist/document/stages.js +54 -0
- package/dist/{emit/dist → core/dist/emit}/emit.js +173 -90
- package/dist/core/dist/emit/index.js +6 -0
- package/dist/core/dist/emit/ooxml.js +241 -0
- package/dist/core/dist/import/import.js +547 -0
- package/dist/core/dist/import/index.js +19 -0
- package/dist/{import/dist → core/dist/import}/masters.js +404 -328
- package/dist/core/dist/import/media-timing.js +233 -0
- package/dist/{import/dist → core/dist/import}/notes-masters.js +48 -45
- package/dist/core/dist/index.js +47 -15
- package/dist/core/dist/{author-ids.js → kernel/author-ids.js} +9 -6
- package/dist/core/dist/{author-schemas.js → kernel/author-schemas.js} +105 -127
- package/dist/core/dist/{block-flex-layout.js → kernel/block-flex-layout.js} +225 -142
- package/dist/core/dist/kernel/build.js +4 -0
- package/dist/core/dist/kernel/capability.js +17 -0
- package/dist/core/dist/kernel/codegen.js +97 -0
- package/dist/core/dist/kernel/container-slots.js +104 -0
- package/dist/core/dist/kernel/date-time-format.js +18 -0
- package/dist/core/dist/kernel/declaration-snapshot.js +68 -0
- package/dist/core/dist/{declaration.js → kernel/declaration.js} +3 -2
- package/dist/core/dist/kernel/diagnostics.js +370 -0
- package/dist/core/dist/kernel/document-internals.js +26 -0
- package/dist/core/dist/{document.js → kernel/document.js} +23 -13
- package/dist/core/dist/kernel/drawing-units.js +14 -0
- package/dist/core/dist/kernel/font-seal.js +204 -0
- package/dist/core/dist/{geometry-schemas.js → kernel/geometry-schemas.js} +21 -18
- package/dist/core/dist/{grid-layout.js → kernel/grid-layout.js} +177 -72
- package/dist/core/dist/{host.js → kernel/host.js} +1 -1
- package/dist/core/dist/kernel/index.js +24 -0
- package/dist/core/dist/kernel/input-values.js +62 -0
- package/dist/core/dist/kernel/layout-definition.js +7 -0
- package/dist/core/dist/{layout-protocol.js → kernel/layout-protocol.js} +5 -10
- package/dist/core/dist/{layout-schemas.js → kernel/layout-schemas.js} +33 -44
- package/dist/core/dist/kernel/layout.js +339 -0
- package/dist/core/dist/kernel/masters.js +171 -0
- package/dist/core/dist/{morph.js → kernel/morph.js} +1 -1
- package/dist/core/dist/kernel/placeholders.js +289 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/alternate-content.js +1 -1
- package/dist/{import/dist → core/dist/kernel/pptx-read}/diagnostics.js +33 -29
- package/dist/core/dist/kernel/pptx-read/drawing-list-import.js +251 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/fonts.js +71 -12
- package/dist/core/dist/kernel/pptx-read/index.js +15 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/mechanism.js +1 -1
- package/dist/core/dist/kernel/pptx-read/media.js +26 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/namespaces.js +6 -7
- package/dist/{import/dist → core/dist/kernel/pptx-read}/opc.js +62 -13
- package/dist/{import/dist → core/dist/kernel/pptx-read}/resources.js +1 -1
- package/dist/core/dist/kernel/pptx-read/shape-tree.js +57 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/themes.js +182 -41
- package/dist/{import/dist → core/dist/kernel/pptx-read}/visual.js +175 -88
- package/dist/core/dist/kernel/pptx-read/xml-fragments.js +320 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-reader.js +8 -1
- package/dist/{emit/dist → core/dist/kernel/pptx-write}/shape-tree.js +1 -1
- package/dist/core/dist/kernel/pptx-write/timing.js +52 -0
- package/dist/{emit/dist/ooxml.js → core/dist/kernel/pptx-write/xml.js} +133 -290
- package/dist/core/dist/{query.js → kernel/query.js} +76 -37
- package/dist/core/dist/{resolution.js → kernel/resolution.js} +2 -1
- package/dist/core/dist/kernel/resolve-work.js +58 -0
- package/dist/core/dist/{resolve.js → kernel/resolve.js} +797 -409
- package/dist/core/dist/kernel/resource-source.js +11 -0
- package/dist/core/dist/kernel/stage-options.js +312 -0
- package/dist/core/dist/{theme.js → kernel/theme.js} +399 -289
- package/dist/core/dist/kernel/transform-geometry.js +72 -0
- package/dist/core/dist/kernel/xml-values.js +13 -0
- package/dist/document-C0lPlH-L.d.ts +1442 -0
- package/dist/index-B9_OUeA-.d.ts +2238 -0
- package/dist/index-BJEzQxWV.d.ts +75 -0
- package/dist/index-DA9flrlR.d.ts +146 -0
- package/dist/index-GSt0t9VO.d.ts +54 -0
- package/dist/index.d.ts +7 -7
- package/dist/index.js +75 -61
- package/dist/node.d.ts +37 -35
- package/dist/node.js +125 -51
- package/dist/pptxdk/src/cli-commands.js +79 -81
- package/dist/pptxdk/src/compose.js +32 -24
- package/dist/pptxdk/src/preview-result.js +24 -0
- package/dist/{capabilities/dist/image → preview/dist}/gif-decoder.js +5 -5
- package/dist/preview/dist/index.js +229 -77
- package/dist/preview/dist/options.js +17 -26
- package/dist/preview/dist/raster.js +66 -0
- package/dist/preview/dist/svg-guard.js +1090 -0
- package/dist/preview.d.ts +6 -3
- package/dist/preview.js +8 -24
- package/dist/react/dist/append.js +3 -3
- package/dist/react/dist/author/audio-elements.js +14 -0
- package/dist/{capabilities/dist/box → react/dist/author}/box-elements.js +5 -3
- package/dist/react/dist/author/chart-elements.js +14 -0
- package/dist/react/dist/author/comment-elements.js +15 -0
- package/dist/react/dist/author/group-elements.js +14 -0
- package/dist/react/dist/author/image-elements.js +14 -0
- package/dist/react/dist/author/line-elements.js +14 -0
- package/dist/{capabilities/dist/motion → react/dist/author}/motion-elements.js +6 -4
- package/dist/react/dist/author/notes-elements.js +14 -0
- package/dist/react/dist/author/placeholder-elements.js +14 -0
- package/dist/react/dist/author/shape-elements.js +14 -0
- package/dist/{capabilities/dist/table → react/dist/author}/table-elements.js +6 -4
- package/dist/react/dist/author/text-elements.js +64 -0
- package/dist/react/dist/author/video-elements.js +14 -0
- package/dist/react/dist/document-adapter.js +376 -37
- package/dist/react/dist/elements.js +30 -4
- package/dist/react/dist/from-vanilla.js +57 -0
- package/dist/react/dist/index.js +47 -12
- package/dist/react/dist/mount.js +34 -0
- package/dist/react/dist/reconciler.js +26 -26
- package/dist/react.d.ts +174 -50
- package/dist/react.js +31 -27
- package/dist/stages-DYHSHKt4.d.ts +80 -0
- package/dist/vanilla.d.ts +4 -4
- package/dist/vanilla.js +14 -14
- package/package.json +6 -8
- package/README.md +0 -49
- package/dist/capabilities/dist/all.js +0 -32
- package/dist/capabilities/dist/box/box-codegen.js +0 -51
- package/dist/capabilities/dist/box/box-declaration.js +0 -31
- package/dist/capabilities/dist/chart/chart-elements.js +0 -12
- package/dist/capabilities/dist/chart/preview/data-labels.js +0 -334
- package/dist/capabilities/dist/document.js +0 -148
- package/dist/capabilities/dist/font/font-embedding.js +0 -289
- package/dist/capabilities/dist/font/font-family.js +0 -10
- package/dist/capabilities/dist/font/font-import.js +0 -302
- package/dist/capabilities/dist/font/font.js +0 -25
- package/dist/capabilities/dist/group/group-codegen.js +0 -51
- package/dist/capabilities/dist/group/group-declaration.js +0 -42
- package/dist/capabilities/dist/group/group-elements.js +0 -12
- package/dist/capabilities/dist/group/group-import.js +0 -319
- package/dist/capabilities/dist/group/group.js +0 -211
- package/dist/capabilities/dist/image/image-codegen.js +0 -94
- package/dist/capabilities/dist/image/image-declaration.js +0 -8
- package/dist/capabilities/dist/image/image-elements.js +0 -12
- package/dist/capabilities/dist/image/image-xml.js +0 -12
- package/dist/capabilities/dist/image/image.js +0 -472
- package/dist/capabilities/dist/masters/masters-codegen.js +0 -21
- package/dist/capabilities/dist/motion/motion-api.js +0 -527
- package/dist/capabilities/dist/motion/motion-schemas.js +0 -216
- package/dist/capabilities/dist/notes/notes-elements.js +0 -12
- package/dist/capabilities/dist/notes/notes-xml.js +0 -38
- package/dist/capabilities/dist/placeholder/placeholder-codegen.js +0 -23
- package/dist/capabilities/dist/placeholder/placeholder-elements.js +0 -12
- package/dist/capabilities/dist/placeholder/placeholder.js +0 -292
- package/dist/capabilities/dist/shape/shape-declaration.js +0 -57
- package/dist/capabilities/dist/shape/shape-elements.js +0 -12
- package/dist/capabilities/dist/shape/shape-import.js +0 -579
- package/dist/capabilities/dist/shared/placeholder-import.js +0 -113
- package/dist/capabilities/dist/shared/style-parse.js +0 -11
- package/dist/capabilities/dist/shared/text-schemas.js +0 -216
- package/dist/capabilities/dist/shared/text-service.js +0 -1883
- package/dist/capabilities/dist/slide-background/slide-background-codegen.js +0 -44
- package/dist/capabilities/dist/slide-background/slide-background-xml.js +0 -21
- package/dist/capabilities/dist/table/table-codegen.js +0 -81
- package/dist/capabilities/dist/table/table-schemas.js +0 -279
- package/dist/capabilities/dist/text/text-codegen.js +0 -129
- package/dist/capabilities/dist/text/text-declaration.js +0 -19
- package/dist/capabilities/dist/text/text-elements.js +0 -38
- package/dist/capabilities/dist/text/text-import.js +0 -1077
- package/dist/capability-D_xeNVIw.d.ts +0 -29496
- package/dist/codegen/dist/types.js +0 -49
- package/dist/core/dist/build.js +0 -4
- package/dist/core/dist/capability.js +0 -13
- package/dist/core/dist/diagnostics.js +0 -21
- package/dist/core/dist/document-internals.js +0 -13
- package/dist/core/dist/input-values.js +0 -45
- package/dist/core/dist/layout.js +0 -299
- package/dist/core/dist/masters.js +0 -169
- package/dist/core/dist/placeholders.js +0 -213
- package/dist/core/dist/stage-options.js +0 -67
- package/dist/document-BHPUODPP.d.ts +0 -27759
- package/dist/emit/dist/index.js +0 -5
- package/dist/import/dist/import.js +0 -504
- package/dist/import/dist/index.js +0 -16
- package/dist/import/dist/xml-fragments.js +0 -36
- package/dist/index-B5m3hqjC.d.ts +0 -7
- package/dist/index-CCy-Yo8G.d.ts +0 -1208
- package/dist/index-DpxcZ4Gs.d.ts +0 -725
- package/dist/pptxdk/src/slide.js +0 -9
- package/dist/preview-Cfw0QdMM.d.ts +0 -86
- package/dist/transition-Cips9wma.d.ts +0 -82
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// ../codegen/dist/types.js
|
|
3
|
-
/** Supported author source generation syntax targets. */
|
|
4
|
-
const codegenTargetSchema = z.enum(["vanilla", "react"]);
|
|
5
|
-
/** Options controlling `codegen` target syntax output. */
|
|
6
|
-
const codegenOptionsSchema = z.object({ target: codegenTargetSchema }).readonly();
|
|
7
|
-
const codegenDiagnosticCodeSchema = z.enum([
|
|
8
|
-
"invalid-document",
|
|
9
|
-
"invalid-options",
|
|
10
|
-
"unsupported-declaration",
|
|
11
|
-
"unsupported-slide-property",
|
|
12
|
-
"unexpressible-value"
|
|
13
|
-
]);
|
|
14
|
-
const codegenDiagnosticSchema = z.object({
|
|
15
|
-
severity: z.literal("error"),
|
|
16
|
-
path: z.string(),
|
|
17
|
-
code: codegenDiagnosticCodeSchema,
|
|
18
|
-
message: z.string()
|
|
19
|
-
}).readonly();
|
|
20
|
-
/** Structured error thrown when an editable document cannot be expressed in generated source. */
|
|
21
|
-
var CodegenError = class extends Error {
|
|
22
|
-
diagnostics;
|
|
23
|
-
constructor(diagnostics) {
|
|
24
|
-
const first = diagnostics[0];
|
|
25
|
-
super(first === void 0 ? "Codegen failed" : `${first.path}: ${first.message} (${first.code})`);
|
|
26
|
-
this.name = "CodegenError";
|
|
27
|
-
this.diagnostics = Object.freeze([...diagnostics]);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const codegenExprBrand = Symbol("CodegenExpr");
|
|
31
|
-
/** Marks a raw TypeScript/JSX expression string produced by a capability serializer. */
|
|
32
|
-
function expr(code) {
|
|
33
|
-
return Object.freeze({
|
|
34
|
-
[codegenExprBrand]: true,
|
|
35
|
-
code
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function isCodegenExpr(value) {
|
|
39
|
-
return typeof value === "object" && value !== null && codegenExprBrand in value && typeof value.code === "string";
|
|
40
|
-
}
|
|
41
|
-
/** Typed helper for authoring object capability `codegen` contributions. */
|
|
42
|
-
function defineObjectCodegen(contribution) {
|
|
43
|
-
return Object.freeze(contribution);
|
|
44
|
-
}
|
|
45
|
-
/** Typed helper for authoring slide capability `codegen` contributions. */
|
|
46
|
-
function defineSlideCodegen(contribution) {
|
|
47
|
-
return Object.freeze(contribution);
|
|
48
|
-
}
|
|
49
|
-
export { CodegenError, codegenDiagnosticCodeSchema, codegenDiagnosticSchema, codegenOptionsSchema, codegenTargetSchema, defineObjectCodegen, defineSlideCodegen, expr, isCodegenExpr };
|
package/dist/core/dist/build.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { BuildError, CapabilityError } from "./diagnostics.js";
|
|
2
|
-
import { createResolver } from "./resolve.js";
|
|
3
|
-
import { buildOptionsSchema, diagnosticSchema, diagnosticSeveritySchema, emitOptionsSchema, extensionSchema, fontEmbeddingModeSchema, formatBaseline, formatBaselineSchema, resolveOptionsSchema, targetNameSchema, targetSchema, targets } from "./stage-options.js";
|
|
4
|
-
export { BuildError, CapabilityError, buildOptionsSchema, createResolver, diagnosticSchema, diagnosticSeveritySchema, emitOptionsSchema, extensionSchema, fontEmbeddingModeSchema, formatBaseline, formatBaselineSchema, resolveOptionsSchema, targetNameSchema, targetSchema, targets };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CapabilityError } from "./diagnostics.js";
|
|
2
|
-
import { authorIdSchema } from "./author-ids.js";
|
|
3
|
-
import { linkTargetSchema, parseLinkTarget, slideBackgroundSchema, slideFooterValueSchema, slideNumberValueSchema } from "./author-schemas.js";
|
|
4
|
-
import { createMorphScope, getMorphKeyLabel, isMorphKey } from "./morph.js";
|
|
5
|
-
import { footerPlaceholdersSchema, headerFooterSchema } from "./masters.js";
|
|
6
|
-
import { customGeometrySchema, geometryAdjustKeySchema, geometryAdjustSchema, geometrySchema, presetGeometryNameSchema, presetGeometryTuple } from "./geometry-schemas.js";
|
|
7
|
-
import { layoutStyleSchema } from "./layout-schemas.js";
|
|
8
|
-
import "./stage-options.js";
|
|
9
|
-
import { applyFormatColorTransforms, assertValidLang, bcp47LangSchema, colorValueSchema, defaultColorMap, defaultTheme, defineTheme, fontOptionsSchema, fontSchema, isFont, isTheme, linearGradientSchema, radialGradientSchema, schemeColorNameSchema, shadowSchema, textStyleFrom, textStyleKeys, textStyleSchema, themeScopeSchema, validateTextStyle, visualStyleSchema } from "./theme.js";
|
|
10
|
-
import { masterTextStyleCategoryForRole, matchLayoutPlaceholderKey, matchMasterPlaceholderSpec, nativePlaceholderRefSchema, placeholderRoleSchema, placeholderStyleSchema, textListSchema } from "./placeholders.js";
|
|
11
|
-
import { paddingStyleKeys } from "./block-flex-layout.js";
|
|
12
|
-
import { layoutStyleKeys, parseCapabilityLayoutContract } from "./layout.js";
|
|
13
|
-
export { CapabilityError, applyFormatColorTransforms, assertValidLang, authorIdSchema, bcp47LangSchema, colorValueSchema, createMorphScope, customGeometrySchema, defaultColorMap, defaultTheme, defineTheme, fontOptionsSchema, fontSchema, footerPlaceholdersSchema, geometryAdjustKeySchema, geometryAdjustSchema, geometrySchema, getMorphKeyLabel, headerFooterSchema, isFont, isMorphKey, isTheme, layoutStyleKeys, layoutStyleSchema, linearGradientSchema, linkTargetSchema, masterTextStyleCategoryForRole, matchLayoutPlaceholderKey, matchMasterPlaceholderSpec, nativePlaceholderRefSchema, paddingStyleKeys, parseCapabilityLayoutContract, parseLinkTarget, placeholderRoleSchema, placeholderStyleSchema, presetGeometryNameSchema, presetGeometryTuple, radialGradientSchema, schemeColorNameSchema, shadowSchema, slideBackgroundSchema, slideFooterValueSchema, slideNumberValueSchema, textListSchema, textStyleFrom, textStyleKeys, textStyleSchema, themeScopeSchema, validateTextStyle, visualStyleSchema };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// ../core/dist/diagnostics.js
|
|
2
|
-
var BuildError = class extends Error {
|
|
3
|
-
diagnostics;
|
|
4
|
-
constructor(diagnostics) {
|
|
5
|
-
super(diagnostics.map((diagnostic) => `${diagnostic.path}: ${diagnostic.message}`).join("\n"));
|
|
6
|
-
this.name = "BuildError";
|
|
7
|
-
this.diagnostics = Object.freeze(diagnostics.map((diagnostic) => Object.freeze({ ...diagnostic })));
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
var CapabilityError = class extends Error {
|
|
11
|
-
code;
|
|
12
|
-
path;
|
|
13
|
-
/** Subpath relative to the native object triggering the capability, facilitating localization of cell declarations inside the object. */
|
|
14
|
-
constructor(code, message, path) {
|
|
15
|
-
super(message);
|
|
16
|
-
this.name = "CapabilityError";
|
|
17
|
-
this.code = code;
|
|
18
|
-
this.path = path;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export { BuildError, CapabilityError };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// ../core/dist/document-internals.js
|
|
2
|
-
/**
|
|
3
|
-
* Operation keys shared by the editable document and the React host adapter.
|
|
4
|
-
*
|
|
5
|
-
* The adapter must insert, reorder, and replace complete JSX declarations without exposing those
|
|
6
|
-
* reconciliation operations as author API. These symbols are internal to the core package and are
|
|
7
|
-
* not re-exported by the public document entry.
|
|
8
|
-
*/
|
|
9
|
-
const replaceDeclarationProps = Symbol("pptxdk.replaceDeclarationProps");
|
|
10
|
-
const insertDeclarationChild = Symbol("pptxdk.insertDeclarationChild");
|
|
11
|
-
const removeDeclarationChild = Symbol("pptxdk.removeDeclarationChild");
|
|
12
|
-
const setDeclarationText = Symbol("pptxdk.setDeclarationText");
|
|
13
|
-
export { insertDeclarationChild, removeDeclarationChild, replaceDeclarationProps, setDeclarationText };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { replaceDeclarationProps } from "./document-internals.js";
|
|
2
|
-
import { isMorphKey } from "./morph.js";
|
|
3
|
-
// ../core/dist/input-values.js
|
|
4
|
-
const slideLayoutDefinitionSymbol = Symbol.for("@pptxdk/core/slide-layout-definition");
|
|
5
|
-
const themeBrandSymbol = Symbol.for("@pptxdk/core/theme");
|
|
6
|
-
function isRecord(value) {
|
|
7
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8
|
-
}
|
|
9
|
-
function preservesIdentity(value) {
|
|
10
|
-
if (isMorphKey(value) || slideLayoutDefinitionSymbol in value || themeBrandSymbol in value) return true;
|
|
11
|
-
if (replaceDeclarationProps in value) return true;
|
|
12
|
-
return isRecord(value) && Object.getOwnPropertyDescriptor(value, "type")?.value === "motion-scope-handle";
|
|
13
|
-
}
|
|
14
|
-
function isRecordValue(value) {
|
|
15
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Copies author-owned values received by a declaration entry.
|
|
19
|
-
*
|
|
20
|
-
* Record values, arrays, URLs, and byte views are isolated recursively. Enumerable getters are read
|
|
21
|
-
* at receipt, while behavior handles and opaque objects keep their identity. This is a field-level
|
|
22
|
-
* authoring rule, not a general document clone.
|
|
23
|
-
*/
|
|
24
|
-
function snapshotValue(value) {
|
|
25
|
-
if (value === null || typeof value !== "object") return value;
|
|
26
|
-
if (value instanceof Uint8Array) return new Uint8Array(value);
|
|
27
|
-
if (value instanceof ArrayBuffer) return value.slice(0);
|
|
28
|
-
if (value instanceof URL) return new URL(value.href);
|
|
29
|
-
if (Array.isArray(value)) return Object.freeze(value.map((item) => snapshotValue(item)));
|
|
30
|
-
if (preservesIdentity(value)) return value;
|
|
31
|
-
if (!isRecordValue(value)) return value;
|
|
32
|
-
const copy = Object.create(null);
|
|
33
|
-
for (const key of Reflect.ownKeys(value)) {
|
|
34
|
-
if (Object.getOwnPropertyDescriptor(value, key)?.enumerable !== true) continue;
|
|
35
|
-
const observedValue = Reflect.get(value, key);
|
|
36
|
-
Object.defineProperty(copy, key, {
|
|
37
|
-
configurable: false,
|
|
38
|
-
enumerable: true,
|
|
39
|
-
value: snapshotValue(observedValue),
|
|
40
|
-
writable: false
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return Object.freeze(copy);
|
|
44
|
-
}
|
|
45
|
-
export { snapshotValue };
|
package/dist/core/dist/layout.js
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { blockFlexLayoutProperties, createBlockFlexLayoutSolver, isStyleRecord, paddingStyleKeys, validateBlockFlexContainerContext, validateBlockFlexContainerProperties, validateBlockFlexLayoutContextBounds } from "./block-flex-layout.js";
|
|
2
|
-
import { BuildError, CapabilityError } from "./diagnostics.js";
|
|
3
|
-
import { gridLayoutMode } from "./grid-layout.js";
|
|
4
|
-
import { expandedSpacing } from "./layout-protocol.js";
|
|
5
|
-
import { validateLayoutStyleValues } from "./layout-schemas.js";
|
|
6
|
-
import { textStyleKeys } from "./theme.js";
|
|
7
|
-
// ../core/dist/layout.js
|
|
8
|
-
const customContainerModes = [gridLayoutMode];
|
|
9
|
-
const layoutProperties = [...blockFlexLayoutProperties, ...customContainerModes.flatMap((mode) => [...mode.containerStyleKeys, ...mode.itemStyleKeys])];
|
|
10
|
-
const layoutPropertySet = new Set(layoutProperties);
|
|
11
|
-
const layoutStyleKeys = layoutProperties.filter((key) => !paddingStyleKeys.includes(key));
|
|
12
|
-
function diagnostic(path, code, message) {
|
|
13
|
-
return {
|
|
14
|
-
severity: "error",
|
|
15
|
-
path,
|
|
16
|
-
code,
|
|
17
|
-
message
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function fail(path, code, message) {
|
|
21
|
-
throw new BuildError([diagnostic(path, code, message)]);
|
|
22
|
-
}
|
|
23
|
-
function element(child) {
|
|
24
|
-
return "props" in child;
|
|
25
|
-
}
|
|
26
|
-
function identity(element) {
|
|
27
|
-
const id = element.props["id"];
|
|
28
|
-
return typeof id === "string" && id.trim() !== "" ? id : void 0;
|
|
29
|
-
}
|
|
30
|
-
function label(element, index) {
|
|
31
|
-
return `${element.type}[${identity(element) ?? String(index + 1)}]`;
|
|
32
|
-
}
|
|
33
|
-
function readStyle(value, path, isContainer, allowsPadding = isContainer, allowedPresentation = /* @__PURE__ */ new Set()) {
|
|
34
|
-
if (value === void 0) return {};
|
|
35
|
-
if (!isStyleRecord(value)) fail(path, "invalid-layout-style", "style must be an object");
|
|
36
|
-
const unknown = Object.keys(value).find((key) => !layoutPropertySet.has(key) && !allowedPresentation.has(key));
|
|
37
|
-
if (unknown !== void 0) fail(path, "unsupported-layout-style", `style contains unsupported property ${unknown}`);
|
|
38
|
-
const resolvedDisplay = validateBlockFlexContainerContext(value, path, isContainer, customContainerModes);
|
|
39
|
-
validateBlockFlexContainerProperties(value, resolvedDisplay, path, customContainerModes);
|
|
40
|
-
for (const mode of customContainerModes) mode.validateContainerStyle(value, resolvedDisplay, path);
|
|
41
|
-
validateLayoutStyleValues(value, path);
|
|
42
|
-
for (const mode of customContainerModes) mode.validateStyleValues(value, path);
|
|
43
|
-
validateBlockFlexLayoutContextBounds(value, allowsPadding, path);
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Parses and validates host props into a CapabilityLayoutContract for object capabilities.
|
|
48
|
-
*/
|
|
49
|
-
function parseCapabilityLayoutContract(options) {
|
|
50
|
-
const { nativeKind, props, allowedStyleKeys, allowPadding = false, isContainer = false } = options;
|
|
51
|
-
const path = options.path ?? "style";
|
|
52
|
-
const rawStyle = props["style"];
|
|
53
|
-
if (rawStyle !== void 0) {
|
|
54
|
-
if (!isStyleRecord(rawStyle)) throw new CapabilityError("invalid-style", "style must be an object", options.path);
|
|
55
|
-
if (!allowPadding) {
|
|
56
|
-
if (paddingStyleKeys.find((key) => rawStyle[key] !== void 0) !== void 0) throw new CapabilityError("invalid-layout-context", "padding is only applicable to layout containers", options.path);
|
|
57
|
-
}
|
|
58
|
-
const unknown = Object.keys(rawStyle).find((key) => rawStyle[key] !== void 0 && !allowedStyleKeys.has(key));
|
|
59
|
-
if (unknown !== void 0) throw new CapabilityError("unknown-style", `style contains unsupported property ${unknown}`, options.path);
|
|
60
|
-
}
|
|
61
|
-
const layoutStyle = readStyle(rawStyle, path, isContainer, allowPadding, allowedStyleKeys);
|
|
62
|
-
let padding;
|
|
63
|
-
if (allowPadding && rawStyle !== void 0) {
|
|
64
|
-
if (paddingStyleKeys.some((key) => rawStyle[key] !== void 0)) {
|
|
65
|
-
const edges = expandedSpacing(layoutStyle, "padding");
|
|
66
|
-
padding = {
|
|
67
|
-
top: edges.top,
|
|
68
|
-
right: edges.right,
|
|
69
|
-
bottom: edges.bottom,
|
|
70
|
-
left: edges.left
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const x = typeof props["x"] === "number" ? props["x"] : void 0;
|
|
75
|
-
const y = typeof props["y"] === "number" ? props["y"] : void 0;
|
|
76
|
-
const styleWidth = rawStyle !== void 0 ? rawStyle["width"] : void 0;
|
|
77
|
-
const styleHeight = rawStyle !== void 0 ? rawStyle["height"] : void 0;
|
|
78
|
-
const width = styleWidth ?? props["width"];
|
|
79
|
-
const height = styleHeight ?? props["height"];
|
|
80
|
-
return {
|
|
81
|
-
nativeKind,
|
|
82
|
-
...x === void 0 ? {} : { x },
|
|
83
|
-
...y === void 0 ? {} : { y },
|
|
84
|
-
...width === void 0 ? {} : { width },
|
|
85
|
-
...height === void 0 ? {} : { height },
|
|
86
|
-
layoutStyle,
|
|
87
|
-
...padding === void 0 ? {} : { padding }
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
const nativeElementKinds = /* @__PURE__ */ new Set([
|
|
91
|
-
"sp",
|
|
92
|
-
"pic",
|
|
93
|
-
"grpSp",
|
|
94
|
-
"graphicFrame",
|
|
95
|
-
"cxnSp"
|
|
96
|
-
]);
|
|
97
|
-
function validateBoundObjectCapability(bound) {
|
|
98
|
-
if (typeof bound !== "object" || bound === null) throw new CapabilityError("invalid-capability-binding", "Object capability bind() must return a bound capability object");
|
|
99
|
-
const candidate = bound;
|
|
100
|
-
if (typeof candidate.contract !== "object" || candidate.contract === null || candidate.contract.nativeKind === void 0 || !nativeElementKinds.has(candidate.contract.nativeKind) || typeof candidate.contract.layoutStyle !== "object" || candidate.contract.layoutStyle === null || Array.isArray(candidate.contract.layoutStyle) || typeof candidate.resolve !== "function") throw new CapabilityError("invalid-capability-binding", "Object capability bind() must return a valid contract and resolve handler");
|
|
101
|
-
return bound;
|
|
102
|
-
}
|
|
103
|
-
function objectModule(module) {
|
|
104
|
-
return module !== void 0 && "bind" in module;
|
|
105
|
-
}
|
|
106
|
-
/** Coordinates layout tree construction, capability binding, solver collaboration, and box commitment. */
|
|
107
|
-
var LayoutPass = class {
|
|
108
|
-
#modules;
|
|
109
|
-
#dimensions;
|
|
110
|
-
#slideNumber;
|
|
111
|
-
#options;
|
|
112
|
-
#boxes = /* @__PURE__ */ new WeakMap();
|
|
113
|
-
#themes = /* @__PURE__ */ new WeakMap();
|
|
114
|
-
#hidden = /* @__PURE__ */ new WeakSet();
|
|
115
|
-
#boundObjects = /* @__PURE__ */ new WeakMap();
|
|
116
|
-
#nodeMeta = /* @__PURE__ */ new WeakMap();
|
|
117
|
-
#warnings = [];
|
|
118
|
-
#warningKeys = /* @__PURE__ */ new Set();
|
|
119
|
-
#solver;
|
|
120
|
-
#placeholderFor = () => void 0;
|
|
121
|
-
constructor(modules, dimensions, slideNumber = 1, options = {}) {
|
|
122
|
-
this.#modules = modules;
|
|
123
|
-
this.#dimensions = dimensions;
|
|
124
|
-
this.#slideNumber = slideNumber;
|
|
125
|
-
this.#options = options;
|
|
126
|
-
this.#solver = createBlockFlexLayoutSolver({
|
|
127
|
-
dimensions,
|
|
128
|
-
customContainers: customContainerModes.map((mode) => mode.createSolver((path, code, message) => {
|
|
129
|
-
this.#warnOnce(path, code, message);
|
|
130
|
-
}))
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
run(children, parentPath, theme, slideStyle, placeholderFor) {
|
|
134
|
-
this.#placeholderFor = placeholderFor ?? (() => void 0);
|
|
135
|
-
const rootStyle = readStyle(slideStyle, parentPath, true, true, textStyleKeys);
|
|
136
|
-
const root = this.#solver.createRoot({
|
|
137
|
-
path: parentPath,
|
|
138
|
-
style: rootStyle
|
|
139
|
-
});
|
|
140
|
-
this.#appendChildren(children, parentPath, root, slideStyle !== void 0, theme);
|
|
141
|
-
this.#solver.solve((node, box) => {
|
|
142
|
-
const meta = this.#nodeMeta.get(node);
|
|
143
|
-
if (meta === void 0) return;
|
|
144
|
-
this.#boxes.set(meta.element, box);
|
|
145
|
-
if (meta.checksCanvasOverflow && (box.x < 0 || box.y < 0 || box.x + box.width > this.#dimensions.width || box.y + box.height > this.#dimensions.height)) this.#warnings.push({
|
|
146
|
-
severity: "warning",
|
|
147
|
-
path: node.path,
|
|
148
|
-
code: "overflow",
|
|
149
|
-
message: "Layout container overflows slide canvas; build retains original declaration"
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
return {
|
|
153
|
-
boxes: this.#boxes,
|
|
154
|
-
themes: this.#themes,
|
|
155
|
-
hidden: this.#hidden,
|
|
156
|
-
warnings: this.#warnings,
|
|
157
|
-
bound: this.#boundObjects
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
#bindCapability(child, childPath, themeContext, module, placeholder) {
|
|
161
|
-
let bound = this.#boundObjects.get(child);
|
|
162
|
-
if (bound === void 0) try {
|
|
163
|
-
bound = validateBoundObjectCapability(module.bind(child, {
|
|
164
|
-
path: childPath,
|
|
165
|
-
theme: themeContext,
|
|
166
|
-
options: this.#options,
|
|
167
|
-
slideNumber: this.#slideNumber,
|
|
168
|
-
...placeholder === void 0 ? {} : { placeholder }
|
|
169
|
-
}));
|
|
170
|
-
this.#boundObjects.set(child, bound);
|
|
171
|
-
} catch (error) {
|
|
172
|
-
if (error instanceof BuildError) throw error;
|
|
173
|
-
const code = error instanceof CapabilityError ? error.code : "invalid-capability-input";
|
|
174
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
175
|
-
return fail(error instanceof CapabilityError && error.path !== void 0 ? error.path.startsWith(childPath) ? error.path : `${childPath}/${error.path}` : childPath, code, message);
|
|
176
|
-
}
|
|
177
|
-
return bound;
|
|
178
|
-
}
|
|
179
|
-
#appendChildren(children, parentPath, parent, includeObjects, themeContext) {
|
|
180
|
-
children.forEach((child, index) => {
|
|
181
|
-
if (!element(child)) return;
|
|
182
|
-
const childPath = `${parentPath}/${label(child, index)}`;
|
|
183
|
-
if (parent.style.display === "none") {
|
|
184
|
-
this.#markHidden(child);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
const module = this.#modules.get(child.type);
|
|
188
|
-
if (module !== void 0 && "compileDeclaration" in module) {
|
|
189
|
-
this.#themes.set(child, themeContext);
|
|
190
|
-
if (module.children === "owned") return;
|
|
191
|
-
this.#appendChildren(child.children, childPath, parent, includeObjects, themeContext);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
if (objectModule(module)) {
|
|
195
|
-
const placeholder = this.#placeholderFor(child);
|
|
196
|
-
const elementTheme = placeholder === void 0 ? themeContext : placeholder.masterTheme;
|
|
197
|
-
const bound = this.#bindCapability(child, childPath, elementTheme, module, placeholder);
|
|
198
|
-
const contract = bound.contract;
|
|
199
|
-
if (contract.layoutStyle.display === "none") {
|
|
200
|
-
this.#markHidden(child);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
if (placeholder !== void 0) {
|
|
204
|
-
this.#themes.set(child, elementTheme);
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
for (const mode of customContainerModes) mode.validateItemStyle(contract.layoutStyle, parent.style, childPath);
|
|
208
|
-
if (bound.container !== void 0) {
|
|
209
|
-
if (!includeObjects && bound.container.layoutMode === "when-styled" && !Object.keys(contract.layoutStyle).some((key) => key !== "zIndex" && layoutPropertySet.has(key) && contract.layoutStyle[key] !== void 0)) {
|
|
210
|
-
const theme = bound.container.theme ?? themeContext;
|
|
211
|
-
this.#themes.set(child, theme);
|
|
212
|
-
this.#appendChildren(bound.container.children, childPath, parent, false, theme);
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
const built = this.#buildContainer(child, childPath, parent, themeContext, contract, bound.container);
|
|
216
|
-
this.#solver.appendChild(parent, built);
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
this.#themes.set(child, themeContext);
|
|
220
|
-
if (!includeObjects && !this.#solver.requiresLooseLayout(contract.layoutStyle)) return;
|
|
221
|
-
const built = this.#buildLeafObject(child, childPath, parent, themeContext, bound, contract);
|
|
222
|
-
if (!includeObjects) this.#solver.positionLooseGeometry(built);
|
|
223
|
-
this.#solver.appendChild(parent, built);
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
#buildContainer(input, path, parent, themeContext, contract, container) {
|
|
228
|
-
const style = contract.layoutStyle;
|
|
229
|
-
const theme = container.theme ?? themeContext;
|
|
230
|
-
this.#themes.set(input, theme);
|
|
231
|
-
const node = this.#solver.createNode({
|
|
232
|
-
path,
|
|
233
|
-
style,
|
|
234
|
-
isContainer: true,
|
|
235
|
-
propagatesBaseline: container.propagatesBaseline !== false,
|
|
236
|
-
...contract.width === void 0 ? {} : { contractWidth: contract.width },
|
|
237
|
-
...contract.height === void 0 ? {} : { contractHeight: contract.height },
|
|
238
|
-
...contract.x === void 0 ? {} : { contractX: contract.x },
|
|
239
|
-
...contract.y === void 0 ? {} : { contractY: contract.y },
|
|
240
|
-
...contract.padding === void 0 ? {} : { padding: contract.padding }
|
|
241
|
-
}, parent);
|
|
242
|
-
this.#nodeMeta.set(node, {
|
|
243
|
-
element: input,
|
|
244
|
-
checksCanvasOverflow: container.checksCanvasOverflow !== false
|
|
245
|
-
});
|
|
246
|
-
this.#appendChildren(container.children, path, node, true, theme);
|
|
247
|
-
return node;
|
|
248
|
-
}
|
|
249
|
-
#buildLeafObject(input, path, parent, themeContext, bound, contract) {
|
|
250
|
-
const node = this.#solver.createNode({
|
|
251
|
-
path,
|
|
252
|
-
style: contract.layoutStyle,
|
|
253
|
-
isContainer: false,
|
|
254
|
-
propagatesBaseline: false,
|
|
255
|
-
...contract.width === void 0 ? {} : { contractWidth: contract.width },
|
|
256
|
-
...contract.height === void 0 ? {} : { contractHeight: contract.height },
|
|
257
|
-
...contract.x === void 0 ? {} : { contractX: contract.x },
|
|
258
|
-
...contract.y === void 0 ? {} : { contractY: contract.y },
|
|
259
|
-
...contract.padding === void 0 ? {} : { padding: contract.padding },
|
|
260
|
-
...bound.measureLayout === void 0 ? {} : { measure: (request) => this.#measure(path, themeContext, bound, request) }
|
|
261
|
-
}, parent);
|
|
262
|
-
this.#nodeMeta.set(node, {
|
|
263
|
-
element: input,
|
|
264
|
-
checksCanvasOverflow: false
|
|
265
|
-
});
|
|
266
|
-
return node;
|
|
267
|
-
}
|
|
268
|
-
#markHidden(child) {
|
|
269
|
-
this.#hidden.add(child);
|
|
270
|
-
for (const descendant of child.children) if (element(descendant)) this.#markHidden(descendant);
|
|
271
|
-
}
|
|
272
|
-
#warnOnce(path, code, message) {
|
|
273
|
-
const key = `${path}\u0000${code}\u0000${message}`;
|
|
274
|
-
if (this.#warningKeys.has(key)) return;
|
|
275
|
-
this.#warningKeys.add(key);
|
|
276
|
-
this.#warnings.push({
|
|
277
|
-
severity: "warning",
|
|
278
|
-
path,
|
|
279
|
-
code,
|
|
280
|
-
message
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
#measure(path, theme, bound, request) {
|
|
284
|
-
if (bound.measureLayout === void 0) return;
|
|
285
|
-
try {
|
|
286
|
-
return bound.measureLayout({
|
|
287
|
-
...request,
|
|
288
|
-
theme,
|
|
289
|
-
slideNumber: this.#slideNumber
|
|
290
|
-
});
|
|
291
|
-
} catch (error) {
|
|
292
|
-
if (error instanceof BuildError) throw error;
|
|
293
|
-
const code = error instanceof CapabilityError ? error.code : "layout-measurement-failed";
|
|
294
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
295
|
-
return fail(error instanceof CapabilityError && error.path !== void 0 ? error.path.startsWith(path) ? error.path : `${path}/${error.path}` : path, code, message);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
export { LayoutPass, layoutStyleKeys, paddingStyleKeys, parseCapabilityLayoutContract, validateBoundObjectCapability };
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { placeholderSizeSchema, slideBackgroundSchema, xml10StringSchema } from "./author-schemas.js";
|
|
2
|
-
import { CapabilityError } from "./diagnostics.js";
|
|
3
|
-
import { masterPlaceholderMapSchema, masterTextStylesSchema, placeholderMapSchema } from "./placeholders.js";
|
|
4
|
-
import { colorMapOverrideSchema, colorMapSchema, textStyleSchema, themeOverrideSchema } from "./theme.js";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
// ../core/dist/masters.js
|
|
7
|
-
/** OOXML `<p:hf>` header/footer visibility flags on SlideMaster and SlideLayout (ECMA-376 §19.3.1.24). */
|
|
8
|
-
const headerFooterSchema = z.strictObject({
|
|
9
|
-
dateTime: z.boolean().optional(),
|
|
10
|
-
footer: z.boolean().optional(),
|
|
11
|
-
header: z.boolean().optional(),
|
|
12
|
-
slideNumber: z.boolean().optional()
|
|
13
|
-
}).readonly();
|
|
14
|
-
/** Geometry, placeholder metadata, and default text/style for a `dt`, `ftr`, or `sldNum` slot. */
|
|
15
|
-
const footerPlaceholderSpecSchema = z.strictObject({
|
|
16
|
-
x: z.number().finite().optional(),
|
|
17
|
-
y: z.number().finite().optional(),
|
|
18
|
-
width: z.number().finite().positive().optional(),
|
|
19
|
-
height: z.number().finite().positive().optional(),
|
|
20
|
-
idx: z.number().int().nonnegative().optional(),
|
|
21
|
-
size: placeholderSizeSchema.optional(),
|
|
22
|
-
text: xml10StringSchema.optional(),
|
|
23
|
-
style: textStyleSchema.optional(),
|
|
24
|
-
visible: z.boolean().optional()
|
|
25
|
-
}).readonly();
|
|
26
|
-
/** Collection of date, footer, and slide-number metadata placeholder definitions on a master or layout. */
|
|
27
|
-
const footerPlaceholdersSchema = z.strictObject({
|
|
28
|
-
dateTime: footerPlaceholderSpecSchema.optional(),
|
|
29
|
-
footer: footerPlaceholderSpecSchema.optional(),
|
|
30
|
-
slideNumber: footerPlaceholderSpecSchema.optional()
|
|
31
|
-
}).readonly();
|
|
32
|
-
/** Official OOXML ST_SlideLayoutType enumeration values (ECMA-376 §19.7.15). */
|
|
33
|
-
const slideLayoutTypeValues = [
|
|
34
|
-
"title",
|
|
35
|
-
"tx",
|
|
36
|
-
"twoColTx",
|
|
37
|
-
"tbl",
|
|
38
|
-
"txAndChart",
|
|
39
|
-
"chartAndTx",
|
|
40
|
-
"dgm",
|
|
41
|
-
"chart",
|
|
42
|
-
"txAndClipArt",
|
|
43
|
-
"clipArtAndTx",
|
|
44
|
-
"titleOnly",
|
|
45
|
-
"blank",
|
|
46
|
-
"txAndObj",
|
|
47
|
-
"objAndTx",
|
|
48
|
-
"objOnly",
|
|
49
|
-
"obj",
|
|
50
|
-
"txAndMedia",
|
|
51
|
-
"mediaAndTx",
|
|
52
|
-
"objOverTx",
|
|
53
|
-
"txOverObj",
|
|
54
|
-
"txAndTwoObj",
|
|
55
|
-
"twoObjAndTx",
|
|
56
|
-
"twoObjOverTx",
|
|
57
|
-
"fourObj",
|
|
58
|
-
"vertTx",
|
|
59
|
-
"clipArtAndVertTx",
|
|
60
|
-
"vertTitleAndTx",
|
|
61
|
-
"vertTitleAndTxOverChart",
|
|
62
|
-
"twoObj",
|
|
63
|
-
"objAndTwoObj",
|
|
64
|
-
"twoObjAndObj",
|
|
65
|
-
"cust",
|
|
66
|
-
"secHead",
|
|
67
|
-
"twoTxTwoObj",
|
|
68
|
-
"objTx",
|
|
69
|
-
"picTx"
|
|
70
|
-
];
|
|
71
|
-
const slideLayoutTypeSchema = z.enum(slideLayoutTypeValues);
|
|
72
|
-
const slideMasterDataPropsSchema = z.strictObject({
|
|
73
|
-
id: z.string().trim().min(1).optional(),
|
|
74
|
-
name: z.string().optional(),
|
|
75
|
-
preserve: z.boolean().optional(),
|
|
76
|
-
placeholders: masterPlaceholderMapSchema.optional(),
|
|
77
|
-
textStyles: masterTextStylesSchema.optional(),
|
|
78
|
-
colorMap: colorMapSchema.optional(),
|
|
79
|
-
background: slideBackgroundSchema.optional(),
|
|
80
|
-
headerFooter: headerFooterSchema.optional(),
|
|
81
|
-
footerPlaceholders: footerPlaceholdersSchema.optional(),
|
|
82
|
-
transition: z.unknown().optional(),
|
|
83
|
-
advanceAfter: z.number().optional(),
|
|
84
|
-
motion: z.unknown().optional()
|
|
85
|
-
}).readonly();
|
|
86
|
-
const slideLayoutDataPropsSchema = z.strictObject({
|
|
87
|
-
id: z.string().trim().min(1).optional(),
|
|
88
|
-
name: z.string().optional(),
|
|
89
|
-
type: slideLayoutTypeSchema.optional(),
|
|
90
|
-
preserve: z.boolean().optional(),
|
|
91
|
-
matchingName: z.string().optional(),
|
|
92
|
-
userDrawn: z.boolean().optional(),
|
|
93
|
-
showMasterShapes: z.boolean().optional(),
|
|
94
|
-
showMasterPlaceholderAnimations: z.boolean().optional(),
|
|
95
|
-
placeholders: placeholderMapSchema.optional(),
|
|
96
|
-
colorMapOverride: colorMapOverrideSchema.optional(),
|
|
97
|
-
themeOverride: themeOverrideSchema.optional(),
|
|
98
|
-
background: slideBackgroundSchema.optional(),
|
|
99
|
-
headerFooter: headerFooterSchema.optional(),
|
|
100
|
-
footerPlaceholders: footerPlaceholdersSchema.optional(),
|
|
101
|
-
transition: z.unknown().optional(),
|
|
102
|
-
advanceAfter: z.number().optional(),
|
|
103
|
-
motion: z.unknown().optional()
|
|
104
|
-
}).readonly();
|
|
105
|
-
const slideLayoutObservationSchema = z.object({
|
|
106
|
-
id: z.string().min(1),
|
|
107
|
-
name: z.string().optional(),
|
|
108
|
-
type: slideLayoutTypeSchema.optional(),
|
|
109
|
-
preserve: z.boolean().optional(),
|
|
110
|
-
matchingName: z.string().optional(),
|
|
111
|
-
userDrawn: z.boolean().optional(),
|
|
112
|
-
showMasterShapes: z.boolean().optional(),
|
|
113
|
-
showMasterPlaceholderAnimations: z.boolean().optional(),
|
|
114
|
-
colorMapOverride: colorMapOverrideSchema.optional(),
|
|
115
|
-
themeOverride: themeOverrideSchema.optional(),
|
|
116
|
-
background: slideBackgroundSchema.optional(),
|
|
117
|
-
headerFooter: headerFooterSchema.optional(),
|
|
118
|
-
capabilities: z.record(z.string(), z.unknown()).readonly().optional()
|
|
119
|
-
}).readonly();
|
|
120
|
-
const slideMasterObservationSchema = z.object({
|
|
121
|
-
id: z.string().min(1),
|
|
122
|
-
name: z.string().optional(),
|
|
123
|
-
preserve: z.boolean().optional(),
|
|
124
|
-
colorMap: colorMapSchema.optional(),
|
|
125
|
-
headerFooter: headerFooterSchema.optional(),
|
|
126
|
-
capabilities: z.record(z.string(), z.unknown()).readonly().optional(),
|
|
127
|
-
layouts: z.array(slideLayoutObservationSchema).readonly()
|
|
128
|
-
}).readonly();
|
|
129
|
-
const slideLayoutDefinitionSymbol = Symbol.for("@pptxdk/core/slide-layout-definition");
|
|
130
|
-
/** Checks whether a runtime value was produced by `defineSlideLayout`. */
|
|
131
|
-
function isSlideLayoutDefinition(value) {
|
|
132
|
-
return typeof value === "object" && value !== null && slideLayoutDefinitionSymbol in value;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Defines a reusable native slide layout specification that can be mounted into a `SlideMaster`
|
|
136
|
-
* across both JSX (`<SlideLayout layout={def} />`) and imperative (`slideLayout(def)`) entries.
|
|
137
|
-
*/
|
|
138
|
-
function defineSlideLayout(spec) {
|
|
139
|
-
const parsed = slideLayoutDataPropsSchema.safeParse(spec);
|
|
140
|
-
if (!parsed.success) {
|
|
141
|
-
const first = parsed.error.issues[0];
|
|
142
|
-
throw new CapabilityError("invalid-slide-layout", first?.message ?? "Invalid slide layout specification");
|
|
143
|
-
}
|
|
144
|
-
const normalized = {};
|
|
145
|
-
for (const [key, value] of Object.entries(parsed.data)) if (value !== void 0) normalized[key] = value;
|
|
146
|
-
const frozenProps = Object.freeze(normalized);
|
|
147
|
-
return Object.freeze({
|
|
148
|
-
[slideLayoutDefinitionSymbol]: true,
|
|
149
|
-
props: frozenProps,
|
|
150
|
-
...frozenProps.id === void 0 ? {} : { id: frozenProps.id },
|
|
151
|
-
...frozenProps.name === void 0 ? {} : { name: frozenProps.name },
|
|
152
|
-
...frozenProps.type === void 0 ? {} : { type: frozenProps.type },
|
|
153
|
-
...frozenProps.preserve === void 0 ? {} : { preserve: frozenProps.preserve },
|
|
154
|
-
...frozenProps.matchingName === void 0 ? {} : { matchingName: frozenProps.matchingName },
|
|
155
|
-
...frozenProps.userDrawn === void 0 ? {} : { userDrawn: frozenProps.userDrawn },
|
|
156
|
-
...frozenProps.showMasterShapes === void 0 ? {} : { showMasterShapes: frozenProps.showMasterShapes },
|
|
157
|
-
...frozenProps.showMasterPlaceholderAnimations === void 0 ? {} : { showMasterPlaceholderAnimations: frozenProps.showMasterPlaceholderAnimations },
|
|
158
|
-
...frozenProps.placeholders === void 0 ? {} : { placeholders: frozenProps.placeholders },
|
|
159
|
-
...frozenProps.colorMapOverride === void 0 ? {} : { colorMapOverride: frozenProps.colorMapOverride },
|
|
160
|
-
...frozenProps.themeOverride === void 0 ? {} : { themeOverride: frozenProps.themeOverride },
|
|
161
|
-
...frozenProps.background === void 0 ? {} : { background: frozenProps.background },
|
|
162
|
-
...frozenProps.headerFooter === void 0 ? {} : { headerFooter: frozenProps.headerFooter },
|
|
163
|
-
...frozenProps.footerPlaceholders === void 0 ? {} : { footerPlaceholders: frozenProps.footerPlaceholders },
|
|
164
|
-
...frozenProps.transition === void 0 ? {} : { transition: frozenProps.transition },
|
|
165
|
-
...frozenProps.advanceAfter === void 0 ? {} : { advanceAfter: frozenProps.advanceAfter },
|
|
166
|
-
...frozenProps.motion === void 0 ? {} : { motion: frozenProps.motion }
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
export { defineSlideLayout, footerPlaceholderSpecSchema, footerPlaceholdersSchema, headerFooterSchema, isSlideLayoutDefinition, slideLayoutDataPropsSchema, slideLayoutObservationSchema, slideLayoutTypeSchema, slideLayoutTypeValues, slideMasterDataPropsSchema, slideMasterObservationSchema };
|