@docmentis/udoc-viewer 0.7.10 → 0.7.12

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.
Files changed (46) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/UDocClient.d.ts +13 -0
  3. package/dist/src/UDocClient.d.ts.map +1 -1
  4. package/dist/src/UDocClient.js +1 -1
  5. package/dist/src/UDocClient.js.map +1 -1
  6. package/dist/src/UDocViewer.d.ts.map +1 -1
  7. package/dist/src/UDocViewer.js +3 -1
  8. package/dist/src/UDocViewer.js.map +1 -1
  9. package/dist/src/ui/viewer/animation-presets.d.ts +37 -0
  10. package/dist/src/ui/viewer/animation-presets.d.ts.map +1 -0
  11. package/dist/src/ui/viewer/animation-presets.js +123 -0
  12. package/dist/src/ui/viewer/animation-presets.js.map +1 -0
  13. package/dist/src/ui/viewer/animation.d.ts +162 -0
  14. package/dist/src/ui/viewer/animation.d.ts.map +1 -0
  15. package/dist/src/ui/viewer/animation.js +506 -0
  16. package/dist/src/ui/viewer/animation.js.map +1 -0
  17. package/dist/src/ui/viewer/components/Spread.d.ts +6 -0
  18. package/dist/src/ui/viewer/components/Spread.d.ts.map +1 -1
  19. package/dist/src/ui/viewer/components/Spread.js +41 -0
  20. package/dist/src/ui/viewer/components/Spread.js.map +1 -1
  21. package/dist/src/ui/viewer/components/Toolbar.d.ts.map +1 -1
  22. package/dist/src/ui/viewer/components/Toolbar.js +4 -0
  23. package/dist/src/ui/viewer/components/Toolbar.js.map +1 -1
  24. package/dist/src/ui/viewer/components/Viewport.d.ts.map +1 -1
  25. package/dist/src/ui/viewer/components/Viewport.js +113 -3
  26. package/dist/src/ui/viewer/components/Viewport.js.map +1 -1
  27. package/dist/src/ui/viewer/state.d.ts +2 -0
  28. package/dist/src/ui/viewer/state.d.ts.map +1 -1
  29. package/dist/src/ui/viewer/state.js +1 -0
  30. package/dist/src/ui/viewer/state.js.map +1 -1
  31. package/dist/src/wasm/udoc.d.ts +150 -3
  32. package/dist/src/wasm/udoc.js +84 -12
  33. package/dist/src/wasm/udoc_bg.wasm +0 -0
  34. package/dist/src/wasm/udoc_bg.wasm.d.ts +5 -3
  35. package/dist/src/worker/WorkerClient.d.ts +18 -2
  36. package/dist/src/worker/WorkerClient.d.ts.map +1 -1
  37. package/dist/src/worker/WorkerClient.js +27 -0
  38. package/dist/src/worker/WorkerClient.js.map +1 -1
  39. package/dist/src/worker/index.d.ts +1 -1
  40. package/dist/src/worker/index.d.ts.map +1 -1
  41. package/dist/src/worker/worker-inline.js +1 -1
  42. package/dist/src/worker/worker.d.ts +28 -2
  43. package/dist/src/worker/worker.d.ts.map +1 -1
  44. package/dist/src/worker/worker.js +103 -10
  45. package/dist/src/worker/worker.js.map +1 -1
  46. package/package.json +1 -1
