@deriv-web-design/ui 0.1.18 → 0.1.19
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/components.manifest.json +1 -1
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2568,7 +2568,7 @@ function DotLottieInView({
|
|
|
2568
2568
|
}, [rootMargin, threshold]);
|
|
2569
2569
|
useEffect6(() => {
|
|
2570
2570
|
if (mounted) return;
|
|
2571
|
-
if (!
|
|
2571
|
+
if (!inView) return;
|
|
2572
2572
|
if (typeof window === "undefined") return;
|
|
2573
2573
|
let cancelled = false;
|
|
2574
2574
|
const commit = () => {
|
|
@@ -2583,15 +2583,23 @@ function DotLottieInView({
|
|
|
2583
2583
|
}
|
|
2584
2584
|
if (timerId !== null) window.clearTimeout(timerId);
|
|
2585
2585
|
};
|
|
2586
|
-
}, [inView,
|
|
2586
|
+
}, [inView, mounted]);
|
|
2587
2587
|
useEffect6(() => {
|
|
2588
2588
|
if (!dotLottie) return;
|
|
2589
2589
|
if (!enabled || !inView) {
|
|
2590
2590
|
dotLottie.stop();
|
|
2591
2591
|
return;
|
|
2592
2592
|
}
|
|
2593
|
-
|
|
2594
|
-
|
|
2593
|
+
const start = () => {
|
|
2594
|
+
dotLottie.stop();
|
|
2595
|
+
dotLottie.play();
|
|
2596
|
+
};
|
|
2597
|
+
if (dotLottie.isLoaded) {
|
|
2598
|
+
start();
|
|
2599
|
+
return;
|
|
2600
|
+
}
|
|
2601
|
+
dotLottie.addEventListener("load", start);
|
|
2602
|
+
return () => dotLottie.removeEventListener("load", start);
|
|
2595
2603
|
}, [dotLottie, enabled, inView]);
|
|
2596
2604
|
return /* @__PURE__ */ jsx27(
|
|
2597
2605
|
"div",
|