@officedk/pptxdk 0.2.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 +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 +2 -5
- 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
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { mediaPictureKind } from "../kernel/pptx-read/media.js";
|
|
2
|
+
import { P_NS } from "../kernel/pptx-read/namespaces.js";
|
|
3
|
+
import { peekShapeTreeObjectIdentity } from "../kernel/pptx-read/resources.js";
|
|
4
|
+
import { ooxmlNonNegativeIntSchema } from "../kernel/pptx-read/xml-fragments.js";
|
|
5
|
+
// ../core/dist/import/media-timing.js
|
|
6
|
+
function descendants(element, name) {
|
|
7
|
+
return Array.from(element.getElementsByTagNameNS(P_NS, name));
|
|
8
|
+
}
|
|
9
|
+
function targetIds(element) {
|
|
10
|
+
return [...new Set(descendants(element, "spTgt").map((target) => Number(target.getAttribute("spid"))))];
|
|
11
|
+
}
|
|
12
|
+
function isMediaNode(element) {
|
|
13
|
+
return element.namespaceURI === "http://schemas.openxmlformats.org/presentationml/2006/main" && (element.localName === "video" || element.localName === "audio");
|
|
14
|
+
}
|
|
15
|
+
function readBool(raw) {
|
|
16
|
+
if (raw === "1" || raw === "true") return true;
|
|
17
|
+
if (raw === "0" || raw === "false") return false;
|
|
18
|
+
}
|
|
19
|
+
const graphicBehaviors = /* @__PURE__ */ new Set([
|
|
20
|
+
"anim",
|
|
21
|
+
"animClr",
|
|
22
|
+
"animEffect",
|
|
23
|
+
"animMotion",
|
|
24
|
+
"animRot",
|
|
25
|
+
"animScale",
|
|
26
|
+
"set"
|
|
27
|
+
]);
|
|
28
|
+
function pChildren(element, name) {
|
|
29
|
+
return element === void 0 ? [] : descendants(element, name).filter((child) => child.parentNode === element);
|
|
30
|
+
}
|
|
31
|
+
function startsWithMainSequence(step, mainSequenceId) {
|
|
32
|
+
const start = pChildren(step, "stCondLst")[0];
|
|
33
|
+
const conditions = pChildren(start, "cond");
|
|
34
|
+
const entry = conditions.find((condition) => condition.getAttribute("evt") === "onBegin" && Number(condition.getAttribute("delay")) === 0 && pChildren(condition, "tn")[0]?.getAttribute("val") === mainSequenceId);
|
|
35
|
+
return entry !== void 0 && conditions.every((condition) => condition === entry || !condition.getAttribute("evt") && condition.getAttribute("delay") === "indefinite" && condition.childNodes.length === 0);
|
|
36
|
+
}
|
|
37
|
+
function readStartupCommands(step, mediaSpids) {
|
|
38
|
+
const nodes = descendants(pChildren(step, "childTnLst")[0] ?? step, "*");
|
|
39
|
+
const effects = nodes.filter((node) => node.localName === "cTn" && node.hasAttribute("presetID"));
|
|
40
|
+
if (effects.length === 0 || nodes.some((node) => graphicBehaviors.has(node.localName ?? "") || node.localName === "cond" && (node.getAttribute("evt") || pChildren(node, "tn").length > 0))) return void 0;
|
|
41
|
+
const startup = /* @__PURE__ */ new Map();
|
|
42
|
+
const playTargets = /* @__PURE__ */ new Set();
|
|
43
|
+
const stopTargets = /* @__PURE__ */ new Set();
|
|
44
|
+
const stopConditions = /* @__PURE__ */ new Set();
|
|
45
|
+
for (const effect of effects) {
|
|
46
|
+
const [command, ...more] = pChildren(pChildren(effect, "childTnLst")[0], "cmd");
|
|
47
|
+
if (effect.getAttribute("nodeType") !== "withEffect" || effect.getAttribute("presetClass") !== "mediacall" || command === void 0 || more.length > 0 || command.getAttribute("type") !== "call") return void 0;
|
|
48
|
+
const [spid, ...others] = targetIds(command);
|
|
49
|
+
if (spid === void 0 || others.length > 0 || !mediaSpids.has(spid)) return void 0;
|
|
50
|
+
const call = command.getAttribute("cmd") ?? "";
|
|
51
|
+
if (/^(?:play|playFrom\(0(?:\.0+)?\))$/u.test(call)) playTargets.add(spid);
|
|
52
|
+
else if (call === "stop" && effect.getAttribute("presetID") === "3") {
|
|
53
|
+
const [condition, ...others] = pChildren(pChildren(effect, "stCondLst")[0], "cond");
|
|
54
|
+
if (condition === void 0 || others.length > 0 || !(Number(condition.getAttribute("delay")) > 0) || condition.firstChild !== null) return void 0;
|
|
55
|
+
stopTargets.add(spid);
|
|
56
|
+
stopConditions.add(condition);
|
|
57
|
+
} else return;
|
|
58
|
+
startup.set(command, spid);
|
|
59
|
+
}
|
|
60
|
+
return startup.size === nodes.filter((node) => node.localName === "cmd").length && [...stopTargets].every((spid) => playTargets.has(spid)) && nodes.every((node) => node.localName !== "cond" || stopConditions.has(node) || Number(node.getAttribute("delay")) === 0) ? startup : void 0;
|
|
61
|
+
}
|
|
62
|
+
function readMediaTiming(slide, slideIndex, diagnostics, hasGraphicTimingReader) {
|
|
63
|
+
const mediaPictures = /* @__PURE__ */ new Map();
|
|
64
|
+
for (const picture of descendants(slide.element, "pic")) {
|
|
65
|
+
if (mediaPictureKind(picture) === void 0) continue;
|
|
66
|
+
const identity = peekShapeTreeObjectIdentity(picture);
|
|
67
|
+
if (identity.objectId !== void 0) mediaPictures.set(identity.objectId, identity);
|
|
68
|
+
}
|
|
69
|
+
const bySpid = /* @__PURE__ */ new Map();
|
|
70
|
+
const rootBranches = /* @__PURE__ */ new Set();
|
|
71
|
+
const result = {
|
|
72
|
+
bySpid,
|
|
73
|
+
mediaSpids: new Set(mediaPictures.keys()),
|
|
74
|
+
rootBranches
|
|
75
|
+
};
|
|
76
|
+
const timingElement = descendants(slide.element, "timing").find((element) => element.parentNode === slide.element);
|
|
77
|
+
if (timingElement === void 0) return result;
|
|
78
|
+
const nativeMedia = descendants(timingElement, "*").filter(isMediaNode);
|
|
79
|
+
if (mediaPictures.size === 0 && nativeMedia.length === 0) return result;
|
|
80
|
+
const timing = slide.child(P_NS, "timing");
|
|
81
|
+
const root = timing.child(P_NS, "tnLst")?.child(P_NS, "par")?.child(P_NS, "cTn");
|
|
82
|
+
const rootChildren = root?.child(P_NS, "childTnLst");
|
|
83
|
+
if (rootChildren === void 0) return result;
|
|
84
|
+
const report = (element, mechanismHint, spid) => {
|
|
85
|
+
const identity = spid === void 0 ? void 0 : mediaPictures.get(spid);
|
|
86
|
+
diagnostics.push({
|
|
87
|
+
code: "unsupported-mechanism",
|
|
88
|
+
category: "unsupported",
|
|
89
|
+
disposition: "omitted",
|
|
90
|
+
location: {
|
|
91
|
+
part: slide.part,
|
|
92
|
+
slideIndex,
|
|
93
|
+
xpath: `${timing.xpath}//p:${element.localName}`,
|
|
94
|
+
...spid === void 0 ? {} : { objectId: spid },
|
|
95
|
+
...identity?.objectName === void 0 ? {} : { objectName: identity.objectName }
|
|
96
|
+
},
|
|
97
|
+
namespaceUri: P_NS,
|
|
98
|
+
localName: element.localName ?? element.tagName,
|
|
99
|
+
mechanismHint
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const clickTargets = /* @__PURE__ */ new Set();
|
|
103
|
+
const directBranches = rootChildren.matchingChildren((element) => {
|
|
104
|
+
if (element.namespaceURI !== "http://schemas.openxmlformats.org/presentationml/2006/main") return false;
|
|
105
|
+
if (isMediaNode(element)) return true;
|
|
106
|
+
const timeNode = descendants(element, "cTn")[0];
|
|
107
|
+
const nodeType = timeNode?.getAttribute("nodeType");
|
|
108
|
+
const branches = descendants(element, "*");
|
|
109
|
+
if (nodeType === "mainSeq" || branches.some((node) => graphicBehaviors.has(node.localName ?? ""))) return false;
|
|
110
|
+
if (nodeType === "interactiveSeq") {
|
|
111
|
+
const ids = targetIds(element);
|
|
112
|
+
const spid = ids[0];
|
|
113
|
+
const clickedObject = descendants(timeNode, "cond").some((condition) => condition.getAttribute("evt") === "onClick" && targetIds(condition).includes(spid));
|
|
114
|
+
if (ids.length !== 1 || spid === void 0 || !mediaPictures.has(spid) || !clickedObject || !branches.some((branch) => isMediaNode(branch) || branch.localName === "cmd")) return false;
|
|
115
|
+
clickTargets.add(spid);
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
return branches.some(isMediaNode);
|
|
119
|
+
});
|
|
120
|
+
const acceptedMedia = /* @__PURE__ */ new Set();
|
|
121
|
+
for (const branch of directBranches) {
|
|
122
|
+
rootBranches.add(branch.element);
|
|
123
|
+
branch.suppressUnconsumed();
|
|
124
|
+
for (const media of isMediaNode(branch.element) ? [branch.element] : descendants(branch.element, "*").filter(isMediaNode)) acceptedMedia.add(media);
|
|
125
|
+
}
|
|
126
|
+
const automaticTargets = /* @__PURE__ */ new Set();
|
|
127
|
+
const startupCommands = /* @__PURE__ */ new Set();
|
|
128
|
+
let consumedMainSequence = false;
|
|
129
|
+
const mainSeqElement = pChildren(rootChildren.element, "seq").find((seq) => pChildren(seq, "cTn")[0]?.getAttribute("nodeType") === "mainSeq");
|
|
130
|
+
const mainTimeNode = pChildren(mainSeqElement, "cTn")[0];
|
|
131
|
+
const mainSequenceId = mainTimeNode?.getAttribute("id");
|
|
132
|
+
if (mainSeqElement !== void 0 && mainTimeNode !== void 0 && mainSequenceId) {
|
|
133
|
+
const stepList = pChildren(mainTimeNode, "childTnLst")[0];
|
|
134
|
+
const steps = pChildren(stepList, "par");
|
|
135
|
+
const mediaEntryGroups = /* @__PURE__ */ new Set();
|
|
136
|
+
for (const wrapper of steps) {
|
|
137
|
+
const step = pChildren(wrapper, "cTn")[0];
|
|
138
|
+
if (step === void 0 || !startsWithMainSequence(step, mainSequenceId)) break;
|
|
139
|
+
const commands = readStartupCommands(step, result.mediaSpids);
|
|
140
|
+
if (commands === void 0) continue;
|
|
141
|
+
mediaEntryGroups.add(wrapper);
|
|
142
|
+
for (const [command, spid] of commands) {
|
|
143
|
+
startupCommands.add(command);
|
|
144
|
+
automaticTargets.add(spid);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const emptyMediaSequence = !hasGraphicTimingReader && clickTargets.size > 0 && Array.from(mainTimeNode.childNodes).every((node) => node.nodeType !== 1) && Array.from(mainSeqElement.childNodes).every((node) => node.nodeType !== 1 || node === mainTimeNode || node.namespaceURI === "http://schemas.openxmlformats.org/presentationml/2006/main" && (node.localName === "prevCondLst" || node.localName === "nextCondLst"));
|
|
148
|
+
if (mediaEntryGroups.size > 0 || emptyMediaSequence) {
|
|
149
|
+
const [sequence] = rootChildren.matchingChildren((node) => node === mainSeqElement);
|
|
150
|
+
const mainNode = sequence?.child(P_NS, "cTn");
|
|
151
|
+
const stepListCursor = mainNode?.child(P_NS, "childTnLst");
|
|
152
|
+
for (const entry of stepListCursor?.matchingChildren((node) => mediaEntryGroups.has(node)) ?? []) {
|
|
153
|
+
rootBranches.add(entry.element);
|
|
154
|
+
entry.suppressUnconsumed();
|
|
155
|
+
}
|
|
156
|
+
consumedMainSequence = Array.from(stepList?.childNodes ?? []).filter((node) => node.nodeType === 1).length === mediaEntryGroups.size;
|
|
157
|
+
if (consumedMainSequence && sequence !== void 0) {
|
|
158
|
+
rootBranches.add(sequence.element);
|
|
159
|
+
sequence.suppressUnconsumed();
|
|
160
|
+
mainNode?.suppressUnconsumed();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
for (const media of nativeMedia) {
|
|
165
|
+
const mediaNode = descendants(media, "cMediaNode")[0];
|
|
166
|
+
const spid = targetIds(media)[0];
|
|
167
|
+
if (!acceptedMedia.has(media) || mediaNode === void 0 || spid === void 0 || !mediaPictures.has(spid)) {
|
|
168
|
+
report(media, acceptedMedia.has(media) ? "invalid-media-timing-target" : "unsupported-media-timing-placement", spid);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (bySpid.get(spid) !== void 0) {
|
|
172
|
+
report(media, "duplicate-media-timing", spid);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
const timeNode = descendants(mediaNode, "cTn")[0];
|
|
176
|
+
const rawDuration = timeNode?.getAttribute("dur");
|
|
177
|
+
const duration = rawDuration === void 0 || rawDuration === null || rawDuration === "" ? NaN : Number(rawDuration);
|
|
178
|
+
const rawVolume = mediaNode.getAttribute("vol");
|
|
179
|
+
let volume = .5;
|
|
180
|
+
if (rawVolume !== null) {
|
|
181
|
+
const integer = rawVolume.replace(/^[ \t\r\n]+|[ \t\r\n]+$/gu, "").replace(/^\+(?=\d)/u, "");
|
|
182
|
+
const parsed = ooxmlNonNegativeIntSchema.safeParse(integer);
|
|
183
|
+
if (parsed.success && parsed.data <= 1e5) volume = parsed.data / 1e5;
|
|
184
|
+
else diagnostics.push({
|
|
185
|
+
code: "invalid-xml-value",
|
|
186
|
+
category: "corrupt-input",
|
|
187
|
+
disposition: "recovered",
|
|
188
|
+
location: {
|
|
189
|
+
part: slide.part,
|
|
190
|
+
slideIndex,
|
|
191
|
+
...mediaPictures.get(spid),
|
|
192
|
+
xpath: `${timing.descendantXpath(mediaNode)}/@vol`
|
|
193
|
+
},
|
|
194
|
+
attributeOrElement: "p:cMediaNode/@vol",
|
|
195
|
+
rawValue: rawVolume
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
const muted = readBool(mediaNode.getAttribute("mute"));
|
|
199
|
+
const rawShowWhenStopped = mediaNode.getAttribute("showWhenStopped");
|
|
200
|
+
const showWhenStopped = rawShowWhenStopped === null || rawShowWhenStopped === "" ? true : readBool(rawShowWhenStopped);
|
|
201
|
+
const starts = timeNode === void 0 ? [] : descendants(timeNode, "stCondLst").flatMap((list) => descendants(list, "cond"));
|
|
202
|
+
bySpid.set(spid, {
|
|
203
|
+
kind: media.localName === "video" ? "video" : "audio",
|
|
204
|
+
autoPlay: automaticTargets.has(spid) || !clickTargets.has(spid) && (starts.length === 0 || starts.some((cond) => cond.getAttribute("delay") === "0")),
|
|
205
|
+
loop: timeNode?.getAttribute("repeatCount") === "indefinite",
|
|
206
|
+
...timeNode !== void 0 && Number.isFinite(duration) && duration > 0 ? { duration: {
|
|
207
|
+
milliseconds: duration,
|
|
208
|
+
xpath: `${timing.descendantXpath(timeNode)}/@dur`
|
|
209
|
+
} } : {},
|
|
210
|
+
volume,
|
|
211
|
+
...muted === void 0 ? {} : { muted },
|
|
212
|
+
...showWhenStopped === void 0 ? {} : { showWhenStopped }
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
const graphicTargetsHandledByMotion = /* @__PURE__ */ new Set();
|
|
216
|
+
for (const timeNode of descendants(timing.element, "cTn")) {
|
|
217
|
+
if (timeNode.getAttribute("nodeType") !== "mainSeq") continue;
|
|
218
|
+
if (hasGraphicTimingReader) for (const behavior of descendants(timeNode, "*")) graphicTargetsHandledByMotion.add(behavior);
|
|
219
|
+
for (const command of descendants(timeNode, "cmd")) {
|
|
220
|
+
if (startupCommands.has(command)) continue;
|
|
221
|
+
const spid = targetIds(command).find((id) => mediaPictures.has(id));
|
|
222
|
+
if (spid !== void 0) report(command, "media-in-main-sequence", spid);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
for (const behavior of descendants(timing.element, "*")) {
|
|
226
|
+
if (!graphicBehaviors.has(behavior.localName ?? "") || graphicTargetsHandledByMotion.has(behavior)) continue;
|
|
227
|
+
const spid = targetIds(behavior).find((id) => mediaPictures.has(id));
|
|
228
|
+
if (spid !== void 0) report(behavior, "graphic-motion-on-media", spid);
|
|
229
|
+
}
|
|
230
|
+
if (rootBranches.size > 0 && Array.from(rootChildren.element.childNodes).filter((node) => node.nodeType === 1).length === directBranches.length + Number(consumedMainSequence)) root?.suppressUnconsumed();
|
|
231
|
+
return result;
|
|
232
|
+
}
|
|
233
|
+
export { readMediaTiming };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { A_NS, P_NS, REL_HANDOUT_MASTER, REL_NOTES_MASTER, R_NS } from "
|
|
3
|
-
import { resolvePartPath } from "
|
|
4
|
-
import { peekShapeTreeObjectIdentity } from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import "./masters.js";
|
|
2
|
+
import { A_NS, P_NS, REL_HANDOUT_MASTER, REL_NOTES_MASTER, R_NS } from "../kernel/pptx-read/namespaces.js";
|
|
3
|
+
import { resolvePartPath } from "../kernel/pptx-read/opc.js";
|
|
4
|
+
import { peekShapeTreeObjectIdentity } from "../kernel/pptx-read/resources.js";
|
|
5
|
+
import { appendUnconsumedDiagnostics, consumeIdentityShapeTreeBoilerplate } from "../kernel/pptx-read/shape-tree.js";
|
|
6
|
+
import { ooxmlNonNegativeIntSchema } from "../kernel/pptx-read/xml-fragments.js";
|
|
7
|
+
import { XmlElementCursor, parseXmlPart } from "../kernel/pptx-read/xml-reader.js";
|
|
7
8
|
import { z } from "zod";
|
|
8
|
-
// ../
|
|
9
|
+
// ../core/dist/import/notes-masters.js
|
|
9
10
|
const standardNotesMasterPlaceholders = /* @__PURE__ */ new Set([
|
|
10
11
|
"sldImg",
|
|
11
12
|
"body",
|
|
@@ -67,7 +68,7 @@ function isBaselineBgRef(bg) {
|
|
|
67
68
|
if (!parsed.success || parsed.data.idx !== 1001) return false;
|
|
68
69
|
const schemeClr = bgRef.child(A_NS, "schemeClr");
|
|
69
70
|
if (schemeClr === void 0) return false;
|
|
70
|
-
return schemeClr.attr("val") === "bg1";
|
|
71
|
+
return schemeClr.attr("val") === "bg1" && schemeClr.allElementChildren().length === 0;
|
|
71
72
|
}
|
|
72
73
|
function consumeBenignCreationIdExtLst(cSld) {
|
|
73
74
|
const extLst = cSld.child(P_NS, "extLst");
|
|
@@ -100,7 +101,7 @@ function readPlaceholderTypeOnSp(spCursor) {
|
|
|
100
101
|
]));
|
|
101
102
|
return parsed.success ? parsed.data.type : void 0;
|
|
102
103
|
}
|
|
103
|
-
function inspectPrintMasterPart(pkg, masterPartPath, kind, diagnostics) {
|
|
104
|
+
function inspectPrintMasterPart(pkg, masterPartPath, kind, diagnostics, reader) {
|
|
104
105
|
const xmlText = pkg.readTextPart(masterPartPath);
|
|
105
106
|
if (xmlText === void 0) return;
|
|
106
107
|
let rootEl;
|
|
@@ -124,50 +125,48 @@ function inspectPrintMasterPart(pkg, masterPartPath, kind, diagnostics) {
|
|
|
124
125
|
});
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
|
-
const retainedAs = kind === "notesMaster" ? "default-notes-master" : "omitted";
|
|
128
|
+
const retainedAs = kind === "notesMaster" ? "default-notes-master" : reader === void 0 ? "omitted" : "handout-master-header-footer";
|
|
128
129
|
const allowedPlaceholders = kind === "notesMaster" ? standardNotesMasterPlaceholders : standardHandoutMasterPlaceholders;
|
|
129
130
|
const masterCursor = XmlElementCursor.createRoot(rootEl, masterPartPath, `/p:${kind}`);
|
|
130
131
|
const rels = pkg.readRelationships(masterPartPath);
|
|
131
132
|
diagnostics.push(...rels.diagnostics);
|
|
132
|
-
|
|
133
|
+
const placeholders = /* @__PURE__ */ new Map();
|
|
133
134
|
const cSld = masterCursor.child(P_NS, "cSld");
|
|
134
135
|
if (cSld !== void 0) {
|
|
135
136
|
cSld.consumeAttr("name");
|
|
136
137
|
const bg = cSld.child(P_NS, "bg");
|
|
137
138
|
if (bg !== void 0) {
|
|
138
|
-
if (!isBaselineBgRef(bg)) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
});
|
|
156
|
-
bg.suppressUnconsumed();
|
|
157
|
-
}
|
|
139
|
+
if (!isBaselineBgRef(XmlElementCursor.createRoot(bg.element, bg.part, bg.xpath))) diagnostics.push({
|
|
140
|
+
code: "unsupported-mechanism",
|
|
141
|
+
category: "unsupported",
|
|
142
|
+
disposition: "omitted",
|
|
143
|
+
location: {
|
|
144
|
+
part: masterPartPath,
|
|
145
|
+
xpath: bg.xpath
|
|
146
|
+
},
|
|
147
|
+
namespaceUri: bg.namespaceUri,
|
|
148
|
+
localName: bg.localName,
|
|
149
|
+
mechanismHint: `${kind}-custom-background`,
|
|
150
|
+
loss: {
|
|
151
|
+
lost: "custom-print-layout",
|
|
152
|
+
retainedAs
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
bg.suppressUnconsumed();
|
|
158
156
|
}
|
|
159
157
|
const spTree = cSld.child(P_NS, "spTree");
|
|
160
158
|
if (spTree !== void 0) {
|
|
161
159
|
consumeIdentityShapeTreeBoilerplate(spTree);
|
|
162
160
|
for (const item of spTree.remainingElementChildren()) {
|
|
163
161
|
if (item.namespaceUri === "http://schemas.openxmlformats.org/presentationml/2006/main" && item.localName === "sp") {
|
|
164
|
-
const
|
|
162
|
+
const probe = XmlElementCursor.createRoot(item.element, item.part, item.xpath);
|
|
163
|
+
const phType = readPlaceholderTypeOnSp(probe);
|
|
165
164
|
if (phType !== void 0 && allowedPlaceholders.has(phType)) {
|
|
165
|
+
if (standardHandoutMasterPlaceholders.has(phType) && !placeholders.has(phType)) placeholders.set(phType, probe);
|
|
166
166
|
item.suppressUnconsumed();
|
|
167
167
|
continue;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
reportedCustomLoss = true;
|
|
171
170
|
const identity = peekShapeTreeObjectIdentity(item.element);
|
|
172
171
|
diagnostics.push({
|
|
173
172
|
code: "unsupported-mechanism",
|
|
@@ -193,7 +192,6 @@ function inspectPrintMasterPart(pkg, masterPartPath, kind, diagnostics) {
|
|
|
193
192
|
}
|
|
194
193
|
const clrMap = masterCursor.child(P_NS, "clrMap");
|
|
195
194
|
if (clrMap !== void 0 && !isStandardColorMap(clrMap)) {
|
|
196
|
-
reportedCustomLoss = true;
|
|
197
195
|
diagnostics.push({
|
|
198
196
|
code: "unsupported-mechanism",
|
|
199
197
|
category: "unsupported",
|
|
@@ -215,7 +213,16 @@ function inspectPrintMasterPart(pkg, masterPartPath, kind, diagnostics) {
|
|
|
215
213
|
const styleElementName = kind === "notesMaster" ? "notesStyle" : "handoutStyle";
|
|
216
214
|
const masterStyle = masterCursor.child(P_NS, styleElementName);
|
|
217
215
|
if (masterStyle !== void 0) masterStyle.suppressUnconsumed();
|
|
218
|
-
|
|
216
|
+
const headerFooter = masterCursor.child(P_NS, "hf");
|
|
217
|
+
if (reader !== void 0) reader({
|
|
218
|
+
kind,
|
|
219
|
+
headerFooter,
|
|
220
|
+
placeholders
|
|
221
|
+
});
|
|
222
|
+
else if (kind === "handoutMaster" || [...standardHandoutMasterPlaceholders].some((slot) => {
|
|
223
|
+
const flag = headerFooter?.attr(slot);
|
|
224
|
+
return flag === "1" || flag === "true" || flag === void 0 && headerFooter !== void 0 || placeholders.get(slot)?.child("http://schemas.openxmlformats.org/presentationml/2006/main", "txBody") !== void 0;
|
|
225
|
+
})) diagnostics.push({
|
|
219
226
|
code: "unsupported-mechanism",
|
|
220
227
|
category: "unsupported",
|
|
221
228
|
disposition: "omitted",
|
|
@@ -225,22 +232,18 @@ function inspectPrintMasterPart(pkg, masterPartPath, kind, diagnostics) {
|
|
|
225
232
|
},
|
|
226
233
|
namespaceUri: P_NS,
|
|
227
234
|
localName: kind,
|
|
228
|
-
mechanismHint: "
|
|
229
|
-
loss: {
|
|
230
|
-
lost: "custom-print-layout",
|
|
231
|
-
retainedAs: "omitted"
|
|
232
|
-
}
|
|
235
|
+
mechanismHint: "print-header-footer"
|
|
233
236
|
});
|
|
237
|
+
headerFooter?.suppressUnconsumed();
|
|
234
238
|
appendUnconsumedDiagnostics(masterCursor, void 0, diagnostics);
|
|
235
239
|
}
|
|
236
240
|
/**
|
|
237
241
|
* Inspects `<p:notesMasterIdLst>` and `<p:handoutMasterIdLst>` from `presentation.xml`.
|
|
238
242
|
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
* locations and `custom-print-layout` editability loss without blocking slide notes import.
|
|
243
|
+
* Both masters retain standard placeholders through the registered reader. Print objects and
|
|
244
|
+
* backgrounds outside that template produce localized diagnostics independently of metadata.
|
|
242
245
|
*/
|
|
243
|
-
function inspectNotesAndHandoutMasters(presCursor, pkg, presRelById, diagnostics) {
|
|
246
|
+
function inspectNotesAndHandoutMasters(presCursor, pkg, presRelById, diagnostics, reader) {
|
|
244
247
|
const visitedParts = /* @__PURE__ */ new Set();
|
|
245
248
|
const inspectList = (listTag, entryTag, relType, kind) => {
|
|
246
249
|
const lst = presCursor.child(P_NS, listTag);
|
|
@@ -291,7 +294,7 @@ function inspectNotesAndHandoutMasters(presCursor, pkg, presRelById, diagnostics
|
|
|
291
294
|
}
|
|
292
295
|
if (visitedParts.has(targetPart)) continue;
|
|
293
296
|
visitedParts.add(targetPart);
|
|
294
|
-
inspectPrintMasterPart(pkg, targetPart, kind, diagnostics);
|
|
297
|
+
inspectPrintMasterPart(pkg, targetPart, kind, diagnostics, reader);
|
|
295
298
|
}
|
|
296
299
|
};
|
|
297
300
|
inspectList("notesMasterIdLst", "notesMasterId", REL_NOTES_MASTER, "notesMaster");
|
package/dist/core/dist/index.js
CHANGED
|
@@ -1,15 +1,47 @@
|
|
|
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
|
-
|
|
1
|
+
import "./kernel/morph.js";
|
|
2
|
+
import { slideStyleSchema } from "./kernel/author-schemas.js";
|
|
3
|
+
import { createAudioNode } from "./capabilities/audio/audio-declaration.js";
|
|
4
|
+
import { createBoxNode } from "./capabilities/box/box-declaration.js";
|
|
5
|
+
import { createChartNode } from "./capabilities/chart/chart-declaration.js";
|
|
6
|
+
import "./kernel/pptx-read/visual.js";
|
|
7
|
+
import { createGroupNode } from "./capabilities/group/group-declaration.js";
|
|
8
|
+
import { blockArc, path, preset } from "./capabilities/shared/geometry.js";
|
|
9
|
+
import { createImageNode } from "./capabilities/image/image-declaration.js";
|
|
10
|
+
import { linearGradient, radialGradient } from "./capabilities/shared/visual.js";
|
|
11
|
+
import { createLineNode } from "./capabilities/line/line-declaration.js";
|
|
12
|
+
import { createNotesNode } from "./capabilities/notes/notes-declaration.js";
|
|
13
|
+
import { createPlaceholderNode } from "./capabilities/placeholder/placeholder-schemas.js";
|
|
14
|
+
import { font, fromFontCollection } from "./capabilities/shared/font/font.js";
|
|
15
|
+
import { after, appear, breathe, collapse, createMotionScopeHandle, createMotionScopeNode, createMotionStepIdentity, createMotionStepNode, disappear, fade, fadeOut, fillColor, floatDown, floatOut, floatUp, fly, flyOut, onStep, repeat, spin, spinIn, spinOut, stretch, wipe, wipeOut, zoom, zoomOut } from "./capabilities/shared/motion-api.js";
|
|
16
|
+
import { createShapeNode } from "./capabilities/shared/shape-declaration.js";
|
|
17
|
+
import { createDateTimeNode, createParagraphNode, createSlideNumberNode, createSpanNode, createSubNode, createSupNode, createTextNode } from "./capabilities/shared/text-declaration.js";
|
|
18
|
+
import { isPlaceholderRichTextNodeType } from "./capabilities/shared/text-schemas.js";
|
|
19
|
+
import { createCellNode, createRowNode, createTableNode } from "./capabilities/table/table-declaration.js";
|
|
20
|
+
import { transitions } from "./capabilities/transition/transition-api.js";
|
|
21
|
+
import { createVideoNode } from "./capabilities/video/video-declaration.js";
|
|
22
|
+
import { motionSchedule } from "./capabilities/motion/motion-query.js";
|
|
23
|
+
import { comment, createCommentNode } from "./capabilities/comment/comment-declaration.js";
|
|
24
|
+
import { audio, box, cell, chart, dateTime, deck, deckPropsSchema, defineSlideLayout, group, image, isSlideLayoutDefinition, line, motionScope, notes, paragraph, placeholder, row, section, shape, slide, slideLayout, slideLayoutDataPropsSchema, slideMaster, slideMasterDataPropsSchema, slideNumber, slidePropsSchema, span, step, sub, sup, table, text, video } from "./document/document.js";
|
|
25
|
+
import "./capabilities/audio/entry.js";
|
|
26
|
+
import "./capabilities/box/box.js";
|
|
27
|
+
import "./capabilities/chart/chart.js";
|
|
28
|
+
import "./capabilities/comment/comment.js";
|
|
29
|
+
import "./capabilities/footer-placeholder/footer-placeholder.js";
|
|
30
|
+
import "./capabilities/group/group.js";
|
|
31
|
+
import "./capabilities/image/image.js";
|
|
32
|
+
import "./capabilities/line/line.js";
|
|
33
|
+
import "./capabilities/masters/masters.js";
|
|
34
|
+
import "./capabilities/motion/motion.js";
|
|
35
|
+
import "./capabilities/notes/notes.js";
|
|
36
|
+
import "./capabilities/placeholder/placeholder.js";
|
|
37
|
+
import "./capabilities/shape/shape.js";
|
|
38
|
+
import "./capabilities/slide-background/slide-background.js";
|
|
39
|
+
import "./capabilities/table/table.js";
|
|
40
|
+
import "./capabilities/text/text.js";
|
|
41
|
+
import "./capabilities/transition/transition.js";
|
|
42
|
+
import "./capabilities/video/entry.js";
|
|
43
|
+
import { documentCapabilities } from "./document/all.js";
|
|
44
|
+
import { emit } from "./emit/emit.js";
|
|
45
|
+
import { codegen, importPptx, resolve } from "./document/default.js";
|
|
46
|
+
import "./document/index.js";
|
|
47
|
+
export { after, appear, audio, blockArc, box, breathe, cell, chart, codegen, collapse, comment, createAudioNode, createBoxNode, createCellNode, createChartNode, createCommentNode, createDateTimeNode, createGroupNode, createImageNode, createLineNode, createMotionScopeHandle, createMotionScopeNode, createMotionStepIdentity, createMotionStepNode, createNotesNode, createParagraphNode, createPlaceholderNode, createRowNode, createShapeNode, createSlideNumberNode, createSpanNode, createSubNode, createSupNode, createTableNode, createTextNode, createVideoNode, dateTime, deck, deckPropsSchema, defineSlideLayout, disappear, documentCapabilities, emit, fade, fadeOut, fillColor, floatDown, floatOut, floatUp, fly, flyOut, font, fromFontCollection, group, image, importPptx, isPlaceholderRichTextNodeType, isSlideLayoutDefinition, line, linearGradient, motionSchedule, motionScope, notes, onStep, paragraph, path, placeholder, preset, radialGradient, repeat, resolve, row, section, shape, slide, slideLayout, slideLayoutDataPropsSchema, slideMaster, slideMasterDataPropsSchema, slideNumber, slidePropsSchema, slideStyleSchema, span, spin, spinIn, spinOut, step, stretch, sub, sup, table, text, transitions, video, wipe, wipeOut, zoom, zoomOut };
|
|
@@ -2,7 +2,7 @@ import { componentLabel, isDeclarationNode } from "./declaration.js";
|
|
|
2
2
|
import { BuildError } from "./diagnostics.js";
|
|
3
3
|
import { readInternalDeclarationProps } from "./document-internals.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
// ../core/dist/author-ids.js
|
|
5
|
+
// ../core/dist/kernel/author-ids.js
|
|
6
6
|
/** Non-empty trimmed author identifier unique within its naming scope. */
|
|
7
7
|
const authorIdSchema = z.string().refine((value) => value.trim() !== "", { message: "id must be a non-empty string" });
|
|
8
8
|
/**
|