@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,17 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { allocateScopedAuthorId, appendUnconsumedDiagnostics, consumeCommonSlideCreationId, readShapeTreeItems } from "./masters.js";
|
|
6
|
-
import { P_NS, R_NS, emuToPx } from "./namespaces.js";
|
|
1
|
+
import { emuToPx } from "../kernel/drawing-units.js";
|
|
2
|
+
import { createMorphScope } from "../kernel/morph.js";
|
|
3
|
+
import { consumeCommonSlideCreationId, importMastersAndLayouts, readShapeTreeItems } from "./masters.js";
|
|
4
|
+
import { readMediaTiming } from "./media-timing.js";
|
|
7
5
|
import { inspectNotesAndHandoutMasters } from "./notes-masters.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { createContainerSlotRegistry } from "../kernel/container-slots.js";
|
|
7
|
+
import { createDeckNode, createSlideNode } from "../kernel/document.js";
|
|
8
|
+
import "../kernel/index.js";
|
|
9
|
+
import { importOptionsSchema } from "../kernel/pptx-read/diagnostics.js";
|
|
10
|
+
import { P_NS, R_NS } from "../kernel/pptx-read/namespaces.js";
|
|
11
|
+
import { allocateScopedAuthorId, appendUnconsumedDiagnostics } from "../kernel/pptx-read/shape-tree.js";
|
|
12
|
+
import { openPptxPackage, resolvePartPath } from "../kernel/pptx-read/opc.js";
|
|
13
|
+
import { buildRelationshipIndex } from "../kernel/pptx-read/resources.js";
|
|
14
|
+
import { readColorMapOverride, readPartThemeOverride } from "../kernel/pptx-read/themes.js";
|
|
15
|
+
import { extentEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema } from "../kernel/pptx-read/xml-fragments.js";
|
|
16
|
+
import { XmlElementCursor, parseXmlPart } from "../kernel/pptx-read/xml-reader.js";
|
|
13
17
|
import { z } from "zod";
|
|
14
|
-
|
|
18
|
+
import { setImmediate } from "node:timers/promises";
|
|
19
|
+
// ../core/dist/import/import.js
|
|
15
20
|
const defaultSlideWidthPx = 960;
|
|
16
21
|
const defaultSlideHeightPx = 540;
|
|
17
22
|
const minimumSlideSizeEmu = 914400;
|
|
@@ -22,15 +27,24 @@ const slideShowAttrSchema = z.object({
|
|
|
22
27
|
showMasterPhAnim: ooxmlBoolSchema.optional(),
|
|
23
28
|
showMasterSp: ooxmlBoolSchema.optional()
|
|
24
29
|
});
|
|
30
|
+
const importHandlerTargets = {
|
|
31
|
+
"shape-tree": true,
|
|
32
|
+
slide: true,
|
|
33
|
+
deck: true,
|
|
34
|
+
"text-inline": true
|
|
35
|
+
};
|
|
25
36
|
function isImportMechanismHandler(value) {
|
|
26
37
|
if (typeof value !== "object" || value === null || !("target" in value)) return false;
|
|
27
38
|
const target = value.target;
|
|
28
|
-
return target === "
|
|
39
|
+
return typeof target === "string" && Object.hasOwn(importHandlerTargets, target);
|
|
29
40
|
}
|
|
30
41
|
function collectHandlers(capabilities) {
|
|
31
42
|
const shapeTree = [];
|
|
32
43
|
const slide = [];
|
|
33
44
|
const deck = [];
|
|
45
|
+
const slideModules = capabilities.filter((mod) => "bindSlide" in mod);
|
|
46
|
+
const readsFooterPlaceholders = createContainerSlotRegistry(slideModules).owners.master.has("footerPlaceholders");
|
|
47
|
+
const literalMorphNames = /* @__PURE__ */ new Set();
|
|
34
48
|
for (const mod of capabilities) {
|
|
35
49
|
if (!("mechanisms" in mod) || mod.mechanisms === void 0) continue;
|
|
36
50
|
for (const mechanism of mod.mechanisms) {
|
|
@@ -39,18 +53,25 @@ function collectHandlers(capabilities) {
|
|
|
39
53
|
switch (handler.target) {
|
|
40
54
|
case "shape-tree":
|
|
41
55
|
shapeTree.push(handler);
|
|
56
|
+
if (handler.importsMorphName === false) literalMorphNames.add(mod.declaration);
|
|
42
57
|
break;
|
|
43
58
|
case "slide":
|
|
44
59
|
slide.push(handler);
|
|
45
60
|
break;
|
|
46
|
-
case "deck":
|
|
61
|
+
case "deck":
|
|
62
|
+
deck.push(handler);
|
|
63
|
+
break;
|
|
64
|
+
case "text-inline": break;
|
|
65
|
+
default: throw new Error(`Unsupported import handler target: ${String(handler)}`);
|
|
47
66
|
}
|
|
48
67
|
}
|
|
49
68
|
}
|
|
50
69
|
return {
|
|
51
70
|
shapeTree,
|
|
52
71
|
slide,
|
|
53
|
-
deck
|
|
72
|
+
deck,
|
|
73
|
+
readsFooterPlaceholders,
|
|
74
|
+
literalMorphNames
|
|
54
75
|
};
|
|
55
76
|
}
|
|
56
77
|
function consumePresentationHeaderBoilerplate(presCursor) {
|
|
@@ -124,7 +145,7 @@ function applyNativeMorphToken(node, slidePartPath, slideIndex, morphScope, morp
|
|
|
124
145
|
morphKey: handle
|
|
125
146
|
});
|
|
126
147
|
}
|
|
127
|
-
function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeByPartPath, clrMapByLayoutPartPath, handlers, registerDeferredSlideLink, morphScope, morphHandleByToken, slideDimensions, diagnostics) {
|
|
148
|
+
function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeByPartPath, clrMapByLayoutPartPath, textLevelsByLayout, handlers, registerDeferredSlideLink, morphScope, morphHandleByToken, slideDimensions, diagnostics) {
|
|
128
149
|
const xmlText = pkg.readTextPart(slidePartPath);
|
|
129
150
|
if (xmlText === void 0) return void 0;
|
|
130
151
|
let slideEl;
|
|
@@ -243,6 +264,7 @@ function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeB
|
|
|
243
264
|
const layoutPlaceholders = layoutNode?.props["placeholders"];
|
|
244
265
|
const masterPlaceholders = layoutNode?.parent?.props["placeholders"];
|
|
245
266
|
const masterTextStyles = layoutNode?.parent?.props["textStyles"];
|
|
267
|
+
const placeholderTextLevels = resolvedLayoutPath === void 0 ? void 0 : textLevelsByLayout.get(resolvedLayoutPath);
|
|
246
268
|
const layoutClrMap = resolvedLayoutPath === void 0 ? void 0 : clrMapByLayoutPartPath.get(resolvedLayoutPath);
|
|
247
269
|
const clrMapOvr = slideCursor.child(P_NS, "clrMapOvr");
|
|
248
270
|
let colorMapOverride;
|
|
@@ -250,24 +272,10 @@ function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeB
|
|
|
250
272
|
const parsedOvr = readColorMapOverride(clrMapOvr, slidePartPath, slideIndex, diagnostics);
|
|
251
273
|
if (parsedOvr !== void 0 && parsedOvr !== "master") colorMapOverride = parsedOvr;
|
|
252
274
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if (overridePart === void 0 || !pkg.hasPart(overridePart)) diagnostics.push({
|
|
258
|
-
code: "missing-target-part",
|
|
259
|
-
category: "corrupt-input",
|
|
260
|
-
disposition: "omitted",
|
|
261
|
-
location: {
|
|
262
|
-
part: slidePartPath,
|
|
263
|
-
xpath: themeOverrideRel.xpath,
|
|
264
|
-
slideIndex
|
|
265
|
-
},
|
|
266
|
-
relationshipId: themeOverrideRel.Id,
|
|
267
|
-
targetPart: overridePart ?? themeOverrideRel.Target
|
|
268
|
-
});
|
|
269
|
-
else themeOverride = readThemeOverridePart(pkg, overridePart, slideIndex, diagnostics);
|
|
270
|
-
}
|
|
275
|
+
const themeOverride = readPartThemeOverride(pkg, slideRels.entries, {
|
|
276
|
+
part: slidePartPath,
|
|
277
|
+
slideIndex
|
|
278
|
+
}, diagnostics);
|
|
271
279
|
const rawSlideName = cSld.attr("name");
|
|
272
280
|
const slideId = allocateScopedAuthorId(rawSlideName, usedSlideIds, `slide-${slideIndex + 1}`);
|
|
273
281
|
const displayName = rawSlideName !== void 0 && rawSlideName.trim().length > 0 && rawSlideName !== slideId ? rawSlideName : void 0;
|
|
@@ -289,6 +297,8 @@ function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeB
|
|
|
289
297
|
const usedSlideMorphTokens = /* @__PURE__ */ new Set();
|
|
290
298
|
const spTree = cSld.child(P_NS, "spTree");
|
|
291
299
|
const claimedPlaceholderKeys = /* @__PURE__ */ new Set();
|
|
300
|
+
const slideImportHandlers = handlers.slide.filter((handler) => handler.matches === void 0 || handler.matches(slideCursor));
|
|
301
|
+
const mediaTiming = readMediaTiming(slideCursor, slideIndex, diagnostics, slideImportHandlers.some((handler) => handler.slot === "timing" && handler.readsGraphicMotion === true));
|
|
292
302
|
if (spTree !== void 0) readShapeTreeItems({
|
|
293
303
|
spTree,
|
|
294
304
|
pkg,
|
|
@@ -300,20 +310,21 @@ function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeB
|
|
|
300
310
|
registerImportedObject,
|
|
301
311
|
omittedSpids,
|
|
302
312
|
appendNode: (node) => {
|
|
303
|
-
applyNativeMorphToken(node, slidePartPath, slideIndex, morphScope, morphHandleByToken, usedSlideMorphTokens, diagnostics);
|
|
313
|
+
if (!handlers.literalMorphNames.has(node.type)) applyNativeMorphToken(node, slidePartPath, slideIndex, morphScope, morphHandleByToken, usedSlideMorphTokens, diagnostics);
|
|
304
314
|
slideNode.append(node);
|
|
305
315
|
},
|
|
306
316
|
diagnostics,
|
|
307
317
|
containerNode: slideNode,
|
|
318
|
+
mediaTiming: mediaTiming.bySpid,
|
|
308
319
|
slideDimensions,
|
|
309
320
|
claimedPlaceholderKeys,
|
|
321
|
+
...placeholderTextLevels === void 0 ? {} : { placeholderTextLevels },
|
|
310
322
|
...layoutPlaceholders === void 0 ? {} : { layoutPlaceholders },
|
|
311
323
|
...masterPlaceholders === void 0 ? {} : { masterPlaceholders },
|
|
312
324
|
...masterTextStyles === void 0 ? {} : { masterTextStyles },
|
|
313
325
|
...layoutClrMap === void 0 ? {} : { clrMap: layoutClrMap }
|
|
314
326
|
});
|
|
315
|
-
for (const slideHandler of
|
|
316
|
-
if (slideHandler.matches !== void 0 && !slideHandler.matches(slideCursor)) continue;
|
|
327
|
+
for (const slideHandler of slideImportHandlers) {
|
|
317
328
|
const outcome = slideHandler.read({
|
|
318
329
|
slideCursor,
|
|
319
330
|
slideNode,
|
|
@@ -321,7 +332,10 @@ function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeB
|
|
|
321
332
|
slideIndex,
|
|
322
333
|
package: pkg,
|
|
323
334
|
objectBySpid,
|
|
324
|
-
omittedSpids
|
|
335
|
+
omittedSpids,
|
|
336
|
+
mediaTiming: mediaTiming.bySpid,
|
|
337
|
+
mediaSpids: mediaTiming.mediaSpids,
|
|
338
|
+
mediaTimingBranches: mediaTiming.rootBranches
|
|
325
339
|
});
|
|
326
340
|
if (outcome.diagnostics !== void 0) diagnostics.push(...outcome.diagnostics);
|
|
327
341
|
}
|
|
@@ -339,175 +353,195 @@ function readSlidePart(pkg, slidePartPath, slideIndex, usedSlideIds, layoutNodeB
|
|
|
339
353
|
*/
|
|
340
354
|
function createImporter(capabilities) {
|
|
341
355
|
const handlers = collectHandlers(capabilities);
|
|
342
|
-
return function importPptx(input, options = {}) {
|
|
356
|
+
return async function importPptx(input, options = {}) {
|
|
343
357
|
importOptionsSchema.parse(options);
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
358
|
+
return importPackage(await openPptxPackage(input, options.signal), handlers, options);
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
async function importPackage(pkg, handlers, options) {
|
|
362
|
+
const diagnostics = [...pkg.relDiagnostics];
|
|
363
|
+
const presCursor = pkg.presentationRoot;
|
|
364
|
+
consumePresentationHeaderBoilerplate(presCursor);
|
|
365
|
+
const size = readSlideSize(presCursor, diagnostics);
|
|
366
|
+
const deckNode = createDeckNode({
|
|
367
|
+
width: size.width,
|
|
368
|
+
height: size.height
|
|
369
|
+
});
|
|
370
|
+
const relById = /* @__PURE__ */ new Map();
|
|
371
|
+
for (const rel of pkg.presentationRels) relById.set(rel.Id, rel);
|
|
372
|
+
const usedDeckIds = /* @__PURE__ */ new Set();
|
|
373
|
+
const textLevelsByLayout = /* @__PURE__ */ new Map();
|
|
374
|
+
const clrMapByLayoutPartPath = /* @__PURE__ */ new Map();
|
|
375
|
+
const layoutNodeByPartPath = /* @__PURE__ */ new Map();
|
|
376
|
+
const slideIdByPartPath = /* @__PURE__ */ new Map();
|
|
377
|
+
const slideNodeByPresentationSldId = /* @__PURE__ */ new Map();
|
|
378
|
+
const deferredSlideLinks = [];
|
|
379
|
+
const registerDeferredSlideLink = (link) => {
|
|
380
|
+
deferredSlideLinks.push(link);
|
|
381
|
+
};
|
|
382
|
+
const seenDeckReaders = /* @__PURE__ */ new Set();
|
|
383
|
+
const uniqueDeckHandlers = handlers.deck.filter((handler) => {
|
|
384
|
+
if (seenDeckReaders.has(handler.read)) return false;
|
|
385
|
+
seenDeckReaders.add(handler.read);
|
|
386
|
+
return true;
|
|
387
|
+
});
|
|
388
|
+
const preSlideDeckHandlers = uniqueDeckHandlers.filter((handler) => handler.stage === "pre-slides");
|
|
389
|
+
const postSlideDeckHandlers = uniqueDeckHandlers.filter((handler) => handler.stage !== "pre-slides");
|
|
390
|
+
if (preSlideDeckHandlers.length > 0) for (const deckHandler of preSlideDeckHandlers) {
|
|
391
|
+
const outcome = deckHandler.read({
|
|
392
|
+
presentationCursor: presCursor,
|
|
393
|
+
readMasters(visualReader) {
|
|
394
|
+
if (deckNode.masters.length > 0) return {};
|
|
395
|
+
const masterDiagnostics = [];
|
|
396
|
+
const layouts = importMastersAndLayouts(presCursor, pkg, relById, deckNode, usedDeckIds, masterDiagnostics, handlers.slide, handlers.shapeTree, registerDeferredSlideLink, clrMapByLayoutPartPath, visualReader, handlers.readsFooterPlaceholders, textLevelsByLayout);
|
|
397
|
+
for (const [partPath, layout] of layouts) layoutNodeByPartPath.set(partPath, layout);
|
|
398
|
+
return masterDiagnostics.length === 0 ? {} : { diagnostics: masterDiagnostics };
|
|
399
|
+
},
|
|
400
|
+
deckNode,
|
|
401
|
+
package: pkg,
|
|
402
|
+
relById,
|
|
403
|
+
usedDeckIds,
|
|
404
|
+
slideHandlers: handlers.slide,
|
|
405
|
+
shapeTreeHandlers: handlers.shapeTree,
|
|
406
|
+
registerDeferredSlideLink,
|
|
407
|
+
layoutNodeByPartPath,
|
|
408
|
+
clrMapByLayoutPartPath,
|
|
409
|
+
existingDiagnostics: diagnostics
|
|
370
410
|
});
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
411
|
+
if (outcome.diagnostics !== void 0) diagnostics.push(...outcome.diagnostics);
|
|
412
|
+
}
|
|
413
|
+
else presCursor.child(P_NS, "sldMasterIdLst")?.suppressUnconsumed();
|
|
414
|
+
const morphScope = createMorphScope();
|
|
415
|
+
const morphHandleByToken = /* @__PURE__ */ new Map();
|
|
416
|
+
let slideCount = 0;
|
|
417
|
+
const sldIdLst = presCursor.child(P_NS, "sldIdLst");
|
|
418
|
+
if (sldIdLst !== void 0) {
|
|
419
|
+
const sldIds = sldIdLst.children(P_NS, "sldId");
|
|
420
|
+
for (let index = 0; index < sldIds.length; index += 1) {
|
|
421
|
+
if (options.signal !== void 0 && index > 0) await setImmediate();
|
|
422
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
423
|
+
const sldIdCursor = sldIds[index];
|
|
424
|
+
const rawId = sldIdCursor.attr("id");
|
|
425
|
+
const parsedSlideNumId = rawId === void 0 ? void 0 : ooxmlIntSchema.safeParse(rawId);
|
|
426
|
+
if (parsedSlideNumId !== void 0 && !parsedSlideNumId.success) diagnostics.push({
|
|
427
|
+
code: "invalid-xml-value",
|
|
428
|
+
category: "corrupt-input",
|
|
429
|
+
disposition: "recovered",
|
|
430
|
+
location: {
|
|
431
|
+
part: pkg.presentationPath,
|
|
432
|
+
xpath: `${sldIdCursor.xpath}/@id`,
|
|
433
|
+
slideIndex: index
|
|
434
|
+
},
|
|
435
|
+
attributeOrElement: "@id",
|
|
436
|
+
rawValue: rawId
|
|
386
437
|
});
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
const morphHandleByToken = /* @__PURE__ */ new Map();
|
|
392
|
-
let slideCount = 0;
|
|
393
|
-
const sldIdLst = presCursor.child(P_NS, "sldIdLst");
|
|
394
|
-
if (sldIdLst !== void 0) {
|
|
395
|
-
const sldIds = sldIdLst.children(P_NS, "sldId");
|
|
396
|
-
for (let index = 0; index < sldIds.length; index += 1) {
|
|
397
|
-
if (options.signal?.aborted) throw options.signal.reason;
|
|
398
|
-
const sldIdCursor = sldIds[index];
|
|
399
|
-
const rawId = sldIdCursor.attr("id");
|
|
400
|
-
const parsedSlideNumId = rawId === void 0 ? void 0 : ooxmlIntSchema.safeParse(rawId);
|
|
401
|
-
if (parsedSlideNumId !== void 0 && !parsedSlideNumId.success) diagnostics.push({
|
|
402
|
-
code: "invalid-xml-value",
|
|
438
|
+
const rId = sldIdCursor.attr("id", R_NS);
|
|
439
|
+
if (rId === void 0) {
|
|
440
|
+
diagnostics.push({
|
|
441
|
+
code: "broken-relationship",
|
|
403
442
|
category: "corrupt-input",
|
|
404
|
-
disposition: "
|
|
443
|
+
disposition: "omitted",
|
|
405
444
|
location: {
|
|
406
445
|
part: pkg.presentationPath,
|
|
407
|
-
xpath:
|
|
446
|
+
xpath: sldIdCursor.xpath,
|
|
408
447
|
slideIndex: index
|
|
409
448
|
},
|
|
410
|
-
|
|
411
|
-
rawValue: rawId
|
|
449
|
+
relationshipId: ""
|
|
412
450
|
});
|
|
413
|
-
|
|
414
|
-
if (rId === void 0) {
|
|
415
|
-
diagnostics.push({
|
|
416
|
-
code: "broken-relationship",
|
|
417
|
-
category: "corrupt-input",
|
|
418
|
-
disposition: "omitted",
|
|
419
|
-
location: {
|
|
420
|
-
part: pkg.presentationPath,
|
|
421
|
-
xpath: sldIdCursor.xpath,
|
|
422
|
-
slideIndex: index
|
|
423
|
-
},
|
|
424
|
-
relationshipId: ""
|
|
425
|
-
});
|
|
426
|
-
continue;
|
|
427
|
-
}
|
|
428
|
-
const rel = relById.get(rId);
|
|
429
|
-
if (rel === void 0 || rel.Type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" || rel.TargetMode === "External") {
|
|
430
|
-
diagnostics.push({
|
|
431
|
-
code: "broken-relationship",
|
|
432
|
-
category: "corrupt-input",
|
|
433
|
-
disposition: "omitted",
|
|
434
|
-
location: {
|
|
435
|
-
part: pkg.presentationPath,
|
|
436
|
-
xpath: sldIdCursor.xpath,
|
|
437
|
-
slideIndex: index
|
|
438
|
-
},
|
|
439
|
-
relationshipId: rId
|
|
440
|
-
});
|
|
441
|
-
continue;
|
|
442
|
-
}
|
|
443
|
-
const targetPart = resolvePartPath(pkg.presentationPath, rel.Target);
|
|
444
|
-
if (targetPart === void 0 || !pkg.hasPart(targetPart)) {
|
|
445
|
-
diagnostics.push({
|
|
446
|
-
code: "missing-target-part",
|
|
447
|
-
category: "corrupt-input",
|
|
448
|
-
disposition: "omitted",
|
|
449
|
-
location: {
|
|
450
|
-
part: pkg.presentationPath,
|
|
451
|
-
xpath: sldIdCursor.xpath,
|
|
452
|
-
slideIndex: index
|
|
453
|
-
},
|
|
454
|
-
relationshipId: rId,
|
|
455
|
-
targetPart: targetPart ?? rel.Target
|
|
456
|
-
});
|
|
457
|
-
continue;
|
|
458
|
-
}
|
|
459
|
-
const slideResult = readSlidePart(pkg, targetPart, index, usedDeckIds, layoutNodeByPartPath, clrMapByLayoutPartPath, handlers, registerDeferredSlideLink, morphScope, morphHandleByToken, size, diagnostics);
|
|
460
|
-
if (slideResult !== void 0) {
|
|
461
|
-
slideIdByPartPath.set(targetPart, slideResult.slideId);
|
|
462
|
-
if (parsedSlideNumId?.success) slideNodeByPresentationSldId.set(parsedSlideNumId.data, slideResult.node);
|
|
463
|
-
deckNode.append(slideResult.node);
|
|
464
|
-
slideCount += 1;
|
|
465
|
-
}
|
|
451
|
+
continue;
|
|
466
452
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
453
|
+
const rel = relById.get(rId);
|
|
454
|
+
if (rel === void 0 || rel.Type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" || rel.TargetMode === "External") {
|
|
455
|
+
diagnostics.push({
|
|
456
|
+
code: "broken-relationship",
|
|
457
|
+
category: "corrupt-input",
|
|
458
|
+
disposition: "omitted",
|
|
459
|
+
location: {
|
|
460
|
+
part: pkg.presentationPath,
|
|
461
|
+
xpath: sldIdCursor.xpath,
|
|
462
|
+
slideIndex: index
|
|
463
|
+
},
|
|
464
|
+
relationshipId: rId
|
|
465
|
+
});
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
const targetPart = resolvePartPath(pkg.presentationPath, rel.Target);
|
|
469
|
+
if (targetPart === void 0 || !pkg.hasPart(targetPart)) {
|
|
471
470
|
diagnostics.push({
|
|
472
471
|
code: "missing-target-part",
|
|
473
472
|
category: "corrupt-input",
|
|
474
473
|
disposition: "omitted",
|
|
475
|
-
location:
|
|
476
|
-
|
|
477
|
-
|
|
474
|
+
location: {
|
|
475
|
+
part: pkg.presentationPath,
|
|
476
|
+
xpath: sldIdCursor.xpath,
|
|
477
|
+
slideIndex: index
|
|
478
|
+
},
|
|
479
|
+
relationshipId: rId,
|
|
480
|
+
targetPart: targetPart ?? rel.Target
|
|
478
481
|
});
|
|
479
482
|
continue;
|
|
480
483
|
}
|
|
481
|
-
|
|
484
|
+
const slideResult = readSlidePart(pkg, targetPart, index, usedDeckIds, layoutNodeByPartPath, clrMapByLayoutPartPath, textLevelsByLayout, handlers, registerDeferredSlideLink, morphScope, morphHandleByToken, size, diagnostics);
|
|
485
|
+
if (slideResult !== void 0) {
|
|
486
|
+
slideIdByPartPath.set(targetPart, slideResult.slideId);
|
|
487
|
+
if (parsedSlideNumId?.success) slideNodeByPresentationSldId.set(parsedSlideNumId.data, slideResult.node);
|
|
488
|
+
deckNode.append(slideResult.node);
|
|
489
|
+
slideCount += 1;
|
|
490
|
+
}
|
|
482
491
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
layoutNodeByPartPath,
|
|
495
|
-
clrMapByLayoutPartPath,
|
|
496
|
-
slideNodeByPresentationSldId,
|
|
497
|
-
existingDiagnostics: diagnostics
|
|
492
|
+
}
|
|
493
|
+
for (const pending of deferredSlideLinks) {
|
|
494
|
+
const targetSlideId = slideIdByPartPath.get(pending.targetPart);
|
|
495
|
+
if (targetSlideId === void 0) {
|
|
496
|
+
diagnostics.push({
|
|
497
|
+
code: "missing-target-part",
|
|
498
|
+
category: "corrupt-input",
|
|
499
|
+
disposition: "omitted",
|
|
500
|
+
location: pending.location,
|
|
501
|
+
relationshipId: pending.relationshipId,
|
|
502
|
+
targetPart: pending.targetPart
|
|
498
503
|
});
|
|
499
|
-
|
|
504
|
+
continue;
|
|
500
505
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
506
|
+
pending.apply(targetSlideId);
|
|
507
|
+
}
|
|
508
|
+
let printMastersInspected = false;
|
|
509
|
+
for (const deckHandler of postSlideDeckHandlers) {
|
|
510
|
+
const outcome = deckHandler.read({
|
|
511
|
+
presentationCursor: presCursor,
|
|
512
|
+
readPrintMasters(reader) {
|
|
513
|
+
if (printMastersInspected) return {};
|
|
514
|
+
printMastersInspected = true;
|
|
515
|
+
const printDiagnostics = [];
|
|
516
|
+
inspectNotesAndHandoutMasters(presCursor, pkg, relById, printDiagnostics, reader);
|
|
517
|
+
return { diagnostics: printDiagnostics };
|
|
518
|
+
},
|
|
519
|
+
deckNode,
|
|
520
|
+
package: pkg,
|
|
521
|
+
relById,
|
|
522
|
+
usedDeckIds,
|
|
523
|
+
slideHandlers: handlers.slide,
|
|
524
|
+
shapeTreeHandlers: handlers.shapeTree,
|
|
525
|
+
registerDeferredSlideLink,
|
|
526
|
+
layoutNodeByPartPath,
|
|
527
|
+
clrMapByLayoutPartPath,
|
|
528
|
+
slideNodeByPresentationSldId,
|
|
529
|
+
existingDiagnostics: diagnostics
|
|
530
|
+
});
|
|
531
|
+
if (outcome.diagnostics !== void 0) diagnostics.push(...outcome.diagnostics);
|
|
532
|
+
}
|
|
533
|
+
if (!printMastersInspected) inspectNotesAndHandoutMasters(presCursor, pkg, relById, diagnostics);
|
|
534
|
+
appendUnconsumedDiagnostics(presCursor, void 0, diagnostics);
|
|
535
|
+
const report = Object.freeze({
|
|
536
|
+
evidence: "import",
|
|
537
|
+
sourceFormat: "ECMA-376 5th edition Transitional",
|
|
538
|
+
slideCount,
|
|
539
|
+
diagnostics: Object.freeze(diagnostics)
|
|
540
|
+
});
|
|
541
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
542
|
+
return {
|
|
543
|
+
document: deckNode,
|
|
544
|
+
report
|
|
511
545
|
};
|
|
512
546
|
}
|
|
513
547
|
export { createImporter };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EMU_PER_PX, emuToPx } from "../kernel/drawing-units.js";
|
|
2
|
+
import { A_NS, C_NS, DIAGRAM_NS, DSP_NS, MC_NS, P14_CREATION_ID_EXT_URI, P14_NS, P159_NS, P_NS, REL_CHART, REL_DIAGRAM_DATA, REL_DIAGRAM_DRAWING, REL_HYPERLINK, REL_IMAGE, REL_NOTES_SLIDE, REL_SLIDE, R_NS, TABLE_NS_URI, XMLNS_NS, XML_NS, canonicalQName } from "../kernel/pptx-read/namespaces.js";
|
|
3
|
+
import "../kernel/pptx-read/alternate-content.js";
|
|
4
|
+
import { ImportError, cascadedOmissionSchema, editabilityLossSchema, fatalImportIssueSchema, importDiagnosticSchema, importLocationSchema, importOptionsSchema, importReportSchema } from "../kernel/pptx-read/diagnostics.js";
|
|
5
|
+
import { XmlElementCursor, parseXmlPart } from "../kernel/pptx-read/xml-reader.js";
|
|
6
|
+
import { resolvePartPath } from "../kernel/pptx-read/opc.js";
|
|
7
|
+
import { MAXIMUM_COORDINATE_PX, MAXIMUM_WRITABLE_EMU, cascadeOoxmlTextDecoration, extentEmuFragmentSchema, hexRgb6Schema, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlListLevelSchema, ooxmlNonNegativeIntSchema, ooxmlPlaceholderRoleSchema, ooxmlPositiveFixedAngleSchema, ooxmlPositiveIntSchema, ooxmlPositiveLineWidthEmuSchema, ooxmlWritableExtentEmuSchema, ooxmlWritablePositiveExtentEmuSchema, projectOoxmlTextDecoration, readOoxmlBoxInsets, readOoxmlRunAttrStyles, readOoxmlTextDecoration, reportOoxmlTextDecorationLoss, transformAttributesFragmentSchema } from "../kernel/pptx-read/xml-fragments.js";
|
|
8
|
+
import { arrowTypeSchema, readBlipFill, readDrawingColor, readEffectList, readGradientFill, readLineBorder, readPlaceholderSpPrVisuals, readPlaceholderTransform, readRunFillAndStroke, readTransformXml } from "../kernel/pptx-read/visual.js";
|
|
9
|
+
import { allocateScopedAuthorId, appendUnconsumedDiagnostics, consumeIdentityShapeTreeBoilerplate } from "../kernel/pptx-read/shape-tree.js";
|
|
10
|
+
import { readPartThemeOverride } from "../kernel/pptx-read/themes.js";
|
|
11
|
+
import { readEmbeddedFontList, readPresentationThemeFontScheme, readRunFontSlots, unpackEotFontData } from "../kernel/pptx-read/fonts.js";
|
|
12
|
+
import { defineCanvasMechanism, defineShowMechanism } from "../kernel/pptx-read/mechanism.js";
|
|
13
|
+
import { buildRelationshipIndex, inspectUnsupportedGraphicFrame, peekShapeTreeObjectIdentity, resolveExternalRelationshipTarget, resolveInternalRelationshipTarget } from "../kernel/pptx-read/resources.js";
|
|
14
|
+
import "../kernel/pptx-read/media.js";
|
|
15
|
+
import "../kernel/pptx-read/index.js";
|
|
16
|
+
import { createImporter } from "./import.js";
|
|
17
|
+
import "./masters.js";
|
|
18
|
+
import "./notes-masters.js";
|
|
19
|
+
export { A_NS, C_NS, DIAGRAM_NS, DSP_NS, EMU_PER_PX, ImportError, MAXIMUM_COORDINATE_PX, MAXIMUM_WRITABLE_EMU, MC_NS, P14_CREATION_ID_EXT_URI, P14_NS, P159_NS, P_NS, REL_CHART, REL_DIAGRAM_DATA, REL_DIAGRAM_DRAWING, REL_HYPERLINK, REL_IMAGE, REL_NOTES_SLIDE, REL_SLIDE, R_NS, TABLE_NS_URI, XMLNS_NS, XML_NS, XmlElementCursor, allocateScopedAuthorId, appendUnconsumedDiagnostics, arrowTypeSchema, buildRelationshipIndex, canonicalQName, cascadeOoxmlTextDecoration, cascadedOmissionSchema, consumeIdentityShapeTreeBoilerplate, createImporter, defineCanvasMechanism, defineShowMechanism, editabilityLossSchema, emuToPx, extentEmuFragmentSchema, fatalImportIssueSchema, hexRgb6Schema, importDiagnosticSchema, importLocationSchema, importOptionsSchema, importReportSchema, inspectUnsupportedGraphicFrame, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlIntSchema, ooxmlListLevelSchema, ooxmlNonNegativeIntSchema, ooxmlPlaceholderRoleSchema, ooxmlPositiveFixedAngleSchema, ooxmlPositiveIntSchema, ooxmlPositiveLineWidthEmuSchema, ooxmlWritableExtentEmuSchema, ooxmlWritablePositiveExtentEmuSchema, parseXmlPart, peekShapeTreeObjectIdentity, projectOoxmlTextDecoration, readBlipFill, readDrawingColor, readEffectList, readEmbeddedFontList, readGradientFill, readLineBorder, readOoxmlBoxInsets, readOoxmlRunAttrStyles, readOoxmlTextDecoration, readPartThemeOverride, readPlaceholderSpPrVisuals, readPlaceholderTransform, readPresentationThemeFontScheme, readRunFillAndStroke, readRunFontSlots, readTransformXml, reportOoxmlTextDecorationLoss, resolveExternalRelationshipTarget, resolveInternalRelationshipTarget, resolvePartPath, transformAttributesFragmentSchema, unpackEotFontData };
|