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

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,32 @@
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
+ return /* @__PURE__ */ jsx(Fragment, { children: children && // enforce passing the ref to Wrapper
27
+ //@ts-ignore
28
+ React.cloneElement(children, { ref }) });
29
+ }
30
+ export {
31
+ EnterAnimationClient as default
32
+ };
@@ -0,0 +1,30 @@
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
+ return /* @__PURE__ */ jsx(Fragment, { children: children && // enforce passing the ref to Wrapper
25
+ //@ts-ignore
26
+ React.cloneElement(children, { ref }) });
27
+ }
28
+ export {
29
+ EnterAnimationClient as default
30
+ };