@officedk/pptxdk 0.2.0 → 0.2.2
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 +5 -8
- package/dist/build.js +44 -52
- 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/{capabilities/dist → core/dist/capabilities}/box/box-codegen.js +7 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box-declaration.js +8 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box.js +14 -15
- package/dist/core/dist/capabilities/box/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-codegen.js +11 -18
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-import.js +891 -468
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-labels.js +30 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-model.js +1 -1
- 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 +73 -79
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-xml.js +41 -36
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart.js +175 -113
- package/dist/core/dist/capabilities/chart/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/axes-and-grid.js +2 -2
- 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 +28 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/layout.js +7 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/legend.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/line-area.js +1 -1
- 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 +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/style.js +1 -1
- 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 +3 -3
- 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 +113 -50
- 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/{capabilities/dist → core/dist/capabilities}/group/group-codegen.js +6 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-declaration.js +8 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-import.js +36 -77
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group.js +17 -17
- 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/{capabilities/dist → core/dist/capabilities}/line/line-codegen.js +6 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-declaration.js +15 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-import.js +15 -95
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line.js +41 -43
- package/dist/core/dist/capabilities/masters/entry.js +1 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters-codegen.js +7 -26
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters.js +23 -35
- package/dist/core/dist/capabilities/motion/entry.js +5 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-codegen.js +15 -35
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-import.js +25 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-plan.js +17 -14
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-query.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion.js +79 -75
- package/dist/core/dist/capabilities/notes/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-codegen.js +4 -5
- 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 +6 -6
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes.js +16 -41
- 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/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder-codegen.js +5 -15
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder-schemas.js +7 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder.js +50 -107
- 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 +44 -30
- package/dist/core/dist/capabilities/shared/container-slots.js +59 -0
- package/dist/core/dist/capabilities/shared/date-time.js +98 -0
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-embedding.js +5 -6
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-engine.js +34 -13
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-import.js +62 -23
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-subset.js +24 -9
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font.js +4 -4
- package/dist/core/dist/capabilities/shared/geometry-codegen.js +101 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/geometry.js +47 -44
- 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 -79
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-schemas.js +16 -26
- 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/{capabilities/dist/motion → core/dist/capabilities/shared}/motion-api.js +112 -99
- package/dist/{capabilities/dist/motion → core/dist/capabilities/shared}/motion-schemas.js +19 -5
- package/dist/{capabilities/dist/image/image-import.js → core/dist/capabilities/shared/picture-import.js} +97 -158
- package/dist/core/dist/capabilities/shared/picture-xml.js +13 -0
- package/dist/core/dist/capabilities/shared/picture.js +510 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/placeholder-import.js +50 -20
- package/dist/core/dist/capabilities/shared/placeholder-roles.js +42 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/preset-definitions.js +1 -1
- package/dist/core/dist/capabilities/shared/print-xml.js +77 -0
- package/dist/{capabilities/dist/text/text-codegen.js → core/dist/capabilities/shared/rich-text-codegen.js} +23 -102
- package/dist/core/dist/capabilities/shared/rich-text-import.js +472 -0
- package/dist/{capabilities/dist/shape → core/dist/capabilities/shared}/shape-declaration.js +14 -14
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/style-inheritance.js +12 -5
- package/dist/{capabilities/dist/text → core/dist/capabilities/shared}/text-declaration.js +7 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/text-schemas.js +77 -77
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/text-service.js +571 -260
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/visual.js +137 -112
- 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 +5 -5
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-xml.js +2 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background.js +27 -33
- package/dist/core/dist/capabilities/table/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-codegen.js +6 -13
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-import.js +22 -57
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-schemas.js +40 -37
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-xml.js +9 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table.js +60 -45
- 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 +61 -54
- package/dist/core/dist/capabilities/transition/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-api.js +1 -1
- 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 +13 -8
- package/dist/{codegen/dist → core/dist/codegen}/codegen.js +54 -122
- package/dist/{codegen/dist → core/dist/codegen}/identifiers.js +17 -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 +122 -60
- package/dist/core/dist/emit/index.js +6 -0
- package/dist/core/dist/emit/ooxml.js +241 -0
- package/dist/{import/dist → core/dist/import}/import.js +221 -187
- package/dist/core/dist/import/index.js +19 -0
- package/dist/{import/dist → core/dist/import}/masters.js +253 -317
- 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} +1 -1
- package/dist/core/dist/{author-schemas.js → kernel/author-schemas.js} +59 -98
- package/dist/core/dist/{block-flex-layout.js → kernel/block-flex-layout.js} +109 -78
- package/dist/core/dist/kernel/build.js +4 -0
- package/dist/core/dist/kernel/capability.js +17 -0
- package/dist/{codegen/dist/types.js → core/dist/kernel/codegen.js} +22 -2
- 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} +1 -1
- package/dist/core/dist/{diagnostics.js → kernel/diagnostics.js} +22 -5
- package/dist/core/dist/{document-internals.js → kernel/document-internals.js} +1 -1
- package/dist/core/dist/{document.js → kernel/document.js} +6 -5
- package/dist/core/dist/kernel/drawing-units.js +14 -0
- package/dist/core/dist/{font-seal.js → kernel/font-seal.js} +2 -2
- package/dist/core/dist/{geometry-schemas.js → kernel/geometry-schemas.js} +2 -6
- package/dist/core/dist/{grid-layout.js → kernel/grid-layout.js} +156 -55
- package/dist/core/dist/{host.js → kernel/host.js} +1 -1
- package/dist/core/dist/kernel/index.js +24 -0
- package/dist/core/dist/{input-values.js → kernel/input-values.js} +4 -3
- package/dist/core/dist/kernel/layout-definition.js +7 -0
- package/dist/core/dist/{layout-protocol.js → kernel/layout-protocol.js} +1 -1
- package/dist/core/dist/{layout-schemas.js → kernel/layout-schemas.js} +2 -6
- package/dist/core/dist/{layout.js → kernel/layout.js} +37 -38
- package/dist/core/dist/{masters.js → kernel/masters.js} +32 -55
- package/dist/core/dist/{morph.js → kernel/morph.js} +1 -1
- package/dist/core/dist/{placeholders.js → kernel/placeholders.js} +23 -9
- 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 +1 -1
- package/dist/core/dist/kernel/pptx-read/drawing-list-import.js +251 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/fonts.js +1 -1
- 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 +5 -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 +40 -5
- package/dist/{import/dist → core/dist/kernel/pptx-read}/visual.js +94 -67
- package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-fragments.js +56 -13
- 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} +62 -274
- package/dist/core/dist/{query.js → kernel/query.js} +5 -1
- package/dist/core/dist/{resolution.js → kernel/resolution.js} +1 -1
- package/dist/core/dist/kernel/resolve-work.js +58 -0
- package/dist/core/dist/{resolve.js → kernel/resolve.js} +226 -257
- package/dist/core/dist/kernel/resource-source.js +11 -0
- package/dist/core/dist/{stage-options.js → kernel/stage-options.js} +23 -11
- package/dist/core/dist/{theme.js → kernel/theme.js} +54 -36
- package/dist/core/dist/{transform-geometry.js → kernel/transform-geometry.js} +1 -1
- package/dist/core/dist/kernel/xml-values.js +13 -0
- package/dist/{document-41spD7bq.d.ts → document-C0lPlH-L.d.ts} +614 -522
- package/dist/{capability-BbKW9w4O.d.ts → index-B9_OUeA-.d.ts} +660 -553
- package/dist/{index-BEwhk7c8.d.ts → index-BJEzQxWV.d.ts} +27 -24
- package/dist/{index-cK2KtukZ.d.ts → index-DA9flrlR.d.ts} +2 -17
- package/dist/{index-v77CTJev.d.ts → index-GSt0t9VO.d.ts} +3 -4
- package/dist/index.d.ts +7 -8
- package/dist/index.js +68 -66
- package/dist/node.d.ts +16 -14
- package/dist/node.js +86 -43
- package/dist/pptxdk/src/cli-commands.js +9 -5
- package/dist/pptxdk/src/compose.js +28 -29
- 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 +84 -34
- package/dist/preview/dist/options.js +8 -4
- package/dist/preview/dist/raster.js +66 -0
- package/dist/preview/dist/svg-guard.js +8 -7
- package/dist/preview.d.ts +3 -9
- package/dist/preview.js +7 -25
- 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/{capabilities/dist/text → react/dist/author}/text-elements.js +15 -5
- package/dist/react/dist/author/video-elements.js +14 -0
- package/dist/react/dist/document-adapter.js +4 -4
- package/dist/react/dist/elements.js +7 -4
- package/dist/react/dist/from-vanilla.js +3 -3
- package/dist/react/dist/index.js +17 -3
- package/dist/react/dist/reconciler.js +3 -3
- package/dist/react.d.ts +103 -69
- package/dist/react.js +28 -28
- package/dist/{index-1ag7U9Jt.d.ts → stages-DYHSHKt4.d.ts} +23 -6
- package/dist/vanilla.d.ts +4 -4
- package/dist/vanilla.js +14 -15
- package/package.json +8 -7
- package/dist/build-zrZuX4fK.d.ts +0 -3
- package/dist/capabilities/dist/all.js +0 -34
- 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 -168
- package/dist/capabilities/dist/group/group-elements.js +0 -12
- package/dist/capabilities/dist/image/image-codegen.js +0 -164
- 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 -552
- package/dist/capabilities/dist/line/line-elements.js +0 -12
- 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-elements.js +0 -13
- package/dist/capabilities/dist/shape/shape-codegen.js +0 -236
- package/dist/capabilities/dist/shape/shape-elements.js +0 -12
- package/dist/capabilities/dist/shape/shape-import.js +0 -628
- package/dist/capabilities/dist/slide-background/slide-background-codegen.js +0 -44
- package/dist/capabilities/dist/text/text-import.js +0 -1224
- package/dist/core/dist/build.js +0 -4
- package/dist/core/dist/capability.js +0 -15
- package/dist/emit/dist/index.js +0 -5
- package/dist/import/dist/index.js +0 -16
- package/dist/pptxdk/src/slide.js +0 -9
- package/dist/transition-6n8GZxSg.d.ts +0 -9
|
@@ -1,20 +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 {
|
|
14
|
-
import {
|
|
15
|
-
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";
|
|
16
22
|
import { z } from "zod";
|
|
17
|
-
// ../
|
|
23
|
+
// ../core/dist/import/masters.js
|
|
18
24
|
const minimumMasterLayoutId = 2147483648;
|
|
19
25
|
const maximumMasterLayoutId = 4294967295;
|
|
20
26
|
const slideMasterAttrsSchema = z.object({ preserve: ooxmlBoolSchema.optional() });
|
|
@@ -122,11 +128,9 @@ function readDefRPr(rPr, clrMap, partPath, diagnostics) {
|
|
|
122
128
|
location: { part: partPath },
|
|
123
129
|
diagnostics,
|
|
124
130
|
allowBaseline: false,
|
|
125
|
-
allowNoneTextDecoration: true,
|
|
126
131
|
diagnoseUnsupportedEnums: false
|
|
127
132
|
});
|
|
128
|
-
const
|
|
129
|
-
const color = solidFill === void 0 ? void 0 : readStyleColor(solidFill, clrMap);
|
|
133
|
+
const { color, textStroke } = readRunFillAndStroke(rPr, { part: partPath }, diagnostics, (solidFill) => readStyleColor(solidFill, clrMap));
|
|
130
134
|
rPr.ignoreEmptyChild(A_NS, "noFill");
|
|
131
135
|
let textShadow;
|
|
132
136
|
const effectLst = rPr.child(A_NS, "effectLst");
|
|
@@ -169,153 +173,20 @@ function readDefRPr(rPr, clrMap, partPath, diagnostics) {
|
|
|
169
173
|
}
|
|
170
174
|
const { fontFamily, eastAsianFontFamily } = readRunFontSlots(rPr);
|
|
171
175
|
return {
|
|
172
|
-
...
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
function pushBoundedAttrDiagnostic(diagnostics, partPath, xpath, attrName, rawValue) {
|
|
186
|
-
diagnostics.push({
|
|
187
|
-
code: "invalid-xml-value",
|
|
188
|
-
category: "corrupt-input",
|
|
189
|
-
disposition: "omitted",
|
|
190
|
-
location: {
|
|
191
|
-
part: partPath,
|
|
192
|
-
xpath: `${xpath}/@${attrName}`
|
|
193
|
-
},
|
|
194
|
-
attributeOrElement: `@${attrName}`,
|
|
195
|
-
rawValue
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function readLevelParagraphProperties(pPr, levelIndex0, clrMap, partPath, diagnostics) {
|
|
199
|
-
const rawAttrs = pPr.attrsObject([
|
|
200
|
-
"marL",
|
|
201
|
-
"indent",
|
|
202
|
-
"algn",
|
|
203
|
-
"defTabSz",
|
|
204
|
-
"rtl",
|
|
205
|
-
"eaLnBrk",
|
|
206
|
-
"latinLnBrk",
|
|
207
|
-
"hangingPunct",
|
|
208
|
-
"fontAlgn"
|
|
209
|
-
]);
|
|
210
|
-
let marginLeft;
|
|
211
|
-
if (rawAttrs["marL"] !== void 0) {
|
|
212
|
-
const marLParsed = ooxmlWritableExtentEmuSchema.safeParse(rawAttrs["marL"]);
|
|
213
|
-
if (marLParsed.success) marginLeft = emuToPx(marLParsed.data);
|
|
214
|
-
else pushBoundedAttrDiagnostic(diagnostics, partPath, pPr.xpath, "marL", rawAttrs["marL"]);
|
|
215
|
-
}
|
|
216
|
-
let indent;
|
|
217
|
-
if (rawAttrs["indent"] !== void 0) {
|
|
218
|
-
const indentParsed = ooxmlWritableInt32CoordEmuSchema.safeParse(rawAttrs["indent"]);
|
|
219
|
-
if (indentParsed.success) indent = emuToPx(indentParsed.data);
|
|
220
|
-
else pushBoundedAttrDiagnostic(diagnostics, partPath, pPr.xpath, "indent", rawAttrs["indent"]);
|
|
221
|
-
}
|
|
222
|
-
const align = rawAttrs["algn"] === void 0 ? void 0 : {
|
|
223
|
-
l: "left",
|
|
224
|
-
ctr: "center",
|
|
225
|
-
r: "right",
|
|
226
|
-
just: "justify"
|
|
227
|
-
}[rawAttrs["algn"]];
|
|
228
|
-
const spcBef = pPr.child(A_NS, "spcBef");
|
|
229
|
-
const spcBefPts = spcBef?.child(A_NS, "spcPts");
|
|
230
|
-
(spcBef?.child(A_NS, "spcPct"))?.consumeAttr("val");
|
|
231
|
-
let spacingBefore;
|
|
232
|
-
if (spcBefPts !== void 0) {
|
|
233
|
-
const rawVal = spcBefPts.attr("val");
|
|
234
|
-
const parsed = ooxmlParagraphSpacingPointsSchema.safeParse(rawVal);
|
|
235
|
-
if (parsed.success) spacingBefore = parsed.data / 75;
|
|
236
|
-
else if (rawVal !== void 0) pushBoundedAttrDiagnostic(diagnostics, partPath, spcBefPts.xpath, "val", rawVal);
|
|
237
|
-
}
|
|
238
|
-
const spcAft = pPr.child(A_NS, "spcAft");
|
|
239
|
-
const spcAftPts = spcAft?.child(A_NS, "spcPts");
|
|
240
|
-
(spcAft?.child(A_NS, "spcPct"))?.consumeAttr("val");
|
|
241
|
-
let spacingAfter;
|
|
242
|
-
if (spcAftPts !== void 0) {
|
|
243
|
-
const rawVal = spcAftPts.attr("val");
|
|
244
|
-
const parsed = ooxmlParagraphSpacingPointsSchema.safeParse(rawVal);
|
|
245
|
-
if (parsed.success) spacingAfter = parsed.data / 75;
|
|
246
|
-
else if (rawVal !== void 0) pushBoundedAttrDiagnostic(diagnostics, partPath, spcAftPts.xpath, "val", rawVal);
|
|
247
|
-
}
|
|
248
|
-
const lnSpc = pPr.child(A_NS, "lnSpc");
|
|
249
|
-
const lnSpcPts = lnSpc?.child(A_NS, "spcPts");
|
|
250
|
-
const lnSpcPct = lnSpc?.child(A_NS, "spcPct");
|
|
251
|
-
let lineHeight;
|
|
252
|
-
if (lnSpcPts !== void 0) {
|
|
253
|
-
const rawVal = lnSpcPts.attr("val");
|
|
254
|
-
const parsed = ooxmlLineSpacingPointsSchema.safeParse(rawVal);
|
|
255
|
-
if (parsed.success) lineHeight = `${parsed.data / 100}pt`;
|
|
256
|
-
else if (rawVal !== void 0) pushBoundedAttrDiagnostic(diagnostics, partPath, lnSpcPts.xpath, "val", rawVal);
|
|
257
|
-
} else if (lnSpcPct !== void 0) {
|
|
258
|
-
const rawVal = lnSpcPct.attr("val");
|
|
259
|
-
const parsed = ooxmlLineSpacingPercentSchema.safeParse(rawVal);
|
|
260
|
-
if (parsed.success) lineHeight = `${parsed.data / 1e3}%`;
|
|
261
|
-
else if (rawVal !== void 0) pushBoundedAttrDiagnostic(diagnostics, partPath, lnSpcPct.xpath, "val", rawVal);
|
|
262
|
-
}
|
|
263
|
-
pPr.ignoreEmptyChild(A_NS, "buNone");
|
|
264
|
-
const buFont = pPr.child(A_NS, "buFont");
|
|
265
|
-
if (buFont !== void 0) {
|
|
266
|
-
buFont.consumeAttr("typeface");
|
|
267
|
-
buFont.consumeAttr("pitchFamily");
|
|
268
|
-
buFont.consumeAttr("charset");
|
|
269
|
-
buFont.consumeAttr("panose");
|
|
270
|
-
}
|
|
271
|
-
const buChar = pPr.child(A_NS, "buChar");
|
|
272
|
-
const buAutoNum = pPr.child(A_NS, "buAutoNum");
|
|
273
|
-
let list;
|
|
274
|
-
if (buChar !== void 0) {
|
|
275
|
-
const rawChar = buChar.attr("char");
|
|
276
|
-
const normalized = normalizeBulletCharacter(rawChar);
|
|
277
|
-
if (normalized.recovered) diagnostics.push({
|
|
278
|
-
code: "invalid-xml-value",
|
|
279
|
-
category: "corrupt-input",
|
|
280
|
-
disposition: "recovered",
|
|
281
|
-
location: {
|
|
282
|
-
part: partPath,
|
|
283
|
-
xpath: `${buChar.xpath}/@char`
|
|
284
|
-
},
|
|
285
|
-
attributeOrElement: "a:buChar/@char",
|
|
286
|
-
rawValue: rawChar ?? ""
|
|
287
|
-
});
|
|
288
|
-
list = {
|
|
289
|
-
type: "bullet",
|
|
290
|
-
character: normalized.character,
|
|
291
|
-
...levelIndex0 > 0 ? { level: levelIndex0 } : {}
|
|
292
|
-
};
|
|
293
|
-
} else if (buAutoNum !== void 0) {
|
|
294
|
-
buAutoNum.consumeAttr("type");
|
|
295
|
-
const rawStartAt = buAutoNum.attr("startAt");
|
|
296
|
-
let startAt;
|
|
297
|
-
if (rawStartAt !== void 0) {
|
|
298
|
-
const startParsed = ooxmlAutoNumStartAtSchema.safeParse(rawStartAt);
|
|
299
|
-
if (startParsed.success) startAt = startParsed.data;
|
|
300
|
-
else pushBoundedAttrDiagnostic(diagnostics, partPath, buAutoNum.xpath, "startAt", rawStartAt);
|
|
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 }
|
|
301
189
|
}
|
|
302
|
-
list = {
|
|
303
|
-
type: "number",
|
|
304
|
-
style: "arabicPeriod",
|
|
305
|
-
...startAt === void 0 ? {} : { startAt },
|
|
306
|
-
...levelIndex0 > 0 ? { level: levelIndex0 } : {}
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
const defRPr = pPr.child(A_NS, "defRPr");
|
|
310
|
-
return {
|
|
311
|
-
...defRPr === void 0 ? {} : readDefRPr(defRPr, clrMap, partPath, diagnostics),
|
|
312
|
-
...list === void 0 ? {} : { list },
|
|
313
|
-
...marginLeft === void 0 ? {} : { marginLeft },
|
|
314
|
-
...indent === void 0 ? {} : { indent },
|
|
315
|
-
...spacingBefore === void 0 ? {} : { spacingBefore },
|
|
316
|
-
...align === void 0 ? {} : { align },
|
|
317
|
-
...lineHeight === void 0 ? {} : { lineHeight },
|
|
318
|
-
...spacingAfter === void 0 ? {} : { spacingAfter }
|
|
319
190
|
};
|
|
320
191
|
}
|
|
321
192
|
function sanitizeObjectBySchema(candidate, fullSchema, singleFieldValidate) {
|
|
@@ -329,47 +200,52 @@ function sanitizeObjectBySchema(candidate, fullSchema, singleFieldValidate) {
|
|
|
329
200
|
const reparsed = fullSchema.safeParse(cleaned);
|
|
330
201
|
return reparsed.success ? reparsed.data : void 0;
|
|
331
202
|
}
|
|
332
|
-
function readPlaceholderListStyles(container, clrMap, partPath, diagnostics) {
|
|
333
|
-
|
|
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 };
|
|
334
206
|
const levels = {};
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
count += 1;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
return count === 0 ? void 0 : 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)
|
|
213
|
+
};
|
|
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)
|
|
218
|
+
};
|
|
219
|
+
});
|
|
220
|
+
return {
|
|
221
|
+
...Object.keys(levels).length === 0 ? {} : { styles: levels },
|
|
222
|
+
nativeLevels
|
|
223
|
+
};
|
|
356
224
|
}
|
|
357
225
|
function readMasterTextStyles(txStyles, clrMap, partPath, diagnostics) {
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
const
|
|
361
|
-
const
|
|
362
|
-
const titleStyle =
|
|
363
|
-
const bodyStyle =
|
|
364
|
-
const otherStyle =
|
|
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)];
|
|
365
239
|
const candidate = {
|
|
366
240
|
...titleStyle === void 0 ? {} : { titleStyle },
|
|
367
241
|
...bodyStyle === void 0 ? {} : { bodyStyle },
|
|
368
242
|
...otherStyle === void 0 ? {} : { otherStyle }
|
|
369
243
|
};
|
|
370
|
-
if (Object.keys(candidate).length === 0) return void 0;
|
|
371
244
|
const parsed = masterTextStylesSchema.safeParse(candidate);
|
|
372
|
-
return
|
|
245
|
+
return {
|
|
246
|
+
nativeLevels,
|
|
247
|
+
...parsed.success && Object.keys(candidate).length > 0 ? { styles: parsed.data } : {}
|
|
248
|
+
};
|
|
373
249
|
}
|
|
374
250
|
function directPlaceholderChild(el) {
|
|
375
251
|
for (let child = el.firstChild; child !== null; child = child.nextSibling) {
|
|
@@ -387,12 +263,19 @@ function directPlaceholderChild(el) {
|
|
|
387
263
|
}
|
|
388
264
|
return false;
|
|
389
265
|
}
|
|
390
|
-
function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnostics, readPlaceholderVisuals) {
|
|
266
|
+
function readPlaceholderSpList(spTree, clrMap, isMaster, readsFooterPlaceholders, pkg, partPath, diagnostics, inheritedTextLevels, readPlaceholderVisuals) {
|
|
391
267
|
const placeholderKeyBySpid = /* @__PURE__ */ new Map();
|
|
392
|
-
if (spTree === void 0) return {
|
|
268
|
+
if (spTree === void 0) return {
|
|
269
|
+
placeholderKeyBySpid,
|
|
270
|
+
nativeLevels: inheritedTextLevels
|
|
271
|
+
};
|
|
393
272
|
const rawSpecs = [];
|
|
273
|
+
let footerPlaceholders;
|
|
274
|
+
const textLevelsBySpec = /* @__PURE__ */ new Map();
|
|
394
275
|
const rawSpids = [];
|
|
395
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);
|
|
396
279
|
const nvSpPr = sp.child(P_NS, "nvSpPr");
|
|
397
280
|
const cNvPr = nvSpPr?.child(P_NS, "cNvPr");
|
|
398
281
|
const rawId = cNvPr?.attr("id");
|
|
@@ -408,8 +291,7 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
408
291
|
const ph = (nvSpPr?.child(P_NS, "nvPr"))?.child(P_NS, "ph");
|
|
409
292
|
if (ph === void 0) continue;
|
|
410
293
|
const rawType = ph.attr("type");
|
|
411
|
-
const
|
|
412
|
-
const typeRes = placeholderRoleSchema.safeParse(rawType ?? "obj");
|
|
294
|
+
const typeRes = ooxmlPlaceholderRoleSchema.safeParse(rawType);
|
|
413
295
|
const phType = typeRes.success ? typeRes.data : "obj";
|
|
414
296
|
const idxParsed = ooxmlNonNegativeIntSchema.safeParse(ph.attr("idx"));
|
|
415
297
|
const idx = idxParsed.success ? idxParsed.data : void 0;
|
|
@@ -435,8 +317,14 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
435
317
|
geometry = importedSpPr.geometry;
|
|
436
318
|
if (importedSpPr.style !== void 0) Object.assign(styleProps, importedSpPr.style);
|
|
437
319
|
}
|
|
320
|
+
let textLevels = inheritedTextLevels({
|
|
321
|
+
type: phType,
|
|
322
|
+
...idx === void 0 ? {} : { idx }
|
|
323
|
+
});
|
|
438
324
|
let listStyles;
|
|
439
325
|
let promptText;
|
|
326
|
+
let dateTimeFormat;
|
|
327
|
+
let dateFieldStyle;
|
|
440
328
|
const txBody = sp.child(P_NS, "txBody");
|
|
441
329
|
if (txBody !== void 0) {
|
|
442
330
|
const bodyPr = txBody.child(A_NS, "bodyPr");
|
|
@@ -480,62 +368,112 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
480
368
|
normAutofit?.consumeAttr("fontScale");
|
|
481
369
|
normAutofit?.consumeAttr("lnSpcReduction");
|
|
482
370
|
}
|
|
483
|
-
|
|
371
|
+
const list = readPlaceholderListStyles(txBody.child(A_NS, "lstStyle"), clrMap, partPath, diagnostics, textLevels);
|
|
372
|
+
listStyles = list.styles;
|
|
373
|
+
textLevels = list.nativeLevels;
|
|
484
374
|
const promptParagraphs = [];
|
|
485
375
|
let promptLvl1Fallback;
|
|
486
376
|
for (const p of txBody.children(A_NS, "p")) {
|
|
487
377
|
const pPr = p.child(A_NS, "pPr");
|
|
488
|
-
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);
|
|
489
380
|
const runTexts = [];
|
|
490
381
|
for (const r of p.children(A_NS, "r")) {
|
|
491
382
|
const rPr = r.child(A_NS, "rPr");
|
|
492
383
|
const rStyle = rPr === void 0 ? void 0 : readDefRPr(rPr, clrMap, partPath, diagnostics);
|
|
493
|
-
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || rStyle !== void 0)) promptLvl1Fallback =
|
|
494
|
-
...pStyle,
|
|
495
|
-
...rStyle
|
|
496
|
-
};
|
|
384
|
+
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || rStyle !== void 0)) promptLvl1Fallback = cascadeDrawingParagraphProperties(pStyle, rStyle, 0);
|
|
497
385
|
const t = r.child(A_NS, "t");
|
|
498
386
|
if (t !== void 0) {
|
|
499
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);
|
|
500
392
|
runTexts.push(t.textContent);
|
|
501
393
|
}
|
|
502
394
|
}
|
|
503
|
-
const fld
|
|
504
|
-
if (fld !== void 0) {
|
|
395
|
+
for (const fld of p.children(A_NS, "fld")) {
|
|
505
396
|
fld.consumeAttr("id");
|
|
506
|
-
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
|
+
});
|
|
507
412
|
const rPr = fld.child(A_NS, "rPr");
|
|
508
413
|
const rStyle = rPr === void 0 ? void 0 : readDefRPr(rPr, clrMap, partPath, diagnostics);
|
|
509
|
-
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || rStyle !== void 0)) promptLvl1Fallback =
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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
|
+
}
|
|
513
427
|
fld.ignoreEmptyChild(A_NS, "pPr");
|
|
514
428
|
const t = fld.child(A_NS, "t");
|
|
515
429
|
if (t !== void 0) {
|
|
516
430
|
t.consumeAttr("space", XML_NS);
|
|
517
|
-
runTexts.push(t.textContent);
|
|
431
|
+
if (fieldType === "slidenum") runTexts.push(t.textContent);
|
|
518
432
|
}
|
|
519
433
|
}
|
|
520
434
|
const endPara = p.child(A_NS, "endParaRPr");
|
|
521
435
|
if (endPara !== void 0) {
|
|
522
436
|
const endStyle = readDefRPr(endPara, clrMap, partPath, diagnostics);
|
|
523
|
-
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || Object.keys(endStyle).length > 0)) promptLvl1Fallback =
|
|
524
|
-
...pStyle,
|
|
525
|
-
...endStyle
|
|
526
|
-
};
|
|
437
|
+
if (promptLvl1Fallback === void 0 && (pStyle !== void 0 || Object.keys(endStyle.style).length > 0 || endStyle.decoration !== void 0)) promptLvl1Fallback = cascadeDrawingParagraphProperties(pStyle, endStyle, 0);
|
|
527
438
|
}
|
|
528
439
|
if (runTexts.length > 0) promptParagraphs.push(runTexts.join(""));
|
|
529
440
|
}
|
|
530
441
|
if (promptParagraphs.length > 0) promptText = promptParagraphs.join("\n");
|
|
531
|
-
|
|
532
|
-
|
|
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
|
+
}
|
|
533
455
|
}
|
|
534
456
|
const rawStyle = Object.keys(styleProps).length === 0 ? void 0 : sanitizeObjectBySchema(styleProps, placeholderStyleSchema, (key, value) => placeholderStyleSchema.safeParse({ [key]: value }).success);
|
|
535
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
|
+
}
|
|
474
|
+
}
|
|
536
475
|
const candidate = {
|
|
537
476
|
type: phType,
|
|
538
|
-
...explicitType ? {} : { explicitType: false },
|
|
539
477
|
...idx === void 0 ? {} : { idx },
|
|
540
478
|
...sizeParsed.success ? { size: sizeParsed.data } : {},
|
|
541
479
|
...orientParsed.success ? { orient: orientParsed.data } : {},
|
|
@@ -549,6 +487,7 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
549
487
|
const schema = isMaster ? masterPlaceholderSpecSchema : layoutPlaceholderSpecSchema;
|
|
550
488
|
const validated = schema.safeParse(candidate);
|
|
551
489
|
if (validated.success) {
|
|
490
|
+
textLevelsBySpec.set(validated.data, textLevels);
|
|
552
491
|
rawSpecs.push(validated.data);
|
|
553
492
|
rawSpids.push(spid);
|
|
554
493
|
continue;
|
|
@@ -570,11 +509,17 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
570
509
|
[key]: value
|
|
571
510
|
}).success);
|
|
572
511
|
if (sanitizedSpec !== void 0) {
|
|
512
|
+
textLevelsBySpec.set(sanitizedSpec, textLevels);
|
|
573
513
|
rawSpecs.push(sanitizedSpec);
|
|
574
514
|
rawSpids.push(spid);
|
|
575
515
|
}
|
|
576
516
|
}
|
|
577
|
-
|
|
517
|
+
const footerSlots = footerPlaceholders === void 0 ? {} : { footerPlaceholders };
|
|
518
|
+
if (rawSpecs.length === 0) return {
|
|
519
|
+
placeholderKeyBySpid,
|
|
520
|
+
nativeLevels: inheritedTextLevels,
|
|
521
|
+
...footerSlots
|
|
522
|
+
};
|
|
578
523
|
const keys = allocatePlaceholderAuthorKeys(rawSpecs);
|
|
579
524
|
const map = {};
|
|
580
525
|
for (let i = 0; i < rawSpecs.length; i += 1) {
|
|
@@ -584,65 +529,17 @@ function readPlaceholderSpList(spTree, clrMap, isMaster, pkg, partPath, diagnost
|
|
|
584
529
|
if (spid !== void 0) placeholderKeyBySpid.set(spid, key);
|
|
585
530
|
}
|
|
586
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
|
+
},
|
|
587
537
|
placeholders: Object.freeze(map),
|
|
588
|
-
placeholderKeyBySpid
|
|
538
|
+
placeholderKeyBySpid,
|
|
539
|
+
...footerSlots
|
|
589
540
|
};
|
|
590
541
|
}
|
|
591
542
|
/** Allocates a deterministic unique author id within `used`, disambiguating collisions with `-2`, `-3`, ... */
|
|
592
|
-
function allocateScopedAuthorId(requested, used, fallbackBase) {
|
|
593
|
-
const base = requested !== void 0 && requested.trim().length > 0 ? requested.trim() : fallbackBase;
|
|
594
|
-
if (!used.has(base)) {
|
|
595
|
-
used.add(base);
|
|
596
|
-
return base;
|
|
597
|
-
}
|
|
598
|
-
let suffix = 2;
|
|
599
|
-
while (used.has(`${base}-${suffix}`)) suffix += 1;
|
|
600
|
-
const unique = `${base}-${suffix}`;
|
|
601
|
-
used.add(unique);
|
|
602
|
-
return unique;
|
|
603
|
-
}
|
|
604
|
-
/** Consumes standard identity `<p:nvGrpSpPr>` and `<p:grpSpPr>` transform boilerplate on an `spTree`. */
|
|
605
|
-
function consumeIdentityShapeTreeBoilerplate(spTree) {
|
|
606
|
-
const nvGrpSpPr = spTree.child(P_NS, "nvGrpSpPr");
|
|
607
|
-
if (nvGrpSpPr !== void 0) {
|
|
608
|
-
const cNvPr = nvGrpSpPr.child(P_NS, "cNvPr");
|
|
609
|
-
if (cNvPr !== void 0) {
|
|
610
|
-
cNvPr.consumeAttr("id");
|
|
611
|
-
cNvPr.consumeAttr("name");
|
|
612
|
-
}
|
|
613
|
-
nvGrpSpPr.ignoreEmptyChild(P_NS, "cNvGrpSpPr");
|
|
614
|
-
nvGrpSpPr.ignoreEmptyChild(P_NS, "nvPr");
|
|
615
|
-
}
|
|
616
|
-
const grpSpPr = spTree.child(P_NS, "grpSpPr");
|
|
617
|
-
if (grpSpPr !== void 0) {
|
|
618
|
-
const xfrm = grpSpPr.child(A_NS, "xfrm");
|
|
619
|
-
if (xfrm !== void 0) {
|
|
620
|
-
const off = xfrm.child(A_NS, "off");
|
|
621
|
-
if (off !== void 0 && off.attr("x") === "0" && off.attr("y") === "0") {}
|
|
622
|
-
const ext = xfrm.child(A_NS, "ext");
|
|
623
|
-
if (ext !== void 0 && ext.attr("cx") === "0" && ext.attr("cy") === "0") {}
|
|
624
|
-
const chOff = xfrm.child(A_NS, "chOff");
|
|
625
|
-
if (chOff !== void 0 && chOff.attr("x") === "0" && chOff.attr("y") === "0") {}
|
|
626
|
-
const chExt = xfrm.child(A_NS, "chExt");
|
|
627
|
-
if (chExt !== void 0 && chExt.attr("cx") === "0" && chExt.attr("cy") === "0") {}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
/** Records `unconsumed-xml` diagnostics for all unconsumed attributes/elements under a root cursor. */
|
|
632
|
-
function appendUnconsumedDiagnostics(cursor, slideIndex, diagnostics) {
|
|
633
|
-
for (const item of cursor.collectUnconsumed()) diagnostics.push({
|
|
634
|
-
code: "unconsumed-xml",
|
|
635
|
-
category: "unsupported",
|
|
636
|
-
disposition: "omitted",
|
|
637
|
-
kind: item.kind,
|
|
638
|
-
location: {
|
|
639
|
-
...item.location,
|
|
640
|
-
...slideIndex === void 0 ? {} : { slideIndex }
|
|
641
|
-
},
|
|
642
|
-
namespaceUri: item.namespaceUri,
|
|
643
|
-
localName: item.localName
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
543
|
function validateMasterLayoutNumericId(rawId, part, xpath, diagnostics) {
|
|
647
544
|
if (rawId === void 0) return;
|
|
648
545
|
const parsed = ooxmlNonNegativeIntSchema.safeParse(rawId);
|
|
@@ -685,9 +582,47 @@ const supportedShapeTreeNamespaces = /* @__PURE__ */ new Set([
|
|
|
685
582
|
A_NS,
|
|
686
583
|
R_NS
|
|
687
584
|
]);
|
|
688
|
-
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);
|
|
689
622
|
const identity = peekShapeTreeObjectIdentity(itemCursor.element);
|
|
690
|
-
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);
|
|
691
626
|
if (match === void 0) {
|
|
692
627
|
if (omittedSpids !== void 0 && identity.objectId !== void 0) omittedSpids.set(identity.objectId, {
|
|
693
628
|
...identity.objectName === void 0 ? {} : { objectName: identity.objectName },
|
|
@@ -706,7 +641,7 @@ function readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex
|
|
|
706
641
|
},
|
|
707
642
|
namespaceUri: itemCursor.namespaceUri,
|
|
708
643
|
localName: itemCursor.localName,
|
|
709
|
-
...frameInfo?.mechanismHint === void 0 ? {} : { mechanismHint: frameInfo.mechanismHint },
|
|
644
|
+
...mediaKind !== void 0 ? { mechanismHint: mediaKind } : frameInfo?.mechanismHint === void 0 ? {} : { mechanismHint: frameInfo.mechanismHint },
|
|
710
645
|
...frameInfo === void 0 || frameInfo.cascaded.length === 0 ? {} : { cascaded: frameInfo.cascaded }
|
|
711
646
|
});
|
|
712
647
|
itemCursor.suppressUnconsumed();
|
|
@@ -714,10 +649,22 @@ function readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex
|
|
|
714
649
|
}
|
|
715
650
|
const outcome = match.read({
|
|
716
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
|
+
},
|
|
717
662
|
part: partPath,
|
|
718
663
|
slideIndex: slideIndex ?? 0,
|
|
719
664
|
package: pkg,
|
|
720
665
|
...containerNode === void 0 ? {} : { containerNode },
|
|
666
|
+
...mediaTiming === void 0 ? {} : { mediaTiming },
|
|
667
|
+
...placeholderTextLevels === void 0 ? {} : { placeholderTextLevels },
|
|
721
668
|
relationships: relIndex.byId,
|
|
722
669
|
relationshipEntries: relIndex.entries,
|
|
723
670
|
registerDeferredSlideLink,
|
|
@@ -749,7 +696,7 @@ function readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex
|
|
|
749
696
|
}
|
|
750
697
|
/** Shared `<p:spTree>` child reader for slides, slide layouts, and slide masters. */
|
|
751
698
|
function readShapeTreeItems(args) {
|
|
752
|
-
const { spTree, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, appendNode, diagnostics, containerNode, layoutPlaceholders, masterPlaceholders, masterTextStyles, slideDimensions, claimedPlaceholderKeys, 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;
|
|
753
700
|
consumeIdentityShapeTreeBoilerplate(spTree);
|
|
754
701
|
const scopeObjectsBySpid = /* @__PURE__ */ new Map();
|
|
755
702
|
const usedAuthorIds = /* @__PURE__ */ new Set();
|
|
@@ -761,14 +708,14 @@ function readShapeTreeItems(args) {
|
|
|
761
708
|
if (itemCursor.namespaceUri === MC_NS_IMPORT_PLACEHOLDER && itemCursor.localName === "AlternateContent") {
|
|
762
709
|
const selection = readAlternateContent(itemCursor, (ns) => supportedShapeTreeNamespaces.has(ns));
|
|
763
710
|
if (selection.branch === "choice") for (const childCursor of selection.children) {
|
|
764
|
-
const node = readSingleShapeTreeItem(childCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders, registerDeferredConnector, scopeObjectsBySpid, usedAuthorIds, masterTextStyles, slideDimensions, claimedPlaceholderKeys);
|
|
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);
|
|
765
712
|
if (node !== void 0) appendNode(node);
|
|
766
713
|
}
|
|
767
714
|
else if (selection.branch === "fallback") {
|
|
768
715
|
let adoptedFallback = false;
|
|
769
716
|
for (const childCursor of selection.children) {
|
|
770
717
|
const identity = peekShapeTreeObjectIdentity(childCursor.element);
|
|
771
|
-
const node = readSingleShapeTreeItem(childCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders, registerDeferredConnector, scopeObjectsBySpid, usedAuthorIds, masterTextStyles, slideDimensions, claimedPlaceholderKeys);
|
|
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);
|
|
772
719
|
if (node !== void 0) {
|
|
773
720
|
adoptedFallback = true;
|
|
774
721
|
appendNode(node);
|
|
@@ -810,7 +757,7 @@ function readShapeTreeItems(args) {
|
|
|
810
757
|
}
|
|
811
758
|
continue;
|
|
812
759
|
}
|
|
813
|
-
const node = readSingleShapeTreeItem(itemCursor, pkg, partPath, slideIndex, relIndex, shapeTreeHandlers, registerDeferredSlideLink, diagnostics, containerNode, layoutPlaceholders, clrMap, registerImportedObject, omittedSpids, masterPlaceholders, registerDeferredConnector, scopeObjectsBySpid, usedAuthorIds, masterTextStyles, slideDimensions, claimedPlaceholderKeys);
|
|
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);
|
|
814
761
|
if (node !== void 0) appendNode(node);
|
|
815
762
|
}
|
|
816
763
|
if (deferredConnectors.length > 0) {
|
|
@@ -824,7 +771,7 @@ function readShapeTreeItems(args) {
|
|
|
824
771
|
}
|
|
825
772
|
}
|
|
826
773
|
const MC_NS_IMPORT_PLACEHOLDER = "http://schemas.openxmlformats.org/markup-compatibility/2006";
|
|
827
|
-
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) {
|
|
828
775
|
const xmlText = pkg.readTextPart(layoutPartPath);
|
|
829
776
|
if (xmlText === void 0) return void 0;
|
|
830
777
|
let layoutEl;
|
|
@@ -916,12 +863,16 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
916
863
|
consumeCommonSlideCreationId(cSld);
|
|
917
864
|
const spTree = cSld.child(P_NS, "spTree");
|
|
918
865
|
let placeholders;
|
|
866
|
+
let footerPlaceholders;
|
|
919
867
|
let layoutPlaceholderKeyBySpid;
|
|
868
|
+
let layoutTextLevels = masterTextLevels;
|
|
920
869
|
if (spTree !== void 0) {
|
|
921
870
|
consumeIdentityShapeTreeBoilerplate(spTree);
|
|
922
|
-
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;
|
|
923
873
|
placeholders = placeholderRead.placeholders;
|
|
924
874
|
layoutPlaceholderKeyBySpid = placeholderRead.placeholderKeyBySpid;
|
|
875
|
+
footerPlaceholders = placeholderRead.footerPlaceholders;
|
|
925
876
|
}
|
|
926
877
|
const clrMapOvr = layoutCursor.child(P_NS, "clrMapOvr");
|
|
927
878
|
let colorMapOverride;
|
|
@@ -945,23 +896,7 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
945
896
|
relationshipId: backMasterRel.Id
|
|
946
897
|
});
|
|
947
898
|
}
|
|
948
|
-
|
|
949
|
-
const themeOverrideRel = layoutRels.entries.find((entry) => entry.Type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/themeOverride" && entry.TargetMode !== "External");
|
|
950
|
-
if (themeOverrideRel !== void 0) {
|
|
951
|
-
const overridePart = resolvePartPath(layoutPartPath, themeOverrideRel.Target);
|
|
952
|
-
if (overridePart === void 0 || !pkg.hasPart(overridePart)) diagnostics.push({
|
|
953
|
-
code: "missing-target-part",
|
|
954
|
-
category: "corrupt-input",
|
|
955
|
-
disposition: "omitted",
|
|
956
|
-
location: {
|
|
957
|
-
part: layoutPartPath,
|
|
958
|
-
xpath: themeOverrideRel.xpath
|
|
959
|
-
},
|
|
960
|
-
relationshipId: themeOverrideRel.Id,
|
|
961
|
-
targetPart: overridePart ?? themeOverrideRel.Target
|
|
962
|
-
});
|
|
963
|
-
else themeOverride = readThemeOverridePart(pkg, overridePart, void 0, diagnostics);
|
|
964
|
-
}
|
|
899
|
+
const themeOverride = readPartThemeOverride(pkg, layoutRels.entries, { part: layoutPartPath }, diagnostics);
|
|
965
900
|
const props = {
|
|
966
901
|
id: allocateScopedAuthorId(layoutName, usedLayoutIds, `layout-${layoutOrder}`),
|
|
967
902
|
...layoutName === void 0 ? {} : { name: layoutName },
|
|
@@ -974,6 +909,7 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
974
909
|
...placeholders === void 0 ? {} : { placeholders },
|
|
975
910
|
...colorMapOverride === void 0 ? {} : { colorMapOverride },
|
|
976
911
|
...themeOverride === void 0 ? {} : { themeOverride },
|
|
912
|
+
...footerPlaceholders === void 0 ? {} : { footerPlaceholders },
|
|
977
913
|
...layoutHeaderFooter === void 0 ? {} : { headerFooter: layoutHeaderFooter }
|
|
978
914
|
};
|
|
979
915
|
const layoutNode = createSlideLayoutNode(props);
|
|
@@ -1015,9 +951,10 @@ function readSlideLayoutPart(pkg, layoutPartPath, ownerMasterPartPath, layoutOrd
|
|
|
1015
951
|
diagnostics.push(...stripSlideIndexFromDiagnostics(outcome.diagnostics));
|
|
1016
952
|
}
|
|
1017
953
|
appendUnconsumedDiagnostics(layoutCursor, void 0, diagnostics);
|
|
954
|
+
textLevelsByLayout.set(layoutPartPath, layoutTextLevels);
|
|
1018
955
|
return layoutNode;
|
|
1019
956
|
}
|
|
1020
|
-
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) {
|
|
1021
958
|
const xmlText = pkg.readTextPart(masterPartPath);
|
|
1022
959
|
if (xmlText === void 0) return void 0;
|
|
1023
960
|
let masterEl;
|
|
@@ -1081,21 +1018,19 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
1081
1018
|
if (isNonDefaultColorMap(parsedMap)) colorMap = parsedMap;
|
|
1082
1019
|
}
|
|
1083
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;
|
|
1084
1024
|
let masterPlaceholders;
|
|
1025
|
+
let footerPlaceholders;
|
|
1085
1026
|
let masterPlaceholderKeyBySpid;
|
|
1086
1027
|
if (spTree !== void 0) {
|
|
1087
1028
|
consumeIdentityShapeTreeBoilerplate(spTree);
|
|
1088
|
-
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;
|
|
1089
1031
|
masterPlaceholders = placeholderRead.placeholders;
|
|
1090
1032
|
masterPlaceholderKeyBySpid = placeholderRead.placeholderKeyBySpid;
|
|
1091
|
-
|
|
1092
|
-
const txStylesCursor = masterCursor.child(P_NS, "txStyles");
|
|
1093
|
-
let textStyles;
|
|
1094
|
-
if (txStylesCursor !== void 0) {
|
|
1095
|
-
txStylesCursor.ignoreEmptyChild(P_NS, "titleStyle");
|
|
1096
|
-
txStylesCursor.ignoreEmptyChild(P_NS, "bodyStyle");
|
|
1097
|
-
txStylesCursor.ignoreEmptyChild(P_NS, "otherStyle");
|
|
1098
|
-
textStyles = readMasterTextStyles(txStylesCursor, masterClrMap, masterPartPath, diagnostics);
|
|
1033
|
+
footerPlaceholders = placeholderRead.footerPlaceholders;
|
|
1099
1034
|
}
|
|
1100
1035
|
const masterHeaderFooter = readHeaderFooterElement(masterCursor, masterPartPath, diagnostics);
|
|
1101
1036
|
const masterRels = pkg.readRelationships(masterPartPath);
|
|
@@ -1127,6 +1062,7 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
1127
1062
|
...textStyles === void 0 ? {} : { textStyles },
|
|
1128
1063
|
...masterTheme === void 0 ? {} : { theme: masterTheme },
|
|
1129
1064
|
...colorMap === void 0 ? {} : { colorMap },
|
|
1065
|
+
...footerPlaceholders === void 0 ? {} : { footerPlaceholders },
|
|
1130
1066
|
...masterHeaderFooter === void 0 ? {} : { headerFooter: masterHeaderFooter }
|
|
1131
1067
|
};
|
|
1132
1068
|
const masterNode = createSlideMasterNode(masterProps);
|
|
@@ -1217,7 +1153,7 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
1217
1153
|
});
|
|
1218
1154
|
continue;
|
|
1219
1155
|
}
|
|
1220
|
-
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);
|
|
1221
1157
|
if (layoutNode !== void 0) {
|
|
1222
1158
|
masterNode.append(layoutNode);
|
|
1223
1159
|
layoutNodeByPartPath.set(layoutPart, layoutNode);
|
|
@@ -1232,7 +1168,7 @@ function readSlideMasterPart(pkg, masterPartPath, masterOrder, usedDeckIds, them
|
|
|
1232
1168
|
* Traverses `<p:sldMasterIdLst>` and `<p:sldLayoutIdLst>` relationships to reconstruct explicit
|
|
1233
1169
|
* `SlideMaster` and `SlideLayout` ownership (including idle layouts) onto `deckNode`.
|
|
1234
1170
|
*/
|
|
1235
|
-
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()) {
|
|
1236
1172
|
const masterLevelSlideHandlers = slideHandlers.filter((handler) => handler.slot === "background" || handler.slot === "header-footer" || handler.slot === "transition" || handler.slot === "timing");
|
|
1237
1173
|
const layoutNodeByPartPath = /* @__PURE__ */ new Map();
|
|
1238
1174
|
const themesByPartPath = /* @__PURE__ */ new Map();
|
|
@@ -1285,7 +1221,7 @@ function importMastersAndLayouts(presCursor, pkg, presRelById, deckNode, usedDec
|
|
|
1285
1221
|
});
|
|
1286
1222
|
continue;
|
|
1287
1223
|
}
|
|
1288
|
-
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);
|
|
1289
1225
|
if (masterNode !== void 0) deckNode.append(masterNode);
|
|
1290
1226
|
}
|
|
1291
1227
|
return layoutNodeByPartPath;
|