jean-react-utils 0.2.1 → 0.2.3
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +51 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -13
package/dist/index.d.mts
CHANGED
|
@@ -236,7 +236,7 @@ interface SmoothScrollProviderProps {
|
|
|
236
236
|
}
|
|
237
237
|
declare function SmoothScrollProvider({ children }: SmoothScrollProviderProps): react_jsx_runtime.JSX.Element;
|
|
238
238
|
|
|
239
|
-
declare function ThemeToggle(): react_jsx_runtime.JSX.Element;
|
|
239
|
+
declare function ThemeToggle(): react_jsx_runtime.JSX.Element | null;
|
|
240
240
|
|
|
241
241
|
declare function ThemeProvider({ children, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
242
242
|
|
package/dist/index.d.ts
CHANGED
|
@@ -236,7 +236,7 @@ interface SmoothScrollProviderProps {
|
|
|
236
236
|
}
|
|
237
237
|
declare function SmoothScrollProvider({ children }: SmoothScrollProviderProps): react_jsx_runtime.JSX.Element;
|
|
238
238
|
|
|
239
|
-
declare function ThemeToggle(): react_jsx_runtime.JSX.Element;
|
|
239
|
+
declare function ThemeToggle(): react_jsx_runtime.JSX.Element | null;
|
|
240
240
|
|
|
241
241
|
declare function ThemeProvider({ children, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
242
242
|
|
package/dist/index.js
CHANGED
|
@@ -41,12 +41,12 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
41
41
|
return x2 === y3 && (0 !== x2 || 1 / x2 === 1 / y3) || x2 !== x2 && y3 !== y3;
|
|
42
42
|
}
|
|
43
43
|
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
44
|
-
var
|
|
45
|
-
var
|
|
44
|
+
var useState5 = React3.useState;
|
|
45
|
+
var useEffect3 = React3.useEffect;
|
|
46
46
|
var useLayoutEffect = React3.useLayoutEffect;
|
|
47
47
|
var useDebugValue2 = React3.useDebugValue;
|
|
48
48
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
49
|
-
var value = getSnapshot(), _useState =
|
|
49
|
+
var value = getSnapshot(), _useState = useState5({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
50
50
|
useLayoutEffect(
|
|
51
51
|
function() {
|
|
52
52
|
inst.value = value;
|
|
@@ -55,7 +55,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
55
55
|
},
|
|
56
56
|
[subscribe, value, getSnapshot]
|
|
57
57
|
);
|
|
58
|
-
|
|
58
|
+
useEffect3(
|
|
59
59
|
function() {
|
|
60
60
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
61
61
|
return subscribe(function() {
|
|
@@ -104,7 +104,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
104
104
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
105
105
|
), didWarnUncachedGetSnapshot = true);
|
|
106
106
|
}
|
|
107
|
-
cachedValue =
|
|
107
|
+
cachedValue = useState5({
|
|
108
108
|
inst: { value, getSnapshot }
|
|
109
109
|
});
|
|
110
110
|
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
@@ -116,7 +116,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
116
116
|
},
|
|
117
117
|
[subscribe, value, getSnapshot]
|
|
118
118
|
);
|
|
119
|
-
|
|
119
|
+
useEffect3(
|
|
120
120
|
function() {
|
|
121
121
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
122
122
|
return subscribe(function() {
|
|
@@ -142,7 +142,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
142
142
|
return getSnapshot();
|
|
143
143
|
}
|
|
144
144
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
145
|
-
var React3 = require("react"), objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
145
|
+
var React3 = require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState5 = React3.useState, useEffect3 = React3.useEffect, useLayoutEffect = React3.useLayoutEffect, useDebugValue2 = React3.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
146
146
|
exports2.useSyncExternalStore = void 0 !== React3.useSyncExternalStore ? React3.useSyncExternalStore : shim;
|
|
147
147
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
148
148
|
}();
|
|
@@ -173,7 +173,7 @@ var require_with_selector_production = __commonJS({
|
|
|
173
173
|
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
174
174
|
var useSyncExternalStore = shim.useSyncExternalStore;
|
|
175
175
|
var useRef = React3.useRef;
|
|
176
|
-
var
|
|
176
|
+
var useEffect3 = React3.useEffect;
|
|
177
177
|
var useMemo2 = React3.useMemo;
|
|
178
178
|
var useDebugValue2 = React3.useDebugValue;
|
|
179
179
|
exports2.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
@@ -217,7 +217,7 @@ var require_with_selector_production = __commonJS({
|
|
|
217
217
|
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
218
218
|
);
|
|
219
219
|
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
220
|
-
|
|
220
|
+
useEffect3(
|
|
221
221
|
function() {
|
|
222
222
|
inst.hasValue = true;
|
|
223
223
|
inst.value = value;
|
|
@@ -239,7 +239,7 @@ var require_with_selector_development = __commonJS({
|
|
|
239
239
|
return x2 === y3 && (0 !== x2 || 1 / x2 === 1 / y3) || x2 !== x2 && y3 !== y3;
|
|
240
240
|
}
|
|
241
241
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
242
|
-
var React3 = require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef = React3.useRef,
|
|
242
|
+
var React3 = require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef = React3.useRef, useEffect3 = React3.useEffect, useMemo2 = React3.useMemo, useDebugValue2 = React3.useDebugValue;
|
|
243
243
|
exports2.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
244
244
|
var instRef = useRef(null);
|
|
245
245
|
if (null === instRef.current) {
|
|
@@ -282,7 +282,7 @@ var require_with_selector_development = __commonJS({
|
|
|
282
282
|
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
283
283
|
);
|
|
284
284
|
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
285
|
-
|
|
285
|
+
useEffect3(
|
|
286
286
|
function() {
|
|
287
287
|
inst.hasValue = true;
|
|
288
288
|
inst.value = value;
|
|
@@ -2884,7 +2884,6 @@ var buttonVariants = cva(
|
|
|
2884
2884
|
);
|
|
2885
2885
|
var Button = React.forwardRef(
|
|
2886
2886
|
({ className, variant, size, ...props }, ref) => {
|
|
2887
|
-
console.log(">>>>> button props >>> ", props);
|
|
2888
2887
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2889
2888
|
"button",
|
|
2890
2889
|
{
|
|
@@ -2951,7 +2950,7 @@ function SubTitle({ children, title, className = "" }) {
|
|
|
2951
2950
|
}
|
|
2952
2951
|
|
|
2953
2952
|
// src/layout/Header/index.tsx
|
|
2954
|
-
var
|
|
2953
|
+
var import_react2 = require("react");
|
|
2955
2954
|
var import_link = __toESM(require("next/link"));
|
|
2956
2955
|
var import_framer_motion2 = require("framer-motion");
|
|
2957
2956
|
|
|
@@ -2971,6 +2970,9 @@ function BreadIcon({ isMenuOpen }) {
|
|
|
2971
2970
|
// src/layout/Header/index.tsx
|
|
2972
2971
|
var import_navigation = require("next/navigation");
|
|
2973
2972
|
|
|
2973
|
+
// src/theme/providers/theme-toggle.tsx
|
|
2974
|
+
var import_react = require("react");
|
|
2975
|
+
|
|
2974
2976
|
// ../node_modules/next-themes/dist/index.mjs
|
|
2975
2977
|
var t = __toESM(require("react"), 1);
|
|
2976
2978
|
var M = (e3, i2, s2, u2, m2, a3, l2, h) => {
|
|
@@ -3071,17 +3073,24 @@ var E = (e3) => (e3 || (e3 = window.matchMedia(I)), e3.matches ? "dark" : "light
|
|
|
3071
3073
|
var import_lucide_react = require("lucide-react");
|
|
3072
3074
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3073
3075
|
function ThemeToggle() {
|
|
3076
|
+
const [mounted, setMounted] = (0, import_react.useState)(false);
|
|
3074
3077
|
const { theme, setTheme } = z();
|
|
3078
|
+
(0, import_react.useEffect)(() => {
|
|
3079
|
+
setMounted(true);
|
|
3080
|
+
}, []);
|
|
3081
|
+
if (!mounted) {
|
|
3082
|
+
return null;
|
|
3083
|
+
}
|
|
3084
|
+
const isDark = theme === "dark";
|
|
3075
3085
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
3076
3086
|
Button,
|
|
3077
3087
|
{
|
|
3078
3088
|
variant: "borderNone",
|
|
3079
3089
|
size: "icon",
|
|
3080
|
-
onClick: () => setTheme(
|
|
3090
|
+
onClick: () => setTheme(isDark ? "light" : "dark"),
|
|
3081
3091
|
children: [
|
|
3082
3092
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Sun, { className: "h-5 w-5 rotate-0 scale-100 transition-all dark:rotate-90 dark:scale-0" }),
|
|
3083
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Moon, { className: "absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
|
|
3084
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Toggle theme" })
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Moon, { className: "absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
|
|
3085
3094
|
]
|
|
3086
3095
|
}
|
|
3087
3096
|
);
|
|
@@ -3103,7 +3112,7 @@ var Header = ({
|
|
|
3103
3112
|
enableAnimation = true,
|
|
3104
3113
|
theme = {}
|
|
3105
3114
|
}) => {
|
|
3106
|
-
const [isMenuOpen, setIsMenuOpen] = (0,
|
|
3115
|
+
const [isMenuOpen, setIsMenuOpen] = (0, import_react2.useState)(false);
|
|
3107
3116
|
const selectedKey = (0, import_navigation.usePathname)().split("/")[2] || "home";
|
|
3108
3117
|
const baseNavClassName = `fixed top-0 left-0 right-0 z-50 backdrop-blur-lg ${className}`;
|
|
3109
3118
|
const navVariants = {
|
|
@@ -3340,10 +3349,10 @@ function BasicLayout({ children }) {
|
|
|
3340
3349
|
}
|
|
3341
3350
|
|
|
3342
3351
|
// src/hooks/useForceRerender.ts
|
|
3343
|
-
var
|
|
3352
|
+
var import_react3 = require("react");
|
|
3344
3353
|
var useForceRerender = () => {
|
|
3345
|
-
const [key, setKey] = (0,
|
|
3346
|
-
const forceRerender = (0,
|
|
3354
|
+
const [key, setKey] = (0, import_react3.useState)(0);
|
|
3355
|
+
const forceRerender = (0, import_react3.useCallback)(() => {
|
|
3347
3356
|
setKey((prevKey) => prevKey + 1);
|
|
3348
3357
|
}, []);
|
|
3349
3358
|
return [key, forceRerender];
|
|
@@ -3351,7 +3360,7 @@ var useForceRerender = () => {
|
|
|
3351
3360
|
var useForceRerender_default = useForceRerender;
|
|
3352
3361
|
|
|
3353
3362
|
// ../node_modules/@studio-freight/hamo/dist/hamo.modern.mjs
|
|
3354
|
-
var
|
|
3363
|
+
var import_react4 = require("react");
|
|
3355
3364
|
|
|
3356
3365
|
// ../node_modules/@studio-freight/tempus/dist/tempus.modern.mjs
|
|
3357
3366
|
var a = "undefined" != typeof window && new class {
|
|
@@ -3438,7 +3447,7 @@ var createNanoEvents = () => ({
|
|
|
3438
3447
|
|
|
3439
3448
|
// ../node_modules/@studio-freight/hamo/dist/hamo.modern.mjs
|
|
3440
3449
|
function f(e3, n3 = 0) {
|
|
3441
|
-
(0,
|
|
3450
|
+
(0, import_react4.useEffect)(() => {
|
|
3442
3451
|
if (e3) return a.add(e3, n3), () => a.remove(e3);
|
|
3443
3452
|
}, [e3, n3]);
|
|
3444
3453
|
}
|
|
@@ -3476,11 +3485,11 @@ function E2(e3, t4 = 0) {
|
|
|
3476
3485
|
}
|
|
3477
3486
|
var L = createNanoEvents();
|
|
3478
3487
|
function k({ ignoreTransform: r3 = false, ignoreSticky: c2 = true, debounce: u2 = 500, lazy: s2 = false, callback: a3 } = {}) {
|
|
3479
|
-
const [d2, l2] = (0,
|
|
3488
|
+
const [d2, l2] = (0, import_react4.useState)(), f3 = (0, import_react4.useRef)({}), [h, m2] = (0, import_react4.useState)({}), v = (0, import_react4.useCallback)(({ top: e3, left: t4, width: n3, height: r4, element: o3 }) => {
|
|
3480
3489
|
var c3, i2, u3, d3, l3;
|
|
3481
3490
|
e3 = null != (c3 = e3) ? c3 : f3.current.top, t4 = null != (i2 = t4) ? i2 : f3.current.left, n3 = null != (u3 = n3) ? u3 : f3.current.width, r4 = null != (d3 = r4) ? d3 : f3.current.height, o3 = null != (l3 = o3) ? l3 : f3.current.element, e3 === f3.current.top && t4 === f3.current.left && n3 === f3.current.width && r4 === f3.current.height && o3 === f3.current.element || (f3.current.top = e3, f3.current.y = e3, f3.current.width = n3, f3.current.height = r4, f3.current.left = t4, f3.current.x = t4, f3.current.bottom = e3 + r4, f3.current.right = t4 + n3, f3.current.element = o3, null == a3 || a3(f3.current), s2 || m2(g({}, f3.current)));
|
|
3482
3491
|
}, [s2]);
|
|
3483
|
-
(0,
|
|
3492
|
+
(0, import_react4.useEffect)(() => {
|
|
3484
3493
|
if (!d2) return;
|
|
3485
3494
|
const e3 = d2.getBoundingClientRect();
|
|
3486
3495
|
v({ width: e3.width, height: e3.height });
|
|
@@ -3491,7 +3500,7 @@ function k({ ignoreTransform: r3 = false, ignoreSticky: c2 = true, debounce: u2
|
|
|
3491
3500
|
n3.disconnect(), t4.cancel();
|
|
3492
3501
|
};
|
|
3493
3502
|
}, [d2, u2, v]);
|
|
3494
|
-
const [w, k2] = (0,
|
|
3503
|
+
const [w, k2] = (0, import_react4.useState)(), x2 = (0, import_react4.useCallback)(() => {
|
|
3495
3504
|
if (!d2) return;
|
|
3496
3505
|
let e3, t4;
|
|
3497
3506
|
if (c2 && p(d2), r3) e3 = y(d2), t4 = z2(d2);
|
|
@@ -3501,18 +3510,18 @@ function k({ ignoreTransform: r3 = false, ignoreSticky: c2 = true, debounce: u2
|
|
|
3501
3510
|
}
|
|
3502
3511
|
c2 && b2(d2), v({ top: e3, left: t4, element: d2 });
|
|
3503
3512
|
}, [r3, c2, d2, v]);
|
|
3504
|
-
(0,
|
|
3513
|
+
(0, import_react4.useEffect)(() => {
|
|
3505
3514
|
x2();
|
|
3506
3515
|
const e3 = functionDebounce(x2, u2), t4 = new ResizeObserver(e3);
|
|
3507
3516
|
return t4.observe(null != w ? w : document.body), () => {
|
|
3508
3517
|
t4.disconnect(), e3.cancel();
|
|
3509
3518
|
};
|
|
3510
|
-
}, [w, u2, x2]), (0,
|
|
3519
|
+
}, [w, u2, x2]), (0, import_react4.useEffect)(() => L.on("resize", function() {
|
|
3511
3520
|
if (!d2) return;
|
|
3512
3521
|
const e3 = d2.getBoundingClientRect();
|
|
3513
3522
|
v({ width: e3.width, height: e3.height }), x2();
|
|
3514
3523
|
}), [d2, x2, v]);
|
|
3515
|
-
const O2 = (0,
|
|
3524
|
+
const O2 = (0, import_react4.useCallback)(() => f3.current, []);
|
|
3516
3525
|
return [l2, s2 ? O2 : h, k2];
|
|
3517
3526
|
}
|
|
3518
3527
|
k.resize = () => {
|
|
@@ -3767,7 +3776,7 @@ var Lenis = class {
|
|
|
3767
3776
|
};
|
|
3768
3777
|
|
|
3769
3778
|
// ../node_modules/@studio-freight/react-lenis/dist/react-lenis.mjs
|
|
3770
|
-
var
|
|
3779
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
3771
3780
|
|
|
3772
3781
|
// ../node_modules/zustand/esm/vanilla.mjs
|
|
3773
3782
|
var import_meta = {};
|
|
@@ -3803,10 +3812,10 @@ var createStoreImpl = (createState) => {
|
|
|
3803
3812
|
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
3804
3813
|
|
|
3805
3814
|
// ../node_modules/zustand/esm/index.mjs
|
|
3806
|
-
var
|
|
3815
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
3807
3816
|
var import_with_selector = __toESM(require_with_selector(), 1);
|
|
3808
3817
|
var import_meta2 = {};
|
|
3809
|
-
var { useDebugValue } =
|
|
3818
|
+
var { useDebugValue } = import_react5.default;
|
|
3810
3819
|
var { useSyncExternalStoreWithSelector } = import_with_selector.default;
|
|
3811
3820
|
var didWarnAboutEqualityFn = false;
|
|
3812
3821
|
var identity = (arg) => arg;
|
|
@@ -3842,9 +3851,9 @@ var create = (createState) => createState ? createImpl(createState) : createImpl
|
|
|
3842
3851
|
|
|
3843
3852
|
// ../node_modules/@studio-freight/react-lenis/dist/react-lenis.mjs
|
|
3844
3853
|
"undefined" != typeof window && (window.reactLenisVersion = "0.0.47");
|
|
3845
|
-
var d = (0,
|
|
3854
|
+
var d = (0, import_react6.createContext)(null);
|
|
3846
3855
|
var m = create(() => ({}));
|
|
3847
|
-
var y2 = (0,
|
|
3856
|
+
var y2 = (0, import_react6.forwardRef)((o3, a3) => {
|
|
3848
3857
|
var { children: f3, root: p2 = false, options: b3 = {}, autoRaf: y3 = true, rafPriority: v = 0, className: O2 } = o3, g2 = function(r3, e3) {
|
|
3849
3858
|
var t4 = {};
|
|
3850
3859
|
for (var n3 in r3) Object.prototype.hasOwnProperty.call(r3, n3) && e3.indexOf(n3) < 0 && (t4[n3] = r3[n3]);
|
|
@@ -3854,33 +3863,33 @@ var y2 = (0, import_react5.forwardRef)((o3, a3) => {
|
|
|
3854
3863
|
}
|
|
3855
3864
|
return t4;
|
|
3856
3865
|
}(o3, ["children", "root", "options", "autoRaf", "rafPriority", "className"]);
|
|
3857
|
-
const h = (0,
|
|
3866
|
+
const h = (0, import_react6.useRef)(null), w = (0, import_react6.useRef)(null), [k2, N2] = (0, import_react6.useState)(void 0), j = (0, import_react6.useRef)([]), C = (0, import_react6.useCallback)((r3, e3) => {
|
|
3858
3867
|
j.current.push({ callback: r3, priority: e3 }), j.current.sort((r4, e4) => r4.priority - e4.priority);
|
|
3859
|
-
}, []), E3 = (0,
|
|
3868
|
+
}, []), E3 = (0, import_react6.useCallback)((r3) => {
|
|
3860
3869
|
j.current = j.current.filter((e3) => e3.callback !== r3);
|
|
3861
3870
|
}, []);
|
|
3862
|
-
(0,
|
|
3871
|
+
(0, import_react6.useImperativeHandle)(a3, () => ({ wrapper: h.current, content: w.current, lenis: k2 }), [k2]), (0, import_react6.useEffect)(() => {
|
|
3863
3872
|
const r3 = new Lenis(Object.assign(Object.assign({}, b3), !p2 && { wrapper: h.current, content: w.current }));
|
|
3864
3873
|
return N2(r3), () => {
|
|
3865
3874
|
r3.destroy(), N2(void 0);
|
|
3866
3875
|
};
|
|
3867
3876
|
}, [p2, JSON.stringify(b3)]), f((r3) => {
|
|
3868
3877
|
y3 && (null == k2 || k2.raf(r3));
|
|
3869
|
-
}, v), (0,
|
|
3878
|
+
}, v), (0, import_react6.useEffect)(() => {
|
|
3870
3879
|
p2 && k2 && m.setState({ lenis: k2, addCallback: C, removeCallback: E3 });
|
|
3871
3880
|
}, [p2, k2, C, E3]);
|
|
3872
|
-
const P2 = (0,
|
|
3881
|
+
const P2 = (0, import_react6.useCallback)((r3) => {
|
|
3873
3882
|
for (let e3 = 0; e3 < j.current.length; e3++) j.current[e3].callback(r3);
|
|
3874
3883
|
}, []);
|
|
3875
|
-
(0,
|
|
3884
|
+
(0, import_react6.useEffect)(() => (null == k2 || k2.on("scroll", P2), () => {
|
|
3876
3885
|
null == k2 || k2.off("scroll", P2);
|
|
3877
3886
|
}), [k2, P2]);
|
|
3878
|
-
const S = (0,
|
|
3887
|
+
const S = (0, import_react6.useCallback)(() => {
|
|
3879
3888
|
h.current && (h.current.className = clsx_default(null == k2 ? void 0 : k2.className, O2));
|
|
3880
3889
|
}, [k2, O2]);
|
|
3881
|
-
return (0,
|
|
3890
|
+
return (0, import_react6.useEffect)(() => (S(), null == k2 || k2.on("className change", S), () => {
|
|
3882
3891
|
null == k2 || k2.off("className change", S);
|
|
3883
|
-
}), [k2, S]),
|
|
3892
|
+
}), [k2, S]), import_react6.default.createElement(d.Provider, { value: { lenis: k2, addCallback: C, removeCallback: E3 } }, p2 ? f3 : import_react6.default.createElement("div", Object.assign({ ref: h, className: clsx_default(null == k2 ? void 0 : k2.className, O2) }, g2), import_react6.default.createElement("div", { ref: w }, f3)));
|
|
3884
3893
|
});
|
|
3885
3894
|
|
|
3886
3895
|
// src/providers/smooth-scroll-provider.tsx
|