codexly-ui 0.13.5 → 0.13.6

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.
@@ -2788,6 +2788,15 @@ class ClxAnimateService {
2788
2788
  void element.offsetHeight;
2789
2789
  const animClass = `${PREFIX}${config.animation}`;
2790
2790
  const isInfinite = config.repeat === 'infinite';
2791
+ // A fillMode: 'forwards' animation (an exit fade/slide, e.g. clx-toast's playExitAnimation)
2792
+ // is almost always followed by the caller destroying the element on the same tick its promise
2793
+ // resolves — stripping animClass in _cleanup right then would drop animation-fill-mode's hold
2794
+ // on the last keyframe, snapping the element back to its static CSS state (opaque, in place)
2795
+ // for one paintable frame before removal, which read as a flash/"ghost" re-appearance. Classes
2796
+ // are only stripped for a non-forwards run; a forwards run keeps them and instead resets
2797
+ // them at the START of runAnimation's own reflow-forced restart path above, so a persisted
2798
+ // element that's re-animated later (e.g. clx-animate-directive on hover) still resets cleanly.
2799
+ const keepClassesOnEnd = config.fillMode === 'forwards';
2791
2800
  element.style.setProperty('--clx-anim-duration', `${config.duration}ms`);
2792
2801
  element.style.setProperty('--clx-anim-delay', `${config.delay}ms`);
2793
2802
  element.style.setProperty('--clx-anim-repeat', isInfinite ? 'infinite' : String(config.repeat ?? 1));
@@ -2809,7 +2818,12 @@ class ClxAnimateService {
2809
2818
  return new Promise(resolve => {
2810
2819
  const handleEnd = (ev) => {
2811
2820
  ev.stopPropagation();
2812
- this._cleanup(element, animClass);
2821
+ if (keepClassesOnEnd) {
2822
+ this._cleanups.delete(element);
2823
+ }
2824
+ else {
2825
+ this._cleanup(element, animClass);
2826
+ }
2813
2827
  this._runningCount.update(c => Math.max(0, c - 1));
2814
2828
  resolve();
2815
2829
  };