@moontra/moonui-pro 3.4.16 → 3.4.17

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/dist/index.mjs CHANGED
@@ -95545,6 +95545,7 @@ var NumberTickerInternal = ({
95545
95545
  const [isInViewport, setIsInViewport] = useState(false);
95546
95546
  const elementRef = useRef(null);
95547
95547
  const animationRef = useRef(null);
95548
+ const hasAnimatedRef = useRef(false);
95548
95549
  const getEasingFunction = (t2) => {
95549
95550
  switch (easing) {
95550
95551
  case "linear":
@@ -95582,7 +95583,7 @@ var NumberTickerInternal = ({
95582
95583
  return `${prefix}${formatted}${suffix}`;
95583
95584
  };
95584
95585
  const startAnimation = () => {
95585
- if (isAnimating || hasAnimated && !repeat)
95586
+ if (isAnimating || hasAnimatedRef.current && !repeat)
95586
95587
  return;
95587
95588
  setIsAnimating(true);
95588
95589
  const startTime = performance.now();
@@ -95600,6 +95601,7 @@ var NumberTickerInternal = ({
95600
95601
  } else {
95601
95602
  setIsAnimating(false);
95602
95603
  setHasAnimated(true);
95604
+ hasAnimatedRef.current = true;
95603
95605
  setCurrentValue(endVal);
95604
95606
  onComplete?.();
95605
95607
  }
@@ -95617,7 +95619,7 @@ var NumberTickerInternal = ({
95617
95619
  const observer = new IntersectionObserver(
95618
95620
  ([entry]) => {
95619
95621
  setIsInViewport(entry.isIntersecting);
95620
- if (entry.isIntersecting && (!hasAnimated || repeat)) {
95622
+ if (entry.isIntersecting && (!hasAnimatedRef.current || repeat)) {
95621
95623
  startAnimation();
95622
95624
  } else if (!entry.isIntersecting && isAnimating && animationRef.current) {
95623
95625
  cancelAnimationFrame(animationRef.current);
@@ -95633,12 +95635,12 @@ var NumberTickerInternal = ({
95633
95635
  cancelAnimationFrame(animationRef.current);
95634
95636
  }
95635
95637
  };
95636
- }, [useIntersectionObserver, threshold, value, repeat]);
95638
+ }, [useIntersectionObserver, threshold]);
95637
95639
  useEffect(() => {
95638
- if (!useIntersectionObserver && (repeat || !hasAnimated)) {
95640
+ if (!useIntersectionObserver && (repeat || !hasAnimatedRef.current)) {
95639
95641
  startAnimation();
95640
95642
  }
95641
- }, [value, repeat]);
95643
+ }, [value, repeat, useIntersectionObserver]);
95642
95644
  return /* @__PURE__ */ jsxs(
95643
95645
  "span",
95644
95646
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "3.4.16",
3
+ "version": "3.4.17",
4
4
  "description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",