@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260708102516 → 0.8.1-dev.20260709115728

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.
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ // src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
4
+ import React, { useEffect, useRef } from "react";
5
+ import { Fragment, jsx } from "react/jsx-runtime";
6
+ function EnterAnimationClient({ hasEnterAnimation, children }) {
7
+ const ref = useRef(null);
8
+ useEffect(() => {
9
+ if (!hasEnterAnimation || !ref.current) return;
10
+ const observer = new IntersectionObserver(
11
+ (entries) => {
12
+ entries.forEach((entry) => {
13
+ if (entry.isIntersecting) {
14
+ entry.target.classList.add("visible");
15
+ observer.unobserve(entry.target);
16
+ }
17
+ });
18
+ },
19
+ { threshold: 0.1 }
20
+ );
21
+ observer.observe(ref.current);
22
+ return () => observer.disconnect();
23
+ }, [hasEnterAnimation]);
24
+ if (!children) return null;
25
+ return /* @__PURE__ */ jsx(Fragment, { children: children && // enforce passing the ref to Wrapper
26
+ //@ts-ignore
27
+ React.cloneElement(children, { ref }) });
28
+ }
29
+ export {
30
+ EnterAnimationClient as default
31
+ };
@@ -0,0 +1,33 @@
1
+ "use client";
2
+
3
+ "use client";
4
+
5
+ // src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
6
+ import React, { useEffect, useRef } from "react";
7
+ import { Fragment, jsx } from "react/jsx-runtime";
8
+ function EnterAnimationClient({ hasEnterAnimation, children }) {
9
+ const ref = useRef(null);
10
+ useEffect(() => {
11
+ if (!hasEnterAnimation || !ref.current) return;
12
+ const observer = new IntersectionObserver(
13
+ (entries) => {
14
+ entries.forEach((entry) => {
15
+ if (entry.isIntersecting) {
16
+ entry.target.classList.add("visible");
17
+ observer.unobserve(entry.target);
18
+ }
19
+ });
20
+ },
21
+ { threshold: 0.1 }
22
+ );
23
+ observer.observe(ref.current);
24
+ return () => observer.disconnect();
25
+ }, [hasEnterAnimation]);
26
+ if (!children) return null;
27
+ return /* @__PURE__ */ jsx(Fragment, { children: children && // enforce passing the ref to Wrapper
28
+ //@ts-ignore
29
+ React.cloneElement(children, { ref }) });
30
+ }
31
+ export {
32
+ EnterAnimationClient as default
33
+ };