animot-presenter 0.6.7 → 0.6.9

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.
@@ -1699,7 +1699,9 @@
1699
1699
  if (currentSlideIndex < slides.length - 1) animateToSlide(currentSlideIndex + 1);
1700
1700
  else if (loop) {
1701
1701
  const loopMode = project?.settings?.loopMode ?? ((project as any)?.mode === 'flow' ? 'reset' : 'transition');
1702
- if (loopMode === 'transition') animateToSlide(0);
1702
+ // Single-slide decks can't transition to a different index
1703
+ // (animateToSlide early-returns), so reset to replay the entrance.
1704
+ if (loopMode === 'transition' && slides.length > 1) animateToSlide(0);
1703
1705
  else resetToFirstSlide();
1704
1706
  }
1705
1707
  else isAutoplay = false;
@@ -1713,7 +1715,9 @@
1713
1715
  animateToSlide(currentSlideIndex + 1);
1714
1716
  } else if (loop) {
1715
1717
  const loopMode = project?.settings?.loopMode ?? ((project as any)?.mode === 'flow' ? 'reset' : 'transition');
1716
- if (loopMode === 'transition') {
1718
+ // Single-slide decks can't transition to a different index
1719
+ // (animateToSlide early-returns), so reset to replay the entrance.
1720
+ if (loopMode === 'transition' && slides.length > 1) {
1717
1721
  animateToSlide(0);
1718
1722
  } else {
1719
1723
  resetToFirstSlide();
@@ -2187,7 +2191,7 @@
2187
2191
  {@const shapePmProg = crossMorphProg.get(elementId) ?? (animated.pathMorph?.current ?? 1)}
2188
2192
  {@const shapeKpmProg = kfPathProg.get(elementId) ?? (animated.pathMorph?.current ?? 1)}
2189
2193
  {@const shapeMorphProg = shapeKpm ? shapeKpmProg : shapePmProg}
2190
- {@const shapeMorphActive = shapeKpm ?? ((shapePm && shapePmProg > 0 && shapePmProg < 1) ? shapePm : restingKfMorph(element))}
2194
+ {@const shapeMorphActive = shapeKpm ?? ((shapePm && shapePmProg < 1) ? shapePm : restingKfMorph(element))}
2191
2195
  {#if shapeMorphActive}
2192
2196
  <svg class="animot-shape-element" width="100%" height="100%" viewBox={shapeMorphActive.viewBox ?? `0 0 ${Math.max(1, animated.width.current)} ${Math.max(1, animated.height.current)}`} preserveAspectRatio="none">
2193
2197
  {#if shapeMorphActive.parts && shapeMorphActive.parts.length > 1}
@@ -2229,7 +2233,7 @@
2229
2233
  {@const pmProg = crossMorphProg.get(elementId) ?? (animated.pathMorph?.current ?? 1)}
2230
2234
  {@const kpmProg = kfPathProg.get(elementId) ?? (animated.pathMorph?.current ?? 1)}
2231
2235
  {@const morphProg = kpm ? kpmProg : pmProg}
2232
- {@const svgMorph = kpm ?? ((pm && pmProg > 0 && pmProg < 1) ? pm : restingKfMorph(element))}
2236
+ {@const svgMorph = kpm ?? ((pm && pmProg < 1) ? pm : restingKfMorph(element))}
2233
2237
  {#if svgMorph}
2234
2238
  <svg class="animot-svg-element" width="100%" height="100%" viewBox={svgMorph.viewBox ?? morphViewBox(element, animated.width.current, animated.height.current)} preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
2235
2239
  {#each (svgMorph.parts ?? [{ interp: svgMorph.interp, fromColor: svgMorph.fromColor, toColor: svgMorph.toColor }]) as part}
@@ -2273,7 +2277,7 @@
2273
2277
  {@const pmProg = crossMorphProg.get(elementId) ?? (animated.pathMorph?.current ?? 1)}
2274
2278
  {@const kpmProg = kfPathProg.get(elementId) ?? (animated.pathMorph?.current ?? 1)}
2275
2279
  {@const morphProg = dkpm ? kpmProg : pmProg}
2276
- {@const drawMorph = dkpm ?? ((dpm && pmProg > 0 && pmProg < 1) ? dpm : restingKfMorph(element))}
2280
+ {@const drawMorph = dkpm ?? ((dpm && pmProg < 1) ? dpm : restingKfMorph(element))}
2277
2281
  {@const drawPath = drawElementToPath(drawEl)}
2278
2282
  {@const drawMode = drawEl.animation?.mode ?? 'none'}
2279
2283
  {@const drawReveal = !drawMorph && (drawMode === 'draw' || drawMode === 'undraw' || drawMode === 'draw-undraw')}