@officedk/pptxdk 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/dist/build-zrZuX4fK.d.ts +3 -0
- package/dist/build.d.ts +35 -0
- package/dist/build.js +128 -0
- package/dist/capabilities/dist/all.js +34 -0
- package/dist/capabilities/dist/box/box-codegen.js +84 -0
- package/dist/capabilities/dist/box/box-declaration.js +32 -0
- package/dist/capabilities/dist/box/box-elements.js +17 -0
- package/dist/capabilities/dist/box/box.js +142 -0
- package/dist/capabilities/dist/chart/chart-codegen.js +79 -0
- package/dist/capabilities/dist/chart/chart-declaration.js +7 -0
- package/dist/capabilities/dist/chart/chart-elements.js +12 -0
- package/dist/capabilities/dist/chart/chart-import.js +2403 -0
- package/dist/capabilities/dist/chart/chart-labels.js +86 -0
- package/dist/capabilities/dist/chart/chart-model.js +9 -0
- package/dist/capabilities/dist/chart/chart-schemas.js +1088 -0
- package/dist/capabilities/dist/chart/chart-xml.js +788 -0
- package/dist/capabilities/dist/chart/chart.js +1119 -0
- package/dist/capabilities/dist/chart/preview/axes-and-grid.js +311 -0
- package/dist/capabilities/dist/chart/preview/bar-column.js +143 -0
- package/dist/capabilities/dist/chart/preview/data-labels.js +334 -0
- package/dist/capabilities/dist/chart/preview/error-bars.js +213 -0
- package/dist/capabilities/dist/chart/preview/index.js +192 -0
- package/dist/capabilities/dist/chart/preview/layout.js +592 -0
- package/dist/capabilities/dist/chart/preview/legend.js +273 -0
- package/dist/capabilities/dist/chart/preview/line-area.js +404 -0
- package/dist/capabilities/dist/chart/preview/markers.js +100 -0
- package/dist/capabilities/dist/chart/preview/number-format.js +247 -0
- package/dist/capabilities/dist/chart/preview/pie-doughnut.js +159 -0
- package/dist/capabilities/dist/chart/preview/scales.js +365 -0
- package/dist/capabilities/dist/chart/preview/scatter.js +131 -0
- package/dist/capabilities/dist/chart/preview/style.js +60 -0
- package/dist/capabilities/dist/chart/preview/text-render.js +116 -0
- package/dist/capabilities/dist/chart/preview/trendlines.js +537 -0
- package/dist/capabilities/dist/chart/preview/types.js +5 -0
- package/dist/capabilities/dist/document.js +168 -0
- package/dist/capabilities/dist/font/font-embedding.js +119 -0
- package/dist/capabilities/dist/font/font-engine.js +834 -0
- package/dist/capabilities/dist/font/font-import.js +766 -0
- package/dist/capabilities/dist/font/font-subset.js +55 -0
- package/dist/capabilities/dist/font/font.js +72 -0
- package/dist/capabilities/dist/group/group-codegen.js +74 -0
- package/dist/capabilities/dist/group/group-declaration.js +41 -0
- package/dist/capabilities/dist/group/group-elements.js +12 -0
- package/dist/capabilities/dist/group/group-import.js +649 -0
- package/dist/capabilities/dist/group/group-xml.js +8 -0
- package/dist/capabilities/dist/group/group.js +260 -0
- package/dist/capabilities/dist/image/gif-decoder.js +244 -0
- package/dist/capabilities/dist/image/image-codegen.js +164 -0
- package/dist/capabilities/dist/image/image-declaration.js +8 -0
- package/dist/capabilities/dist/image/image-decode.js +244 -0
- package/dist/capabilities/dist/image/image-elements.js +12 -0
- package/dist/capabilities/dist/image/image-import.js +984 -0
- package/dist/capabilities/dist/image/image-schemas.js +147 -0
- package/dist/capabilities/dist/image/image-xml.js +12 -0
- package/dist/capabilities/dist/image/image.js +552 -0
- package/dist/capabilities/dist/line/line-codegen.js +89 -0
- package/dist/capabilities/dist/line/line-declaration.js +72 -0
- package/dist/capabilities/dist/line/line-elements.js +12 -0
- package/dist/capabilities/dist/line/line-import.js +504 -0
- package/dist/capabilities/dist/line/line-xml.js +9 -0
- package/dist/capabilities/dist/line/line.js +331 -0
- package/dist/capabilities/dist/masters/footer-placeholder.js +683 -0
- package/dist/capabilities/dist/masters/masters-codegen.js +69 -0
- package/dist/capabilities/dist/masters/masters.js +250 -0
- package/dist/capabilities/dist/motion/motion-api.js +757 -0
- package/dist/capabilities/dist/motion/motion-codegen.js +406 -0
- package/dist/capabilities/dist/motion/motion-elements.js +43 -0
- package/dist/capabilities/dist/motion/motion-import.js +1568 -0
- package/dist/capabilities/dist/motion/motion-plan.js +2340 -0
- package/dist/capabilities/dist/motion/motion-query.js +423 -0
- package/dist/capabilities/dist/motion/motion-schemas.js +339 -0
- package/dist/capabilities/dist/motion/motion.js +1617 -0
- package/dist/capabilities/dist/notes/notes-codegen.js +19 -0
- package/dist/capabilities/dist/notes/notes-declaration.js +8 -0
- package/dist/capabilities/dist/notes/notes-elements.js +12 -0
- package/dist/capabilities/dist/notes/notes-import.js +292 -0
- package/dist/capabilities/dist/notes/notes-schemas.js +38 -0
- package/dist/capabilities/dist/notes/notes-xml.js +38 -0
- package/dist/capabilities/dist/notes/notes.js +194 -0
- package/dist/capabilities/dist/placeholder/placeholder-codegen.js +54 -0
- package/dist/capabilities/dist/placeholder/placeholder-elements.js +13 -0
- package/dist/capabilities/dist/placeholder/placeholder-schemas.js +33 -0
- package/dist/capabilities/dist/placeholder/placeholder.js +451 -0
- package/dist/capabilities/dist/shape/shape-codegen.js +236 -0
- package/dist/capabilities/dist/shape/shape-declaration.js +45 -0
- package/dist/capabilities/dist/shape/shape-elements.js +12 -0
- package/dist/capabilities/dist/shape/shape-import.js +628 -0
- package/dist/capabilities/dist/shape/shape-xml.js +6 -0
- package/dist/capabilities/dist/shape/shape.js +320 -0
- package/dist/capabilities/dist/shared/geometry.js +1681 -0
- package/dist/capabilities/dist/shared/identity.js +205 -0
- package/dist/capabilities/dist/shared/morph-api.js +11 -0
- package/dist/capabilities/dist/shared/placeholder-import.js +238 -0
- package/dist/capabilities/dist/shared/preset-definitions.js +22423 -0
- package/dist/capabilities/dist/shared/style-inheritance.js +161 -0
- package/dist/capabilities/dist/shared/text-schemas.js +241 -0
- package/dist/capabilities/dist/shared/text-service.js +2252 -0
- package/dist/capabilities/dist/shared/visual.js +1197 -0
- package/dist/capabilities/dist/slide-background/slide-background-codegen.js +44 -0
- package/dist/capabilities/dist/slide-background/slide-background-import.js +166 -0
- package/dist/capabilities/dist/slide-background/slide-background-xml.js +34 -0
- package/dist/capabilities/dist/slide-background/slide-background.js +238 -0
- package/dist/capabilities/dist/table/table-codegen.js +125 -0
- package/dist/capabilities/dist/table/table-declaration.js +15 -0
- package/dist/capabilities/dist/table/table-elements.js +27 -0
- package/dist/capabilities/dist/table/table-import.js +606 -0
- package/dist/capabilities/dist/table/table-schemas.js +334 -0
- package/dist/capabilities/dist/table/table-xml.js +30 -0
- package/dist/capabilities/dist/table/table.js +739 -0
- package/dist/capabilities/dist/text/text-codegen.js +198 -0
- package/dist/capabilities/dist/text/text-declaration.js +27 -0
- package/dist/capabilities/dist/text/text-elements.js +54 -0
- package/dist/capabilities/dist/text/text-import.js +1224 -0
- package/dist/capabilities/dist/text/text-xml.js +9 -0
- package/dist/capabilities/dist/text/text.js +320 -0
- package/dist/capabilities/dist/transition/transition-api.js +136 -0
- package/dist/capabilities/dist/transition/transition-codegen.js +45 -0
- package/dist/capabilities/dist/transition/transition-import.js +477 -0
- package/dist/capabilities/dist/transition/transition.js +260 -0
- package/dist/capability-BbKW9w4O.d.ts +2131 -0
- package/dist/cli.js +20 -0
- package/dist/codegen/dist/assets.js +79 -0
- package/dist/codegen/dist/codegen.js +691 -0
- package/dist/codegen/dist/identifiers.js +203 -0
- package/dist/codegen/dist/index.js +3 -0
- package/dist/codegen/dist/printer.js +143 -0
- package/dist/codegen/dist/types.js +77 -0
- package/dist/core/dist/author-ids.js +51 -0
- package/dist/core/dist/author-schemas.js +330 -0
- package/dist/core/dist/block-flex-layout.js +801 -0
- package/dist/core/dist/build.js +4 -0
- package/dist/core/dist/capability.js +15 -0
- package/dist/core/dist/declaration.js +16 -0
- package/dist/core/dist/diagnostics.js +353 -0
- package/dist/core/dist/document-internals.js +26 -0
- package/dist/core/dist/document.js +417 -0
- package/dist/core/dist/font-seal.js +204 -0
- package/dist/core/dist/geometry-schemas.js +256 -0
- package/dist/core/dist/grid-layout.js +449 -0
- package/dist/core/dist/host.js +40 -0
- package/dist/core/dist/index.js +15 -0
- package/dist/core/dist/input-values.js +61 -0
- package/dist/core/dist/layout-protocol.js +61 -0
- package/dist/core/dist/layout-schemas.js +201 -0
- package/dist/core/dist/layout.js +340 -0
- package/dist/core/dist/masters.js +194 -0
- package/dist/core/dist/morph.js +30 -0
- package/dist/core/dist/placeholders.js +275 -0
- package/dist/core/dist/query.js +190 -0
- package/dist/core/dist/resolution.js +12 -0
- package/dist/core/dist/resolve.js +2246 -0
- package/dist/core/dist/stage-options.js +300 -0
- package/dist/core/dist/theme.js +1023 -0
- package/dist/core/dist/transform-geometry.js +72 -0
- package/dist/document-41spD7bq.d.ts +1350 -0
- package/dist/emit/dist/emit.js +957 -0
- package/dist/emit/dist/index.js +5 -0
- package/dist/emit/dist/ooxml.js +661 -0
- package/dist/emit/dist/shape-tree.js +12 -0
- package/dist/import/dist/alternate-content.js +54 -0
- package/dist/import/dist/diagnostics.js +157 -0
- package/dist/import/dist/fonts.js +309 -0
- package/dist/import/dist/import.js +513 -0
- package/dist/import/dist/index.js +16 -0
- package/dist/import/dist/masters.js +1293 -0
- package/dist/import/dist/mechanism.js +10 -0
- package/dist/import/dist/namespaces.js +61 -0
- package/dist/import/dist/notes-masters.js +300 -0
- package/dist/import/dist/opc.js +233 -0
- package/dist/import/dist/resources.js +166 -0
- package/dist/import/dist/sections.js +139 -0
- package/dist/import/dist/themes.js +777 -0
- package/dist/import/dist/visual.js +821 -0
- package/dist/import/dist/xml-fragments.js +277 -0
- package/dist/import/dist/xml-reader.js +267 -0
- package/dist/index-1ag7U9Jt.d.ts +63 -0
- package/dist/index-BEwhk7c8.d.ts +72 -0
- package/dist/index-cK2KtukZ.d.ts +161 -0
- package/dist/index-v77CTJev.d.ts +55 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +82 -0
- package/dist/node.d.ts +53 -0
- package/dist/node.js +225 -0
- package/dist/pptxdk/src/cli-commands.js +907 -0
- package/dist/pptxdk/src/compose.js +53 -0
- package/dist/pptxdk/src/slide.js +9 -0
- package/dist/preview/dist/index.js +342 -0
- package/dist/preview/dist/options.js +40 -0
- package/dist/preview/dist/svg-guard.js +1089 -0
- package/dist/preview.d.ts +12 -0
- package/dist/preview.js +29 -0
- package/dist/react/dist/append.js +66 -0
- package/dist/react/dist/document-adapter.js +404 -0
- package/dist/react/dist/elements.js +82 -0
- package/dist/react/dist/from-vanilla.js +57 -0
- package/dist/react/dist/index.js +89 -0
- package/dist/react/dist/mount.js +34 -0
- package/dist/react/dist/reconciler.js +290 -0
- package/dist/react.d.ts +235 -0
- package/dist/react.js +31 -0
- package/dist/transition-6n8GZxSg.d.ts +9 -0
- package/dist/vanilla.d.ts +4 -0
- package/dist/vanilla.js +15 -0
- package/package.json +79 -3
- package/README.md +0 -3
|
@@ -0,0 +1,1568 @@
|
|
|
1
|
+
import { CommonContainer, CommonNode, RichTextContainer } from "../../../core/dist/document.js";
|
|
2
|
+
import { maximumTimeNodeValue, spinAngleSchema } from "./motion-schemas.js";
|
|
3
|
+
import "../../../import/dist/index.js";
|
|
4
|
+
import { A_NS, P_NS } from "../../../import/dist/namespaces.js";
|
|
5
|
+
import { ooxmlNonNegativeIntSchema, ooxmlPositiveIntSchema } from "../../../import/dist/xml-fragments.js";
|
|
6
|
+
import { createParagraphNode } from "../text/text-declaration.js";
|
|
7
|
+
import { after, appear, breathe, collapse, createMotionScopeHandle, createMotionScopeNode, createMotionStepIdentity, createMotionStepNode, disappear, fade, fadeOut, fillColor, floatDown, floatOut, floatUp, fly, flyOut, onStep, relativeLuminance, repeat, spin, spinIn, spinOut, stretch, wipe, wipeOut, zoom, zoomOut } from "./motion-api.js";
|
|
8
|
+
// ../capabilities/dist/motion/motion-import.js
|
|
9
|
+
const supportedBehaviorNames = /* @__PURE__ */ new Set([
|
|
10
|
+
"set",
|
|
11
|
+
"anim",
|
|
12
|
+
"animEffect",
|
|
13
|
+
"animRot",
|
|
14
|
+
"animClr"
|
|
15
|
+
]);
|
|
16
|
+
const entrancePresetById = {
|
|
17
|
+
1: "appear",
|
|
18
|
+
2: "fly",
|
|
19
|
+
10: "fade",
|
|
20
|
+
17: "stretch",
|
|
21
|
+
22: "wipe",
|
|
22
|
+
42: "floatUp",
|
|
23
|
+
47: "floatDown",
|
|
24
|
+
49: "spinIn",
|
|
25
|
+
53: "zoom"
|
|
26
|
+
};
|
|
27
|
+
const emphasisPresetById = {
|
|
28
|
+
8: "spin",
|
|
29
|
+
9: "fillColor"
|
|
30
|
+
};
|
|
31
|
+
const exitPresetById = {
|
|
32
|
+
1: "disappear",
|
|
33
|
+
2: "flyOut",
|
|
34
|
+
10: "fadeOut",
|
|
35
|
+
17: "collapse",
|
|
36
|
+
22: "wipeOut",
|
|
37
|
+
42: "floatOut",
|
|
38
|
+
47: "floatOut",
|
|
39
|
+
49: "spinOut",
|
|
40
|
+
53: "zoomOut"
|
|
41
|
+
};
|
|
42
|
+
function resolvePreset(presetClass, presetId, hasColorAnim, autoRev) {
|
|
43
|
+
if (presetId === void 0) return void 0;
|
|
44
|
+
if (presetClass === "emph") return emphasisPresetById[presetId] ?? (presetId === 0 && hasColorAnim && autoRev ? "breathe" : void 0);
|
|
45
|
+
if (presetClass === "exit") return exitPresetById[presetId];
|
|
46
|
+
if (presetClass === "entr") return entrancePresetById[presetId];
|
|
47
|
+
}
|
|
48
|
+
const directionBySubtype = {
|
|
49
|
+
1: "top",
|
|
50
|
+
2: "right",
|
|
51
|
+
4: "bottom",
|
|
52
|
+
8: "left"
|
|
53
|
+
};
|
|
54
|
+
function locationFor(context, xpath, objectId, objectName) {
|
|
55
|
+
return {
|
|
56
|
+
part: context.part,
|
|
57
|
+
xpath,
|
|
58
|
+
...context.slideIndex === void 0 ? {} : { slideIndex: context.slideIndex },
|
|
59
|
+
...objectId === void 0 ? {} : { objectId },
|
|
60
|
+
...objectName === void 0 ? {} : { objectName }
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function parsePositiveInt(raw, maxValue) {
|
|
64
|
+
if (raw === void 0) return void 0;
|
|
65
|
+
const parsed = ooxmlPositiveIntSchema.safeParse(raw);
|
|
66
|
+
if (!parsed.success) return void 0;
|
|
67
|
+
if (maxValue !== void 0 && parsed.data > maxValue) return void 0;
|
|
68
|
+
return parsed.data;
|
|
69
|
+
}
|
|
70
|
+
function parseNonNegativeInt(raw, maxValue) {
|
|
71
|
+
if (raw === void 0) return void 0;
|
|
72
|
+
const parsed = ooxmlNonNegativeIntSchema.safeParse(raw);
|
|
73
|
+
if (!parsed.success) return void 0;
|
|
74
|
+
if (maxValue !== void 0 && parsed.data > maxValue) return void 0;
|
|
75
|
+
return parsed.data;
|
|
76
|
+
}
|
|
77
|
+
function parseSignedInt(raw) {
|
|
78
|
+
if (raw === void 0 || !/^-?\d+$/u.test(raw)) return void 0;
|
|
79
|
+
const n = Number(raw);
|
|
80
|
+
return Number.isSafeInteger(n) ? n : void 0;
|
|
81
|
+
}
|
|
82
|
+
function parseRotationUnits(raw) {
|
|
83
|
+
const units = parseSignedInt(raw);
|
|
84
|
+
if (units === void 0) return void 0;
|
|
85
|
+
return spinAngleSchema.safeParse(units / 6e4).success ? units : void 0;
|
|
86
|
+
}
|
|
87
|
+
function consumeTargetElement(tgtEl) {
|
|
88
|
+
const refs = [];
|
|
89
|
+
tgtEl.children(P_NS, "sldTgt");
|
|
90
|
+
for (const spTgt of tgtEl.children(P_NS, "spTgt")) {
|
|
91
|
+
const spid = parsePositiveInt(spTgt.attr("spid"));
|
|
92
|
+
let isBackground = false;
|
|
93
|
+
for (const _bg of spTgt.children(P_NS, "bg")) isBackground = true;
|
|
94
|
+
let range;
|
|
95
|
+
for (const txEl of spTgt.children(P_NS, "txEl")) {
|
|
96
|
+
const pRg = txEl.child(P_NS, "pRg");
|
|
97
|
+
if (pRg !== void 0) {
|
|
98
|
+
const st = parseNonNegativeInt(pRg.attr("st"));
|
|
99
|
+
const end = parseNonNegativeInt(pRg.attr("end"));
|
|
100
|
+
if (st !== void 0 && end !== void 0 && st <= end) range = {
|
|
101
|
+
type: "paragraph",
|
|
102
|
+
start: st,
|
|
103
|
+
end
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const charRg = txEl.child(P_NS, "charRg");
|
|
107
|
+
if (charRg !== void 0) {
|
|
108
|
+
charRg.consumeAttr("st");
|
|
109
|
+
charRg.consumeAttr("end");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (const graphicEl of spTgt.children(P_NS, "graphicEl")) {
|
|
113
|
+
const chart = graphicEl.child(A_NS, "chart");
|
|
114
|
+
if (chart !== void 0) {
|
|
115
|
+
const seriesIdx = parseSignedInt(chart.attr("seriesIdx"));
|
|
116
|
+
const categoryIdx = parseSignedInt(chart.attr("categoryIdx"));
|
|
117
|
+
const bldStep = chart.attr("bldStep");
|
|
118
|
+
if (seriesIdx !== void 0 && categoryIdx !== void 0 && (bldStep === "gridLegend" || bldStep === "series" || bldStep === "category" || bldStep === "ptInSeries" || bldStep === "ptInCategory")) range = {
|
|
119
|
+
type: "chart",
|
|
120
|
+
step: bldStep,
|
|
121
|
+
seriesIndex: seriesIdx,
|
|
122
|
+
categoryIndex: categoryIdx
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (spid !== void 0) refs.push({
|
|
127
|
+
spid,
|
|
128
|
+
isBackground,
|
|
129
|
+
...range === void 0 ? {} : { range }
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return refs;
|
|
133
|
+
}
|
|
134
|
+
function consumeConditionList(condList, context, diagnostics) {
|
|
135
|
+
if (condList === void 0) return [];
|
|
136
|
+
const result = [];
|
|
137
|
+
for (const cond of condList.children(P_NS, "cond")) {
|
|
138
|
+
const evt = cond.attr("evt");
|
|
139
|
+
const rawDelay = cond.attr("delay");
|
|
140
|
+
let delayMs = 0;
|
|
141
|
+
if (rawDelay !== void 0 && rawDelay !== "indefinite") {
|
|
142
|
+
const parsedDelay = parseNonNegativeInt(rawDelay, maximumTimeNodeValue);
|
|
143
|
+
if (parsedDelay !== void 0) delayMs = parsedDelay;
|
|
144
|
+
else if (context !== void 0 && diagnostics !== void 0) diagnostics.push({
|
|
145
|
+
code: "invalid-xml-value",
|
|
146
|
+
category: "corrupt-input",
|
|
147
|
+
disposition: "recovered",
|
|
148
|
+
location: locationFor(context, `${cond.xpath}/@delay`),
|
|
149
|
+
attributeOrElement: "p:cond/@delay",
|
|
150
|
+
rawValue: rawDelay
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const sourceId = parsePositiveInt(cond.child(P_NS, "tn")?.attr("val"));
|
|
154
|
+
const tgtEl = cond.child(P_NS, "tgtEl");
|
|
155
|
+
if (tgtEl !== void 0) consumeTargetElement(tgtEl);
|
|
156
|
+
if (evt === "onBegin") result.push({
|
|
157
|
+
kind: "onBegin",
|
|
158
|
+
delayMs
|
|
159
|
+
});
|
|
160
|
+
else if (evt === "end" && sourceId !== void 0) result.push({
|
|
161
|
+
kind: "end",
|
|
162
|
+
sourceTimingId: sourceId,
|
|
163
|
+
offsetMs: delayMs
|
|
164
|
+
});
|
|
165
|
+
else result.push({
|
|
166
|
+
kind: "delay",
|
|
167
|
+
delayMs
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
function consumeCommonTimeNodeAttrs(cTn) {
|
|
173
|
+
const id = parsePositiveInt(cTn.attr("id"));
|
|
174
|
+
const dur = cTn.attr("dur");
|
|
175
|
+
cTn.consumeAttr("fill");
|
|
176
|
+
cTn.consumeAttr("restart");
|
|
177
|
+
const nodeType = cTn.attr("nodeType");
|
|
178
|
+
const presetId = parseNonNegativeInt(cTn.attr("presetID"));
|
|
179
|
+
const presetClass = cTn.attr("presetClass");
|
|
180
|
+
const presetSubtype = parseNonNegativeInt(cTn.attr("presetSubtype"));
|
|
181
|
+
const grpId = parseNonNegativeInt(cTn.attr("grpId"));
|
|
182
|
+
const rawRepeat = cTn.attr("repeatCount");
|
|
183
|
+
let repeatCount;
|
|
184
|
+
if (rawRepeat === "indefinite") repeatCount = "forever";
|
|
185
|
+
else if (rawRepeat !== void 0) {
|
|
186
|
+
const milliCount = parsePositiveInt(rawRepeat);
|
|
187
|
+
if (milliCount !== void 0 && milliCount >= 1e3 && milliCount % 1e3 === 0) repeatCount = milliCount / 1e3;
|
|
188
|
+
}
|
|
189
|
+
const rawAutoRev = cTn.attr("autoRev");
|
|
190
|
+
const autoRev = rawAutoRev === "1" || rawAutoRev === "true";
|
|
191
|
+
const accel = parseNonNegativeInt(cTn.attr("accel"));
|
|
192
|
+
const decel = parseNonNegativeInt(cTn.attr("decel"));
|
|
193
|
+
return {
|
|
194
|
+
...id === void 0 ? {} : { id },
|
|
195
|
+
...dur === void 0 ? {} : { dur },
|
|
196
|
+
...nodeType === void 0 ? {} : { nodeType },
|
|
197
|
+
...presetId === void 0 ? {} : { presetId },
|
|
198
|
+
...presetClass === void 0 ? {} : { presetClass },
|
|
199
|
+
...presetSubtype === void 0 ? {} : { presetSubtype },
|
|
200
|
+
...grpId === void 0 ? {} : { grpId },
|
|
201
|
+
...repeatCount === void 0 ? {} : { repeatCount },
|
|
202
|
+
autoRev,
|
|
203
|
+
...accel === void 0 ? {} : { accel },
|
|
204
|
+
...decel === void 0 ? {} : { decel }
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function consumeBehaviorValueWrapper(wrapper) {
|
|
208
|
+
if (wrapper === void 0) return;
|
|
209
|
+
for (const fltVal of wrapper.children(P_NS, "fltVal")) fltVal.consumeAttr("val");
|
|
210
|
+
for (const strVal of wrapper.children(P_NS, "strVal")) strVal.consumeAttr("val");
|
|
211
|
+
for (const srgb of wrapper.children(A_NS, "srgbClr")) srgb.consumeAttr("val");
|
|
212
|
+
}
|
|
213
|
+
function readColorFromWrapper(wrapper) {
|
|
214
|
+
if (wrapper === void 0) return void 0;
|
|
215
|
+
const hex = wrapper.child(A_NS, "srgbClr")?.attr("val");
|
|
216
|
+
if (hex === void 0 || !/^[0-9a-f]{6}$/iu.test(hex)) return void 0;
|
|
217
|
+
return `#${hex.toUpperCase()}`;
|
|
218
|
+
}
|
|
219
|
+
function readBehaviorElement(behavior) {
|
|
220
|
+
const localName = behavior.localName;
|
|
221
|
+
if (localName === "animEffect") {
|
|
222
|
+
behavior.consumeAttr("transition");
|
|
223
|
+
behavior.consumeAttr("filter");
|
|
224
|
+
} else if (localName === "anim") {
|
|
225
|
+
behavior.consumeAttr("calcmode");
|
|
226
|
+
behavior.consumeAttr("valueType");
|
|
227
|
+
behavior.consumeAttr("from");
|
|
228
|
+
behavior.consumeAttr("to");
|
|
229
|
+
behavior.consumeAttr("by");
|
|
230
|
+
} else if (localName === "animClr") behavior.consumeAttr("clrSpc");
|
|
231
|
+
else if (localName === "animRot") {}
|
|
232
|
+
const rawRotFrom = localName === "animRot" ? behavior.attr("from") : void 0;
|
|
233
|
+
const rawRotTo = localName === "animRot" ? behavior.attr("to") : void 0;
|
|
234
|
+
const rawRotBy = localName === "animRot" ? behavior.attr("by") : void 0;
|
|
235
|
+
const rotationFrom = parseRotationUnits(rawRotFrom);
|
|
236
|
+
const rotationTo = parseRotationUnits(rawRotTo);
|
|
237
|
+
const rotationBy = parseRotationUnits(rawRotBy);
|
|
238
|
+
const invalidRotation = rawRotBy !== void 0 && rotationBy === void 0 ? {
|
|
239
|
+
attr: "by",
|
|
240
|
+
raw: rawRotBy
|
|
241
|
+
} : rawRotFrom !== void 0 && rotationFrom === void 0 ? {
|
|
242
|
+
attr: "from",
|
|
243
|
+
raw: rawRotFrom
|
|
244
|
+
} : rawRotTo !== void 0 && rotationTo === void 0 ? {
|
|
245
|
+
attr: "to",
|
|
246
|
+
raw: rawRotTo
|
|
247
|
+
} : void 0;
|
|
248
|
+
const cBhvr = behavior.child(P_NS, "cBhvr");
|
|
249
|
+
const additive = cBhvr?.attr("additive");
|
|
250
|
+
cBhvr?.consumeAttr("accumulate");
|
|
251
|
+
cBhvr?.consumeAttr("override");
|
|
252
|
+
const innerCTn = cBhvr?.child(P_NS, "cTn");
|
|
253
|
+
const innerAttrs = innerCTn === void 0 ? void 0 : consumeCommonTimeNodeAttrs(innerCTn);
|
|
254
|
+
if (innerCTn !== void 0) consumeConditionList(innerCTn.child(P_NS, "stCondLst"));
|
|
255
|
+
const durationMs = parsePositiveInt(innerAttrs?.dur, maximumTimeNodeValue);
|
|
256
|
+
const invalidDuration = localName !== "set" && innerCTn !== void 0 && innerAttrs?.dur !== void 0 && innerAttrs.dur !== "indefinite" && durationMs === void 0 ? {
|
|
257
|
+
raw: innerAttrs.dur,
|
|
258
|
+
xpath: `${innerCTn.xpath}/@dur`
|
|
259
|
+
} : void 0;
|
|
260
|
+
const tgtEl = cBhvr?.child(P_NS, "tgtEl");
|
|
261
|
+
const targets = tgtEl === void 0 ? [] : consumeTargetElement(tgtEl);
|
|
262
|
+
const attrNameLst = cBhvr?.child(P_NS, "attrNameLst");
|
|
263
|
+
const attrNames = [];
|
|
264
|
+
if (attrNameLst !== void 0) for (const attrName of attrNameLst.children(P_NS, "attrName")) attrNames.push(attrName.textContent.trim());
|
|
265
|
+
const tavLst = behavior.child(P_NS, "tavLst");
|
|
266
|
+
if (tavLst !== void 0) for (const tav of tavLst.children(P_NS, "tav")) {
|
|
267
|
+
tav.consumeAttr("tm");
|
|
268
|
+
tav.consumeAttr("fmla");
|
|
269
|
+
consumeBehaviorValueWrapper(tav.child(P_NS, "val"));
|
|
270
|
+
}
|
|
271
|
+
const fromEl = behavior.child(P_NS, "from");
|
|
272
|
+
const toEl = behavior.child(P_NS, "to");
|
|
273
|
+
let fromColor;
|
|
274
|
+
let toColor;
|
|
275
|
+
if (localName === "animClr") {
|
|
276
|
+
fromColor = readColorFromWrapper(fromEl);
|
|
277
|
+
toColor = readColorFromWrapper(toEl);
|
|
278
|
+
} else {
|
|
279
|
+
consumeBehaviorValueWrapper(fromEl);
|
|
280
|
+
consumeBehaviorValueWrapper(toEl);
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
localName,
|
|
284
|
+
xpath: behavior.xpath,
|
|
285
|
+
targets,
|
|
286
|
+
...durationMs === void 0 ? {} : { durationMs },
|
|
287
|
+
...invalidDuration === void 0 ? {} : { invalidDuration },
|
|
288
|
+
attrNames,
|
|
289
|
+
...additive === void 0 ? {} : { additive },
|
|
290
|
+
...fromColor === void 0 ? {} : { fromColor },
|
|
291
|
+
...toColor === void 0 ? {} : { toColor },
|
|
292
|
+
...rotationFrom === void 0 ? {} : { rotationFrom },
|
|
293
|
+
...rotationTo === void 0 ? {} : { rotationTo },
|
|
294
|
+
...rotationBy === void 0 ? {} : { rotationBy },
|
|
295
|
+
...invalidRotation === void 0 ? {} : { invalidRotation }
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function buildEffectDeclaration(args) {
|
|
299
|
+
const baseOptions = {
|
|
300
|
+
duration: args.durationMs,
|
|
301
|
+
delay: args.delayMs,
|
|
302
|
+
...args.easing === void 0 ? {} : { easing: args.easing }
|
|
303
|
+
};
|
|
304
|
+
const granularityOptions = {
|
|
305
|
+
...baseOptions,
|
|
306
|
+
...typeof args.by === "string" ? { by: args.by } : {},
|
|
307
|
+
...args.intervalMs === void 0 ? {} : { intervalMs: args.intervalMs }
|
|
308
|
+
};
|
|
309
|
+
const instantOptions = {
|
|
310
|
+
delay: args.delayMs,
|
|
311
|
+
...typeof args.by === "string" ? { by: args.by } : {},
|
|
312
|
+
...args.intervalMs === void 0 ? {} : { intervalMs: args.intervalMs }
|
|
313
|
+
};
|
|
314
|
+
let effect;
|
|
315
|
+
switch (args.preset) {
|
|
316
|
+
case "appear":
|
|
317
|
+
effect = appear(instantOptions);
|
|
318
|
+
break;
|
|
319
|
+
case "fade":
|
|
320
|
+
effect = fade(granularityOptions);
|
|
321
|
+
break;
|
|
322
|
+
case "wipe":
|
|
323
|
+
effect = wipe({
|
|
324
|
+
...granularityOptions,
|
|
325
|
+
...typeof args.from === "string" ? { from: args.from } : {}
|
|
326
|
+
});
|
|
327
|
+
break;
|
|
328
|
+
case "zoom":
|
|
329
|
+
effect = zoom(granularityOptions);
|
|
330
|
+
break;
|
|
331
|
+
case "fly":
|
|
332
|
+
effect = fly({
|
|
333
|
+
...granularityOptions,
|
|
334
|
+
...typeof args.from === "string" ? { from: args.from } : {}
|
|
335
|
+
});
|
|
336
|
+
break;
|
|
337
|
+
case "floatUp":
|
|
338
|
+
effect = floatUp(granularityOptions);
|
|
339
|
+
break;
|
|
340
|
+
case "floatDown":
|
|
341
|
+
effect = floatDown(granularityOptions);
|
|
342
|
+
break;
|
|
343
|
+
case "spinIn":
|
|
344
|
+
effect = spinIn(granularityOptions);
|
|
345
|
+
break;
|
|
346
|
+
case "stretch":
|
|
347
|
+
effect = stretch(granularityOptions);
|
|
348
|
+
break;
|
|
349
|
+
case "spin":
|
|
350
|
+
effect = typeof args.by === "number" ? spin({
|
|
351
|
+
...baseOptions,
|
|
352
|
+
by: args.by
|
|
353
|
+
}) : spin({
|
|
354
|
+
...granularityOptions,
|
|
355
|
+
...typeof args.from === "number" ? { from: args.from } : {},
|
|
356
|
+
...typeof args.to === "number" ? { to: args.to } : {}
|
|
357
|
+
});
|
|
358
|
+
break;
|
|
359
|
+
case "breathe":
|
|
360
|
+
effect = breathe({
|
|
361
|
+
period: args.durationMs,
|
|
362
|
+
from: args.fromColor ?? "#000000",
|
|
363
|
+
to: args.toColor ?? "#FFFFFF",
|
|
364
|
+
delay: args.delayMs,
|
|
365
|
+
...args.easing === void 0 ? {} : { easing: args.easing }
|
|
366
|
+
});
|
|
367
|
+
break;
|
|
368
|
+
case "fillColor":
|
|
369
|
+
effect = fillColor({
|
|
370
|
+
...baseOptions,
|
|
371
|
+
from: args.fromColor ?? "#000000",
|
|
372
|
+
to: args.toColor ?? "#FFFFFF"
|
|
373
|
+
});
|
|
374
|
+
break;
|
|
375
|
+
case "disappear":
|
|
376
|
+
effect = disappear(instantOptions);
|
|
377
|
+
break;
|
|
378
|
+
case "fadeOut":
|
|
379
|
+
effect = fadeOut(granularityOptions);
|
|
380
|
+
break;
|
|
381
|
+
case "wipeOut":
|
|
382
|
+
effect = wipeOut({
|
|
383
|
+
...granularityOptions,
|
|
384
|
+
...typeof args.from === "string" ? { from: args.from } : {}
|
|
385
|
+
});
|
|
386
|
+
break;
|
|
387
|
+
case "flyOut":
|
|
388
|
+
effect = flyOut({
|
|
389
|
+
...granularityOptions,
|
|
390
|
+
...typeof args.from === "string" ? { from: args.from } : {}
|
|
391
|
+
});
|
|
392
|
+
break;
|
|
393
|
+
case "zoomOut":
|
|
394
|
+
effect = zoomOut(granularityOptions);
|
|
395
|
+
break;
|
|
396
|
+
case "floatOut":
|
|
397
|
+
effect = floatOut(granularityOptions);
|
|
398
|
+
break;
|
|
399
|
+
case "spinOut":
|
|
400
|
+
effect = spinOut(granularityOptions);
|
|
401
|
+
break;
|
|
402
|
+
case "collapse": effect = collapse(granularityOptions);
|
|
403
|
+
}
|
|
404
|
+
const declaration = args.repeatCount === void 0 ? effect : repeat(effect, args.repeatCount);
|
|
405
|
+
return {
|
|
406
|
+
effect,
|
|
407
|
+
declaration
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function commonEffectPropsMatch(left, right) {
|
|
411
|
+
return left.targetId === right.targetId && left.effect.preset === right.effect.preset && left.effect.kind === right.effect.kind && left.effect.duration === right.effect.duration && left.from === right.from && left.to === right.to && left.repeatCount === right.repeatCount && JSON.stringify(left.easing ?? null) === JSON.stringify(right.easing ?? null);
|
|
412
|
+
}
|
|
413
|
+
function targetParagraphCount(node) {
|
|
414
|
+
if (node.kind !== "text" && node.kind !== "shape") return 0;
|
|
415
|
+
const explicitCount = node.children.filter((c) => c instanceof CommonNode && c.type === "paragraph").length;
|
|
416
|
+
if (explicitCount > 0) return explicitCount;
|
|
417
|
+
return node.children.length > 0 || node.kind === "text" ? 1 : 0;
|
|
418
|
+
}
|
|
419
|
+
function shapeFillState(node) {
|
|
420
|
+
if (node.kind !== "shape") return {
|
|
421
|
+
filled: false,
|
|
422
|
+
solidFilled: false
|
|
423
|
+
};
|
|
424
|
+
const style = node.props["style"];
|
|
425
|
+
if (typeof style !== "object" || style === null) return {
|
|
426
|
+
filled: false,
|
|
427
|
+
solidFilled: false
|
|
428
|
+
};
|
|
429
|
+
const background = style["background"];
|
|
430
|
+
if (background === void 0 || background === "none") return {
|
|
431
|
+
filled: false,
|
|
432
|
+
solidFilled: false
|
|
433
|
+
};
|
|
434
|
+
return {
|
|
435
|
+
filled: true,
|
|
436
|
+
solidFilled: typeof background === "string" || typeof background === "object" && background !== null && "color" in background && typeof background["color"] === "string"
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
function isValidRepeatModifier(args) {
|
|
440
|
+
const { preset, repeatCount, by, durationMs, delayMs } = args;
|
|
441
|
+
if (preset !== "spin" && preset !== "breathe") return false;
|
|
442
|
+
if (repeatCount === "forever") return preset === "breathe";
|
|
443
|
+
if (by !== void 0 && typeof by !== "number") return false;
|
|
444
|
+
if (!Number.isSafeInteger(repeatCount) || repeatCount < 1 || repeatCount > 4294967 || repeatCount * 1e3 > 4294967295) return false;
|
|
445
|
+
const unitDur = preset === "breathe" ? durationMs / 2 : Math.round(durationMs);
|
|
446
|
+
return Math.round(delayMs) <= 4294967295 && unitDur <= 4294967295 && Number.isSafeInteger(Math.round(delayMs) + Math.round(durationMs) * repeatCount);
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Reads slide, layout, or master `<p:timing>` back into live `enter`/`emphasis`,
|
|
450
|
+
* `Step`/`MotionScope`, or `OwnerMotion` declarations, emitting localized diagnostics
|
|
451
|
+
* with cascaded dependency tracking when targets or animation behaviors cannot be imported.
|
|
452
|
+
*/
|
|
453
|
+
function readSlideMotionImport(context) {
|
|
454
|
+
const timingCursors = context.slideCursor.children(P_NS, "timing");
|
|
455
|
+
if (timingCursors.length === 0) return {};
|
|
456
|
+
const diagnostics = [];
|
|
457
|
+
for (const extraTiming of timingCursors.slice(1)) {
|
|
458
|
+
diagnostics.push({
|
|
459
|
+
code: "invalid-xml-value",
|
|
460
|
+
category: "corrupt-input",
|
|
461
|
+
disposition: "recovered",
|
|
462
|
+
location: locationFor(context, extraTiming.xpath),
|
|
463
|
+
attributeOrElement: "p:timing"
|
|
464
|
+
});
|
|
465
|
+
extraTiming.suppressUnconsumed();
|
|
466
|
+
}
|
|
467
|
+
const timingCursor = timingCursors[0];
|
|
468
|
+
const paragraphBuilds = /* @__PURE__ */ new Map();
|
|
469
|
+
const chartBuilds = /* @__PURE__ */ new Map();
|
|
470
|
+
const bldLst = timingCursor.child(P_NS, "bldLst");
|
|
471
|
+
if (bldLst !== void 0) {
|
|
472
|
+
for (const bldP of bldLst.children(P_NS, "bldP")) {
|
|
473
|
+
const spid = parsePositiveInt(bldP.attr("spid"));
|
|
474
|
+
const grpId = parseNonNegativeInt(bldP.attr("grpId")) ?? 0;
|
|
475
|
+
const build = bldP.attr("build");
|
|
476
|
+
const rawAnimBg = bldP.attr("animBg");
|
|
477
|
+
bldP.consumeAttr("rev");
|
|
478
|
+
bldP.consumeAttr("advAuto");
|
|
479
|
+
bldP.consumeAttr("uiExpand");
|
|
480
|
+
bldP.consumeAttr("bld");
|
|
481
|
+
const animBg = rawAnimBg === "1" || rawAnimBg === "true" ? true : rawAnimBg === "0" || rawAnimBg === "false" ? false : void 0;
|
|
482
|
+
if (spid !== void 0) paragraphBuilds.set(`${spid}:${grpId}`, {
|
|
483
|
+
...build === void 0 ? {} : { build },
|
|
484
|
+
...animBg === void 0 ? {} : { animBg }
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
for (const bldGraphic of bldLst.children(P_NS, "bldGraphic")) {
|
|
488
|
+
const spid = parsePositiveInt(bldGraphic.attr("spid"));
|
|
489
|
+
const grpId = parseNonNegativeInt(bldGraphic.attr("grpId")) ?? 0;
|
|
490
|
+
bldGraphic.consumeAttr("uiExpand");
|
|
491
|
+
let mode;
|
|
492
|
+
if (bldGraphic.child("http://schemas.openxmlformats.org/presentationml/2006/main", "bldAsOne") !== void 0) mode = "all";
|
|
493
|
+
const bldSub = bldGraphic.child(P_NS, "bldSub");
|
|
494
|
+
if (bldSub !== void 0) {
|
|
495
|
+
const bldChart = bldSub.child(A_NS, "bldChart");
|
|
496
|
+
const rawBld = bldChart?.attr("bld");
|
|
497
|
+
bldChart?.consumeAttr("animBg");
|
|
498
|
+
if (rawBld === "all" || rawBld === "series" || rawBld === "category" || rawBld === "seriesEl" || rawBld === "categoryEl") mode = rawBld;
|
|
499
|
+
}
|
|
500
|
+
if (spid !== void 0 && mode !== void 0) chartBuilds.set(`${spid}:${grpId}`, { mode });
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
const rootCTn = (timingCursor.child(P_NS, "tnLst")?.child(P_NS, "par"))?.child(P_NS, "cTn");
|
|
504
|
+
if (rootCTn === void 0) {
|
|
505
|
+
diagnostics.push({
|
|
506
|
+
code: "corrupt-part",
|
|
507
|
+
category: "corrupt-input",
|
|
508
|
+
disposition: "omitted",
|
|
509
|
+
location: locationFor(context, timingCursor.xpath)
|
|
510
|
+
});
|
|
511
|
+
timingCursor.suppressUnconsumed();
|
|
512
|
+
return { diagnostics };
|
|
513
|
+
}
|
|
514
|
+
consumeCommonTimeNodeAttrs(rootCTn);
|
|
515
|
+
consumeConditionList(rootCTn.child(P_NS, "stCondLst"));
|
|
516
|
+
const rootChildTnLst = rootCTn.child(P_NS, "childTnLst");
|
|
517
|
+
let mainSeq;
|
|
518
|
+
if (rootChildTnLst !== void 0) for (const childSeq of rootChildTnLst.children(P_NS, "seq")) {
|
|
519
|
+
childSeq.consumeAttr("concurrent");
|
|
520
|
+
childSeq.consumeAttr("nextAc");
|
|
521
|
+
const seqCTn = childSeq.child(P_NS, "cTn");
|
|
522
|
+
const attrs = seqCTn === void 0 ? void 0 : consumeCommonTimeNodeAttrs(seqCTn);
|
|
523
|
+
consumeConditionList(childSeq.child(P_NS, "prevCondLst"));
|
|
524
|
+
consumeConditionList(childSeq.child(P_NS, "nextCondLst"));
|
|
525
|
+
if (attrs?.nodeType === "mainSeq" && mainSeq === void 0) mainSeq = childSeq;
|
|
526
|
+
else {
|
|
527
|
+
diagnostics.push({
|
|
528
|
+
code: "unsupported-mechanism",
|
|
529
|
+
category: "unsupported",
|
|
530
|
+
disposition: "omitted",
|
|
531
|
+
location: locationFor(context, childSeq.xpath),
|
|
532
|
+
namespaceUri: childSeq.namespaceUri,
|
|
533
|
+
localName: childSeq.localName,
|
|
534
|
+
mechanismHint: `timing-sequence:${attrs?.nodeType ?? "unknown"}`
|
|
535
|
+
});
|
|
536
|
+
childSeq.suppressUnconsumed();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
const mainSeqChildren = (mainSeq?.child(P_NS, "cTn"))?.child(P_NS, "childTnLst");
|
|
540
|
+
if (mainSeqChildren === void 0) return diagnostics.length === 0 ? {} : { diagnostics };
|
|
541
|
+
const rawNodesById = /* @__PURE__ */ new Map();
|
|
542
|
+
const stepInfos = [];
|
|
543
|
+
const visitTimingNode = (cursor, parentTimingId, stepIndex) => {
|
|
544
|
+
const cTn = cursor.child(P_NS, "cTn");
|
|
545
|
+
if (cTn === void 0) return void 0;
|
|
546
|
+
const attrs = consumeCommonTimeNodeAttrs(cTn);
|
|
547
|
+
if (attrs.id === void 0) {
|
|
548
|
+
diagnostics.push({
|
|
549
|
+
code: "invalid-xml-value",
|
|
550
|
+
category: "corrupt-input",
|
|
551
|
+
disposition: "omitted",
|
|
552
|
+
location: locationFor(context, cTn.xpath),
|
|
553
|
+
attributeOrElement: "@id"
|
|
554
|
+
});
|
|
555
|
+
cursor.suppressUnconsumed();
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
const timingId = attrs.id;
|
|
559
|
+
const conds = consumeConditionList(cTn.child(P_NS, "stCondLst"), context, diagnostics);
|
|
560
|
+
let delayMs = 0;
|
|
561
|
+
const dependsOn = [];
|
|
562
|
+
for (const cond of conds) if (cond.kind === "delay") delayMs += cond.delayMs;
|
|
563
|
+
else if (cond.kind === "end") dependsOn.push({
|
|
564
|
+
timingId: cond.sourceTimingId,
|
|
565
|
+
offsetMs: cond.offsetMs
|
|
566
|
+
});
|
|
567
|
+
const endSyncEl = cTn.child(P_NS, "endSync");
|
|
568
|
+
let endSyncAll = false;
|
|
569
|
+
if (endSyncEl !== void 0) {
|
|
570
|
+
const evt = endSyncEl.attr("evt");
|
|
571
|
+
endSyncEl.consumeAttr("delay");
|
|
572
|
+
const val = endSyncEl.child(P_NS, "rtn")?.attr("val");
|
|
573
|
+
endSyncAll = evt === "end" && (val === "all" || val === void 0);
|
|
574
|
+
}
|
|
575
|
+
const iterateEl = cTn.child(P_NS, "iterate");
|
|
576
|
+
let iterateBy;
|
|
577
|
+
let iterateIntervalMs;
|
|
578
|
+
if (iterateEl !== void 0) {
|
|
579
|
+
const rawType = iterateEl.attr("type");
|
|
580
|
+
if (rawType === "wd") iterateBy = "word";
|
|
581
|
+
else if (rawType === "lt") iterateBy = "letter";
|
|
582
|
+
const tmAbs = iterateEl.child(P_NS, "tmAbs");
|
|
583
|
+
const rawInterval = tmAbs?.attr("val");
|
|
584
|
+
iterateIntervalMs = parsePositiveInt(rawInterval, maximumTimeNodeValue);
|
|
585
|
+
if (tmAbs !== void 0 && rawInterval !== void 0 && iterateIntervalMs === void 0) diagnostics.push({
|
|
586
|
+
code: "invalid-xml-value",
|
|
587
|
+
category: "corrupt-input",
|
|
588
|
+
disposition: "recovered",
|
|
589
|
+
location: locationFor(context, `${tmAbs.xpath}/@val`),
|
|
590
|
+
attributeOrElement: "p:tmAbs/@val",
|
|
591
|
+
rawValue: rawInterval
|
|
592
|
+
});
|
|
593
|
+
iterateEl.consumeAttr("backwards");
|
|
594
|
+
}
|
|
595
|
+
const childTnLst = cTn.child(P_NS, "childTnLst");
|
|
596
|
+
const subContainers = [];
|
|
597
|
+
const behaviorCursors = [];
|
|
598
|
+
const otherChildren = [];
|
|
599
|
+
if (childTnLst !== void 0) for (const child of childTnLst.remainingElementChildren()) if (child.namespaceUri === "http://schemas.openxmlformats.org/presentationml/2006/main" && (child.localName === "par" || child.localName === "seq")) {
|
|
600
|
+
if (child.localName === "seq") {
|
|
601
|
+
child.consumeAttr("concurrent");
|
|
602
|
+
child.consumeAttr("nextAc");
|
|
603
|
+
}
|
|
604
|
+
subContainers.push(child);
|
|
605
|
+
} else if (child.namespaceUri === "http://schemas.openxmlformats.org/presentationml/2006/main" && supportedBehaviorNames.has(child.localName)) behaviorCursors.push(child);
|
|
606
|
+
else otherChildren.push(child);
|
|
607
|
+
if ((attrs.presetId !== void 0 || behaviorCursors.length > 0 || otherChildren.length > 0) && subContainers.length === 0) {
|
|
608
|
+
const behaviors = behaviorCursors.map(readBehaviorElement);
|
|
609
|
+
const targetIds = [...new Set(behaviors.flatMap((b) => b.targets.map((t) => t.spid)))];
|
|
610
|
+
let unsupportedBehavior;
|
|
611
|
+
if (otherChildren.length > 0) {
|
|
612
|
+
const firstUnsupported = otherChildren[0];
|
|
613
|
+
let unsupportedTargetId;
|
|
614
|
+
const innerTgt = firstUnsupported.child(P_NS, "cBhvr")?.child(P_NS, "tgtEl");
|
|
615
|
+
if (innerTgt !== void 0) unsupportedTargetId = consumeTargetElement(innerTgt)[0]?.spid;
|
|
616
|
+
unsupportedBehavior = {
|
|
617
|
+
namespaceUri: firstUnsupported.namespaceUri,
|
|
618
|
+
localName: firstUnsupported.localName,
|
|
619
|
+
xpath: firstUnsupported.xpath,
|
|
620
|
+
...unsupportedTargetId === void 0 ? {} : { targetId: unsupportedTargetId }
|
|
621
|
+
};
|
|
622
|
+
cursor.suppressUnconsumed();
|
|
623
|
+
}
|
|
624
|
+
const hasSetBehavior = behaviors.some((b) => b.localName === "set");
|
|
625
|
+
const firstRange = behaviors.flatMap((b) => b.targets).find((t) => !t.isBackground && t.range !== void 0)?.range;
|
|
626
|
+
rawNodesById.set(timingId, {
|
|
627
|
+
kind: "effect",
|
|
628
|
+
timingId,
|
|
629
|
+
xpath: cursor.xpath,
|
|
630
|
+
...parentTimingId === void 0 ? {} : { parentTimingId },
|
|
631
|
+
stepIndex,
|
|
632
|
+
...attrs.presetId === void 0 ? {} : { presetId: attrs.presetId },
|
|
633
|
+
...attrs.presetClass === void 0 ? {} : { presetClass: attrs.presetClass },
|
|
634
|
+
...attrs.presetSubtype === void 0 ? {} : { presetSubtype: attrs.presetSubtype },
|
|
635
|
+
...attrs.grpId === void 0 ? {} : { buildGroupId: attrs.grpId },
|
|
636
|
+
...attrs.repeatCount === void 0 ? {} : { repeatCount: attrs.repeatCount },
|
|
637
|
+
autoRev: attrs.autoRev,
|
|
638
|
+
...attrs.accel === void 0 ? {} : { accel: attrs.accel },
|
|
639
|
+
...attrs.decel === void 0 ? {} : { decel: attrs.decel },
|
|
640
|
+
delayMs,
|
|
641
|
+
dependsOn,
|
|
642
|
+
...iterateBy === void 0 ? {} : { iterateBy },
|
|
643
|
+
...iterateIntervalMs === void 0 ? {} : { iterateIntervalMs },
|
|
644
|
+
hasSetBehavior,
|
|
645
|
+
behaviors,
|
|
646
|
+
targetIds,
|
|
647
|
+
...firstRange === void 0 ? {} : { targetRange: firstRange },
|
|
648
|
+
...unsupportedBehavior === void 0 ? {} : { unsupportedBehavior },
|
|
649
|
+
cursor
|
|
650
|
+
});
|
|
651
|
+
return timingId;
|
|
652
|
+
}
|
|
653
|
+
const childIds = [];
|
|
654
|
+
for (const sub of subContainers) {
|
|
655
|
+
const childId = visitTimingNode(sub, timingId, stepIndex);
|
|
656
|
+
if (childId !== void 0) childIds.push(childId);
|
|
657
|
+
}
|
|
658
|
+
rawNodesById.set(timingId, {
|
|
659
|
+
kind: "container",
|
|
660
|
+
timingId,
|
|
661
|
+
containerKind: cursor.localName === "seq" ? "sequence" : "parallel",
|
|
662
|
+
xpath: cursor.xpath,
|
|
663
|
+
...parentTimingId === void 0 ? {} : { parentTimingId },
|
|
664
|
+
stepIndex,
|
|
665
|
+
endSyncAll,
|
|
666
|
+
delayMs,
|
|
667
|
+
dependsOn,
|
|
668
|
+
childIds,
|
|
669
|
+
cursor
|
|
670
|
+
});
|
|
671
|
+
return timingId;
|
|
672
|
+
};
|
|
673
|
+
const stepPars = mainSeqChildren.children(P_NS, "par");
|
|
674
|
+
for (let stepIndex = 0; stepIndex < stepPars.length; stepIndex += 1) {
|
|
675
|
+
const stepPar = stepPars[stepIndex];
|
|
676
|
+
const stepCTn = stepPar.child(P_NS, "cTn");
|
|
677
|
+
if (stepCTn === void 0) continue;
|
|
678
|
+
const stepAttrs = consumeCommonTimeNodeAttrs(stepCTn);
|
|
679
|
+
const trigger = consumeConditionList(stepCTn.child("http://schemas.openxmlformats.org/presentationml/2006/main", "stCondLst")).some((c) => c.kind === "onBegin") ? "auto" : "click";
|
|
680
|
+
const stepChildTnLst = stepCTn.child(P_NS, "childTnLst");
|
|
681
|
+
const rootChildIds = [];
|
|
682
|
+
if (stepChildTnLst !== void 0) {
|
|
683
|
+
for (const childCursor of stepChildTnLst.children(P_NS, "par")) {
|
|
684
|
+
const id = visitTimingNode(childCursor, stepAttrs.id, stepIndex);
|
|
685
|
+
if (id !== void 0) rootChildIds.push(id);
|
|
686
|
+
}
|
|
687
|
+
for (const childCursor of stepChildTnLst.children(P_NS, "seq")) {
|
|
688
|
+
childCursor.consumeAttr("concurrent");
|
|
689
|
+
childCursor.consumeAttr("nextAc");
|
|
690
|
+
const id = visitTimingNode(childCursor, stepAttrs.id, stepIndex);
|
|
691
|
+
if (id !== void 0) rootChildIds.push(id);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
stepInfos.push({
|
|
695
|
+
stepIndex,
|
|
696
|
+
trigger,
|
|
697
|
+
rootChildIds,
|
|
698
|
+
xpath: stepPar.xpath
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
const rootDiagnosticByNodeId = /* @__PURE__ */ new Map();
|
|
702
|
+
const omittedNodeIds = /* @__PURE__ */ new Set();
|
|
703
|
+
const isKnownSlideTarget = (spid) => context.placeholderKeyBySpid?.has(spid) === true || context.objectBySpid?.has(spid) === true;
|
|
704
|
+
for (const [timingId, rawNode] of rawNodesById) {
|
|
705
|
+
if (rawNode.kind !== "effect") continue;
|
|
706
|
+
if (rawNode.unsupportedBehavior !== void 0) {
|
|
707
|
+
const targetId = rawNode.unsupportedBehavior.targetId ?? rawNode.targetIds[0];
|
|
708
|
+
const diag = {
|
|
709
|
+
code: "unsupported-mechanism",
|
|
710
|
+
category: "unsupported",
|
|
711
|
+
disposition: "omitted",
|
|
712
|
+
location: locationFor(context, rawNode.unsupportedBehavior.xpath, targetId),
|
|
713
|
+
namespaceUri: rawNode.unsupportedBehavior.namespaceUri,
|
|
714
|
+
localName: rawNode.unsupportedBehavior.localName,
|
|
715
|
+
mechanismHint: `motion-behavior:${rawNode.unsupportedBehavior.localName}`
|
|
716
|
+
};
|
|
717
|
+
rootDiagnosticByNodeId.set(timingId, diag);
|
|
718
|
+
omittedNodeIds.add(timingId);
|
|
719
|
+
rawNode.cursor.suppressUnconsumed();
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
const preset = resolvePreset(rawNode.presetClass, rawNode.presetId, rawNode.behaviors.some((b) => b.localName === "animClr"), rawNode.autoRev);
|
|
723
|
+
if (preset === void 0) {
|
|
724
|
+
const targetId = rawNode.targetIds[0];
|
|
725
|
+
const diag = {
|
|
726
|
+
code: "unsupported-mechanism",
|
|
727
|
+
category: "unsupported",
|
|
728
|
+
disposition: "omitted",
|
|
729
|
+
location: locationFor(context, rawNode.xpath, targetId),
|
|
730
|
+
namespaceUri: P_NS,
|
|
731
|
+
localName: "cTn",
|
|
732
|
+
mechanismHint: `motion-preset:${rawNode.presetClass ?? ""}#${String(rawNode.presetId ?? "")}`
|
|
733
|
+
};
|
|
734
|
+
rootDiagnosticByNodeId.set(timingId, diag);
|
|
735
|
+
omittedNodeIds.add(timingId);
|
|
736
|
+
rawNode.cursor.suppressUnconsumed();
|
|
737
|
+
continue;
|
|
738
|
+
}
|
|
739
|
+
const missingTargetId = rawNode.targetIds.find((id) => !isKnownSlideTarget(id));
|
|
740
|
+
if (rawNode.targetIds.length !== 1 || missingTargetId !== void 0) {
|
|
741
|
+
const omittedInfo = missingTargetId === void 0 ? void 0 : context.omittedSpids?.get(missingTargetId);
|
|
742
|
+
const diag = {
|
|
743
|
+
code: "unsupported-mechanism",
|
|
744
|
+
category: "unsupported",
|
|
745
|
+
disposition: "omitted",
|
|
746
|
+
location: locationFor(context, rawNode.xpath, missingTargetId, omittedInfo?.objectName),
|
|
747
|
+
namespaceUri: P_NS,
|
|
748
|
+
localName: "spTgt",
|
|
749
|
+
mechanismHint: omittedInfo === void 0 ? "missing-animation-target" : `omitted-target:${omittedInfo.reason}`
|
|
750
|
+
};
|
|
751
|
+
rootDiagnosticByNodeId.set(timingId, diag);
|
|
752
|
+
omittedNodeIds.add(timingId);
|
|
753
|
+
rawNode.cursor.suppressUnconsumed();
|
|
754
|
+
continue;
|
|
755
|
+
}
|
|
756
|
+
const targetId = rawNode.targetIds[0];
|
|
757
|
+
const targetNode = context.objectBySpid?.get(targetId);
|
|
758
|
+
const omitInvalidEffect = (localName, mechanismHint) => {
|
|
759
|
+
rootDiagnosticByNodeId.set(timingId, {
|
|
760
|
+
code: "unsupported-mechanism",
|
|
761
|
+
category: "unsupported",
|
|
762
|
+
disposition: "omitted",
|
|
763
|
+
location: locationFor(context, rawNode.xpath, targetId),
|
|
764
|
+
namespaceUri: P_NS,
|
|
765
|
+
localName,
|
|
766
|
+
mechanismHint
|
|
767
|
+
});
|
|
768
|
+
omittedNodeIds.add(timingId);
|
|
769
|
+
rawNode.cursor.suppressUnconsumed();
|
|
770
|
+
};
|
|
771
|
+
if (rawNode.targetRange?.type === "paragraph" && targetNode !== void 0) {
|
|
772
|
+
const paraCount = targetParagraphCount(targetNode);
|
|
773
|
+
if (paraCount === 0 || rawNode.targetRange.end >= paraCount) {
|
|
774
|
+
omitInvalidEffect("pRg", "invalid-paragraph-range");
|
|
775
|
+
continue;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
if (rawNode.targetRange?.type === "chart" && targetNode !== void 0 && targetNode.kind !== "chart") {
|
|
779
|
+
omitInvalidEffect("graphicEl", "invalid-chart-target");
|
|
780
|
+
continue;
|
|
781
|
+
}
|
|
782
|
+
if (preset === "fillColor") {
|
|
783
|
+
if (rawNode.targetRange !== void 0 || targetNode !== void 0 && !shapeFillState(targetNode).solidFilled) {
|
|
784
|
+
omitInvalidEffect("animClr", "invalid-fill-color-target");
|
|
785
|
+
continue;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
if (preset === "breathe") {
|
|
789
|
+
const clrBehavior = rawNode.behaviors.find((b) => b.localName === "animClr");
|
|
790
|
+
const fromColor = clrBehavior?.fromColor ?? "#000000";
|
|
791
|
+
const toColor = clrBehavior?.toColor ?? "#FFFFFF";
|
|
792
|
+
if (rawNode.presetClass !== "emph" || rawNode.targetRange !== void 0 || targetNode !== void 0 && !shapeFillState(targetNode).filled) {
|
|
793
|
+
omitInvalidEffect("animClr", "invalid-breathe-target");
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
if (relativeLuminance(toColor) <= relativeLuminance(fromColor)) {
|
|
797
|
+
omitInvalidEffect("animClr", "invalid-breathe-colors");
|
|
798
|
+
continue;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
const invalidDurationBehavior = rawNode.behaviors.find((b) => b.invalidDuration !== void 0);
|
|
802
|
+
if (invalidDurationBehavior?.invalidDuration !== void 0) {
|
|
803
|
+
rootDiagnosticByNodeId.set(timingId, {
|
|
804
|
+
code: "invalid-xml-value",
|
|
805
|
+
category: "corrupt-input",
|
|
806
|
+
disposition: "omitted",
|
|
807
|
+
location: locationFor(context, invalidDurationBehavior.invalidDuration.xpath, targetId),
|
|
808
|
+
attributeOrElement: "p:cTn/@dur",
|
|
809
|
+
rawValue: invalidDurationBehavior.invalidDuration.raw
|
|
810
|
+
});
|
|
811
|
+
omittedNodeIds.add(timingId);
|
|
812
|
+
rawNode.cursor.suppressUnconsumed();
|
|
813
|
+
continue;
|
|
814
|
+
}
|
|
815
|
+
if (preset === "spin") {
|
|
816
|
+
const rotBehavior = rawNode.behaviors.find((b) => b.localName === "animRot");
|
|
817
|
+
if (rotBehavior === void 0 || rotBehavior.invalidRotation !== void 0 || rotBehavior.rotationFrom === void 0 && rotBehavior.rotationBy === void 0 || rotBehavior.rotationFrom !== void 0 && rotBehavior.rotationBy !== void 0) {
|
|
818
|
+
rootDiagnosticByNodeId.set(timingId, {
|
|
819
|
+
code: "invalid-xml-value",
|
|
820
|
+
category: "corrupt-input",
|
|
821
|
+
disposition: "omitted",
|
|
822
|
+
location: locationFor(context, rotBehavior?.xpath ?? rawNode.xpath, targetId),
|
|
823
|
+
attributeOrElement: "p:animRot",
|
|
824
|
+
...rotBehavior?.invalidRotation === void 0 ? {} : { rawValue: rotBehavior.invalidRotation.raw }
|
|
825
|
+
});
|
|
826
|
+
omittedNodeIds.add(timingId);
|
|
827
|
+
rawNode.cursor.suppressUnconsumed();
|
|
828
|
+
continue;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
const directDependentsOf = /* @__PURE__ */ new Map();
|
|
833
|
+
for (const [timingId, rawNode] of rawNodesById) for (const dep of rawNode.dependsOn) {
|
|
834
|
+
const list = directDependentsOf.get(dep.timingId) ?? [];
|
|
835
|
+
list.push(timingId);
|
|
836
|
+
directDependentsOf.set(dep.timingId, list);
|
|
837
|
+
}
|
|
838
|
+
const hasAnySurvivingEffect = (containerId) => {
|
|
839
|
+
const node = rawNodesById.get(containerId);
|
|
840
|
+
if (node === void 0) return false;
|
|
841
|
+
if (node.kind === "effect") return !omittedNodeIds.has(node.timingId);
|
|
842
|
+
return node.childIds.some((cid) => hasAnySurvivingEffect(cid));
|
|
843
|
+
};
|
|
844
|
+
const cascadedByRootDiag = /* @__PURE__ */ new Map();
|
|
845
|
+
const addCascadedToRoot = (rootId, dependentNode) => {
|
|
846
|
+
const list = cascadedByRootDiag.get(rootId) ?? [];
|
|
847
|
+
const targetId = dependentNode.kind === "effect" ? dependentNode.targetIds[0] : void 0;
|
|
848
|
+
list.push({
|
|
849
|
+
location: locationFor(context, dependentNode.xpath, targetId),
|
|
850
|
+
role: "animation-dependency"
|
|
851
|
+
});
|
|
852
|
+
cascadedByRootDiag.set(rootId, list);
|
|
853
|
+
};
|
|
854
|
+
for (const [rootId] of rootDiagnosticByNodeId) {
|
|
855
|
+
const queue = [rootId];
|
|
856
|
+
const visited = /* @__PURE__ */ new Set([rootId]);
|
|
857
|
+
while (queue.length > 0) {
|
|
858
|
+
const currentId = queue.shift();
|
|
859
|
+
const currentNode = rawNodesById.get(currentId);
|
|
860
|
+
if (currentNode?.parentTimingId !== void 0) {
|
|
861
|
+
const parentNode = rawNodesById.get(currentNode.parentTimingId);
|
|
862
|
+
if (parentNode?.kind === "container" && !omittedNodeIds.has(parentNode.timingId) && !hasAnySurvivingEffect(parentNode.timingId)) {
|
|
863
|
+
omittedNodeIds.add(parentNode.timingId);
|
|
864
|
+
if (!visited.has(parentNode.timingId)) {
|
|
865
|
+
visited.add(parentNode.timingId);
|
|
866
|
+
queue.push(parentNode.timingId);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
for (const dependentId of directDependentsOf.get(currentId) ?? []) {
|
|
871
|
+
if (visited.has(dependentId)) continue;
|
|
872
|
+
visited.add(dependentId);
|
|
873
|
+
const dependentNode = rawNodesById.get(dependentId);
|
|
874
|
+
if (dependentNode === void 0) continue;
|
|
875
|
+
omittedNodeIds.add(dependentId);
|
|
876
|
+
dependentNode.cursor.suppressUnconsumed();
|
|
877
|
+
if (dependentNode.kind === "effect") addCascadedToRoot(rootId, dependentNode);
|
|
878
|
+
queue.push(dependentId);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
for (const [rootId, diag] of rootDiagnosticByNodeId) {
|
|
883
|
+
const cascaded = cascadedByRootDiag.get(rootId);
|
|
884
|
+
if (cascaded !== void 0 && cascaded.length > 0 && diag.code === "unsupported-mechanism") diagnostics.push({
|
|
885
|
+
...diag,
|
|
886
|
+
cascaded
|
|
887
|
+
});
|
|
888
|
+
else {
|
|
889
|
+
diagnostics.push(diag);
|
|
890
|
+
if (cascaded !== void 0) for (const dep of cascaded) diagnostics.push({
|
|
891
|
+
code: "invalid-xml-value",
|
|
892
|
+
category: "corrupt-input",
|
|
893
|
+
disposition: "omitted",
|
|
894
|
+
location: dep.location,
|
|
895
|
+
attributeOrElement: "p:stCondLst/p:cond"
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
const survivingEffects = [];
|
|
900
|
+
const collectStepEffects = (nodeId, accumulatedDelayMs, inheritedStartAfter) => {
|
|
901
|
+
if (omittedNodeIds.has(nodeId)) return;
|
|
902
|
+
const node = rawNodesById.get(nodeId);
|
|
903
|
+
if (node === void 0) return;
|
|
904
|
+
const dep = node.dependsOn[0];
|
|
905
|
+
let effectiveDelayMs = dep !== void 0 ? dep.offsetMs : inheritedStartAfter !== void 0 ? inheritedStartAfter.offsetMs + node.delayMs : accumulatedDelayMs + node.delayMs;
|
|
906
|
+
let effectiveStartAfter = dep !== void 0 && !omittedNodeIds.has(dep.timingId) ? dep : inheritedStartAfter;
|
|
907
|
+
if (node.kind === "container") {
|
|
908
|
+
for (const childId of node.childIds) collectStepEffects(childId, effectiveStartAfter === void 0 ? effectiveDelayMs : 0, effectiveStartAfter);
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
const preset = resolvePreset(node.presetClass, node.presetId, node.behaviors.some((b) => b.localName === "animClr"), node.autoRev);
|
|
912
|
+
if (preset === void 0 || node.targetIds.length !== 1) return;
|
|
913
|
+
const targetId = node.targetIds[0];
|
|
914
|
+
const kind = node.presetClass === "emph" ? "emphasis" : node.presetClass === "exit" ? "exit" : "entrance";
|
|
915
|
+
const nonSetDurations = node.behaviors.filter((b) => b.localName !== "set").map((b) => b.durationMs).filter((d) => d !== void 0);
|
|
916
|
+
const traversalDurationMs = nonSetDurations.length > 0 ? Math.max(...nonSetDurations) : preset === "appear" || preset === "disappear" ? 1 : 500;
|
|
917
|
+
const durationMs = preset === "breathe" ? traversalDurationMs * 2 : traversalDurationMs;
|
|
918
|
+
if (!Number.isSafeInteger(effectiveDelayMs) || effectiveDelayMs < 0 || effectiveDelayMs > 4294967295 || !Number.isSafeInteger(effectiveDelayMs + durationMs)) {
|
|
919
|
+
diagnostics.push({
|
|
920
|
+
code: "invalid-xml-value",
|
|
921
|
+
category: "corrupt-input",
|
|
922
|
+
disposition: "recovered",
|
|
923
|
+
location: locationFor(context, node.xpath, targetId),
|
|
924
|
+
attributeOrElement: "p:cond/@delay",
|
|
925
|
+
rawValue: String(effectiveDelayMs)
|
|
926
|
+
});
|
|
927
|
+
effectiveDelayMs = 0;
|
|
928
|
+
if (effectiveStartAfter !== void 0) effectiveStartAfter = {
|
|
929
|
+
timingId: effectiveStartAfter.timingId,
|
|
930
|
+
offsetMs: 0
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
let easing;
|
|
934
|
+
if (node.accel !== void 0 && node.accel !== 0 || node.decel !== void 0 && node.decel !== 0) {
|
|
935
|
+
const accelRatio = node.accel !== void 0 && node.accel !== 0 ? node.accel / 1e5 : 0;
|
|
936
|
+
const decelRatio = node.decel !== void 0 && node.decel !== 0 ? node.decel / 1e5 : 0;
|
|
937
|
+
if (accelRatio < 0 || decelRatio < 0 || accelRatio + decelRatio > 1) diagnostics.push({
|
|
938
|
+
code: "invalid-xml-value",
|
|
939
|
+
category: "corrupt-input",
|
|
940
|
+
disposition: "recovered",
|
|
941
|
+
location: locationFor(context, node.xpath, targetId),
|
|
942
|
+
attributeOrElement: "p:cTn/@accel"
|
|
943
|
+
});
|
|
944
|
+
else easing = {
|
|
945
|
+
...accelRatio > 0 ? { accelerate: accelRatio } : {},
|
|
946
|
+
...decelRatio > 0 ? { decelerate: decelRatio } : {}
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
let from;
|
|
950
|
+
if (preset === "wipe" || preset === "wipeOut" || preset === "fly" || preset === "flyOut") from = node.presetSubtype === void 0 ? void 0 : directionBySubtype[node.presetSubtype];
|
|
951
|
+
let to;
|
|
952
|
+
let by = node.iterateBy;
|
|
953
|
+
let iterateIntervalMs = node.iterateIntervalMs;
|
|
954
|
+
const targetNode = context.objectBySpid?.get(targetId);
|
|
955
|
+
if (by !== void 0 && (preset === "fillColor" || preset === "breathe" || preset === "spin" || targetNode !== void 0 && targetParagraphCount(targetNode) === 0)) {
|
|
956
|
+
diagnostics.push({
|
|
957
|
+
code: "invalid-xml-value",
|
|
958
|
+
category: "corrupt-input",
|
|
959
|
+
disposition: "recovered",
|
|
960
|
+
location: locationFor(context, node.xpath, targetId),
|
|
961
|
+
attributeOrElement: "p:cTn/p:iterate",
|
|
962
|
+
rawValue: by
|
|
963
|
+
});
|
|
964
|
+
by = void 0;
|
|
965
|
+
iterateIntervalMs = void 0;
|
|
966
|
+
}
|
|
967
|
+
if (preset === "spin") {
|
|
968
|
+
const rotBehavior = node.behaviors.find((b) => b.localName === "animRot");
|
|
969
|
+
if (rotBehavior?.rotationBy !== void 0) by = rotBehavior.rotationBy / 6e4;
|
|
970
|
+
else {
|
|
971
|
+
if (rotBehavior?.rotationFrom !== void 0) from = rotBehavior.rotationFrom / 6e4;
|
|
972
|
+
if (rotBehavior?.rotationTo !== void 0 && rotBehavior.rotationTo !== 0) to = rotBehavior.rotationTo / 6e4;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
const clrBehavior = node.behaviors.find((b) => b.localName === "animClr");
|
|
976
|
+
const fromColor = clrBehavior?.fromColor;
|
|
977
|
+
const toColor = clrBehavior?.toColor;
|
|
978
|
+
if (!node.hasSetBehavior && kind === "entrance" && node.targetRange?.type === "paragraph" && (node.buildGroupId ?? 0) === 0) return;
|
|
979
|
+
let effectiveRepeatCount = node.repeatCount;
|
|
980
|
+
if (effectiveRepeatCount !== void 0 && !isValidRepeatModifier({
|
|
981
|
+
preset,
|
|
982
|
+
repeatCount: effectiveRepeatCount,
|
|
983
|
+
...by === void 0 ? {} : { by },
|
|
984
|
+
durationMs,
|
|
985
|
+
delayMs: effectiveDelayMs
|
|
986
|
+
})) {
|
|
987
|
+
diagnostics.push({
|
|
988
|
+
code: "invalid-xml-value",
|
|
989
|
+
category: "corrupt-input",
|
|
990
|
+
disposition: "recovered",
|
|
991
|
+
location: locationFor(context, node.xpath, targetId),
|
|
992
|
+
attributeOrElement: "p:cTn/@repeatCount",
|
|
993
|
+
rawValue: String(effectiveRepeatCount)
|
|
994
|
+
});
|
|
995
|
+
effectiveRepeatCount = void 0;
|
|
996
|
+
}
|
|
997
|
+
const built = buildEffectDeclaration({
|
|
998
|
+
preset,
|
|
999
|
+
kind,
|
|
1000
|
+
durationMs,
|
|
1001
|
+
delayMs: effectiveDelayMs,
|
|
1002
|
+
...from === void 0 ? {} : { from },
|
|
1003
|
+
...to === void 0 ? {} : { to },
|
|
1004
|
+
...fromColor === void 0 ? {} : { fromColor },
|
|
1005
|
+
...toColor === void 0 ? {} : { toColor },
|
|
1006
|
+
...easing === void 0 ? {} : { easing },
|
|
1007
|
+
...by === void 0 ? {} : { by },
|
|
1008
|
+
...iterateIntervalMs === void 0 ? {} : { intervalMs: iterateIntervalMs },
|
|
1009
|
+
...effectiveRepeatCount === void 0 ? {} : { repeatCount: effectiveRepeatCount }
|
|
1010
|
+
});
|
|
1011
|
+
survivingEffects.push({
|
|
1012
|
+
effect: built.effect,
|
|
1013
|
+
declaration: built.declaration,
|
|
1014
|
+
targetId,
|
|
1015
|
+
...node.targetRange === void 0 ? {} : { targetRange: node.targetRange },
|
|
1016
|
+
...node.buildGroupId === void 0 ? {} : { buildGroupId: node.buildGroupId },
|
|
1017
|
+
stepIndex: node.stepIndex,
|
|
1018
|
+
...node.parentTimingId === void 0 ? {} : { parentTimingId: node.parentTimingId },
|
|
1019
|
+
timingId: node.timingId,
|
|
1020
|
+
effectiveDelayMs,
|
|
1021
|
+
...effectiveStartAfter === void 0 ? {} : {
|
|
1022
|
+
startAfterTimingId: effectiveStartAfter.timingId,
|
|
1023
|
+
startAfterOffsetMs: effectiveStartAfter.offsetMs
|
|
1024
|
+
},
|
|
1025
|
+
...easing === void 0 ? {} : { easing },
|
|
1026
|
+
...effectiveRepeatCount === void 0 ? {} : { repeatCount: effectiveRepeatCount },
|
|
1027
|
+
...from === void 0 ? {} : { from },
|
|
1028
|
+
...to === void 0 ? {} : { to },
|
|
1029
|
+
...by === void 0 ? {} : { by },
|
|
1030
|
+
...iterateIntervalMs === void 0 ? {} : { intervalMs: iterateIntervalMs },
|
|
1031
|
+
...fromColor === void 0 ? {} : { fromColor },
|
|
1032
|
+
...toColor === void 0 ? {} : { toColor }
|
|
1033
|
+
});
|
|
1034
|
+
};
|
|
1035
|
+
for (const step of stepInfos) for (const rootId of step.rootChildIds) collectStepEffects(rootId, 0, void 0);
|
|
1036
|
+
if (context.placeholderKeyBySpid !== void 0) {
|
|
1037
|
+
const placeholdersProp = context.slideNode.props["placeholders"];
|
|
1038
|
+
const placeholderCount = typeof placeholdersProp === "object" && placeholdersProp !== null && !Array.isArray(placeholdersProp) ? Object.keys(placeholdersProp).length : 0;
|
|
1039
|
+
const emittedSpidByNode = /* @__PURE__ */ new Map();
|
|
1040
|
+
let nextOwnerObjectId = 2 + placeholderCount;
|
|
1041
|
+
const assignEmittedOwnerSpids = (children) => {
|
|
1042
|
+
for (const child of children) {
|
|
1043
|
+
if (!(child instanceof CommonNode)) continue;
|
|
1044
|
+
emittedSpidByNode.set(child, nextOwnerObjectId++);
|
|
1045
|
+
if (child.kind === "group") assignEmittedOwnerSpids(child.children);
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
assignEmittedOwnerSpids(context.slideNode.children);
|
|
1049
|
+
const ownerSteps = [];
|
|
1050
|
+
for (const stepInfo of stepInfos) {
|
|
1051
|
+
const stepEffects = survivingEffects.filter((eff) => eff.stepIndex === stepInfo.stepIndex);
|
|
1052
|
+
if (stepEffects.length === 0) continue;
|
|
1053
|
+
const mappedEffects = [];
|
|
1054
|
+
for (const eff of stepEffects) {
|
|
1055
|
+
const placeholderKey = context.placeholderKeyBySpid?.get(eff.targetId);
|
|
1056
|
+
let target;
|
|
1057
|
+
if (placeholderKey !== void 0) target = { placeholder: placeholderKey };
|
|
1058
|
+
else {
|
|
1059
|
+
const targetNode = context.objectBySpid?.get(eff.targetId);
|
|
1060
|
+
const emittedSpid = targetNode === void 0 ? void 0 : emittedSpidByNode.get(targetNode);
|
|
1061
|
+
if (emittedSpid !== void 0) target = { spid: emittedSpid };
|
|
1062
|
+
else {
|
|
1063
|
+
diagnostics.push({
|
|
1064
|
+
code: "unsupported-mechanism",
|
|
1065
|
+
category: "unsupported",
|
|
1066
|
+
disposition: "omitted",
|
|
1067
|
+
location: locationFor(context, timingCursor.xpath, eff.targetId),
|
|
1068
|
+
namespaceUri: P_NS,
|
|
1069
|
+
localName: "spTgt"
|
|
1070
|
+
});
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
mappedEffects.push({
|
|
1075
|
+
target,
|
|
1076
|
+
effect: eff.declaration,
|
|
1077
|
+
...eff.targetRange === void 0 ? {} : { range: eff.targetRange }
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
if (mappedEffects.length > 0) ownerSteps.push({
|
|
1081
|
+
trigger: stepInfo.trigger,
|
|
1082
|
+
effects: mappedEffects
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
if (ownerSteps.length > 0) {
|
|
1086
|
+
const motion = { steps: ownerSteps };
|
|
1087
|
+
context.slideNode.set({ motion });
|
|
1088
|
+
}
|
|
1089
|
+
return diagnostics.length === 0 ? {} : { diagnostics };
|
|
1090
|
+
}
|
|
1091
|
+
const collapsedEffects = [];
|
|
1092
|
+
const consumedIndices = /* @__PURE__ */ new Set();
|
|
1093
|
+
for (let i = 0; i < survivingEffects.length; i += 1) {
|
|
1094
|
+
if (consumedIndices.has(i)) continue;
|
|
1095
|
+
const head = survivingEffects[i];
|
|
1096
|
+
if (head.targetRange?.type === "paragraph" && head.buildGroupId === 1) {
|
|
1097
|
+
consumedIndices.add(i);
|
|
1098
|
+
const { targetRange: _omittedRange, ...rest } = head;
|
|
1099
|
+
collapsedEffects.push(rest);
|
|
1100
|
+
continue;
|
|
1101
|
+
}
|
|
1102
|
+
if (head.targetRange?.type === "chart") {
|
|
1103
|
+
const chartBuild = chartBuilds.get(`${head.targetId}:${head.buildGroupId ?? 0}`);
|
|
1104
|
+
const groupIndices = [i];
|
|
1105
|
+
for (let j = i + 1; j < survivingEffects.length; j += 1) {
|
|
1106
|
+
if (consumedIndices.has(j)) continue;
|
|
1107
|
+
const cand = survivingEffects[j];
|
|
1108
|
+
if (cand.targetRange?.type === "chart" && cand.stepIndex === head.stepIndex && commonEffectPropsMatch(head, cand) && cand.startAfterTimingId === head.startAfterTimingId && cand.startAfterOffsetMs === head.startAfterOffsetMs) groupIndices.push(j);
|
|
1109
|
+
}
|
|
1110
|
+
const mappedBy = chartBuild?.mode === "series" ? "series" : chartBuild?.mode === "category" ? "category" : chartBuild?.mode === "seriesEl" ? "seriesElements" : chartBuild?.mode === "categoryEl" ? "categoryElements" : head.targetRange.step === "series" ? "series" : head.targetRange.step === "category" ? "category" : head.targetRange.step === "ptInSeries" ? "seriesElements" : head.targetRange.step === "ptInCategory" ? "categoryElements" : void 0;
|
|
1111
|
+
for (const idx of groupIndices) consumedIndices.add(idx);
|
|
1112
|
+
const baseDelay = Math.min(...groupIndices.map((idx) => survivingEffects[idx].effectiveDelayMs));
|
|
1113
|
+
const effectiveRepeat = mappedBy !== void 0 && head.repeatCount !== void 0 ? void 0 : head.repeatCount;
|
|
1114
|
+
if (mappedBy !== void 0 && head.repeatCount !== void 0) diagnostics.push({
|
|
1115
|
+
code: "invalid-xml-value",
|
|
1116
|
+
category: "corrupt-input",
|
|
1117
|
+
disposition: "recovered",
|
|
1118
|
+
location: locationFor(context, timingCursor.xpath, head.targetId),
|
|
1119
|
+
attributeOrElement: "p:cTn/@repeatCount",
|
|
1120
|
+
rawValue: String(head.repeatCount)
|
|
1121
|
+
});
|
|
1122
|
+
const rebuilt = buildEffectDeclaration({
|
|
1123
|
+
preset: head.effect.preset,
|
|
1124
|
+
kind: head.effect.kind,
|
|
1125
|
+
durationMs: head.effect.duration,
|
|
1126
|
+
delayMs: baseDelay,
|
|
1127
|
+
...head.from === void 0 ? {} : { from: head.from },
|
|
1128
|
+
...head.to === void 0 ? {} : { to: head.to },
|
|
1129
|
+
...head.fromColor === void 0 ? {} : { fromColor: head.fromColor },
|
|
1130
|
+
...head.toColor === void 0 ? {} : { toColor: head.toColor },
|
|
1131
|
+
...head.easing === void 0 ? {} : { easing: head.easing },
|
|
1132
|
+
...mappedBy === void 0 ? {} : { by: mappedBy },
|
|
1133
|
+
...effectiveRepeat === void 0 ? {} : { repeatCount: effectiveRepeat }
|
|
1134
|
+
});
|
|
1135
|
+
const { targetRange: _omittedRange, repeatCount: _droppedRepeat, ...headRest } = head;
|
|
1136
|
+
collapsedEffects.push({
|
|
1137
|
+
...headRest,
|
|
1138
|
+
effectiveDelayMs: baseDelay,
|
|
1139
|
+
...mappedBy === void 0 ? {} : { by: mappedBy },
|
|
1140
|
+
...effectiveRepeat === void 0 ? {} : { repeatCount: effectiveRepeat },
|
|
1141
|
+
effect: rebuilt.effect,
|
|
1142
|
+
declaration: rebuilt.declaration
|
|
1143
|
+
});
|
|
1144
|
+
continue;
|
|
1145
|
+
}
|
|
1146
|
+
if (head.targetRange?.type === "paragraph" && head.targetRange.start === 0 && head.targetRange.end === 0 && (head.buildGroupId ?? 0) === 0) {
|
|
1147
|
+
const pBuild = paragraphBuilds.get(`${head.targetId}:0`);
|
|
1148
|
+
const targetObj = context.objectBySpid?.get(head.targetId);
|
|
1149
|
+
const existingParaCount = targetObj === void 0 ? 0 : targetObj.children.filter((c) => c instanceof CommonNode && c.type === "paragraph").length;
|
|
1150
|
+
const targetParaCount = existingParaCount > 0 ? existingParaCount : targetObj?.kind === "shape" && targetObj.children.length > 0 ? 1 : 0;
|
|
1151
|
+
if (pBuild?.build === "p" && targetParaCount > 1) {
|
|
1152
|
+
const groupIndices = [i];
|
|
1153
|
+
let expectedNextStart = head.targetRange.end + 1;
|
|
1154
|
+
for (let j = i + 1; j < survivingEffects.length; j += 1) {
|
|
1155
|
+
if (consumedIndices.has(j)) continue;
|
|
1156
|
+
const cand = survivingEffects[j];
|
|
1157
|
+
if (cand.targetRange?.type === "paragraph" && cand.targetRange.start === expectedNextStart && cand.targetRange.end === expectedNextStart && cand.stepIndex === head.stepIndex && commonEffectPropsMatch(head, cand) && cand.effectiveDelayMs === head.effectiveDelayMs + expectedNextStart * head.effect.duration && cand.startAfterTimingId === head.startAfterTimingId && cand.startAfterOffsetMs === head.startAfterOffsetMs) {
|
|
1158
|
+
groupIndices.push(j);
|
|
1159
|
+
expectedNextStart = cand.targetRange.end + 1;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
if (groupIndices.length === targetParaCount) {
|
|
1163
|
+
for (const idx of groupIndices) consumedIndices.add(idx);
|
|
1164
|
+
const baseDelay = Math.min(...groupIndices.map((idx) => survivingEffects[idx].effectiveDelayMs));
|
|
1165
|
+
const effectiveRepeat = head.repeatCount !== void 0 ? void 0 : head.repeatCount;
|
|
1166
|
+
if (head.repeatCount !== void 0) diagnostics.push({
|
|
1167
|
+
code: "invalid-xml-value",
|
|
1168
|
+
category: "corrupt-input",
|
|
1169
|
+
disposition: "recovered",
|
|
1170
|
+
location: locationFor(context, timingCursor.xpath, head.targetId),
|
|
1171
|
+
attributeOrElement: "p:cTn/@repeatCount",
|
|
1172
|
+
rawValue: String(head.repeatCount)
|
|
1173
|
+
});
|
|
1174
|
+
const rebuilt = buildEffectDeclaration({
|
|
1175
|
+
preset: head.effect.preset,
|
|
1176
|
+
kind: head.effect.kind,
|
|
1177
|
+
durationMs: head.effect.duration,
|
|
1178
|
+
delayMs: baseDelay,
|
|
1179
|
+
...head.from === void 0 ? {} : { from: head.from },
|
|
1180
|
+
...head.to === void 0 ? {} : { to: head.to },
|
|
1181
|
+
...head.fromColor === void 0 ? {} : { fromColor: head.fromColor },
|
|
1182
|
+
...head.toColor === void 0 ? {} : { toColor: head.toColor },
|
|
1183
|
+
...head.easing === void 0 ? {} : { easing: head.easing },
|
|
1184
|
+
by: "paragraph",
|
|
1185
|
+
...effectiveRepeat === void 0 ? {} : { repeatCount: effectiveRepeat }
|
|
1186
|
+
});
|
|
1187
|
+
const { targetRange: _omittedRange, repeatCount: _droppedRepeat, ...headRest } = head;
|
|
1188
|
+
collapsedEffects.push({
|
|
1189
|
+
...headRest,
|
|
1190
|
+
effectiveDelayMs: baseDelay,
|
|
1191
|
+
by: "paragraph",
|
|
1192
|
+
...effectiveRepeat === void 0 ? {} : { repeatCount: effectiveRepeat },
|
|
1193
|
+
effect: rebuilt.effect,
|
|
1194
|
+
declaration: rebuilt.declaration
|
|
1195
|
+
});
|
|
1196
|
+
continue;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
consumedIndices.add(i);
|
|
1201
|
+
collapsedEffects.push(head);
|
|
1202
|
+
}
|
|
1203
|
+
const objectBySpid = context.objectBySpid;
|
|
1204
|
+
const slideContainer = context.slideNode;
|
|
1205
|
+
if (objectBySpid === void 0 || !(slideContainer instanceof CommonContainer)) return diagnostics.length === 0 ? {} : { diagnostics };
|
|
1206
|
+
const topLevelOwnerByNode = /* @__PURE__ */ new Map();
|
|
1207
|
+
const registerTopLevelOwner = (node, topLevel) => {
|
|
1208
|
+
topLevelOwnerByNode.set(node, topLevel);
|
|
1209
|
+
for (const child of node.children) if (child instanceof CommonNode) registerTopLevelOwner(child, topLevel);
|
|
1210
|
+
};
|
|
1211
|
+
for (const child of context.slideNode.children) if (child instanceof CommonNode) registerTopLevelOwner(child, child);
|
|
1212
|
+
const spidsByNode = /* @__PURE__ */ new Map();
|
|
1213
|
+
for (const [spid, node] of objectBySpid) spidsByNode.set(node, spid);
|
|
1214
|
+
const collectGroupLeaves = (groupNode) => {
|
|
1215
|
+
const leaves = [];
|
|
1216
|
+
for (const member of groupNode.children) {
|
|
1217
|
+
if (!(member instanceof CommonNode)) continue;
|
|
1218
|
+
if (member.kind === "group") leaves.push(...collectGroupLeaves(member));
|
|
1219
|
+
else leaves.push(member);
|
|
1220
|
+
}
|
|
1221
|
+
return leaves;
|
|
1222
|
+
};
|
|
1223
|
+
const liftedCollapsed = [];
|
|
1224
|
+
const spinConsumed = /* @__PURE__ */ new Set();
|
|
1225
|
+
const findAllGroups = (nodes) => {
|
|
1226
|
+
const groups = [];
|
|
1227
|
+
for (const n of nodes) if (n instanceof CommonNode && n.kind === "group") {
|
|
1228
|
+
groups.push(n);
|
|
1229
|
+
groups.push(...findAllGroups(n.children));
|
|
1230
|
+
}
|
|
1231
|
+
return groups;
|
|
1232
|
+
};
|
|
1233
|
+
for (const groupNode of findAllGroups(context.slideNode.children)) {
|
|
1234
|
+
const groupSpid = spidsByNode.get(groupNode);
|
|
1235
|
+
if (groupSpid === void 0) continue;
|
|
1236
|
+
const leaves = collectGroupLeaves(groupNode);
|
|
1237
|
+
if (leaves.length === 0) continue;
|
|
1238
|
+
const leafSpids = leaves.map((leaf) => spidsByNode.get(leaf)).filter((id) => id !== void 0);
|
|
1239
|
+
if (leafSpids.length !== leaves.length) continue;
|
|
1240
|
+
for (let idx = 0; idx < collapsedEffects.length; idx += 1) {
|
|
1241
|
+
if (spinConsumed.has(idx)) continue;
|
|
1242
|
+
const candidate = collapsedEffects[idx];
|
|
1243
|
+
if (candidate.effect.preset !== "spin" || candidate.targetId !== leafSpids[0]) continue;
|
|
1244
|
+
const matchedLeafIndices = [idx];
|
|
1245
|
+
for (const leafSpid of leafSpids.slice(1)) {
|
|
1246
|
+
const matchIdx = collapsedEffects.findIndex((other, otherIdx) => !spinConsumed.has(otherIdx) && other.effect.preset === "spin" && other.targetId === leafSpid && other.stepIndex === candidate.stepIndex && other.effectiveDelayMs === candidate.effectiveDelayMs && other.effect.duration === candidate.effect.duration && other.by === candidate.by && other.from === candidate.from && other.to === candidate.to && other.startAfterTimingId === candidate.startAfterTimingId && other.startAfterOffsetMs === candidate.startAfterOffsetMs);
|
|
1247
|
+
if (matchIdx >= 0) matchedLeafIndices.push(matchIdx);
|
|
1248
|
+
}
|
|
1249
|
+
if (matchedLeafIndices.length === leafSpids.length) {
|
|
1250
|
+
for (const m of matchedLeafIndices) spinConsumed.add(m);
|
|
1251
|
+
liftedCollapsed.push({
|
|
1252
|
+
...candidate,
|
|
1253
|
+
targetId: groupSpid
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
for (let i = 0; i < collapsedEffects.length; i += 1) if (!spinConsumed.has(i)) liftedCollapsed.push(collapsedEffects[i]);
|
|
1259
|
+
const clickNumberByStepIndex = /* @__PURE__ */ new Map();
|
|
1260
|
+
let nextClickNumber = 1;
|
|
1261
|
+
for (const info of stepInfos) if (info.trigger === "click") {
|
|
1262
|
+
if (liftedCollapsed.some((e) => e.stepIndex === info.stepIndex)) clickNumberByStepIndex.set(info.stepIndex, nextClickNumber++);
|
|
1263
|
+
}
|
|
1264
|
+
const wholeEffectsByNode = /* @__PURE__ */ new Map();
|
|
1265
|
+
const paragraphEffectsByNode = /* @__PURE__ */ new Map();
|
|
1266
|
+
const topLevelStepIndices = /* @__PURE__ */ new Map();
|
|
1267
|
+
for (const eff of liftedCollapsed) {
|
|
1268
|
+
const targetNode = objectBySpid.get(eff.targetId);
|
|
1269
|
+
if (targetNode === void 0) continue;
|
|
1270
|
+
if (eff.targetRange?.type === "paragraph") {
|
|
1271
|
+
let byPara = paragraphEffectsByNode.get(targetNode);
|
|
1272
|
+
if (byPara === void 0) {
|
|
1273
|
+
byPara = /* @__PURE__ */ new Map();
|
|
1274
|
+
paragraphEffectsByNode.set(targetNode, byPara);
|
|
1275
|
+
}
|
|
1276
|
+
const pIdx = eff.targetRange.start;
|
|
1277
|
+
const pList = byPara.get(pIdx) ?? [];
|
|
1278
|
+
pList.push(eff);
|
|
1279
|
+
byPara.set(pIdx, pList);
|
|
1280
|
+
continue;
|
|
1281
|
+
}
|
|
1282
|
+
const list = wholeEffectsByNode.get(targetNode) ?? [];
|
|
1283
|
+
list.push(eff);
|
|
1284
|
+
wholeEffectsByNode.set(targetNode, list);
|
|
1285
|
+
const topLevelNode = topLevelOwnerByNode.get(targetNode) ?? targetNode;
|
|
1286
|
+
const indices = topLevelStepIndices.get(topLevelNode) ?? /* @__PURE__ */ new Set();
|
|
1287
|
+
indices.add(eff.stepIndex);
|
|
1288
|
+
topLevelStepIndices.set(topLevelNode, indices);
|
|
1289
|
+
}
|
|
1290
|
+
const anchorStepIndexByTopLevel = /* @__PURE__ */ new Map();
|
|
1291
|
+
for (const [topLevelNode, indices] of topLevelStepIndices) anchorStepIndexByTopLevel.set(topLevelNode, Math.min(...indices));
|
|
1292
|
+
const internalChainTimingIds = /* @__PURE__ */ new Set();
|
|
1293
|
+
const finiteDurationOf = (eff) => {
|
|
1294
|
+
if (eff.repeatCount === "forever" || eff.by === "word" || eff.by === "letter" || eff.by === "paragraph") return;
|
|
1295
|
+
const rounds = typeof eff.repeatCount === "number" ? eff.repeatCount : 1;
|
|
1296
|
+
return eff.effect.duration * rounds;
|
|
1297
|
+
};
|
|
1298
|
+
const applySlotAdjustedPatch = (targetNode, list, anchorStep) => {
|
|
1299
|
+
const adjustedByEffect = /* @__PURE__ */ new Map();
|
|
1300
|
+
const byStep = /* @__PURE__ */ new Map();
|
|
1301
|
+
for (const eff of list) {
|
|
1302
|
+
const group = byStep.get(eff.stepIndex) ?? [];
|
|
1303
|
+
group.push(eff);
|
|
1304
|
+
byStep.set(eff.stepIndex, group);
|
|
1305
|
+
}
|
|
1306
|
+
for (const stepList of byStep.values()) {
|
|
1307
|
+
let prevSlotTimingIds = /* @__PURE__ */ new Set();
|
|
1308
|
+
let prevSlotEndMs = 0;
|
|
1309
|
+
let prevSlotEndKnown = true;
|
|
1310
|
+
let hasPrevSlot = false;
|
|
1311
|
+
for (const slotKind of [
|
|
1312
|
+
"entrance",
|
|
1313
|
+
"emphasis",
|
|
1314
|
+
"exit"
|
|
1315
|
+
]) {
|
|
1316
|
+
const slotItems = stepList.filter((e) => e.effect.kind === slotKind);
|
|
1317
|
+
if (slotItems.length === 0) continue;
|
|
1318
|
+
const slotTimingIds = new Set(slotItems.map((e) => e.timingId));
|
|
1319
|
+
let slotMaxEnd = 0;
|
|
1320
|
+
let slotKnown = prevSlotEndKnown;
|
|
1321
|
+
for (const item of slotItems) {
|
|
1322
|
+
let adjustedDelay = item.effectiveDelayMs;
|
|
1323
|
+
if (hasPrevSlot) {
|
|
1324
|
+
if (item.startAfterTimingId !== void 0 && prevSlotTimingIds.has(item.startAfterTimingId)) {
|
|
1325
|
+
internalChainTimingIds.add(item.timingId);
|
|
1326
|
+
adjustedDelay = item.startAfterOffsetMs ?? 0;
|
|
1327
|
+
} else if (prevSlotEndKnown && prevSlotEndMs !== void 0) adjustedDelay = Math.max(0, item.effectiveDelayMs - prevSlotEndMs);
|
|
1328
|
+
}
|
|
1329
|
+
const rebuiltDecl = adjustedDelay === item.effectiveDelayMs ? item.declaration : buildEffectDeclaration({
|
|
1330
|
+
preset: item.effect.preset,
|
|
1331
|
+
kind: item.effect.kind,
|
|
1332
|
+
durationMs: item.effect.duration,
|
|
1333
|
+
delayMs: adjustedDelay,
|
|
1334
|
+
...item.from === void 0 ? {} : { from: item.from },
|
|
1335
|
+
...item.to === void 0 ? {} : { to: item.to },
|
|
1336
|
+
...item.fromColor === void 0 ? {} : { fromColor: item.fromColor },
|
|
1337
|
+
...item.toColor === void 0 ? {} : { toColor: item.toColor },
|
|
1338
|
+
...item.easing === void 0 ? {} : { easing: item.easing },
|
|
1339
|
+
...item.by === void 0 ? {} : { by: item.by },
|
|
1340
|
+
...item.intervalMs === void 0 ? {} : { intervalMs: item.intervalMs },
|
|
1341
|
+
...item.repeatCount === void 0 ? {} : { repeatCount: item.repeatCount }
|
|
1342
|
+
}).declaration;
|
|
1343
|
+
adjustedByEffect.set(item, rebuiltDecl);
|
|
1344
|
+
const finiteDur = finiteDurationOf(item);
|
|
1345
|
+
if (slotKnown && finiteDur !== void 0 && prevSlotEndMs !== void 0) {
|
|
1346
|
+
const itemEnd = prevSlotEndMs + adjustedDelay + finiteDur;
|
|
1347
|
+
slotMaxEnd = slotMaxEnd === void 0 ? itemEnd : Math.max(slotMaxEnd, itemEnd);
|
|
1348
|
+
} else slotKnown = false;
|
|
1349
|
+
}
|
|
1350
|
+
prevSlotTimingIds = slotTimingIds;
|
|
1351
|
+
prevSlotEndMs = slotMaxEnd;
|
|
1352
|
+
prevSlotEndKnown = slotKnown;
|
|
1353
|
+
hasPrevSlot = true;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
const wrapWithStepIfNeeded = (eff, decl) => {
|
|
1357
|
+
if (anchorStep !== void 0 && eff.stepIndex !== anchorStep) {
|
|
1358
|
+
const clickNum = clickNumberByStepIndex.get(eff.stepIndex);
|
|
1359
|
+
if (clickNum !== void 0) return onStep(clickNum, decl);
|
|
1360
|
+
}
|
|
1361
|
+
return decl;
|
|
1362
|
+
};
|
|
1363
|
+
const enters = list.filter((e) => e.effect.kind === "entrance").map((e) => wrapWithStepIfNeeded(e, adjustedByEffect.get(e) ?? e.declaration));
|
|
1364
|
+
const emphases = list.filter((e) => e.effect.kind === "emphasis").map((e) => wrapWithStepIfNeeded(e, adjustedByEffect.get(e) ?? e.declaration));
|
|
1365
|
+
const exits = list.filter((e) => e.effect.kind === "exit").map((e) => wrapWithStepIfNeeded(e, adjustedByEffect.get(e) ?? e.declaration));
|
|
1366
|
+
const patch = {};
|
|
1367
|
+
if (enters.length === 1) patch.enter = enters[0];
|
|
1368
|
+
else if (enters.length > 1) patch.enter = enters;
|
|
1369
|
+
if (emphases.length === 1) patch.emphasis = emphases[0];
|
|
1370
|
+
else if (emphases.length > 1) patch.emphasis = emphases;
|
|
1371
|
+
if (exits.length === 1) patch.exit = exits[0];
|
|
1372
|
+
else if (exits.length > 1) patch.exit = exits;
|
|
1373
|
+
if (patch.enter !== void 0 || patch.emphasis !== void 0 || patch.exit !== void 0) targetNode.set(patch);
|
|
1374
|
+
};
|
|
1375
|
+
for (const [targetNode, list] of wholeEffectsByNode) {
|
|
1376
|
+
const topLevelNode = topLevelOwnerByNode.get(targetNode) ?? targetNode;
|
|
1377
|
+
applySlotAdjustedPatch(targetNode, list, anchorStepIndexByTopLevel.get(topLevelNode));
|
|
1378
|
+
}
|
|
1379
|
+
const paragraphNodesByKey = /* @__PURE__ */ new Map();
|
|
1380
|
+
const paragraphPublishTimingIds = /* @__PURE__ */ new Set();
|
|
1381
|
+
for (const [targetNode, byPara] of paragraphEffectsByNode) {
|
|
1382
|
+
if (targetNode instanceof RichTextContainer && !targetNode.children.some((c) => c instanceof CommonNode && c.type === "paragraph") && targetNode.children.length > 0) {
|
|
1383
|
+
const p0 = createParagraphNode({});
|
|
1384
|
+
const rawChildren = [...targetNode.children];
|
|
1385
|
+
p0.content(...rawChildren.map((child) => child instanceof CommonNode ? child : child.text));
|
|
1386
|
+
targetNode.content(p0);
|
|
1387
|
+
}
|
|
1388
|
+
const pNodes = targetNode.children.filter((c) => c instanceof CommonNode && c.type === "paragraph");
|
|
1389
|
+
const stepByParagraph = /* @__PURE__ */ new Map();
|
|
1390
|
+
for (const [pIndex, pList] of byPara) {
|
|
1391
|
+
const pNode = pNodes[pIndex];
|
|
1392
|
+
if (pNode === void 0) continue;
|
|
1393
|
+
const anchorStep = Math.min(...pList.map((e) => e.stepIndex));
|
|
1394
|
+
applySlotAdjustedPatch(pNode, pList, anchorStep);
|
|
1395
|
+
const clickStep = clickNumberByStepIndex.get(anchorStep);
|
|
1396
|
+
if (clickStep !== void 0) stepByParagraph.set(pNode, clickStep);
|
|
1397
|
+
const anchorEff = pList.find((e) => e.stepIndex === anchorStep) ?? pList[0];
|
|
1398
|
+
paragraphNodesByKey.set(`${targetNode.id}:${pIndex}`, {
|
|
1399
|
+
pNode,
|
|
1400
|
+
anchorStep,
|
|
1401
|
+
...clickStep === void 0 ? {} : { clickStep },
|
|
1402
|
+
...anchorEff?.startAfterTimingId !== void 0 && !internalChainTimingIds.has(anchorEff.timingId) ? {
|
|
1403
|
+
startAfterTimingId: anchorEff.startAfterTimingId,
|
|
1404
|
+
...anchorEff.startAfterOffsetMs === void 0 ? {} : { startAfterOffsetMs: anchorEff.startAfterOffsetMs }
|
|
1405
|
+
} : {}
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
if (stepByParagraph.size > 0 && targetNode instanceof RichTextContainer) {
|
|
1409
|
+
const originalPChildren = [...targetNode.children];
|
|
1410
|
+
for (const child of originalPChildren) if (child instanceof CommonNode) child.remove();
|
|
1411
|
+
const wrappedPChildren = [];
|
|
1412
|
+
let activeStepHost;
|
|
1413
|
+
let activeClickStep;
|
|
1414
|
+
for (const child of originalPChildren) if (child instanceof CommonNode) {
|
|
1415
|
+
const clickStep = stepByParagraph.get(child);
|
|
1416
|
+
if (clickStep !== void 0) {
|
|
1417
|
+
if (activeStepHost === void 0 || activeClickStep !== clickStep) {
|
|
1418
|
+
activeStepHost = createMotionStepNode({
|
|
1419
|
+
n: clickStep,
|
|
1420
|
+
stepIdentity: createMotionStepIdentity()
|
|
1421
|
+
});
|
|
1422
|
+
activeClickStep = clickStep;
|
|
1423
|
+
wrappedPChildren.push(activeStepHost);
|
|
1424
|
+
}
|
|
1425
|
+
activeStepHost.append(child);
|
|
1426
|
+
} else {
|
|
1427
|
+
activeStepHost = void 0;
|
|
1428
|
+
activeClickStep = void 0;
|
|
1429
|
+
wrappedPChildren.push(child);
|
|
1430
|
+
}
|
|
1431
|
+
} else {
|
|
1432
|
+
activeStepHost = void 0;
|
|
1433
|
+
activeClickStep = void 0;
|
|
1434
|
+
wrappedPChildren.push(child.text);
|
|
1435
|
+
}
|
|
1436
|
+
targetNode.content(...wrappedPChildren);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
const referencedTimingIds = /* @__PURE__ */ new Set();
|
|
1440
|
+
for (const eff of liftedCollapsed) if (eff.startAfterTimingId !== void 0 && !internalChainTimingIds.has(eff.timingId) && !omittedNodeIds.has(eff.startAfterTimingId)) {
|
|
1441
|
+
referencedTimingIds.add(eff.startAfterTimingId);
|
|
1442
|
+
if (liftedCollapsed.find((candidate) => candidate.timingId === eff.startAfterTimingId)?.targetRange?.type === "paragraph") paragraphPublishTimingIds.add(eff.startAfterTimingId);
|
|
1443
|
+
}
|
|
1444
|
+
const handleByTimingId = /* @__PURE__ */ new Map();
|
|
1445
|
+
for (const tid of referencedTimingIds) handleByTimingId.set(tid, createMotionScopeHandle());
|
|
1446
|
+
for (const pInfo of paragraphNodesByKey.values()) {
|
|
1447
|
+
if (pInfo.startAfterTimingId === void 0) continue;
|
|
1448
|
+
const sourceHandle = handleByTimingId.get(pInfo.startAfterTimingId);
|
|
1449
|
+
if (sourceHandle === void 0) continue;
|
|
1450
|
+
const offset = pInfo.startAfterOffsetMs ?? 0;
|
|
1451
|
+
const moment = paragraphPublishTimingIds.has(pInfo.startAfterTimingId) ? sourceHandle.cue("done") : sourceHandle.end;
|
|
1452
|
+
pInfo.pNode.set({ startAt: offset > 0 ? after(moment, offset) : moment });
|
|
1453
|
+
}
|
|
1454
|
+
for (const tid of paragraphPublishTimingIds) {
|
|
1455
|
+
const sourceEff = liftedCollapsed.find((e) => e.timingId === tid);
|
|
1456
|
+
const sourceNode = sourceEff === void 0 ? void 0 : objectBySpid.get(sourceEff.targetId);
|
|
1457
|
+
const handle = handleByTimingId.get(tid);
|
|
1458
|
+
if (sourceNode !== void 0 && sourceEff?.targetRange?.type === "paragraph" && handle !== void 0) paragraphNodesByKey.get(`${sourceNode.id}:${sourceEff.targetRange.start}`)?.pNode.set({ publishEnd: handle.cue("done") });
|
|
1459
|
+
}
|
|
1460
|
+
const ancestorsOfTimingId = (timingId) => {
|
|
1461
|
+
const chain = [];
|
|
1462
|
+
let current = timingId;
|
|
1463
|
+
while (current !== void 0) {
|
|
1464
|
+
if (handleByTimingId.has(current) && !paragraphPublishTimingIds.has(current)) chain.unshift(current);
|
|
1465
|
+
current = rawNodesById.get(current)?.parentTimingId;
|
|
1466
|
+
}
|
|
1467
|
+
return chain;
|
|
1468
|
+
};
|
|
1469
|
+
const assignmentByTopLevel = /* @__PURE__ */ new Map();
|
|
1470
|
+
for (const eff of liftedCollapsed) {
|
|
1471
|
+
if (eff.targetRange?.type === "paragraph") continue;
|
|
1472
|
+
const targetNode = objectBySpid.get(eff.targetId);
|
|
1473
|
+
if (targetNode === void 0) continue;
|
|
1474
|
+
const topLevelNode = topLevelOwnerByNode.get(targetNode) ?? targetNode;
|
|
1475
|
+
const anchorStep = anchorStepIndexByTopLevel.get(topLevelNode);
|
|
1476
|
+
if (eff.stepIndex !== anchorStep) continue;
|
|
1477
|
+
if (assignmentByTopLevel.has(topLevelNode)) continue;
|
|
1478
|
+
const clickStep = clickNumberByStepIndex.get(eff.stepIndex);
|
|
1479
|
+
const sourceScopeIds = ancestorsOfTimingId(eff.timingId);
|
|
1480
|
+
let startAfter;
|
|
1481
|
+
if (eff.startAfterTimingId !== void 0 && !internalChainTimingIds.has(eff.timingId)) {
|
|
1482
|
+
const sourceHandle = handleByTimingId.get(eff.startAfterTimingId);
|
|
1483
|
+
if (sourceHandle !== void 0) {
|
|
1484
|
+
const offset = eff.startAfterOffsetMs ?? 0;
|
|
1485
|
+
const moment = paragraphPublishTimingIds.has(eff.startAfterTimingId) ? sourceHandle.cue("done") : sourceHandle.end;
|
|
1486
|
+
startAfter = offset > 0 ? after(moment, offset) : moment;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
assignmentByTopLevel.set(topLevelNode, {
|
|
1490
|
+
...clickStep === void 0 ? {} : { clickStep },
|
|
1491
|
+
sourceScopeIds,
|
|
1492
|
+
...startAfter === void 0 ? {} : { startAfter }
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
const originalChildren = [...context.slideNode.children];
|
|
1496
|
+
const anyMotionScopesNeeded = referencedTimingIds.size > 0;
|
|
1497
|
+
const indexByChild = /* @__PURE__ */ new Map();
|
|
1498
|
+
let childOrd = 0;
|
|
1499
|
+
for (const child of originalChildren) if (child instanceof CommonNode) indexByChild.set(child, childOrd++);
|
|
1500
|
+
let needsScopeReordering = false;
|
|
1501
|
+
if (anyMotionScopesNeeded) for (const scopeTimingId of referencedTimingIds) {
|
|
1502
|
+
const indices = originalChildren.filter((c) => c instanceof CommonNode).filter((c) => assignmentByTopLevel.get(c)?.sourceScopeIds.includes(scopeTimingId)).map((c) => indexByChild.get(c)).sort((a, b) => a - b);
|
|
1503
|
+
if (indices.length > 1 && indices[indices.length - 1] - indices[0] + 1 !== indices.length) needsScopeReordering = true;
|
|
1504
|
+
}
|
|
1505
|
+
if (needsScopeReordering) for (const [node, ord] of indexByChild) node.style({ zIndex: ord });
|
|
1506
|
+
if (assignmentByTopLevel.size === 0) return diagnostics.length === 0 ? {} : { diagnostics };
|
|
1507
|
+
for (const child of originalChildren) if (child instanceof CommonNode || child instanceof CommonContainer) child.remove();
|
|
1508
|
+
const orderedNodes = [...originalChildren].filter((c) => c instanceof CommonNode);
|
|
1509
|
+
if (needsScopeReordering) {
|
|
1510
|
+
const earliestForScope = /* @__PURE__ */ new Map();
|
|
1511
|
+
for (const tid of referencedTimingIds) {
|
|
1512
|
+
const minOrd = Math.min(...orderedNodes.filter((n) => assignmentByTopLevel.get(n)?.sourceScopeIds.includes(tid)).map((n) => indexByChild.get(n)));
|
|
1513
|
+
earliestForScope.set(tid, minOrd);
|
|
1514
|
+
}
|
|
1515
|
+
orderedNodes.sort((left, right) => {
|
|
1516
|
+
const leftAssign = assignmentByTopLevel.get(left);
|
|
1517
|
+
const rightAssign = assignmentByTopLevel.get(right);
|
|
1518
|
+
return (leftAssign?.sourceScopeIds[0] !== void 0 ? earliestForScope.get(leftAssign.sourceScopeIds[0]) ?? indexByChild.get(left) : indexByChild.get(left)) - (rightAssign?.sourceScopeIds[0] !== void 0 ? earliestForScope.get(rightAssign.sourceScopeIds[0]) ?? indexByChild.get(right) : indexByChild.get(right)) || indexByChild.get(left) - indexByChild.get(right);
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
const createdScopeHosts = /* @__PURE__ */ new Map();
|
|
1522
|
+
for (const node of orderedNodes) {
|
|
1523
|
+
const assign = assignmentByTopLevel.get(node);
|
|
1524
|
+
if (assign === void 0) {
|
|
1525
|
+
slideContainer.append(node);
|
|
1526
|
+
continue;
|
|
1527
|
+
}
|
|
1528
|
+
let wrapped = node;
|
|
1529
|
+
if (assign.startAfter !== void 0) {
|
|
1530
|
+
const consumerHandle = createMotionScopeHandle();
|
|
1531
|
+
const consumerScope = createMotionScopeNode({
|
|
1532
|
+
scope: consumerHandle,
|
|
1533
|
+
startAt: assign.startAfter
|
|
1534
|
+
});
|
|
1535
|
+
consumerScope.append(wrapped);
|
|
1536
|
+
wrapped = consumerScope;
|
|
1537
|
+
}
|
|
1538
|
+
let appendedToExistingHost = false;
|
|
1539
|
+
for (const scopeId of [...assign.sourceScopeIds].reverse()) {
|
|
1540
|
+
const existingHost = createdScopeHosts.get(scopeId);
|
|
1541
|
+
if (existingHost !== void 0) {
|
|
1542
|
+
existingHost.append(wrapped);
|
|
1543
|
+
appendedToExistingHost = true;
|
|
1544
|
+
break;
|
|
1545
|
+
}
|
|
1546
|
+
const handle = handleByTimingId.get(scopeId);
|
|
1547
|
+
const scopeHost = createMotionScopeNode({ scope: handle });
|
|
1548
|
+
scopeHost.append(wrapped);
|
|
1549
|
+
createdScopeHosts.set(scopeId, scopeHost);
|
|
1550
|
+
wrapped = scopeHost;
|
|
1551
|
+
}
|
|
1552
|
+
if (appendedToExistingHost) continue;
|
|
1553
|
+
if (assign.clickStep !== void 0) {
|
|
1554
|
+
const lastChild = slideContainer.children.at(-1);
|
|
1555
|
+
if (lastChild instanceof CommonContainer && lastChild.kind === "motion-step" && lastChild.props["n"] === assign.clickStep) lastChild.append(wrapped);
|
|
1556
|
+
else {
|
|
1557
|
+
const stepHost = createMotionStepNode({
|
|
1558
|
+
n: assign.clickStep,
|
|
1559
|
+
stepIdentity: createMotionStepIdentity()
|
|
1560
|
+
});
|
|
1561
|
+
stepHost.append(wrapped);
|
|
1562
|
+
slideContainer.append(stepHost);
|
|
1563
|
+
}
|
|
1564
|
+
} else slideContainer.append(wrapped);
|
|
1565
|
+
}
|
|
1566
|
+
return diagnostics.length === 0 ? {} : { diagnostics };
|
|
1567
|
+
}
|
|
1568
|
+
export { readSlideMotionImport };
|