@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,13 +1,15 @@
|
|
|
1
|
-
import { BuildError, CapabilityError, capabilityErrorToDiagnostic, toBuildDiagnostic } from "
|
|
2
|
-
import { bytesSha256 } from "
|
|
3
|
-
import { buildOptionsSchema, formatBaseline, targets } from "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { BuildError, CapabilityError, capabilityErrorToDiagnostic, toBuildDiagnostic } from "../kernel/diagnostics.js";
|
|
2
|
+
import { bytesSha256 } from "../kernel/font-seal.js";
|
|
3
|
+
import { buildOptionsSchema, emitOptionsSchema, formatBaseline, targets } from "../kernel/stage-options.js";
|
|
4
|
+
import { countAllocatedMasterThemeParts, pptxParts } from "./ooxml.js";
|
|
5
|
+
import "../kernel/build.js";
|
|
6
|
+
import "../kernel/capability.js";
|
|
7
|
+
import { assertXml10Characters, hasThemeOverrideContent } from "../kernel/pptx-write/xml.js";
|
|
8
|
+
import { writeTiming } from "../kernel/pptx-write/timing.js";
|
|
9
|
+
import { createBuildQuery } from "../kernel/query.js";
|
|
10
|
+
import { getInternalResolution } from "../kernel/resolution.js";
|
|
9
11
|
import { strToU8, zipSync } from "fflate";
|
|
10
|
-
// ../
|
|
12
|
+
// ../core/dist/emit/emit.js
|
|
11
13
|
function diagnostic(path, code, message, details) {
|
|
12
14
|
return toBuildDiagnostic(path, code, message, details);
|
|
13
15
|
}
|
|
@@ -35,6 +37,7 @@ function mapBuildOptionsIssue(rawOptions, issue) {
|
|
|
35
37
|
field: "embedFonts",
|
|
36
38
|
mechanism: "embedFonts"
|
|
37
39
|
});
|
|
40
|
+
if (head === "referenceDate") return diagnostic("build.referenceDate", "invalid-options", "referenceDate must be a valid Date or ISO date string", { field: "referenceDate" });
|
|
38
41
|
if (head === "signal") return diagnostic("build.signal", "invalid-options", "Build options signal must be an AbortSignal", { field: "signal" });
|
|
39
42
|
if (head === "target") {
|
|
40
43
|
if (second === void 0) {
|
|
@@ -62,12 +65,15 @@ function mapBuildOptionsIssue(rawOptions, issue) {
|
|
|
62
65
|
}
|
|
63
66
|
return diagnostic("build", "invalid-options", issue.message);
|
|
64
67
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const parsed = buildOptionsSchema.safeParse(options);
|
|
68
|
+
function validateTargetOptions(options, schema) {
|
|
69
|
+
const parsed = schema.safeParse(options);
|
|
68
70
|
if (!parsed.success) throw new BuildError(parsed.error.issues.map((issue) => mapBuildOptionsIssue(options, issue)));
|
|
69
71
|
return parsed.data.target ?? targets.transitional;
|
|
70
72
|
}
|
|
73
|
+
/** Validates the build options and returns the selected output target. */
|
|
74
|
+
function validateOptions(options) {
|
|
75
|
+
return validateTargetOptions(options, buildOptionsSchema);
|
|
76
|
+
}
|
|
71
77
|
function addResource(resource, context, objectId) {
|
|
72
78
|
if ("externalTarget" in resource) {
|
|
73
79
|
if (typeof resource.externalTarget !== "string" || resource.externalTarget.trim() === "" || typeof resource.relationshipType !== "string" || resource.relationshipType.trim() === "") throw new CapabilityError("invalid-resource", "External resource target or relationship type is invalid");
|
|
@@ -149,20 +155,29 @@ function recordResourceObservation(slide, objectId, resource) {
|
|
|
149
155
|
});
|
|
150
156
|
}
|
|
151
157
|
function packagePartPath(template, sequence) {
|
|
152
|
-
|
|
153
|
-
|
|
158
|
+
const path = sequence === void 0 ? template : template.replace("{n}", String(sequence));
|
|
159
|
+
if (sequence !== void 0 && (template.match(/\{n\}/gu) ?? []).length !== 1 || !/^(?:[a-z0-9_-]+\/)*[a-z0-9_-]+\.[a-z0-9]+$/iu.test(path)) throw new CapabilityError("invalid-part", sequence === void 0 ? "Native part path must be a safe package-relative path" : "Native part path must be a safe package-relative path containing a single part number");
|
|
160
|
+
return path;
|
|
154
161
|
}
|
|
155
162
|
/**
|
|
156
|
-
* Allocates a
|
|
163
|
+
* Allocates a capability part path without colliding with generated deck parts.
|
|
157
164
|
*
|
|
158
|
-
*
|
|
165
|
+
* Part numbering starts at 1 for each path template. A template such as
|
|
159
166
|
* `ppt/theme/theme{n}.xml` must nevertheless skip the theme part generated from the deck theme,
|
|
160
167
|
* which is written outside shared part registration but already reserved for the package.
|
|
161
168
|
*/
|
|
162
|
-
function
|
|
163
|
-
|
|
164
|
-
const path = packagePartPath(template
|
|
165
|
-
if (
|
|
169
|
+
function allocateCapabilityPartPath(template, document) {
|
|
170
|
+
if (!template.includes("{n}")) {
|
|
171
|
+
const path = packagePartPath(template);
|
|
172
|
+
if (document.packageParts.has(path) || document.presentationPartPaths.has(path)) throw new CapabilityError("duplicate-part", "Duplicate PPTX part path");
|
|
173
|
+
return path;
|
|
174
|
+
}
|
|
175
|
+
for (let sequence = document.nextCapabilityPartIdByTemplate.get(template) ?? 1;; sequence += 1) {
|
|
176
|
+
const path = packagePartPath(template, sequence);
|
|
177
|
+
if (!document.packageParts.has(path) && !document.presentationPartPaths.has(path)) {
|
|
178
|
+
document.nextCapabilityPartIdByTemplate.set(template, sequence + 1);
|
|
179
|
+
return path;
|
|
180
|
+
}
|
|
166
181
|
}
|
|
167
182
|
}
|
|
168
183
|
function addPackagePart(packagePart, context, objectId) {
|
|
@@ -177,7 +192,7 @@ function addPackagePart(packagePart, context, objectId) {
|
|
|
177
192
|
const sequence = context.document.nextPackagePartId++;
|
|
178
193
|
const partPath = packagePartPath(part.pathTemplate, sequence);
|
|
179
194
|
const related = relatedParts.map((item, index) => ({
|
|
180
|
-
path: packagePartPath(item.pathTemplate, sequence),
|
|
195
|
+
path: item.independentSequence ? allocateCapabilityPartPath(item.pathTemplate, context.document) : packagePartPath(item.pathTemplate, sequence),
|
|
181
196
|
relationship: {
|
|
182
197
|
id: `rId${index + 1}`,
|
|
183
198
|
type: item.relationshipType,
|
|
@@ -250,10 +265,13 @@ function packagePartDescriptor(part, relationshipType, relationships, content, l
|
|
|
250
265
|
relationships: relationships ?? []
|
|
251
266
|
};
|
|
252
267
|
}
|
|
253
|
-
function targetPartPath(target,
|
|
254
|
-
if (target.kind === "slide")
|
|
268
|
+
function targetPartPath(target, document, slideIndex) {
|
|
269
|
+
if (target.kind === "slide") {
|
|
270
|
+
if (slideIndex === void 0) throw new CapabilityError("invalid-part", "The package part has no owning slide");
|
|
271
|
+
return `ppt/slides/slide${slideIndex}.xml`;
|
|
272
|
+
}
|
|
255
273
|
if (target.kind === "part") {
|
|
256
|
-
const shared =
|
|
274
|
+
const shared = document.sharedParts.get(target.key);
|
|
257
275
|
if (shared === void 0) throw new CapabilityError("missing-part-target", `Package part relationship references unregistered shared part ${JSON.stringify(target.key)}`);
|
|
258
276
|
return shared.path;
|
|
259
277
|
}
|
|
@@ -268,13 +286,11 @@ function addSlidePackagePart(part, context) {
|
|
|
268
286
|
const descriptor = packagePartDescriptor(part.part, part.slideRelationshipType, part.relationships, part.content, "slide part", true);
|
|
269
287
|
const slideRelationshipType = descriptor.relationshipType;
|
|
270
288
|
if (slideRelationshipType === void 0) throw new CapabilityError("invalid-part", "Slide part relationship type is required");
|
|
271
|
-
const
|
|
272
|
-
const partPath = packagePartPath(descriptor.pathTemplate, sequence);
|
|
273
|
-
if (context.document.packageParts.has(partPath) || context.document.presentationPartPaths.has(partPath)) throw new CapabilityError("duplicate-part", "Duplicate PPTX part path");
|
|
289
|
+
const partPath = allocateCapabilityPartPath(descriptor.pathTemplate, context.document);
|
|
274
290
|
const relationships = descriptor.relationships.map((relationship, index) => ({
|
|
275
291
|
id: `rId${index + 1}`,
|
|
276
292
|
type: relationship.relationshipType,
|
|
277
|
-
target: relationshipTarget(partPath, targetPartPath(relationship.target, context))
|
|
293
|
+
target: relationshipTarget(partPath, targetPartPath(relationship.target, context.document, context.slide.index))
|
|
278
294
|
}));
|
|
279
295
|
const content = partContent(part.content(relationships.map(({ id }) => id)), "Slide part");
|
|
280
296
|
context.document.presentationPartPaths.add(partPath);
|
|
@@ -292,56 +308,57 @@ function addSlidePackagePart(part, context) {
|
|
|
292
308
|
});
|
|
293
309
|
return relationshipId;
|
|
294
310
|
}
|
|
295
|
-
function addSharedPackagePart(key, part,
|
|
311
|
+
function addSharedPackagePart(key, part, document) {
|
|
296
312
|
if (typeof key !== "string" || key.trim() === "") throw new CapabilityError("invalid-part", "Shared part key must be a non-empty string");
|
|
297
313
|
const descriptor = packagePartDescriptor(part.part, part.presentationRelationshipType, part.relationships, part.content, "shared part");
|
|
298
314
|
const presentationRelationshipType = descriptor.relationshipType;
|
|
299
315
|
if (part.presentationElement !== void 0 && presentationRelationshipType === void 0) throw new CapabilityError("invalid-part", "Shared part presentation element requires a presentation relationship type");
|
|
300
|
-
const existing =
|
|
316
|
+
const existing = document.sharedParts.get(key);
|
|
301
317
|
if (existing !== void 0) {
|
|
302
318
|
if (!(existing.descriptor.part.pathTemplate === descriptor.pathTemplate && existing.descriptor.part.contentType === descriptor.contentType && existing.descriptor.presentationRelationshipType === descriptor.relationshipType && JSON.stringify(existing.descriptor.relationships ?? []) === JSON.stringify(descriptor.relationships))) throw new CapabilityError("conflicting-shared-part", `Shared part ${JSON.stringify(key)} has conflicting declarations`);
|
|
303
319
|
return {
|
|
304
320
|
path: existing.path,
|
|
321
|
+
renderSlideFragment: existing.descriptor.renderSlideFragment,
|
|
305
322
|
...existing.relationshipId === void 0 ? {} : { relationshipId: existing.relationshipId }
|
|
306
323
|
};
|
|
307
324
|
}
|
|
308
|
-
const partPath =
|
|
325
|
+
const partPath = allocateCapabilityPartPath(descriptor.pathTemplate, document);
|
|
309
326
|
const relationships = descriptor.relationships.map((relationship, index) => ({
|
|
310
327
|
id: `rId${index + 1}`,
|
|
311
328
|
type: relationship.relationshipType,
|
|
312
|
-
target: relationshipTarget(partPath, targetPartPath(relationship.target,
|
|
329
|
+
target: relationshipTarget(partPath, targetPartPath(relationship.target, document))
|
|
313
330
|
}));
|
|
314
331
|
const content = partContent(part.content(relationships.map(({ id }) => id)), "Shared part");
|
|
315
|
-
|
|
316
|
-
|
|
332
|
+
document.presentationPartPaths.add(partPath);
|
|
333
|
+
document.packageParts.set(partPath, {
|
|
317
334
|
path: partPath,
|
|
318
335
|
content,
|
|
319
336
|
contentType: descriptor.contentType
|
|
320
337
|
});
|
|
321
|
-
if (relationships.length > 0)
|
|
338
|
+
if (relationships.length > 0) document.packageRelationships.set(partPath, relationships);
|
|
322
339
|
let relationshipId;
|
|
323
340
|
if (presentationRelationshipType !== void 0) {
|
|
324
|
-
relationshipId = `rId${
|
|
325
|
-
const presentationRelationships =
|
|
341
|
+
relationshipId = `rId${document.nextPresentationRelationshipId++}`;
|
|
342
|
+
const presentationRelationships = document.packageRelationships.get("ppt/presentation.xml") ?? [];
|
|
326
343
|
presentationRelationships.push({
|
|
327
344
|
id: relationshipId,
|
|
328
345
|
type: presentationRelationshipType,
|
|
329
346
|
target: relationshipTarget("ppt/presentation.xml", partPath)
|
|
330
347
|
});
|
|
331
|
-
|
|
348
|
+
document.packageRelationships.set("ppt/presentation.xml", presentationRelationships);
|
|
332
349
|
const element = part.presentationElement;
|
|
333
350
|
if (element !== void 0) {
|
|
334
|
-
if (element.position !== "before-slides" && element.position !== "after-notes-size" || typeof element.content !== "function") throw new CapabilityError("invalid-part", "Shared part presentation element declaration is invalid");
|
|
351
|
+
if (element.position !== "before-slides" && element.position !== "after-notes-master" && element.position !== "after-notes-size" || typeof element.content !== "function") throw new CapabilityError("invalid-part", "Shared part presentation element declaration is invalid");
|
|
335
352
|
const xml = element.content(relationshipId);
|
|
336
353
|
if (typeof xml !== "string" || xml.trim() === "") throw new CapabilityError("invalid-part", "Shared part presentation element must generate content");
|
|
337
354
|
assertXml10Characters(xml);
|
|
338
|
-
|
|
355
|
+
document.presentationElements.push({
|
|
339
356
|
position: element.position,
|
|
340
357
|
content: xml
|
|
341
358
|
});
|
|
342
359
|
}
|
|
343
360
|
}
|
|
344
|
-
|
|
361
|
+
document.sharedParts.set(key, {
|
|
345
362
|
path: partPath,
|
|
346
363
|
...relationshipId === void 0 ? {} : { relationshipId },
|
|
347
364
|
descriptor: {
|
|
@@ -352,11 +369,13 @@ function addSharedPackagePart(key, part, context) {
|
|
|
352
369
|
...presentationRelationshipType === void 0 ? {} : { presentationRelationshipType },
|
|
353
370
|
...part.relationships === void 0 ? {} : { relationships: descriptor.relationships },
|
|
354
371
|
...part.presentationElement === void 0 ? {} : { presentationElement: part.presentationElement },
|
|
355
|
-
content: part.content
|
|
372
|
+
content: part.content,
|
|
373
|
+
renderSlideFragment: part.renderSlideFragment
|
|
356
374
|
}
|
|
357
375
|
});
|
|
358
376
|
return {
|
|
359
377
|
path: partPath,
|
|
378
|
+
renderSlideFragment: part.renderSlideFragment,
|
|
360
379
|
...relationshipId === void 0 ? {} : { relationshipId }
|
|
361
380
|
};
|
|
362
381
|
}
|
|
@@ -447,7 +466,7 @@ function addPresentationContribution(contribution, context, path, objectId) {
|
|
|
447
466
|
...item.resolveBytes === void 0 ? {} : { resolveBytes: item.resolveBytes }
|
|
448
467
|
});
|
|
449
468
|
}
|
|
450
|
-
function finalizePresentationContributions(document) {
|
|
469
|
+
async function finalizePresentationContributions(document, options) {
|
|
451
470
|
for (const collection of document.presentationCollections.values()) for (const record of collection.records.values()) for (const item of record.items.values()) {
|
|
452
471
|
let bytes = item.bytes;
|
|
453
472
|
if (item.resourceClaim !== void 0) {
|
|
@@ -455,8 +474,11 @@ function finalizePresentationContributions(document) {
|
|
|
455
474
|
const claim = document.resourceClaims.get(claimKey);
|
|
456
475
|
if (claim === void 0 || claim.identity !== item.identity) throw new BuildError([diagnostic(item.path, "missing-resource-claim", `Presentation resource ${item.resourceClaim.key} is missing matching character claims`)]);
|
|
457
476
|
try {
|
|
458
|
-
|
|
477
|
+
const prepared = item.resolveBytes(claim.characters, { signal: options.signal });
|
|
478
|
+
bytes = prepared instanceof Uint8Array ? prepared : await prepared;
|
|
479
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
459
480
|
} catch (error) {
|
|
481
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
460
482
|
if (error instanceof CapabilityError) throw new BuildError([capabilityErrorToDiagnostic(error, item.path)]);
|
|
461
483
|
throw new BuildError([diagnostic(item.path, "resource-contribution-failed", error instanceof Error ? error.message : String(error))]);
|
|
462
484
|
}
|
|
@@ -485,7 +507,7 @@ function presentationContent(document) {
|
|
|
485
507
|
const rendered = [...document.presentationCollections.values()].map(({ tagName, records }) => `<${tagName}>${[...records.values()].map((record) => `<${record.tagName}>${record.content}${[...record.items.values()].sort((left, right) => left.order - right.order).map(({ content }) => content).join("")}</${record.tagName}>`).join("")}</${tagName}>`).join("");
|
|
486
508
|
const elements = (position) => document.presentationElements.filter((element) => element.position === position).map(({ content }) => content).join("");
|
|
487
509
|
return {
|
|
488
|
-
beforeSlides: elements("before-slides"),
|
|
510
|
+
beforeSlides: elements("before-slides") + elements("after-notes-master"),
|
|
489
511
|
afterNotesSize: rendered + elements("after-notes-size")
|
|
490
512
|
};
|
|
491
513
|
}
|
|
@@ -547,6 +569,7 @@ function createDocumentEmitState(internal) {
|
|
|
547
569
|
presentationCollections: /* @__PURE__ */ new Map(),
|
|
548
570
|
sharedParts: /* @__PURE__ */ new Map(),
|
|
549
571
|
presentationElements: [],
|
|
572
|
+
nextCapabilityPartIdByTemplate: /* @__PURE__ */ new Map(),
|
|
550
573
|
nextPackagePartId: 1,
|
|
551
574
|
nextPresentationRelationshipId: (internal.masters?.length ?? 1) + internal.slides.length + 1,
|
|
552
575
|
nextTextFieldId: 1
|
|
@@ -584,6 +607,10 @@ function emitLayer(layer, slideIndexById, docEmit, slideEmit, target, options) {
|
|
|
584
607
|
};
|
|
585
608
|
const output = layer.emit(emitContext);
|
|
586
609
|
ownXml = output.xml;
|
|
610
|
+
if (output.timing !== void 0) slideEmit.objectTiming.push({
|
|
611
|
+
path: layer.path,
|
|
612
|
+
timing: output.timing
|
|
613
|
+
});
|
|
587
614
|
if (layer.morphKey !== void 0 && layer.emitsObject && ownXml === "") slideEmit.diagnostics.push(diagnostic(layer.path, "morph-needs-object", "morphKey can only be used with capabilities that produce native objects"));
|
|
588
615
|
for (const contribution of output.presentationContributions ?? []) addPresentationContribution(contribution, {
|
|
589
616
|
document: docEmit,
|
|
@@ -612,6 +639,12 @@ function maxResolvedObjectId(layers) {
|
|
|
612
639
|
function emittedBuildQuery(report, fallbackQuery) {
|
|
613
640
|
return emittedQueries.get(report) ?? fallbackQuery;
|
|
614
641
|
}
|
|
642
|
+
function emitPartTiming(contributions, diagnostics) {
|
|
643
|
+
return writeTiming(contributions.map((entry) => entry.timing), (index, error) => {
|
|
644
|
+
const { path } = contributions[index];
|
|
645
|
+
diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
646
|
+
});
|
|
647
|
+
}
|
|
615
648
|
function emitMasterOrLayoutCapabilities(capabilities, internal, docEmit, partEmit, target, options) {
|
|
616
649
|
if (capabilities === void 0 || capabilities.length === 0) return {
|
|
617
650
|
transitionXml: "",
|
|
@@ -623,6 +656,7 @@ function emitMasterOrLayoutCapabilities(capabilities, internal, docEmit, partEmi
|
|
|
623
656
|
};
|
|
624
657
|
const transitionParts = [];
|
|
625
658
|
const timingParts = [];
|
|
659
|
+
const timing = [];
|
|
626
660
|
for (const cap of capabilities) {
|
|
627
661
|
checkExtensions(cap.extensions, target, docEmit.usedExtensions, partEmit.diagnostics, cap.path);
|
|
628
662
|
try {
|
|
@@ -635,7 +669,11 @@ function emitMasterOrLayoutCapabilities(capabilities, internal, docEmit, partEmi
|
|
|
635
669
|
createTextFieldId: () => allocateTextFieldId(docEmit),
|
|
636
670
|
registerResource: (resource) => addResource(resource, packageCtx),
|
|
637
671
|
registerPackagePart: (part) => addSlidePackagePart(part, packageCtx),
|
|
638
|
-
registerSharedPart: (key, part) => addSharedPackagePart(key, part,
|
|
672
|
+
registerSharedPart: (key, part) => addSharedPackagePart(key, part, docEmit)
|
|
673
|
+
});
|
|
674
|
+
if (output.timing !== void 0) timing.push({
|
|
675
|
+
path: cap.path,
|
|
676
|
+
timing: output.timing
|
|
639
677
|
});
|
|
640
678
|
if (cap.slot === "transition" && output.xml !== "") transitionParts.push(output.xml);
|
|
641
679
|
else if (cap.slot === "timing" && output.xml !== "") timingParts.push(output.xml);
|
|
@@ -645,7 +683,7 @@ function emitMasterOrLayoutCapabilities(capabilities, internal, docEmit, partEmi
|
|
|
645
683
|
}
|
|
646
684
|
return {
|
|
647
685
|
transitionXml: transitionParts.join(""),
|
|
648
|
-
timingXml: timingParts.join("")
|
|
686
|
+
timingXml: timingParts.join("") + emitPartTiming(timing, partEmit.diagnostics)
|
|
649
687
|
};
|
|
650
688
|
}
|
|
651
689
|
function emitOwnerPlaceholderVisuals(placeholderVisuals, internal, docEmit, ownerEmit, ownerCtx, target, options) {
|
|
@@ -660,17 +698,26 @@ function emitOwnerPlaceholderVisuals(placeholderVisuals, internal, docEmit, owne
|
|
|
660
698
|
createTextFieldId: () => allocateTextFieldId(docEmit),
|
|
661
699
|
registerResource: (resource) => addResource(resource, ownerCtx),
|
|
662
700
|
registerPackagePart: (part) => addSlidePackagePart(part, ownerCtx),
|
|
663
|
-
registerSharedPart: (key, part) => addSharedPackagePart(key, part,
|
|
701
|
+
registerSharedPart: (key, part) => addSharedPackagePart(key, part, docEmit)
|
|
664
702
|
}).placeholderSpPrByKey;
|
|
665
703
|
}
|
|
666
704
|
/**
|
|
667
705
|
* Emits a PPTX archive and BuildReport from an existing Resolution without re-resolving the document.
|
|
668
706
|
*/
|
|
669
|
-
function emit(resolution, options = {}) {
|
|
670
|
-
const target =
|
|
707
|
+
async function emit(resolution, options = {}) {
|
|
708
|
+
const target = validateTargetOptions(options, emitOptionsSchema);
|
|
671
709
|
if (options.signal?.aborted) throw options.signal.reason;
|
|
672
710
|
const internal = getInternalResolution(resolution);
|
|
673
711
|
const docEmit = createDocumentEmitState(internal);
|
|
712
|
+
for (const emitDeck of internal.deckEmitters ?? []) try {
|
|
713
|
+
emitDeck({
|
|
714
|
+
createTextFieldId: () => allocateTextFieldId(docEmit),
|
|
715
|
+
registerSharedPart: (key, part) => addSharedPackagePart(key, part, docEmit)
|
|
716
|
+
});
|
|
717
|
+
} catch (error) {
|
|
718
|
+
if (!(error instanceof CapabilityError)) throw error;
|
|
719
|
+
throw new BuildError([capabilityErrorToDiagnostic(error, "deck")]);
|
|
720
|
+
}
|
|
674
721
|
let sectionXml = "";
|
|
675
722
|
if (internal.sectionsEmitter !== void 0) {
|
|
676
723
|
const forbiddenExtensions = internal.sectionsEmitter.extensions.filter((ext) => !target.extensions.includes(ext));
|
|
@@ -693,7 +740,8 @@ function emit(resolution, options = {}) {
|
|
|
693
740
|
diagnostics: [],
|
|
694
741
|
relationships: [],
|
|
695
742
|
relationshipIds: /* @__PURE__ */ new Map(),
|
|
696
|
-
resourceObservations: []
|
|
743
|
+
resourceObservations: [],
|
|
744
|
+
objectTiming: []
|
|
697
745
|
};
|
|
698
746
|
const masterCtx = {
|
|
699
747
|
document: docEmit,
|
|
@@ -712,7 +760,7 @@ function emit(resolution, options = {}) {
|
|
|
712
760
|
createTextFieldId: () => allocateTextFieldId(docEmit),
|
|
713
761
|
registerResource: (resource) => addResource(resource, masterCtx),
|
|
714
762
|
registerPackagePart: (part) => addSlidePackagePart(part, masterCtx),
|
|
715
|
-
registerSharedPart: (key, part) => addSharedPackagePart(key, part,
|
|
763
|
+
registerSharedPart: (key, part) => addSharedPackagePart(key, part, docEmit)
|
|
716
764
|
}).xml;
|
|
717
765
|
}
|
|
718
766
|
let nextMasterObjectId = Math.max(maxResolvedObjectId(master.layers ?? []), 1 + Object.keys(master.placeholders ?? {}).length) + 1;
|
|
@@ -729,7 +777,7 @@ function emit(resolution, options = {}) {
|
|
|
729
777
|
allocateObjectId: () => nextMasterObjectId++,
|
|
730
778
|
registerResource: (resource) => addResource(resource, masterCtx),
|
|
731
779
|
registerPackagePart: (part) => addSlidePackagePart(part, masterCtx),
|
|
732
|
-
registerSharedPart: (key, part) => addSharedPackagePart(key, part,
|
|
780
|
+
registerSharedPart: (key, part) => addSharedPackagePart(key, part, docEmit)
|
|
733
781
|
});
|
|
734
782
|
masterShapeFragments.push(fpOut.xml);
|
|
735
783
|
for (const contribution of fpOut.presentationContributions ?? []) addPresentationContribution(contribution, {
|
|
@@ -748,7 +796,8 @@ function emit(resolution, options = {}) {
|
|
|
748
796
|
diagnostics: [],
|
|
749
797
|
relationships: [],
|
|
750
798
|
relationshipIds: /* @__PURE__ */ new Map(),
|
|
751
|
-
resourceObservations: []
|
|
799
|
+
resourceObservations: [],
|
|
800
|
+
objectTiming: []
|
|
752
801
|
};
|
|
753
802
|
const layoutCtx = {
|
|
754
803
|
document: docEmit,
|
|
@@ -767,7 +816,7 @@ function emit(resolution, options = {}) {
|
|
|
767
816
|
createTextFieldId: () => allocateTextFieldId(docEmit),
|
|
768
817
|
registerResource: (resource) => addResource(resource, layoutCtx),
|
|
769
818
|
registerPackagePart: (part) => addSlidePackagePart(part, layoutCtx),
|
|
770
|
-
registerSharedPart: (key, part) => addSharedPackagePart(key, part,
|
|
819
|
+
registerSharedPart: (key, part) => addSharedPackagePart(key, part, docEmit)
|
|
771
820
|
}).xml;
|
|
772
821
|
}
|
|
773
822
|
let nextLayoutObjectId = Math.max(maxResolvedObjectId(layout.layers ?? []), 1 + Object.keys(layout.placeholders ?? {}).length) + 1;
|
|
@@ -784,7 +833,7 @@ function emit(resolution, options = {}) {
|
|
|
784
833
|
allocateObjectId: () => nextLayoutObjectId++,
|
|
785
834
|
registerResource: (resource) => addResource(resource, layoutCtx),
|
|
786
835
|
registerPackagePart: (part) => addSlidePackagePart(part, layoutCtx),
|
|
787
|
-
registerSharedPart: (key, part) => addSharedPackagePart(key, part,
|
|
836
|
+
registerSharedPart: (key, part) => addSharedPackagePart(key, part, docEmit)
|
|
788
837
|
});
|
|
789
838
|
layoutShapeFragments.push(fpOut.xml);
|
|
790
839
|
for (const contribution of fpOut.presentationContributions ?? []) addPresentationContribution(contribution, {
|
|
@@ -843,7 +892,8 @@ function emit(resolution, options = {}) {
|
|
|
843
892
|
diagnostics: [],
|
|
844
893
|
relationships: [],
|
|
845
894
|
relationshipIds: /* @__PURE__ */ new Map(),
|
|
846
|
-
resourceObservations: []
|
|
895
|
+
resourceObservations: [],
|
|
896
|
+
objectTiming: []
|
|
847
897
|
};
|
|
848
898
|
const packageCtx = {
|
|
849
899
|
document: docEmit,
|
|
@@ -851,6 +901,7 @@ function emit(resolution, options = {}) {
|
|
|
851
901
|
};
|
|
852
902
|
let nextSlideObjectId = maxResolvedObjectId(resolvedSlide.layers) + 1;
|
|
853
903
|
let shapeXml = resolvedSlide.layers.map((layer) => emitLayer(layer, slideIndexById, docEmit, slideEmit, target, options)).join("");
|
|
904
|
+
const slideTiming = [];
|
|
854
905
|
let backgroundXml = "";
|
|
855
906
|
const slideXmlParts = [];
|
|
856
907
|
for (const slideCap of resolvedSlide.slideCapabilities) {
|
|
@@ -862,13 +913,18 @@ function emit(resolution, options = {}) {
|
|
|
862
913
|
theme: slideCap.theme,
|
|
863
914
|
options,
|
|
864
915
|
slideNumber: resolvedSlide.index,
|
|
916
|
+
slides: resolution.report.slides,
|
|
865
917
|
createTextFieldId: () => allocateTextFieldId(docEmit),
|
|
866
918
|
allocateObjectId: () => nextSlideObjectId++,
|
|
867
919
|
registerResource: (resource) => addResource(resource, packageCtx),
|
|
868
920
|
registerPackagePart: (part) => addSlidePackagePart(part, packageCtx),
|
|
869
|
-
registerSharedPart: (key, part) => addSharedPackagePart(key, part,
|
|
921
|
+
registerSharedPart: (key, part) => addSharedPackagePart(key, part, docEmit)
|
|
870
922
|
};
|
|
871
923
|
const output = slideCap.emit(slideEmitContext);
|
|
924
|
+
if (output.timing !== void 0) slideTiming.push({
|
|
925
|
+
path: slideCap.path,
|
|
926
|
+
timing: output.timing
|
|
927
|
+
});
|
|
872
928
|
if (slideCap.slot === "background") backgroundXml += output.xml;
|
|
873
929
|
else if (slideCap.slot === "shape-tree") shapeXml += output.xml;
|
|
874
930
|
else slideXmlParts.push({
|
|
@@ -883,6 +939,11 @@ function emit(resolution, options = {}) {
|
|
|
883
939
|
slideEmit.diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, slideCap.path) : diagnostic(slideCap.path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
884
940
|
}
|
|
885
941
|
}
|
|
942
|
+
const timingXml = emitPartTiming([...slideTiming, ...slideEmit.objectTiming], slideEmit.diagnostics);
|
|
943
|
+
if (timingXml !== "") slideXmlParts.push({
|
|
944
|
+
slot: "timing",
|
|
945
|
+
xml: timingXml
|
|
946
|
+
});
|
|
886
947
|
if (slideEmit.diagnostics.length > 0) throw new BuildError(slideEmit.diagnostics);
|
|
887
948
|
return {
|
|
888
949
|
id: resolvedSlide.id,
|
|
@@ -903,8 +964,9 @@ function emit(resolution, options = {}) {
|
|
|
903
964
|
resourceObservations: slideEmit.resourceObservations
|
|
904
965
|
};
|
|
905
966
|
});
|
|
906
|
-
finalizePresentationContributions(docEmit);
|
|
907
|
-
|
|
967
|
+
await finalizePresentationContributions(docEmit, options);
|
|
968
|
+
options.signal?.throwIfAborted();
|
|
969
|
+
const parts = pptxParts((template) => allocateCapabilityPartPath(template, docEmit), internal.dimensions, emittedSlides.map(({ id, name, layoutKey, colorMapOverride, themeOverride, hidden, showMasterPlaceholderAnimations, showMasterShapes, shapeXml, backgroundXml, slideXml, relationships }) => ({
|
|
908
970
|
id,
|
|
909
971
|
...name === void 0 ? {} : { name },
|
|
910
972
|
...layoutKey === void 0 ? {} : { layoutKey },
|