@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
package/dist/emit/dist/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import "../../core/dist/stage-options.js";
|
|
2
|
-
import { emit, emittedBuildQuery, validateOptions } from "./emit.js";
|
|
3
|
-
import { assertXml10Characters, colorMapAttributesXml, colorMapOverrideXml, layoutXml, masterXml, placeholderRefXml, pxToEmu, resolvedColorXml, sectionListXml, themeOverrideXml, themeXml, xmlDocument, xmlEscape } from "./ooxml.js";
|
|
4
|
-
import "../../core/dist/build.js";
|
|
5
|
-
export { assertXml10Characters, colorMapAttributesXml, colorMapOverrideXml, emit, emittedBuildQuery, layoutXml, masterXml, placeholderRefXml, pxToEmu, resolvedColorXml, sectionListXml, themeOverrideXml, themeXml, validateOptions, xmlDocument, xmlEscape };
|
|
@@ -1,504 +0,0 @@
|
|
|
1
|
-
import { createMorphScope } from "../../core/dist/morph.js";
|
|
2
|
-
import "../../core/dist/index.js";
|
|
3
|
-
import { createDeckNode, createSlideNode } from "../../core/dist/document.js";
|
|
4
|
-
import { importOptionsSchema } from "./diagnostics.js";
|
|
5
|
-
import { allocateScopedAuthorId, appendUnconsumedDiagnostics, consumeCommonSlideCreationId, readShapeTreeItems } from "./masters.js";
|
|
6
|
-
import { P_NS, R_NS, emuToPx } from "./namespaces.js";
|
|
7
|
-
import { inspectNotesAndHandoutMasters } from "./notes-masters.js";
|
|
8
|
-
import { openPptxPackage, resolvePartPath } from "./opc.js";
|
|
9
|
-
import { buildRelationshipIndex } from "./resources.js";
|
|
10
|
-
import { readColorMapOverride, readThemeOverridePart } from "./themes.js";
|
|
11
|
-
import { extentEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema } from "./xml-fragments.js";
|
|
12
|
-
import { XmlElementCursor, parseXmlPart } from "./xml-reader.js";
|
|
13
|
-
import { z } from "zod";
|
|
14
|
-
// ../import/dist/import.js
|
|
15
|
-
const defaultSlideWidthPx = 960;
|
|
16
|
-
const defaultSlideHeightPx = 540;
|
|
17
|
-
const slideSizeFragmentSchema = extentEmuFragmentSchema.extend({ type: z.string().optional() });
|
|
18
|
-
const slideShowAttrSchema = z.object({
|
|
19
|
-
show: ooxmlBoolSchema.optional(),
|
|
20
|
-
showMasterPhAnim: ooxmlBoolSchema.optional(),
|
|
21
|
-
showMasterSp: ooxmlBoolSchema.optional()
|
|
22
|
-
});
|
|
23
|
-
function isImportMechanismHandler(value) {
|
|
24
|
-
if (typeof value !== "object" || value === null || !("target" in value)) return false;
|
|
25
|
-
const target = value.target;
|
|
26
|
-
return target === "shape-tree" || target === "slide" || target === "deck";
|
|
27
|
-
}
|
|
28
|
-
function collectHandlers(capabilities) {
|
|
29
|
-
const shapeTree = [];
|
|
30
|
-
const slide = [];
|
|
31
|
-
const deck = [];
|
|
32
|
-
for (const mod of capabilities) {
|
|
33
|
-
if (!("mechanisms" in mod) || mod.mechanisms === void 0) continue;
|
|
34
|
-
for (const mechanism of mod.mechanisms) {
|
|
35
|
-
if (!isImportMechanismHandler(mechanism.import)) continue;
|
|
36
|
-
const handler = mechanism.import;
|
|
37
|
-
switch (handler.target) {
|
|
38
|
-
case "shape-tree":
|
|
39
|
-
shapeTree.push(handler);
|
|
40
|
-
break;
|
|
41
|
-
case "slide":
|
|
42
|
-
slide.push(handler);
|
|
43
|
-
break;
|
|
44
|
-
case "deck": deck.push(handler);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
shapeTree,
|
|
50
|
-
slide,
|
|
51
|
-
deck
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function consumePresentationHeaderBoilerplate(presCursor) {
|
|
55
|
-
const notesSz = presCursor.child(P_NS, "notesSz");
|
|
56
|
-
if (notesSz !== void 0) {
|
|
57
|
-
notesSz.consumeAttr("cx");
|
|
58
|
-
notesSz.consumeAttr("cy");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function readSlideSize(presCursor, diagnostics) {
|
|
62
|
-
const sldSz = presCursor.child(P_NS, "sldSz");
|
|
63
|
-
if (sldSz === void 0) return {
|
|
64
|
-
width: defaultSlideWidthPx,
|
|
65
|
-
height: defaultSlideHeightPx
|
|
66
|
-
};
|
|
67
|
-
const raw = sldSz.attrsObject([
|
|
68
|
-
"cx",
|
|
69
|
-
"cy",
|
|
70
|
-
"type"
|
|
71
|
-
]);
|
|
72
|
-
const parsed = slideSizeFragmentSchema.safeParse(raw);
|
|
73
|
-
if (!parsed.success) {
|
|
74
|
-
diagnostics.push({
|
|
75
|
-
code: "invalid-xml-value",
|
|
76
|
-
category: "corrupt-input",
|
|
77
|
-
disposition: "recovered",
|
|
78
|
-
location: {
|
|
79
|
-
part: presCursor.part,
|
|
80
|
-
xpath: sldSz.xpath
|
|
81
|
-
},
|
|
82
|
-
attributeOrElement: "p:sldSz",
|
|
83
|
-
rawValue: JSON.stringify(raw)
|
|
84
|
-
});
|
|
85
|
-
return {
|
|
86
|
-
width: defaultSlideWidthPx,
|
|
87
|
-
height: defaultSlideHeightPx
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
width: emuToPx(parsed.data.cx),
|
|
92
|
-
height: emuToPx(parsed.data.cy)
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function applyNativeMorphToken(node, slidePartPath, slideIndex, morphScope, morphHandleByToken, usedSlideMorphTokens, diagnostics) {
|
|
96
|
-
const rawName = node.props["name"];
|
|
97
|
-
if (typeof rawName !== "string" || !rawName.startsWith("!!")) return;
|
|
98
|
-
const token = rawName.slice(2);
|
|
99
|
-
if (token.trim() === "") return;
|
|
100
|
-
if (usedSlideMorphTokens.has(token)) {
|
|
101
|
-
diagnostics.push({
|
|
102
|
-
code: "invalid-xml-value",
|
|
103
|
-
category: "corrupt-input",
|
|
104
|
-
disposition: "recovered",
|
|
105
|
-
location: {
|
|
106
|
-
part: slidePartPath,
|
|
107
|
-
slideIndex
|
|
108
|
-
},
|
|
109
|
-
attributeOrElement: "p:cNvPr/@name",
|
|
110
|
-
rawValue: rawName
|
|
111
|
-
});
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
usedSlideMorphTokens.add(token);
|
|
115
|
-
let handle = morphHandleByToken.get(token);
|
|
116
|
-
if (handle === void 0) {
|
|
117
|
-
handle = morphScope.handle(token);
|
|
118
|
-
morphHandleByToken.set(token, handle);
|
|
119
|
-
}
|
|
120
|
-
node.set({
|
|
121
|
-
name: void 0,
|
|
122
|
-
morphKey: handle
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeByPartPath, clrMapByLayoutPartPath, handlers, registerDeferredSlideLink, morphScope, morphHandleByToken, diagnostics) {
|
|
126
|
-
const xmlText = pkg.readTextPart(slidePartPath);
|
|
127
|
-
if (xmlText === void 0) return void 0;
|
|
128
|
-
let slideEl;
|
|
129
|
-
try {
|
|
130
|
-
slideEl = parseXmlPart(slidePartPath, xmlText);
|
|
131
|
-
} catch {
|
|
132
|
-
diagnostics.push({
|
|
133
|
-
code: "corrupt-part",
|
|
134
|
-
category: "corrupt-input",
|
|
135
|
-
disposition: "omitted",
|
|
136
|
-
location: {
|
|
137
|
-
part: slidePartPath,
|
|
138
|
-
slideIndex
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
if ((slideEl.namespaceURI ?? "") !== "http://schemas.openxmlformats.org/presentationml/2006/main" || (slideEl.localName ?? slideEl.tagName) !== "sld") {
|
|
144
|
-
diagnostics.push({
|
|
145
|
-
code: "corrupt-part",
|
|
146
|
-
category: "corrupt-input",
|
|
147
|
-
disposition: "omitted",
|
|
148
|
-
location: {
|
|
149
|
-
part: slidePartPath,
|
|
150
|
-
slideIndex
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
const relIndex = buildRelationshipIndex(pkg, slidePartPath);
|
|
156
|
-
diagnostics.push(...relIndex.diagnostics);
|
|
157
|
-
const slideCursor = XmlElementCursor.createRoot(slideEl, slidePartPath, "/p:sld");
|
|
158
|
-
const rawShow = slideCursor.attrsObject([
|
|
159
|
-
"show",
|
|
160
|
-
"showMasterPhAnim",
|
|
161
|
-
"showMasterSp"
|
|
162
|
-
]);
|
|
163
|
-
const parsedShow = slideShowAttrSchema.safeParse(rawShow);
|
|
164
|
-
let hidden = false;
|
|
165
|
-
let showMasterPlaceholderAnimations;
|
|
166
|
-
let showMasterShapes;
|
|
167
|
-
if (!parsedShow.success) {
|
|
168
|
-
const singleShow = ooxmlBoolSchema.safeParse(rawShow["show"]);
|
|
169
|
-
if (rawShow["show"] !== void 0) {
|
|
170
|
-
if (!singleShow.success) diagnostics.push({
|
|
171
|
-
code: "invalid-xml-value",
|
|
172
|
-
category: "corrupt-input",
|
|
173
|
-
disposition: "recovered",
|
|
174
|
-
location: {
|
|
175
|
-
part: slidePartPath,
|
|
176
|
-
xpath: `${slideCursor.xpath}/@show`,
|
|
177
|
-
slideIndex
|
|
178
|
-
},
|
|
179
|
-
attributeOrElement: "@show",
|
|
180
|
-
rawValue: rawShow["show"]
|
|
181
|
-
});
|
|
182
|
-
else if (!singleShow.data) hidden = true;
|
|
183
|
-
}
|
|
184
|
-
const singlePhAnim = ooxmlBoolSchema.safeParse(rawShow["showMasterPhAnim"]);
|
|
185
|
-
if (rawShow["showMasterPhAnim"] !== void 0) {
|
|
186
|
-
if (!singlePhAnim.success) diagnostics.push({
|
|
187
|
-
code: "invalid-xml-value",
|
|
188
|
-
category: "corrupt-input",
|
|
189
|
-
disposition: "recovered",
|
|
190
|
-
location: {
|
|
191
|
-
part: slidePartPath,
|
|
192
|
-
xpath: `${slideCursor.xpath}/@showMasterPhAnim`,
|
|
193
|
-
slideIndex
|
|
194
|
-
},
|
|
195
|
-
attributeOrElement: "@showMasterPhAnim",
|
|
196
|
-
rawValue: rawShow["showMasterPhAnim"]
|
|
197
|
-
});
|
|
198
|
-
else showMasterPlaceholderAnimations = singlePhAnim.data;
|
|
199
|
-
}
|
|
200
|
-
const singleShowMasterSp = ooxmlBoolSchema.safeParse(rawShow["showMasterSp"]);
|
|
201
|
-
if (rawShow["showMasterSp"] !== void 0) {
|
|
202
|
-
if (!singleShowMasterSp.success) diagnostics.push({
|
|
203
|
-
code: "invalid-xml-value",
|
|
204
|
-
category: "corrupt-input",
|
|
205
|
-
disposition: "recovered",
|
|
206
|
-
location: {
|
|
207
|
-
part: slidePartPath,
|
|
208
|
-
xpath: `${slideCursor.xpath}/@showMasterSp`,
|
|
209
|
-
slideIndex
|
|
210
|
-
},
|
|
211
|
-
attributeOrElement: "@showMasterSp",
|
|
212
|
-
rawValue: rawShow["showMasterSp"]
|
|
213
|
-
});
|
|
214
|
-
else showMasterShapes = singleShowMasterSp.data;
|
|
215
|
-
}
|
|
216
|
-
} else {
|
|
217
|
-
if (parsedShow.data.show === false) hidden = true;
|
|
218
|
-
showMasterPlaceholderAnimations = parsedShow.data.showMasterPhAnim;
|
|
219
|
-
showMasterShapes = parsedShow.data.showMasterSp;
|
|
220
|
-
}
|
|
221
|
-
const cSld = slideCursor.child(P_NS, "cSld");
|
|
222
|
-
if (cSld === void 0) {
|
|
223
|
-
diagnostics.push({
|
|
224
|
-
code: "corrupt-part",
|
|
225
|
-
category: "corrupt-input",
|
|
226
|
-
disposition: "omitted",
|
|
227
|
-
location: {
|
|
228
|
-
part: slidePartPath,
|
|
229
|
-
xpath: slideCursor.xpath,
|
|
230
|
-
slideIndex
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
consumeCommonSlideCreationId(cSld);
|
|
236
|
-
const slideRels = pkg.readRelationships(slidePartPath);
|
|
237
|
-
diagnostics.push(...slideRels.diagnostics);
|
|
238
|
-
const layoutRel = slideRels.entries.find((entry) => entry.Type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" && entry.TargetMode !== "External");
|
|
239
|
-
const resolvedLayoutPath = layoutRel === void 0 ? void 0 : resolvePartPath(slidePartPath, layoutRel.Target);
|
|
240
|
-
const layoutNode = resolvedLayoutPath === void 0 ? void 0 : layoutNodeByPartPath.get(resolvedLayoutPath);
|
|
241
|
-
const layoutPlaceholders = layoutNode?.props["placeholders"];
|
|
242
|
-
const masterPlaceholders = layoutNode?.parent?.props["placeholders"];
|
|
243
|
-
const layoutClrMap = resolvedLayoutPath === void 0 ? void 0 : clrMapByLayoutPartPath.get(resolvedLayoutPath);
|
|
244
|
-
const clrMapOvr = slideCursor.child(P_NS, "clrMapOvr");
|
|
245
|
-
let colorMapOverride;
|
|
246
|
-
if (clrMapOvr !== void 0) {
|
|
247
|
-
const parsedOvr = readColorMapOverride(clrMapOvr, slidePartPath, slideIndex, diagnostics);
|
|
248
|
-
if (parsedOvr !== void 0 && parsedOvr !== "master") colorMapOverride = parsedOvr;
|
|
249
|
-
}
|
|
250
|
-
let themeOverride;
|
|
251
|
-
const themeOverrideRel = slideRels.entries.find((entry) => entry.Type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/themeOverride" && entry.TargetMode !== "External");
|
|
252
|
-
if (themeOverrideRel !== void 0) {
|
|
253
|
-
const overridePart = resolvePartPath(slidePartPath, themeOverrideRel.Target);
|
|
254
|
-
if (overridePart === void 0 || !pkg.hasPart(overridePart)) diagnostics.push({
|
|
255
|
-
code: "missing-target-part",
|
|
256
|
-
category: "corrupt-input",
|
|
257
|
-
disposition: "omitted",
|
|
258
|
-
location: {
|
|
259
|
-
part: slidePartPath,
|
|
260
|
-
xpath: themeOverrideRel.xpath,
|
|
261
|
-
slideIndex
|
|
262
|
-
},
|
|
263
|
-
relationshipId: themeOverrideRel.Id,
|
|
264
|
-
targetPart: overridePart ?? themeOverrideRel.Target
|
|
265
|
-
});
|
|
266
|
-
else themeOverride = readThemeOverridePart(pkg, overridePart, slideIndex, diagnostics);
|
|
267
|
-
}
|
|
268
|
-
const rawSlideName = cSld.attr("name");
|
|
269
|
-
const slideId = allocateScopedAuthorId(rawSlideName, usedSlideIds, `slide-${slideIndex + 1}`);
|
|
270
|
-
const displayName = rawSlideName !== void 0 && rawSlideName.trim().length > 0 && rawSlideName !== slideId ? rawSlideName : void 0;
|
|
271
|
-
const slideNode = createSlideNode({
|
|
272
|
-
id: slideId,
|
|
273
|
-
...displayName === void 0 ? {} : { name: displayName },
|
|
274
|
-
...layoutNode === void 0 ? {} : { layout: layoutNode },
|
|
275
|
-
...colorMapOverride === void 0 ? {} : { colorMapOverride },
|
|
276
|
-
...themeOverride === void 0 ? {} : { themeOverride },
|
|
277
|
-
...hidden ? { hidden: true } : {},
|
|
278
|
-
...showMasterPlaceholderAnimations === void 0 ? {} : { showMasterPlaceholderAnimations },
|
|
279
|
-
...showMasterShapes === void 0 ? {} : { showMasterShapes }
|
|
280
|
-
});
|
|
281
|
-
const objectBySpid = /* @__PURE__ */ new Map();
|
|
282
|
-
const omittedSpids = /* @__PURE__ */ new Map();
|
|
283
|
-
const registerImportedObject = (spid, node) => {
|
|
284
|
-
objectBySpid.set(spid, node);
|
|
285
|
-
};
|
|
286
|
-
const usedSlideMorphTokens = /* @__PURE__ */ new Set();
|
|
287
|
-
const spTree = cSld.child(P_NS, "spTree");
|
|
288
|
-
if (spTree !== void 0) readShapeTreeItems({
|
|
289
|
-
spTree,
|
|
290
|
-
pkg,
|
|
291
|
-
partPath: slidePartPath,
|
|
292
|
-
slideIndex,
|
|
293
|
-
relIndex,
|
|
294
|
-
shapeTreeHandlers: handlers.shapeTree,
|
|
295
|
-
registerDeferredSlideLink,
|
|
296
|
-
registerImportedObject,
|
|
297
|
-
omittedSpids,
|
|
298
|
-
appendNode: (node) => {
|
|
299
|
-
applyNativeMorphToken(node, slidePartPath, slideIndex, morphScope, morphHandleByToken, usedSlideMorphTokens, diagnostics);
|
|
300
|
-
slideNode.append(node);
|
|
301
|
-
},
|
|
302
|
-
diagnostics,
|
|
303
|
-
containerNode: slideNode,
|
|
304
|
-
...layoutPlaceholders === void 0 ? {} : { layoutPlaceholders },
|
|
305
|
-
...masterPlaceholders === void 0 ? {} : { masterPlaceholders },
|
|
306
|
-
...layoutClrMap === void 0 ? {} : { clrMap: layoutClrMap }
|
|
307
|
-
});
|
|
308
|
-
for (const slideHandler of handlers.slide) {
|
|
309
|
-
if (slideHandler.matches !== void 0 && !slideHandler.matches(slideCursor)) continue;
|
|
310
|
-
const outcome = slideHandler.read({
|
|
311
|
-
slideCursor,
|
|
312
|
-
slideNode,
|
|
313
|
-
part: slidePartPath,
|
|
314
|
-
slideIndex,
|
|
315
|
-
package: pkg,
|
|
316
|
-
objectBySpid,
|
|
317
|
-
omittedSpids
|
|
318
|
-
});
|
|
319
|
-
if (outcome.diagnostics !== void 0) diagnostics.push(...outcome.diagnostics);
|
|
320
|
-
}
|
|
321
|
-
appendUnconsumedDiagnostics(slideCursor, slideIndex, diagnostics);
|
|
322
|
-
return {
|
|
323
|
-
node: slideNode,
|
|
324
|
-
slideId
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Creates a Transitional PPTX importer bound to the caller's registered capability modules.
|
|
329
|
-
*
|
|
330
|
-
* The returned function owns OPC package traversal, XML cursor tracking, and structured diagnostics,
|
|
331
|
-
* while delegating native object/slide parsing to mechanisms declared by `capabilities`.
|
|
332
|
-
*/
|
|
333
|
-
function createImporter(capabilities) {
|
|
334
|
-
const handlers = collectHandlers(capabilities);
|
|
335
|
-
return function importPptx(input, options = {}) {
|
|
336
|
-
importOptionsSchema.parse(options);
|
|
337
|
-
if (options.signal?.aborted) throw options.signal.reason;
|
|
338
|
-
const pkg = openPptxPackage(input);
|
|
339
|
-
const diagnostics = [...pkg.relDiagnostics];
|
|
340
|
-
const presCursor = pkg.presentationRoot;
|
|
341
|
-
consumePresentationHeaderBoilerplate(presCursor);
|
|
342
|
-
const size = readSlideSize(presCursor, diagnostics);
|
|
343
|
-
const deckNode = createDeckNode({
|
|
344
|
-
width: size.width,
|
|
345
|
-
height: size.height
|
|
346
|
-
});
|
|
347
|
-
const relById = /* @__PURE__ */ new Map();
|
|
348
|
-
for (const rel of pkg.presentationRels) relById.set(rel.Id, rel);
|
|
349
|
-
const usedDeckIds = /* @__PURE__ */ new Set();
|
|
350
|
-
const clrMapByLayoutPartPath = /* @__PURE__ */ new Map();
|
|
351
|
-
const layoutNodeByPartPath = /* @__PURE__ */ new Map();
|
|
352
|
-
const slideIdByPartPath = /* @__PURE__ */ new Map();
|
|
353
|
-
const slideNodeByPresentationSldId = /* @__PURE__ */ new Map();
|
|
354
|
-
const deferredSlideLinks = [];
|
|
355
|
-
const registerDeferredSlideLink = (link) => {
|
|
356
|
-
deferredSlideLinks.push(link);
|
|
357
|
-
};
|
|
358
|
-
const seenDeckReaders = /* @__PURE__ */ new Set();
|
|
359
|
-
const uniqueDeckHandlers = handlers.deck.filter((handler) => {
|
|
360
|
-
if (seenDeckReaders.has(handler.read)) return false;
|
|
361
|
-
seenDeckReaders.add(handler.read);
|
|
362
|
-
return true;
|
|
363
|
-
});
|
|
364
|
-
const preSlideDeckHandlers = uniqueDeckHandlers.filter((handler) => handler.stage === "pre-slides");
|
|
365
|
-
const postSlideDeckHandlers = uniqueDeckHandlers.filter((handler) => handler.stage !== "pre-slides");
|
|
366
|
-
if (preSlideDeckHandlers.length > 0) for (const deckHandler of preSlideDeckHandlers) {
|
|
367
|
-
const outcome = deckHandler.read({
|
|
368
|
-
presentationCursor: presCursor,
|
|
369
|
-
deckNode,
|
|
370
|
-
package: pkg,
|
|
371
|
-
relById,
|
|
372
|
-
usedDeckIds,
|
|
373
|
-
slideHandlers: handlers.slide,
|
|
374
|
-
shapeTreeHandlers: handlers.shapeTree,
|
|
375
|
-
registerDeferredSlideLink,
|
|
376
|
-
layoutNodeByPartPath,
|
|
377
|
-
clrMapByLayoutPartPath
|
|
378
|
-
});
|
|
379
|
-
if (outcome.diagnostics !== void 0) diagnostics.push(...outcome.diagnostics);
|
|
380
|
-
}
|
|
381
|
-
else presCursor.child(P_NS, "sldMasterIdLst")?.suppressUnconsumed();
|
|
382
|
-
const morphScope = createMorphScope();
|
|
383
|
-
const morphHandleByToken = /* @__PURE__ */ new Map();
|
|
384
|
-
let slideCount = 0;
|
|
385
|
-
const sldIdLst = presCursor.child(P_NS, "sldIdLst");
|
|
386
|
-
if (sldIdLst !== void 0) {
|
|
387
|
-
const sldIds = sldIdLst.children(P_NS, "sldId");
|
|
388
|
-
for (let index = 0; index < sldIds.length; index += 1) {
|
|
389
|
-
if (options.signal?.aborted) throw options.signal.reason;
|
|
390
|
-
const sldIdCursor = sldIds[index];
|
|
391
|
-
const rawId = sldIdCursor.attr("id");
|
|
392
|
-
const parsedSlideNumId = rawId === void 0 ? void 0 : ooxmlIntSchema.safeParse(rawId);
|
|
393
|
-
if (parsedSlideNumId !== void 0 && !parsedSlideNumId.success) diagnostics.push({
|
|
394
|
-
code: "invalid-xml-value",
|
|
395
|
-
category: "corrupt-input",
|
|
396
|
-
disposition: "recovered",
|
|
397
|
-
location: {
|
|
398
|
-
part: pkg.presentationPath,
|
|
399
|
-
xpath: `${sldIdCursor.xpath}/@id`,
|
|
400
|
-
slideIndex: index
|
|
401
|
-
},
|
|
402
|
-
attributeOrElement: "@id",
|
|
403
|
-
rawValue: rawId
|
|
404
|
-
});
|
|
405
|
-
const rId = sldIdCursor.attr("id", R_NS);
|
|
406
|
-
if (rId === void 0) {
|
|
407
|
-
diagnostics.push({
|
|
408
|
-
code: "broken-relationship",
|
|
409
|
-
category: "corrupt-input",
|
|
410
|
-
disposition: "omitted",
|
|
411
|
-
location: {
|
|
412
|
-
part: pkg.presentationPath,
|
|
413
|
-
xpath: sldIdCursor.xpath,
|
|
414
|
-
slideIndex: index
|
|
415
|
-
},
|
|
416
|
-
relationshipId: ""
|
|
417
|
-
});
|
|
418
|
-
continue;
|
|
419
|
-
}
|
|
420
|
-
const rel = relById.get(rId);
|
|
421
|
-
if (rel === void 0 || rel.Type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" || rel.TargetMode === "External") {
|
|
422
|
-
diagnostics.push({
|
|
423
|
-
code: "broken-relationship",
|
|
424
|
-
category: "corrupt-input",
|
|
425
|
-
disposition: "omitted",
|
|
426
|
-
location: {
|
|
427
|
-
part: pkg.presentationPath,
|
|
428
|
-
xpath: sldIdCursor.xpath,
|
|
429
|
-
slideIndex: index
|
|
430
|
-
},
|
|
431
|
-
relationshipId: rId
|
|
432
|
-
});
|
|
433
|
-
continue;
|
|
434
|
-
}
|
|
435
|
-
const targetPart = resolvePartPath(pkg.presentationPath, rel.Target);
|
|
436
|
-
if (targetPart === void 0 || !pkg.hasPart(targetPart)) {
|
|
437
|
-
diagnostics.push({
|
|
438
|
-
code: "missing-target-part",
|
|
439
|
-
category: "corrupt-input",
|
|
440
|
-
disposition: "omitted",
|
|
441
|
-
location: {
|
|
442
|
-
part: pkg.presentationPath,
|
|
443
|
-
xpath: sldIdCursor.xpath,
|
|
444
|
-
slideIndex: index
|
|
445
|
-
},
|
|
446
|
-
relationshipId: rId,
|
|
447
|
-
targetPart: targetPart ?? rel.Target
|
|
448
|
-
});
|
|
449
|
-
continue;
|
|
450
|
-
}
|
|
451
|
-
const slideResult = readSlidePart(pkg, targetPart, index, usedDeckIds, layoutNodeByPartPath, clrMapByLayoutPartPath, handlers, registerDeferredSlideLink, morphScope, morphHandleByToken, diagnostics);
|
|
452
|
-
if (slideResult !== void 0) {
|
|
453
|
-
slideIdByPartPath.set(targetPart, slideResult.slideId);
|
|
454
|
-
if (parsedSlideNumId?.success) slideNodeByPresentationSldId.set(parsedSlideNumId.data, slideResult.node);
|
|
455
|
-
deckNode.append(slideResult.node);
|
|
456
|
-
slideCount += 1;
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
for (const pending of deferredSlideLinks) {
|
|
461
|
-
const targetSlideId = slideIdByPartPath.get(pending.targetPart);
|
|
462
|
-
if (targetSlideId === void 0) {
|
|
463
|
-
diagnostics.push({
|
|
464
|
-
code: "missing-target-part",
|
|
465
|
-
category: "corrupt-input",
|
|
466
|
-
disposition: "omitted",
|
|
467
|
-
location: pending.location,
|
|
468
|
-
relationshipId: pending.relationshipId,
|
|
469
|
-
targetPart: pending.targetPart
|
|
470
|
-
});
|
|
471
|
-
continue;
|
|
472
|
-
}
|
|
473
|
-
pending.apply(targetSlideId);
|
|
474
|
-
}
|
|
475
|
-
inspectNotesAndHandoutMasters(presCursor, pkg, relById, diagnostics);
|
|
476
|
-
for (const deckHandler of postSlideDeckHandlers) {
|
|
477
|
-
const outcome = deckHandler.read({
|
|
478
|
-
presentationCursor: presCursor,
|
|
479
|
-
deckNode,
|
|
480
|
-
package: pkg,
|
|
481
|
-
relById,
|
|
482
|
-
usedDeckIds,
|
|
483
|
-
slideHandlers: handlers.slide,
|
|
484
|
-
shapeTreeHandlers: handlers.shapeTree,
|
|
485
|
-
registerDeferredSlideLink,
|
|
486
|
-
layoutNodeByPartPath,
|
|
487
|
-
clrMapByLayoutPartPath,
|
|
488
|
-
slideNodeByPresentationSldId
|
|
489
|
-
});
|
|
490
|
-
if (outcome.diagnostics !== void 0) diagnostics.push(...outcome.diagnostics);
|
|
491
|
-
}
|
|
492
|
-
appendUnconsumedDiagnostics(presCursor, void 0, diagnostics);
|
|
493
|
-
return {
|
|
494
|
-
document: deckNode,
|
|
495
|
-
report: Object.freeze({
|
|
496
|
-
evidence: "import",
|
|
497
|
-
sourceFormat: "ECMA-376 5th edition Transitional",
|
|
498
|
-
slideCount,
|
|
499
|
-
diagnostics: Object.freeze(diagnostics)
|
|
500
|
-
})
|
|
501
|
-
};
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
export { createImporter };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { A_NS, C_NS, EMU_PER_PX, MC_NS, P14_CREATION_ID_EXT_URI, P14_NS, P159_NS, P_NS, REL_CHART, REL_HYPERLINK, REL_IMAGE, REL_NOTES_SLIDE, REL_SLIDE, R_NS, TABLE_NS_URI, XML_NS, canonicalQName, emuToPx } from "./namespaces.js";
|
|
2
|
-
import "./alternate-content.js";
|
|
3
|
-
import { arrowTypeSchema, readBlipFill, readDrawingColor, readEffectList, readGradientFill, readLineBorder, readPlaceholderSpPrVisuals, readTransformXml } from "./visual.js";
|
|
4
|
-
import { ImportError, cascadedOmissionSchema, editabilityLossSchema, fatalImportIssueSchema, importDiagnosticSchema, importLocationSchema, importOptionsSchema, importReportSchema } from "./diagnostics.js";
|
|
5
|
-
import { createImporter } from "./import.js";
|
|
6
|
-
import { appendUnconsumedDiagnostics, consumeIdentityShapeTreeBoilerplate, importMastersAndLayouts } from "./masters.js";
|
|
7
|
-
import "./notes-masters.js";
|
|
8
|
-
import { importPresentationSections } from "./sections.js";
|
|
9
|
-
import "./themes.js";
|
|
10
|
-
import { readEmbeddedFontList, readPresentationThemeFontScheme, unpackEotFontData } from "./fonts.js";
|
|
11
|
-
import { resolvePartPath } from "./opc.js";
|
|
12
|
-
import { peekShapeTreeObjectIdentity, resolveExternalRelationshipTarget, resolveInternalRelationshipTarget } from "./resources.js";
|
|
13
|
-
import { extentEmuFragmentSchema, hexRgb6Schema, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlNonNegativeIntSchema, ooxmlPositiveIntSchema, transformAttributesFragmentSchema } from "./xml-fragments.js";
|
|
14
|
-
import { XmlElementCursor, parseXmlPart } from "./xml-reader.js";
|
|
15
|
-
import { defineCanvasMechanism, defineShowMechanism } from "./mechanism.js";
|
|
16
|
-
export { A_NS, C_NS, EMU_PER_PX, ImportError, MC_NS, P14_CREATION_ID_EXT_URI, P14_NS, P159_NS, P_NS, REL_CHART, REL_HYPERLINK, REL_IMAGE, REL_NOTES_SLIDE, REL_SLIDE, R_NS, TABLE_NS_URI, XML_NS, XmlElementCursor, appendUnconsumedDiagnostics, arrowTypeSchema, canonicalQName, cascadedOmissionSchema, consumeIdentityShapeTreeBoilerplate, createImporter, defineCanvasMechanism, defineShowMechanism, editabilityLossSchema, emuToPx, extentEmuFragmentSchema, fatalImportIssueSchema, hexRgb6Schema, importDiagnosticSchema, importLocationSchema, importMastersAndLayouts, importOptionsSchema, importPresentationSections, importReportSchema, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlNonNegativeIntSchema, ooxmlPositiveIntSchema, parseXmlPart, peekShapeTreeObjectIdentity, readBlipFill, readDrawingColor, readEffectList, readEmbeddedFontList, readGradientFill, readLineBorder, readPlaceholderSpPrVisuals, readPresentationThemeFontScheme, readTransformXml, resolveExternalRelationshipTarget, resolveInternalRelationshipTarget, resolvePartPath, transformAttributesFragmentSchema, unpackEotFontData };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// ../import/dist/xml-fragments.js
|
|
3
|
-
const integerStringPattern = /^-?\d+$/u;
|
|
4
|
-
const hexRgbPattern = /^[0-9a-fA-F]{6}$/u;
|
|
5
|
-
/** Parses an OOXML signed integer attribute string into a safe integer. */
|
|
6
|
-
const ooxmlIntSchema = z.string().regex(integerStringPattern).transform((value) => Number(value)).refine((value) => Number.isSafeInteger(value));
|
|
7
|
-
/** Parses an OOXML non-negative integer attribute string into a safe integer. */
|
|
8
|
-
const ooxmlNonNegativeIntSchema = ooxmlIntSchema.refine((value) => value >= 0);
|
|
9
|
-
/** Parses an OOXML positive integer attribute string into a safe integer. */
|
|
10
|
-
const ooxmlPositiveIntSchema = ooxmlIntSchema.refine((value) => value > 0);
|
|
11
|
-
/** Parses OOXML xsd:boolean attribute values ("1" | "0" | "true" | "false"). */
|
|
12
|
-
const ooxmlBoolSchema = z.enum([
|
|
13
|
-
"1",
|
|
14
|
-
"0",
|
|
15
|
-
"true",
|
|
16
|
-
"false"
|
|
17
|
-
]).transform((value) => value === "1" || value === "true");
|
|
18
|
-
/** Six-digit hex RGB value stored in `<a:srgbClr val="RRGGBB"/>`. */
|
|
19
|
-
const hexRgb6Schema = z.string().regex(hexRgbPattern);
|
|
20
|
-
/** `<a:off x="..." y="..."/>` fragment schema. */
|
|
21
|
-
const offsetEmuFragmentSchema = z.object({
|
|
22
|
-
x: ooxmlIntSchema,
|
|
23
|
-
y: ooxmlIntSchema
|
|
24
|
-
});
|
|
25
|
-
/** `<a:ext cx="..." cy="..."/>` fragment schema. */
|
|
26
|
-
const extentEmuFragmentSchema = z.object({
|
|
27
|
-
cx: ooxmlPositiveIntSchema,
|
|
28
|
-
cy: ooxmlPositiveIntSchema
|
|
29
|
-
});
|
|
30
|
-
/** `<a:xfrm rot="..." flipH="..." flipV="..."/>` attribute fragment schema. */
|
|
31
|
-
const transformAttributesFragmentSchema = z.object({
|
|
32
|
-
rot: ooxmlIntSchema.optional(),
|
|
33
|
-
flipH: ooxmlBoolSchema.optional(),
|
|
34
|
-
flipV: ooxmlBoolSchema.optional()
|
|
35
|
-
});
|
|
36
|
-
export { extentEmuFragmentSchema, hexRgb6Schema, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlNonNegativeIntSchema, ooxmlPositiveIntSchema, transformAttributesFragmentSchema };
|
package/dist/index-B5m3hqjC.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { L as EmitResult, _t as EmitOptions, tt as Resolution } from "./capability-D_xeNVIw.js";
|
|
2
|
-
import "./index-DpxcZ4Gs.js";
|
|
3
|
-
/**
|
|
4
|
-
* Emits a PPTX archive and BuildReport from an existing Resolution without re-resolving the document.
|
|
5
|
-
*/
|
|
6
|
-
declare function emit(resolution: Resolution, options?: EmitOptions): EmitResult;
|
|
7
|
-
export { emit as t };
|