@@ -0,0 +1,506 @@
1
+ /**
2
+ * Slide build sequences for PPTX animations.
3
+ *
4
+ * The WASM side rasterizes a slide into z-ordered layers — one per animated
5
+ * shape, plus one per run of static content between them — and hands over a
6
+ * timeline of click steps. This module stacks those layers as DOM elements and
7
+ * plays the steps with the Web Animations API, so compositing stays on the GPU
8
+ * and no re-render is needed per frame.
9
+ *
10
+ * Paragraph builds clip a text shape's single layer to the band occupied by
11
+ * the revealed paragraphs, derived from the page's text layout. Paragraphs
12
+ * never overlap, so clipping is exact.
13
+ */
14
+ import { resolveEasing, resolveMotion } from "./animation-presets.js";
15
+ /**
16
+ * Plays one slide's build sequence over a stack of layer canvases.
17
+ *
18
+ * Step counting: `step` is the number of steps already played. At 0 nothing
19
+ * has run, so entrance targets are hidden; at `stepCount` the build is
20
+ * complete and the slide looks like a normal full-page render.
21
+ */
22
+ export class SlideAnimationController {
23
+ animation;
24
+ host;
25
+ layers = [];
26
+ running = new Set();
27
+ /** Step at which each shape first enters, if it has an entrance effect. */
28
+ entranceStep = new Map();
29
+ /** Step at which each shape first leaves, if it has an exit effect. */
30
+ exitStep = new Map();
31
+ /** Paragraph bands per shape, for shapes built paragraph by paragraph. */
32
+ paragraphBands = new Map();
33
+ /** Step at which each paragraph of a shape is revealed. */
34
+ paragraphStep = new Map();
35
+ currentStep = 0;
36
+ constructor(options) {
37
+ this.animation = options.animation;
38
+ this.host = options.host;
39
+ this.indexEffects();
40
+ this.indexParagraphBands(options.layout, options.renderHeight);
41
+ this.mountLayers(options.layers, options.renderWidth, options.renderHeight);
42
+ this.applyState(0, false);
43
+ }
44
+ /** Number of clicks this slide's build takes. */
45
+ get stepCount() {
46
+ return this.animation.steps.length;
47
+ }
48
+ /** Steps already played. */
49
+ get step() {
50
+ return this.currentStep;
51
+ }
52
+ /** Whether every step has played. */
53
+ get isComplete() {
54
+ return this.currentStep >= this.stepCount;
55
+ }
56
+ /**
57
+ * Play the next step.
58
+ *
59
+ * Returns false when the build is already finished, which is the caller's
60
+ * cue to advance the slide instead.
61
+ */
62
+ next() {
63
+ if (this.isComplete)
64
+ return false;
65
+ this.currentStep += 1;
66
+ this.applyState(this.currentStep, true);
67
+ return true;
68
+ }
69
+ /** Jump to a step's resting state without animating. */
70
+ seek(step) {
71
+ this.currentStep = Math.min(Math.max(step, 0), this.stepCount);
72
+ this.applyState(this.currentStep, false);
73
+ }
74
+ /** Show the fully built slide, as when navigating backwards into it. */
75
+ complete() {
76
+ this.seek(this.stepCount);
77
+ }
78
+ /**
79
+ * Whether this build is still mounted in `host` and on screen.
80
+ *
81
+ * A viewer that was destroyed and recreated leaves the old controller
82
+ * pointing at detached nodes; reusing it would show no layers at all.
83
+ */
84
+ isMountedIn(host) {
85
+ return this.host === host && host.isConnected;
86
+ }
87
+ /** Cancel in-flight animations and remove the layer stack. */
88
+ destroy() {
89
+ for (const animation of this.running)
90
+ animation.cancel();
91
+ this.running.clear();
92
+ for (const layer of this.layers)
93
+ layer.element.remove();
94
+ this.layers.length = 0;
95
+ }
96
+ // ── Indexing ──
97
+ /** Record, per shape, the steps at which it enters, leaves and builds. */
98
+ indexEffects() {
99
+ this.animation.steps.forEach((step, index) => {
100
+ for (const effect of step.effects) {
101
+ const key = effect.shapeKey;
102
+ if (effect.target.type === "paragraphs") {
103
+ for (let p = effect.target.start; p < effect.target.end; p++) {
104
+ const id = paragraphId(key, p);
105
+ if (!this.paragraphStep.has(id))
106
+ this.paragraphStep.set(id, index);
107
+ }
108
+ continue;
109
+ }
110
+ if (effect.class === "entrance" && !this.entranceStep.has(key)) {
111
+ this.entranceStep.set(key, index);
112
+ }
113
+ else if (effect.class === "exit" && !this.exitStep.has(key)) {
114
+ this.exitStep.set(key, index);
115
+ }
116
+ }
117
+ });
118
+ }
119
+ /**
120
+ * Derive each built shape's paragraph bands from the page text layout.
121
+ *
122
+ * Lines carry `isFirstLineOfPara`, so paragraphs are the runs between
123
+ * those flags. Bands are stored as fractions of the page height so they
124
+ * survive zoom without recomputation.
125
+ */
126
+ indexParagraphBands(layout, renderHeight) {
127
+ if (!layout || renderHeight <= 0)
128
+ return;
129
+ const built = new Set();
130
+ for (const id of this.paragraphStep.keys())
131
+ built.add(shapeOfParagraphId(id));
132
+ if (built.size === 0)
133
+ return;
134
+ for (const frame of layout.frames) {
135
+ const key = frame.shapeKey;
136
+ if (key === undefined || !built.has(key) || !frame.parcel)
137
+ continue;
138
+ // Parcel coordinates are frame-local; the frame transform places
139
+ // it on the page, and layout units are points like page.height.
140
+ const frameTop = frame.transform.translateY + frame.parcel.y;
141
+ const bands = [];
142
+ for (const line of frame.parcel.lines) {
143
+ const top = (frameTop + line.y - line.height) / layout.height;
144
+ const bottom = (frameTop + line.y) / layout.height;
145
+ if (line.isFirstLineOfPara || bands.length === 0) {
146
+ bands.push({ top, bottom });
147
+ }
148
+ else {
149
+ const last = bands[bands.length - 1];
150
+ last.top = Math.min(last.top, top);
151
+ last.bottom = Math.max(last.bottom, bottom);
152
+ }
153
+ }
154
+ if (bands.length > 0)
155
+ this.paragraphBands.set(key, bands);
156
+ }
157
+ }
158
+ // ── Mounting ──
159
+ mountLayers(layers, renderWidth, renderHeight) {
160
+ if (renderWidth <= 0 || renderHeight <= 0)
161
+ return;
162
+ for (const layer of layers) {
163
+ if (layer.width === 0 || layer.height === 0)
164
+ continue;
165
+ const canvas = document.createElement("canvas");
166
+ canvas.className = "udoc-spread__animation-layer";
167
+ canvas.width = layer.width;
168
+ canvas.height = layer.height;
169
+ canvas.setAttribute("aria-hidden", "true");
170
+ const context = canvas.getContext("2d");
171
+ if (context) {
172
+ // Copy rather than view the transferred buffer: ImageData
173
+ // requires a plain ArrayBuffer, and the copy is one frame's
174
+ // cost against a raster that is then reused for every step.
175
+ const image = context.createImageData(layer.width, layer.height);
176
+ image.data.set(layer.rgba);
177
+ context.putImageData(image, 0, 0);
178
+ }
179
+ // Position as a percentage of the host so zooming needs no relayout.
180
+ canvas.style.position = "absolute";
181
+ canvas.style.left = `${(layer.x / renderWidth) * 100}%`;
182
+ canvas.style.top = `${(layer.y / renderHeight) * 100}%`;
183
+ canvas.style.width = `${(layer.width / renderWidth) * 100}%`;
184
+ canvas.style.height = `${(layer.height / renderHeight) * 100}%`;
185
+ canvas.style.transformOrigin = "center";
186
+ this.host.appendChild(canvas);
187
+ this.layers.push({
188
+ shapeKey: layer.shapeKey,
189
+ element: canvas,
190
+ topFraction: layer.y / renderHeight,
191
+ heightFraction: layer.height / renderHeight,
192
+ });
193
+ }
194
+ }
195
+ // ── Playback ──
196
+ /**
197
+ * Put every layer into its state after `step` steps.
198
+ *
199
+ * When `animate` is set, shapes whose state changes during this step play
200
+ * their effect; everything else snaps, which is what makes `seek` cheap.
201
+ */
202
+ applyState(step, animate) {
203
+ for (const animation of this.running)
204
+ animation.cancel();
205
+ this.running.clear();
206
+ const playing = animate ? this.effectsOfStep(step - 1) : new Map();
207
+ for (const layer of this.layers) {
208
+ const key = layer.shapeKey;
209
+ if (key === undefined) {
210
+ layer.element.style.opacity = "1";
211
+ continue;
212
+ }
213
+ this.applyParagraphClip(layer, key, step);
214
+ const visible = this.isVisibleAt(key, step);
215
+ const effect = playing.get(key);
216
+ if (effect) {
217
+ this.play(layer, effect, visible);
218
+ }
219
+ else {
220
+ layer.element.style.opacity = visible ? "1" : "0";
221
+ layer.element.style.transform = "";
222
+ }
223
+ }
224
+ }
225
+ /** Effects belonging to a step, keyed by shape. */
226
+ effectsOfStep(index) {
227
+ const effects = new Map();
228
+ const step = this.animation.steps[index];
229
+ if (!step)
230
+ return effects;
231
+ for (const effect of step.effects) {
232
+ if (!effects.has(effect.shapeKey))
233
+ effects.set(effect.shapeKey, effect);
234
+ }
235
+ return effects;
236
+ }
237
+ play(layer, effect, endsVisible) {
238
+ const motion = resolveMotion(effect);
239
+ if (!motion) {
240
+ layer.element.style.opacity = endsVisible ? "1" : "0";
241
+ return;
242
+ }
243
+ // A zero-length effect (Appear) still needs a frame to commit, so give
244
+ // the animation a floor rather than special-casing instant effects.
245
+ const duration = Math.max(effect.durationMs, 1);
246
+ const animation = layer.element.animate(motion.keyframes, {
247
+ duration,
248
+ delay: effect.startMs,
249
+ easing: resolveEasing(effect.accelerate, effect.decelerate),
250
+ iterations: effect.repeatCount ?? Infinity,
251
+ direction: effect.autoReverse ? "alternate" : "normal",
252
+ fill: "both",
253
+ });
254
+ this.running.add(animation);
255
+ animation.addEventListener("finish", () => {
256
+ this.running.delete(animation);
257
+ layer.element.style.opacity = motion.endsVisible ? "1" : "0";
258
+ layer.element.style.transform = "";
259
+ animation.cancel();
260
+ });
261
+ }
262
+ /** Whether a shape is on screen once `step` steps have played. */
263
+ isVisibleAt(shapeKey, step) {
264
+ const entrance = this.entranceStep.get(shapeKey);
265
+ if (entrance !== undefined && step <= entrance)
266
+ return false;
267
+ const exit = this.exitStep.get(shapeKey);
268
+ if (exit !== undefined && step > exit)
269
+ return false;
270
+ return true;
271
+ }
272
+ /**
273
+ * Clip a paragraph-built shape to the paragraphs revealed so far.
274
+ *
275
+ * Bands are page-relative, so they are rebased onto the layer's own box
276
+ * before becoming an inset. Shapes without a build get no clip at all.
277
+ */
278
+ applyParagraphClip(layer, shapeKey, step) {
279
+ const bands = this.paragraphBands.get(shapeKey);
280
+ if (!bands || layer.heightFraction <= 0)
281
+ return;
282
+ let revealed = -1;
283
+ for (let index = 0; index < bands.length; index++) {
284
+ const at = this.paragraphStep.get(paragraphId(shapeKey, index));
285
+ // A paragraph with no effect of its own is part of the base text.
286
+ if (at === undefined || step > at)
287
+ revealed = index;
288
+ else
289
+ break;
290
+ }
291
+ if (revealed < 0) {
292
+ layer.element.style.clipPath = "inset(0 0 100% 0)";
293
+ return;
294
+ }
295
+ if (revealed >= bands.length - 1) {
296
+ layer.element.style.clipPath = "";
297
+ return;
298
+ }
299
+ const cutoff = bands[revealed].bottom;
300
+ const bottomInset = 1 - (cutoff - layer.topFraction) / layer.heightFraction;
301
+ layer.element.style.clipPath = `inset(0 0 ${(bottomInset * 100).toFixed(3)}% 0)`;
302
+ }
303
+ }
304
+ function paragraphId(shapeKey, paragraph) {
305
+ return `${shapeKey}:${paragraph}`;
306
+ }
307
+ function shapeOfParagraphId(id) {
308
+ return Number(id.slice(0, id.indexOf(":")));
309
+ }
310
+ // ── The build currently on screen ──
311
+ //
312
+ // Exactly one slide is presented at a time in spread mode, so the active
313
+ // controller is shared rather than threaded through every component that can
314
+ // advance the deck.
315
+ let active = null;
316
+ let activeRestore = null;
317
+ /** Identity of the mounted build, so re-renders can skip or resume it. */
318
+ let activeKey = null;
319
+ /** Bumped by every mount attempt so a superseded one discards its result. */
320
+ let mountGeneration = 0;
321
+ /**
322
+ * Build sequences already fetched, keyed `docId:pageIndex`.
323
+ *
324
+ * Knowing whether a slide animates *before* its layers are ready is what lets
325
+ * the viewer avoid showing the finished slide and then rewinding it to step 0.
326
+ * `null` records "asked, and it has none".
327
+ */
328
+ const animationCache = new Map();
329
+ function cacheKey(docId, pageIndex) {
330
+ return `${docId}:${pageIndex}`;
331
+ }
332
+ /** Fetch a slide's build sequence, reusing the cached answer when there is one. */
333
+ async function loadAnimation(workerClient, docId, pageIndex) {
334
+ const key = cacheKey(docId, pageIndex);
335
+ const cached = animationCache.get(key);
336
+ if (cached !== undefined)
337
+ return cached;
338
+ const animation = (await workerClient.getSlideAnimation(docId, pageIndex)) ?? null;
339
+ animationCache.set(key, animation);
340
+ return animation;
341
+ }
342
+ /**
343
+ * Whether a slide is known to animate, without waiting on the worker.
344
+ *
345
+ * `undefined` means "not asked yet" — the caller must not assume either way.
346
+ */
347
+ export function knownToAnimate(docId, pageIndex) {
348
+ const cached = animationCache.get(cacheKey(docId, pageIndex));
349
+ if (cached === undefined)
350
+ return undefined;
351
+ return cached !== null && cached.steps.length > 0;
352
+ }
353
+ /**
354
+ * Warm the cache for a slide so arriving at it needs no worker round trip.
355
+ *
356
+ * Called for the slides on either side of the current one, which covers the
357
+ * sequential stepping that presenting a deck actually consists of.
358
+ */
359
+ export function prefetchSlideAnimation(workerClient, docId, pageIndex) {
360
+ if (pageIndex < 0)
361
+ return;
362
+ if (animationCache.has(cacheKey(docId, pageIndex)))
363
+ return;
364
+ void loadAnimation(workerClient, docId, pageIndex).catch(() => {
365
+ // A prefetch failure is not worth surfacing; the real mount retries.
366
+ animationCache.delete(cacheKey(docId, pageIndex));
367
+ });
368
+ }
369
+ /**
370
+ * Drop cached build sequences, for one document or all of them.
371
+ *
372
+ * Document ids are recycled — a fresh client numbers from `doc_0` again — so a
373
+ * stale entry would otherwise hand one document's timeline to another.
374
+ */
375
+ export function forgetSlideAnimations(docId) {
376
+ if (docId === undefined) {
377
+ animationCache.clear();
378
+ return;
379
+ }
380
+ for (const key of [...animationCache.keys()]) {
381
+ if (key.startsWith(`${docId}:`))
382
+ animationCache.delete(key);
383
+ }
384
+ }
385
+ /**
386
+ * Advance the on-screen build by one step.
387
+ *
388
+ * Returns true when a step played, which means the caller must NOT turn the
389
+ * page: the click belonged to the build, not to navigation.
390
+ */
391
+ export function advanceActiveSlideAnimation() {
392
+ return active?.next() ?? false;
393
+ }
394
+ /** Steps played on the on-screen build, or null when none is mounted. */
395
+ export function activeSlideAnimationStep() {
396
+ return active?.step ?? null;
397
+ }
398
+ /** Whether a build is on screen with steps still to play. */
399
+ export function hasPendingSlideAnimation() {
400
+ return active !== null && !active.isComplete;
401
+ }
402
+ /** Tear down the on-screen build and restore the plain page canvas. */
403
+ export function clearActiveSlideAnimation() {
404
+ active?.destroy();
405
+ active = null;
406
+ activeKey = null;
407
+ activeRestore?.();
408
+ activeRestore = null;
409
+ // The canvas may be hidden with no controller yet — a mount that was
410
+ // abandoned between "this slide animates" and "its layers are ready".
411
+ showPageCanvas(hiddenPageCanvas);
412
+ }
413
+ /**
414
+ * Hide the plain page canvas while a build owns the slide.
415
+ *
416
+ * Tracked so an aborted mount can put it back: the canvas is hidden before the
417
+ * layers exist, so every failure path after that point must restore it.
418
+ */
419
+ let hiddenPageCanvas = null;
420
+ function hidePageCanvas(canvas) {
421
+ if (hiddenPageCanvas === canvas)
422
+ return;
423
+ showPageCanvas(hiddenPageCanvas);
424
+ hiddenPageCanvas = canvas;
425
+ canvas.style.visibility = "hidden";
426
+ }
427
+ function showPageCanvas(canvas) {
428
+ if (!canvas)
429
+ return;
430
+ canvas.style.visibility = "";
431
+ if (hiddenPageCanvas === canvas)
432
+ hiddenPageCanvas = null;
433
+ }
434
+ /**
435
+ * Load and mount a slide's build sequence.
436
+ *
437
+ * Returns false — leaving the plain page canvas in place — when the slide has
438
+ * no animation, which is the overwhelming majority of pages.
439
+ */
440
+ export async function mountSlideAnimation(options) {
441
+ const { workerClient, docId, pageIndex, host, pageCanvas } = options;
442
+ // Re-rendering the same slide at the same resolution — a scroll, or a
443
+ // layout pass that changed nothing — must not restart the build.
444
+ const key = `${docId}:${pageIndex}:${options.renderWidth}x${options.renderHeight}`;
445
+ if (active && activeKey === key && active.isMountedIn(host))
446
+ return true;
447
+ // Everything below runs while the previous build stays live and clickable.
448
+ // Tearing it down first would leave a window — several frames of worker
449
+ // round-trips — in which an advance would turn the page instead of stepping
450
+ // the build, and the layer stack would visibly flash.
451
+ const generation = ++mountGeneration;
452
+ const superseded = () => generation !== mountGeneration;
453
+ const animation = await loadAnimation(workerClient, docId, pageIndex);
454
+ if (superseded())
455
+ return active !== null;
456
+ if (!animation || animation.steps.length === 0) {
457
+ clearActiveSlideAnimation();
458
+ return false;
459
+ }
460
+ // Hide the finished slide the moment we know it builds, rather than after
461
+ // its layers are ready: rasterizing them takes long enough that the viewer
462
+ // would otherwise show the completed slide and then rewind it to step 0.
463
+ hidePageCanvas(pageCanvas);
464
+ const layers = await workerClient.renderPageLayers(docId, pageIndex, options.renderWidth, options.renderHeight);
465
+ if (superseded())
466
+ return active !== null;
467
+ if (!layers || layers.length === 0) {
468
+ clearActiveSlideAnimation();
469
+ return false;
470
+ }
471
+ // Paragraph builds need the text layout to find their bands; a slide that
472
+ // only animates whole shapes does not, so a failure here is not fatal.
473
+ let layout;
474
+ if (animation.steps.some((step) => step.effects.some((e) => e.target.type === "paragraphs"))) {
475
+ layout = await workerClient.getLayoutPage(docId, pageIndex).catch(() => undefined);
476
+ if (superseded())
477
+ return active !== null;
478
+ }
479
+ // Zoom and rotation change the resolution, so the layers were rasterized
480
+ // again; carry the step across so the build resumes where it was.
481
+ const resumeStep = activeKey?.startsWith(`${docId}:${pageIndex}:`) ? (active?.step ?? null) : null;
482
+ clearActiveSlideAnimation();
483
+ const controller = new SlideAnimationController({
484
+ animation,
485
+ layers,
486
+ renderWidth: options.renderWidth,
487
+ renderHeight: options.renderHeight,
488
+ host,
489
+ layout,
490
+ });
491
+ if (resumeStep !== null)
492
+ controller.seek(resumeStep);
493
+ else if (options.startComplete)
494
+ controller.complete();
495
+ const previousHostDisplay = host.style.display;
496
+ host.style.display = "block";
497
+ hidePageCanvas(pageCanvas);
498
+ active = controller;
499
+ activeKey = key;
500
+ activeRestore = () => {
501
+ showPageCanvas(pageCanvas);
502
+ host.style.display = previousHostDisplay;
503
+ };
504
+ return true;
505
+ }
506
+ //# sourceMappingURL=animation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation.js","sourceRoot":"","sources":["../../../../src/ui/viewer/animation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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AAU,CAAC;IACpB,SAAS,GAAG,GAAG,CAAC;IAChB,aAAa,GAAG,GAAG,EAAE;QACjB,cAAc,CAAC,UAAU,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,mBAAmB,CAAC;IAC7C,CAAC,CAAC;IACF,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -66,6 +66,12 @@ export declare function createSpread(data: SpreadData, showAttribution?: boolean
66
66
  mount: (container: HTMLElement) => void;
