@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,18 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { footerPlaceholderStyleSchema } from "../kernel/author-schemas.js";
|
|
2
|
+
import { emuToPx } from "../kernel/drawing-units.js";
|
|
3
|
+
import { geometrySchema } from "../kernel/geometry-schemas.js";
|
|
4
|
+
import { schemeColorNameSchema } from "../kernel/theme.js";
|
|
5
|
+
import { allocatePlaceholderAuthorKeys, layoutPlaceholderSpecSchema, masterPlaceholderSpecSchema, masterTextStyleCategoryForRole, masterTextStylesSchema, matchLayoutPlaceholderKey, matchMasterPlaceholderSpec, placeholderLevelStyleSchema, placeholderOrientSchema, placeholderSizeSchema, placeholderStyleSchema } from "../kernel/placeholders.js";
|
|
6
|
+
import { dateTimeFormatSchema } from "../kernel/date-time-format.js";
|
|
7
|
+
import { dateTimeFooterPlaceholderSpecSchema, slideLayoutTypeSchema } from "../kernel/masters.js";
|
|
8
|
+
import { createSlideLayoutNode, createSlideMasterNode } from "../kernel/document.js";
|
|
9
|
+
import "../kernel/index.js";
|
|
10
|
+
import { readAlternateContent } from "../kernel/pptx-read/alternate-content.js";
|
|
11
|
+
import { cascadeDrawingParagraphProperties, readDrawingListStyles, readDrawingParagraphProperties } from "../kernel/pptx-read/drawing-list-import.js";
|
|
12
|
+
import { readRunFontSlots } from "../kernel/pptx-read/fonts.js";
|
|
13
|
+
import { inferModernMediaKind, mediaPictureKind } from "../kernel/pptx-read/media.js";
|
|
14
|
+
import { A_NS, P_NS, R_NS, XML_NS } from "../kernel/pptx-read/namespaces.js";
|
|
15
|
+
import { resolvePartPath } from "../kernel/pptx-read/opc.js";
|
|
16
|
+
import { inspectUnsupportedGraphicFrame, peekShapeTreeObjectIdentity } from "../kernel/pptx-read/resources.js";
|
|
17
|
+
import { allocateScopedAuthorId, appendUnconsumedDiagnostics, consumeIdentityShapeTreeBoilerplate } from "../kernel/pptx-read/shape-tree.js";
|
|
18
|
+
import { isNonDefaultColorMap, readColorMapElement, readColorMapOverride, readPartThemeOverride, readThemePart } from "../kernel/pptx-read/themes.js";
|
|
19
|
+
import { readPlaceholderSpPrVisuals, readRunFillAndStroke } from "../kernel/pptx-read/visual.js";
|
|
20
|
+
import { cascadeOoxmlTextDecoration, hexRgb6Schema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlNonNegativeIntSchema, ooxmlPlaceholderRoleSchema, ooxmlWritableExtentEmuSchema, projectOoxmlTextDecoration, readOoxmlBoxInsets, readOoxmlRunAttrStyles, reportOoxmlTextDecorationLoss } from "../kernel/pptx-read/xml-fragments.js";
|
|
21
|
+
import { XmlElementCursor, parseXmlPart } from "../kernel/pptx-read/xml-reader.js";
|
|
14
22
|
import { z } from "zod";
|
|
15
|
-
// ../
|
|
23
|
+
// ../core/dist/import/masters.js
|
|
16
24
|
const minimumMasterLayoutId = 2147483648;
|
|
17
25
|
const maximumMasterLayoutId = 4294967295;
|
|
18
26
|
const slideMasterAttrsSchema = z.object({ preserve: ooxmlBoolSchema.optional() });
|
|
@@ -114,189 +122,130 @@ function readStyleColor(containerCursor, _clrMap) {
|
|
|
114
122
|
alpha
|
|
115
123
|
} : baseColor;
|
|
116
124
|
}
|
|
117
|
-
function readDefRPr(rPr, clrMap) {
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"spc",
|
|
127
|
-
"kern",
|
|
128
|
-
"dirty",
|
|
129
|
-
"smtClean",
|
|
130
|
-
"baseline"
|
|
131
|
-
]);
|
|
132
|
-
let lang;
|
|
133
|
-
if (raw["lang"] !== void 0) try {
|
|
134
|
-
lang = assertValidLang(raw["lang"]);
|
|
135
|
-
} catch {
|
|
136
|
-
lang = void 0;
|
|
137
|
-
}
|
|
138
|
-
const szParsed = ooxmlPositiveIntSchema.safeParse(raw["sz"]);
|
|
139
|
-
const fontSize = szParsed.success ? `${szParsed.data / 100}pt` : void 0;
|
|
140
|
-
const bParsed = ooxmlBoolSchema.safeParse(raw["b"]);
|
|
141
|
-
const fontWeight = bParsed.success ? bParsed.data ? "bold" : "normal" : void 0;
|
|
142
|
-
const iParsed = ooxmlBoolSchema.safeParse(raw["i"]);
|
|
143
|
-
const fontStyle = iParsed.success ? iParsed.data ? "italic" : "normal" : void 0;
|
|
144
|
-
const textDecoration = raw["u"] === "sng" ? "underline" : raw["strike"] === "sngStrike" ? "line-through" : raw["u"] === "none" && raw["strike"] === "noStrike" ? "none" : void 0;
|
|
145
|
-
const textTransform = raw["cap"] === "all" ? "uppercase" : raw["cap"] === "none" ? "none" : void 0;
|
|
146
|
-
const spcParsed = ooxmlIntSchema.safeParse(raw["spc"]);
|
|
147
|
-
const letterSpacing = spcParsed.success ? spcParsed.data / 75 : void 0;
|
|
148
|
-
const solidFill = rPr.child(A_NS, "solidFill");
|
|
149
|
-
const color = solidFill === void 0 ? void 0 : readStyleColor(solidFill, clrMap);
|
|
125
|
+
function readDefRPr(rPr, clrMap, partPath, diagnostics) {
|
|
126
|
+
const attrStyles = readOoxmlRunAttrStyles({
|
|
127
|
+
rPrCursor: rPr,
|
|
128
|
+
location: { part: partPath },
|
|
129
|
+
diagnostics,
|
|
130
|
+
allowBaseline: false,
|
|
131
|
+
diagnoseUnsupportedEnums: false
|
|
132
|
+
});
|
|
133
|
+
const { color, textStroke } = readRunFillAndStroke(rPr, { part: partPath }, diagnostics, (solidFill) => readStyleColor(solidFill, clrMap));
|
|
150
134
|
rPr.ignoreEmptyChild(A_NS, "noFill");
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
135
|
+
let textShadow;
|
|
136
|
+
const effectLst = rPr.child(A_NS, "effectLst");
|
|
137
|
+
if (effectLst !== void 0) {
|
|
138
|
+
const outerShdw = effectLst.child(A_NS, "outerShdw");
|
|
139
|
+
if (outerShdw !== void 0) {
|
|
140
|
+
const shdwAttrs = outerShdw.attrsObject([
|
|
141
|
+
"blurRad",
|
|
142
|
+
"dist",
|
|
143
|
+
"dir",
|
|
144
|
+
"algn",
|
|
145
|
+
"rotWithShape"
|
|
146
|
+
]);
|
|
147
|
+
const blurParsed = shdwAttrs["blurRad"] === void 0 ? void 0 : ooxmlWritableExtentEmuSchema.safeParse(shdwAttrs["blurRad"]);
|
|
148
|
+
const distParsed = shdwAttrs["dist"] === void 0 ? void 0 : ooxmlWritableExtentEmuSchema.safeParse(shdwAttrs["dist"]);
|
|
149
|
+
const dirParsed = shdwAttrs["dir"] === void 0 ? void 0 : ooxmlIntSchema.safeParse(shdwAttrs["dir"]);
|
|
150
|
+
if (blurParsed !== void 0 && !blurParsed.success || distParsed !== void 0 && !distParsed.success || dirParsed !== void 0 && !dirParsed.success) {
|
|
151
|
+
diagnostics.push({
|
|
152
|
+
code: "invalid-xml-value",
|
|
153
|
+
category: "corrupt-input",
|
|
154
|
+
disposition: "omitted",
|
|
155
|
+
location: {
|
|
156
|
+
part: partPath,
|
|
157
|
+
xpath: outerShdw.xpath
|
|
158
|
+
},
|
|
159
|
+
attributeOrElement: "a:outerShdw",
|
|
160
|
+
rawValue: JSON.stringify(shdwAttrs)
|
|
161
|
+
});
|
|
162
|
+
outerShdw.suppressUnconsumed();
|
|
163
|
+
} else {
|
|
164
|
+
const shdwColor = readStyleColor(outerShdw, clrMap);
|
|
165
|
+
textShadow = {
|
|
166
|
+
...shdwColor === void 0 ? {} : { color: shdwColor },
|
|
167
|
+
blur: blurParsed?.success ? emuToPx(blurParsed.data) : 0,
|
|
168
|
+
distance: distParsed?.success ? emuToPx(distParsed.data) : 0,
|
|
169
|
+
angle: dirParsed?.success ? dirParsed.data / 6e4 : 0
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
} else if (effectLst.element.children.length === 0) textShadow = "none";
|
|
172
173
|
}
|
|
174
|
+
const { fontFamily, eastAsianFontFamily } = readRunFontSlots(rPr);
|
|
173
175
|
return {
|
|
174
|
-
...
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
...attrStyles.decoration === void 0 ? {} : { decoration: attrStyles.decoration },
|
|
177
|
+
style: {
|
|
178
|
+
...fontFamily === void 0 ? {} : { fontFamily },
|
|
179
|
+
...eastAsianFontFamily === void 0 ? {} : { eastAsianFontFamily },
|
|
180
|
+
...attrStyles.fontSize === void 0 ? {} : { fontSize: attrStyles.fontSize },
|
|
181
|
+
...attrStyles.fontWeight === void 0 ? {} : { fontWeight: attrStyles.fontWeight },
|
|
182
|
+
...attrStyles.fontStyle === void 0 ? {} : { fontStyle: attrStyles.fontStyle },
|
|
183
|
+
...color === void 0 ? {} : { color },
|
|
184
|
+
...attrStyles.letterSpacing === void 0 ? {} : { letterSpacing: attrStyles.letterSpacing },
|
|
185
|
+
...attrStyles.textTransform === void 0 ? {} : { textTransform: attrStyles.textTransform },
|
|
186
|
+
...textShadow === void 0 ? {} : { textShadow },
|
|
187
|
+
...textStroke === void 0 ? {} : { textStroke },
|
|
188
|
+
...attrStyles.lang === void 0 ? {} : { lang: attrStyles.lang }
|
|
189
|
+
}
|
|
183
190
|
};
|
|
184
191
|
}
|
|
185
|
-
function
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"eaLnBrk",
|
|
193
|
-
"latinLnBrk",
|
|
194
|
-
"hangingPunct",
|
|
195
|
-
"fontAlgn"
|
|
196
|
-
]);
|
|
197
|
-
const marLParsed = ooxmlNonNegativeIntSchema.safeParse(rawAttrs["marL"]);
|
|
198
|
-
const marginLeft = marLParsed.success ? emuToPx(marLParsed.data) : void 0;
|
|
199
|
-
const indentParsed = ooxmlIntSchema.safeParse(rawAttrs["indent"]);
|
|
200
|
-
const indent = indentParsed.success ? emuToPx(indentParsed.data) : void 0;
|
|
201
|
-
const align = rawAttrs["algn"] === void 0 ? void 0 : {
|
|
202
|
-
l: "left",
|
|
203
|
-
ctr: "center",
|
|
204
|
-
r: "right",
|
|
205
|
-
just: "justify"
|
|
206
|
-
}[rawAttrs["algn"]];
|
|
207
|
-
const spcBef = pPr.child(A_NS, "spcBef");
|
|
208
|
-
const spcBefPts = spcBef?.child(A_NS, "spcPts");
|
|
209
|
-
(spcBef?.child(A_NS, "spcPct"))?.consumeAttr("val");
|
|
210
|
-
const spcBefVal = ooxmlNonNegativeIntSchema.safeParse(spcBefPts?.attr("val"));
|
|
211
|
-
const spacingBefore = spcBefVal.success ? spcBefVal.data / 75 : void 0;
|
|
212
|
-
const spcAft = pPr.child(A_NS, "spcAft");
|
|
213
|
-
const spcAftPts = spcAft?.child(A_NS, "spcPts");
|
|
214
|
-
(spcAft?.child(A_NS, "spcPct"))?.consumeAttr("val");
|
|
215
|
-
const spcAftVal = ooxmlNonNegativeIntSchema.safeParse(spcAftPts?.attr("val"));
|
|
216
|
-
const spacingAfter = spcAftVal.success ? spcAftVal.data / 75 : void 0;
|
|
217
|
-
const lnSpc = pPr.child(A_NS, "lnSpc");
|
|
218
|
-
const lnSpcPts = lnSpc?.child(A_NS, "spcPts");
|
|
219
|
-
(lnSpc?.child(A_NS, "spcPct"))?.consumeAttr("val");
|
|
220
|
-
const lnSpcVal = ooxmlPositiveIntSchema.safeParse(lnSpcPts?.attr("val"));
|
|
221
|
-
const lineHeight = lnSpcVal.success ? `${lnSpcVal.data / 100}pt` : void 0;
|
|
222
|
-
pPr.ignoreEmptyChild(A_NS, "buNone");
|
|
223
|
-
const buFont = pPr.child(A_NS, "buFont");
|
|
224
|
-
if (buFont !== void 0) {
|
|
225
|
-
buFont.consumeAttr("typeface");
|
|
226
|
-
buFont.consumeAttr("pitchFamily");
|
|
227
|
-
buFont.consumeAttr("charset");
|
|
228
|
-
buFont.consumeAttr("panose");
|
|
192
|
+
function sanitizeObjectBySchema(candidate, fullSchema, singleFieldValidate) {
|
|
193
|
+
const direct = fullSchema.safeParse(candidate);
|
|
194
|
+
if (direct.success) return direct.data;
|
|
195
|
+
const cleaned = {};
|
|
196
|
+
for (const [key, value] of Object.entries(candidate)) {
|
|
197
|
+
if (value === void 0) continue;
|
|
198
|
+
if (singleFieldValidate(key, value)) cleaned[key] = value;
|
|
229
199
|
}
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
200
|
+
const reparsed = fullSchema.safeParse(cleaned);
|
|
201
|
+
return reparsed.success ? reparsed.data : void 0;
|
|
202
|
+
}
|
|
203
|
+
function readPlaceholderListStyles(container, clrMap, partPath, diagnostics, inherited = []) {
|
|
204
|
+
const parsed = readDrawingListStyles(container, { part: partPath }, diagnostics, (cursor) => readDefRPr(cursor, clrMap, partPath, diagnostics), true);
|
|
205
|
+
if (parsed === void 0) return { nativeLevels: inherited };
|
|
206
|
+
const levels = {};
|
|
207
|
+
const nativeLevels = parsed.map((level, index) => {
|
|
208
|
+
const parent = inherited[index];
|
|
209
|
+
const decoration = cascadeOoxmlTextDecoration(parent?.decoration, level.decoration);
|
|
210
|
+
const style = level.decoration === void 0 ? level.style : {
|
|
211
|
+
...level.style,
|
|
212
|
+
textDecoration: projectOoxmlTextDecoration(decoration)
|
|
239
213
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
type: "number",
|
|
245
|
-
style: "arabicPeriod",
|
|
246
|
-
...startParsed.success ? { startAt: startParsed.data } : {},
|
|
247
|
-
...levelIndex0 > 0 ? { level: levelIndex0 } : {}
|
|
214
|
+
if (Object.keys(style).length > 0) levels[index + 1] = style;
|
|
215
|
+
return {
|
|
216
|
+
decoration,
|
|
217
|
+
buNone: level.buNone ?? (level.style.list === void 0 && parent?.buNone)
|
|
248
218
|
};
|
|
249
|
-
}
|
|
250
|
-
const defRPr = pPr.child(A_NS, "defRPr");
|
|
219
|
+
});
|
|
251
220
|
return {
|
|
252
|
-
...
|
|
253
|
-
|
|
254
|
-
...marginLeft === void 0 ? {} : { marginLeft },
|
|
255
|
-
...indent === void 0 ? {} : { indent },
|
|
256
|
-
...spacingBefore === void 0 ? {} : { spacingBefore },
|
|
257
|
-
...align === void 0 ? {} : { align },
|
|
258
|
-
...lineHeight === void 0 ? {} : { lineHeight },
|
|
259
|
-
...spacingAfter === void 0 ? {} : { spacingAfter }
|
|
221
|
+
...Object.keys(levels).length === 0 ? {} : { styles: levels },
|
|
222
|
+
nativeLevels
|
|
260
223
|
};
|
|
261
224
|
}
|
|
262
|
-
function
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
]) {
|
|
277
|
-
const pPr = container.child(A_NS, `lvl${levelNum}pPr`);
|
|
278
|
-
if (pPr === void 0) continue;
|
|
279
|
-
levels[levelNum] = readLevelParagraphProperties(pPr, levelNum - 1, clrMap);
|
|
280
|
-
count += 1;
|
|
281
|
-
}
|
|
282
|
-
return count === 0 ? void 0 : levels;
|
|
283
|
-
}
|
|
284
|
-
function readMasterTextStyles(txStyles, clrMap) {
|
|
285
|
-
if (txStyles === void 0) return void 0;
|
|
286
|
-
const titleStyleCursor = txStyles.child(P_NS, "titleStyle");
|
|
287
|
-
const bodyStyleCursor = txStyles.child(P_NS, "bodyStyle");
|
|
288
|
-
const otherStyleCursor = txStyles.child(P_NS, "otherStyle");
|
|
289
|
-
const titleStyle = readPlaceholderListStyles(titleStyleCursor, clrMap);
|
|
290
|
-
const bodyStyle = readPlaceholderListStyles(bodyStyleCursor, clrMap);
|
|
291
|
-
const otherStyle = readPlaceholderListStyles(otherStyleCursor, clrMap);
|
|
225
|
+
function readMasterTextStyles(txStyles, clrMap, partPath, diagnostics) {
|
|
226
|
+
const read = (category) => readPlaceholderListStyles(txStyles?.child(P_NS, category), clrMap, partPath, diagnostics);
|
|
227
|
+
const title = read("titleStyle");
|
|
228
|
+
const body = read("bodyStyle");
|
|
229
|
+
const other = read("otherStyle");
|
|
230
|
+
const titleStyle = title.styles;
|
|
231
|
+
const bodyStyle = body.styles;
|
|
232
|
+
const otherStyle = other.styles;
|
|
233
|
+
const categories = {
|
|
234
|
+
titleStyle: title.nativeLevels,
|
|
235
|
+
bodyStyle: body.nativeLevels,
|
|
236
|
+
otherStyle: other.nativeLevels
|
|
237
|
+
};
|
|
238
|
+
const nativeLevels = (ref) => categories[masterTextStyleCategoryForRole(ref.type)];
|
|
292
239
|
const candidate = {
|
|
293
240
|
...titleStyle === void 0 ? {} : { titleStyle },
|
|
294
241
|
...bodyStyle === void 0 ? {} : { bodyStyle },
|
|
295
242
|
...otherStyle === void 0 ? {} : { otherStyle }
|
|
296
243
|
};
|
|
297
|
-
if (Object.keys(candidate).length === 0) return void 0;
|
|
298
244
|
const parsed = masterTextStylesSchema.safeParse(candidate);
|
|
299
|
-
return
|
|
245
|
+
return {
|
|
246
|
+
nativeLevels,
|
|
247
|
+
...parsed.success && Object.keys(candidate).length > 0 ? { styles: parsed.data } : {}
|
|
248
|
+
};
|
|
300
249
|
}
|
|
301
250
|
function directPlaceholderChild(el) {
|
|
302
251
|
for (let child = el.firstChild; child !== null; child = child.nextSibling) {
|
|
@@ -314,12 +263,19 @@ function directPlaceholderChild(el) {
|
|
|
314
263
|
}
|
|
315
264
|
return false;
|
|
316
265
|
}
|
|
317
|
-
function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnostics, readPlaceholderVisuals) {
|
|
266
|
+
function readPlaceholderSpList(spTree, clrMap, isMaster, readsFooterPlaceholders, pkg, partPath, diagnostics, inheritedTextLevels, readPlaceholderVisuals) {
|
|
318
267
|
const placeholderKeyBySpid = /* @__PURE__ */ new Map();
|
|
319
|
-
if (spTree === void 0) return {
|
|
268
|
+
if (spTree === void 0) return {
|
|
269
|
+
placeholderKeyBySpid,
|
|
270
|
+
nativeLevels: inheritedTextLevels
|
|
271
|
+
};
|
|
320
272
|
const rawSpecs = [];
|
|
273
|
+
let footerPlaceholders;
|
|
274
|
+
const textLevelsBySpec = /* @__PURE__ */ new Map();
|
|
321
275
|
const rawSpids = [];
|
|
322
276
|
for (const sp of spTree.matchingChildren((el) => (el.namespaceURI ?? "") === "http://schemas.openxmlformats.org/presentationml/2006/main" && (el.localName ?? el.tagName) === "sp" && directPlaceholderChild(el))) {
|
|
277
|
+
const backgroundFillDiagnostic = readShapeUseBgFill(sp, void 0);
|
|
278
|
+
if (backgroundFillDiagnostic !== void 0) diagnostics.push(backgroundFillDiagnostic);
|
|
323
279
|
const nvSpPr = sp.child(P_NS, "nvSpPr");
|
|
324
280
|
const cNvPr = nvSpPr?.child(P_NS, "cNvPr");
|
|
325
281
|
const rawId = cNvPr?.attr("id");
|
|
@@ -335,21 +291,14 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
335
291
|
const ph = (nvSpPr?.child(P_NS, "nvPr"))?.child(P_NS, "ph");
|
|
336
292
|
if (ph === void 0) continue;
|
|
337
293
|
const rawType = ph.attr("type");
|
|
338
|
-
const
|
|
339
|
-
const typeRes = placeholderRoleSchema.safeParse(rawType ?? "obj");
|
|
294
|
+
const typeRes = ooxmlPlaceholderRoleSchema.safeParse(rawType);
|
|
340
295
|
const phType = typeRes.success ? typeRes.data : "obj";
|
|
341
296
|
const idxParsed = ooxmlNonNegativeIntSchema.safeParse(ph.attr("idx"));
|
|
342
297
|
const idx = idxParsed.success ? idxParsed.data : void 0;
|
|
343
|
-
const
|
|
298
|
+
const sizeParsed = placeholderSizeSchema.safeParse(ph.attr("sz"));
|
|
344
299
|
const orientParsed = placeholderOrientSchema.safeParse(ph.attr("orient"));
|
|
345
300
|
const customPromptParsed = ooxmlBoolSchema.safeParse(ph.attr("hasCustomPrompt"));
|
|
346
|
-
let x;
|
|
347
|
-
let y;
|
|
348
|
-
let width;
|
|
349
|
-
let height;
|
|
350
301
|
let geometry;
|
|
351
|
-
let flipH;
|
|
352
|
-
let flipV;
|
|
353
302
|
const styleProps = {};
|
|
354
303
|
const spPr = sp.child(P_NS, "spPr");
|
|
355
304
|
if (spPr !== void 0) {
|
|
@@ -365,17 +314,17 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
365
314
|
location: phLocation,
|
|
366
315
|
diagnostics
|
|
367
316
|
});
|
|
368
|
-
x = importedSpPr.x;
|
|
369
|
-
y = importedSpPr.y;
|
|
370
|
-
width = importedSpPr.width;
|
|
371
|
-
height = importedSpPr.height;
|
|
372
317
|
geometry = importedSpPr.geometry;
|
|
373
|
-
flipH = importedSpPr.flipH;
|
|
374
|
-
flipV = importedSpPr.flipV;
|
|
375
318
|
if (importedSpPr.style !== void 0) Object.assign(styleProps, importedSpPr.style);
|
|
376
319
|
}
|
|
320
|
+
let textLevels = inheritedTextLevels({
|
|
321
|
+
type: phType,
|
|
322
|
+
...idx === void 0 ? {} : { idx }
|
|
323
|
+
});
|
|
377
324
|
let listStyles;
|
|
378
325
|
let promptText;
|
|
326
|
+
let dateTimeFormat;
|
|
327
|
+
let dateFieldStyle;
|
|
379
328
|
const txBody = sp.child(P_NS, "txBody");
|
|
380
329
|
if (txBody !== void 0) {
|
|
381
330
|
const bodyPr = txBody.child(A_NS, "bodyPr");
|
|
@@ -397,85 +346,180 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
397
346
|
if (b["anchor"] === "t") styleProps["verticalAlign"] = "top";
|
|
398
347
|
else if (b["anchor"] === "ctr") styleProps["verticalAlign"] = "middle";
|
|
399
348
|
else if (b["anchor"] === "b") styleProps["verticalAlign"] = "bottom";
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
349
|
+
Object.assign(styleProps, readOoxmlBoxInsets({
|
|
350
|
+
rawAttrs: b,
|
|
351
|
+
attrNames: {
|
|
352
|
+
left: "lIns",
|
|
353
|
+
top: "tIns",
|
|
354
|
+
right: "rIns",
|
|
355
|
+
bottom: "bIns"
|
|
356
|
+
},
|
|
357
|
+
elementXpath: bodyPr.xpath,
|
|
358
|
+
location: {
|
|
359
|
+
part: partPath,
|
|
360
|
+
...spid === void 0 ? {} : { objectId: spid },
|
|
361
|
+
...name === void 0 ? {} : { objectName: name }
|
|
362
|
+
},
|
|
363
|
+
diagnostics
|
|
364
|
+
}));
|
|
408
365
|
bodyPr.ignoreEmptyChild(A_NS, "noAutofit");
|
|
409
366
|
bodyPr.ignoreEmptyChild(A_NS, "spAutoFit");
|
|
410
367
|
const normAutofit = bodyPr.child(A_NS, "normAutofit");
|
|
411
368
|
normAutofit?.consumeAttr("fontScale");
|
|
412
369
|
normAutofit?.consumeAttr("lnSpcReduction");
|
|
413
370
|
}
|
|
414
|
-
|
|
371
|
+
const list = readPlaceholderListStyles(txBody.child(A_NS, "lstStyle"), clrMap, partPath, diagnostics, textLevels);
|
|
372
|
+
listStyles = list.styles;
|
|
373
|
+
textLevels = list.nativeLevels;
|
|
415
374
|
const promptParagraphs = [];
|
|
416
375
|
let promptLvl1Fallback;
|
|
417
376
|
for (const p of txBody.children(A_NS, "p")) {
|
|
418
377
|
const pPr = p.child(A_NS, "pPr");
|
|
419
|
-
const pStyle = pPr === void 0 ? void 0 :
|
|
378
|
+
const pStyle = pPr === void 0 ? void 0 : readDrawingParagraphProperties(pPr, { part: partPath }, diagnostics, (cursor) => readDefRPr(cursor, clrMap, partPath, diagnostics), { placeholder: true });
|
|
379
|
+
const promptDecoration = cascadeOoxmlTextDecoration(textLevels[pStyle?.level ?? 0]?.decoration, pStyle?.decoration);
|
|
420
380
|
const runTexts = [];
|
|
421
381
|
for (const r of p.children(A_NS, "r")) {
|
|
422
382
|
const rPr = r.child(A_NS, "rPr");
|
|
423
|
-
const rStyle = rPr === void 0 ? void 0 : readDefRPr(rPr, clrMap);
|
|
424
|
-
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || rStyle !== void 0)) promptLvl1Fallback =
|
|
425
|
-
...pStyle,
|
|
426
|
-
...rStyle
|
|
427
|
-
};
|
|
383
|
+
const rStyle = rPr === void 0 ? void 0 : readDefRPr(rPr, clrMap, partPath, diagnostics);
|
|
384
|
+
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || rStyle !== void 0)) promptLvl1Fallback = cascadeDrawingParagraphProperties(pStyle, rStyle, 0);
|
|
428
385
|
const t = r.child(A_NS, "t");
|
|
429
386
|
if (t !== void 0) {
|
|
430
387
|
t.consumeAttr("space", XML_NS);
|
|
388
|
+
if (t.textContent.length > 0) reportOoxmlTextDecorationLoss(cascadeOoxmlTextDecoration(promptDecoration, rStyle?.decoration), {
|
|
389
|
+
part: partPath,
|
|
390
|
+
xpath: r.xpath
|
|
391
|
+
}, diagnostics);
|
|
431
392
|
runTexts.push(t.textContent);
|
|
432
393
|
}
|
|
433
394
|
}
|
|
434
|
-
const fld
|
|
435
|
-
if (fld !== void 0) {
|
|
395
|
+
for (const fld of p.children(A_NS, "fld")) {
|
|
436
396
|
fld.consumeAttr("id");
|
|
437
|
-
fld.
|
|
397
|
+
const fieldType = fld.attr("type");
|
|
398
|
+
const format = dateTimeFormatSchema.safeParse(fieldType);
|
|
399
|
+
const isDateField = readsFooterPlaceholders && phType === "dt" && format.success && dateTimeFormat === void 0 && footerPlaceholders?.dateTime === void 0;
|
|
400
|
+
if (!isDateField && fieldType !== "slidenum") diagnostics.push({
|
|
401
|
+
code: "unsupported-mechanism",
|
|
402
|
+
category: "unsupported",
|
|
403
|
+
disposition: "omitted",
|
|
404
|
+
location: {
|
|
405
|
+
part: partPath,
|
|
406
|
+
xpath: fld.xpath
|
|
407
|
+
},
|
|
408
|
+
namespaceUri: A_NS,
|
|
409
|
+
localName: "fld",
|
|
410
|
+
mechanismHint: `text-field:${fieldType ?? "unknown"}`
|
|
411
|
+
});
|
|
438
412
|
const rPr = fld.child(A_NS, "rPr");
|
|
439
|
-
|
|
413
|
+
const rStyle = rPr === void 0 ? void 0 : readDefRPr(rPr, clrMap, partPath, diagnostics);
|
|
414
|
+
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || rStyle !== void 0)) promptLvl1Fallback = cascadeDrawingParagraphProperties(pStyle, rStyle, 0);
|
|
415
|
+
if (isDateField || fieldType === "slidenum") reportOoxmlTextDecorationLoss(cascadeOoxmlTextDecoration(promptDecoration, rStyle?.decoration), {
|
|
416
|
+
part: partPath,
|
|
417
|
+
xpath: fld.xpath
|
|
418
|
+
}, diagnostics);
|
|
419
|
+
if (isDateField) {
|
|
420
|
+
dateTimeFormat = format.data;
|
|
421
|
+
const field = cascadeDrawingParagraphProperties(pStyle, rStyle, 0);
|
|
422
|
+
dateFieldStyle = {
|
|
423
|
+
...field.style,
|
|
424
|
+
...field.decoration === void 0 ? {} : { textDecoration: projectOoxmlTextDecoration(cascadeOoxmlTextDecoration(textLevels[0]?.decoration, field.decoration)) }
|
|
425
|
+
};
|
|
426
|
+
}
|
|
440
427
|
fld.ignoreEmptyChild(A_NS, "pPr");
|
|
441
428
|
const t = fld.child(A_NS, "t");
|
|
442
429
|
if (t !== void 0) {
|
|
443
430
|
t.consumeAttr("space", XML_NS);
|
|
444
|
-
runTexts.push(t.textContent);
|
|
431
|
+
if (fieldType === "slidenum") runTexts.push(t.textContent);
|
|
445
432
|
}
|
|
446
433
|
}
|
|
447
434
|
const endPara = p.child(A_NS, "endParaRPr");
|
|
448
|
-
if (endPara !== void 0)
|
|
435
|
+
if (endPara !== void 0) {
|
|
436
|
+
const endStyle = readDefRPr(endPara, clrMap, partPath, diagnostics);
|
|
437
|
+
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || Object.keys(endStyle.style).length > 0 || endStyle.decoration !== void 0)) promptLvl1Fallback = cascadeDrawingParagraphProperties(pStyle, endStyle, 0);
|
|
438
|
+
}
|
|
449
439
|
if (runTexts.length > 0) promptParagraphs.push(runTexts.join(""));
|
|
450
440
|
}
|
|
451
441
|
if (promptParagraphs.length > 0) promptText = promptParagraphs.join("\n");
|
|
452
|
-
if (listStyles === void 0 && promptLvl1Fallback !== void 0
|
|
442
|
+
if (listStyles === void 0 && promptLvl1Fallback !== void 0) {
|
|
443
|
+
const { style, decoration } = promptLvl1Fallback;
|
|
444
|
+
const effective = cascadeOoxmlTextDecoration(textLevels[0]?.decoration, decoration);
|
|
445
|
+
const level = sanitizeObjectBySchema({
|
|
446
|
+
...style,
|
|
447
|
+
...decoration === void 0 ? {} : { textDecoration: projectOoxmlTextDecoration(effective) }
|
|
448
|
+
}, placeholderLevelStyleSchema, (key, value) => placeholderLevelStyleSchema.safeParse({ [key]: value }).success);
|
|
449
|
+
if (level !== void 0 && Object.keys(level).length > 0) listStyles = { 1: level };
|
|
450
|
+
textLevels = [{
|
|
451
|
+
decoration: effective,
|
|
452
|
+
buNone: promptLvl1Fallback.buNone ?? (style.list === void 0 && textLevels[0]?.buNone)
|
|
453
|
+
}, ...textLevels.slice(1)];
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
const rawStyle = Object.keys(styleProps).length === 0 ? void 0 : sanitizeObjectBySchema(styleProps, placeholderStyleSchema, (key, value) => placeholderStyleSchema.safeParse({ [key]: value }).success);
|
|
457
|
+
const style = rawStyle !== void 0 && Object.keys(rawStyle).length > 0 ? rawStyle : void 0;
|
|
458
|
+
if (dateTimeFormat !== void 0 && footerPlaceholders?.dateTime === void 0) {
|
|
459
|
+
const dateSlot = dateTimeFooterPlaceholderSpecSchema.safeParse({
|
|
460
|
+
format: dateTimeFormat,
|
|
461
|
+
size: sizeParsed.success ? sizeParsed.data : void 0,
|
|
462
|
+
idx,
|
|
463
|
+
style: sanitizeObjectBySchema({
|
|
464
|
+
...style,
|
|
465
|
+
...listStyles?.[1],
|
|
466
|
+
...dateFieldStyle
|
|
467
|
+
}, footerPlaceholderStyleSchema, (key, value) => footerPlaceholderStyleSchema.safeParse({ [key]: value }).success),
|
|
468
|
+
visible: false
|
|
469
|
+
});
|
|
470
|
+
if (dateSlot.success) {
|
|
471
|
+
footerPlaceholders = { dateTime: dateSlot.data };
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
453
474
|
}
|
|
454
|
-
const style = Object.keys(styleProps).length === 0 ? void 0 : styleProps;
|
|
455
475
|
const candidate = {
|
|
456
476
|
type: phType,
|
|
457
|
-
...explicitType ? {} : { explicitType: false },
|
|
458
477
|
...idx === void 0 ? {} : { idx },
|
|
459
|
-
...
|
|
478
|
+
...sizeParsed.success ? { size: sizeParsed.data } : {},
|
|
460
479
|
...orientParsed.success ? { orient: orientParsed.data } : {},
|
|
461
480
|
...customPromptParsed.success && customPromptParsed.data ? { hasCustomPrompt: true } : {},
|
|
462
481
|
...name === void 0 ? {} : { name },
|
|
463
|
-
...
|
|
464
|
-
...y === void 0 ? {} : { y },
|
|
465
|
-
...width === void 0 ? {} : { width },
|
|
466
|
-
...height === void 0 ? {} : { height },
|
|
467
|
-
...geometry === void 0 ? {} : { geometry },
|
|
468
|
-
...flipH ? { flipH: true } : {},
|
|
469
|
-
...flipV ? { flipV: true } : {},
|
|
482
|
+
...geometry !== void 0 && geometrySchema.safeParse(geometry).success ? { geometry } : {},
|
|
470
483
|
...style === void 0 ? {} : { style },
|
|
471
484
|
...listStyles === void 0 ? {} : { listStyles },
|
|
472
485
|
...promptText === void 0 ? {} : { promptText }
|
|
473
486
|
};
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
487
|
+
const schema = isMaster ? masterPlaceholderSpecSchema : layoutPlaceholderSpecSchema;
|
|
488
|
+
const validated = schema.safeParse(candidate);
|
|
489
|
+
if (validated.success) {
|
|
490
|
+
textLevelsBySpec.set(validated.data, textLevels);
|
|
491
|
+
rawSpecs.push(validated.data);
|
|
492
|
+
rawSpids.push(spid);
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
diagnostics.push({
|
|
496
|
+
code: "invalid-xml-value",
|
|
497
|
+
category: "corrupt-input",
|
|
498
|
+
disposition: "recovered",
|
|
499
|
+
location: {
|
|
500
|
+
part: partPath,
|
|
501
|
+
xpath: sp.xpath,
|
|
502
|
+
...spid === void 0 ? {} : { objectId: spid },
|
|
503
|
+
...name === void 0 ? {} : { objectName: name }
|
|
504
|
+
},
|
|
505
|
+
attributeOrElement: "p:sp"
|
|
506
|
+
});
|
|
507
|
+
const sanitizedSpec = sanitizeObjectBySchema(candidate, schema, (key, value) => schema.safeParse({
|
|
508
|
+
type: phType,
|
|
509
|
+
[key]: value
|
|
510
|
+
}).success);
|
|
511
|
+
if (sanitizedSpec !== void 0) {
|
|
512
|
+
textLevelsBySpec.set(sanitizedSpec, textLevels);
|
|
513
|
+
rawSpecs.push(sanitizedSpec);
|
|
514
|
+
rawSpids.push(spid);
|
|
515
|
+
}
|
|
477
516
|
}
|
|
478
|
-
|
|
517
|
+
const footerSlots = footerPlaceholders === void 0 ? {} : { footerPlaceholders };
|
|
518
|
+
if (rawSpecs.length === 0) return {
|
|
519
|
+
placeholderKeyBySpid,
|
|
520
|
+
nativeLevels: inheritedTextLevels,
|
|
521
|
+
...footerSlots
|
|
522
|
+
};
|
|
479
523
|
const keys = allocatePlaceholderAuthorKeys(rawSpecs);
|
|
480
524
|
const map = {};
|
|
481
525
|
for (let i = 0; i < rawSpecs.length; i += 1) {
|
|
@@ -485,65 +529,17 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
485
529
|
if (spid !== void 0) placeholderKeyBySpid.set(spid, key);
|
|
486
530
|
}
|
|
487
531
|
return {
|
|
532
|
+
nativeLevels: (ref) => {
|
|
533
|
+
const key = isMaster ? void 0 : matchLayoutPlaceholderKey(map, ref);
|
|
534
|
+
const spec = isMaster ? matchMasterPlaceholderSpec(map, ref.type) : key === void 0 ? void 0 : map[key];
|
|
535
|
+
return (spec === void 0 ? void 0 : textLevelsBySpec.get(spec)) ?? inheritedTextLevels(ref);
|
|
536
|
+
},
|
|
488
537
|
placeholders: Object.freeze(map),
|
|
489
|
-
placeholderKeyBySpid
|
|
538
|
+
placeholderKeyBySpid,
|
|
539
|
+
...footerSlots
|
|
490
540
|
};
|
|
491
541
|
}
|
|
492
542
|
/** Allocates a deterministic unique author id within `used`, disambiguating collisions with `-2`, `-3`, ... */
|
|
493
|
-
function allocateScopedAuthorId(requested, used, fallbackBase) {
|
|
494
|
-
const base = requested !== void 0 && requested.trim().length > 0 ? requested.trim() : fallbackBase;
|
|
495
|
-
if (!used.has(base)) {
|
|
496
|
-
used.add(base);
|
|
497
|
-
return base;
|
|
498
|
-
}
|
|
499
|
-
let suffix = 2;
|
|
500
|
-
while (used.has(`${base}-${suffix}`)) suffix += 1;
|
|
501
|
-
const unique = `${base}-${suffix}`;
|
|
502
|
-
used.add(unique);
|
|
503
|
-
return unique;
|
|
504
|
-
}
|
|
505
|
-
/** Consumes standard identity `<p:nvGrpSpPr>` and `<p:grpSpPr>` transform boilerplate on an `spTree`. */
|
|
506
|
-
function consumeIdentityShapeTreeBoilerplate(spTree) {
|
|
507
|
-
const nvGrpSpPr = spTree.child(P_NS, "nvGrpSpPr");
|
|
508
|
-
if (nvGrpSpPr !== void 0) {
|
|
509
|
-
const cNvPr = nvGrpSpPr.child(P_NS, "cNvPr");
|
|
510
|
-
if (cNvPr !== void 0) {
|
|
511
|
-
cNvPr.consumeAttr("id");
|
|
512
|
-
cNvPr.consumeAttr("name");
|
|
513
|
-
}
|
|
514
|
-
nvGrpSpPr.ignoreEmptyChild(P_NS, "cNvGrpSpPr");
|
|
515
|
-
nvGrpSpPr.ignoreEmptyChild(P_NS, "nvPr");
|
|
516
|
-
}
|
|
517
|
-
const grpSpPr = spTree.child(P_NS, "grpSpPr");
|
|
518
|
-
if (grpSpPr !== void 0) {
|
|
519
|
-
const xfrm = grpSpPr.child(A_NS, "xfrm");
|
|
520
|
-
if (xfrm !== void 0) {
|
|
521
|
-
const off = xfrm.child(A_NS, "off");
|
|
522
|
-
if (off !== void 0 && off.attr("x") === "0" && off.attr("y") === "0") {}
|
|
523
|
-
const ext = xfrm.child(A_NS, "ext");
|
|
524
|
-
if (ext !== void 0 && ext.attr("cx") === "0" && ext.attr("cy") === "0") {}
|
|
525
|
-
const chOff = xfrm.child(A_NS, "chOff");
|
|
526
|
-
if (chOff !== void 0 && chOff.attr("x") === "0" && chOff.attr("y") === "0") {}
|
|
527
|
-
const chExt = xfrm.child(A_NS, "chExt");
|
|
528
|
-
if (chExt !== void 0 && chExt.attr("cx") === "0" && chExt.attr("cy") === "0") {}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
/** Records `unconsumed-xml` diagnostics for all unconsumed attributes/elements under a root cursor. */
|
|
533
|
-
function appendUnconsumedDiagnostics(cursor, slideIndex, diagnostics) {
|
|
534
|
-
for (const item of cursor.collectUnconsumed()) diagnostics.push({
|
|
535
|
-
code: "unconsumed-xml",
|
|
536
|
-
category: "unsupported",
|
|
537
|
-
disposition: "omitted",
|
|
538
|
-
kind: item.kind,
|
|
539
|
-
location: {
|
|
540
|
-
...item.location,
|
|
541
|
-
...slideIndex === void 0 ? {} : { slideIndex }
|
|
542
|
-
},
|
|
543
|
-
namespaceUri: item.namespaceUri,
|
|
544
|
-
localName: item.localName
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
543
|
function validateMasterLayoutNumericId(rawId, part, xpath, diagnostics) {
|
|
548
544
|
if (rawId === void 0) return;
|
|
549
545
|
const parsed = ooxmlNonNegativeIntSchema.safeParse(rawId);
|
|
@@ -586,9 +582,47 @@ const supportedShapeTreeNamespaces = /* @__PURE__ */ new Set([
|
|
|
586
582
|
A_NS,
|
|
587
583
|
R_NS
|
|
588
584
|
]);
|
|
589
|
-
function
|
|
585
|
+
function matchShapeTreeHandler(cursor, handlers, groupMember = false, mediaKind) {
|
|
586
|
+
return handlers.find((handler) => cursor.namespaceUri === "http://schemas.openxmlformats.org/presentationml/2006/main" && (!groupMember || handler.groupMember !== void 0) && (handler.localName === cursor.localName || handler.alternateLocalNames?.includes(cursor.localName) === true) && (groupMember && typeof handler.groupMember === "function" ? handler.groupMember(cursor) : handler.matches === void 0 || handler.matches(cursor, mediaKind)));
|
|
587
|
+
}
|
|
588
|
+
/** Consumes the background fill flag independently of the editable shape it belongs to. */
|
|
589
|
+
function readShapeUseBgFill(cursor, slideIndex) {
|
|
590
|
+
if (cursor.namespaceUri !== "http://schemas.openxmlformats.org/presentationml/2006/main" || cursor.localName !== "sp") return void 0;
|
|
591
|
+
const rawValue = cursor.attr("useBgFill");
|
|
592
|
+
if (rawValue === void 0) return void 0;
|
|
593
|
+
const parsed = ooxmlBoolSchema.safeParse(rawValue);
|
|
594
|
+
if (parsed.success && !parsed.data) return void 0;
|
|
595
|
+
const location = {
|
|
596
|
+
part: cursor.part,
|
|
597
|
+
xpath: `${cursor.xpath}/@useBgFill`,
|
|
598
|
+
...slideIndex === void 0 ? {} : { slideIndex },
|
|
599
|
+
...peekShapeTreeObjectIdentity(cursor.element)
|
|
600
|
+
};
|
|
601
|
+
if (!parsed.success) return {
|
|
602
|
+
code: "invalid-xml-value",
|
|
603
|
+
category: "corrupt-input",
|
|
604
|
+
disposition: "recovered",
|
|
605
|
+
location,
|
|
606
|
+
attributeOrElement: "@useBgFill",
|
|
607
|
+
rawValue
|
|
608
|
+
};
|
|
609
|
+
return {
|
|
610
|
+
code: "unsupported-mechanism",
|
|
611
|
+
category: "unsupported",
|
|
612
|
+
disposition: "omitted",
|
|
613
|
+
location,
|
|
614
|
+
namespaceUri: P_NS,
|
|
615
|
+
localName: "useBgFill",
|
|
616
|
+
mechanismHint: "useBgFill"
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
function readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders, registerDeferredConnector, scopeObjectsBySpid, usedAuthorIds, masterTextStyles, slideDimensions, claimedPlaceholderKeys, mediaTiming, placeholderTextLevels) {
|
|
620
|
+
const backgroundFillDiagnostic = readShapeUseBgFill(itemCursor, slideIndex);
|
|
621
|
+
if (backgroundFillDiagnostic !== void 0) diagnostics.push(backgroundFillDiagnostic);
|
|
590
622
|
const identity = peekShapeTreeObjectIdentity(itemCursor.element);
|
|
591
|
-
const
|
|
623
|
+
const markerKind = mediaPictureKind(itemCursor.element);
|
|
624
|
+
const mediaKind = markerKind === "media" ? inferModernMediaKind(itemCursor.element, pkg, partPath, relIndex.byId, identity.objectId === void 0 ? void 0 : mediaTiming?.get(identity.objectId)?.kind) ?? markerKind : markerKind;
|
|
625
|
+
const match = mediaKind !== void 0 && slideIndex === void 0 ? void 0 : matchShapeTreeHandler(itemCursor, shapeTreeHandlers, false, mediaKind);
|
|
592
626
|
if (match === void 0) {
|
|
593
627
|
if (omittedSpids !== void 0 && identity.objectId !== void 0) omittedSpids.set(identity.objectId, {
|
|
594
628
|
...identity.objectName === void 0 ? {} : { objectName: identity.objectName },
|
|
@@ -607,7 +641,7 @@ function readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex
|
|
|
607
641
|
},
|
|
608
642
|
namespaceUri: itemCursor.namespaceUri,
|
|
609
643
|
localName: itemCursor.localName,
|
|
610
|
-
...frameInfo?.mechanismHint === void 0 ? {} : { mechanismHint: frameInfo.mechanismHint },
|
|
644
|
+
...mediaKind !== void 0 ? { mechanismHint: mediaKind } : frameInfo?.mechanismHint === void 0 ? {} : { mechanismHint: frameInfo.mechanismHint },
|
|
611
645
|
...frameInfo === void 0 || frameInfo.cascaded.length === 0 ? {} : { cascaded: frameInfo.cascaded }
|
|
612
646
|
});
|
|
613
647
|
itemCursor.suppressUnconsumed();
|
|
@@ -615,15 +649,32 @@ function readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex
|
|
|
615
649
|
}
|
|
616
650
|
const outcome = match.read({
|
|
617
651
|
cursor: itemCursor,
|
|
652
|
+
readGroupMember: (context) => {
|
|
653
|
+
const memberHandler = matchShapeTreeHandler(context.cursor, shapeTreeHandlers, true);
|
|
654
|
+
if (memberHandler === void 0) return void 0;
|
|
655
|
+
const backgroundFillDiagnostic = readShapeUseBgFill(context.cursor, slideIndex);
|
|
656
|
+
const member = memberHandler.read(context);
|
|
657
|
+
return backgroundFillDiagnostic === void 0 ? member : {
|
|
658
|
+
...member,
|
|
659
|
+
diagnostics: [backgroundFillDiagnostic, ...member.diagnostics ?? []]
|
|
660
|
+
};
|
|
661
|
+
},
|
|
618
662
|
part: partPath,
|
|
619
663
|
slideIndex: slideIndex ?? 0,
|
|
620
664
|
package: pkg,
|
|
621
665
|
...containerNode === void 0 ? {} : { containerNode },
|
|
666
|
+
...mediaTiming === void 0 ? {} : { mediaTiming },
|
|
667
|
+
...placeholderTextLevels === void 0 ? {} : { placeholderTextLevels },
|
|
622
668
|
relationships: relIndex.byId,
|
|
669
|
+
relationshipEntries: relIndex.entries,
|
|
623
670
|
registerDeferredSlideLink,
|
|
624
671
|
...registerImportedObject === void 0 ? {} : { registerImportedObject },
|
|
672
|
+
...registerDeferredConnector === void 0 ? {} : { registerDeferredConnector },
|
|
625
673
|
...layoutPlaceholders === void 0 ? {} : { layoutPlaceholders },
|
|
626
674
|
...masterPlaceholders === void 0 ? {} : { masterPlaceholders },
|
|
675
|
+
...masterTextStyles === void 0 ? {} : { masterTextStyles },
|
|
676
|
+
...slideDimensions === void 0 ? {} : { slideDimensions },
|
|
677
|
+
...claimedPlaceholderKeys === void 0 ? {} : { claimedPlaceholderKeys },
|
|
627
678
|
...clrMap === void 0 ? {} : { clrMap }
|
|
628
679
|
});
|
|
629
680
|
if (outcome.diagnostics !== void 0) diagnostics.push(...slideIndex === void 0 ? stripSlideIndexFromDiagnostics(outcome.diagnostics) : outcome.diagnostics);
|
|
@@ -635,25 +686,36 @@ function readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex
|
|
|
635
686
|
itemCursor.suppressUnconsumed();
|
|
636
687
|
return;
|
|
637
688
|
}
|
|
638
|
-
if (
|
|
689
|
+
if (identity.objectId !== void 0) {
|
|
690
|
+
registerImportedObject?.(identity.objectId, outcome.node);
|
|
691
|
+
scopeObjectsBySpid?.set(identity.objectId, outcome.node);
|
|
692
|
+
}
|
|
693
|
+
const authorId = outcome.node.props["id"];
|
|
694
|
+
if (typeof authorId === "string" && authorId.length > 0) usedAuthorIds?.add(authorId);
|
|
639
695
|
return outcome.node;
|
|
640
696
|
}
|
|
641
697
|
/** Shared `<p:spTree>` child reader for slides, slide layouts, and slide masters. */
|
|
642
698
|
function readShapeTreeItems(args) {
|
|
643
|
-
const { spTree, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, appendNode, diagnostics, containerNode, layoutPlaceholders, masterPlaceholders, clrMap, registerImportedObject, omittedSpids } = args;
|
|
699
|
+
const { spTree, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, appendNode, diagnostics, containerNode, layoutPlaceholders, masterPlaceholders, masterTextStyles, slideDimensions, claimedPlaceholderKeys, clrMap, registerImportedObject, omittedSpids, mediaTiming, placeholderTextLevels } = args;
|
|
644
700
|
consumeIdentityShapeTreeBoilerplate(spTree);
|
|
701
|
+
const scopeObjectsBySpid = /* @__PURE__ */ new Map();
|
|
702
|
+
const usedAuthorIds = /* @__PURE__ */ new Set();
|
|
703
|
+
const deferredConnectors = [];
|
|
704
|
+
const registerDeferredConnector = (resolve) => {
|
|
705
|
+
deferredConnectors.push(resolve);
|
|
706
|
+
};
|
|
645
707
|
for (const itemCursor of spTree.remainingElementChildren()) {
|
|
646
708
|
if (itemCursor.namespaceUri === MC_NS_IMPORT_PLACEHOLDER && itemCursor.localName === "AlternateContent") {
|
|
647
709
|
const selection = readAlternateContent(itemCursor, (ns) => supportedShapeTreeNamespaces.has(ns));
|
|
648
710
|
if (selection.branch === "choice") for (const childCursor of selection.children) {
|
|
649
|
-
const node = readSingleShapeTreeItem(childCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders);
|
|
711
|
+
const node = readSingleShapeTreeItem(childCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders, registerDeferredConnector, scopeObjectsBySpid, usedAuthorIds, masterTextStyles, slideDimensions, claimedPlaceholderKeys, mediaTiming, placeholderTextLevels);
|
|
650
712
|
if (node !== void 0) appendNode(node);
|
|
651
713
|
}
|
|
652
714
|
else if (selection.branch === "fallback") {
|
|
653
715
|
let adoptedFallback = false;
|
|
654
716
|
for (const childCursor of selection.children) {
|
|
655
717
|
const identity = peekShapeTreeObjectIdentity(childCursor.element);
|
|
656
|
-
const node = readSingleShapeTreeItem(childCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders);
|
|
718
|
+
const node = readSingleShapeTreeItem(childCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders, registerDeferredConnector, scopeObjectsBySpid, usedAuthorIds, masterTextStyles, slideDimensions, claimedPlaceholderKeys, mediaTiming, placeholderTextLevels);
|
|
657
719
|
if (node !== void 0) {
|
|
658
720
|
adoptedFallback = true;
|
|
659
721
|
appendNode(node);
|
|
@@ -695,12 +757,21 @@ function readShapeTreeItems(args) {
|
|
|
695
757
|
}
|
|
696
758
|
continue;
|
|
697
759
|
}
|
|
698
|
-
const node = readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders);
|
|
760
|
+
const node = readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders, registerDeferredConnector, scopeObjectsBySpid, usedAuthorIds, masterTextStyles, slideDimensions, claimedPlaceholderKeys, mediaTiming, placeholderTextLevels);
|
|
699
761
|
if (node !== void 0) appendNode(node);
|
|
700
762
|
}
|
|
763
|
+
if (deferredConnectors.length > 0) {
|
|
764
|
+
const scopeContext = {
|
|
765
|
+
scopeObjectsBySpid,
|
|
766
|
+
omittedSpids: omittedSpids ?? /* @__PURE__ */ new Map(),
|
|
767
|
+
usedAuthorIds,
|
|
768
|
+
diagnostics
|
|
769
|
+
};
|
|
770
|
+
for (const resolveConnector of deferredConnectors) resolveConnector(scopeContext);
|
|
771
|
+
}
|
|
701
772
|
}
|
|
702
773
|
const MC_NS_IMPORT_PLACEHOLDER = "http://schemas.openxmlformats.org/markup-compatibility/2006";
|
|
703
|
-
function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrder, usedLayoutIds, masterClrMap, masterLevelSlideHandlers, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, readPlaceholderVisuals) {
|
|
774
|
+
function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrder, usedLayoutIds, masterClrMap, readsFooterPlaceholders, masterLevelSlideHandlers, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, masterTextLevels, textLevelsByLayout, readPlaceholderVisuals) {
|
|
704
775
|
const xmlText = pkg.readTextPart(layoutPartPath);
|
|
705
776
|
if (xmlText === void 0) return void 0;
|
|
706
777
|
let layoutEl;
|
|
@@ -792,12 +863,16 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
792
863
|
consumeCommonSlideCreationId(cSld);
|
|
793
864
|
const spTree = cSld.child(P_NS, "spTree");
|
|
794
865
|
let placeholders;
|
|
866
|
+
let footerPlaceholders;
|
|
795
867
|
let layoutPlaceholderKeyBySpid;
|
|
868
|
+
let layoutTextLevels = masterTextLevels;
|
|
796
869
|
if (spTree !== void 0) {
|
|
797
870
|
consumeIdentityShapeTreeBoilerplate(spTree);
|
|
798
|
-
const placeholderRead = readPlaceholderSpList(spTree, masterClrMap, false, pkg, layoutPartPath, diagnostics, readPlaceholderVisuals);
|
|
871
|
+
const placeholderRead = readPlaceholderSpList(spTree, masterClrMap, false, readsFooterPlaceholders, pkg, layoutPartPath, diagnostics, masterTextLevels, readPlaceholderVisuals);
|
|
872
|
+
layoutTextLevels = placeholderRead.nativeLevels;
|
|
799
873
|
placeholders = placeholderRead.placeholders;
|
|
800
874
|
layoutPlaceholderKeyBySpid = placeholderRead.placeholderKeyBySpid;
|
|
875
|
+
footerPlaceholders = placeholderRead.footerPlaceholders;
|
|
801
876
|
}
|
|
802
877
|
const clrMapOvr = layoutCursor.child(P_NS, "clrMapOvr");
|
|
803
878
|
let colorMapOverride;
|
|
@@ -821,23 +896,7 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
821
896
|
relationshipId: backMasterRel.Id
|
|
822
897
|
});
|
|
823
898
|
}
|
|
824
|
-
|
|
825
|
-
const themeOverrideRel = layoutRels.entries.find((entry) => entry.Type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/themeOverride" && entry.TargetMode !== "External");
|
|
826
|
-
if (themeOverrideRel !== void 0) {
|
|
827
|
-
const overridePart = resolvePartPath(layoutPartPath, themeOverrideRel.Target);
|
|
828
|
-
if (overridePart === void 0 || !pkg.hasPart(overridePart)) diagnostics.push({
|
|
829
|
-
code: "missing-target-part",
|
|
830
|
-
category: "corrupt-input",
|
|
831
|
-
disposition: "omitted",
|
|
832
|
-
location: {
|
|
833
|
-
part: layoutPartPath,
|
|
834
|
-
xpath: themeOverrideRel.xpath
|
|
835
|
-
},
|
|
836
|
-
relationshipId: themeOverrideRel.Id,
|
|
837
|
-
targetPart: overridePart ?? themeOverrideRel.Target
|
|
838
|
-
});
|
|
839
|
-
else themeOverride = readThemeOverridePart(pkg, overridePart, void 0, diagnostics);
|
|
840
|
-
}
|
|
899
|
+
const themeOverride = readPartThemeOverride(pkg, layoutRels.entries, { part: layoutPartPath }, diagnostics);
|
|
841
900
|
const props = {
|
|
842
901
|
id: allocateScopedAuthorId(layoutName, usedLayoutIds, `layout-${layoutOrder}`),
|
|
843
902
|
...layoutName === void 0 ? {} : { name: layoutName },
|
|
@@ -850,9 +909,12 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
850
909
|
...placeholders === void 0 ? {} : { placeholders },
|
|
851
910
|
...colorMapOverride === void 0 ? {} : { colorMapOverride },
|
|
852
911
|
...themeOverride === void 0 ? {} : { themeOverride },
|
|
912
|
+
...footerPlaceholders === void 0 ? {} : { footerPlaceholders },
|
|
853
913
|
...layoutHeaderFooter === void 0 ? {} : { headerFooter: layoutHeaderFooter }
|
|
854
914
|
};
|
|
855
915
|
const layoutNode = createSlideLayoutNode(props);
|
|
916
|
+
const layoutObjectBySpid = /* @__PURE__ */ new Map();
|
|
917
|
+
const layoutOmittedSpids = /* @__PURE__ */ new Map();
|
|
856
918
|
if (spTree !== void 0 && shapeTreeHandlers.length > 0) readShapeTreeItems({
|
|
857
919
|
spTree,
|
|
858
920
|
pkg,
|
|
@@ -865,6 +927,10 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
865
927
|
},
|
|
866
928
|
shapeTreeHandlers,
|
|
867
929
|
registerDeferredSlideLink,
|
|
930
|
+
registerImportedObject: (spid, node) => {
|
|
931
|
+
layoutObjectBySpid.set(spid, node);
|
|
932
|
+
},
|
|
933
|
+
omittedSpids: layoutOmittedSpids,
|
|
868
934
|
appendNode: (node) => layoutNode.append(node),
|
|
869
935
|
diagnostics,
|
|
870
936
|
containerNode: layoutNode,
|
|
@@ -878,14 +944,17 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
878
944
|
part: layoutPartPath,
|
|
879
945
|
...slideHandler.slot === "transition" ? {} : { slideIndex: 0 },
|
|
880
946
|
package: pkg,
|
|
947
|
+
objectBySpid: layoutObjectBySpid,
|
|
948
|
+
omittedSpids: layoutOmittedSpids,
|
|
881
949
|
...layoutPlaceholderKeyBySpid === void 0 ? {} : { placeholderKeyBySpid: layoutPlaceholderKeyBySpid }
|
|
882
950
|
});
|
|
883
951
|
diagnostics.push(...stripSlideIndexFromDiagnostics(outcome.diagnostics));
|
|
884
952
|
}
|
|
885
953
|
appendUnconsumedDiagnostics(layoutCursor, void 0, diagnostics);
|
|
954
|
+
textLevelsByLayout.set(layoutPartPath, layoutTextLevels);
|
|
886
955
|
return layoutNode;
|
|
887
956
|
}
|
|
888
|
-
function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, themesByPartPath, layoutNodeByPartPath, clrMapByLayoutPartPath, masterLevelSlideHandlers, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, readPlaceholderVisuals) {
|
|
957
|
+
function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, themesByPartPath, layoutNodeByPartPath, clrMapByLayoutPartPath, readsFooterPlaceholders, masterLevelSlideHandlers, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, textLevelsByLayout, readPlaceholderVisuals) {
|
|
889
958
|
const xmlText = pkg.readTextPart(masterPartPath);
|
|
890
959
|
if (xmlText === void 0) return void 0;
|
|
891
960
|
let masterEl;
|
|
@@ -949,21 +1018,19 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
949
1018
|
if (isNonDefaultColorMap(parsedMap)) colorMap = parsedMap;
|
|
950
1019
|
}
|
|
951
1020
|
const spTree = cSld.child(P_NS, "spTree");
|
|
1021
|
+
const masterText = readMasterTextStyles(masterCursor.child(P_NS, "txStyles"), masterClrMap, masterPartPath, diagnostics);
|
|
1022
|
+
const textStyles = masterText.styles;
|
|
1023
|
+
let masterTextLevels = masterText.nativeLevels;
|
|
952
1024
|
let masterPlaceholders;
|
|
1025
|
+
let footerPlaceholders;
|
|
953
1026
|
let masterPlaceholderKeyBySpid;
|
|
954
1027
|
if (spTree !== void 0) {
|
|
955
1028
|
consumeIdentityShapeTreeBoilerplate(spTree);
|
|
956
|
-
const placeholderRead = readPlaceholderSpList(spTree, masterClrMap, true, pkg, masterPartPath, diagnostics, readPlaceholderVisuals);
|
|
1029
|
+
const placeholderRead = readPlaceholderSpList(spTree, masterClrMap, true, readsFooterPlaceholders, pkg, masterPartPath, diagnostics, masterTextLevels, readPlaceholderVisuals);
|
|
1030
|
+
masterTextLevels = placeholderRead.nativeLevels;
|
|
957
1031
|
masterPlaceholders = placeholderRead.placeholders;
|
|
958
1032
|
masterPlaceholderKeyBySpid = placeholderRead.placeholderKeyBySpid;
|
|
959
|
-
|
|
960
|
-
const txStylesCursor = masterCursor.child(P_NS, "txStyles");
|
|
961
|
-
let textStyles;
|
|
962
|
-
if (txStylesCursor !== void 0) {
|
|
963
|
-
txStylesCursor.ignoreEmptyChild(P_NS, "titleStyle");
|
|
964
|
-
txStylesCursor.ignoreEmptyChild(P_NS, "bodyStyle");
|
|
965
|
-
txStylesCursor.ignoreEmptyChild(P_NS, "otherStyle");
|
|
966
|
-
textStyles = readMasterTextStyles(txStylesCursor, masterClrMap);
|
|
1033
|
+
footerPlaceholders = placeholderRead.footerPlaceholders;
|
|
967
1034
|
}
|
|
968
1035
|
const masterHeaderFooter = readHeaderFooterElement(masterCursor, masterPartPath, diagnostics);
|
|
969
1036
|
const masterRels = pkg.readRelationships(masterPartPath);
|
|
@@ -995,9 +1062,12 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
995
1062
|
...textStyles === void 0 ? {} : { textStyles },
|
|
996
1063
|
...masterTheme === void 0 ? {} : { theme: masterTheme },
|
|
997
1064
|
...colorMap === void 0 ? {} : { colorMap },
|
|
1065
|
+
...footerPlaceholders === void 0 ? {} : { footerPlaceholders },
|
|
998
1066
|
...masterHeaderFooter === void 0 ? {} : { headerFooter: masterHeaderFooter }
|
|
999
1067
|
};
|
|
1000
1068
|
const masterNode = createSlideMasterNode(masterProps);
|
|
1069
|
+
const masterObjectBySpid = /* @__PURE__ */ new Map();
|
|
1070
|
+
const masterOmittedSpids = /* @__PURE__ */ new Map();
|
|
1001
1071
|
if (spTree !== void 0 && shapeTreeHandlers.length > 0) readShapeTreeItems({
|
|
1002
1072
|
spTree,
|
|
1003
1073
|
pkg,
|
|
@@ -1010,6 +1080,10 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
1010
1080
|
},
|
|
1011
1081
|
shapeTreeHandlers,
|
|
1012
1082
|
registerDeferredSlideLink,
|
|
1083
|
+
registerImportedObject: (spid, node) => {
|
|
1084
|
+
masterObjectBySpid.set(spid, node);
|
|
1085
|
+
},
|
|
1086
|
+
omittedSpids: masterOmittedSpids,
|
|
1013
1087
|
appendNode: (node) => masterNode.append(node),
|
|
1014
1088
|
diagnostics,
|
|
1015
1089
|
containerNode: masterNode,
|
|
@@ -1023,6 +1097,8 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
1023
1097
|
part: masterPartPath,
|
|
1024
1098
|
...slideHandler.slot === "transition" ? {} : { slideIndex: 0 },
|
|
1025
1099
|
package: pkg,
|
|
1100
|
+
objectBySpid: masterObjectBySpid,
|
|
1101
|
+
omittedSpids: masterOmittedSpids,
|
|
1026
1102
|
...masterPlaceholderKeyBySpid === void 0 ? {} : { placeholderKeyBySpid: masterPlaceholderKeyBySpid }
|
|
1027
1103
|
});
|
|
1028
1104
|
diagnostics.push(...stripSlideIndexFromDiagnostics(outcome.diagnostics));
|
|
@@ -1077,7 +1153,7 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
1077
1153
|
});
|
|
1078
1154
|
continue;
|
|
1079
1155
|
}
|
|
1080
|
-
const layoutNode = readSlideLayoutPart(pkg, layoutPart, masterPartPath, index + 1, usedLayoutIds, masterClrMap, masterLevelSlideHandlers, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, readPlaceholderVisuals);
|
|
1156
|
+
const layoutNode = readSlideLayoutPart(pkg, layoutPart, masterPartPath, index + 1, usedLayoutIds, masterClrMap, readsFooterPlaceholders, masterLevelSlideHandlers, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, masterTextLevels, textLevelsByLayout, readPlaceholderVisuals);
|
|
1081
1157
|
if (layoutNode !== void 0) {
|
|
1082
1158
|
masterNode.append(layoutNode);
|
|
1083
1159
|
layoutNodeByPartPath.set(layoutPart, layoutNode);
|
|
@@ -1092,7 +1168,7 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
1092
1168
|
* Traverses `<p:sldMasterIdLst>` and `<p:sldLayoutIdLst>` relationships to reconstruct explicit
|
|
1093
1169
|
* `SlideMaster` and `SlideLayout` ownership (including idle layouts) onto `deckNode`.
|
|
1094
1170
|
*/
|
|
1095
|
-
function importMastersAndLayouts(presCursor, pkg, presRelById, deckNode, usedDeckIds, diagnostics, slideHandlers = [], shapeTreeHandlers = [], registerDeferredSlideLink = () => {}, clrMapByLayoutPartPath = /* @__PURE__ */ new Map(), readPlaceholderVisuals) {
|
|
1171
|
+
function importMastersAndLayouts(presCursor, pkg, presRelById, deckNode, usedDeckIds, diagnostics, slideHandlers = [], shapeTreeHandlers = [], registerDeferredSlideLink = () => {}, clrMapByLayoutPartPath = /* @__PURE__ */ new Map(), readPlaceholderVisuals, readsFooterPlaceholders = false, textLevelsByLayout = /* @__PURE__ */ new Map()) {
|
|
1096
1172
|
const masterLevelSlideHandlers = slideHandlers.filter((handler) => handler.slot === "background" || handler.slot === "header-footer" || handler.slot === "transition" || handler.slot === "timing");
|
|
1097
1173
|
const layoutNodeByPartPath = /* @__PURE__ */ new Map();
|
|
1098
1174
|
const themesByPartPath = /* @__PURE__ */ new Map();
|
|
@@ -1145,7 +1221,7 @@ function importMastersAndLayouts(presCursor, pkg, presRelById, deckNode, usedDec
|
|
|
1145
1221
|
});
|
|
1146
1222
|
continue;
|
|
1147
1223
|
}
|
|
1148
|
-
const masterNode = readSlideMasterPart(pkg, masterPart, index + 1, usedDeckIds, themesByPartPath, layoutNodeByPartPath, clrMapByLayoutPartPath, masterLevelSlideHandlers, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, readPlaceholderVisuals);
|
|
1224
|
+
const masterNode = readSlideMasterPart(pkg, masterPart, index + 1, usedDeckIds, themesByPartPath, layoutNodeByPartPath, clrMapByLayoutPartPath, readsFooterPlaceholders, masterLevelSlideHandlers, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, textLevelsByLayout, readPlaceholderVisuals);
|
|
1149
1225
|
if (masterNode !== void 0) deckNode.append(masterNode);
|
|
1150
1226
|
}
|
|
1151
1227
|
return layoutNodeByPartPath;
|