animot-presenter 0.5.17 → 0.5.18

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/README.md CHANGED
@@ -358,9 +358,24 @@ export class DemoComponent implements AfterViewInit {
358
358
  | `keyboard` | `boolean` | `true` | Enable arrow key navigation |
359
359
  | `duration` | `number` | — | Override all transition durations (ms) |
360
360
  | `start-slide` | `number` | `0` | Initial slide index |
361
+ | `mute-narration` | `boolean` | `false` | Force-disable per-slide voice narration regardless of the project's `settings.narrationEnabled`. Use on previews / gallery cards where audio would be intrusive. |
361
362
 
362
363
  **Note:** `data` can only be set via JavaScript property, not as an HTML attribute.
363
364
 
365
+ ### Per-slide voice narration
366
+
367
+ Projects with `settings.narrationEnabled: true` and per-slide `narration` clips
368
+ play voice-over alongside slide changes. Narration is bound to the deck's play
369
+ state — pressing the play button starts narration, pause stops it. To disable
370
+ narration on a specific embed regardless of the project's setting, set
371
+ `mute-narration`.
372
+
373
+ Recommended pattern for share-link / hero usage with narration: omit `autoplay`
374
+ (the deck loads paused) so the viewer's first click on Play doubles as the
375
+ gesture browsers require to unlock audio. Embedded gallery / preview surfaces
376
+ where audio would be intrusive should pass `mute-narration` and keep
377
+ `autoplay`.
378
+
364
379
  ## Events
365
380
 
366
381
  | Event | Detail | Description |
@@ -585,10 +585,12 @@
585
585
  const targetSlide = slides[targetIndex];
586
586
  clearAllTypewriterAnimations();
587
587
  cancelMotionPathLoops();
588
- // Trigger per-slide narration only while the deck is actively
589
- // playing. Manual nav while paused stays silent — narration is
590
- // bound to the play button, not to every interaction.
591
- if (isAutoplay) playNarrationForSlide(targetIndex);
588
+ // Manual arrow nav and the autoplay timer are both forms of "user
589
+ // is moving forward in the deck"both should swap narration to
590
+ // the new slide. The pause button is what stops audio. Without
591
+ // this, clicking an arrow while paused would render the new slide
592
+ // silently, which feels broken.
593
+ playNarrationForSlide(targetIndex);
592
594
  const transition = targetSlide.transition;
593
595
  const duration = durationOverride ?? transition.duration;
594
596
  transitionDurationMs = duration;
@@ -12472,7 +12472,7 @@ function zB(t, e) {
12472
12472
  if (o($) || Q < 0 || Q >= o(Y).length || Q === o(v)) return;
12473
12473
  N($, !0), N(V, Q > o(v) ? "forward" : "backward", !0);
12474
12474
  const O = o(Y)[Q];
12475
- ft(), A(), o(x) && J(Q);
12475
+ ft(), A(), J(Q);
12476
12476
  const W = O.transition, L = e.duration ?? W.duration;
12477
12477
  if (N(ae, L, !0), W.type !== "none") {
12478
12478
  N(P, `transition-${W.type}-out`), await new Promise((Ye) => setTimeout(Ye, L * 0.4));