react-simplikit 0.0.50 → 0.0.52
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/components/ImpressionArea/ImpressionArea.cjs +57 -0
- package/{esm/components/ImpressionArea/index.d.ts → dist/components/ImpressionArea/ImpressionArea.d.cts} +9 -8
- package/dist/components/ImpressionArea/ImpressionArea.d.mts +48 -0
- package/dist/components/ImpressionArea/ImpressionArea.mjs +57 -0
- package/dist/components/ImpressionArea/index.d.cts +2 -46
- package/dist/components/ImpressionArea/index.d.mts +3 -0
- package/dist/components/Separated/Separated.cjs +38 -0
- package/{esm/components/Separated/index.d.ts → dist/components/Separated/Separated.d.cts} +7 -7
- package/dist/components/Separated/Separated.d.mts +38 -0
- package/dist/components/Separated/Separated.mjs +38 -0
- package/dist/components/Separated/index.d.cts +2 -37
- package/dist/components/Separated/index.d.mts +3 -0
- package/dist/components/SwitchCase/SwitchCase.cjs +40 -0
- package/{esm/components/SwitchCase/index.d.ts → dist/components/SwitchCase/SwitchCase.d.cts} +7 -8
- package/dist/components/SwitchCase/SwitchCase.d.mts +45 -0
- package/dist/components/SwitchCase/SwitchCase.mjs +40 -0
- package/dist/components/SwitchCase/index.d.cts +2 -45
- package/dist/components/SwitchCase/index.d.mts +3 -0
- package/dist/hooks/useAsyncEffect/index.d.cts +2 -24
- package/dist/hooks/useAsyncEffect/index.d.mts +3 -0
- package/dist/hooks/useAsyncEffect/useAsyncEffect.cjs +39 -0
- package/{esm/hooks/useAsyncEffect/index.d.ts → dist/hooks/useAsyncEffect/useAsyncEffect.d.cts} +4 -3
- package/dist/hooks/useAsyncEffect/useAsyncEffect.d.mts +26 -0
- package/dist/hooks/useAsyncEffect/useAsyncEffect.mjs +39 -0
- package/dist/hooks/useBooleanState/useBooleanState.cjs +36 -0
- package/dist/hooks/useBooleanState/{index.d.cts → useBooleanState.d.cts} +4 -2
- package/{esm/hooks/useBooleanState/index.d.ts → dist/hooks/useBooleanState/useBooleanState.d.mts} +4 -2
- package/dist/hooks/useBooleanState/useBooleanState.mjs +36 -0
- package/dist/hooks/useCallbackOncePerRender/index.d.cts +2 -39
- package/dist/hooks/useCallbackOncePerRender/index.d.mts +3 -0
- package/dist/hooks/useCallbackOncePerRender/useCallbackOncePerRender.cjs +52 -0
- package/{esm/hooks/useCallbackOncePerRender/index.d.ts → dist/hooks/useCallbackOncePerRender/useCallbackOncePerRender.d.cts} +4 -3
- package/dist/hooks/useCallbackOncePerRender/useCallbackOncePerRender.d.mts +41 -0
- package/dist/hooks/useCallbackOncePerRender/useCallbackOncePerRender.mjs +52 -0
- package/dist/hooks/useConditionalEffect/index.d.cts +2 -42
- package/dist/hooks/useConditionalEffect/index.d.mts +3 -0
- package/dist/hooks/useConditionalEffect/useConditionalEffect.cjs +57 -0
- package/{esm/hooks/useConditionalEffect/index.d.ts → dist/hooks/useConditionalEffect/useConditionalEffect.d.cts} +4 -3
- package/dist/hooks/useConditionalEffect/useConditionalEffect.d.mts +44 -0
- package/dist/hooks/useConditionalEffect/useConditionalEffect.mjs +57 -0
- package/dist/hooks/useControlledState/index.d.cts +2 -50
- package/dist/hooks/useControlledState/index.d.mts +3 -0
- package/dist/hooks/useControlledState/useControlledState.cjs +60 -0
- package/{esm/hooks/useControlledState/index.d.ts → dist/hooks/useControlledState/useControlledState.d.cts} +11 -10
- package/dist/hooks/useControlledState/useControlledState.d.mts +52 -0
- package/dist/hooks/useControlledState/useControlledState.mjs +60 -0
- package/dist/hooks/useCounter/useCounter.cjs +75 -0
- package/{esm/hooks/useCounter/index.d.ts → dist/hooks/useCounter/useCounter.d.cts} +12 -10
- package/dist/hooks/useCounter/{index.d.cts → useCounter.d.mts} +12 -10
- package/dist/hooks/useCounter/useCounter.mjs +75 -0
- package/dist/hooks/useDebounce/debounce.cjs +49 -0
- package/dist/hooks/useDebounce/debounce.d.cts +8 -0
- package/dist/hooks/useDebounce/debounce.d.mts +8 -0
- package/dist/hooks/useDebounce/debounce.mjs +49 -0
- package/dist/hooks/useDebounce/useDebounce.cjs +66 -0
- package/{esm/hooks/useDebounce/index.d.ts → dist/hooks/useDebounce/useDebounce.d.cts} +6 -8
- package/dist/hooks/useDebounce/{index.d.cts → useDebounce.d.mts} +6 -8
- package/dist/hooks/useDebounce/useDebounce.mjs +66 -0
- package/dist/hooks/useDebouncedCallback/useDebouncedCallback.cjs +62 -0
- package/{esm/hooks/useDebouncedCallback/index.d.ts → dist/hooks/useDebouncedCallback/useDebouncedCallback.d.cts} +9 -7
- package/dist/hooks/useDebouncedCallback/{index.d.cts → useDebouncedCallback.d.mts} +9 -7
- package/dist/hooks/useDebouncedCallback/useDebouncedCallback.mjs +62 -0
- package/dist/hooks/useDoubleClick/index.d.cts +2 -45
- package/dist/hooks/useDoubleClick/index.d.mts +3 -0
- package/dist/hooks/useDoubleClick/useDoubleClick.cjs +64 -0
- package/{esm/hooks/useDoubleClick/index.d.ts → dist/hooks/useDoubleClick/useDoubleClick.d.cts} +8 -7
- package/dist/hooks/useDoubleClick/useDoubleClick.d.mts +47 -0
- package/dist/hooks/useDoubleClick/useDoubleClick.mjs +64 -0
- package/dist/hooks/useGeolocation/useGeolocation.cjs +210 -0
- package/{esm/hooks/useGeolocation/index.d.ts → dist/hooks/useGeolocation/useGeolocation.d.cts} +26 -24
- package/dist/hooks/useGeolocation/{index.d.cts → useGeolocation.d.mts} +26 -24
- package/dist/hooks/useGeolocation/useGeolocation.mjs +209 -0
- package/dist/hooks/useImpressionRef/useImpressionRef.cjs +67 -0
- package/{esm/hooks/useImpressionRef/index.d.ts → dist/hooks/useImpressionRef/useImpressionRef.d.cts} +10 -8
- package/dist/hooks/useImpressionRef/{index.d.cts → useImpressionRef.d.mts} +10 -8
- package/dist/hooks/useImpressionRef/useImpressionRef.mjs +67 -0
- package/dist/hooks/useInputState/index.d.cts +2 -22
- package/dist/hooks/useInputState/index.d.mts +3 -0
- package/dist/hooks/useInputState/useInputState.cjs +32 -0
- package/{esm/hooks/useInputState/index.d.ts → dist/hooks/useInputState/useInputState.d.cts} +4 -3
- package/dist/hooks/useInputState/useInputState.d.mts +24 -0
- package/dist/hooks/useInputState/useInputState.mjs +32 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.cjs +58 -0
- package/dist/hooks/useIntersectionObserver/{index.d.cts → useIntersectionObserver.d.cts} +4 -2
- package/{esm/hooks/useIntersectionObserver/index.d.ts → dist/hooks/useIntersectionObserver/useIntersectionObserver.d.mts} +4 -2
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.mjs +58 -0
- package/dist/hooks/useInterval/useInterval.cjs +65 -0
- package/dist/hooks/useInterval/{index.d.cts → useInterval.d.cts} +7 -5
- package/{esm/hooks/useInterval/index.d.ts → dist/hooks/useInterval/useInterval.d.mts} +7 -5
- package/dist/hooks/useInterval/useInterval.mjs +65 -0
- package/dist/hooks/useIsClient/useIsClient.cjs +49 -0
- package/dist/hooks/useIsClient/{index.d.cts → useIsClient.d.cts} +4 -2
- package/{esm/hooks/useIsClient/index.d.ts → dist/hooks/useIsClient/useIsClient.d.mts} +4 -2
- package/dist/hooks/useIsClient/useIsClient.mjs +49 -0
- package/dist/hooks/useIsomorphicLayoutEffect/index.d.cts +2 -24
- package/dist/hooks/useIsomorphicLayoutEffect/index.d.mts +3 -0
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +25 -0
- package/{esm/hooks/useIsomorphicLayoutEffect/index.d.ts → dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.cts} +4 -3
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.mts +26 -0
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs +25 -0
- package/dist/hooks/useList/useList.cjs +94 -0
- package/{esm/hooks/useList/index.d.ts → dist/hooks/useList/useList.d.cts} +10 -8
- package/dist/hooks/useList/{index.d.cts → useList.d.mts} +10 -8
- package/dist/hooks/useList/useList.mjs +94 -0
- package/dist/hooks/useLoading/useLoading.cjs +61 -0
- package/dist/hooks/useLoading/{index.d.cts → useLoading.d.cts} +4 -2
- package/{esm/hooks/useLoading/index.d.ts → dist/hooks/useLoading/useLoading.d.mts} +4 -2
- package/dist/hooks/useLoading/useLoading.mjs +61 -0
- package/dist/hooks/useLongPress/index.d.cts +2 -73
- package/dist/hooks/useLongPress/index.d.mts +3 -0
- package/dist/hooks/useLongPress/useLongPress.cjs +133 -0
- package/{esm/hooks/useLongPress/index.d.ts → dist/hooks/useLongPress/useLongPress.d.cts} +18 -17
- package/dist/hooks/useLongPress/useLongPress.d.mts +75 -0
- package/dist/hooks/useLongPress/useLongPress.mjs +133 -0
- package/dist/hooks/useMap/useMap.cjs +64 -0
- package/dist/hooks/useMap/{index.d.cts → useMap.d.cts} +12 -10
- package/{esm/hooks/useMap/index.d.ts → dist/hooks/useMap/useMap.d.mts} +12 -10
- package/dist/hooks/useMap/useMap.mjs +64 -0
- package/dist/hooks/useOutsideClickEffect/useOutsideClickEffect.cjs +51 -0
- package/{esm/hooks/useOutsideClickEffect/index.d.ts → dist/hooks/useOutsideClickEffect/useOutsideClickEffect.d.cts} +4 -2
- package/dist/hooks/useOutsideClickEffect/{index.d.cts → useOutsideClickEffect.d.mts} +4 -2
- package/dist/hooks/useOutsideClickEffect/useOutsideClickEffect.mjs +51 -0
- package/dist/hooks/usePreservedCallback/usePreservedCallback.cjs +41 -0
- package/dist/hooks/usePreservedCallback/{index.d.cts → usePreservedCallback.d.cts} +4 -2
- package/{esm/hooks/usePreservedCallback/index.d.ts → dist/hooks/usePreservedCallback/usePreservedCallback.d.mts} +4 -2
- package/dist/hooks/usePreservedCallback/usePreservedCallback.mjs +41 -0
- package/dist/hooks/usePreservedReference/usePreservedReference.cjs +55 -0
- package/dist/hooks/usePreservedReference/{index.d.cts → usePreservedReference.d.cts} +4 -2
- package/{esm/hooks/usePreservedReference/index.d.ts → dist/hooks/usePreservedReference/usePreservedReference.d.mts} +4 -2
- package/dist/hooks/usePreservedReference/usePreservedReference.mjs +55 -0
- package/dist/hooks/usePrevious/usePrevious.cjs +38 -0
- package/{esm/hooks/usePrevious/index.d.ts → dist/hooks/usePrevious/usePrevious.d.cts} +4 -2
- package/dist/hooks/usePrevious/{index.d.cts → usePrevious.d.mts} +4 -2
- package/dist/hooks/usePrevious/usePrevious.mjs +38 -0
- package/dist/hooks/useRefEffect/index.d.cts +2 -30
- package/dist/hooks/useRefEffect/index.d.mts +3 -0
- package/dist/hooks/useRefEffect/useRefEffect.cjs +42 -0
- package/{esm/hooks/useRefEffect/index.d.ts → dist/hooks/useRefEffect/useRefEffect.d.cts} +4 -3
- package/dist/hooks/useRefEffect/useRefEffect.d.mts +32 -0
- package/dist/hooks/useRefEffect/useRefEffect.mjs +42 -0
- package/dist/hooks/useSet/useSet.cjs +79 -0
- package/dist/hooks/useSet/{index.d.cts → useSet.d.cts} +9 -7
- package/{esm/hooks/useSet/index.d.ts → dist/hooks/useSet/useSet.d.mts} +9 -7
- package/dist/hooks/useSet/useSet.mjs +79 -0
- package/dist/hooks/useStorageState/index.d.cts +2 -60
- package/dist/hooks/useStorageState/index.d.mts +3 -0
- package/dist/hooks/useStorageState/storage.cjs +85 -0
- package/dist/hooks/useStorageState/storage.d.cts +10 -0
- package/dist/hooks/useStorageState/storage.d.mts +10 -0
- package/dist/hooks/useStorageState/storage.mjs +80 -0
- package/dist/hooks/useStorageState/useStorageState.cjs +81 -0
- package/{esm/hooks/useStorageState/index.d.ts → dist/hooks/useStorageState/useStorageState.d.cts} +10 -15
- package/dist/hooks/useStorageState/useStorageState.d.mts +56 -0
- package/dist/hooks/useStorageState/useStorageState.mjs +81 -0
- package/dist/hooks/useThrottle/throttle.cjs +19 -0
- package/dist/hooks/useThrottle/throttle.d.cts +19 -0
- package/dist/hooks/useThrottle/throttle.d.mts +19 -0
- package/dist/hooks/useThrottle/throttle.mjs +19 -0
- package/dist/hooks/useThrottle/useThrottle.cjs +49 -0
- package/dist/hooks/useThrottle/{index.d.cts → useThrottle.d.cts} +6 -19
- package/{esm/hooks/useThrottle/index.d.ts → dist/hooks/useThrottle/useThrottle.d.mts} +6 -19
- package/dist/hooks/useThrottle/useThrottle.mjs +49 -0
- package/dist/hooks/useThrottledCallback/useThrottledCallback.cjs +57 -0
- package/{esm/hooks/useThrottledCallback/index.d.ts → dist/hooks/useThrottledCallback/useThrottledCallback.d.cts} +8 -6
- package/dist/hooks/useThrottledCallback/{index.d.cts → useThrottledCallback.d.mts} +8 -6
- package/dist/hooks/useThrottledCallback/useThrottledCallback.mjs +57 -0
- package/dist/hooks/useTimeout/useTimeout.cjs +40 -0
- package/dist/hooks/useTimeout/{index.d.cts → useTimeout.d.cts} +4 -2
- package/{esm/hooks/useTimeout/index.d.ts → dist/hooks/useTimeout/useTimeout.d.mts} +4 -2
- package/dist/hooks/useTimeout/useTimeout.mjs +40 -0
- package/dist/hooks/useToggle/useToggle.cjs +34 -0
- package/dist/hooks/useToggle/{index.d.cts → useToggle.d.cts} +4 -4
- package/{esm/hooks/useToggle/index.d.ts → dist/hooks/useToggle/useToggle.d.mts} +4 -4
- package/dist/hooks/useToggle/useToggle.mjs +34 -0
- package/dist/hooks/useVisibilityEvent/useVisibilityEvent.cjs +42 -0
- package/{esm/hooks/useVisibilityEvent/index.d.ts → dist/hooks/useVisibilityEvent/useVisibilityEvent.d.cts} +5 -3
- package/dist/hooks/useVisibilityEvent/{index.d.cts → useVisibilityEvent.d.mts} +5 -3
- package/dist/hooks/useVisibilityEvent/useVisibilityEvent.mjs +42 -0
- package/dist/index.cjs +77 -1382
- package/dist/index.d.cts +56 -40
- package/dist/index.d.mts +56 -0
- package/dist/index.mjs +40 -0
- package/dist/utils/buildContext/buildContext.cjs +50 -0
- package/{esm/utils/buildContext/index.d.ts → dist/utils/buildContext/buildContext.d.cts} +7 -7
- package/dist/utils/buildContext/buildContext.d.mts +38 -0
- package/dist/utils/buildContext/buildContext.mjs +50 -0
- package/dist/utils/buildContext/index.d.cts +2 -37
- package/dist/utils/buildContext/index.d.mts +3 -0
- package/dist/utils/mergeProps/index.d.cts +2 -25
- package/dist/utils/mergeProps/index.d.mts +3 -0
- package/dist/utils/mergeProps/mergeProps.cjs +53 -0
- package/{esm/utils/mergeProps/index.d.ts → dist/utils/mergeProps/mergeProps.d.cts} +7 -8
- package/dist/utils/mergeProps/mergeProps.d.mts +25 -0
- package/dist/utils/mergeProps/mergeProps.mjs +53 -0
- package/dist/utils/mergeRefs/index.d.cts +2 -38
- package/dist/utils/mergeRefs/index.d.mts +3 -0
- package/dist/utils/mergeRefs/mergeRefs.cjs +50 -0
- package/{esm/utils/mergeRefs/index.d.ts → dist/utils/mergeRefs/mergeRefs.d.cts} +4 -3
- package/dist/utils/mergeRefs/mergeRefs.d.mts +40 -0
- package/dist/utils/mergeRefs/mergeRefs.mjs +50 -0
- package/package.json +9 -11
- package/dist/components/ImpressionArea/index.cjs +0 -295
- package/dist/components/Separated/index.cjs +0 -41
- package/dist/components/SwitchCase/index.cjs +0 -36
- package/dist/hooks/useAsyncEffect/index.cjs +0 -44
- package/dist/hooks/useBooleanState/index.cjs +0 -46
- package/dist/hooks/useCallbackOncePerRender/index.cjs +0 -63
- package/dist/hooks/useConditionalEffect/index.cjs +0 -51
- package/dist/hooks/useControlledState/index.cjs +0 -57
- package/dist/hooks/useCounter/index.cjs +0 -70
- package/dist/hooks/useDebounce/index.cjs +0 -130
- package/dist/hooks/useDebouncedCallback/index.cjs +0 -148
- package/dist/hooks/useDoubleClick/index.cjs +0 -79
- package/dist/hooks/useGeolocation/index.cjs +0 -154
- package/dist/hooks/useImpressionRef/index.cjs +0 -258
- package/dist/hooks/useInputState/index.cjs +0 -46
- package/dist/hooks/useIntersectionObserver/index.cjs +0 -95
- package/dist/hooks/useInterval/index.cjs +0 -74
- package/dist/hooks/useIsClient/index.cjs +0 -40
- package/dist/hooks/useIsomorphicLayoutEffect/index.cjs +0 -35
- package/dist/hooks/useList/index.cjs +0 -104
- package/dist/hooks/useLoading/index.cjs +0 -65
- package/dist/hooks/useLongPress/index.cjs +0 -127
- package/dist/hooks/useMap/index.cjs +0 -78
- package/dist/hooks/useOutsideClickEffect/index.cjs +0 -74
- package/dist/hooks/usePreservedCallback/index.cjs +0 -45
- package/dist/hooks/usePreservedReference/index.cjs +0 -45
- package/dist/hooks/usePrevious/index.cjs +0 -48
- package/dist/hooks/useRefEffect/index.cjs +0 -72
- package/dist/hooks/useSet/index.cjs +0 -105
- package/dist/hooks/useStorageState/index.cjs +0 -196
- package/dist/hooks/useThrottle/index.cjs +0 -151
- package/dist/hooks/useThrottledCallback/index.cjs +0 -172
- package/dist/hooks/useTimeout/index.cjs +0 -57
- package/dist/hooks/useToggle/index.cjs +0 -37
- package/dist/hooks/useVisibilityEvent/index.cjs +0 -47
- package/dist/utils/buildContext/index.cjs +0 -56
- package/dist/utils/mergeProps/index.cjs +0 -71
- package/dist/utils/mergeRefs/index.cjs +0 -46
- package/esm/components/ImpressionArea/index.js +0 -269
- package/esm/components/Separated/index.js +0 -15
- package/esm/components/SwitchCase/index.js +0 -10
- package/esm/hooks/useAsyncEffect/index.js +0 -18
- package/esm/hooks/useBooleanState/index.js +0 -20
- package/esm/hooks/useCallbackOncePerRender/index.js +0 -37
- package/esm/hooks/useConditionalEffect/index.js +0 -25
- package/esm/hooks/useControlledState/index.js +0 -31
- package/esm/hooks/useCounter/index.js +0 -44
- package/esm/hooks/useDebounce/index.js +0 -104
- package/esm/hooks/useDebouncedCallback/index.js +0 -122
- package/esm/hooks/useDoubleClick/index.js +0 -53
- package/esm/hooks/useGeolocation/index.js +0 -128
- package/esm/hooks/useImpressionRef/index.js +0 -232
- package/esm/hooks/useInputState/index.js +0 -20
- package/esm/hooks/useIntersectionObserver/index.js +0 -69
- package/esm/hooks/useInterval/index.js +0 -48
- package/esm/hooks/useIsClient/index.js +0 -14
- package/esm/hooks/useIsomorphicLayoutEffect/index.js +0 -9
- package/esm/hooks/useList/index.js +0 -78
- package/esm/hooks/useLoading/index.js +0 -39
- package/esm/hooks/useLongPress/index.js +0 -101
- package/esm/hooks/useMap/index.js +0 -52
- package/esm/hooks/useOutsideClickEffect/index.js +0 -48
- package/esm/hooks/usePreservedCallback/index.js +0 -19
- package/esm/hooks/usePreservedReference/index.js +0 -19
- package/esm/hooks/usePrevious/index.js +0 -22
- package/esm/hooks/useRefEffect/index.js +0 -46
- package/esm/hooks/useSet/index.js +0 -79
- package/esm/hooks/useStorageState/index.js +0 -170
- package/esm/hooks/useThrottle/index.js +0 -125
- package/esm/hooks/useThrottledCallback/index.js +0 -146
- package/esm/hooks/useTimeout/index.js +0 -31
- package/esm/hooks/useToggle/index.js +0 -11
- package/esm/hooks/useVisibilityEvent/index.js +0 -21
- package/esm/index.d.ts +0 -40
- package/esm/index.js +0 -1320
- package/esm/utils/buildContext/index.js +0 -30
- package/esm/utils/mergeProps/index.js +0 -45
- package/esm/utils/mergeRefs/index.js +0 -20
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/useList/index.ts
|
|
22
|
-
var useList_exports = {};
|
|
23
|
-
__export(useList_exports, {
|
|
24
|
-
useList: () => useList
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(useList_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/useList/useList.ts
|
|
29
|
-
var import_react3 = require("react");
|
|
30
|
-
|
|
31
|
-
// src/hooks/usePreservedCallback/usePreservedCallback.ts
|
|
32
|
-
var import_react = require("react");
|
|
33
|
-
function usePreservedCallback(callback) {
|
|
34
|
-
const callbackRef = (0, import_react.useRef)(callback);
|
|
35
|
-
(0, import_react.useEffect)(
|
|
36
|
-
function syncCallbackRef() {
|
|
37
|
-
callbackRef.current = callback;
|
|
38
|
-
},
|
|
39
|
-
[callback]
|
|
40
|
-
);
|
|
41
|
-
return (0, import_react.useCallback)((...args) => {
|
|
42
|
-
return callbackRef.current(...args);
|
|
43
|
-
}, []);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/hooks/usePreservedReference/usePreservedReference.ts
|
|
47
|
-
var import_react2 = require("react");
|
|
48
|
-
function usePreservedReference(value, areValuesEqual = areDeeplyEqual) {
|
|
49
|
-
const ref = (0, import_react2.useRef)(value);
|
|
50
|
-
return (0, import_react2.useMemo)(() => {
|
|
51
|
-
if (!areValuesEqual(ref.current, value)) {
|
|
52
|
-
ref.current = value;
|
|
53
|
-
}
|
|
54
|
-
return ref.current;
|
|
55
|
-
}, [areValuesEqual, value]);
|
|
56
|
-
}
|
|
57
|
-
function areDeeplyEqual(x, y) {
|
|
58
|
-
return JSON.stringify(x) === JSON.stringify(y);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// src/hooks/useList/useList.ts
|
|
62
|
-
function useList(initialState = []) {
|
|
63
|
-
const [list, setList] = (0, import_react3.useState)(initialState);
|
|
64
|
-
const preservedInitialState = usePreservedReference(initialState);
|
|
65
|
-
const push = usePreservedCallback((value) => {
|
|
66
|
-
setList((prev) => [...prev, value]);
|
|
67
|
-
});
|
|
68
|
-
const insertAt = usePreservedCallback((index, value) => {
|
|
69
|
-
setList((prev) => {
|
|
70
|
-
const next = [...prev];
|
|
71
|
-
next.splice(index, 0, value);
|
|
72
|
-
return next;
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
const updateAt = usePreservedCallback((index, value) => {
|
|
76
|
-
setList((prev) => {
|
|
77
|
-
const next = [...prev];
|
|
78
|
-
next[index] = value;
|
|
79
|
-
return next;
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
const removeAt = usePreservedCallback((index) => {
|
|
83
|
-
setList((prev) => {
|
|
84
|
-
const next = [...prev];
|
|
85
|
-
next.splice(index, 1);
|
|
86
|
-
return next;
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
const setAll = usePreservedCallback((values) => {
|
|
90
|
-
setList(values);
|
|
91
|
-
});
|
|
92
|
-
const reset = usePreservedCallback(() => {
|
|
93
|
-
setList(preservedInitialState);
|
|
94
|
-
});
|
|
95
|
-
const actions = (0, import_react3.useMemo)(
|
|
96
|
-
() => ({ push, insertAt, updateAt, removeAt, setAll, reset }),
|
|
97
|
-
[push, insertAt, updateAt, removeAt, setAll, reset]
|
|
98
|
-
);
|
|
99
|
-
return [list, actions];
|
|
100
|
-
}
|
|
101
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
-
0 && (module.exports = {
|
|
103
|
-
useList
|
|
104
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/useLoading/index.ts
|
|
22
|
-
var useLoading_exports = {};
|
|
23
|
-
__export(useLoading_exports, {
|
|
24
|
-
useLoading: () => useLoading
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(useLoading_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/useLoading/useLoading.ts
|
|
29
|
-
var import_react = require("react");
|
|
30
|
-
function useLoading() {
|
|
31
|
-
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
32
|
-
const ref = useIsMountedRef();
|
|
33
|
-
const startTransition = (0, import_react.useCallback)(
|
|
34
|
-
async (promise) => {
|
|
35
|
-
try {
|
|
36
|
-
setLoading(true);
|
|
37
|
-
const data = await promise;
|
|
38
|
-
return data;
|
|
39
|
-
} finally {
|
|
40
|
-
if (ref.isMounted) {
|
|
41
|
-
setLoading(false);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
[ref.isMounted]
|
|
46
|
-
);
|
|
47
|
-
return (0, import_react.useMemo)(() => [loading, startTransition], [loading, startTransition]);
|
|
48
|
-
}
|
|
49
|
-
function useIsMountedRef() {
|
|
50
|
-
const ref = (0, import_react.useRef)({ isMounted: true }).current;
|
|
51
|
-
(0, import_react.useEffect)(
|
|
52
|
-
function trackMountedState() {
|
|
53
|
-
ref.isMounted = true;
|
|
54
|
-
return () => {
|
|
55
|
-
ref.isMounted = false;
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
[ref]
|
|
59
|
-
);
|
|
60
|
-
return ref;
|
|
61
|
-
}
|
|
62
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
-
0 && (module.exports = {
|
|
64
|
-
useLoading
|
|
65
|
-
});
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/useLongPress/index.ts
|
|
22
|
-
var useLongPress_exports = {};
|
|
23
|
-
__export(useLongPress_exports, {
|
|
24
|
-
useLongPress: () => useLongPress
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(useLongPress_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/useLongPress/useLongPress.ts
|
|
29
|
-
var import_react2 = require("react");
|
|
30
|
-
|
|
31
|
-
// src/hooks/usePreservedCallback/usePreservedCallback.ts
|
|
32
|
-
var import_react = require("react");
|
|
33
|
-
function usePreservedCallback(callback) {
|
|
34
|
-
const callbackRef = (0, import_react.useRef)(callback);
|
|
35
|
-
(0, import_react.useEffect)(
|
|
36
|
-
function syncCallbackRef() {
|
|
37
|
-
callbackRef.current = callback;
|
|
38
|
-
},
|
|
39
|
-
[callback]
|
|
40
|
-
);
|
|
41
|
-
return (0, import_react.useCallback)((...args) => {
|
|
42
|
-
return callbackRef.current(...args);
|
|
43
|
-
}, []);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/hooks/useLongPress/useLongPress.ts
|
|
47
|
-
function useLongPress(onLongPress, { delay = 500, moveThreshold, onClick, onLongPressEnd } = {}) {
|
|
48
|
-
const timeoutRef = (0, import_react2.useRef)(null);
|
|
49
|
-
const isLongPressActiveRef = (0, import_react2.useRef)(false);
|
|
50
|
-
const initialPositionRef = (0, import_react2.useRef)({ x: 0, y: 0 });
|
|
51
|
-
const preservedOnLongPress = usePreservedCallback(onLongPress);
|
|
52
|
-
const preservedOnClick = usePreservedCallback(onClick || (() => {
|
|
53
|
-
}));
|
|
54
|
-
const preservedOnLongPressEnd = usePreservedCallback(onLongPressEnd || (() => {
|
|
55
|
-
}));
|
|
56
|
-
const hasThreshold = moveThreshold?.x !== void 0 || moveThreshold?.y !== void 0;
|
|
57
|
-
const getClientPosition = (0, import_react2.useCallback)((event) => {
|
|
58
|
-
if ("touches" in event.nativeEvent) {
|
|
59
|
-
const touch = event.nativeEvent.touches[0];
|
|
60
|
-
return { x: touch.clientX, y: touch.clientY };
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
x: event.nativeEvent.clientX,
|
|
64
|
-
y: event.nativeEvent.clientY
|
|
65
|
-
};
|
|
66
|
-
}, []);
|
|
67
|
-
const isMovedBeyondThreshold = (0, import_react2.useCallback)(
|
|
68
|
-
(event) => {
|
|
69
|
-
const { x, y } = getClientPosition(event);
|
|
70
|
-
const deltaX = Math.abs(x - initialPositionRef.current.x);
|
|
71
|
-
const deltaY = Math.abs(y - initialPositionRef.current.y);
|
|
72
|
-
return moveThreshold?.x !== void 0 && deltaX > moveThreshold.x || moveThreshold?.y !== void 0 && deltaY > moveThreshold.y;
|
|
73
|
-
},
|
|
74
|
-
[getClientPosition, moveThreshold]
|
|
75
|
-
);
|
|
76
|
-
const cancelLongPress = (0, import_react2.useCallback)(() => {
|
|
77
|
-
if (timeoutRef.current !== null) {
|
|
78
|
-
window.clearTimeout(timeoutRef.current);
|
|
79
|
-
timeoutRef.current = null;
|
|
80
|
-
}
|
|
81
|
-
}, []);
|
|
82
|
-
const handlePressStart = (0, import_react2.useCallback)(
|
|
83
|
-
(event) => {
|
|
84
|
-
cancelLongPress();
|
|
85
|
-
const position = getClientPosition(event);
|
|
86
|
-
initialPositionRef.current = position;
|
|
87
|
-
isLongPressActiveRef.current = false;
|
|
88
|
-
timeoutRef.current = window.setTimeout(() => {
|
|
89
|
-
isLongPressActiveRef.current = true;
|
|
90
|
-
preservedOnLongPress(event);
|
|
91
|
-
}, delay);
|
|
92
|
-
},
|
|
93
|
-
[cancelLongPress, delay, getClientPosition, preservedOnLongPress]
|
|
94
|
-
);
|
|
95
|
-
const handlePressEnd = (0, import_react2.useCallback)(
|
|
96
|
-
(event) => {
|
|
97
|
-
if (isLongPressActiveRef.current) {
|
|
98
|
-
preservedOnLongPressEnd(event);
|
|
99
|
-
} else if (timeoutRef.current !== null) {
|
|
100
|
-
preservedOnClick(event);
|
|
101
|
-
}
|
|
102
|
-
cancelLongPress();
|
|
103
|
-
isLongPressActiveRef.current = false;
|
|
104
|
-
},
|
|
105
|
-
[cancelLongPress, preservedOnClick, preservedOnLongPressEnd]
|
|
106
|
-
);
|
|
107
|
-
const handlePressMove = (0, import_react2.useCallback)(
|
|
108
|
-
(event) => {
|
|
109
|
-
if (timeoutRef.current !== null && isMovedBeyondThreshold(event)) {
|
|
110
|
-
cancelLongPress();
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
[cancelLongPress, isMovedBeyondThreshold]
|
|
114
|
-
);
|
|
115
|
-
return {
|
|
116
|
-
onMouseDown: handlePressStart,
|
|
117
|
-
onMouseUp: handlePressEnd,
|
|
118
|
-
onMouseLeave: cancelLongPress,
|
|
119
|
-
onTouchStart: handlePressStart,
|
|
120
|
-
onTouchEnd: handlePressEnd,
|
|
121
|
-
...hasThreshold ? { onTouchMove: handlePressMove, onMouseMove: handlePressMove } : {}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
125
|
-
0 && (module.exports = {
|
|
126
|
-
useLongPress
|
|
127
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/useMap/index.ts
|
|
22
|
-
var useMap_exports = {};
|
|
23
|
-
__export(useMap_exports, {
|
|
24
|
-
useMap: () => useMap
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(useMap_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/useMap/useMap.ts
|
|
29
|
-
var import_react2 = require("react");
|
|
30
|
-
|
|
31
|
-
// src/hooks/usePreservedReference/usePreservedReference.ts
|
|
32
|
-
var import_react = require("react");
|
|
33
|
-
function usePreservedReference(value, areValuesEqual = areDeeplyEqual) {
|
|
34
|
-
const ref = (0, import_react.useRef)(value);
|
|
35
|
-
return (0, import_react.useMemo)(() => {
|
|
36
|
-
if (!areValuesEqual(ref.current, value)) {
|
|
37
|
-
ref.current = value;
|
|
38
|
-
}
|
|
39
|
-
return ref.current;
|
|
40
|
-
}, [areValuesEqual, value]);
|
|
41
|
-
}
|
|
42
|
-
function areDeeplyEqual(x, y) {
|
|
43
|
-
return JSON.stringify(x) === JSON.stringify(y);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/hooks/useMap/useMap.ts
|
|
47
|
-
function useMap(initialState = /* @__PURE__ */ new Map()) {
|
|
48
|
-
const [map, setMap] = (0, import_react2.useState)(() => new Map(initialState));
|
|
49
|
-
const preservedInitialState = usePreservedReference(initialState);
|
|
50
|
-
const set = (0, import_react2.useCallback)((key, value) => {
|
|
51
|
-
setMap((prev) => {
|
|
52
|
-
const nextMap = new Map(prev);
|
|
53
|
-
nextMap.set(key, value);
|
|
54
|
-
return nextMap;
|
|
55
|
-
});
|
|
56
|
-
}, []);
|
|
57
|
-
const setAll = (0, import_react2.useCallback)((entries) => {
|
|
58
|
-
setMap(() => new Map(entries));
|
|
59
|
-
}, []);
|
|
60
|
-
const remove = (0, import_react2.useCallback)((key) => {
|
|
61
|
-
setMap((prev) => {
|
|
62
|
-
const nextMap = new Map(prev);
|
|
63
|
-
nextMap.delete(key);
|
|
64
|
-
return nextMap;
|
|
65
|
-
});
|
|
66
|
-
}, []);
|
|
67
|
-
const reset = (0, import_react2.useCallback)(() => {
|
|
68
|
-
setMap(() => new Map(preservedInitialState));
|
|
69
|
-
}, [preservedInitialState]);
|
|
70
|
-
const actions = (0, import_react2.useMemo)(() => {
|
|
71
|
-
return { set, setAll, remove, reset };
|
|
72
|
-
}, [set, setAll, remove, reset]);
|
|
73
|
-
return [map, actions];
|
|
74
|
-
}
|
|
75
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
-
0 && (module.exports = {
|
|
77
|
-
useMap
|
|
78
|
-
});
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/useOutsideClickEffect/index.ts
|
|
22
|
-
var useOutsideClickEffect_exports = {};
|
|
23
|
-
__export(useOutsideClickEffect_exports, {
|
|
24
|
-
useOutsideClickEffect: () => useOutsideClickEffect
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(useOutsideClickEffect_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/useOutsideClickEffect/useOutsideClickEffect.ts
|
|
29
|
-
var import_react2 = require("react");
|
|
30
|
-
|
|
31
|
-
// src/hooks/usePreservedCallback/usePreservedCallback.ts
|
|
32
|
-
var import_react = require("react");
|
|
33
|
-
function usePreservedCallback(callback) {
|
|
34
|
-
const callbackRef = (0, import_react.useRef)(callback);
|
|
35
|
-
(0, import_react.useEffect)(
|
|
36
|
-
function syncCallbackRef() {
|
|
37
|
-
callbackRef.current = callback;
|
|
38
|
-
},
|
|
39
|
-
[callback]
|
|
40
|
-
);
|
|
41
|
-
return (0, import_react.useCallback)((...args) => {
|
|
42
|
-
return callbackRef.current(...args);
|
|
43
|
-
}, []);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/hooks/useOutsideClickEffect/useOutsideClickEffect.ts
|
|
47
|
-
function useOutsideClickEffect(container, callback) {
|
|
48
|
-
const containers = (0, import_react2.useRef)([]);
|
|
49
|
-
const handleDocumentClick = usePreservedCallback(({ target }) => {
|
|
50
|
-
if (target === null) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (containers.current.length === 0) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (containers.current.some((x) => x.contains(target))) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
callback();
|
|
60
|
-
});
|
|
61
|
-
(0, import_react2.useEffect)(() => {
|
|
62
|
-
containers.current = [container].flat(1).filter((item) => item != null);
|
|
63
|
-
}, [container]);
|
|
64
|
-
(0, import_react2.useEffect)(() => {
|
|
65
|
-
document.addEventListener("click", handleDocumentClick);
|
|
66
|
-
return () => {
|
|
67
|
-
document.removeEventListener("click", handleDocumentClick);
|
|
68
|
-
};
|
|
69
|
-
}, [handleDocumentClick]);
|
|
70
|
-
}
|
|
71
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
-
0 && (module.exports = {
|
|
73
|
-
useOutsideClickEffect
|
|
74
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/usePreservedCallback/index.ts
|
|
22
|
-
var usePreservedCallback_exports = {};
|
|
23
|
-
__export(usePreservedCallback_exports, {
|
|
24
|
-
usePreservedCallback: () => usePreservedCallback
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(usePreservedCallback_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/usePreservedCallback/usePreservedCallback.ts
|
|
29
|
-
var import_react = require("react");
|
|
30
|
-
function usePreservedCallback(callback) {
|
|
31
|
-
const callbackRef = (0, import_react.useRef)(callback);
|
|
32
|
-
(0, import_react.useEffect)(
|
|
33
|
-
function syncCallbackRef() {
|
|
34
|
-
callbackRef.current = callback;
|
|
35
|
-
},
|
|
36
|
-
[callback]
|
|
37
|
-
);
|
|
38
|
-
return (0, import_react.useCallback)((...args) => {
|
|
39
|
-
return callbackRef.current(...args);
|
|
40
|
-
}, []);
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
usePreservedCallback
|
|
45
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/usePreservedReference/index.ts
|
|
22
|
-
var usePreservedReference_exports = {};
|
|
23
|
-
__export(usePreservedReference_exports, {
|
|
24
|
-
usePreservedReference: () => usePreservedReference
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(usePreservedReference_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/usePreservedReference/usePreservedReference.ts
|
|
29
|
-
var import_react = require("react");
|
|
30
|
-
function usePreservedReference(value, areValuesEqual = areDeeplyEqual) {
|
|
31
|
-
const ref = (0, import_react.useRef)(value);
|
|
32
|
-
return (0, import_react.useMemo)(() => {
|
|
33
|
-
if (!areValuesEqual(ref.current, value)) {
|
|
34
|
-
ref.current = value;
|
|
35
|
-
}
|
|
36
|
-
return ref.current;
|
|
37
|
-
}, [areValuesEqual, value]);
|
|
38
|
-
}
|
|
39
|
-
function areDeeplyEqual(x, y) {
|
|
40
|
-
return JSON.stringify(x) === JSON.stringify(y);
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
usePreservedReference
|
|
45
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/usePrevious/index.ts
|
|
22
|
-
var usePrevious_exports = {};
|
|
23
|
-
__export(usePrevious_exports, {
|
|
24
|
-
usePrevious: () => usePrevious
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(usePrevious_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/usePrevious/usePrevious.ts
|
|
29
|
-
var import_react = require("react");
|
|
30
|
-
var strictEquals = (prev, next) => prev === next;
|
|
31
|
-
function usePrevious(state, compare = strictEquals) {
|
|
32
|
-
const prevRef = (0, import_react.useRef)(state);
|
|
33
|
-
const currentRef = (0, import_react.useRef)(state);
|
|
34
|
-
const isFirstRender = (0, import_react.useRef)(true);
|
|
35
|
-
if (isFirstRender.current) {
|
|
36
|
-
isFirstRender.current = false;
|
|
37
|
-
return prevRef.current;
|
|
38
|
-
}
|
|
39
|
-
if (!compare(currentRef.current, state)) {
|
|
40
|
-
prevRef.current = currentRef.current;
|
|
41
|
-
currentRef.current = state;
|
|
42
|
-
}
|
|
43
|
-
return prevRef.current;
|
|
44
|
-
}
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
usePrevious
|
|
48
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/hooks/useRefEffect/index.ts
|
|
22
|
-
var useRefEffect_exports = {};
|
|
23
|
-
__export(useRefEffect_exports, {
|
|
24
|
-
useRefEffect: () => useRefEffect
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(useRefEffect_exports);
|
|
27
|
-
|
|
28
|
-
// src/hooks/useRefEffect/useRefEffect.ts
|
|
29
|
-
var import_react2 = require("react");
|
|
30
|
-
|
|
31
|
-
// src/hooks/usePreservedCallback/usePreservedCallback.ts
|
|
32
|
-
var import_react = require("react");
|
|
33
|
-
function usePreservedCallback(callback) {
|
|
34
|
-
const callbackRef = (0, import_react.useRef)(callback);
|
|
35
|
-
(0, import_react.useEffect)(
|
|
36
|
-
function syncCallbackRef() {
|
|
37
|
-
callbackRef.current = callback;
|
|
38
|
-
},
|
|
39
|
-
[callback]
|
|
40
|
-
);
|
|
41
|
-
return (0, import_react.useCallback)((...args) => {
|
|
42
|
-
return callbackRef.current(...args);
|
|
43
|
-
}, []);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/hooks/useRefEffect/useRefEffect.ts
|
|
47
|
-
function useRefEffect(callback, deps) {
|
|
48
|
-
const preservedCallback = usePreservedCallback(callback);
|
|
49
|
-
const cleanupCallbackRef = (0, import_react2.useRef)(() => {
|
|
50
|
-
});
|
|
51
|
-
const effect = (0, import_react2.useCallback)(
|
|
52
|
-
(element) => {
|
|
53
|
-
cleanupCallbackRef.current();
|
|
54
|
-
cleanupCallbackRef.current = () => {
|
|
55
|
-
};
|
|
56
|
-
if (element == null) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const cleanup = preservedCallback(element);
|
|
60
|
-
if (typeof cleanup === "function") {
|
|
61
|
-
cleanupCallbackRef.current = cleanup;
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
-
[preservedCallback, ...deps]
|
|
66
|
-
);
|
|
67
|
-
return effect;
|
|
68
|
-
}
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
useRefEffect
|
|
72
|
-
});
|