@officedk/pptxdk 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.d.ts +5 -8
- package/dist/build.js +44 -52
- package/dist/core/dist/capabilities/audio/audio-declaration.js +7 -0
- package/dist/core/dist/capabilities/audio/audio-source.js +172 -0
- package/dist/core/dist/capabilities/audio/entry.js +122 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box-codegen.js +7 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box-declaration.js +8 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box.js +14 -15
- package/dist/core/dist/capabilities/box/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-codegen.js +11 -18
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-import.js +891 -468
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-labels.js +30 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-model.js +1 -1
- package/dist/{capabilities/dist/chart/preview/number-format.js → core/dist/capabilities/chart/chart-number-format.js} +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-schemas.js +73 -79
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-xml.js +41 -36
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart.js +175 -113
- package/dist/core/dist/capabilities/chart/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/axes-and-grid.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/bar-column.js +1 -1
- package/dist/core/dist/capabilities/chart/preview/data-labels.js +474 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/error-bars.js +3 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/index.js +28 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/layout.js +7 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/legend.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/line-area.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/markers.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/pie-doughnut.js +39 -60
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scales.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scatter.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/style.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/text-render.js +34 -24
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/trendlines.js +3 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/types.js +1 -1
- package/dist/core/dist/capabilities/comment/comment-codegen.js +25 -0
- package/dist/core/dist/capabilities/comment/comment-declaration.js +37 -0
- package/dist/core/dist/capabilities/comment/comment-import.js +176 -0
- package/dist/core/dist/capabilities/comment/comment.js +141 -0
- package/dist/core/dist/capabilities/comment/entry.js +1 -0
- package/dist/core/dist/capabilities/footer-placeholder/entry.js +2 -0
- package/dist/core/dist/capabilities/footer-placeholder/footer-placeholder-codegen.js +16 -0
- package/dist/{capabilities/dist/masters → core/dist/capabilities/footer-placeholder}/footer-placeholder.js +113 -50
- package/dist/core/dist/capabilities/footer-placeholder/print-header-footer-import.js +121 -0
- package/dist/core/dist/capabilities/footer-placeholder/print-header-footer.js +123 -0
- package/dist/core/dist/capabilities/group/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-codegen.js +6 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-declaration.js +8 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-import.js +36 -77
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group.js +17 -17
- package/dist/core/dist/capabilities/image/entry.js +4 -0
- package/dist/core/dist/capabilities/image/image-codegen.js +59 -0
- package/dist/core/dist/capabilities/image/image-declaration.js +8 -0
- package/dist/core/dist/capabilities/image/image-import.js +26 -0
- package/dist/core/dist/capabilities/image/image.js +57 -0
- package/dist/core/dist/capabilities/line/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-codegen.js +6 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-declaration.js +15 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-import.js +15 -95
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line.js +41 -43
- package/dist/core/dist/capabilities/masters/entry.js +1 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters-codegen.js +7 -26
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters.js +23 -35
- package/dist/core/dist/capabilities/motion/entry.js +5 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-codegen.js +15 -35
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-import.js +25 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-plan.js +17 -14
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-query.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion.js +79 -75
- package/dist/core/dist/capabilities/notes/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-codegen.js +4 -5
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-import.js +16 -13
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-schemas.js +6 -6
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes.js +16 -41
- package/dist/{import/dist/sections.js → core/dist/capabilities/notes/sections-import.js} +5 -5
- package/dist/core/dist/capabilities/placeholder/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder-codegen.js +5 -15
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder-schemas.js +7 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder.js +50 -107
- package/dist/core/dist/capabilities/shape/entry.js +6 -0
- package/dist/core/dist/capabilities/shape/shape-codegen.js +112 -0
- package/dist/core/dist/capabilities/shape/shape-import.js +152 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape.js +44 -30
- package/dist/core/dist/capabilities/shared/container-slots.js +59 -0
- package/dist/core/dist/capabilities/shared/date-time.js +98 -0
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-embedding.js +5 -6
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-engine.js +34 -13
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-import.js +62 -23
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-subset.js +24 -9
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font.js +4 -4
- package/dist/core/dist/capabilities/shared/geometry-codegen.js +101 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/geometry.js +47 -44
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/identity.js +56 -38
- package/dist/core/dist/capabilities/shared/image-codegen.js +94 -0
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-decode.js +17 -79
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-schemas.js +16 -26
- package/dist/core/dist/capabilities/shared/line-match.js +78 -0
- package/dist/core/dist/capabilities/shared/media-codegen.js +86 -0
- package/dist/core/dist/capabilities/shared/media-import.js +156 -0
- package/dist/core/dist/capabilities/shared/media-placement.js +20 -0
- package/dist/core/dist/capabilities/shared/media-poster.js +50 -0
- package/dist/core/dist/capabilities/shared/media-schemas.js +60 -0
- package/dist/core/dist/capabilities/shared/media-source.js +107 -0
- package/dist/core/dist/capabilities/shared/media-trim.js +102 -0
- package/dist/core/dist/capabilities/shared/media.js +134 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/morph-api.js +5 -5
- package/dist/{capabilities/dist/motion → core/dist/capabilities/shared}/motion-api.js +112 -99
- package/dist/{capabilities/dist/motion → core/dist/capabilities/shared}/motion-schemas.js +19 -5
- package/dist/{capabilities/dist/image/image-import.js → core/dist/capabilities/shared/picture-import.js} +97 -158
- package/dist/core/dist/capabilities/shared/picture-xml.js +13 -0
- package/dist/core/dist/capabilities/shared/picture.js +510 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/placeholder-import.js +50 -20
- package/dist/core/dist/capabilities/shared/placeholder-roles.js +42 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/preset-definitions.js +1 -1
- package/dist/core/dist/capabilities/shared/print-xml.js +77 -0
- package/dist/{capabilities/dist/text/text-codegen.js → core/dist/capabilities/shared/rich-text-codegen.js} +23 -102
- package/dist/core/dist/capabilities/shared/rich-text-import.js +472 -0
- package/dist/{capabilities/dist/shape → core/dist/capabilities/shared}/shape-declaration.js +14 -14
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/style-inheritance.js +12 -5
- package/dist/{capabilities/dist/text → core/dist/capabilities/shared}/text-declaration.js +7 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/text-schemas.js +77 -77
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/text-service.js +571 -260
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/visual.js +137 -112
- package/dist/core/dist/capabilities/slide-background/entry.js +1 -0
- package/dist/core/dist/capabilities/slide-background/slide-background-codegen.js +15 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-import.js +5 -5
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-xml.js +2 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background.js +27 -33
- package/dist/core/dist/capabilities/table/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-codegen.js +6 -13
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-import.js +22 -57
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-schemas.js +40 -37
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-xml.js +9 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table.js +60 -45
- package/dist/core/dist/capabilities/text/entry.js +3 -0
- package/dist/core/dist/capabilities/text/text-codegen.js +66 -0
- package/dist/core/dist/capabilities/text/text-import.js +468 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/text/text-xml.js +3 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/text/text.js +61 -54
- package/dist/core/dist/capabilities/transition/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-api.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-codegen.js +2 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-import.js +25 -27
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition.js +23 -23
- package/dist/core/dist/capabilities/video/entry.js +77 -0
- package/dist/core/dist/capabilities/video/video-declaration.js +7 -0
- package/dist/core/dist/capabilities/video/video-source.js +42 -0
- package/dist/{codegen/dist → core/dist/codegen}/assets.js +13 -8
- package/dist/{codegen/dist → core/dist/codegen}/codegen.js +54 -122
- package/dist/{codegen/dist → core/dist/codegen}/identifiers.js +17 -1
- package/dist/{codegen/dist → core/dist/codegen}/index.js +2 -2
- package/dist/{codegen/dist → core/dist/codegen}/printer.js +23 -4
- package/dist/core/dist/document/all.js +41 -0
- package/dist/core/dist/document/default.js +10 -0
- package/dist/core/dist/document/document.js +218 -0
- package/dist/core/dist/document/index.js +62 -0
- package/dist/core/dist/document/stages.js +54 -0
- package/dist/{emit/dist → core/dist/emit}/emit.js +122 -60
- package/dist/core/dist/emit/index.js +6 -0
- package/dist/core/dist/emit/ooxml.js +241 -0
- package/dist/{import/dist → core/dist/import}/import.js +221 -187
- package/dist/core/dist/import/index.js +19 -0
- package/dist/{import/dist → core/dist/import}/masters.js +253 -317
- package/dist/core/dist/import/media-timing.js +233 -0
- package/dist/{import/dist → core/dist/import}/notes-masters.js +48 -45
- package/dist/core/dist/index.js +47 -15
- package/dist/core/dist/{author-ids.js → kernel/author-ids.js} +1 -1
- package/dist/core/dist/{author-schemas.js → kernel/author-schemas.js} +59 -98
- package/dist/core/dist/{block-flex-layout.js → kernel/block-flex-layout.js} +109 -78
- package/dist/core/dist/kernel/build.js +4 -0
- package/dist/core/dist/kernel/capability.js +17 -0
- package/dist/{codegen/dist/types.js → core/dist/kernel/codegen.js} +22 -2
- package/dist/core/dist/kernel/container-slots.js +104 -0
- package/dist/core/dist/kernel/date-time-format.js +18 -0
- package/dist/core/dist/kernel/declaration-snapshot.js +68 -0
- package/dist/core/dist/{declaration.js → kernel/declaration.js} +1 -1
- package/dist/core/dist/{diagnostics.js → kernel/diagnostics.js} +22 -5
- package/dist/core/dist/{document-internals.js → kernel/document-internals.js} +1 -1
- package/dist/core/dist/{document.js → kernel/document.js} +6 -5
- package/dist/core/dist/kernel/drawing-units.js +14 -0
- package/dist/core/dist/{font-seal.js → kernel/font-seal.js} +2 -2
- package/dist/core/dist/{geometry-schemas.js → kernel/geometry-schemas.js} +2 -6
- package/dist/core/dist/{grid-layout.js → kernel/grid-layout.js} +156 -55
- package/dist/core/dist/{host.js → kernel/host.js} +1 -1
- package/dist/core/dist/kernel/index.js +24 -0
- package/dist/core/dist/{input-values.js → kernel/input-values.js} +4 -3
- package/dist/core/dist/kernel/layout-definition.js +7 -0
- package/dist/core/dist/{layout-protocol.js → kernel/layout-protocol.js} +1 -1
- package/dist/core/dist/{layout-schemas.js → kernel/layout-schemas.js} +2 -6
- package/dist/core/dist/{layout.js → kernel/layout.js} +37 -38
- package/dist/core/dist/{masters.js → kernel/masters.js} +32 -55
- package/dist/core/dist/{morph.js → kernel/morph.js} +1 -1
- package/dist/core/dist/{placeholders.js → kernel/placeholders.js} +23 -9
- package/dist/{import/dist → core/dist/kernel/pptx-read}/alternate-content.js +1 -1
- package/dist/{import/dist → core/dist/kernel/pptx-read}/diagnostics.js +1 -1
- package/dist/core/dist/kernel/pptx-read/drawing-list-import.js +251 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/fonts.js +1 -1
- package/dist/core/dist/kernel/pptx-read/index.js +15 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/mechanism.js +1 -1
- package/dist/core/dist/kernel/pptx-read/media.js +26 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/namespaces.js +5 -7
- package/dist/{import/dist → core/dist/kernel/pptx-read}/opc.js +62 -13
- package/dist/{import/dist → core/dist/kernel/pptx-read}/resources.js +1 -1
- package/dist/core/dist/kernel/pptx-read/shape-tree.js +57 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/themes.js +40 -5
- package/dist/{import/dist → core/dist/kernel/pptx-read}/visual.js +94 -67
- package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-fragments.js +56 -13
- package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-reader.js +8 -1
- package/dist/{emit/dist → core/dist/kernel/pptx-write}/shape-tree.js +1 -1
- package/dist/core/dist/kernel/pptx-write/timing.js +52 -0
- package/dist/{emit/dist/ooxml.js → core/dist/kernel/pptx-write/xml.js} +62 -274
- package/dist/core/dist/{query.js → kernel/query.js} +5 -1
- package/dist/core/dist/{resolution.js → kernel/resolution.js} +1 -1
- package/dist/core/dist/kernel/resolve-work.js +58 -0
- package/dist/core/dist/{resolve.js → kernel/resolve.js} +226 -257
- package/dist/core/dist/kernel/resource-source.js +11 -0
- package/dist/core/dist/{stage-options.js → kernel/stage-options.js} +23 -11
- package/dist/core/dist/{theme.js → kernel/theme.js} +54 -36
- package/dist/core/dist/{transform-geometry.js → kernel/transform-geometry.js} +1 -1
- package/dist/core/dist/kernel/xml-values.js +13 -0
- package/dist/{document-41spD7bq.d.ts → document-C0lPlH-L.d.ts} +614 -522
- package/dist/{capability-BbKW9w4O.d.ts → index-B9_OUeA-.d.ts} +660 -553
- package/dist/{index-BEwhk7c8.d.ts → index-BJEzQxWV.d.ts} +27 -24
- package/dist/{index-cK2KtukZ.d.ts → index-DA9flrlR.d.ts} +2 -17
- package/dist/{index-v77CTJev.d.ts → index-GSt0t9VO.d.ts} +3 -4
- package/dist/index.d.ts +7 -8
- package/dist/index.js +68 -66
- package/dist/node.d.ts +16 -14
- package/dist/node.js +86 -43
- package/dist/pptxdk/src/cli-commands.js +9 -5
- package/dist/pptxdk/src/compose.js +28 -29
- package/dist/pptxdk/src/preview-result.js +24 -0
- package/dist/{capabilities/dist/image → preview/dist}/gif-decoder.js +5 -5
- package/dist/preview/dist/index.js +84 -34
- package/dist/preview/dist/options.js +8 -4
- package/dist/preview/dist/raster.js +66 -0
- package/dist/preview/dist/svg-guard.js +8 -7
- package/dist/preview.d.ts +3 -9
- package/dist/preview.js +7 -25
- package/dist/react/dist/append.js +3 -3
- package/dist/react/dist/author/audio-elements.js +14 -0
- package/dist/{capabilities/dist/box → react/dist/author}/box-elements.js +5 -3
- package/dist/react/dist/author/chart-elements.js +14 -0
- package/dist/react/dist/author/comment-elements.js +15 -0
- package/dist/react/dist/author/group-elements.js +14 -0
- package/dist/react/dist/author/image-elements.js +14 -0
- package/dist/react/dist/author/line-elements.js +14 -0
- package/dist/{capabilities/dist/motion → react/dist/author}/motion-elements.js +6 -4
- package/dist/react/dist/author/notes-elements.js +14 -0
- package/dist/react/dist/author/placeholder-elements.js +14 -0
- package/dist/react/dist/author/shape-elements.js +14 -0
- package/dist/{capabilities/dist/table → react/dist/author}/table-elements.js +6 -4
- package/dist/{capabilities/dist/text → react/dist/author}/text-elements.js +15 -5
- package/dist/react/dist/author/video-elements.js +14 -0
- package/dist/react/dist/document-adapter.js +4 -4
- package/dist/react/dist/elements.js +7 -4
- package/dist/react/dist/from-vanilla.js +3 -3
- package/dist/react/dist/index.js +17 -3
- package/dist/react/dist/reconciler.js +3 -3
- package/dist/react.d.ts +103 -69
- package/dist/react.js +28 -28
- package/dist/{index-1ag7U9Jt.d.ts → stages-DYHSHKt4.d.ts} +23 -6
- package/dist/vanilla.d.ts +4 -4
- package/dist/vanilla.js +14 -15
- package/package.json +2 -5
- package/dist/build-zrZuX4fK.d.ts +0 -3
- package/dist/capabilities/dist/all.js +0 -34
- package/dist/capabilities/dist/chart/chart-elements.js +0 -12
- package/dist/capabilities/dist/chart/preview/data-labels.js +0 -334
- package/dist/capabilities/dist/document.js +0 -168
- package/dist/capabilities/dist/group/group-elements.js +0 -12
- package/dist/capabilities/dist/image/image-codegen.js +0 -164
- package/dist/capabilities/dist/image/image-declaration.js +0 -8
- package/dist/capabilities/dist/image/image-elements.js +0 -12
- package/dist/capabilities/dist/image/image-xml.js +0 -12
- package/dist/capabilities/dist/image/image.js +0 -552
- package/dist/capabilities/dist/line/line-elements.js +0 -12
- package/dist/capabilities/dist/notes/notes-elements.js +0 -12
- package/dist/capabilities/dist/notes/notes-xml.js +0 -38
- package/dist/capabilities/dist/placeholder/placeholder-elements.js +0 -13
- package/dist/capabilities/dist/shape/shape-codegen.js +0 -236
- package/dist/capabilities/dist/shape/shape-elements.js +0 -12
- package/dist/capabilities/dist/shape/shape-import.js +0 -628
- package/dist/capabilities/dist/slide-background/slide-background-codegen.js +0 -44
- package/dist/capabilities/dist/text/text-import.js +0 -1224
- package/dist/core/dist/build.js +0 -4
- package/dist/core/dist/capability.js +0 -15
- package/dist/emit/dist/index.js +0 -5
- package/dist/import/dist/index.js +0 -16
- package/dist/pptxdk/src/slide.js +0 -9
- package/dist/transition-6n8GZxSg.d.ts +0 -9
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { maximumTimeNodeValue, spinAngleSchema } from "
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
// ../
|
|
1
|
+
import { after, appear, breathe, collapse, createMotionScopeHandle, createMotionScopeNode, createMotionStepIdentity, createMotionStepNode, disappear, fade, fadeOut, fillColor, floatDown, floatOut, floatUp, fly, flyOut, onStep, relativeLuminance, repeat, spin, spinIn, spinOut, stretch, wipe, wipeOut, zoom, zoomOut } from "../shared/motion-api.js";
|
|
2
|
+
import { maximumTimeNodeValue, spinAngleSchema } from "../shared/motion-schemas.js";
|
|
3
|
+
import { A_NS, P_NS } from "../../kernel/pptx-read/namespaces.js";
|
|
4
|
+
import { ooxmlNonNegativeIntSchema, ooxmlPositiveIntSchema } from "../../kernel/pptx-read/xml-fragments.js";
|
|
5
|
+
import { createParagraphNode } from "../shared/text-declaration.js";
|
|
6
|
+
import { CommonContainer, CommonNode, RichTextContainer } from "../../kernel/document.js";
|
|
7
|
+
import "../../kernel/pptx-read/index.js";
|
|
8
|
+
// ../core/dist/capabilities/motion/motion-import.js
|
|
9
9
|
const supportedBehaviorNames = /* @__PURE__ */ new Set([
|
|
10
10
|
"set",
|
|
11
11
|
"anim",
|
|
@@ -516,6 +516,7 @@ function readSlideMotionImport(context) {
|
|
|
516
516
|
const rootChildTnLst = rootCTn.child(P_NS, "childTnLst");
|
|
517
517
|
let mainSeq;
|
|
518
518
|
if (rootChildTnLst !== void 0) for (const childSeq of rootChildTnLst.children(P_NS, "seq")) {
|
|
519
|
+
if (context.mediaTimingBranches?.has(childSeq.element)) continue;
|
|
519
520
|
childSeq.consumeAttr("concurrent");
|
|
520
521
|
childSeq.consumeAttr("nextAc");
|
|
521
522
|
const seqCTn = childSeq.child(P_NS, "cTn");
|
|
@@ -670,7 +671,7 @@ function readSlideMotionImport(context) {
|
|
|
670
671
|
});
|
|
671
672
|
return timingId;
|
|
672
673
|
};
|
|
673
|
-
const stepPars = mainSeqChildren.children(P_NS, "par");
|
|
674
|
+
const stepPars = mainSeqChildren.children(P_NS, "par").filter((child) => !context.mediaTimingBranches?.has(child.element));
|
|
674
675
|
for (let stepIndex = 0; stepIndex < stepPars.length; stepIndex += 1) {
|
|
675
676
|
const stepPar = stepPars[stepIndex];
|
|
676
677
|
const stepCTn = stepPar.child(P_NS, "cTn");
|
|
@@ -736,6 +737,21 @@ function readSlideMotionImport(context) {
|
|
|
736
737
|
rawNode.cursor.suppressUnconsumed();
|
|
737
738
|
continue;
|
|
738
739
|
}
|
|
740
|
+
const mediaTarget = rawNode.targetIds.find((id) => context.mediaSpids?.has(id));
|
|
741
|
+
if (mediaTarget !== void 0) {
|
|
742
|
+
rootDiagnosticByNodeId.set(timingId, {
|
|
743
|
+
code: "unsupported-mechanism",
|
|
744
|
+
category: "unsupported",
|
|
745
|
+
disposition: "omitted",
|
|
746
|
+
location: locationFor(context, rawNode.xpath, mediaTarget),
|
|
747
|
+
namespaceUri: P_NS,
|
|
748
|
+
localName: "spTgt",
|
|
749
|
+
mechanismHint: "graphic-motion-on-media"
|
|
750
|
+
});
|
|
751
|
+
omittedNodeIds.add(timingId);
|
|
752
|
+
rawNode.cursor.suppressUnconsumed();
|
|
753
|
+
continue;
|
|
754
|
+
}
|
|
739
755
|
const missingTargetId = rawNode.targetIds.find((id) => !isKnownSlideTarget(id));
|
|
740
756
|
if (rawNode.targetIds.length !== 1 || missingTargetId !== void 0) {
|
|
741
757
|
const omittedInfo = missingTargetId === void 0 ? void 0 : context.omittedSpids?.get(missingTargetId);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CapabilityError } from "
|
|
2
|
-
import "
|
|
3
|
-
import { maximumTimeNodeValue } from "
|
|
4
|
-
import "
|
|
1
|
+
import { CapabilityError } from "../../kernel/diagnostics.js";
|
|
2
|
+
import "../shared/motion-api.js";
|
|
3
|
+
import { maximumTimeNodeValue } from "../shared/motion-schemas.js";
|
|
4
|
+
import "../../kernel/capability.js";
|
|
5
5
|
import { createMotionQuery } from "./motion-query.js";
|
|
6
|
-
// ../
|
|
6
|
+
// ../core/dist/capabilities/motion/motion-plan.js
|
|
7
7
|
function planStartForGate(gate) {
|
|
8
8
|
switch (gate.kind) {
|
|
9
9
|
case "parent-start": return {
|
|
@@ -19,6 +19,7 @@ function planStartForGate(gate) {
|
|
|
19
19
|
dependency: gate.dependency
|
|
20
20
|
};
|
|
21
21
|
case "plan-start": return gate.start;
|
|
22
|
+
default: return gate;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
function gateSourceDependencies(gate) {
|
|
@@ -101,8 +102,8 @@ function composeMotionPlanStarts(inherited, child) {
|
|
|
101
102
|
if (child.kind === "condition-end") return;
|
|
102
103
|
return addMotionPlanStartDelay(inherited, child.delayMs);
|
|
103
104
|
}
|
|
104
|
-
function fail(code, message, path) {
|
|
105
|
-
throw new CapabilityError(code, message, path);
|
|
105
|
+
function fail(code, message, path, field) {
|
|
106
|
+
throw new CapabilityError(code, message, path, { field });
|
|
106
107
|
}
|
|
107
108
|
function isRecord(value) {
|
|
108
109
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -449,7 +450,7 @@ function expansionFor(target, effect, path) {
|
|
|
449
450
|
count: 1
|
|
450
451
|
};
|
|
451
452
|
if (effect.by === "word" || effect.by === "letter") {
|
|
452
|
-
if (!target.textBody || !target.paragraphCount) fail("invalid-motion-granularity", `by: "${effect.by}" requires native object with text`, path);
|
|
453
|
+
if (!target.textBody || !target.paragraphCount) fail("invalid-motion-granularity", `by: "${effect.by}" requires native object with text`, path, `${effect.authorField}.by`);
|
|
453
454
|
return {
|
|
454
455
|
type: "iterate",
|
|
455
456
|
count: 1,
|
|
@@ -459,7 +460,7 @@ function expansionFor(target, effect, path) {
|
|
|
459
460
|
}
|
|
460
461
|
if (effect.by === "paragraph") {
|
|
461
462
|
const count = target.paragraphCount ?? 0;
|
|
462
|
-
if (!target.textBody || count < 1) fail("invalid-motion-granularity", "by: \"paragraph\" requires native text object with paragraphs", path);
|
|
463
|
+
if (!target.textBody || count < 1) fail("invalid-motion-granularity", "by: \"paragraph\" requires native text object with paragraphs", path, `${effect.authorField}.by`);
|
|
463
464
|
return {
|
|
464
465
|
type: "parts",
|
|
465
466
|
count,
|
|
@@ -471,7 +472,7 @@ function expansionFor(target, effect, path) {
|
|
|
471
472
|
};
|
|
472
473
|
}
|
|
473
474
|
const pointCounts = target.chartSeriesPointCounts ?? [];
|
|
474
|
-
if (target.kind !== "chart") fail("invalid-motion-granularity", `by: "${effect.by}" requires native chart`, path);
|
|
475
|
+
if (target.kind !== "chart") fail("invalid-motion-granularity", `by: "${effect.by}" requires native chart`, path, `${effect.authorField}.by`);
|
|
475
476
|
const pointCount = Math.max(0, ...pointCounts);
|
|
476
477
|
let dataRanges;
|
|
477
478
|
if (effect.by === "series") dataRanges = pointCounts.map((_, seriesIndex) => ({
|
|
@@ -527,7 +528,7 @@ function effectTimingAt(startExpression, target, effect, effectIndex, partIndex,
|
|
|
527
528
|
};
|
|
528
529
|
const rounds = effect.repeatCount ?? 1;
|
|
529
530
|
const durationMs = Math.round(effect.duration) * rounds;
|
|
530
|
-
if (start.state === "known" && !Number.isSafeInteger(start.timeMs + durationMs)) fail("invalid-motion-time", "Effect completion moment must be a safe integer in milliseconds", target.path);
|
|
531
|
+
if (start.state === "known" && !Number.isSafeInteger(start.timeMs + durationMs)) fail("invalid-motion-time", "Effect completion moment must be a safe integer in milliseconds", target.path, `${effect.authorField}.duration`);
|
|
531
532
|
const dependency = {
|
|
532
533
|
targetId: target.id,
|
|
533
534
|
effectIndex,
|
|
@@ -625,7 +626,9 @@ function motionPlan(contributions) {
|
|
|
625
626
|
const granularities = new Set(target.value.effects.map(({ by }) => by).filter((by) => typeof by === "string"));
|
|
626
627
|
const textGranularities = [...granularities].filter((by) => by === "paragraph" || by === "word" || by === "letter");
|
|
627
628
|
const chartGranularities = [...granularities].filter((by) => by === "series" || by === "category" || by === "seriesElements" || by === "categoryElements");
|
|
628
|
-
|
|
629
|
+
const conflictingGranularity = (target.value.target.kind === "chart" ? chartGranularities : textGranularities)[1];
|
|
630
|
+
const conflictingEffect = conflictingGranularity === void 0 ? void 0 : target.value.effects.find(({ by }) => by === conflictingGranularity);
|
|
631
|
+
if (conflictingEffect !== void 0) fail("invalid-motion-granularity", "Parallel motions on the same native object cannot mix incompatible build granularities", target.path, `${conflictingEffect.authorField}.by`);
|
|
629
632
|
}
|
|
630
633
|
for (const scope of scopes.values()) {
|
|
631
634
|
const parentId = scope.declaration.parent;
|
|
@@ -1215,7 +1218,7 @@ function motionPlan(contributions) {
|
|
|
1215
1218
|
}, candidate.offsetMs - exactParentOffset);
|
|
1216
1219
|
if (lowered !== void 0) return lowered;
|
|
1217
1220
|
}
|
|
1218
|
-
fail("unknown-motion-start", "Unknown start has no provable parent activation or completion event source", path);
|
|
1221
|
+
return fail("unknown-motion-start", "Unknown start has no provable parent activation or completion event source", path);
|
|
1219
1222
|
};
|
|
1220
1223
|
const unwrapImplicitReportedDependencies = (dependency, seen = /* @__PURE__ */ new Set()) => {
|
|
1221
1224
|
if (!("scopeId" in dependency)) return [dependency];
|
|
@@ -1468,7 +1471,7 @@ function motionPlan(contributions) {
|
|
|
1468
1471
|
const cached = starts.get(scope.declaration.identity);
|
|
1469
1472
|
if (cached !== void 0) return cached;
|
|
1470
1473
|
if (resolvingStarts.has(scope.declaration.identity)) fail("motion-cycle", "Choreography moment dependencies contain a cycle", scope.path);
|
|
1471
|
-
if (scope.declaration.delay > 4294967295) fail("invalid-motion-time", "Single scope delay field exceeds ST_TLTime range", scope.path);
|
|
1474
|
+
if (scope.declaration.delay > 4294967295) fail("invalid-motion-time", "Single scope delay field exceeds ST_TLTime range", scope.path, "delay");
|
|
1472
1475
|
resolvingStarts.add(scope.declaration.identity);
|
|
1473
1476
|
let parentStart = origin;
|
|
1474
1477
|
let parentScope;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BuildQueryError, resolveSlideFromLocator } from "
|
|
2
|
-
// ../
|
|
1
|
+
import { BuildQueryError, resolveSlideFromLocator } from "../../kernel/query.js";
|
|
2
|
+
// ../core/dist/capabilities/motion/motion-query.js
|
|
3
3
|
const referenceOwners = /* @__PURE__ */ new WeakMap();
|
|
4
4
|
const queryByObservation = /* @__PURE__ */ new WeakMap();
|
|
5
5
|
function frozenRef(value, owner) {
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { CapabilityError } from "
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
import {
|
|
7
|
-
import "
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { CapabilityError, zodIssueField } from "../../kernel/diagnostics.js";
|
|
2
|
+
import { pxToEmu } from "../../kernel/drawing-units.js";
|
|
3
|
+
import { resolvePlaceholderBoxFromLayers } from "../../kernel/placeholders.js";
|
|
4
|
+
import { motionSlots } from "../shared/container-slots.js";
|
|
5
|
+
import { ownerMotionSchema, spinOptionsSchema } from "../shared/motion-schemas.js";
|
|
6
|
+
import { after, appear, breathe, collapse, createMotionScopeHandle, disappear, fade, fadeOut, fillColor, floatDown, floatOut, floatUp, fly, flyOut, motionScopeAnnotation, motionStepAnnotation, onStep, repeat, spin, spinIn, spinOut, stretch, wipe, wipeOut, zoom, zoomOut } from "../shared/motion-api.js";
|
|
7
|
+
import { defineShowMechanism } from "../../kernel/pptx-read/mechanism.js";
|
|
8
|
+
import "../../kernel/capability.js";
|
|
9
|
+
import "../../kernel/pptx-read/index.js";
|
|
10
|
+
import { createTimingIds } from "../../kernel/pptx-write/timing.js";
|
|
11
|
+
import { xmlEscape } from "../../kernel/pptx-write/xml.js";
|
|
10
12
|
import { motionCodegen } from "./motion-codegen.js";
|
|
11
13
|
import { readSlideMotionImport } from "./motion-import.js";
|
|
12
14
|
import { addMotionPlanStartDelay, compileMotionPlan, composeMotionPlanStarts, motionPlanStartLayers } from "./motion-plan.js";
|
|
13
15
|
import { motionSchedule, registerMotionObservation } from "./motion-query.js";
|
|
14
|
-
// ../
|
|
16
|
+
// ../core/dist/capabilities/motion/motion.js
|
|
15
17
|
function invalidMotionTime(field) {
|
|
16
18
|
throw new CapabilityError("invalid-motion-time", `${field} must be an exact non-negative integer in milliseconds, and must not exceed ST_TLTime range when written`);
|
|
17
19
|
}
|
|
@@ -47,12 +49,6 @@ function element(name, attributes, ...children) {
|
|
|
47
49
|
return ` ${key}="${xmlEscape(String(typeof value === "boolean" ? value ? "1" : "0" : value))}"`;
|
|
48
50
|
}).join("")}>${children.filter(Boolean).join("")}</${name}>`;
|
|
49
51
|
}
|
|
50
|
-
function createTimingIds() {
|
|
51
|
-
let next = 1;
|
|
52
|
-
return { take() {
|
|
53
|
-
return next++;
|
|
54
|
-
} };
|
|
55
|
-
}
|
|
56
52
|
function timingTarget(effect, range = effect.target.range, background = false) {
|
|
57
53
|
return element("p:tgtEl", void 0, element("p:spTgt", { spid: effect.target.id }, background ? element("p:bg", void 0) : void 0, range?.type === "paragraph" ? element("p:txEl", void 0, element("p:pRg", {
|
|
58
54
|
st: range.start,
|
|
@@ -63,14 +59,17 @@ function timingTarget(effect, range = effect.target.range, background = false) {
|
|
|
63
59
|
bldStep: range.step
|
|
64
60
|
})) : void 0));
|
|
65
61
|
}
|
|
62
|
+
const nativeChartBuildBy = {
|
|
63
|
+
series: "series",
|
|
64
|
+
category: "category",
|
|
65
|
+
seriesElements: "seriesEl",
|
|
66
|
+
categoryElements: "categoryEl",
|
|
67
|
+
paragraph: void 0,
|
|
68
|
+
word: void 0,
|
|
69
|
+
letter: void 0
|
|
70
|
+
};
|
|
66
71
|
function nativeChartBuild(by) {
|
|
67
|
-
|
|
68
|
-
case "series": return "series";
|
|
69
|
-
case "category": return "category";
|
|
70
|
-
case "seriesElements": return "seriesEl";
|
|
71
|
-
case "categoryElements": return "categoryEl";
|
|
72
|
-
default: return;
|
|
73
|
-
}
|
|
72
|
+
return typeof by === "string" ? nativeChartBuildBy[by] : void 0;
|
|
74
73
|
}
|
|
75
74
|
function attributeNames(value) {
|
|
76
75
|
return element("p:attrNameLst", void 0, element("p:attrName", void 0, value));
|
|
@@ -275,7 +274,24 @@ function behaviorIds(effect, ids, dimensions, mixedShapeText) {
|
|
|
275
274
|
const fromY = effect.preset === "floatDown" ? -.1 : .1;
|
|
276
275
|
return [singleMotion("ppt_x", 0, 0, "sum", targetElement), singleMotion("ppt_y", fromY, 0, "sum", targetElement)];
|
|
277
276
|
}
|
|
278
|
-
|
|
277
|
+
case "appear":
|
|
278
|
+
case "fade":
|
|
279
|
+
case "wipe":
|
|
280
|
+
case "spin":
|
|
281
|
+
case "breathe":
|
|
282
|
+
case "fillColor":
|
|
283
|
+
case "disappear":
|
|
284
|
+
case "fadeOut":
|
|
285
|
+
case "wipeOut":
|
|
286
|
+
case "flyOut":
|
|
287
|
+
case "zoomOut":
|
|
288
|
+
case "floatOut":
|
|
289
|
+
case "spinOut":
|
|
290
|
+
case "collapse": return [];
|
|
291
|
+
default: {
|
|
292
|
+
const exhaustive = effect.preset;
|
|
293
|
+
throw new Error(`Unsupported mixed-shape effect: ${String(exhaustive)}`);
|
|
294
|
+
}
|
|
279
295
|
}
|
|
280
296
|
};
|
|
281
297
|
const primaryBehaviors = () => {
|
|
@@ -680,6 +696,7 @@ const motionFadeMechanism = defineShowMechanism({
|
|
|
680
696
|
import: {
|
|
681
697
|
target: "slide",
|
|
682
698
|
slot: "timing",
|
|
699
|
+
readsGraphicMotion: true,
|
|
683
700
|
read: readSlideMotionImport
|
|
684
701
|
}
|
|
685
702
|
});
|
|
@@ -815,30 +832,15 @@ const motionExitMechanism = defineShowMechanism({
|
|
|
815
832
|
read: readSlideMotionImport
|
|
816
833
|
}
|
|
817
834
|
});
|
|
818
|
-
/** Native
|
|
835
|
+
/** Native main sequence and build-list contribution to the slide timing tree. */
|
|
819
836
|
const motionChoreographyMechanism = defineShowMechanism({
|
|
820
837
|
key: "motion-choreography",
|
|
821
838
|
role: "show",
|
|
822
839
|
emit(model, _context) {
|
|
823
|
-
return {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
nodeType: "tmRoot"
|
|
828
|
-
}, element("p:childTnLst", void 0, element("p:seq", {
|
|
829
|
-
concurrent: true,
|
|
830
|
-
nextAc: "seek"
|
|
831
|
-
}, element("p:cTn", {
|
|
832
|
-
id: model.sequenceId,
|
|
833
|
-
dur: "indefinite",
|
|
834
|
-
nodeType: "mainSeq"
|
|
835
|
-
}, element("p:childTnLst", void 0, ...model.stepGroups)), element("p:prevCondLst", void 0, element("p:cond", {
|
|
836
|
-
evt: "onPrev",
|
|
837
|
-
delay: 0
|
|
838
|
-
}, model.slideTarget)), element("p:nextCondLst", void 0, element("p:cond", {
|
|
839
|
-
evt: "onNext",
|
|
840
|
-
delay: 0
|
|
841
|
-
}, model.slideTarget))))))), model.buildList.length === 0 ? void 0 : element("p:bldLst", void 0, ...model.buildList)) };
|
|
840
|
+
return {
|
|
841
|
+
mainSequenceSteps: model.stepGroups,
|
|
842
|
+
buildList: model.buildList
|
|
843
|
+
};
|
|
842
844
|
},
|
|
843
845
|
import: {
|
|
844
846
|
target: "slide",
|
|
@@ -986,10 +988,8 @@ function mainSequenceWithGroup(id, children) {
|
|
|
986
988
|
fill: "hold"
|
|
987
989
|
}, element("p:stCondLst", void 0, element("p:cond", { delay: 0 })), element("p:childTnLst", void 0, ...children)));
|
|
988
990
|
}
|
|
989
|
-
function
|
|
990
|
-
const
|
|
991
|
-
const rootId = ids.take();
|
|
992
|
-
const sequenceId = ids.take();
|
|
991
|
+
function writeMotionTiming(steps, dimensions, ids) {
|
|
992
|
+
const sequenceId = ids.mainSequenceId;
|
|
993
993
|
const effectNodeIds = /* @__PURE__ */ new Map();
|
|
994
994
|
const scopeNodeIds = /* @__PURE__ */ new Map();
|
|
995
995
|
const targetGroupIds = /* @__PURE__ */ new Map();
|
|
@@ -1379,7 +1379,6 @@ function timingXml(steps, dimensions) {
|
|
|
1379
1379
|
fill: "hold"
|
|
1380
1380
|
}, element("p:stCondLst", void 0, trigger), element("p:childTnLst", void 0, ...stepTimingGroups)));
|
|
1381
1381
|
});
|
|
1382
|
-
const slideTarget = element("p:tgtEl", void 0, element("p:sldTgt", void 0));
|
|
1383
1382
|
const paragraphBuilds = /* @__PURE__ */ new Map();
|
|
1384
1383
|
const chartBuildTargets = /* @__PURE__ */ new Map();
|
|
1385
1384
|
const wholeTextArrays = /* @__PURE__ */ new Map();
|
|
@@ -1426,19 +1425,16 @@ function timingXml(steps, dimensions) {
|
|
|
1426
1425
|
}, build === void 0 ? element("p:bldAsOne", void 0) : element("p:bldSub", void 0, element("a:bldChart", { bld: build })));
|
|
1427
1426
|
})];
|
|
1428
1427
|
return {
|
|
1429
|
-
|
|
1430
|
-
rootId,
|
|
1431
|
-
sequenceId,
|
|
1432
|
-
slideTarget,
|
|
1428
|
+
...motionChoreographyMechanism.emit({
|
|
1433
1429
|
stepGroups,
|
|
1434
1430
|
buildList
|
|
1435
|
-
}, void 0)
|
|
1431
|
+
}, void 0),
|
|
1436
1432
|
nativeProjections
|
|
1437
1433
|
};
|
|
1438
1434
|
}
|
|
1439
1435
|
function buildOwnerMotionSteps(ownerPath, rawMotion, rawPlaceholders) {
|
|
1440
1436
|
const parsed = ownerMotionSchema.safeParse(rawMotion);
|
|
1441
|
-
if (!parsed.success) throw new CapabilityError("invalid-owner-motion", parsed.error.issues[0]?.message ?? `${ownerPath} motion declaration is invalid`, ownerPath);
|
|
1437
|
+
if (!parsed.success) throw new CapabilityError("invalid-owner-motion", parsed.error.issues[0]?.message ?? `${ownerPath} motion declaration is invalid`, ownerPath, { field: zodIssueField(parsed.error.issues[0], "motion") });
|
|
1442
1438
|
const placeholderEntries = typeof rawPlaceholders === "object" && rawPlaceholders !== null ? Object.entries(rawPlaceholders) : [];
|
|
1443
1439
|
const placeholderByKey = /* @__PURE__ */ new Map();
|
|
1444
1440
|
placeholderEntries.forEach(([key, spec], index) => {
|
|
@@ -1533,27 +1529,27 @@ function buildOwnerMotionSteps(ownerPath, rawMotion, rawPlaceholders) {
|
|
|
1533
1529
|
};
|
|
1534
1530
|
});
|
|
1535
1531
|
}
|
|
1532
|
+
const motionMechanisms = [
|
|
1533
|
+
motionAppearMechanism,
|
|
1534
|
+
motionFadeMechanism,
|
|
1535
|
+
motionWipeMechanism,
|
|
1536
|
+
motionZoomMechanism,
|
|
1537
|
+
motionFlyMechanism,
|
|
1538
|
+
motionFloatMechanism,
|
|
1539
|
+
motionSpinInMechanism,
|
|
1540
|
+
motionStretchMechanism,
|
|
1541
|
+
motionSpinMechanism,
|
|
1542
|
+
motionBreatheMechanism,
|
|
1543
|
+
motionFillColorMechanism,
|
|
1544
|
+
motionExitMechanism,
|
|
1545
|
+
motionChoreographyMechanism
|
|
1546
|
+
];
|
|
1536
1547
|
/** Slide-level motion module binds choreography, writes object timing, and leaves preview on the static edit canvas. */
|
|
1537
1548
|
const motionCapability = Object.freeze({
|
|
1538
|
-
|
|
1539
|
-
slideProp: "motion",
|
|
1549
|
+
...motionSlots,
|
|
1540
1550
|
slot: "timing",
|
|
1541
1551
|
always: true,
|
|
1542
|
-
mechanisms:
|
|
1543
|
-
motionAppearMechanism,
|
|
1544
|
-
motionFadeMechanism,
|
|
1545
|
-
motionWipeMechanism,
|
|
1546
|
-
motionZoomMechanism,
|
|
1547
|
-
motionFlyMechanism,
|
|
1548
|
-
motionFloatMechanism,
|
|
1549
|
-
motionSpinInMechanism,
|
|
1550
|
-
motionStretchMechanism,
|
|
1551
|
-
motionSpinMechanism,
|
|
1552
|
-
motionBreatheMechanism,
|
|
1553
|
-
motionFillColorMechanism,
|
|
1554
|
-
motionExitMechanism,
|
|
1555
|
-
motionChoreographyMechanism
|
|
1556
|
-
],
|
|
1552
|
+
mechanisms: motionMechanisms,
|
|
1557
1553
|
codegen: motionCodegen,
|
|
1558
1554
|
transparentDeclarations: [{
|
|
1559
1555
|
declaration: "motion-scope",
|
|
@@ -1580,7 +1576,10 @@ const motionCapability = Object.freeze({
|
|
|
1580
1576
|
extensions: [],
|
|
1581
1577
|
observation: input.props["motion"],
|
|
1582
1578
|
emit(emitContext) {
|
|
1583
|
-
return {
|
|
1579
|
+
return {
|
|
1580
|
+
xml: "",
|
|
1581
|
+
timing: (ids) => writeMotionTiming(steps, emitContext.dimensions, ids)
|
|
1582
|
+
};
|
|
1584
1583
|
}
|
|
1585
1584
|
};
|
|
1586
1585
|
} };
|
|
@@ -1598,7 +1597,9 @@ const motionCapability = Object.freeze({
|
|
|
1598
1597
|
}
|
|
1599
1598
|
};
|
|
1600
1599
|
}
|
|
1601
|
-
const
|
|
1600
|
+
const ids = createTimingIds();
|
|
1601
|
+
ids.take();
|
|
1602
|
+
const timing = writeMotionTiming(plan.steps, context.dimensions, ids);
|
|
1602
1603
|
const observation = {
|
|
1603
1604
|
...plan.observation,
|
|
1604
1605
|
...timing.nativeProjections.length === 0 ? {} : { nativeProjections: timing.nativeProjections }
|
|
@@ -1608,7 +1609,10 @@ const motionCapability = Object.freeze({
|
|
|
1608
1609
|
extensions: [],
|
|
1609
1610
|
observation,
|
|
1610
1611
|
emit(emitContext) {
|
|
1611
|
-
return {
|
|
1612
|
+
return {
|
|
1613
|
+
xml: "",
|
|
1614
|
+
timing: (ids) => writeMotionTiming(plan.steps, emitContext.dimensions, ids)
|
|
1615
|
+
};
|
|
1612
1616
|
}
|
|
1613
1617
|
};
|
|
1614
1618
|
} };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import { blockRichTextChildKinds, createRichTextCodegenHandler } from "../text/text-codegen.js";
|
|
1
|
+
import { blockRichTextChildKinds, createRichTextCodegenHandler } from "../shared/rich-text-codegen.js";
|
|
2
|
+
import { defineObjectCodegen } from "../../kernel/codegen.js";
|
|
4
3
|
import { notesAllowedPropKeys } from "./notes-schemas.js";
|
|
5
|
-
// ../
|
|
4
|
+
// ../core/dist/capabilities/notes/notes-codegen.js
|
|
6
5
|
/**
|
|
7
6
|
* Source codegen contribution for page-affiliated `notes` (`notes()` / `<Notes>`) declarations.
|
|
8
7
|
*
|
|
9
|
-
* Registered via `declarations.notes` so
|
|
8
|
+
* Registered via `declarations.notes` so the codegen stage resolves `Notes` child nodes inside
|
|
10
9
|
* `Slide` while preserving all rich-text children and speaker-note styles.
|
|
11
10
|
*/
|
|
12
11
|
const notesCodegen = defineObjectCodegen({ declarations: { notes: createRichTextCodegenHandler({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RichTextContainer } from "
|
|
1
|
+
import { RichTextContainer } from "../../kernel/document.js";
|
|
2
2
|
import "./notes-schemas.js";
|
|
3
|
-
// ../
|
|
3
|
+
// ../core/dist/capabilities/notes/notes-declaration.js
|
|
4
4
|
/** Creates the editable notes container shared by the command factory and Notes JSX. */
|
|
5
5
|
function createNotesNode(props) {
|
|
6
6
|
return new RichTextContainer("notes", "notes", props, { pageAffiliated: true });
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { textStyleKeys } from "
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import { A_NS, P_NS, REL_NOTES_SLIDE } from "
|
|
5
|
-
import { XmlElementCursor, parseXmlPart } from "
|
|
6
|
-
import { resolvePartPath } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "
|
|
11
|
-
import { populateRichTextNode, readRichTextBody } from "../text/text-import.js";
|
|
1
|
+
import { textStyleKeys } from "../../kernel/theme.js";
|
|
2
|
+
import { populateRichTextNode, readRichTextBody } from "../shared/rich-text-import.js";
|
|
3
|
+
import "../../kernel/capability.js";
|
|
4
|
+
import { A_NS, P_NS, REL_NOTES_SLIDE } from "../../kernel/pptx-read/namespaces.js";
|
|
5
|
+
import { XmlElementCursor, parseXmlPart } from "../../kernel/pptx-read/xml-reader.js";
|
|
6
|
+
import { resolvePartPath } from "../../kernel/pptx-read/opc.js";
|
|
7
|
+
import { appendUnconsumedDiagnostics, consumeIdentityShapeTreeBoilerplate } from "../../kernel/pptx-read/shape-tree.js";
|
|
8
|
+
import { peekShapeTreeObjectIdentity } from "../../kernel/pptx-read/resources.js";
|
|
9
|
+
import { CommonContainer, CommonNode } from "../../kernel/document.js";
|
|
10
|
+
import "../../kernel/pptx-read/index.js";
|
|
12
11
|
import { createNotesNode } from "./notes-declaration.js";
|
|
13
12
|
import { notesPlaceholderXmlSchema, notesRootAttrsXmlSchema, notesShapeIdentityXmlSchema } from "./notes-schemas.js";
|
|
14
|
-
|
|
13
|
+
import { importPresentationSections } from "./sections-import.js";
|
|
14
|
+
// ../core/dist/capabilities/notes/notes-import.js
|
|
15
15
|
const baselineNotesSlidePlaceholders = /* @__PURE__ */ new Set([
|
|
16
16
|
"sldImg",
|
|
17
17
|
"hdr",
|
|
@@ -209,7 +209,10 @@ const speakerNotesImportHandler = {
|
|
|
209
209
|
if (spPr !== void 0) consumeNotesBodyShapeProperties(spPr);
|
|
210
210
|
const txBody = item.child(P_NS, "txBody");
|
|
211
211
|
if (txBody !== void 0) {
|
|
212
|
-
const { boxStyle, importedParagraphs } = readRichTextBody(txBody,
|
|
212
|
+
const { boxStyle, importedParagraphs } = readRichTextBody(txBody, {
|
|
213
|
+
part: notesPartPath,
|
|
214
|
+
slideIndex
|
|
215
|
+
}, diagnostics);
|
|
213
216
|
const notesStyle = {};
|
|
214
217
|
const boxRecord = boxStyle;
|
|
215
218
|
for (const key of textStyleKeys) if (Object.hasOwn(boxRecord, key) && boxRecord[key] !== void 0) notesStyle[key] = boxRecord[key];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { authorIdSchema } from "
|
|
2
|
-
import { textStyleSchema } from "
|
|
3
|
-
import "
|
|
4
|
-
import { ooxmlBoolSchema, ooxmlNonNegativeIntSchema } from "
|
|
5
|
-
import "
|
|
1
|
+
import { authorIdSchema } from "../../kernel/author-ids.js";
|
|
2
|
+
import { textStyleSchema } from "../../kernel/theme.js";
|
|
3
|
+
import "../../kernel/capability.js";
|
|
4
|
+
import { ooxmlBoolSchema, ooxmlNonNegativeIntSchema } from "../../kernel/pptx-read/xml-fragments.js";
|
|
5
|
+
import "../../kernel/pptx-read/index.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
// ../
|
|
7
|
+
// ../core/dist/capabilities/notes/notes-schemas.js
|
|
8
8
|
const rawNotesDeclarationPropsSchema = z.strictObject({
|
|
9
9
|
id: authorIdSchema.optional(),
|
|
10
10
|
style: textStyleSchema.optional()
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { CapabilityError } from "
|
|
2
|
-
import "
|
|
3
|
-
import { sectionListXml, themeXml, xmlEscape } from "../../../emit/dist/ooxml.js";
|
|
4
|
-
import "../../../emit/dist/index.js";
|
|
5
|
-
import { defineShowMechanism } from "../../../import/dist/mechanism.js";
|
|
6
|
-
import "../../../import/dist/index.js";
|
|
1
|
+
import { CapabilityError } from "../../kernel/diagnostics.js";
|
|
2
|
+
import { notesMasterRelationshipType, notesSlideContentType, notesSlidePathTemplate, notesSlideRelationshipType, notesSlideXml, registerPrintMaster, slideRelationshipType } from "../shared/print-xml.js";
|
|
7
3
|
import { emitTextBody, parseTextContent, resolveTextBody } from "../shared/text-service.js";
|
|
4
|
+
import "../../kernel/capability.js";
|
|
5
|
+
import { defineShowMechanism } from "../../kernel/pptx-read/mechanism.js";
|
|
6
|
+
import "../../kernel/pptx-read/index.js";
|
|
7
|
+
import { sectionListXml } from "../../kernel/pptx-write/xml.js";
|
|
8
8
|
import { notesCodegen } from "./notes-codegen.js";
|
|
9
9
|
import { presentationSectionsImportHandler, speakerNotesImportHandler } from "./notes-import.js";
|
|
10
10
|
import { notesDeclarationPropsSchema } from "./notes-schemas.js";
|
|
11
|
-
|
|
12
|
-
// ../capabilities/dist/notes/notes.js
|
|
11
|
+
// ../core/dist/capabilities/notes/notes.js
|
|
13
12
|
/**
|
|
14
13
|
* Notes text defaults are independent of slide projection styles.
|
|
15
14
|
*
|
|
@@ -32,16 +31,19 @@ const notesDefaultTextStyle = Object.freeze({
|
|
|
32
31
|
textWrap: "normal"
|
|
33
32
|
});
|
|
34
33
|
const boundNotesEntries = /* @__PURE__ */ new WeakMap();
|
|
35
|
-
function parseNotes(input, pageTheme, slideNumber) {
|
|
34
|
+
function parseNotes(input, pageTheme, slideNumber, referenceDate) {
|
|
36
35
|
const parsedProps = notesDeclarationPropsSchema.safeParse(input.props);
|
|
37
36
|
if (!parsedProps.success) {
|
|
38
37
|
const issue = parsedProps.error.issues[0];
|
|
39
38
|
if (issue?.code === "unrecognized_keys" && issue.path.length === 0) throw new CapabilityError("unknown-parameter", `Notes contains unsupported parameter ${issue.keys[0]}`);
|
|
40
|
-
if (issue?.path[0] === "id") throw new CapabilityError("invalid-notes", "Notes.id must be a string");
|
|
39
|
+
if (issue?.path[0] === "id") throw new CapabilityError("invalid-notes", "Notes.id must be a string", void 0, { field: "id" });
|
|
41
40
|
}
|
|
42
41
|
const theme = pageTheme.withTextStyle(notesDefaultTextStyle);
|
|
43
42
|
return {
|
|
44
|
-
...parseTextContent(input.children, input.props["style"], theme, {
|
|
43
|
+
...parseTextContent(input.children, input.props["style"], theme, {
|
|
44
|
+
slideNumber,
|
|
45
|
+
referenceDate
|
|
46
|
+
}, "Notes.style"),
|
|
45
47
|
theme
|
|
46
48
|
};
|
|
47
49
|
}
|
|
@@ -51,32 +53,7 @@ function emitSpeakerNotes(model, emitContext) {
|
|
|
51
53
|
createFieldId: emitContext.createTextFieldId,
|
|
52
54
|
...embedFonts === void 0 ? {} : { embedFonts }
|
|
53
55
|
});
|
|
54
|
-
emitContext.
|
|
55
|
-
part: {
|
|
56
|
-
pathTemplate: themePathTemplate,
|
|
57
|
-
contentType: themeContentType
|
|
58
|
-
},
|
|
59
|
-
content: () => themeXml(emitContext.theme.theme)
|
|
60
|
-
});
|
|
61
|
-
emitContext.registerSharedPart("notes-master", {
|
|
62
|
-
part: {
|
|
63
|
-
pathTemplate: notesMasterPathTemplate,
|
|
64
|
-
contentType: notesMasterContentType
|
|
65
|
-
},
|
|
66
|
-
presentationRelationshipType: notesMasterRelationshipType,
|
|
67
|
-
relationships: [{
|
|
68
|
-
relationshipType: themeRelationshipType,
|
|
69
|
-
target: {
|
|
70
|
-
kind: "part",
|
|
71
|
-
key: "notes-theme"
|
|
72
|
-
}
|
|
73
|
-
}],
|
|
74
|
-
presentationElement: {
|
|
75
|
-
position: "before-slides",
|
|
76
|
-
content: (relationshipId) => `<p:notesMasterIdLst><p:notesMasterId r:id="${xmlEscape(relationshipId)}"/></p:notesMasterIdLst>`
|
|
77
|
-
},
|
|
78
|
-
content: () => notesMasterXml()
|
|
79
|
-
});
|
|
56
|
+
const corners = registerPrintMaster(emitContext, emitContext.theme.theme, "notes", "<p:hf hdr=\"0\" ftr=\"0\" dt=\"0\" sldNum=\"0\"/>", "").renderSlideFragment?.(emitContext) ?? "";
|
|
80
57
|
emitContext.registerPackagePart({
|
|
81
58
|
part: {
|
|
82
59
|
pathTemplate: notesSlidePathTemplate,
|
|
@@ -93,7 +70,7 @@ function emitSpeakerNotes(model, emitContext) {
|
|
|
93
70
|
key: "notes-master"
|
|
94
71
|
}
|
|
95
72
|
}],
|
|
96
|
-
content: () => notesSlideXml(body.xml)
|
|
73
|
+
content: () => notesSlideXml(body.xml, corners)
|
|
97
74
|
});
|
|
98
75
|
return {
|
|
99
76
|
xml: "",
|
|
@@ -131,8 +108,6 @@ function notesObservation(text, paragraphs) {
|
|
|
131
108
|
*/
|
|
132
109
|
const notesCapability = Object.freeze({
|
|
133
110
|
declaration: "notes",
|
|
134
|
-
slideProp: "notes",
|
|
135
|
-
slideProps: [],
|
|
136
111
|
slot: "timing",
|
|
137
112
|
always: true,
|
|
138
113
|
codegen: notesCodegen,
|
|
@@ -148,7 +123,7 @@ const notesCapability = Object.freeze({
|
|
|
148
123
|
children: "owned",
|
|
149
124
|
compileDeclaration(input, context) {
|
|
150
125
|
if (context.theme === void 0 || context.slideNumber === void 0) throw new CapabilityError("invalid-notes", "Notes declaration requires slide theme and number context");
|
|
151
|
-
const entry = parseNotes(input, context.theme, context.slideNumber);
|
|
126
|
+
const entry = parseNotes(input, context.theme, context.slideNumber, context.options?.referenceDate);
|
|
152
127
|
const token = Object.freeze({});
|
|
153
128
|
boundNotesEntries.set(token, entry);
|
|
154
129
|
return [{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CommonNode, createSectionNode } from "../../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ooxmlNonNegativeIntSchema } from "
|
|
1
|
+
import { CommonNode, createSectionNode } from "../../kernel/document.js";
|
|
2
|
+
import { P14_NS, P_NS } from "../../kernel/pptx-read/namespaces.js";
|
|
3
|
+
import { allocateScopedAuthorId } from "../../kernel/pptx-read/shape-tree.js";
|
|
4
|
+
import { ooxmlNonNegativeIntSchema } from "../../kernel/pptx-read/xml-fragments.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
// ../
|
|
6
|
+
// ../core/dist/capabilities/notes/sections-import.js
|
|
7
7
|
const sectionAttrsXmlSchema = z.object({
|
|
8
8
|
name: z.string().refine((value) => value.trim() !== ""),
|
|
9
9
|
id: z.string().optional()
|