@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,18 +1,23 @@
|
|
|
1
1
|
import { readAuthorId, validateAuthorIdScopes } from "./author-ids.js";
|
|
2
|
-
import { parseDeckProps, parseLinkTarget, parseSectionProps, parseSlideCoreProps,
|
|
2
|
+
import { parseDeckProps, parseLinkTarget, parseSectionProps, parseSlideCoreProps, slideBackgroundSchema } from "./author-schemas.js";
|
|
3
|
+
import { createContainerSlotRegistry, readContainerSlot } from "./container-slots.js";
|
|
4
|
+
import { captureDeclaration } from "./declaration-snapshot.js";
|
|
5
|
+
import { isSlideLayoutDefinition } from "./layout-definition.js";
|
|
3
6
|
import { componentLabel, declarationIdentity, isDeclarationNode } from "./declaration.js";
|
|
4
7
|
import { BuildError, CapabilityError, capabilityErrorToDiagnostic, toBuildDiagnostic, zodIssueToBuildDiagnostic } from "./diagnostics.js";
|
|
8
|
+
import { xml10StringSchema } from "./xml-values.js";
|
|
5
9
|
import { readInternalDeclarationProps } from "./document-internals.js";
|
|
6
10
|
import { LayoutPass, validateBoundObjectCapability } from "./layout.js";
|
|
7
|
-
import { footerPlaceholdersSchema,
|
|
11
|
+
import { footerPlaceholdersSchema, headerFooterSchema, slideLayoutCoreDataPropsSchema, slideMasterCorePropsSchema } from "./masters.js";
|
|
8
12
|
import { getMorphKeyLabel, isMorphKey } from "./morph.js";
|
|
9
|
-
import { masterTextStyleCategoryForRole, matchMasterPlaceholderSpec,
|
|
13
|
+
import { masterTextStyleCategoryForRole, matchMasterPlaceholderSpec, resolvePlaceholderBoxFromLayers } from "./placeholders.js";
|
|
10
14
|
import { createBuildQuery } from "./query.js";
|
|
11
15
|
import { registerInternalResolution } from "./resolution.js";
|
|
16
|
+
import { completeBinding, createResolveFileCache, finishResolveWork } from "./resolve-work.js";
|
|
12
17
|
import { resolveOptionsSchema } from "./stage-options.js";
|
|
13
18
|
import { createThemeContext, defaultColorMap, defineTheme, isFont, isTheme, textStyleFrom } from "./theme.js";
|
|
14
19
|
import { computeTransformedGeometry } from "./transform-geometry.js";
|
|
15
|
-
// ../core/dist/resolve.js
|
|
20
|
+
// ../core/dist/kernel/resolve.js
|
|
16
21
|
function createScopeRegistry() {
|
|
17
22
|
return {
|
|
18
23
|
targetsByAuthorId: /* @__PURE__ */ new Map(),
|
|
@@ -137,15 +142,28 @@ function validateResolveOptions(options) {
|
|
|
137
142
|
scope: "options"
|
|
138
143
|
})]);
|
|
139
144
|
}
|
|
145
|
+
if (issue.path[0] === "referenceDate") throw new BuildError([diagnostic("resolve.referenceDate", "invalid-options", "referenceDate must be a valid Date or ISO date string", { field: "referenceDate" })]);
|
|
140
146
|
if (issue.path[0] === "signal") throw new BuildError([diagnostic("resolve.signal", "invalid-options", "Resolve options signal must be an AbortSignal", {
|
|
141
147
|
field: "signal",
|
|
142
148
|
expected: "AbortSignal"
|
|
143
149
|
})]);
|
|
144
150
|
throw new BuildError([diagnostic("resolve", "invalid-options", "Resolve options must be an object", { expected: "object" })]);
|
|
145
151
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
const dedicatedMasterLayoutSlots = /* @__PURE__ */ new Set([
|
|
153
|
+
"background",
|
|
154
|
+
"style.background",
|
|
155
|
+
"headerFooter",
|
|
156
|
+
"footerPlaceholders"
|
|
157
|
+
]);
|
|
158
|
+
function readOwnerSlot(props, key, path, code, schema) {
|
|
159
|
+
const value = readContainerSlot(props, key);
|
|
160
|
+
if (value === void 0) return void 0;
|
|
161
|
+
const parsed = schema.safeParse(value);
|
|
162
|
+
if (!parsed.success) {
|
|
163
|
+
const issue = parsed.error.issues[0];
|
|
164
|
+
throw new BuildError([zodIssueToBuildDiagnostic(path, code, "Invalid container declaration", issue, key)]);
|
|
165
|
+
}
|
|
166
|
+
return parsed.data;
|
|
149
167
|
}
|
|
150
168
|
function resolveSlides(container, modules, defaultDeckTheme) {
|
|
151
169
|
const decks = childNodes(container.children);
|
|
@@ -159,13 +177,6 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
159
177
|
const masterNodes = topLevel.filter((node) => node.type === "slide-master");
|
|
160
178
|
const slideOrSectionNodes = topLevel.filter((node) => node.type !== "slide-master");
|
|
161
179
|
const authorIds = /* @__PURE__ */ new Set();
|
|
162
|
-
const slideProperties = [...modules.slideModules.values()].flatMap((module) => module.slideProps ?? (module.slideProp === void 0 ? [] : [module.slideProp]));
|
|
163
|
-
const slidePropertySet = new Set(slideProperties);
|
|
164
|
-
const knownTrimmedSlideProps = /* @__PURE__ */ new Set([
|
|
165
|
-
"transition",
|
|
166
|
-
"advanceAfter",
|
|
167
|
-
"motion"
|
|
168
|
-
]);
|
|
169
180
|
const masters = [];
|
|
170
181
|
const layoutKeyByNode = /* @__PURE__ */ new Map();
|
|
171
182
|
const layoutKeysByDefinition = /* @__PURE__ */ new Map();
|
|
@@ -180,45 +191,12 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
180
191
|
const masterKey = `master-${masterIndex + 1}`;
|
|
181
192
|
const masterId = masterAuthorId ?? masterKey;
|
|
182
193
|
const masterPath = `deck/slide-master[${masterAuthorId ?? masterIndex + 1}]`;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
"style",
|
|
190
|
-
"background",
|
|
191
|
-
"headerFooter",
|
|
192
|
-
"footerPlaceholders",
|
|
193
|
-
"placeholders",
|
|
194
|
-
"textStyles",
|
|
195
|
-
...slideProperties
|
|
196
|
-
]);
|
|
197
|
-
if (unknownMasterProp !== void 0) {
|
|
198
|
-
if (knownTrimmedSlideProps.has(unknownMasterProp)) throw new BuildError([diagnostic(masterPath, "missing-capability", `No capability module registered for SlideMaster.${unknownMasterProp}`, {
|
|
199
|
-
capability: unknownMasterProp,
|
|
200
|
-
field: unknownMasterProp
|
|
201
|
-
})]);
|
|
202
|
-
throw new BuildError([diagnostic(masterPath, "unknown-parameter", `SlideMaster contains unknown parameter ${unknownMasterProp}`, {
|
|
203
|
-
prop: unknownMasterProp,
|
|
204
|
-
field: unknownMasterProp,
|
|
205
|
-
scope: "props"
|
|
206
|
-
})]);
|
|
207
|
-
}
|
|
208
|
-
const masterDataInput = {};
|
|
209
|
-
for (const key of [
|
|
210
|
-
"id",
|
|
211
|
-
"name",
|
|
212
|
-
"preserve",
|
|
213
|
-
"colorMap",
|
|
214
|
-
"style",
|
|
215
|
-
"background",
|
|
216
|
-
"headerFooter",
|
|
217
|
-
"footerPlaceholders",
|
|
218
|
-
"placeholders",
|
|
219
|
-
"textStyles"
|
|
220
|
-
]) if (Object.hasOwn(masterProps, key)) masterDataInput[key] = masterProps[key];
|
|
221
|
-
const parsedMaster = slideMasterDataPropsSchema.safeParse(masterDataInput);
|
|
194
|
+
modules.containerSlots.validate("master", masterPath, masterProps);
|
|
195
|
+
const masterDataInput = modules.containerSlots.extractCoreProps("master", masterProps);
|
|
196
|
+
delete masterDataInput["theme"];
|
|
197
|
+
const parsedMaster = slideMasterCorePropsSchema.safeParse(masterDataInput);
|
|
198
|
+
const masterFooter = readOwnerSlot(masterProps, "footerPlaceholders", masterPath, "invalid-slide-master", footerPlaceholdersSchema);
|
|
199
|
+
const masterHeaderFooter = readOwnerSlot(masterProps, "headerFooter", masterPath, "invalid-slide-master", headerFooterSchema);
|
|
222
200
|
if (!parsedMaster.success) {
|
|
223
201
|
const firstIssue = parsedMaster.error.issues[0];
|
|
224
202
|
throw new BuildError([zodIssueToBuildDiagnostic(masterPath, "invalid-slide-master", "Invalid SlideMaster declaration", firstIssue)]);
|
|
@@ -241,10 +219,11 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
241
219
|
})]);
|
|
242
220
|
authorIds.add(masterAuthorId);
|
|
243
221
|
}
|
|
244
|
-
if (parsedMaster.data.name !== void 0 && !xml10StringSchema.safeParse(parsedMaster.data.name).success) throw new BuildError([diagnostic(masterPath, "invalid-xml-character", "SlideMaster.name contains characters not allowed in XML 1.0")]);
|
|
245
|
-
for (const phSpec of Object.
|
|
222
|
+
if (parsedMaster.data.name !== void 0 && !xml10StringSchema.safeParse(parsedMaster.data.name).success) throw new BuildError([diagnostic(masterPath, "invalid-xml-character", "SlideMaster.name contains characters not allowed in XML 1.0", { field: "name" })]);
|
|
223
|
+
for (const [key, phSpec] of Object.entries(parsedMaster.data.placeholders ?? {})) for (const field of ["name", "promptText"]) {
|
|
224
|
+
const phText = phSpec[field];
|
|
246
225
|
if (phText === void 0) continue;
|
|
247
|
-
if (!xml10StringSchema.safeParse(phText).success) throw new BuildError([diagnostic(masterPath, "invalid-xml-character", "SlideMaster placeholder text contains characters not allowed in XML 1.0")]);
|
|
226
|
+
if (!xml10StringSchema.safeParse(phText).success) throw new BuildError([diagnostic(masterPath, "invalid-xml-character", "SlideMaster placeholder text contains characters not allowed in XML 1.0", { field: `placeholders.${key}.${field}` })]);
|
|
248
227
|
}
|
|
249
228
|
if (nonWhitespaceText(masterNode.children)) throw new BuildError([diagnostic(masterPath, "unexpected-text", "SlideMaster cannot directly contain text")]);
|
|
250
229
|
const masterChildren = childNodes(masterNode.children);
|
|
@@ -259,71 +238,24 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
259
238
|
const rawLayoutPath = `${masterPath}/slide-layout[${layoutIndex + 1}]`;
|
|
260
239
|
const layoutProps = readInternalDeclarationProps(layoutNode);
|
|
261
240
|
const rawLayoutDef = layoutProps["layout"];
|
|
262
|
-
|
|
263
|
-
if (rawLayoutDef !== void 0) {
|
|
264
|
-
if (!isSlideLayoutDefinition(rawLayoutDef)) throw new BuildError([diagnostic(rawLayoutPath, "invalid-slide-layout", "SlideLayout.layout must be created by defineSlideLayout()")]);
|
|
265
|
-
layoutDef = rawLayoutDef;
|
|
266
|
-
}
|
|
241
|
+
const layoutDef = isSlideLayoutDefinition(rawLayoutDef) ? rawLayoutDef : void 0;
|
|
267
242
|
const effectiveLayoutProps = { ...layoutDef?.props };
|
|
268
243
|
for (const [key, value] of Object.entries(layoutProps)) {
|
|
269
244
|
if (key === "layout" || value === void 0) continue;
|
|
270
245
|
effectiveLayoutProps[key] = value;
|
|
271
246
|
}
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
"showMasterPlaceholderAnimations",
|
|
281
|
-
"placeholders",
|
|
282
|
-
"colorMapOverride",
|
|
283
|
-
"themeOverride",
|
|
284
|
-
"style",
|
|
285
|
-
"background",
|
|
286
|
-
"headerFooter",
|
|
287
|
-
"footerPlaceholders",
|
|
288
|
-
...slideProperties
|
|
289
|
-
]);
|
|
290
|
-
if (unknownLayoutProp !== void 0) {
|
|
291
|
-
if (knownTrimmedSlideProps.has(unknownLayoutProp)) throw new BuildError([diagnostic(rawLayoutPath, "missing-capability", `No capability module registered for SlideLayout.${unknownLayoutProp}`, {
|
|
292
|
-
capability: unknownLayoutProp,
|
|
293
|
-
field: unknownLayoutProp
|
|
294
|
-
})]);
|
|
295
|
-
throw new BuildError([diagnostic(rawLayoutPath, "unknown-parameter", `SlideLayout contains unknown parameter ${unknownLayoutProp}`, {
|
|
296
|
-
prop: unknownLayoutProp,
|
|
297
|
-
field: unknownLayoutProp,
|
|
298
|
-
scope: "props"
|
|
299
|
-
})]);
|
|
300
|
-
}
|
|
301
|
-
const layoutDataInput = {};
|
|
302
|
-
for (const key of [
|
|
303
|
-
"id",
|
|
304
|
-
"name",
|
|
305
|
-
"type",
|
|
306
|
-
"preserve",
|
|
307
|
-
"matchingName",
|
|
308
|
-
"userDrawn",
|
|
309
|
-
"showMasterShapes",
|
|
310
|
-
"showMasterPlaceholderAnimations",
|
|
311
|
-
"placeholders",
|
|
312
|
-
"colorMapOverride",
|
|
313
|
-
"themeOverride",
|
|
314
|
-
"style",
|
|
315
|
-
"background",
|
|
316
|
-
"headerFooter",
|
|
317
|
-
"footerPlaceholders"
|
|
318
|
-
]) if (Object.hasOwn(effectiveLayoutProps, key)) layoutDataInput[key] = effectiveLayoutProps[key];
|
|
319
|
-
const parsedLayout = slideLayoutDataPropsSchema.safeParse(layoutDataInput);
|
|
247
|
+
const layoutAuthorId = readAuthorId(effectiveLayoutProps["id"], rawLayoutPath);
|
|
248
|
+
const layoutId = layoutAuthorId ?? `layout-${layoutIndex + 1}`;
|
|
249
|
+
const layoutPath = `${masterPath}/slide-layout[${layoutAuthorId ?? layoutIndex + 1}]`;
|
|
250
|
+
if (rawLayoutDef !== void 0 && layoutDef === void 0) throw new BuildError([diagnostic(layoutPath, "invalid-slide-layout", "SlideLayout.layout must be created by defineSlideLayout()", { field: "layout" })]);
|
|
251
|
+
modules.containerSlots.validate("layout", layoutPath, effectiveLayoutProps);
|
|
252
|
+
const parsedLayout = slideLayoutCoreDataPropsSchema.safeParse(modules.containerSlots.extractCoreProps("layout", effectiveLayoutProps));
|
|
253
|
+
const layoutFooter = readOwnerSlot(effectiveLayoutProps, "footerPlaceholders", layoutPath, "invalid-slide-layout", footerPlaceholdersSchema);
|
|
254
|
+
const layoutHeaderFooter = readOwnerSlot(effectiveLayoutProps, "headerFooter", layoutPath, "invalid-slide-layout", headerFooterSchema);
|
|
320
255
|
if (!parsedLayout.success) {
|
|
321
256
|
const firstIssue = parsedLayout.error.issues[0];
|
|
322
|
-
throw new BuildError([zodIssueToBuildDiagnostic(
|
|
257
|
+
throw new BuildError([zodIssueToBuildDiagnostic(layoutPath, "invalid-slide-layout", "Invalid SlideLayout declaration", firstIssue)]);
|
|
323
258
|
}
|
|
324
|
-
const layoutAuthorId = readAuthorId(parsedLayout.data.id, rawLayoutPath);
|
|
325
|
-
const layoutId = layoutAuthorId ?? `layout-${layoutIndex + 1}`;
|
|
326
|
-
const layoutPath = `${masterPath}/slide-layout[${layoutAuthorId ?? layoutIndex + 1}]`;
|
|
327
259
|
if (layoutAuthorId !== void 0) {
|
|
328
260
|
if (masterLayoutIds.has(layoutAuthorId)) throw new BuildError([diagnostic(layoutPath, "duplicate-author-id", `Duplicate SlideLayout.id ${JSON.stringify(layoutAuthorId)} in ${masterPath}`, {
|
|
329
261
|
field: "id",
|
|
@@ -331,17 +263,19 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
331
263
|
})]);
|
|
332
264
|
masterLayoutIds.add(layoutAuthorId);
|
|
333
265
|
}
|
|
334
|
-
for (const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
266
|
+
for (const field of [
|
|
267
|
+
"id",
|
|
268
|
+
"name",
|
|
269
|
+
"matchingName"
|
|
338
270
|
]) {
|
|
271
|
+
const textField = parsedLayout.data[field];
|
|
339
272
|
if (textField === void 0) continue;
|
|
340
|
-
if (!xml10StringSchema.safeParse(textField).success) throw new BuildError([diagnostic(layoutPath, "invalid-xml-character", "SlideLayout text property contains characters not allowed in XML 1.0")]);
|
|
273
|
+
if (!xml10StringSchema.safeParse(textField).success) throw new BuildError([diagnostic(layoutPath, "invalid-xml-character", "SlideLayout text property contains characters not allowed in XML 1.0", { field })]);
|
|
341
274
|
}
|
|
342
|
-
for (const phSpec of Object.
|
|
275
|
+
for (const [key, phSpec] of Object.entries(parsedLayout.data.placeholders ?? {})) for (const field of ["name", "promptText"]) {
|
|
276
|
+
const phText = phSpec[field];
|
|
343
277
|
if (phText === void 0) continue;
|
|
344
|
-
if (!xml10StringSchema.safeParse(phText).success) throw new BuildError([diagnostic(layoutPath, "invalid-xml-character", "SlideLayout placeholder text contains characters not allowed in XML 1.0")]);
|
|
278
|
+
if (!xml10StringSchema.safeParse(phText).success) throw new BuildError([diagnostic(layoutPath, "invalid-xml-character", "SlideLayout placeholder text contains characters not allowed in XML 1.0", { field: `placeholders.${key}.${field}` })]);
|
|
345
279
|
}
|
|
346
280
|
validateAuthorIdScopes(layoutNode, layoutPath, /* @__PURE__ */ new Set());
|
|
347
281
|
if (nonWhitespaceText(layoutNode.children)) throw new BuildError([diagnostic(layoutPath, "unexpected-text", "SlideLayout cannot directly contain text")]);
|
|
@@ -366,22 +300,21 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
366
300
|
...parsedLayout.data.showMasterPlaceholderAnimations === void 0 ? {} : { showMasterPlaceholderAnimations: parsedLayout.data.showMasterPlaceholderAnimations },
|
|
367
301
|
...parsedLayout.data.colorMapOverride === void 0 ? {} : { colorMapOverride: parsedLayout.data.colorMapOverride },
|
|
368
302
|
...parsedLayout.data.themeOverride === void 0 ? {} : { themeOverride: parsedLayout.data.themeOverride },
|
|
369
|
-
...
|
|
303
|
+
...layoutHeaderFooter === void 0 ? {} : { headerFooter: layoutHeaderFooter }
|
|
370
304
|
};
|
|
371
305
|
const reservedFooterIndices = [];
|
|
372
|
-
for (const footerSource of [
|
|
306
|
+
for (const footerSource of [masterFooter, layoutFooter]) {
|
|
373
307
|
if (footerSource === void 0) continue;
|
|
374
308
|
if (footerSource.dateTime !== void 0) reservedFooterIndices.push(footerSource.dateTime.idx ?? 2);
|
|
375
309
|
if (footerSource.footer !== void 0) reservedFooterIndices.push(footerSource.footer.idx ?? 3);
|
|
376
310
|
if (footerSource.slideNumber !== void 0) reservedFooterIndices.push(footerSource.slideNumber.idx ?? 4);
|
|
377
311
|
}
|
|
378
312
|
const normalizedLayoutPlaceholders = normalizeLayoutPlaceholderIndices(parsedLayout.data.placeholders, reservedFooterIndices);
|
|
379
|
-
const layoutSlideProps =
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
const effectiveLayoutBackground = parsedLayout.data.style?.background ?? parsedLayout.data.background;
|
|
313
|
+
const layoutSlideProps = {
|
|
314
|
+
...normalizedLayoutPlaceholders === void 0 ? {} : { placeholders: normalizedLayoutPlaceholders },
|
|
315
|
+
...modules.containerSlots.collectCapabilityProps("layout", effectiveLayoutProps, dedicatedMasterLayoutSlots)
|
|
316
|
+
};
|
|
317
|
+
const effectiveLayoutBackground = readOwnerSlot(effectiveLayoutProps, "style.background", layoutPath, "invalid-slide-layout", slideBackgroundSchema) ?? readOwnerSlot(effectiveLayoutProps, "background", layoutPath, "invalid-slide-layout", slideBackgroundSchema);
|
|
385
318
|
resolvedLayouts.push({
|
|
386
319
|
node: layoutNode,
|
|
387
320
|
key: layoutKey,
|
|
@@ -390,8 +323,8 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
390
323
|
...normalizedLayoutPlaceholders === void 0 ? {} : { placeholders: normalizedLayoutPlaceholders },
|
|
391
324
|
...parsedLayout.data.style === void 0 ? {} : { style: parsedLayout.data.style },
|
|
392
325
|
...effectiveLayoutBackground === void 0 ? {} : { background: effectiveLayoutBackground },
|
|
393
|
-
...
|
|
394
|
-
...
|
|
326
|
+
...layoutHeaderFooter === void 0 ? {} : { headerFooter: layoutHeaderFooter },
|
|
327
|
+
...layoutFooter === void 0 ? {} : { footerPlaceholders: layoutFooter },
|
|
395
328
|
props: layoutSlideProps
|
|
396
329
|
});
|
|
397
330
|
}
|
|
@@ -400,13 +333,11 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
400
333
|
props: masterProps,
|
|
401
334
|
children: masterCanvasNodes
|
|
402
335
|
}, masterPath, new Set(masterLayoutIds));
|
|
403
|
-
const masterSlideProps =
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
const masterStyleProp = masterProps["style"];
|
|
409
|
-
const effectiveMasterBackground = parsedMaster.data.style?.background ?? parsedMaster.data.background;
|
|
336
|
+
const masterSlideProps = {
|
|
337
|
+
...parsedMaster.data.placeholders === void 0 ? {} : { placeholders: parsedMaster.data.placeholders },
|
|
338
|
+
...modules.containerSlots.collectCapabilityProps("master", masterProps, dedicatedMasterLayoutSlots)
|
|
339
|
+
};
|
|
340
|
+
const effectiveMasterBackground = readOwnerSlot(masterProps, "style.background", masterPath, "invalid-slide-master", slideBackgroundSchema) ?? readOwnerSlot(masterProps, "background", masterPath, "invalid-slide-master", slideBackgroundSchema);
|
|
410
341
|
masters.push({
|
|
411
342
|
node: masterNode,
|
|
412
343
|
canvasChildren: masterCanvasNodes,
|
|
@@ -418,12 +349,12 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
418
349
|
theme: masterTheme,
|
|
419
350
|
colorMap: parsedMaster.data.colorMap ?? defaultColorMap,
|
|
420
351
|
...parsedMaster.data.colorMap === void 0 ? {} : { explicitColorMap: parsedMaster.data.colorMap },
|
|
421
|
-
...
|
|
352
|
+
...parsedMaster.data.style === void 0 ? {} : { style: parsedMaster.data.style },
|
|
422
353
|
...parsedMaster.data.placeholders === void 0 ? {} : { placeholders: parsedMaster.data.placeholders },
|
|
423
354
|
...parsedMaster.data.textStyles === void 0 ? {} : { textStyles: parsedMaster.data.textStyles },
|
|
424
355
|
...effectiveMasterBackground === void 0 ? {} : { background: effectiveMasterBackground },
|
|
425
|
-
...
|
|
426
|
-
...
|
|
356
|
+
...masterHeaderFooter === void 0 ? {} : { headerFooter: masterHeaderFooter },
|
|
357
|
+
...masterFooter === void 0 ? {} : { footerPlaceholders: masterFooter },
|
|
427
358
|
props: masterSlideProps,
|
|
428
359
|
layouts: resolvedLayouts
|
|
429
360
|
});
|
|
@@ -460,7 +391,9 @@ function resolveSlides(container, modules, defaultDeckTheme) {
|
|
|
460
391
|
layoutIdByKey,
|
|
461
392
|
slides: candidates.map(({ node, section, sectionIndex }, index) => {
|
|
462
393
|
const slideProps = readInternalDeclarationProps(node);
|
|
463
|
-
const
|
|
394
|
+
const slideLabel = readAuthorId(slideProps["id"], `deck/slide[${index + 1}]`) ?? index + 1;
|
|
395
|
+
modules.containerSlots.validate("slide", `deck/slide[${slideLabel}]`, slideProps);
|
|
396
|
+
const { id, name, hidden, showMasterPlaceholderAnimations, showMasterShapes, colorMapOverride, themeOverride } = parseSlideCoreProps(modules.containerSlots.extractCoreProps("slide", slideProps), index);
|
|
464
397
|
const authorId = id;
|
|
465
398
|
if (authorIds.has(authorId)) throw new BuildError([diagnostic(`deck/slide[${authorId}]`, "duplicate-author-id", `Duplicate Slide.id ${JSON.stringify(authorId)} in the deck`, {
|
|
466
399
|
field: "id",
|
|
@@ -531,7 +464,7 @@ function validateLink(value, context, path) {
|
|
|
531
464
|
parsed = parseLinkTarget(value, path);
|
|
532
465
|
} catch (error) {
|
|
533
466
|
if (error instanceof CapabilityError) {
|
|
534
|
-
context.slide.diagnostics.push(
|
|
467
|
+
context.slide.diagnostics.push(capabilityErrorToDiagnostic(error, path));
|
|
535
468
|
return;
|
|
536
469
|
}
|
|
537
470
|
throw error;
|
|
@@ -554,7 +487,7 @@ function validateLink(value, context, path) {
|
|
|
554
487
|
try {
|
|
555
488
|
url = new URL(parsed.url);
|
|
556
489
|
} catch {
|
|
557
|
-
context.slide.diagnostics.push(diagnostic(path, "invalid-link", "link.url must be an absolute URL"));
|
|
490
|
+
context.slide.diagnostics.push(diagnostic(path, "invalid-link", "link.url must be an absolute URL", { field: "link.url" }));
|
|
558
491
|
return;
|
|
559
492
|
}
|
|
560
493
|
return {
|
|
@@ -773,7 +706,8 @@ function resolveChildrenPass(children, context, parentPath, insideGroup = false,
|
|
|
773
706
|
for (const annotation of module.compileDeclaration(child, {
|
|
774
707
|
path,
|
|
775
708
|
theme: context.theme,
|
|
776
|
-
slideNumber: context.slideNumber
|
|
709
|
+
slideNumber: context.slideNumber,
|
|
710
|
+
options: context.options
|
|
777
711
|
})) context.slide.contributions.push({
|
|
778
712
|
...annotation,
|
|
779
713
|
path,
|
|
@@ -781,7 +715,7 @@ function resolveChildrenPass(children, context, parentPath, insideGroup = false,
|
|
|
781
715
|
declaration: child
|
|
782
716
|
});
|
|
783
717
|
} catch (error) {
|
|
784
|
-
context.slide.diagnostics.push(error instanceof CapabilityError ?
|
|
718
|
+
context.slide.diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path, true) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
785
719
|
}
|
|
786
720
|
const deferredBefore = scope.deferredTasks.length;
|
|
787
721
|
const childResolved = resolveChildrenPass(child.children, context, path, insideGroup, scope);
|
|
@@ -825,13 +759,13 @@ function resolveChildrenPass(children, context, parentPath, insideGroup = false,
|
|
|
825
759
|
const placeholder = context.placeholderContexts.get(child);
|
|
826
760
|
const theme = placeholder !== void 0 ? placeholder.masterTheme : context.layout.themes.get(child) ?? context.theme;
|
|
827
761
|
try {
|
|
828
|
-
const bound = context.layout.bound.get(child) ?? validateBoundObjectCapability(module.bind(child, {
|
|
762
|
+
const bound = context.layout.bound.get(child) ?? validateBoundObjectCapability(finishResolveWork(completeBinding(module.bind(child, {
|
|
829
763
|
path,
|
|
830
764
|
theme,
|
|
831
765
|
options: context.options,
|
|
832
766
|
slideNumber: context.slideNumber,
|
|
833
767
|
...placeholder === void 0 ? {} : { placeholder }
|
|
834
|
-
}));
|
|
768
|
+
})), context.document.readPreparedResource));
|
|
835
769
|
if (bound.container !== void 0) {
|
|
836
770
|
resolveBoundContainer({
|
|
837
771
|
child,
|
|
@@ -945,7 +879,7 @@ function resolveChildrenPass(children, context, parentPath, insideGroup = false,
|
|
|
945
879
|
placeholderEntry.reference = committed.entry.reference;
|
|
946
880
|
content[contentSlot] = committed.contentNode;
|
|
947
881
|
} catch (error) {
|
|
948
|
-
context.slide.diagnostics.push(error instanceof CapabilityError ?
|
|
882
|
+
context.slide.diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path, true) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
949
883
|
}
|
|
950
884
|
});
|
|
951
885
|
return;
|
|
@@ -986,7 +920,7 @@ function resolveChildrenPass(children, context, parentPath, insideGroup = false,
|
|
|
986
920
|
content.push(committed.contentNode);
|
|
987
921
|
entries.push(committed.entry);
|
|
988
922
|
} catch (error) {
|
|
989
|
-
context.slide.diagnostics.push(error instanceof CapabilityError ?
|
|
923
|
+
context.slide.diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path, true) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
990
924
|
}
|
|
991
925
|
});
|
|
992
926
|
const objects = [];
|
|
@@ -1117,7 +1051,7 @@ function resolveBoundContainer(args) {
|
|
|
1117
1051
|
...resolvedObj.paint === void 0 ? {} : { paint: (paintContext) => resolvedObj.paint(paintContext) }
|
|
1118
1052
|
};
|
|
1119
1053
|
} catch (error) {
|
|
1120
|
-
context.slide.diagnostics.push(error instanceof CapabilityError ?
|
|
1054
|
+
context.slide.diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path, true) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
1121
1055
|
}
|
|
1122
1056
|
const childScope = authorId === void 0 ? parentScope : void 0;
|
|
1123
1057
|
const deferredBeforeChildren = childScope?.deferredTasks.length ?? 0;
|
|
@@ -1298,7 +1232,7 @@ function resolveContributions(children, contributions) {
|
|
|
1298
1232
|
}
|
|
1299
1233
|
return resolved;
|
|
1300
1234
|
}
|
|
1301
|
-
function collectOwnedContributions(children, modules, slide, parentPath, order, hidden, theme, slideNumber) {
|
|
1235
|
+
function collectOwnedContributions(children, modules, slide, parentPath, order, hidden, theme, slideNumber, options) {
|
|
1302
1236
|
children.forEach((child, index) => {
|
|
1303
1237
|
if (!("props" in child)) return;
|
|
1304
1238
|
const path = `${parentPath}/${capabilityLabel(child, index)}`;
|
|
@@ -1308,14 +1242,15 @@ function collectOwnedContributions(children, modules, slide, parentPath, order,
|
|
|
1308
1242
|
for (const annotation of module.compileDeclaration(child, {
|
|
1309
1243
|
path,
|
|
1310
1244
|
theme,
|
|
1311
|
-
slideNumber
|
|
1245
|
+
slideNumber,
|
|
1246
|
+
options
|
|
1312
1247
|
})) slide.contributions.push({
|
|
1313
1248
|
...annotation,
|
|
1314
1249
|
path,
|
|
1315
1250
|
order: order.value++
|
|
1316
1251
|
});
|
|
1317
1252
|
} catch (error) {
|
|
1318
|
-
slide.diagnostics.push(error instanceof CapabilityError ?
|
|
1253
|
+
slide.diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path, true) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
1319
1254
|
}
|
|
1320
1255
|
return;
|
|
1321
1256
|
}
|
|
@@ -1323,7 +1258,7 @@ function collectOwnedContributions(children, modules, slide, parentPath, order,
|
|
|
1323
1258
|
if (module === void 0 && hidden.has(child)) slide.diagnostics.push(diagnostic(path, "missing-capability", `No capability module registered for ${child.type}`));
|
|
1324
1259
|
return;
|
|
1325
1260
|
}
|
|
1326
|
-
collectOwnedContributions(child.children, modules, slide, path, order, hidden, theme, slideNumber);
|
|
1261
|
+
collectOwnedContributions(child.children, modules, slide, path, order, hidden, theme, slideNumber, options);
|
|
1327
1262
|
});
|
|
1328
1263
|
}
|
|
1329
1264
|
function collectNestedPlaceholders(children, modules, parentPath, allowDirect, diagnostics, onDirect) {
|
|
@@ -1336,8 +1271,7 @@ function collectNestedPlaceholders(children, modules, parentPath, allowDirect, d
|
|
|
1336
1271
|
collectNestedPlaceholders(child.children, modules, childPath, allowDirect, diagnostics, onDirect);
|
|
1337
1272
|
return;
|
|
1338
1273
|
}
|
|
1339
|
-
|
|
1340
|
-
if (childProps["placeholder"] !== void 0 || childProps["nativePlaceholder"] !== void 0) {
|
|
1274
|
+
if (readInternalDeclarationProps(child)["placeholder"] !== void 0) {
|
|
1341
1275
|
if (allowDirect) onDirect?.(child, childPath);
|
|
1342
1276
|
else diagnostics.push(diagnostic(childPath, "placeholder-inside-container", "Placeholders can only be bound directly on Slide"));
|
|
1343
1277
|
}
|
|
@@ -1350,35 +1284,22 @@ function buildSlidePlaceholderContexts(args) {
|
|
|
1350
1284
|
const seenKeys = /* @__PURE__ */ new Set();
|
|
1351
1285
|
if (rawPlaceholdersProp !== void 0 && !hasExplicitLayout) diagnostics.push(diagnostic(slidePath, "placeholder-requires-layout", `Slide ${JSON.stringify(slideId)} declares placeholders without a bound SlideLayout`));
|
|
1352
1286
|
collectNestedPlaceholders(children, modules, slidePath, true, diagnostics, (child, childPath) => {
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
if (rawNativePh !== void 0) {
|
|
1358
|
-
const parsed = nativePlaceholderRefSchema.safeParse(rawNativePh);
|
|
1359
|
-
if (!parsed.success) {
|
|
1360
|
-
diagnostics.push(zodIssueToBuildDiagnostic(childPath, "invalid-slide-placeholder", "Invalid nativePlaceholder specification", parsed.error.issues[0], "nativePlaceholder"));
|
|
1361
|
-
return;
|
|
1362
|
-
}
|
|
1363
|
-
parsedNativePh = parsed.data;
|
|
1287
|
+
const rawKey = readInternalDeclarationProps(child)["placeholder"];
|
|
1288
|
+
if (typeof rawKey !== "string" || rawKey.trim() === "") {
|
|
1289
|
+
diagnostics.push(diagnostic(childPath, "invalid-slide-placeholder", "placeholder key must be a non-empty string", { field: "placeholder" }));
|
|
1290
|
+
return;
|
|
1364
1291
|
}
|
|
1365
|
-
if (rawKey
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
return;
|
|
1369
|
-
}
|
|
1370
|
-
if (seenKeys.has(rawKey)) {
|
|
1371
|
-
diagnostics.push(diagnostic(childPath, "duplicate-slide-placeholder", `Placeholder ${JSON.stringify(rawKey)} can only be bound once per slide`));
|
|
1372
|
-
return;
|
|
1373
|
-
}
|
|
1374
|
-
seenKeys.add(rawKey);
|
|
1292
|
+
if (seenKeys.has(rawKey)) {
|
|
1293
|
+
diagnostics.push(diagnostic(childPath, "duplicate-slide-placeholder", `Placeholder ${JSON.stringify(rawKey)} can only be bound once per slide`));
|
|
1294
|
+
return;
|
|
1375
1295
|
}
|
|
1376
|
-
|
|
1296
|
+
seenKeys.add(rawKey);
|
|
1297
|
+
if (!hasExplicitLayout) {
|
|
1377
1298
|
diagnostics.push(diagnostic(childPath, "placeholder-requires-layout", `Placeholder ${JSON.stringify(rawKey)} requires a bound SlideLayout`));
|
|
1378
1299
|
return;
|
|
1379
1300
|
}
|
|
1380
|
-
const layoutPlaceholder =
|
|
1381
|
-
if (layoutPlaceholder === void 0
|
|
1301
|
+
const layoutPlaceholder = layoutSpec?.placeholders?.[rawKey];
|
|
1302
|
+
if (layoutPlaceholder === void 0) {
|
|
1382
1303
|
const layoutLabel = layoutSpec?.id ?? layoutSpec?.name ?? "<unnamed>";
|
|
1383
1304
|
diagnostics.push(diagnostic(childPath, "unknown-slide-placeholder", `SlideLayout ${JSON.stringify(layoutLabel)} does not define placeholder ${JSON.stringify(rawKey)}`));
|
|
1384
1305
|
return;
|
|
@@ -1387,30 +1308,28 @@ function buildSlidePlaceholderContexts(args) {
|
|
|
1387
1308
|
diagnostics.push(diagnostic(childPath, "placeholder-requires-layout", `Placeholder ${JSON.stringify(rawKey)} requires a SlideLayout owned by a SlideMaster`));
|
|
1388
1309
|
return;
|
|
1389
1310
|
}
|
|
1390
|
-
const
|
|
1391
|
-
const nativeRef =
|
|
1392
|
-
type
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
...layoutPlaceholder.hasCustomPrompt === void 0 ? {} : { hasCustomPrompt: layoutPlaceholder.hasCustomPrompt }
|
|
1311
|
+
const { type, idx, size, orient, hasCustomPrompt } = layoutPlaceholder;
|
|
1312
|
+
const nativeRef = {
|
|
1313
|
+
type,
|
|
1314
|
+
idx,
|
|
1315
|
+
size,
|
|
1316
|
+
orient,
|
|
1317
|
+
hasCustomPrompt
|
|
1398
1318
|
};
|
|
1399
|
-
const
|
|
1400
|
-
const masterPlaceholder = matchMasterPlaceholderSpec(masterSpec.placeholders, role);
|
|
1319
|
+
const masterPlaceholder = matchMasterPlaceholderSpec(masterSpec.placeholders, type);
|
|
1401
1320
|
contexts.set(child, {
|
|
1402
|
-
|
|
1321
|
+
key: rawKey,
|
|
1403
1322
|
nativeRef,
|
|
1404
1323
|
masterTheme: placeholderTheme ?? masterSpec.themeContext,
|
|
1405
1324
|
slideDimensions: dimensions,
|
|
1406
1325
|
...masterSpec.textStyles === void 0 ? {} : { masterTextStyles: masterSpec.textStyles },
|
|
1407
1326
|
...masterPlaceholder === void 0 ? {} : { masterPlaceholder },
|
|
1408
|
-
|
|
1327
|
+
layoutPlaceholder
|
|
1409
1328
|
});
|
|
1410
1329
|
});
|
|
1411
1330
|
return contexts;
|
|
1412
1331
|
}
|
|
1413
|
-
function resolveOwnerSlideCapabilities(args) {
|
|
1332
|
+
function* resolveOwnerSlideCapabilities(args) {
|
|
1414
1333
|
const { type, props, path, modules, dimensions, document, options, theme } = args;
|
|
1415
1334
|
const slideCapabilities = [];
|
|
1416
1335
|
const capabilities = {};
|
|
@@ -1422,17 +1341,17 @@ function resolveOwnerSlideCapabilities(args) {
|
|
|
1422
1341
|
children: []
|
|
1423
1342
|
};
|
|
1424
1343
|
for (const module of modules.slideModules.values()) {
|
|
1425
|
-
const hasSlideProps = (module.
|
|
1344
|
+
const hasSlideProps = (module.containerSlots?.[type === "slide-master" ? "master" : "layout"] ?? []).some((property) => readContainerSlot(props, property) !== void 0);
|
|
1426
1345
|
if (!hasSlideProps) continue;
|
|
1427
1346
|
try {
|
|
1428
|
-
const boundSlide = validateBoundSlideCapability(module.bindSlide(input, {
|
|
1347
|
+
const boundSlide = validateBoundSlideCapability(yield* completeBinding(module.bindSlide(input, {
|
|
1429
1348
|
path,
|
|
1430
1349
|
dimensions,
|
|
1431
1350
|
theme,
|
|
1432
1351
|
options,
|
|
1433
1352
|
slideNumber: 0,
|
|
1434
1353
|
contributions: []
|
|
1435
|
-
}));
|
|
1354
|
+
})));
|
|
1436
1355
|
continuityByDeclaration.set(module.declaration, boundSlide.continuity?.matchSourceKinds);
|
|
1437
1356
|
const resolvedSlideCap = boundSlide.resolveSlide({
|
|
1438
1357
|
path,
|
|
@@ -1458,7 +1377,7 @@ function resolveOwnerSlideCapabilities(args) {
|
|
|
1458
1377
|
...resolvedSlideCap.paint === void 0 ? {} : { paint: (paintContext) => resolvedSlideCap.paint(paintContext) }
|
|
1459
1378
|
});
|
|
1460
1379
|
} catch (error) {
|
|
1461
|
-
diagnostics.push(error instanceof CapabilityError ?
|
|
1380
|
+
diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
1462
1381
|
}
|
|
1463
1382
|
}
|
|
1464
1383
|
if (diagnostics.length > 0) throw new BuildError(diagnostics);
|
|
@@ -1471,7 +1390,27 @@ function resolveOwnerSlideCapabilities(args) {
|
|
|
1471
1390
|
function isCustomColorMap(colorMap) {
|
|
1472
1391
|
return Object.keys(defaultColorMap).some((slot) => colorMap[slot] !== defaultColorMap[slot]);
|
|
1473
1392
|
}
|
|
1474
|
-
function
|
|
1393
|
+
function validateObjectPlacements(children, modules, parentPath, diagnostics, insideSlide, ancestors = []) {
|
|
1394
|
+
children.forEach((child, index) => {
|
|
1395
|
+
if (!("props" in child)) return;
|
|
1396
|
+
const path = `${parentPath}/${capabilityLabel(child, index)}`;
|
|
1397
|
+
const module = modules.declarations.get(child.type);
|
|
1398
|
+
if (child.pageAffiliated === true && (!insideSlide || ancestors.length !== 0)) {
|
|
1399
|
+
diagnostics.push(module === void 0 ? diagnostic(path, "missing-capability", `No capability module registered for ${child.type}`) : diagnostic(path, "invalid-structure", `${child.type} must be a direct child of Slide`));
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
if (module !== void 0 && "bind" in module) try {
|
|
1403
|
+
module.validatePlacement?.(child, {
|
|
1404
|
+
insideSlide,
|
|
1405
|
+
ancestors
|
|
1406
|
+
});
|
|
1407
|
+
} catch (error) {
|
|
1408
|
+
diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
1409
|
+
}
|
|
1410
|
+
if (child.children.length > 0) validateObjectPlacements(child.children, modules, path, diagnostics, insideSlide, [...ancestors, child]);
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
function* resolveSlideDeclaration(parsed, modules, dimensions, document, options, documentTheme, layoutIdByKey, layoutByKey, masterByKey, inheritedContinuity, inheritedBackground, masterLayers, layoutLayers, inheritance) {
|
|
1475
1414
|
const { node, id, name, authorId, index, layoutKey, hasExplicitLayout, section, hidden = false, showMasterShapes } = parsed;
|
|
1476
1415
|
const slide = {
|
|
1477
1416
|
index,
|
|
@@ -1489,6 +1428,7 @@ function resolveSlideDeclaration(parsed, modules, dimensions, document, options,
|
|
|
1489
1428
|
const path = `deck/slide[${id}]`;
|
|
1490
1429
|
if (nonWhitespaceText(node.children)) slide.diagnostics.push(diagnostic(path, "unexpected-text", "Slide cannot directly contain text"));
|
|
1491
1430
|
const children = node.children.map(capabilityChild);
|
|
1431
|
+
validateObjectPlacements(children, modules, path, slide.diagnostics, true);
|
|
1492
1432
|
const layoutSpec = layoutKey === void 0 ? void 0 : layoutByKey.get(layoutKey);
|
|
1493
1433
|
const masterSpec = layoutSpec === void 0 ? void 0 : masterByKey.get(layoutSpec.masterKey);
|
|
1494
1434
|
const nodeProps = readInternalDeclarationProps(node);
|
|
@@ -1506,15 +1446,16 @@ function resolveSlideDeclaration(parsed, modules, dimensions, document, options,
|
|
|
1506
1446
|
diagnostics: slide.diagnostics
|
|
1507
1447
|
});
|
|
1508
1448
|
if (slide.diagnostics.length > 0) throw new BuildError(slide.diagnostics);
|
|
1449
|
+
const coreSlideStyle = modules.containerSlots.extractCoreProps("slide", nodeProps)["style"];
|
|
1509
1450
|
let theme;
|
|
1510
1451
|
try {
|
|
1511
|
-
theme = documentTheme.with(textStyleFrom(
|
|
1452
|
+
theme = documentTheme.with(textStyleFrom(coreSlideStyle));
|
|
1512
1453
|
} catch (error) {
|
|
1513
1454
|
if (!(error instanceof CapabilityError)) throw error;
|
|
1514
|
-
throw new BuildError([
|
|
1455
|
+
throw new BuildError([capabilityErrorToDiagnostic(error, path)]);
|
|
1515
1456
|
}
|
|
1516
|
-
const layout = new LayoutPass(modules.declarations, dimensions, index, options).run(children, path, theme,
|
|
1517
|
-
collectOwnedContributions(children, modules.declarations, slide, path, { value: 0 }, layout.hidden, theme, index);
|
|
1457
|
+
const layout = yield* new LayoutPass(modules.declarations, dimensions, index, options).run(children, path, theme, coreSlideStyle, (element) => placeholderContexts.get(element));
|
|
1458
|
+
collectOwnedContributions(children, modules.declarations, slide, path, { value: 0 }, layout.hidden, theme, index, options);
|
|
1518
1459
|
const resolvedChildren = resolveChildrenPass(children, {
|
|
1519
1460
|
document,
|
|
1520
1461
|
slide,
|
|
@@ -1530,32 +1471,25 @@ function resolveSlideDeclaration(parsed, modules, dimensions, document, options,
|
|
|
1530
1471
|
try {
|
|
1531
1472
|
contributions = resolveContributions(children, slide.contributions);
|
|
1532
1473
|
} catch (error) {
|
|
1533
|
-
slide.diagnostics.push(error instanceof CapabilityError ?
|
|
1474
|
+
slide.diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
1534
1475
|
}
|
|
1535
1476
|
const capabilities = {};
|
|
1536
1477
|
let footer;
|
|
1478
|
+
let comments;
|
|
1537
1479
|
const slideCapabilities = [];
|
|
1538
1480
|
const input = {
|
|
1539
1481
|
type: node.type,
|
|
1540
1482
|
props: nodeProps,
|
|
1541
1483
|
children: node.children.map(capabilityChild)
|
|
1542
1484
|
};
|
|
1543
|
-
const slideStyle = nodeProps["style"];
|
|
1544
|
-
const hasSlideStyleBackground = typeof slideStyle === "object" && slideStyle !== null && !Array.isArray(slideStyle) && Object.hasOwn(slideStyle, "background") && slideStyle["background"] !== void 0;
|
|
1545
|
-
if (hasSlideStyleBackground && ![...modules.slideModules.values()].some((module) => module.consumesOwnerBackgroundStyle === true)) slide.diagnostics.push(diagnostic(path, "missing-capability", "No capability module registered for Slide.style.background", {
|
|
1546
|
-
capability: "slide-background",
|
|
1547
|
-
field: "style.background"
|
|
1548
|
-
}));
|
|
1549
1485
|
for (const module of modules.slideModules.values()) {
|
|
1550
|
-
const
|
|
1551
|
-
const hasStyleBackground = module.consumesOwnerBackgroundStyle === true && hasSlideStyleBackground;
|
|
1552
|
-
const hasSlideProps = slideProps.some((property) => Object.hasOwn(nodeProps, property)) || hasStyleBackground;
|
|
1486
|
+
const hasSlideProps = (module.containerSlots?.slide ?? []).some((property) => readContainerSlot(nodeProps, property) !== void 0);
|
|
1553
1487
|
if (!module.always && !hasSlideProps) {
|
|
1554
1488
|
if (inheritedContinuity?.get(module.declaration) === true) slide.matchContinuityKinds = true;
|
|
1555
1489
|
continue;
|
|
1556
1490
|
}
|
|
1557
1491
|
try {
|
|
1558
|
-
const boundSlide = validateBoundSlideCapability(module.bindSlide(input, {
|
|
1492
|
+
const boundSlide = validateBoundSlideCapability(yield* completeBinding(module.bindSlide(input, {
|
|
1559
1493
|
path,
|
|
1560
1494
|
dimensions,
|
|
1561
1495
|
theme,
|
|
@@ -1563,7 +1497,7 @@ function resolveSlideDeclaration(parsed, modules, dimensions, document, options,
|
|
|
1563
1497
|
slideNumber: index,
|
|
1564
1498
|
contributions,
|
|
1565
1499
|
...inheritance === void 0 ? {} : { inheritance }
|
|
1566
|
-
}));
|
|
1500
|
+
})));
|
|
1567
1501
|
if ((boundSlide.continuity?.matchSourceKinds ?? inheritedContinuity?.get(module.declaration)) === true) slide.matchContinuityKinds = true;
|
|
1568
1502
|
const resolvedSlideCap = boundSlide.resolveSlide({
|
|
1569
1503
|
path,
|
|
@@ -1576,6 +1510,7 @@ function resolveSlideDeclaration(parsed, modules, dimensions, document, options,
|
|
|
1576
1510
|
...inheritance === void 0 ? {} : { inheritance }
|
|
1577
1511
|
});
|
|
1578
1512
|
if (resolvedSlideCap.observation !== void 0) capabilities[module.declaration] = resolvedSlideCap.observation;
|
|
1513
|
+
if (resolvedSlideCap.comments !== void 0) comments = resolvedSlideCap.comments;
|
|
1579
1514
|
if (resolvedSlideCap.footer !== void 0) footer = resolvedSlideCap.footer;
|
|
1580
1515
|
for (const extension of resolvedSlideCap.extensions) document.usedExtensions.add(extension);
|
|
1581
1516
|
recordResourceClaims(resolvedSlideCap.resourceClaims, document, slide.diagnostics, path);
|
|
@@ -1591,13 +1526,13 @@ function resolveSlideDeclaration(parsed, modules, dimensions, document, options,
|
|
|
1591
1526
|
...resolvedSlideCap.paint === void 0 ? {} : { paint: (paintContext) => resolvedSlideCap.paint(paintContext) }
|
|
1592
1527
|
});
|
|
1593
1528
|
} catch (error) {
|
|
1594
|
-
slide.diagnostics.push(error instanceof CapabilityError ?
|
|
1529
|
+
slide.diagnostics.push(error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error)));
|
|
1595
1530
|
}
|
|
1596
1531
|
}
|
|
1597
1532
|
for (const contribution of contributions) {
|
|
1598
1533
|
if (contribution.optional) continue;
|
|
1599
1534
|
const consumer = modules.slideModules.get(contribution.capability);
|
|
1600
|
-
if (consumer === void 0 || !consumer.always && !(consumer.
|
|
1535
|
+
if (consumer === void 0 || !consumer.always && !(consumer.containerSlots?.slide ?? []).some((property) => readContainerSlot(nodeProps, property) !== void 0)) slide.diagnostics.push(diagnostic(contribution.path, "missing-capability", `No capability module registered for ${contribution.capability}`));
|
|
1601
1536
|
}
|
|
1602
1537
|
if (slide.diagnostics.length > 0) throw new BuildError(slide.diagnostics);
|
|
1603
1538
|
const projectedObjects = projectObservations(resolvedChildren.objects, slide.layoutDerivedObjectIds, slide.transformsById);
|
|
@@ -1615,6 +1550,7 @@ function resolveSlideDeclaration(parsed, modules, dimensions, document, options,
|
|
|
1615
1550
|
objects: projectedObjects,
|
|
1616
1551
|
...sortedLayouts.length > 0 && { layouts: sortedLayouts },
|
|
1617
1552
|
...footer !== void 0 && { footer },
|
|
1553
|
+
...comments !== void 0 && { comments },
|
|
1618
1554
|
...Object.keys(capabilities).length > 0 && { capabilities }
|
|
1619
1555
|
};
|
|
1620
1556
|
const effectiveThemeOverride = parsed.themeOverride ?? layoutSpec?.themeOverride;
|
|
@@ -1644,16 +1580,28 @@ function resolveSlideDeclaration(parsed, modules, dimensions, document, options,
|
|
|
1644
1580
|
...inheritedBackground === void 0 ? {} : { inheritedBackground },
|
|
1645
1581
|
...masterLayers === void 0 ? {} : { masterLayers },
|
|
1646
1582
|
...layoutLayers === void 0 ? {} : { layoutLayers },
|
|
1647
|
-
content: resolvedChildren.content,
|
|
1583
|
+
content: [...resolvedChildren.content, ...(comments ?? []).map(({ id, path: commentPath, text }) => ({
|
|
1584
|
+
...id === void 0 ? {} : { authorId: id },
|
|
1585
|
+
reference: {
|
|
1586
|
+
kind: "part",
|
|
1587
|
+
partKind: "comment",
|
|
1588
|
+
path: commentPath,
|
|
1589
|
+
text
|
|
1590
|
+
},
|
|
1591
|
+
children: []
|
|
1592
|
+
}))],
|
|
1648
1593
|
layers: resolvedChildren.layers,
|
|
1649
1594
|
slideCapabilities
|
|
1650
1595
|
}
|
|
1651
1596
|
};
|
|
1652
1597
|
}
|
|
1653
|
-
function resolveSharedCanvasLayers(args) {
|
|
1598
|
+
function* resolveSharedCanvasLayers(args) {
|
|
1654
1599
|
const { children, path, style, modules, dimensions, options, theme, document, initialNextId = 2 } = args;
|
|
1600
|
+
const diagnostics = [];
|
|
1601
|
+
validateObjectPlacements(children, modules, path, diagnostics, false);
|
|
1602
|
+
if (diagnostics.length > 0) throw new BuildError(diagnostics);
|
|
1655
1603
|
if (children.length === 0) {
|
|
1656
|
-
if (style !== void 0) new LayoutPass(modules.declarations, dimensions, 1, options).run([], path, theme, style);
|
|
1604
|
+
if (style !== void 0) yield* new LayoutPass(modules.declarations, dimensions, 1, options).run([], path, theme, style);
|
|
1657
1605
|
return {
|
|
1658
1606
|
layers: [],
|
|
1659
1607
|
objects: []
|
|
@@ -1679,7 +1627,7 @@ function resolveSharedCanvasLayers(args) {
|
|
|
1679
1627
|
dimensions,
|
|
1680
1628
|
options,
|
|
1681
1629
|
theme,
|
|
1682
|
-
layout: new LayoutPass(modules.declarations, dimensions, 1, options).run(children, path, theme, style),
|
|
1630
|
+
layout: yield* new LayoutPass(modules.declarations, dimensions, 1, options).run(children, path, theme, style),
|
|
1683
1631
|
slideNumber: 1,
|
|
1684
1632
|
placeholderContexts: /* @__PURE__ */ new Map()
|
|
1685
1633
|
}, path);
|
|
@@ -1694,7 +1642,7 @@ function resolveSharedCanvasLayers(args) {
|
|
|
1694
1642
|
objects: projectObservations(resolved.objects, state.layoutDerivedObjectIds, state.transformsById)
|
|
1695
1643
|
};
|
|
1696
1644
|
}
|
|
1697
|
-
function resolveMasterOrLayoutSlideCapability(args) {
|
|
1645
|
+
function* resolveMasterOrLayoutSlideCapability(args) {
|
|
1698
1646
|
const { module, targetType, props, path, dimensions, theme, options, slideNumber, document } = args;
|
|
1699
1647
|
try {
|
|
1700
1648
|
const input = {
|
|
@@ -1702,14 +1650,14 @@ function resolveMasterOrLayoutSlideCapability(args) {
|
|
|
1702
1650
|
props,
|
|
1703
1651
|
children: []
|
|
1704
1652
|
};
|
|
1705
|
-
const resolvedCap = validateBoundSlideCapability(module.bindSlide(input, {
|
|
1653
|
+
const resolvedCap = validateBoundSlideCapability(yield* completeBinding(module.bindSlide(input, {
|
|
1706
1654
|
path,
|
|
1707
1655
|
dimensions,
|
|
1708
1656
|
theme,
|
|
1709
1657
|
options,
|
|
1710
1658
|
slideNumber,
|
|
1711
1659
|
contributions: []
|
|
1712
|
-
})).resolveSlide({
|
|
1660
|
+
}))).resolveSlide({
|
|
1713
1661
|
path,
|
|
1714
1662
|
dimensions,
|
|
1715
1663
|
contributions: [],
|
|
@@ -1735,7 +1683,7 @@ function resolveMasterOrLayoutSlideCapability(args) {
|
|
|
1735
1683
|
};
|
|
1736
1684
|
} catch (error) {
|
|
1737
1685
|
if (error instanceof BuildError) throw error;
|
|
1738
|
-
throw new BuildError([error instanceof CapabilityError ?
|
|
1686
|
+
throw new BuildError([error instanceof CapabilityError ? capabilityErrorToDiagnostic(error, path) : diagnostic(path, "capability-failure", error instanceof Error ? error.message : String(error))]);
|
|
1739
1687
|
}
|
|
1740
1688
|
}
|
|
1741
1689
|
function normalizeLayoutPlaceholderIndices(placeholders, reservedIndices = []) {
|
|
@@ -1834,11 +1782,12 @@ function deriveFooterPlaceholdersFromMap(placeholders) {
|
|
|
1834
1782
|
if (!parsed.success) return void 0;
|
|
1835
1783
|
return Object.keys(parsed.data).length > 0 ? parsed.data : void 0;
|
|
1836
1784
|
}
|
|
1837
|
-
function resolveDocument(container, modules, options) {
|
|
1785
|
+
function* resolveDocument(container, modules, options, readPreparedResource) {
|
|
1838
1786
|
const decks = childNodes(container.children);
|
|
1839
1787
|
if (decks.length !== 1 || decks[0]?.type !== "deck") throw new BuildError([diagnostic("deck", "document-root", "Build content must have exactly one Deck root component")]);
|
|
1840
1788
|
const deck = decks[0];
|
|
1841
1789
|
const deckProps = readInternalDeclarationProps(deck);
|
|
1790
|
+
modules.containerSlots.validate("deck", "deck", deckProps);
|
|
1842
1791
|
const { width, height, title } = parseDeckProps(deckProps);
|
|
1843
1792
|
const size = {
|
|
1844
1793
|
width,
|
|
@@ -1851,6 +1800,21 @@ function resolveDocument(container, modules, options) {
|
|
|
1851
1800
|
if (!(error instanceof CapabilityError)) throw error;
|
|
1852
1801
|
throw new BuildError([diagnostic("deck", error.code, error.message, error.details)]);
|
|
1853
1802
|
}
|
|
1803
|
+
const deckEmitters = [];
|
|
1804
|
+
for (const module of new Set(modules.containerSlots.owners.deck.values())) {
|
|
1805
|
+
const slots = (module.containerSlots?.deck ?? []).filter((slot) => readContainerSlot(deckProps, slot) !== void 0);
|
|
1806
|
+
if (slots.length === 0 || module.bindDeck === void 0) continue;
|
|
1807
|
+
try {
|
|
1808
|
+
const props = Object.fromEntries(slots.map((slot) => [slot, readContainerSlot(deckProps, slot)]));
|
|
1809
|
+
deckEmitters.push(module.bindDeck(props, {
|
|
1810
|
+
theme,
|
|
1811
|
+
options
|
|
1812
|
+
}));
|
|
1813
|
+
} catch (error) {
|
|
1814
|
+
if (!(error instanceof CapabilityError)) throw error;
|
|
1815
|
+
throw new BuildError([capabilityErrorToDiagnostic(error, "deck")]);
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1854
1818
|
const { masters: parsedMasters, layoutIdByKey, slides, sections } = resolveSlides(container, modules, theme.theme);
|
|
1855
1819
|
const mastersModule = modules.slideModules.get("slide-masters");
|
|
1856
1820
|
if (parsedMasters.length > 0 && mastersModule === void 0) throw new BuildError([diagnostic(parsedMasters[0].path, "missing-capability", "No capability module registered for slide-masters")]);
|
|
@@ -1865,6 +1829,7 @@ function resolveDocument(container, modules, options) {
|
|
|
1865
1829
|
const slideIndexById = new Map(slides.map((slide) => [slide.id, slide.index]));
|
|
1866
1830
|
const sharedCanvasRoots = [...parsedMasters.flatMap((m) => m.canvasChildren), ...parsedMasters.flatMap((m) => m.layouts.flatMap((l) => childNodes(l.node.children)))];
|
|
1867
1831
|
const document = {
|
|
1832
|
+
readPreparedResource,
|
|
1868
1833
|
usedExtensions: new Set(boundSections?.extensions ?? []),
|
|
1869
1834
|
resourceClaims: /* @__PURE__ */ new Map(),
|
|
1870
1835
|
fontUsages: /* @__PURE__ */ new Map(),
|
|
@@ -1873,8 +1838,6 @@ function resolveDocument(container, modules, options) {
|
|
|
1873
1838
|
reservedObjectNames: collectExplicitObjectNames(slides, modules.declarations, sharedCanvasRoots),
|
|
1874
1839
|
slideIndexById
|
|
1875
1840
|
};
|
|
1876
|
-
const bgModule = [...modules.slideModules.values()].find((module) => module.slot === "background" && module.consumesOwnerBackgroundStyle === true) ?? [...modules.slideModules.values()].find((module) => module.slot === "background");
|
|
1877
|
-
const footerModule = [...modules.slideModules.values()].find((module) => module.slot === "shape-tree" && module.declaration === "footer-placeholder");
|
|
1878
1841
|
const resolvedMasters = [];
|
|
1879
1842
|
const masterObservations = [];
|
|
1880
1843
|
const masterByKey = /* @__PURE__ */ new Map();
|
|
@@ -1882,6 +1845,7 @@ function resolveDocument(container, modules, options) {
|
|
|
1882
1845
|
const layoutByKey = /* @__PURE__ */ new Map();
|
|
1883
1846
|
const parsedLayoutByKey = /* @__PURE__ */ new Map();
|
|
1884
1847
|
const continuityByLayoutKey = /* @__PURE__ */ new Map();
|
|
1848
|
+
const bgModule = modules.containerSlots.owners.slide.get("background") ?? modules.containerSlots.owners.slide.get("style.background");
|
|
1885
1849
|
for (const parsedMaster of parsedMasters) {
|
|
1886
1850
|
let masterThemeBase;
|
|
1887
1851
|
try {
|
|
@@ -1889,9 +1853,9 @@ function resolveDocument(container, modules, options) {
|
|
|
1889
1853
|
if (parsedMaster.style !== void 0) masterThemeBase = masterThemeBase.withTextStyle(textStyleFrom(parsedMaster.style, masterThemeBase));
|
|
1890
1854
|
} catch (error) {
|
|
1891
1855
|
if (!(error instanceof CapabilityError)) throw error;
|
|
1892
|
-
throw new BuildError([
|
|
1856
|
+
throw new BuildError([capabilityErrorToDiagnostic(error, parsedMaster.path)]);
|
|
1893
1857
|
}
|
|
1894
|
-
const masterCapResult = resolveOwnerSlideCapabilities({
|
|
1858
|
+
const masterCapResult = yield* resolveOwnerSlideCapabilities({
|
|
1895
1859
|
type: "slide-master",
|
|
1896
1860
|
props: parsedMaster.props,
|
|
1897
1861
|
path: parsedMaster.path,
|
|
@@ -1901,10 +1865,12 @@ function resolveDocument(container, modules, options) {
|
|
|
1901
1865
|
options,
|
|
1902
1866
|
theme: masterThemeBase
|
|
1903
1867
|
});
|
|
1868
|
+
const bgModule = modules.containerSlots.owners.master.get("background") ?? modules.containerSlots.owners.master.get("style.background");
|
|
1869
|
+
const footerModule = modules.containerSlots.owners.master.get("footerPlaceholders");
|
|
1904
1870
|
let masterBackground;
|
|
1905
1871
|
if (parsedMaster.background !== void 0) {
|
|
1906
1872
|
if (bgModule === void 0) throw new BuildError([diagnostic(parsedMaster.path, "missing-capability", "No capability module registered for SlideMaster.background")]);
|
|
1907
|
-
masterBackground = resolveMasterOrLayoutSlideCapability({
|
|
1873
|
+
masterBackground = yield* resolveMasterOrLayoutSlideCapability({
|
|
1908
1874
|
module: bgModule,
|
|
1909
1875
|
targetType: "slide-master",
|
|
1910
1876
|
props: { background: parsedMaster.background },
|
|
@@ -1919,7 +1885,7 @@ function resolveDocument(container, modules, options) {
|
|
|
1919
1885
|
let masterFooterPlaceholders;
|
|
1920
1886
|
if (parsedMaster.footerPlaceholders !== void 0) {
|
|
1921
1887
|
if (footerModule === void 0) throw new BuildError([diagnostic(parsedMaster.path, "missing-capability", "No capability module registered for SlideMaster.footerPlaceholders")]);
|
|
1922
|
-
masterFooterPlaceholders = resolveMasterOrLayoutSlideCapability({
|
|
1888
|
+
masterFooterPlaceholders = yield* resolveMasterOrLayoutSlideCapability({
|
|
1923
1889
|
module: footerModule,
|
|
1924
1890
|
targetType: "slide-master",
|
|
1925
1891
|
props: { footerPlaceholders: parsedMaster.footerPlaceholders },
|
|
@@ -1931,7 +1897,7 @@ function resolveDocument(container, modules, options) {
|
|
|
1931
1897
|
document
|
|
1932
1898
|
});
|
|
1933
1899
|
}
|
|
1934
|
-
const masterPlaceholderVisuals = parsedMaster.placeholders !== void 0 && mastersModule !== void 0 ? resolveMasterOrLayoutSlideCapability({
|
|
1900
|
+
const masterPlaceholderVisuals = parsedMaster.placeholders !== void 0 && mastersModule !== void 0 ? yield* resolveMasterOrLayoutSlideCapability({
|
|
1935
1901
|
module: mastersModule,
|
|
1936
1902
|
targetType: "slide-master",
|
|
1937
1903
|
props: { placeholders: parsedMaster.placeholders },
|
|
@@ -1942,10 +1908,10 @@ function resolveDocument(container, modules, options) {
|
|
|
1942
1908
|
slideNumber: 1,
|
|
1943
1909
|
document
|
|
1944
1910
|
}) : void 0;
|
|
1945
|
-
const masterShared = resolveSharedCanvasLayers({
|
|
1911
|
+
const masterShared = yield* resolveSharedCanvasLayers({
|
|
1946
1912
|
children: parsedMaster.canvasChildren.map(capabilityChild),
|
|
1947
1913
|
path: parsedMaster.path,
|
|
1948
|
-
style:
|
|
1914
|
+
style: parsedMaster.style,
|
|
1949
1915
|
modules,
|
|
1950
1916
|
dimensions: size,
|
|
1951
1917
|
options,
|
|
@@ -1967,9 +1933,9 @@ function resolveDocument(container, modules, options) {
|
|
|
1967
1933
|
layoutThemeBase = layoutThemeBase.withTextStyle(textStyleFrom(parsedLayout.style, layoutThemeBase));
|
|
1968
1934
|
} catch (error) {
|
|
1969
1935
|
if (!(error instanceof CapabilityError)) throw error;
|
|
1970
|
-
throw new BuildError([
|
|
1936
|
+
throw new BuildError([capabilityErrorToDiagnostic(error, parsedLayout.path)]);
|
|
1971
1937
|
}
|
|
1972
|
-
const layoutCapResult = resolveOwnerSlideCapabilities({
|
|
1938
|
+
const layoutCapResult = yield* resolveOwnerSlideCapabilities({
|
|
1973
1939
|
type: "slide-layout",
|
|
1974
1940
|
props: parsedLayout.props,
|
|
1975
1941
|
path: parsedLayout.path,
|
|
@@ -1982,10 +1948,12 @@ function resolveDocument(container, modules, options) {
|
|
|
1982
1948
|
const mergedContinuity = new Map(masterCapResult.continuityByDeclaration);
|
|
1983
1949
|
for (const [decl, match] of layoutCapResult.continuityByDeclaration) if (match !== void 0) mergedContinuity.set(decl, match);
|
|
1984
1950
|
continuityByLayoutKey.set(parsedLayout.key, mergedContinuity);
|
|
1951
|
+
const bgModule = modules.containerSlots.owners.layout.get("background") ?? modules.containerSlots.owners.layout.get("style.background");
|
|
1952
|
+
const footerModule = modules.containerSlots.owners.layout.get("footerPlaceholders");
|
|
1985
1953
|
let layoutBackground;
|
|
1986
1954
|
if (parsedLayout.background !== void 0) {
|
|
1987
1955
|
if (bgModule === void 0) throw new BuildError([diagnostic(parsedLayout.path, "missing-capability", "No capability module registered for SlideLayout.background")]);
|
|
1988
|
-
layoutBackground = resolveMasterOrLayoutSlideCapability({
|
|
1956
|
+
layoutBackground = yield* resolveMasterOrLayoutSlideCapability({
|
|
1989
1957
|
module: bgModule,
|
|
1990
1958
|
targetType: "slide-layout",
|
|
1991
1959
|
props: { background: parsedLayout.background },
|
|
@@ -2000,7 +1968,7 @@ function resolveDocument(container, modules, options) {
|
|
|
2000
1968
|
let layoutFooterPlaceholders;
|
|
2001
1969
|
if (parsedLayout.footerPlaceholders !== void 0) {
|
|
2002
1970
|
if (footerModule === void 0) throw new BuildError([diagnostic(parsedLayout.path, "missing-capability", "No capability module registered for SlideLayout.footerPlaceholders")]);
|
|
2003
|
-
layoutFooterPlaceholders = resolveMasterOrLayoutSlideCapability({
|
|
1971
|
+
layoutFooterPlaceholders = yield* resolveMasterOrLayoutSlideCapability({
|
|
2004
1972
|
module: footerModule,
|
|
2005
1973
|
targetType: "slide-layout",
|
|
2006
1974
|
props: { footerPlaceholders: parsedLayout.footerPlaceholders },
|
|
@@ -2012,7 +1980,7 @@ function resolveDocument(container, modules, options) {
|
|
|
2012
1980
|
document
|
|
2013
1981
|
});
|
|
2014
1982
|
}
|
|
2015
|
-
const layoutPlaceholderVisuals = parsedLayout.placeholders !== void 0 && mastersModule !== void 0 ? resolveMasterOrLayoutSlideCapability({
|
|
1983
|
+
const layoutPlaceholderVisuals = parsedLayout.placeholders !== void 0 && mastersModule !== void 0 ? yield* resolveMasterOrLayoutSlideCapability({
|
|
2016
1984
|
module: mastersModule,
|
|
2017
1985
|
targetType: "slide-layout",
|
|
2018
1986
|
props: { placeholders: parsedLayout.placeholders },
|
|
@@ -2023,7 +1991,7 @@ function resolveDocument(container, modules, options) {
|
|
|
2023
1991
|
slideNumber: 1,
|
|
2024
1992
|
document
|
|
2025
1993
|
}) : void 0;
|
|
2026
|
-
const layoutShared = resolveSharedCanvasLayers({
|
|
1994
|
+
const layoutShared = yield* resolveSharedCanvasLayers({
|
|
2027
1995
|
children: parsedLayout.node.children.map(capabilityChild),
|
|
2028
1996
|
path: parsedLayout.path,
|
|
2029
1997
|
style: parsedLayout.style,
|
|
@@ -2088,7 +2056,9 @@ function resolveDocument(container, modules, options) {
|
|
|
2088
2056
|
layouts: observedLayouts
|
|
2089
2057
|
});
|
|
2090
2058
|
}
|
|
2091
|
-
const resolvedSlides =
|
|
2059
|
+
const resolvedSlides = [];
|
|
2060
|
+
for (const parsedSlide of slides) {
|
|
2061
|
+
options.signal?.throwIfAborted();
|
|
2092
2062
|
const boundMaster = parsedSlide.layoutKey === void 0 ? void 0 : masterByLayoutKey.get(parsedSlide.layoutKey);
|
|
2093
2063
|
const boundLayout = parsedSlide.layoutKey === void 0 ? void 0 : layoutByKey.get(parsedSlide.layoutKey);
|
|
2094
2064
|
let slideThemeBase;
|
|
@@ -2106,7 +2076,7 @@ function resolveDocument(container, modules, options) {
|
|
|
2106
2076
|
let inheritedBackground;
|
|
2107
2077
|
if (!Object.hasOwn(slideNodeProps, "background") && !hasSlideStyleBackground && parsedSlide.layoutKey !== void 0 && bgModule !== void 0) {
|
|
2108
2078
|
const inheritedDecl = parsedLayout?.background ?? parsedMaster?.background;
|
|
2109
|
-
if (inheritedDecl !== void 0) inheritedBackground = resolveMasterOrLayoutSlideCapability({
|
|
2079
|
+
if (inheritedDecl !== void 0) inheritedBackground = yield* resolveMasterOrLayoutSlideCapability({
|
|
2110
2080
|
module: bgModule,
|
|
2111
2081
|
targetType: "slide",
|
|
2112
2082
|
props: { background: inheritedDecl },
|
|
@@ -2134,8 +2104,8 @@ function resolveDocument(container, modules, options) {
|
|
|
2134
2104
|
const layoutShowsMaster = boundLayout?.showMasterShapes ?? true;
|
|
2135
2105
|
const activeMasterLayers = slideShowsMaster && layoutShowsMaster && (boundMaster?.layers?.length ?? 0) > 0 ? boundMaster.layers : void 0;
|
|
2136
2106
|
const activeLayoutLayers = slideShowsMaster && (boundLayout?.layers?.length ?? 0) > 0 ? boundLayout.layers : void 0;
|
|
2137
|
-
|
|
2138
|
-
}
|
|
2107
|
+
resolvedSlides.push(yield* resolveSlideDeclaration(parsedSlide, modules, size, document, options, slideThemeBase, layoutIdByKey, layoutByKey, masterByKey, parsedSlide.layoutKey === void 0 ? void 0 : continuityByLayoutKey.get(parsedSlide.layoutKey), inheritedBackground, activeMasterLayers, activeLayoutLayers, inheritance));
|
|
2108
|
+
}
|
|
2139
2109
|
const morphDiagnostics = [];
|
|
2140
2110
|
for (let index = 0; index < slides.length; index += 1) {
|
|
2141
2111
|
const current = slides[index];
|
|
@@ -2187,23 +2157,21 @@ function resolveDocument(container, modules, options) {
|
|
|
2187
2157
|
...mastersModule?.mastersEmitDriver === void 0 ? {} : { mastersEmitDriver: mastersModule.mastersEmitDriver },
|
|
2188
2158
|
sections,
|
|
2189
2159
|
...boundSections === void 0 ? {} : { sectionsEmitter: boundSections },
|
|
2160
|
+
...deckEmitters.length === 0 ? {} : { deckEmitters },
|
|
2190
2161
|
slides: resolvedSlides.map(({ internal: slideInternal }) => slideInternal),
|
|
2191
2162
|
resourceClaims: document.resourceClaims
|
|
2192
2163
|
};
|
|
2193
2164
|
registerInternalResolution(resolution, internal);
|
|
2194
2165
|
return resolution;
|
|
2195
2166
|
}
|
|
2196
|
-
function
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
return { children: [] };
|
|
2200
|
-
}
|
|
2201
|
-
function createResolver(modules) {
|
|
2202
|
-
const bound = bindCapabilityModules(modules);
|
|
2203
|
-
return function resolve(declaration, options = {}) {
|
|
2167
|
+
function createResolver(modules, catalog = []) {
|
|
2168
|
+
const bound = bindCapabilityModules(modules, catalog);
|
|
2169
|
+
return async function resolve(declaration, options = {}) {
|
|
2204
2170
|
validateResolveOptions(options);
|
|
2205
|
-
|
|
2206
|
-
|
|
2171
|
+
options.signal?.throwIfAborted();
|
|
2172
|
+
const snapshot = captureDeclaration(declaration);
|
|
2173
|
+
const files = createResolveFileCache();
|
|
2174
|
+
return files.complete(resolveDocument(snapshot, bound, options, files.readPrepared), options.signal);
|
|
2207
2175
|
};
|
|
2208
2176
|
}
|
|
2209
2177
|
function validateBoundSlideCapability(bound) {
|
|
@@ -2211,7 +2179,7 @@ function validateBoundSlideCapability(bound) {
|
|
|
2211
2179
|
if (typeof bound.resolveSlide !== "function") throw new CapabilityError("invalid-capability-binding", "Slide capability bindSlide() must return a resolveSlide handler");
|
|
2212
2180
|
return bound;
|
|
2213
2181
|
}
|
|
2214
|
-
function bindCapabilityModules(modules) {
|
|
2182
|
+
function bindCapabilityModules(modules, catalog) {
|
|
2215
2183
|
const declarations = /* @__PURE__ */ new Map();
|
|
2216
2184
|
const slideModules = /* @__PURE__ */ new Map();
|
|
2217
2185
|
for (const module of modules) {
|
|
@@ -2240,7 +2208,8 @@ function bindCapabilityModules(modules) {
|
|
|
2240
2208
|
}
|
|
2241
2209
|
return {
|
|
2242
2210
|
declarations,
|
|
2243
|
-
slideModules
|
|
2211
|
+
slideModules,
|
|
2212
|
+
containerSlots: createContainerSlotRegistry(slideModules.values(), catalog)
|
|
2244
2213
|
};
|
|
2245
2214
|
}
|
|
2246
|
-
export { createResolver };
|
|
2215
|
+
export { createResolver, validateResolveOptions };
|