@siberiacancode/reactuse 0.3.0 → 0.3.2
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/cjs/hooks/useActiveElement/useActiveElement.cjs +1 -1
- package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs.map +1 -1
- package/dist/cjs/hooks/useAutoScroll/useAutoScroll.cjs +1 -1
- package/dist/cjs/hooks/useAutoScroll/useAutoScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.cjs +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.cjs.map +1 -1
- package/dist/cjs/hooks/useCssVar/useCssVar.cjs +1 -1
- package/dist/cjs/hooks/useCssVar/useCssVar.cjs.map +1 -1
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.cjs +1 -1
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.cjs.map +1 -1
- package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.cjs +1 -1
- package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useDoubleClick/useDoubleClick.cjs +1 -1
- package/dist/cjs/hooks/useDoubleClick/useDoubleClick.cjs.map +1 -1
- package/dist/cjs/hooks/useDropZone/useDropZone.cjs +1 -1
- package/dist/cjs/hooks/useDropZone/useDropZone.cjs.map +1 -1
- package/dist/cjs/hooks/useElementSize/useElementSize.cjs +1 -1
- package/dist/cjs/hooks/useElementSize/useElementSize.cjs.map +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.cjs +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.cjs.map +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.cjs +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.cjs.map +1 -1
- package/dist/cjs/hooks/useFocusTrap/useFocusTrap.cjs +1 -1
- package/dist/cjs/hooks/useFocusTrap/useFocusTrap.cjs.map +1 -1
- package/dist/cjs/hooks/useFullscreen/useFullscreen.cjs +1 -1
- package/dist/cjs/hooks/useFullscreen/useFullscreen.cjs.map +1 -1
- package/dist/cjs/hooks/useHash/useHash.cjs.map +1 -1
- package/dist/cjs/hooks/useHotkeys/useHotkeys.cjs +1 -1
- package/dist/cjs/hooks/useHotkeys/useHotkeys.cjs.map +1 -1
- package/dist/cjs/hooks/useHover/useHover.cjs +1 -1
- package/dist/cjs/hooks/useHover/useHover.cjs.map +1 -1
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs +1 -1
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyPress/useKeyPress.cjs +1 -1
- package/dist/cjs/hooks/useKeyPress/useKeyPress.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.cjs +1 -1
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyboard/useKeyboard.cjs +1 -1
- package/dist/cjs/hooks/useKeyboard/useKeyboard.cjs.map +1 -1
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.cjs +1 -1
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.cjs.map +1 -1
- package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs +1 -1
- package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useLongPress/useLongPress.cjs +1 -1
- package/dist/cjs/hooks/useLongPress/useLongPress.cjs.map +1 -1
- package/dist/cjs/hooks/useMeasure/useMeasure.cjs +1 -1
- package/dist/cjs/hooks/useMeasure/useMeasure.cjs.map +1 -1
- package/dist/cjs/hooks/useMediaControls/useMediaControls.cjs +1 -1
- package/dist/cjs/hooks/useMediaControls/useMediaControls.cjs.map +1 -1
- package/dist/cjs/hooks/useMouse/useMouse.cjs +1 -1
- package/dist/cjs/hooks/useMouse/useMouse.cjs.map +1 -1
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.cjs +1 -1
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.cjs.map +1 -1
- package/dist/cjs/hooks/usePaint/usePaint.cjs +1 -1
- package/dist/cjs/hooks/usePaint/usePaint.cjs.map +1 -1
- package/dist/cjs/hooks/useParallax/useParallax.cjs +1 -1
- package/dist/cjs/hooks/useParallax/useParallax.cjs.map +1 -1
- package/dist/cjs/hooks/usePictureInPicture/usePictureInPicture.cjs +1 -1
- package/dist/cjs/hooks/usePictureInPicture/usePictureInPicture.cjs.map +1 -1
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.cjs +1 -1
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useRightClick/useRightClick.cjs +1 -1
- package/dist/cjs/hooks/useRightClick/useRightClick.cjs.map +1 -1
- package/dist/cjs/hooks/useScroll/useScroll.cjs +1 -1
- package/dist/cjs/hooks/useScroll/useScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useScrollIntoView/useScrollIntoView.cjs +1 -1
- package/dist/cjs/hooks/useScrollIntoView/useScrollIntoView.cjs.map +1 -1
- package/dist/cjs/hooks/useScrollTo/useScrollTo.cjs +1 -1
- package/dist/cjs/hooks/useScrollTo/useScrollTo.cjs.map +1 -1
- package/dist/cjs/hooks/useSticky/useSticky.cjs +1 -1
- package/dist/cjs/hooks/useSticky/useSticky.cjs.map +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs.map +1 -1
- package/dist/cjs/hooks/useUrlSearchParam/useUrlSearchParam.cjs +1 -1
- package/dist/cjs/hooks/useUrlSearchParam/useUrlSearchParam.cjs.map +1 -1
- package/dist/cjs/hooks/useUrlSearchParams/useUrlSearchParams.cjs +1 -1
- package/dist/cjs/hooks/useUrlSearchParams/useUrlSearchParams.cjs.map +1 -1
- package/dist/cjs/hooks/useVisibility/useVisibility.cjs +1 -1
- package/dist/cjs/hooks/useVisibility/useVisibility.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowEvent/useWindowEvent.cjs +1 -1
- package/dist/cjs/hooks/useWindowEvent/useWindowEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowSize/useWindowSize.cjs +1 -1
- package/dist/cjs/hooks/useWindowSize/useWindowSize.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/helpers/isTarget.cjs +1 -1
- package/dist/cjs/utils/helpers/isTarget.cjs.map +1 -1
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs +8 -9
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs.map +1 -1
- package/dist/esm/hooks/useAutoScroll/useAutoScroll.mjs +12 -13
- package/dist/esm/hooks/useAutoScroll/useAutoScroll.mjs.map +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.mjs +8 -9
- package/dist/esm/hooks/useClickOutside/useClickOutside.mjs.map +1 -1
- package/dist/esm/hooks/useCssVar/useCssVar.mjs +19 -20
- package/dist/esm/hooks/useCssVar/useCssVar.mjs.map +1 -1
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs +15 -16
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs.map +1 -1
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.mjs +3 -3
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.mjs.map +1 -1
- package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs +17 -18
- package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs.map +1 -1
- package/dist/esm/hooks/useDropZone/useDropZone.mjs +17 -18
- package/dist/esm/hooks/useDropZone/useDropZone.mjs.map +1 -1
- package/dist/esm/hooks/useElementSize/useElementSize.mjs +12 -12
- package/dist/esm/hooks/useElementSize/useElementSize.mjs.map +1 -1
- package/dist/esm/hooks/useEventListener/useEventListener.mjs +11 -12
- package/dist/esm/hooks/useEventListener/useEventListener.mjs.map +1 -1
- package/dist/esm/hooks/useFocus/useFocus.mjs +13 -14
- package/dist/esm/hooks/useFocus/useFocus.mjs.map +1 -1
- package/dist/esm/hooks/useFocusTrap/useFocusTrap.mjs +18 -19
- package/dist/esm/hooks/useFocusTrap/useFocusTrap.mjs.map +1 -1
- package/dist/esm/hooks/useFullscreen/useFullscreen.mjs +11 -12
- package/dist/esm/hooks/useFullscreen/useFullscreen.mjs.map +1 -1
- package/dist/esm/hooks/useHash/useHash.mjs.map +1 -1
- package/dist/esm/hooks/useHotkeys/useHotkeys.mjs +8 -9
- package/dist/esm/hooks/useHotkeys/useHotkeys.mjs.map +1 -1
- package/dist/esm/hooks/useHover/useHover.mjs +12 -13
- package/dist/esm/hooks/useHover/useHover.mjs.map +1 -1
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs +11 -12
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs.map +1 -1
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs +19 -20
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs.map +1 -1
- package/dist/esm/hooks/useKeyPress/useKeyPress.mjs +8 -9
- package/dist/esm/hooks/useKeyPress/useKeyPress.mjs.map +1 -1
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.mjs +11 -12
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.mjs.map +1 -1
- package/dist/esm/hooks/useKeyboard/useKeyboard.mjs +11 -12
- package/dist/esm/hooks/useKeyboard/useKeyboard.mjs.map +1 -1
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.mjs +11 -12
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.mjs.map +1 -1
- package/dist/esm/hooks/useLockScroll/useLockScroll.mjs +12 -13
- package/dist/esm/hooks/useLockScroll/useLockScroll.mjs.map +1 -1
- package/dist/esm/hooks/useLongPress/useLongPress.mjs +13 -14
- package/dist/esm/hooks/useLongPress/useLongPress.mjs.map +1 -1
- package/dist/esm/hooks/useMeasure/useMeasure.mjs +15 -16
- package/dist/esm/hooks/useMeasure/useMeasure.mjs.map +1 -1
- package/dist/esm/hooks/useMediaControls/useMediaControls.mjs +32 -33
- package/dist/esm/hooks/useMediaControls/useMediaControls.mjs.map +1 -1
- package/dist/esm/hooks/useMouse/useMouse.mjs +12 -13
- package/dist/esm/hooks/useMouse/useMouse.mjs.map +1 -1
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs +11 -12
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs.map +1 -1
- package/dist/esm/hooks/usePaint/usePaint.mjs +23 -24
- package/dist/esm/hooks/usePaint/usePaint.mjs.map +1 -1
- package/dist/esm/hooks/useParallax/useParallax.mjs +31 -32
- package/dist/esm/hooks/useParallax/useParallax.mjs.map +1 -1
- package/dist/esm/hooks/usePictureInPicture/usePictureInPicture.mjs +11 -12
- package/dist/esm/hooks/usePictureInPicture/usePictureInPicture.mjs.map +1 -1
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs +11 -12
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs.map +1 -1
- package/dist/esm/hooks/useRightClick/useRightClick.mjs +11 -12
- package/dist/esm/hooks/useRightClick/useRightClick.mjs.map +1 -1
- package/dist/esm/hooks/useScroll/useScroll.mjs +12 -13
- package/dist/esm/hooks/useScroll/useScroll.mjs.map +1 -1
- package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.mjs +20 -21
- package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.mjs.map +1 -1
- package/dist/esm/hooks/useScrollTo/useScrollTo.mjs +13 -14
- package/dist/esm/hooks/useScrollTo/useScrollTo.mjs.map +1 -1
- package/dist/esm/hooks/useSticky/useSticky.mjs +11 -12
- package/dist/esm/hooks/useSticky/useSticky.mjs.map +1 -1
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs +21 -22
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs.map +1 -1
- package/dist/esm/hooks/useUrlSearchParam/useUrlSearchParam.mjs +24 -19
- package/dist/esm/hooks/useUrlSearchParam/useUrlSearchParam.mjs.map +1 -1
- package/dist/esm/hooks/useUrlSearchParams/useUrlSearchParams.mjs +35 -30
- package/dist/esm/hooks/useUrlSearchParams/useUrlSearchParams.mjs.map +1 -1
- package/dist/esm/hooks/useVisibility/useVisibility.mjs +13 -14
- package/dist/esm/hooks/useVisibility/useVisibility.mjs.map +1 -1
- package/dist/esm/hooks/useWindowEvent/useWindowEvent.mjs +4 -4
- package/dist/esm/hooks/useWindowEvent/useWindowEvent.mjs.map +1 -1
- package/dist/esm/hooks/useWindowSize/useWindowSize.mjs +12 -16
- package/dist/esm/hooks/useWindowSize/useWindowSize.mjs.map +1 -1
- package/dist/esm/index.mjs +62 -64
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/utils/helpers/isTarget.mjs +9 -3
- package/dist/esm/utils/helpers/isTarget.mjs.map +1 -1
- package/dist/types/hooks/useHash/useHash.d.ts +18 -5
- package/dist/types/utils/helpers/index.d.ts +0 -1
- package/dist/types/utils/helpers/isTarget.d.ts +19 -2
- package/package.json +1 -1
- package/dist/cjs/utils/helpers/getElement.cjs +0 -2
- package/dist/cjs/utils/helpers/getElement.cjs.map +0 -1
- package/dist/esm/utils/helpers/getElement.mjs +0 -10
- package/dist/esm/utils/helpers/getElement.mjs.map +0 -1
- package/dist/types/utils/helpers/getElement.d.ts +0 -12
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext as r } from "./helpers/createContext/createContext.mjs";
|
|
2
2
|
import { createEventEmitter as s } from "./helpers/createEventEmitter/createEventEmitter.mjs";
|
|
3
|
-
import { createReactiveContext as
|
|
3
|
+
import { createReactiveContext as m } from "./helpers/createReactiveContext/createReactiveContext.mjs";
|
|
4
4
|
import { createStore as f } from "./helpers/createStore/createStore.mjs";
|
|
5
5
|
import { useAsync as a } from "./hooks/useAsync/useAsync.mjs";
|
|
6
6
|
import { useLockCallback as n } from "./hooks/useLockCallback/useLockCallback.mjs";
|
|
@@ -25,7 +25,7 @@ import { mapGamepadToXbox360Controller as q, useGamepad as Z } from "./hooks/use
|
|
|
25
25
|
import { useGeolocation as J } from "./hooks/useGeolocation/useGeolocation.mjs";
|
|
26
26
|
import { timeRangeToArray as $, useMediaControls as ee } from "./hooks/useMediaControls/useMediaControls.mjs";
|
|
27
27
|
import { useMemory as re } from "./hooks/useMemory/useMemory.mjs";
|
|
28
|
-
import { getConnection as se, useNetwork as
|
|
28
|
+
import { getConnection as se, useNetwork as ue } from "./hooks/useNetwork/useNetwork.mjs";
|
|
29
29
|
import { useOnline as pe } from "./hooks/useOnline/useOnline.mjs";
|
|
30
30
|
import { useOtpCredential as xe } from "./hooks/useOtpCredential/useOtpCredential.mjs";
|
|
31
31
|
import { usePermission as ie } from "./hooks/usePermission/usePermission.mjs";
|
|
@@ -51,7 +51,7 @@ import { DEFAULT_THRESHOLD_TIME as je, useDoubleClick as Je } from "./hooks/useD
|
|
|
51
51
|
import { useDropZone as $e } from "./hooks/useDropZone/useDropZone.mjs";
|
|
52
52
|
import { useFileDialog as oo } from "./hooks/useFileDialog/useFileDialog.mjs";
|
|
53
53
|
import { useFocus as to } from "./hooks/useFocus/useFocus.mjs";
|
|
54
|
-
import { FOCUS_SELECTOR as
|
|
54
|
+
import { FOCUS_SELECTOR as uo, useFocusTrap as mo } from "./hooks/useFocusTrap/useFocusTrap.mjs";
|
|
55
55
|
import { useHover as fo } from "./hooks/useHover/useHover.mjs";
|
|
56
56
|
import { useImage as ao } from "./hooks/useImage/useImage.mjs";
|
|
57
57
|
import { useLongPress as no } from "./hooks/useLongPress/useLongPress.mjs";
|
|
@@ -71,7 +71,7 @@ import { useMount as wo } from "./hooks/useMount/useMount.mjs";
|
|
|
71
71
|
import { deepEqual as Go, useShallowEffect as Qo } from "./hooks/useShallowEffect/useShallowEffect.mjs";
|
|
72
72
|
import { useUnmount as Xo } from "./hooks/useUnmount/useUnmount.mjs";
|
|
73
73
|
import { BREAKPOINTS_ANT_DESIGN as Zo, BREAKPOINTS_BOOTSTRAP_V5 as jo, BREAKPOINTS_MANTINE as Jo, BREAKPOINTS_MASTER_CSS as Yo, BREAKPOINTS_MATERIAL_UI as $o, BREAKPOINTS_PRIME_FLEX as er, BREAKPOINTS_QUASAR_V2 as or, BREAKPOINTS_SEMANTIC as rr, BREAKPOINTS_TAILWIND as tr, useBreakpoints as sr } from "./hooks/useBreakpoints/useBreakpoints.mjs";
|
|
74
|
-
import { useDeviceMotion as
|
|
74
|
+
import { useDeviceMotion as mr } from "./hooks/useDeviceMotion/useDeviceMotion.mjs";
|
|
75
75
|
import { useDeviceOrientation as fr } from "./hooks/useDeviceOrientation/useDeviceOrientation.mjs";
|
|
76
76
|
import { useDevicePixelRatio as ar } from "./hooks/useDevicePixelRatio/useDevicePixelRatio.mjs";
|
|
77
77
|
import { useDocumentEvent as nr } from "./hooks/useDocumentEvent/useDocumentEvent.mjs";
|
|
@@ -97,7 +97,7 @@ import { useParallax as Jr } from "./hooks/useParallax/useParallax.mjs";
|
|
|
97
97
|
import { usePerformanceObserver as $r } from "./hooks/usePerformanceObserver/usePerformanceObserver.mjs";
|
|
98
98
|
import { useResizeObserver as ot } from "./hooks/useResizeObserver/useResizeObserver.mjs";
|
|
99
99
|
import { useScroll as tt } from "./hooks/useScroll/useScroll.mjs";
|
|
100
|
-
import { useScrollIntoView as
|
|
100
|
+
import { useScrollIntoView as ut } from "./hooks/useScrollIntoView/useScrollIntoView.mjs";
|
|
101
101
|
import { useScrollTo as pt } from "./hooks/useScrollTo/useScrollTo.mjs";
|
|
102
102
|
import { getRangesSelection as xt, useTextSelection as at } from "./hooks/useTextSelection/useTextSelection.mjs";
|
|
103
103
|
import { useVisibility as nt } from "./hooks/useVisibility/useVisibility.mjs";
|
|
@@ -117,7 +117,7 @@ import { getHash as qt, useHash as Zt } from "./hooks/useHash/useHash.mjs";
|
|
|
117
117
|
import { useList as Jt } from "./hooks/useList/useList.mjs";
|
|
118
118
|
import { useLocalStorage as $t } from "./hooks/useLocalStorage/useLocalStorage.mjs";
|
|
119
119
|
import { useMap as os } from "./hooks/useMap/useMap.mjs";
|
|
120
|
-
import { assignRef as ts, mergeRefs as ss, useMergedRef as
|
|
120
|
+
import { assignRef as ts, mergeRefs as ss, useMergedRef as us } from "./hooks/useMergedRef/useMergedRef.mjs";
|
|
121
121
|
import { useOffsetPagination as ps } from "./hooks/useOffsetPagination/useOffsetPagination.mjs";
|
|
122
122
|
import { useQueue as xs } from "./hooks/useQueue/useQueue.mjs";
|
|
123
123
|
import { useRafState as is } from "./hooks/useRafState/useRafState.mjs";
|
|
@@ -137,30 +137,29 @@ import { useTime as Gs } from "./hooks/useTime/useTime.mjs";
|
|
|
137
137
|
import { useTimeout as zs } from "./hooks/useTimeout/useTimeout.mjs";
|
|
138
138
|
import { getTimeFromSeconds as qs, useTimer as Zs } from "./hooks/useTimer/useTimer.mjs";
|
|
139
139
|
import { useBrowserLanguage as Js } from "./hooks/useBrowserLanguage/useBrowserLanguage.mjs";
|
|
140
|
-
import { getOperatingSystem as $s, useOperatingSystem as
|
|
141
|
-
import { usePreferredColorScheme as
|
|
142
|
-
import { usePreferredContrast as
|
|
143
|
-
import { usePreferredDark as
|
|
144
|
-
import { usePreferredLanguages as
|
|
145
|
-
import { usePreferredReducedMotion as
|
|
146
|
-
import { useConst as
|
|
147
|
-
import { useDebounceCallback as
|
|
148
|
-
import { useDebounceState as
|
|
149
|
-
import { useDebounceValue as
|
|
150
|
-
import { useEvent as
|
|
151
|
-
import { useLastChanged as
|
|
152
|
-
import { useLatest as
|
|
153
|
-
import { usePrevious as
|
|
154
|
-
import { useThrottleCallback as
|
|
155
|
-
import { useThrottleState as
|
|
156
|
-
import { useThrottleValue as
|
|
157
|
-
import { copy as
|
|
158
|
-
import { debounce as
|
|
159
|
-
import { getDate as
|
|
160
|
-
import {
|
|
161
|
-
import {
|
|
162
|
-
import {
|
|
163
|
-
import { throttle as Zm } from "./utils/helpers/throttle.mjs";
|
|
140
|
+
import { getOperatingSystem as $s, useOperatingSystem as eu } from "./hooks/useOperatingSystem/useOperatingSystem.mjs";
|
|
141
|
+
import { usePreferredColorScheme as ru } from "./hooks/usePreferredColorScheme/usePreferredColorScheme.mjs";
|
|
142
|
+
import { usePreferredContrast as su } from "./hooks/usePreferredContrast/usePreferredContrast.mjs";
|
|
143
|
+
import { usePreferredDark as mu } from "./hooks/usePreferredDark/usePreferredDark.mjs";
|
|
144
|
+
import { usePreferredLanguages as fu } from "./hooks/usePreferredLanguages/usePreferredLanguages.mjs";
|
|
145
|
+
import { usePreferredReducedMotion as au } from "./hooks/usePreferredReducedMotion/usePreferredReducedMotion.mjs";
|
|
146
|
+
import { useConst as nu } from "./hooks/useConst/useConst.mjs";
|
|
147
|
+
import { useDebounceCallback as lu } from "./hooks/useDebounceCallback/useDebounceCallback.mjs";
|
|
148
|
+
import { useDebounceState as Eu } from "./hooks/useDebounceState/useDebounceState.mjs";
|
|
149
|
+
import { useDebounceValue as gu } from "./hooks/useDebounceValue/useDebounceValue.mjs";
|
|
150
|
+
import { useEvent as Ru } from "./hooks/useEvent/useEvent.mjs";
|
|
151
|
+
import { useLastChanged as Pu } from "./hooks/useLastChanged/useLastChanged.mjs";
|
|
152
|
+
import { useLatest as Iu } from "./hooks/useLatest/useLatest.mjs";
|
|
153
|
+
import { usePrevious as Ou } from "./hooks/usePrevious/usePrevious.mjs";
|
|
154
|
+
import { useThrottleCallback as hu } from "./hooks/useThrottleCallback/useThrottleCallback.mjs";
|
|
155
|
+
import { useThrottleState as _u } from "./hooks/useThrottleState/useThrottleState.mjs";
|
|
156
|
+
import { useThrottleValue as bu } from "./hooks/useThrottleValue/useThrottleValue.mjs";
|
|
157
|
+
import { copy as Mu, legacyCopyToClipboard as Nu } from "./utils/helpers/copy.mjs";
|
|
158
|
+
import { debounce as Ku } from "./utils/helpers/debounce.mjs";
|
|
159
|
+
import { getDate as Uu } from "./utils/helpers/getDate.mjs";
|
|
160
|
+
import { getRetry as Hu } from "./utils/helpers/getRetry.mjs";
|
|
161
|
+
import { isTarget as Wu, target as Gu, targetSymbol as Qu } from "./utils/helpers/isTarget.mjs";
|
|
162
|
+
import { throttle as Xu } from "./utils/helpers/throttle.mjs";
|
|
164
163
|
export {
|
|
165
164
|
Zo as BREAKPOINTS_ANT_DESIGN,
|
|
166
165
|
jo as BREAKPOINTS_BOOTSTRAP_V5,
|
|
@@ -173,7 +172,7 @@ export {
|
|
|
173
172
|
tr as BREAKPOINTS_TAILWIND,
|
|
174
173
|
kt as COOKIE_EVENT,
|
|
175
174
|
je as DEFAULT_THRESHOLD_TIME,
|
|
176
|
-
|
|
175
|
+
uo as FOCUS_SELECTOR,
|
|
177
176
|
lo as Paint,
|
|
178
177
|
So as Pointer,
|
|
179
178
|
Co as SCRIPT_STATUS_ATTRIBUTE_NAME,
|
|
@@ -181,13 +180,13 @@ export {
|
|
|
181
180
|
_s as URL_SEARCH_PARAMS_EVENT,
|
|
182
181
|
ts as assignRef,
|
|
183
182
|
Kt as clearCookies,
|
|
184
|
-
|
|
183
|
+
Mu as copy,
|
|
185
184
|
r as createContext,
|
|
186
185
|
s as createEventEmitter,
|
|
187
186
|
Ds as createQueryString,
|
|
188
|
-
|
|
187
|
+
m as createReactiveContext,
|
|
189
188
|
f as createStore,
|
|
190
|
-
|
|
189
|
+
Ku as debounce,
|
|
191
190
|
Go as deepEqual,
|
|
192
191
|
ht as dispatchCookieEvent,
|
|
193
192
|
ys as dispatchStorageEvent,
|
|
@@ -195,18 +194,17 @@ export {
|
|
|
195
194
|
se as getConnection,
|
|
196
195
|
vt as getCookie,
|
|
197
196
|
_t as getCookies,
|
|
198
|
-
|
|
199
|
-
Hm as getElement,
|
|
197
|
+
Uu as getDate,
|
|
200
198
|
qt as getHash,
|
|
201
199
|
$s as getOperatingSystem,
|
|
202
200
|
xt as getRangesSelection,
|
|
203
|
-
|
|
201
|
+
Hu as getRetry,
|
|
204
202
|
Ae as getSpeechRecognition,
|
|
205
203
|
qs as getTimeFromSeconds,
|
|
206
204
|
Ls as getUrlSearchParams,
|
|
207
205
|
Rr as isHotkeyMatch,
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
Wu as isTarget,
|
|
207
|
+
Nu as legacyCopyToClipboard,
|
|
210
208
|
q as mapGamepadToXbox360Controller,
|
|
211
209
|
ss as mergeRefs,
|
|
212
210
|
Dt as removeCookie,
|
|
@@ -215,9 +213,9 @@ export {
|
|
|
215
213
|
Lt as setCookie,
|
|
216
214
|
Mt as setCookieItem,
|
|
217
215
|
ds as stateHistoryReducer,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
Gu as target,
|
|
217
|
+
Qu as targetSymbol,
|
|
218
|
+
Xu as throttle,
|
|
221
219
|
$ as timeRangeToArray,
|
|
222
220
|
Ge as useActiveElement,
|
|
223
221
|
a as useAsync,
|
|
@@ -232,18 +230,18 @@ export {
|
|
|
232
230
|
Js as useBrowserLanguage,
|
|
233
231
|
qe as useClickOutside,
|
|
234
232
|
h as useClipboard,
|
|
235
|
-
|
|
233
|
+
nu as useConst,
|
|
236
234
|
yt as useControllableState,
|
|
237
235
|
Nt as useCookie,
|
|
238
236
|
Ft as useCookies,
|
|
239
237
|
_ as useCopy,
|
|
240
238
|
Vt as useCounter,
|
|
241
239
|
b as useCssVar,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
lu as useDebounceCallback,
|
|
241
|
+
Eu as useDebounceState,
|
|
242
|
+
gu as useDebounceValue,
|
|
245
243
|
wt as useDefault,
|
|
246
|
-
|
|
244
|
+
mr as useDeviceMotion,
|
|
247
245
|
fr as useDeviceOrientation,
|
|
248
246
|
ar as useDevicePixelRatio,
|
|
249
247
|
Bo as useDidUpdate,
|
|
@@ -255,7 +253,7 @@ export {
|
|
|
255
253
|
Je as useDoubleClick,
|
|
256
254
|
$e as useDropZone,
|
|
257
255
|
Er as useElementSize,
|
|
258
|
-
|
|
256
|
+
Ru as useEvent,
|
|
259
257
|
gr as useEventListener,
|
|
260
258
|
F as useEventSource,
|
|
261
259
|
V as useEyeDropper,
|
|
@@ -263,7 +261,7 @@ export {
|
|
|
263
261
|
zt as useField,
|
|
264
262
|
oo as useFileDialog,
|
|
265
263
|
to as useFocus,
|
|
266
|
-
|
|
264
|
+
mo as useFocusTrap,
|
|
267
265
|
G as useFps,
|
|
268
266
|
ho as useFul,
|
|
269
267
|
z as useFullscreen,
|
|
@@ -283,8 +281,8 @@ export {
|
|
|
283
281
|
Lr as useKeyPressEvent,
|
|
284
282
|
vr as useKeyboard,
|
|
285
283
|
Nr as useKeysPressed,
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
Pu as useLastChanged,
|
|
285
|
+
Iu as useLatest,
|
|
288
286
|
_o as useLess,
|
|
289
287
|
Jt as useList,
|
|
290
288
|
$t as useLocalStorage,
|
|
@@ -297,16 +295,16 @@ export {
|
|
|
297
295
|
ee as useMediaControls,
|
|
298
296
|
Hr as useMediaQuery,
|
|
299
297
|
re as useMemory,
|
|
300
|
-
|
|
298
|
+
us as useMergedRef,
|
|
301
299
|
wo as useMount,
|
|
302
300
|
Wr as useMouse,
|
|
303
301
|
l as useMutation,
|
|
304
302
|
Qr as useMutationObserver,
|
|
305
|
-
|
|
303
|
+
ue as useNetwork,
|
|
306
304
|
ps as useOffsetPagination,
|
|
307
305
|
bo as useOnce,
|
|
308
306
|
pe as useOnline,
|
|
309
|
-
|
|
307
|
+
eu as useOperatingSystem,
|
|
310
308
|
E as useOptimistic,
|
|
311
309
|
Xr as useOrientation,
|
|
312
310
|
xe as useOtpCredential,
|
|
@@ -318,12 +316,12 @@ export {
|
|
|
318
316
|
ce as usePictureInPicture,
|
|
319
317
|
Se as usePointerLock,
|
|
320
318
|
Te as usePostMessage,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
319
|
+
ru as usePreferredColorScheme,
|
|
320
|
+
su as usePreferredContrast,
|
|
321
|
+
mu as usePreferredDark,
|
|
322
|
+
fu as usePreferredLanguages,
|
|
323
|
+
au as usePreferredReducedMotion,
|
|
324
|
+
Ou as usePrevious,
|
|
327
325
|
g as useQuery,
|
|
328
326
|
xs as useQueue,
|
|
329
327
|
de as useRaf,
|
|
@@ -336,7 +334,7 @@ export {
|
|
|
336
334
|
go as useRightClick,
|
|
337
335
|
Po as useScript,
|
|
338
336
|
tt as useScroll,
|
|
339
|
-
|
|
337
|
+
ut as useScrollIntoView,
|
|
340
338
|
pt as useScrollTo,
|
|
341
339
|
Ss as useSessionStorage,
|
|
342
340
|
Ts as useSet,
|
|
@@ -351,9 +349,9 @@ export {
|
|
|
351
349
|
Os as useStorage,
|
|
352
350
|
Oo as useTextDirection,
|
|
353
351
|
at as useTextSelection,
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
352
|
+
hu as useThrottleCallback,
|
|
353
|
+
_u as useThrottleState,
|
|
354
|
+
bu as useThrottleValue,
|
|
357
355
|
Gs as useTime,
|
|
358
356
|
zs as useTimeout,
|
|
359
357
|
Zs as useTimer,
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const n = Symbol("target"), o = (e) => "current" in e ? e.current : typeof e.value == "function" ? e.value() : typeof e.value == "string" ? document.querySelector(e.value) : (e.value instanceof Document || e.value instanceof Window || e.value instanceof Element, e.value), l = (e) => ({
|
|
2
|
+
value: e,
|
|
3
|
+
type: n
|
|
4
|
+
}), u = (e) => typeof e == "object" && ("current" in e || e && e.type === n);
|
|
5
|
+
u.wrap = l;
|
|
6
|
+
u.getElement = o;
|
|
3
7
|
export {
|
|
4
|
-
|
|
8
|
+
u as isTarget,
|
|
9
|
+
l as target,
|
|
10
|
+
n as targetSymbol
|
|
5
11
|
};
|
|
6
12
|
//# sourceMappingURL=isTarget.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTarget.mjs","sources":["../../../../src/utils/helpers/isTarget.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"isTarget.mjs","sources":["../../../../src/utils/helpers/isTarget.ts"],"sourcesContent":["import type { RefObject } from 'react';\n\nexport const targetSymbol = Symbol('target');\n\nexport type Target = (() => Element) | string | Document | Element | Window;\n\nexport type HookTarget =\n | RefObject<Element | null | undefined>\n | {\n value: Target;\n type: symbol;\n };\n\nconst getElement = (target: HookTarget) => {\n if ('current' in target) {\n return target.current;\n }\n\n if (typeof target.value === 'function') {\n return target.value();\n }\n\n if (typeof target.value === 'string') {\n return document.querySelector(target.value);\n }\n\n if (target.value instanceof Document) {\n return target.value;\n }\n\n if (target.value instanceof Window) {\n return target.value;\n }\n\n if (target.value instanceof Element) {\n return target.value;\n }\n\n return target.value;\n};\n\nexport const target = (target: Target) => ({\n value: target,\n type: targetSymbol\n});\n\nexport const isTarget = (target: HookTarget) =>\n typeof target === 'object' &&\n ('current' in target || (target && (target as any).type === targetSymbol));\n\nisTarget.wrap = target;\nisTarget.getElement = getElement;\n"],"names":["targetSymbol","getElement","target","isTarget"],"mappings":"AAEO,MAAMA,IAAe,OAAO,QAAQ,GAWrCC,IAAa,CAACC,MACd,aAAaA,IACRA,EAAO,UAGZ,OAAOA,EAAO,SAAU,aACnBA,EAAO,MAAA,IAGZ,OAAOA,EAAO,SAAU,WACnB,SAAS,cAAcA,EAAO,KAAK,KAGxCA,EAAO,iBAAiB,YAIxBA,EAAO,iBAAiB,UAIxBA,EAAO,iBAAiB,SACnBA,EAAO,QAMLA,IAAS,CAACA,OAAoB;AAAA,EACzC,OAAOA;AAAAA,EACP,MAAMF;AACR,IAEaG,IAAW,CAACD,MACvB,OAAOA,KAAW,aACjB,aAAaA,KAAWA,KAAWA,EAAe,SAASF;AAE9DG,EAAS,OAAOD;AAChBC,EAAS,aAAaF;"}
|
|
@@ -31,11 +31,7 @@ export interface UseHash {
|
|
|
31
31
|
* @returns {UseHashReturn} An array containing the hash value and a function to set the hash value
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
|
-
* const [hash, setHash] = useHash("initial"
|
|
35
|
-
* enabled: true,
|
|
36
|
-
* mode: "replace",
|
|
37
|
-
* onChange: (newHash) => console.log('Hash changed:', newHash)
|
|
38
|
-
* });
|
|
34
|
+
* const [hash, setHash] = useHash("initial");
|
|
39
35
|
*
|
|
40
36
|
* @overload
|
|
41
37
|
* @param {string} [initialValue] The initial hash value if no hash exists
|
|
@@ -44,6 +40,23 @@ export interface UseHash {
|
|
|
44
40
|
*
|
|
45
41
|
* @example
|
|
46
42
|
* const [hash, setHash] = useHash("initial", (newHash) => console.log('callback'));
|
|
43
|
+
*
|
|
44
|
+
* @overload
|
|
45
|
+
* @param {UseHashOptions} [options] Configuration options
|
|
46
|
+
* @param {boolean} [options.enabled] The enabled state of the hook
|
|
47
|
+
* @param {'initial' | 'replace'} [options.mode] The mode of hash setting
|
|
48
|
+
* @param {(hash: string) => void} [options.onChange] Callback function called when hash changes
|
|
49
|
+
* @returns {UseHashReturn} An array containing the hash value and a function to set the hash value
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* const [hash, setHash] = useHash();
|
|
53
|
+
*
|
|
54
|
+
* @overload
|
|
55
|
+
* @param {(hash: string) => void} [callback] Callback function called when hash changes
|
|
56
|
+
* @returns {UseHashReturn} An array containing the hash value and a function to set the hash value
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* const [hash, setHash] = useHash((newHash) => console.log('callback'));
|
|
47
60
|
*/
|
|
48
61
|
export declare const useHash: UseHash;
|
|
49
62
|
export {};
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export declare const targetSymbol: unique symbol;
|
|
3
|
+
export type Target = (() => Element) | string | Document | Element | Window;
|
|
4
|
+
export type HookTarget = RefObject<Element | null | undefined> | {
|
|
5
|
+
value: Target;
|
|
6
|
+
type: symbol;
|
|
7
|
+
};
|
|
8
|
+
export declare const target: (target: Target) => {
|
|
9
|
+
value: Target;
|
|
10
|
+
type: symbol;
|
|
11
|
+
};
|
|
12
|
+
export declare const isTarget: {
|
|
13
|
+
(target: HookTarget): boolean;
|
|
14
|
+
wrap: (target: Target) => {
|
|
15
|
+
value: Target;
|
|
16
|
+
type: symbol;
|
|
17
|
+
};
|
|
18
|
+
getElement: (target: HookTarget) => Window | Document | Element | null | undefined;
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=Symbol("target"),u=e=>({value:e,type:n}),l=e=>"current"in e?e.current:typeof e.value=="function"?e.value():typeof e.value=="string"?document.querySelector(e.value):(e.value instanceof Document||e.value instanceof Window||e.value instanceof Element,e.value);exports.getElement=l;exports.target=u;exports.targetSymbol=n;
|
|
2
|
-
//# sourceMappingURL=getElement.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getElement.cjs","sources":["../../../../src/utils/helpers/getElement.ts"],"sourcesContent":["import type { RefObject } from 'react';\n\nexport type Target = (() => Element) | string | Document | Element | Window;\nexport type HookTarget =\n | RefObject<Element | null | undefined>\n | {\n value: Target;\n type: symbol;\n };\n\nexport const targetSymbol = Symbol('target');\nexport const target = (target: Target) => ({\n value: target,\n type: targetSymbol\n});\n\nexport const getElement = (target: HookTarget) => {\n if ('current' in target) {\n return target.current;\n }\n\n if (typeof target.value === 'function') {\n return target.value();\n }\n\n if (typeof target.value === 'string') {\n return document.querySelector(target.value);\n }\n\n if (target.value instanceof Document) {\n return target.value;\n }\n\n if (target.value instanceof Window) {\n return target.value;\n }\n\n if (target.value instanceof Element) {\n return target.value;\n }\n\n return target.value;\n};\n"],"names":["targetSymbol","target","getElement"],"mappings":"gFAUO,MAAMA,EAAe,OAAO,QAAQ,EAC9BC,EAAUA,IAAoB,CACzC,MAAOA,EACP,KAAMD,CACR,GAEaE,EAAcD,GACrB,YAAaA,EACRA,EAAO,QAGZ,OAAOA,EAAO,OAAU,WACnBA,EAAO,MAAA,EAGZ,OAAOA,EAAO,OAAU,SACnB,SAAS,cAAcA,EAAO,KAAK,GAGxCA,EAAO,iBAAiB,UAIxBA,EAAO,iBAAiB,QAIxBA,EAAO,iBAAiB,QACnBA,EAAO"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const n = Symbol("target"), u = (e) => ({
|
|
2
|
-
value: e,
|
|
3
|
-
type: n
|
|
4
|
-
}), l = (e) => "current" in e ? e.current : typeof e.value == "function" ? e.value() : typeof e.value == "string" ? document.querySelector(e.value) : (e.value instanceof Document || e.value instanceof Window || e.value instanceof Element, e.value);
|
|
5
|
-
export {
|
|
6
|
-
l as getElement,
|
|
7
|
-
u as target,
|
|
8
|
-
n as targetSymbol
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=getElement.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getElement.mjs","sources":["../../../../src/utils/helpers/getElement.ts"],"sourcesContent":["import type { RefObject } from 'react';\n\nexport type Target = (() => Element) | string | Document | Element | Window;\nexport type HookTarget =\n | RefObject<Element | null | undefined>\n | {\n value: Target;\n type: symbol;\n };\n\nexport const targetSymbol = Symbol('target');\nexport const target = (target: Target) => ({\n value: target,\n type: targetSymbol\n});\n\nexport const getElement = (target: HookTarget) => {\n if ('current' in target) {\n return target.current;\n }\n\n if (typeof target.value === 'function') {\n return target.value();\n }\n\n if (typeof target.value === 'string') {\n return document.querySelector(target.value);\n }\n\n if (target.value instanceof Document) {\n return target.value;\n }\n\n if (target.value instanceof Window) {\n return target.value;\n }\n\n if (target.value instanceof Element) {\n return target.value;\n }\n\n return target.value;\n};\n"],"names":["targetSymbol","target","getElement"],"mappings":"AAUO,MAAMA,IAAe,OAAO,QAAQ,GAC9BC,IAAS,CAACA,OAAoB;AAAA,EACzC,OAAOA;AAAAA,EACP,MAAMD;AACR,IAEaE,IAAa,CAACD,MACrB,aAAaA,IACRA,EAAO,UAGZ,OAAOA,EAAO,SAAU,aACnBA,EAAO,MAAA,IAGZ,OAAOA,EAAO,SAAU,WACnB,SAAS,cAAcA,EAAO,KAAK,KAGxCA,EAAO,iBAAiB,YAIxBA,EAAO,iBAAiB,UAIxBA,EAAO,iBAAiB,SACnBA,EAAO;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
export type Target = (() => Element) | string | Document | Element | Window;
|
|
3
|
-
export type HookTarget = RefObject<Element | null | undefined> | {
|
|
4
|
-
value: Target;
|
|
5
|
-
type: symbol;
|
|
6
|
-
};
|
|
7
|
-
export declare const targetSymbol: unique symbol;
|
|
8
|
-
export declare const target: (target: Target) => {
|
|
9
|
-
value: Target;
|
|
10
|
-
type: symbol;
|
|
11
|
-
};
|
|
12
|
-
export declare const getElement: (target: HookTarget) => Window | Document | Element | null | undefined;
|