67
67
  destroy: () => void;
68
68
  render: (workerClient: WorkerClient, options: SpreadRenderOptions) => Promise<void>;
69
+ getAnimationTargets: (pageNumber: number) => {
70
+ host: HTMLElement;
71
+ canvas: HTMLElement;
72
+ cssWidth: number;
73
+ cssHeight: number;
74
+ } | null;
69
75
  updateLayout: (options: SpreadLayoutOptions) => void;
70
76
  updateAnnotations: (annotations: Map<number, Annotation[]>, options: SpreadLayoutOptions, highlightedAnnotation?: HighlightedAnnotation | null) => void;
71
77
  updateTextLayer: (textContent: Map<number, LayoutPage>, options: SpreadLayoutOptions) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"Spread.d.ts","sourceRoot":"","sources":["../../../../../src/ui/viewer/components/Spread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAY,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE/E,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAA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read(data, showAttribution = true, i18n, customPageOverl
80
80
  canvas.setAttribute("aria-label", i18n ? i18n.t("spread.pageContent", { page: pageNumber }) : `Page ${pageNumber} content`);
81
81
  canvas.textContent = i18n ? i18n.t("spread.pageLabel", { page: pageNumber }) : `Page ${pageNumber}`;
82
82
  container.appendChild(canvas);
83
+ // Animation layer host (above canvas, below text) — holds the
84
+ // per-shape canvases while a PPTX build sequence is playing.
85
+ const animationLayerHost = document.createElement("div");
86
+ animationLayerHost.className = "udoc-spread__animation-layer-host";
87
+ animationLayerHost.style.position = "absolute";
88
+ animationLayerHost.style.transformOrigin = "center";
89
+ animationLayerHost.style.pointerEvents = "none";
90
+ animationLayerHost.style.display = "none";
91
+ animationLayerHost.setAttribute("aria-hidden", "true");
92
+ container.appendChild(animationLayerHost);
83
93
  // Text layer (above canvas, below annotations) - for text selection
84
94
  const textLayer = document.createElement("div");
85
95
  textLayer.className = "udoc-spread__text-layer";
@@ -168,6 +178,7 @@ export function createSpread(data, showAttribution = true, i18n, customPageOverl
168
178
  container,
169
179
  canvas,
170
180
  previewCanvas,
181
+ animationLayerHost,
171
182
  textLayer,
172
183
  annotationLayer,
173
184
  searchHighlightLayer,
@@ -199,6 +210,7 @@ export function createSpread(data, showAttribution = true, i18n, customPageOverl
199
210
  container,
200
211
  canvas: null,
201
212
  previewCanvas: null,
213
+ animationLayerHost: null,
202
214
  textLayer: null,
203
215
  annotationLayer: null,
204
216
  searchHighlightLayer: null,
@@ -374,6 +386,15 @@ export function createSpread(data, showAttribution = true, i18n, customPageOverl
374
386
  slotEl.canvas.style.top = formatCssSize(centerTop);
375
387
  slotEl.canvas.style.transform = effectiveRotation === 0 ? "none" : `rotate(${effectiveRotation}deg)`;
376
388
  }
389
+ // Keep the animation host aligned with the canvas it replaces
390
+ if (slotEl.animationLayerHost) {
391
+ slotEl.animationLayerHost.style.width = formatCssSize(slotEl.cssWidth);
392
+ slotEl.animationLayerHost.style.height = formatCssSize(slotEl.cssHeight);
393
+ slotEl.animationLayerHost.style.left = formatCssSize(centerLeft);
394
+ slotEl.animationLayerHost.style.top = formatCssSize(centerTop);
395
+ slotEl.animationLayerHost.style.transform =
396
+ effectiveRotation === 0 ? "none" : `rotate(${effectiveRotation}deg)`;
397
+ }
377
398
  // Update text layer to match canvas position/transform
378
399
  if (slotEl.textLayer) {
379
400
  slotEl.textLayer.style.width = formatCssSize(slotEl.cssWidth);
@@ -690,11 +711,31 @@ export function createSpread(data, showAttribution = true, i18n, customPageOverl
690
711
  }
691
712
  }
692
713
  }
714
+ /**
715
+ * Elements a slide build needs: the host its layers mount into and the
716
+ * plain canvas they stand in for. Null when the page is not in this spread.
717
+ */
718
+ function getAnimationTargets(pageNumber) {
719
+ for (const slotEl of slotElements) {
720
+ if (slotEl.pageNumber !== pageNumber)
721
+ continue;
722
+ if (!slotEl.animationLayerHost || !slotEl.canvas)
723
+ return null;
724
+ return {
725
+ host: slotEl.animationLayerHost,
726
+ canvas: slotEl.canvas,
727
+ cssWidth: slotEl.cssWidth,
728
+ cssHeight: slotEl.cssHeight,
729
+ };
730
+ }
731
+ return null;
732
+ }
693
733
  return {
694
734
  el,
695
735
  mount,
696
736
  destroy,
697
737
  render,
738
+ getAnimationTargets,
698
739
  updateLayout,
699
740
  updateAnnotations,
700
741
  updateTextLayer,