@officedk/pptxdk 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.d.ts +5 -8
- package/dist/build.js +44 -52
- package/dist/core/dist/capabilities/audio/audio-declaration.js +7 -0
- package/dist/core/dist/capabilities/audio/audio-source.js +172 -0
- package/dist/core/dist/capabilities/audio/entry.js +122 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box-codegen.js +7 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box-declaration.js +8 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box.js +14 -15
- package/dist/core/dist/capabilities/box/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-codegen.js +11 -18
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-import.js +891 -468
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-labels.js +30 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-model.js +1 -1
- package/dist/{capabilities/dist/chart/preview/number-format.js → core/dist/capabilities/chart/chart-number-format.js} +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-schemas.js +73 -79
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-xml.js +41 -36
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart.js +175 -113
- package/dist/core/dist/capabilities/chart/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/axes-and-grid.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/bar-column.js +1 -1
- package/dist/core/dist/capabilities/chart/preview/data-labels.js +474 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/error-bars.js +3 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/index.js +28 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/layout.js +7 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/legend.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/line-area.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/markers.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/pie-doughnut.js +39 -60
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scales.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scatter.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/style.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/text-render.js +34 -24
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/trendlines.js +3 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/types.js +1 -1
- package/dist/core/dist/capabilities/comment/comment-codegen.js +25 -0
- package/dist/core/dist/capabilities/comment/comment-declaration.js +37 -0
- package/dist/core/dist/capabilities/comment/comment-import.js +176 -0
- package/dist/core/dist/capabilities/comment/comment.js +141 -0
- package/dist/core/dist/capabilities/comment/entry.js +1 -0
- package/dist/core/dist/capabilities/footer-placeholder/entry.js +2 -0
- package/dist/core/dist/capabilities/footer-placeholder/footer-placeholder-codegen.js +16 -0
- package/dist/{capabilities/dist/masters → core/dist/capabilities/footer-placeholder}/footer-placeholder.js +113 -50
- package/dist/core/dist/capabilities/footer-placeholder/print-header-footer-import.js +121 -0
- package/dist/core/dist/capabilities/footer-placeholder/print-header-footer.js +123 -0
- package/dist/core/dist/capabilities/group/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-codegen.js +6 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-declaration.js +8 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-import.js +36 -77
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group.js +17 -17
- package/dist/core/dist/capabilities/image/entry.js +4 -0
- package/dist/core/dist/capabilities/image/image-codegen.js +59 -0
- package/dist/core/dist/capabilities/image/image-declaration.js +8 -0
- package/dist/core/dist/capabilities/image/image-import.js +26 -0
- package/dist/core/dist/capabilities/image/image.js +57 -0
- package/dist/core/dist/capabilities/line/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-codegen.js +6 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-declaration.js +15 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-import.js +15 -95
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line.js +41 -43
- package/dist/core/dist/capabilities/masters/entry.js +1 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters-codegen.js +7 -26
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters.js +23 -35
- package/dist/core/dist/capabilities/motion/entry.js +5 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-codegen.js +15 -35
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-import.js +25 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-plan.js +17 -14
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-query.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion.js +79 -75
- package/dist/core/dist/capabilities/notes/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-codegen.js +4 -5
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-import.js +16 -13
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-schemas.js +6 -6
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes.js +16 -41
- package/dist/{import/dist/sections.js → core/dist/capabilities/notes/sections-import.js} +5 -5
- package/dist/core/dist/capabilities/placeholder/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder-codegen.js +5 -15
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder-schemas.js +7 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder.js +50 -107
- package/dist/core/dist/capabilities/shape/entry.js +6 -0
- package/dist/core/dist/capabilities/shape/shape-codegen.js +112 -0
- package/dist/core/dist/capabilities/shape/shape-import.js +152 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape.js +44 -30
- package/dist/core/dist/capabilities/shared/container-slots.js +59 -0
- package/dist/core/dist/capabilities/shared/date-time.js +98 -0
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-embedding.js +5 -6
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-engine.js +34 -13
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-import.js +62 -23
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-subset.js +24 -9
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font.js +4 -4
- package/dist/core/dist/capabilities/shared/geometry-codegen.js +101 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/geometry.js +47 -44
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/identity.js +56 -38
- package/dist/core/dist/capabilities/shared/image-codegen.js +94 -0
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-decode.js +17 -79
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-schemas.js +16 -26
- package/dist/core/dist/capabilities/shared/line-match.js +78 -0
- package/dist/core/dist/capabilities/shared/media-codegen.js +86 -0
- package/dist/core/dist/capabilities/shared/media-import.js +156 -0
- package/dist/core/dist/capabilities/shared/media-placement.js +20 -0
- package/dist/core/dist/capabilities/shared/media-poster.js +50 -0
- package/dist/core/dist/capabilities/shared/media-schemas.js +60 -0
- package/dist/core/dist/capabilities/shared/media-source.js +107 -0
- package/dist/core/dist/capabilities/shared/media-trim.js +102 -0
- package/dist/core/dist/capabilities/shared/media.js +134 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/morph-api.js +5 -5
- package/dist/{capabilities/dist/motion → core/dist/capabilities/shared}/motion-api.js +112 -99
- package/dist/{capabilities/dist/motion → core/dist/capabilities/shared}/motion-schemas.js +19 -5
- package/dist/{capabilities/dist/image/image-import.js → core/dist/capabilities/shared/picture-import.js} +97 -158
- package/dist/core/dist/capabilities/shared/picture-xml.js +13 -0
- package/dist/core/dist/capabilities/shared/picture.js +510 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/placeholder-import.js +50 -20
- package/dist/core/dist/capabilities/shared/placeholder-roles.js +42 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/preset-definitions.js +1 -1
- package/dist/core/dist/capabilities/shared/print-xml.js +77 -0
- package/dist/{capabilities/dist/text/text-codegen.js → core/dist/capabilities/shared/rich-text-codegen.js} +23 -102
- package/dist/core/dist/capabilities/shared/rich-text-import.js +472 -0
- package/dist/{capabilities/dist/shape → core/dist/capabilities/shared}/shape-declaration.js +14 -14
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/style-inheritance.js +12 -5
- package/dist/{capabilities/dist/text → core/dist/capabilities/shared}/text-declaration.js +7 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/text-schemas.js +77 -77
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/text-service.js +571 -260
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/visual.js +137 -112
- package/dist/core/dist/capabilities/slide-background/entry.js +1 -0
- package/dist/core/dist/capabilities/slide-background/slide-background-codegen.js +15 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-import.js +5 -5
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-xml.js +2 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background.js +27 -33
- package/dist/core/dist/capabilities/table/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-codegen.js +6 -13
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-import.js +22 -57
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-schemas.js +40 -37
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-xml.js +9 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table.js +60 -45
- package/dist/core/dist/capabilities/text/entry.js +3 -0
- package/dist/core/dist/capabilities/text/text-codegen.js +66 -0
- package/dist/core/dist/capabilities/text/text-import.js +468 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/text/text-xml.js +3 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/text/text.js +61 -54
- package/dist/core/dist/capabilities/transition/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-api.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-codegen.js +2 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-import.js +25 -27
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition.js +23 -23
- package/dist/core/dist/capabilities/video/entry.js +77 -0
- package/dist/core/dist/capabilities/video/video-declaration.js +7 -0
- package/dist/core/dist/capabilities/video/video-source.js +42 -0
- package/dist/{codegen/dist → core/dist/codegen}/assets.js +13 -8
- package/dist/{codegen/dist → core/dist/codegen}/codegen.js +54 -122
- package/dist/{codegen/dist → core/dist/codegen}/identifiers.js +17 -1
- package/dist/{codegen/dist → core/dist/codegen}/index.js +2 -2
- package/dist/{codegen/dist → core/dist/codegen}/printer.js +23 -4
- package/dist/core/dist/document/all.js +41 -0
- package/dist/core/dist/document/default.js +10 -0
- package/dist/core/dist/document/document.js +218 -0
- package/dist/core/dist/document/index.js +62 -0
- package/dist/core/dist/document/stages.js +54 -0
- package/dist/{emit/dist → core/dist/emit}/emit.js +122 -60
- package/dist/core/dist/emit/index.js +6 -0
- package/dist/core/dist/emit/ooxml.js +241 -0
- package/dist/{import/dist → core/dist/import}/import.js +221 -187
- package/dist/core/dist/import/index.js +19 -0
- package/dist/{import/dist → core/dist/import}/masters.js +253 -317
- package/dist/core/dist/import/media-timing.js +233 -0
- package/dist/{import/dist → core/dist/import}/notes-masters.js +48 -45
- package/dist/core/dist/index.js +47 -15
- package/dist/core/dist/{author-ids.js → kernel/author-ids.js} +1 -1
- package/dist/core/dist/{author-schemas.js → kernel/author-schemas.js} +59 -98
- package/dist/core/dist/{block-flex-layout.js → kernel/block-flex-layout.js} +109 -78
- package/dist/core/dist/kernel/build.js +4 -0
- package/dist/core/dist/kernel/capability.js +17 -0
- package/dist/{codegen/dist/types.js → core/dist/kernel/codegen.js} +22 -2
- package/dist/core/dist/kernel/container-slots.js +104 -0
- package/dist/core/dist/kernel/date-time-format.js +18 -0
- package/dist/core/dist/kernel/declaration-snapshot.js +68 -0
- package/dist/core/dist/{declaration.js → kernel/declaration.js} +1 -1
- package/dist/core/dist/{diagnostics.js → kernel/diagnostics.js} +22 -5
- package/dist/core/dist/{document-internals.js → kernel/document-internals.js} +1 -1
- package/dist/core/dist/{document.js → kernel/document.js} +6 -5
- package/dist/core/dist/kernel/drawing-units.js +14 -0
- package/dist/core/dist/{font-seal.js → kernel/font-seal.js} +2 -2
- package/dist/core/dist/{geometry-schemas.js → kernel/geometry-schemas.js} +2 -6
- package/dist/core/dist/{grid-layout.js → kernel/grid-layout.js} +156 -55
- package/dist/core/dist/{host.js → kernel/host.js} +1 -1
- package/dist/core/dist/kernel/index.js +24 -0
- package/dist/core/dist/{input-values.js → kernel/input-values.js} +4 -3
- package/dist/core/dist/kernel/layout-definition.js +7 -0
- package/dist/core/dist/{layout-protocol.js → kernel/layout-protocol.js} +1 -1
- package/dist/core/dist/{layout-schemas.js → kernel/layout-schemas.js} +2 -6
- package/dist/core/dist/{layout.js → kernel/layout.js} +37 -38
- package/dist/core/dist/{masters.js → kernel/masters.js} +32 -55
- package/dist/core/dist/{morph.js → kernel/morph.js} +1 -1
- package/dist/core/dist/{placeholders.js → kernel/placeholders.js} +23 -9
- package/dist/{import/dist → core/dist/kernel/pptx-read}/alternate-content.js +1 -1
- package/dist/{import/dist → core/dist/kernel/pptx-read}/diagnostics.js +1 -1
- package/dist/core/dist/kernel/pptx-read/drawing-list-import.js +251 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/fonts.js +1 -1
- package/dist/core/dist/kernel/pptx-read/index.js +15 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/mechanism.js +1 -1
- package/dist/core/dist/kernel/pptx-read/media.js +26 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/namespaces.js +5 -7
- package/dist/{import/dist → core/dist/kernel/pptx-read}/opc.js +62 -13
- package/dist/{import/dist → core/dist/kernel/pptx-read}/resources.js +1 -1
- package/dist/core/dist/kernel/pptx-read/shape-tree.js +57 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/themes.js +40 -5
- package/dist/{import/dist → core/dist/kernel/pptx-read}/visual.js +94 -67
- package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-fragments.js +56 -13
- package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-reader.js +8 -1
- package/dist/{emit/dist → core/dist/kernel/pptx-write}/shape-tree.js +1 -1
- package/dist/core/dist/kernel/pptx-write/timing.js +52 -0
- package/dist/{emit/dist/ooxml.js → core/dist/kernel/pptx-write/xml.js} +62 -274
- package/dist/core/dist/{query.js → kernel/query.js} +5 -1
- package/dist/core/dist/{resolution.js → kernel/resolution.js} +1 -1
- package/dist/core/dist/kernel/resolve-work.js +58 -0
- package/dist/core/dist/{resolve.js → kernel/resolve.js} +226 -257
- package/dist/core/dist/kernel/resource-source.js +11 -0
- package/dist/core/dist/{stage-options.js → kernel/stage-options.js} +23 -11
- package/dist/core/dist/{theme.js → kernel/theme.js} +54 -36
- package/dist/core/dist/{transform-geometry.js → kernel/transform-geometry.js} +1 -1
- package/dist/core/dist/kernel/xml-values.js +13 -0
- package/dist/{document-41spD7bq.d.ts → document-C0lPlH-L.d.ts} +614 -522
- package/dist/{capability-BbKW9w4O.d.ts → index-B9_OUeA-.d.ts} +660 -553
- package/dist/{index-BEwhk7c8.d.ts → index-BJEzQxWV.d.ts} +27 -24
- package/dist/{index-cK2KtukZ.d.ts → index-DA9flrlR.d.ts} +2 -17
- package/dist/{index-v77CTJev.d.ts → index-GSt0t9VO.d.ts} +3 -4
- package/dist/index.d.ts +7 -8
- package/dist/index.js +68 -66
- package/dist/node.d.ts +16 -14
- package/dist/node.js +86 -43
- package/dist/pptxdk/src/cli-commands.js +9 -5
- package/dist/pptxdk/src/compose.js +28 -29
- package/dist/pptxdk/src/preview-result.js +24 -0
- package/dist/{capabilities/dist/image → preview/dist}/gif-decoder.js +5 -5
- package/dist/preview/dist/index.js +84 -34
- package/dist/preview/dist/options.js +8 -4
- package/dist/preview/dist/raster.js +66 -0
- package/dist/preview/dist/svg-guard.js +8 -7
- package/dist/preview.d.ts +3 -9
- package/dist/preview.js +7 -25
- package/dist/react/dist/append.js +3 -3
- package/dist/react/dist/author/audio-elements.js +14 -0
- package/dist/{capabilities/dist/box → react/dist/author}/box-elements.js +5 -3
- package/dist/react/dist/author/chart-elements.js +14 -0
- package/dist/react/dist/author/comment-elements.js +15 -0
- package/dist/react/dist/author/group-elements.js +14 -0
- package/dist/react/dist/author/image-elements.js +14 -0
- package/dist/react/dist/author/line-elements.js +14 -0
- package/dist/{capabilities/dist/motion → react/dist/author}/motion-elements.js +6 -4
- package/dist/react/dist/author/notes-elements.js +14 -0
- package/dist/react/dist/author/placeholder-elements.js +14 -0
- package/dist/react/dist/author/shape-elements.js +14 -0
- package/dist/{capabilities/dist/table → react/dist/author}/table-elements.js +6 -4
- package/dist/{capabilities/dist/text → react/dist/author}/text-elements.js +15 -5
- package/dist/react/dist/author/video-elements.js +14 -0
- package/dist/react/dist/document-adapter.js +4 -4
- package/dist/react/dist/elements.js +7 -4
- package/dist/react/dist/from-vanilla.js +3 -3
- package/dist/react/dist/index.js +17 -3
- package/dist/react/dist/reconciler.js +3 -3
- package/dist/react.d.ts +103 -69
- package/dist/react.js +28 -28
- package/dist/{index-1ag7U9Jt.d.ts → stages-DYHSHKt4.d.ts} +23 -6
- package/dist/vanilla.d.ts +4 -4
- package/dist/vanilla.js +14 -15
- package/package.json +2 -5
- package/dist/build-zrZuX4fK.d.ts +0 -3
- package/dist/capabilities/dist/all.js +0 -34
- package/dist/capabilities/dist/chart/chart-elements.js +0 -12
- package/dist/capabilities/dist/chart/preview/data-labels.js +0 -334
- package/dist/capabilities/dist/document.js +0 -168
- package/dist/capabilities/dist/group/group-elements.js +0 -12
- package/dist/capabilities/dist/image/image-codegen.js +0 -164
- package/dist/capabilities/dist/image/image-declaration.js +0 -8
- package/dist/capabilities/dist/image/image-elements.js +0 -12
- package/dist/capabilities/dist/image/image-xml.js +0 -12
- package/dist/capabilities/dist/image/image.js +0 -552
- package/dist/capabilities/dist/line/line-elements.js +0 -12
- package/dist/capabilities/dist/notes/notes-elements.js +0 -12
- package/dist/capabilities/dist/notes/notes-xml.js +0 -38
- package/dist/capabilities/dist/placeholder/placeholder-elements.js +0 -13
- package/dist/capabilities/dist/shape/shape-codegen.js +0 -236
- package/dist/capabilities/dist/shape/shape-elements.js +0 -12
- package/dist/capabilities/dist/shape/shape-import.js +0 -628
- package/dist/capabilities/dist/slide-background/slide-background-codegen.js +0 -44
- package/dist/capabilities/dist/text/text-import.js +0 -1224
- package/dist/core/dist/build.js +0 -4
- package/dist/core/dist/capability.js +0 -15
- package/dist/emit/dist/index.js +0 -5
- package/dist/import/dist/index.js +0 -16
- package/dist/pptxdk/src/slide.js +0 -9
- package/dist/transition-6n8GZxSg.d.ts +0 -9
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { CapabilityError } from "../../core/dist/kernel/diagnostics.js";
|
|
2
|
+
import { isImmutableBytes, markImmutableBytes } from "../../core/dist/kernel/font-seal.js";
|
|
3
|
+
import "../../core/dist/kernel/index.js";
|
|
4
|
+
import { decodeGifFirstFrame } from "./gif-decoder.js";
|
|
5
|
+
// ../preview/dist/raster.js
|
|
6
|
+
const rasterFormat = {
|
|
7
|
+
"image/png": "png",
|
|
8
|
+
"image/jpeg": "jpeg",
|
|
9
|
+
"image/gif": "gif"
|
|
10
|
+
};
|
|
11
|
+
let loadingDecoders;
|
|
12
|
+
/** Loads the pixel decoders on demand for embedded images that need normalization. */
|
|
13
|
+
function loadImageDecoders() {
|
|
14
|
+
loadingDecoders ??= Promise.all([import("pngjs"), import("jpeg-js")]).then(([png, jpeg]) => ({
|
|
15
|
+
png,
|
|
16
|
+
jpeg
|
|
17
|
+
}));
|
|
18
|
+
return loadingDecoders;
|
|
19
|
+
}
|
|
20
|
+
const normalizedPngByImmutableBytes = /* @__PURE__ */ new WeakMap();
|
|
21
|
+
/**
|
|
22
|
+
* Decodes PNG, JPEG, or static first-frame GIF bytes into normalized PNG bytes for SVG embedding.
|
|
23
|
+
* Throws `preview-corrupt-image` if compressed pixel data is invalid.
|
|
24
|
+
*/
|
|
25
|
+
function decodeImageToPngBytes(image, decoders) {
|
|
26
|
+
const format = rasterFormat[image.contentType];
|
|
27
|
+
const immutableSource = isImmutableBytes(image.bytes);
|
|
28
|
+
if (immutableSource) {
|
|
29
|
+
const cached = normalizedPngByImmutableBytes.get(image.bytes);
|
|
30
|
+
if (cached?.contentType === image.contentType) return cached.pngBytes;
|
|
31
|
+
}
|
|
32
|
+
const { png: pngModule, jpeg: jpegModule } = decoders;
|
|
33
|
+
let decoded;
|
|
34
|
+
try {
|
|
35
|
+
switch (format) {
|
|
36
|
+
case "png":
|
|
37
|
+
decoded = pngModule.PNG.sync.read(Buffer.from(image.bytes));
|
|
38
|
+
break;
|
|
39
|
+
case "jpeg":
|
|
40
|
+
decoded = jpegModule.decode(image.bytes, { tolerantDecoding: false });
|
|
41
|
+
break;
|
|
42
|
+
case "gif":
|
|
43
|
+
decoded = decodeGifFirstFrame(image.bytes);
|
|
44
|
+
break;
|
|
45
|
+
default: return format;
|
|
46
|
+
}
|
|
47
|
+
} catch (error) {
|
|
48
|
+
if (error instanceof CapabilityError) throw new CapabilityError(error.code, error.message, error.path, error.details ?? { format });
|
|
49
|
+
throw new CapabilityError("preview-corrupt-image", error instanceof Error ? `Failed to decode ${format.toUpperCase()} image for preview: ${error.message}` : `Failed to decode ${format.toUpperCase()} image for preview`, void 0, { format });
|
|
50
|
+
}
|
|
51
|
+
const normalized = new pngModule.PNG({
|
|
52
|
+
width: decoded.width,
|
|
53
|
+
height: decoded.height
|
|
54
|
+
});
|
|
55
|
+
normalized.data = Buffer.from(decoded.data);
|
|
56
|
+
const pngBytes = new Uint8Array(pngModule.PNG.sync.write(normalized));
|
|
57
|
+
if (immutableSource) {
|
|
58
|
+
markImmutableBytes(pngBytes);
|
|
59
|
+
normalizedPngByImmutableBytes.set(image.bytes, {
|
|
60
|
+
contentType: image.contentType,
|
|
61
|
+
pngBytes
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return pngBytes;
|
|
65
|
+
}
|
|
66
|
+
export { decodeImageToPngBytes, loadImageDecoders };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bytesSha256 } from "../../core/dist/font-seal.js";
|
|
2
|
-
import "../../core/dist/
|
|
1
|
+
import { bytesSha256 } from "../../core/dist/kernel/font-seal.js";
|
|
2
|
+
import "../../core/dist/kernel/index.js";
|
|
3
3
|
// ../preview/dist/svg-guard.js
|
|
4
4
|
const EPSILON = 1e-6;
|
|
5
5
|
const SAFE_OFFSCREEN_PAD = 512;
|
|
@@ -926,7 +926,7 @@ function sanitizeBodyNode(node, ctm, canvas, safeViewport, state) {
|
|
|
926
926
|
if (!hasStroke && node.attrs.get("fill") === "none" && node.attrs.get("clip-path") === void 0) return null;
|
|
927
927
|
return node;
|
|
928
928
|
}
|
|
929
|
-
function resolveRasterTokensInSvgTree(svgRoot, registry) {
|
|
929
|
+
function resolveRasterTokensInSvgTree(svgRoot, registry, pendingRasterTokens) {
|
|
930
930
|
const occurrences = [];
|
|
931
931
|
const groups = /* @__PURE__ */ new Map();
|
|
932
932
|
const visitChildren = (parent) => {
|
|
@@ -935,8 +935,9 @@ function resolveRasterTokensInSvgTree(svgRoot, registry) {
|
|
|
935
935
|
if (child === void 0 || child.kind !== "element") continue;
|
|
936
936
|
if (child.tag === "image") {
|
|
937
937
|
const href = child.attrs.get("href");
|
|
938
|
-
|
|
939
|
-
|
|
938
|
+
const token = href === void 0 ? void 0 : pendingRasterTokens?.get(href) ?? href;
|
|
939
|
+
if (token !== void 0 && token.startsWith(RASTER_TOKEN_PREFIX)) {
|
|
940
|
+
const id = Number(token.slice(18));
|
|
940
941
|
const entry = Number.isInteger(id) && id >= 0 ? registry.getEntry(id) : void 0;
|
|
941
942
|
if (entry !== void 0) {
|
|
942
943
|
const x = child.attrs.get("x") ?? "0";
|
|
@@ -1042,7 +1043,7 @@ function resolveRasterTokensInSvgTree(svgRoot, registry) {
|
|
|
1042
1043
|
* and extreme off-canvas geometry that trigger Rust `geom.rs` panics, then materializes
|
|
1043
1044
|
* registered page raster tokens into either inline `<image>` or shared `<defs>` + `<use>`.
|
|
1044
1045
|
*/
|
|
1045
|
-
function sanitizeSvgForRasterization(svg, dimensions, rasterRegistry) {
|
|
1046
|
+
function sanitizeSvgForRasterization(svg, dimensions, rasterRegistry, pendingRasterTokens) {
|
|
1046
1047
|
const width = Number.isFinite(dimensions.width) && dimensions.width > EPSILON ? dimensions.width : 1;
|
|
1047
1048
|
const height = Number.isFinite(dimensions.height) && dimensions.height > EPSILON ? dimensions.height : 1;
|
|
1048
1049
|
const safeViewport = {
|
|
@@ -1083,7 +1084,7 @@ function sanitizeSvgForRasterization(svg, dimensions, rasterRegistry) {
|
|
|
1083
1084
|
}
|
|
1084
1085
|
svgRoot.children.length = 0;
|
|
1085
1086
|
svgRoot.children.push(...keptRootChildren);
|
|
1086
|
-
if (rasterRegistry !== void 0 && rasterRegistry.size > 0) resolveRasterTokensInSvgTree(svgRoot, rasterRegistry);
|
|
1087
|
+
if (rasterRegistry !== void 0 && rasterRegistry.size > 0) resolveRasterTokensInSvgTree(svgRoot, rasterRegistry, pendingRasterTokens);
|
|
1087
1088
|
return nodes.map(serializeSvgNode).join("");
|
|
1088
1089
|
}
|
|
1089
1090
|
export { createPageRasterRegistry, sanitizeSvgForRasterization };
|
package/dist/preview.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import { a as paint, c as ScreenGeometry, d as previewOptionsSchema, f as previewPageNumberSchema, h as screenPointSchema, i as PreviewResult, l as ScreenPoint, m as screenGeometrySchema, n as PreviewNode, o as PaintOptions, p as previewPagesSchema, r as PreviewPageResult, s as PreviewOptions, t as PaintResult, u as paintOptionsSchema } from "./index-v77CTJev.js";
|
|
1
|
+
import { C as CommonNode, Jr as PreviewError, St as ResolutionReport, Xr as PreviewPlaceholder, Yr as PreviewPageRangeError, _t as PreviewTransform, bt as Resolution, ci as previewErrorSchema, li as previewPlaceholderSchema } from "./index-B9_OUeA-.js";
|
|
2
|
+
import { a as paint, c as ScreenGeometry, d as previewOptionsSchema, f as previewPageNumberSchema, h as screenPointSchema, i as PreviewResult, l as ScreenPoint, m as screenGeometrySchema, n as PreviewNode, o as PaintOptions, p as previewPagesSchema, r as PreviewPageResult, s as PreviewOptions, t as PaintResult, u as paintOptionsSchema } from "./index-GSt0t9VO.js";
|
|
4
3
|
import { ReactNode } from "react";
|
|
5
|
-
/**
|
|
6
|
-
* Default static preview for both plain editable documents and JSX elements.
|
|
7
|
-
*
|
|
8
|
-
* Plain CommonNode documents run synchronously through resolve + paint without loading React or
|
|
9
|
-
* react-reconciler; JSX inputs dynamically load React expansion on demand.
|
|
10
|
-
*/
|
|
4
|
+
/** Resolves an editable document or JSX and renders selected pages. */
|
|
11
5
|
export declare function preview(input: ReactNode | CommonNode, options?: PreviewOptions): Promise<PreviewResult>;
|
|
12
6
|
export { type PaintOptions, type PaintResult, type PreviewError, type PreviewNode, type PreviewOptions, PreviewPageRangeError, type PreviewPageResult, type PreviewPlaceholder, type PreviewResult, type PreviewTransform, type Resolution, type ResolutionReport, type ScreenGeometry, type ScreenPoint, paint, paintOptionsSchema, previewErrorSchema, previewOptionsSchema, previewPageNumberSchema, previewPagesSchema, previewPlaceholderSchema, screenGeometrySchema, screenPointSchema };
|
package/dist/preview.js
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
import { PreviewPageRangeError, previewErrorSchema, previewPlaceholderSchema } from "./core/dist/stage-options.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import "./core/dist/build.js";
|
|
1
|
+
import { PreviewPageRangeError, previewErrorSchema, previewPlaceholderSchema } from "./core/dist/kernel/stage-options.js";
|
|
2
|
+
import "./core/dist/kernel/index.js";
|
|
3
|
+
import { paintOptionsSchema, previewOptionsSchema, previewPageNumberSchema, previewPagesSchema, screenGeometrySchema, screenPointSchema } from "./preview/dist/options.js";
|
|
5
4
|
import { paint } from "./preview/dist/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import { resolveDocumentInput } from "./pptxdk/src/compose.js";
|
|
5
|
+
import { runPreview } from "./pptxdk/src/preview-result.js";
|
|
8
6
|
// src/preview.ts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* Plain CommonNode documents run synchronously through resolve + paint without loading React or
|
|
14
|
-
* react-reconciler; JSX inputs dynamically load React expansion on demand.
|
|
15
|
-
*/
|
|
16
|
-
async function preview(input, options = {}) {
|
|
17
|
-
const validatedOptions = validatePaintOptions(options);
|
|
18
|
-
if (validatedOptions.signal?.aborted) throw validatedOptions.signal.reason;
|
|
19
|
-
const signalOption = validatedOptions.signal === void 0 ? {} : { signal: validatedOptions.signal };
|
|
20
|
-
const resolution = await resolveDocumentInput(resolveDocument, input, signalOption);
|
|
21
|
-
const { pages } = paint(resolution, validatedOptions);
|
|
22
|
-
return Object.freeze({
|
|
23
|
-
report: resolution.report,
|
|
24
|
-
pages,
|
|
25
|
-
slides: resolution.slides,
|
|
26
|
-
slide: (id) => resolution.slide(id)
|
|
27
|
-
});
|
|
7
|
+
/** Resolves an editable document or JSX and renders selected pages. */
|
|
8
|
+
function preview(input, options = {}) {
|
|
9
|
+
return runPreview(input, options);
|
|
28
10
|
}
|
|
29
11
|
export { PreviewPageRangeError, paint, paintOptionsSchema, preview, previewErrorSchema, previewOptionsSchema, previewPageNumberSchema, previewPagesSchema, previewPlaceholderSchema, screenGeometrySchema, screenPointSchema };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { validateAuthorIdScopes } from "../../core/dist/author-ids.js";
|
|
2
|
-
import { CommonNode } from "../../core/dist/document.js";
|
|
3
|
-
import "../../core/dist/
|
|
1
|
+
import { validateAuthorIdScopes } from "../../core/dist/kernel/author-ids.js";
|
|
2
|
+
import { CommonNode } from "../../core/dist/kernel/document.js";
|
|
3
|
+
import "../../core/dist/kernel/index.js";
|
|
4
4
|
// ../react/dist/append.js
|
|
5
5
|
function collectAnonymousIds(parent, ids) {
|
|
6
6
|
for (const child of parent.children) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createAudioNode } from "../../../core/dist/capabilities/audio/audio-declaration.js";
|
|
2
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
3
|
+
import "../../../core/dist/document/document.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { createElement } from "react";
|
|
6
|
+
// ../react/dist/author/audio-elements.js
|
|
7
|
+
/** Declares a native audio and its static poster. */
|
|
8
|
+
function Audio(props) {
|
|
9
|
+
return createElement("audio", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createAudioNode
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Audio };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { hostNodeCreator } from "../../../core/dist/host.js";
|
|
2
|
-
import
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createBoxNode } from "../../../core/dist/capabilities/box/box-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
3
5
|
import { createElement } from "react";
|
|
4
|
-
// ../
|
|
6
|
+
// ../react/dist/author/box-elements.js
|
|
5
7
|
/**
|
|
6
8
|
* Visible Box backgrounds and descendants inherit its entrance only when they do not declare one.
|
|
7
9
|
*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createChartNode } from "../../../core/dist/capabilities/chart/chart-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { motionElement } from "./motion-elements.js";
|
|
6
|
+
// ../react/dist/author/chart-elements.js
|
|
7
|
+
/** Declares an object compiled into a native chart by the official capability module. */
|
|
8
|
+
function Chart(props) {
|
|
9
|
+
return motionElement("chart", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createChartNode
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Chart };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createCommentNode } from "../../../core/dist/capabilities/comment/comment-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { createElement } from "react";
|
|
6
|
+
// ../react/dist/author/comment-elements.js
|
|
7
|
+
/** Declares a plain-text review comment as a direct child of Slide. */
|
|
8
|
+
function Comment({ children, ...props }) {
|
|
9
|
+
return createElement("comment", {
|
|
10
|
+
...props,
|
|
11
|
+
text: typeof children === "string" ? children : void 0,
|
|
12
|
+
[hostNodeCreator]: createCommentNode
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export { Comment };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createGroupNode } from "../../../core/dist/capabilities/group/group-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { motionElement } from "./motion-elements.js";
|
|
6
|
+
// ../react/dist/author/group-elements.js
|
|
7
|
+
/** Declares an editable group preserving native member structure within the React tree. */
|
|
8
|
+
function Group(props) {
|
|
9
|
+
return motionElement("group", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createGroupNode
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Group };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createImageNode } from "../../../core/dist/capabilities/image/image-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { motionElement } from "./motion-elements.js";
|
|
6
|
+
// ../react/dist/author/image-elements.js
|
|
7
|
+
/** Declares a native image handled by the image module within the React tree. */
|
|
8
|
+
function Image(props) {
|
|
9
|
+
return motionElement("image", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createImageNode
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Image };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createLineNode } from "../../../core/dist/capabilities/line/line-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { motionElement } from "./motion-elements.js";
|
|
6
|
+
// ../react/dist/author/line-elements.js
|
|
7
|
+
/** Declares a native `<p:cxnSp>` line or connector within the React tree. */
|
|
8
|
+
function Line(props) {
|
|
9
|
+
return motionElement("line", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createLineNode
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Line };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { hostNodeCreator } from "../../../core/dist/host.js";
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createMotionScopeHandle, createMotionScopeNode, createMotionStepIdentity, createMotionStepNode } from "../../../core/dist/capabilities/shared/motion-api.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import "./box-elements.js";
|
|
4
6
|
import { createElement, useState } from "react";
|
|
5
|
-
// ../
|
|
7
|
+
// ../react/dist/author/motion-elements.js
|
|
6
8
|
/**
|
|
7
9
|
* Keeps one pure scope identity for the lifetime of this component instance.
|
|
8
10
|
*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createNotesNode } from "../../../core/dist/capabilities/notes/notes-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { createElement } from "react";
|
|
6
|
+
// ../react/dist/author/notes-elements.js
|
|
7
|
+
/** Declares one page's rich-text speaker notes; repeated declarations on a page are a build error. */
|
|
8
|
+
function Notes(props) {
|
|
9
|
+
return createElement("notes", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createNotesNode
|
|
12
|
+
}, props.children);
|
|
13
|
+
}
|
|
14
|
+
export { Notes };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createPlaceholderNode } from "../../../core/dist/capabilities/placeholder/placeholder-schemas.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { createElement } from "react";
|
|
6
|
+
// ../react/dist/author/placeholder-elements.js
|
|
7
|
+
/** Declares an unpopulated native content placeholder bound to a layout placeholder slot. */
|
|
8
|
+
function Placeholder(props) {
|
|
9
|
+
return createElement("placeholder", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createPlaceholderNode
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Placeholder };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createShapeNode } from "../../../core/dist/capabilities/shared/shape-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { motionElement } from "./motion-elements.js";
|
|
6
|
+
// ../react/dist/author/shape-elements.js
|
|
7
|
+
/** Declares a native object handled by the shape module within the React tree. */
|
|
8
|
+
function Shape(props) {
|
|
9
|
+
return motionElement("shape", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createShapeNode
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Shape };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { hostNodeCreator } from "../../../core/dist/host.js";
|
|
2
|
-
import
|
|
3
|
-
import { createCellNode, createRowNode, createTableNode } from "
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createCellNode, createRowNode, createTableNode } from "../../../core/dist/capabilities/table/table-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { motionElement } from "./motion-elements.js";
|
|
4
6
|
import { createElement } from "react";
|
|
5
|
-
// ../
|
|
7
|
+
// ../react/dist/author/table-elements.js
|
|
6
8
|
/** Declares an editable native table in the React root handled by the table module. */
|
|
7
9
|
function Table(props) {
|
|
8
10
|
return motionElement("table", {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { hostNodeCreator } from "../../../core/dist/host.js";
|
|
2
|
-
import
|
|
3
|
-
import { createParagraphNode, createSlideNumberNode, createSpanNode, createSubNode, createSupNode, createTextNode } from "
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createDateTimeNode, createParagraphNode, createSlideNumberNode, createSpanNode, createSubNode, createSupNode, createTextNode } from "../../../core/dist/capabilities/shared/text-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { motionElement } from "./motion-elements.js";
|
|
4
6
|
import { createElement } from "react";
|
|
5
|
-
// ../
|
|
7
|
+
// ../react/dist/author/text-elements.js
|
|
6
8
|
/** Native text box; numeric height preserves a fixed region, while auto height uses explicit font measurement. */
|
|
7
9
|
function Text(props) {
|
|
8
10
|
return motionElement("text", {
|
|
@@ -45,10 +47,18 @@ function SlideNumber(props) {
|
|
|
45
47
|
[hostNodeCreator]: createSlideNumberNode
|
|
46
48
|
});
|
|
47
49
|
}
|
|
50
|
+
/** Declares a native inline date/time field with no children. */
|
|
51
|
+
function DateTime(props) {
|
|
52
|
+
return createElement("date-time", {
|
|
53
|
+
...props,
|
|
54
|
+
[hostNodeCreator]: createDateTimeNode
|
|
55
|
+
});
|
|
56
|
+
}
|
|
48
57
|
const inlineTextMarker = Symbol.for("@pptxdk/text-inline-element");
|
|
49
58
|
Object.defineProperty(P, inlineTextMarker, { value: true });
|
|
50
59
|
Object.defineProperty(Span, inlineTextMarker, { value: true });
|
|
51
60
|
Object.defineProperty(Sup, inlineTextMarker, { value: true });
|
|
52
61
|
Object.defineProperty(Sub, inlineTextMarker, { value: true });
|
|
53
62
|
Object.defineProperty(SlideNumber, inlineTextMarker, { value: true });
|
|
54
|
-
|
|
63
|
+
Object.defineProperty(DateTime, inlineTextMarker, { value: true });
|
|
64
|
+
export { DateTime, P, SlideNumber, Span, Sub, Sup, Text };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/kernel/host.js";
|
|
2
|
+
import "../../../core/dist/document/document.js";
|
|
3
|
+
import { createVideoNode } from "../../../core/dist/capabilities/video/video-declaration.js";
|
|
4
|
+
import "../../../core/dist/kernel/index.js";
|
|
5
|
+
import { createElement } from "react";
|
|
6
|
+
// ../react/dist/author/video-elements.js
|
|
7
|
+
/** Declares a native video and its static poster. */
|
|
8
|
+
function Video(props) {
|
|
9
|
+
return createElement("video", {
|
|
10
|
+
...props,
|
|
11
|
+
[hostNodeCreator]: createVideoNode
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Video };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BuildError, toBuildDiagnostic } from "../../core/dist/diagnostics.js";
|
|
2
|
-
import "../../core/dist/
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { BuildError, toBuildDiagnostic } from "../../core/dist/kernel/diagnostics.js";
|
|
2
|
+
import { CommonContainer, CommonNode } from "../../core/dist/kernel/document.js";
|
|
3
|
+
import { HostTextNode, hostNodeCreator, insertDeclarationChild, removeDeclarationChild, replaceDeclarationProps, setDeclarationText } from "../../core/dist/kernel/host.js";
|
|
4
|
+
import "../../core/dist/kernel/index.js";
|
|
5
5
|
import { hostMountPlaceholder } from "./mount.js";
|
|
6
6
|
// ../react/dist/document-adapter.js
|
|
7
7
|
const nodeOwnerContainer = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { CommonNode, RichTextContainer, createDeckNode, createSectionNode, createSlideLayoutNode, createSlideMasterNode, createSlideNode } from "../../core/dist/document.js";
|
|
2
|
-
import { hostNodeCreator } from "../../core/dist/host.js";
|
|
1
|
+
import { CommonNode, RichTextContainer, createDeckNode, createSectionNode, createSlideLayoutNode, createSlideMasterNode, createSlideNode } from "../../core/dist/kernel/document.js";
|
|
2
|
+
import { hostNodeCreator } from "../../core/dist/kernel/host.js";
|
|
3
|
+
import "../../core/dist/document/document.js";
|
|
4
|
+
import { isPlaceholderRichTextNodeType } from "../../core/dist/capabilities/shared/text-schemas.js";
|
|
5
|
+
import "../../core/dist/kernel/index.js";
|
|
3
6
|
import { Mount, createPlaceholderMount } from "./mount.js";
|
|
4
7
|
import { cloneElement, createElement, isValidElement } from "react";
|
|
5
8
|
// ../react/dist/elements.js
|
|
@@ -10,10 +13,10 @@ function createPlaceholderTextNode(props) {
|
|
|
10
13
|
function isInlineTextElement(value) {
|
|
11
14
|
if (!isValidElement(value)) return false;
|
|
12
15
|
if (typeof value.type === "function") return inlineTextMarker in value.type;
|
|
13
|
-
return value.type
|
|
16
|
+
return isPlaceholderRichTextNodeType(value.type);
|
|
14
17
|
}
|
|
15
18
|
function isInlineTextNode(node) {
|
|
16
|
-
return node.type
|
|
19
|
+
return isPlaceholderRichTextNodeType(node.type);
|
|
17
20
|
}
|
|
18
21
|
function expandPlaceholderEntry(key, value) {
|
|
19
22
|
if (value === void 0) return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BuildError, toBuildDiagnostic } from "../../core/dist/diagnostics.js";
|
|
2
|
-
import "../../core/dist/
|
|
3
|
-
import
|
|
1
|
+
import { BuildError, toBuildDiagnostic } from "../../core/dist/kernel/diagnostics.js";
|
|
2
|
+
import { CommonContainer, CommonNode } from "../../core/dist/kernel/document.js";
|
|
3
|
+
import "../../core/dist/kernel/index.js";
|
|
4
4
|
import { Mount } from "./mount.js";
|
|
5
5
|
import { createElement, useRef } from "react";
|
|
6
6
|
// ../react/dist/from-vanilla.js
|
package/dist/react/dist/index.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import { BuildError, toBuildDiagnostic } from "../../core/dist/diagnostics.js";
|
|
2
|
-
import "../../core/dist/index.js";
|
|
1
|
+
import { BuildError, toBuildDiagnostic } from "../../core/dist/kernel/diagnostics.js";
|
|
2
|
+
import "../../core/dist/kernel/index.js";
|
|
3
3
|
import { assertAppendableAuthorIds } from "./append.js";
|
|
4
4
|
import { expandReactDocument, expandReactFragment } from "./reconciler.js";
|
|
5
5
|
import { Deck, Section, Slide, SlideLayout, SlideMaster } from "./elements.js";
|
|
6
6
|
import { Mount } from "./mount.js";
|
|
7
7
|
import { fromVanilla } from "./from-vanilla.js";
|
|
8
|
+
import { Box } from "./author/box-elements.js";
|
|
9
|
+
import { Chart } from "./author/chart-elements.js";
|
|
10
|
+
import { Group } from "./author/group-elements.js";
|
|
11
|
+
import { Image } from "./author/image-elements.js";
|
|
12
|
+
import { Line } from "./author/line-elements.js";
|
|
13
|
+
import { MotionScope, Step, useMotionScope } from "./author/motion-elements.js";
|
|
14
|
+
import { Comment } from "./author/comment-elements.js";
|
|
15
|
+
import { Notes } from "./author/notes-elements.js";
|
|
16
|
+
import { Placeholder } from "./author/placeholder-elements.js";
|
|
17
|
+
import { Shape } from "./author/shape-elements.js";
|
|
18
|
+
import { Cell, Row, Table } from "./author/table-elements.js";
|
|
19
|
+
import { DateTime, P, SlideNumber, Span, Sub, Sup, Text } from "./author/text-elements.js";
|
|
20
|
+
import { Video } from "./author/video-elements.js";
|
|
21
|
+
import { Audio } from "./author/audio-elements.js";
|
|
8
22
|
// ../react/dist/index.js
|
|
9
23
|
function diagnostic(path, code, message) {
|
|
10
24
|
return toBuildDiagnostic(path, code, message);
|
|
@@ -86,4 +100,4 @@ async function appendJSX(target, element, options = {}) {
|
|
|
86
100
|
throw appendFailure(error);
|
|
87
101
|
}
|
|
88
102
|
}
|
|
89
|
-
export { Deck, Mount, Section, Slide, SlideLayout, SlideMaster, appendJSX, expandDocument, expandFragment, fromVanilla };
|
|
103
|
+
export { Audio, Box, Cell, Chart, Comment, DateTime, Deck, Group, Image, Line, MotionScope, Mount, Notes, P, Placeholder, Row, Section, Shape, Slide, SlideLayout, SlideMaster, SlideNumber, Span, Step, Sub, Sup, Table, Text, Video, appendJSX, expandDocument, expandFragment, fromVanilla, useMotionScope };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BuildError, toBuildDiagnostic } from "../../core/dist/diagnostics.js";
|
|
2
|
-
import "../../core/dist/
|
|
3
|
-
import
|
|
1
|
+
import { BuildError, toBuildDiagnostic } from "../../core/dist/kernel/diagnostics.js";
|
|
2
|
+
import { CommonContainer, CommonNode } from "../../core/dist/kernel/document.js";
|
|
3
|
+
import "../../core/dist/kernel/index.js";
|
|
4
4
|
import { appendInitialHostChild, commitMountHostInstance, createHostContainer, createHostInstance, createHostText, insertHostChild, isMountHostRecord, lockHandoffTree, releaseContainerMounts, removeHostChild, updateHostInstance, updateHostText } from "./document-adapter.js";
|
|
5
5
|
import { createContext } from "react";
|
|
6
6
|
import Reconciler from "react-reconciler";
|