@siberiacancode/reactuse 0.2.12 → 0.2.13
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/helpers/createContext/createContext.cjs.map +1 -1
- package/dist/cjs/helpers/createReactiveContext/createReactiveContext.cjs.map +1 -1
- package/dist/cjs/helpers/createStore/createStore.cjs.map +1 -1
- package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs +1 -1
- package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs.map +1 -1
- package/dist/cjs/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/cjs/hooks/useBattery/useBattery.cjs +1 -1
- package/dist/cjs/hooks/useBattery/useBattery.cjs.map +1 -1
- package/dist/cjs/hooks/useBluetooth/useBluetooth.cjs +1 -1
- package/dist/cjs/hooks/useBluetooth/useBluetooth.cjs.map +1 -1
- package/dist/cjs/hooks/useBoolean/useBoolean.cjs.map +1 -1
- package/dist/cjs/hooks/useBreakpoints/useBreakpoints.cjs.map +1 -1
- package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.cjs.map +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.cjs.map +1 -1
- package/dist/cjs/hooks/useClipboard/useClipboard.cjs +1 -1
- package/dist/cjs/hooks/useClipboard/useClipboard.cjs.map +1 -1
- package/dist/cjs/hooks/useCookie/useCookie.cjs +1 -1
- package/dist/cjs/hooks/useCookie/useCookie.cjs.map +1 -1
- package/dist/cjs/hooks/useCookies/useCookies.cjs +1 -1
- package/dist/cjs/hooks/useCookies/useCookies.cjs.map +1 -1
- package/dist/cjs/hooks/useCopy/useCopy.cjs.map +1 -1
- package/dist/cjs/hooks/useCounter/useCounter.cjs +1 -1
- package/dist/cjs/hooks/useCounter/useCounter.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/useDebounceCallback/useDebounceCallback.cjs.map +1 -1
- package/dist/cjs/hooks/useDebounceValue/useDebounceValue.cjs.map +1 -1
- package/dist/cjs/hooks/useDeviceMotion/useDeviceMotion.cjs +1 -1
- package/dist/cjs/hooks/useDeviceMotion/useDeviceMotion.cjs.map +1 -1
- package/dist/cjs/hooks/useDeviceOrientation/useDeviceOrientation.cjs.map +1 -1
- package/dist/cjs/hooks/useDevicePixelRatio/useDevicePixelRatio.cjs.map +1 -1
- package/dist/cjs/hooks/useDidUpdate/useDidUpdate.cjs.map +1 -1
- package/dist/cjs/hooks/useDisclosure/useDisclosure.cjs +1 -1
- package/dist/cjs/hooks/useDisclosure/useDisclosure.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.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.cjs +1 -1
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.cjs.map +1 -1
- package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.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.map +1 -1
- package/dist/cjs/hooks/useEvent/useEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.cjs.map +1 -1
- package/dist/cjs/hooks/useEventSource/useEventSource.cjs +1 -1
- package/dist/cjs/hooks/useEventSource/useEventSource.cjs.map +1 -1
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.cjs.map +1 -1
- package/dist/cjs/hooks/useFavicon/useFavicon.cjs +1 -1
- package/dist/cjs/hooks/useFavicon/useFavicon.cjs.map +1 -1
- package/dist/cjs/hooks/useField/useField.cjs +1 -1
- package/dist/cjs/hooks/useField/useField.cjs.map +1 -1
- package/dist/cjs/hooks/useFileDialog/useFileDialog.cjs +1 -1
- package/dist/cjs/hooks/useFileDialog/useFileDialog.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/useFps/useFps.cjs.map +1 -1
- package/dist/cjs/hooks/useFul/useFul.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/useGamepad/useGamepad.cjs.map +1 -1
- package/dist/cjs/hooks/useGeolocation/useGeolocation.cjs +1 -1
- package/dist/cjs/hooks/useGeolocation/useGeolocation.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/useIdle/useIdle.cjs.map +1 -1
- package/dist/cjs/hooks/useImage/useImage.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/useInterval/useInterval.cjs +1 -1
- package/dist/cjs/hooks/useInterval/useInterval.cjs.map +1 -1
- package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.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/useLastChanged/useLastChanged.cjs +1 -1
- package/dist/cjs/hooks/useLastChanged/useLastChanged.cjs.map +1 -1
- package/dist/cjs/hooks/useLatest/useLatest.cjs +1 -1
- package/dist/cjs/hooks/useLatest/useLatest.cjs.map +1 -1
- package/dist/cjs/hooks/useLess/useLess.cjs.map +1 -1
- package/dist/cjs/hooks/useList/useList.cjs.map +1 -1
- package/dist/cjs/hooks/useLockCallback/useLockCallback.cjs.map +1 -1
- package/dist/cjs/hooks/useLogger/useLogger.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/useMap/useMap.cjs.map +1 -1
- package/dist/cjs/hooks/useMeasure/useMeasure.cjs.map +1 -1
- package/dist/cjs/hooks/useMediaQuery/useMediaQuery.cjs.map +1 -1
- package/dist/cjs/hooks/useMemory/useMemory.cjs +1 -1
- package/dist/cjs/hooks/useMemory/useMemory.cjs.map +1 -1
- package/dist/cjs/hooks/useMount/useMount.cjs.map +1 -1
- package/dist/cjs/hooks/useMouse/useMouse.cjs.map +1 -1
- package/dist/cjs/hooks/useMutation/useMutation.cjs +1 -1
- package/dist/cjs/hooks/useMutation/useMutation.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/useNetwork/useNetwork.cjs +1 -1
- package/dist/cjs/hooks/useNetwork/useNetwork.cjs.map +1 -1
- package/dist/cjs/hooks/useOffsetPagination/useOffsetPagination.cjs.map +1 -1
- package/dist/cjs/hooks/useOnce/useOnce.cjs.map +1 -1
- package/dist/cjs/hooks/useOnline/useOnline.cjs.map +1 -1
- package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.cjs.map +1 -1
- package/dist/cjs/hooks/useOptimistic/useOptimistic.cjs.map +1 -1
- package/dist/cjs/hooks/useOrientation/useOrientation.cjs.map +1 -1
- package/dist/cjs/hooks/useOtpCredential/useOtpCredential.cjs +1 -1
- package/dist/cjs/hooks/useOtpCredential/useOtpCredential.cjs.map +1 -1
- package/dist/cjs/hooks/usePageLeave/usePageLeave.cjs +1 -1
- package/dist/cjs/hooks/usePageLeave/usePageLeave.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.map +1 -1
- package/dist/cjs/hooks/usePerformanceObserver/usePerformanceObserver.cjs +1 -1
- package/dist/cjs/hooks/usePerformanceObserver/usePerformanceObserver.cjs.map +1 -1
- package/dist/cjs/hooks/usePermission/usePermission.cjs +1 -1
- package/dist/cjs/hooks/usePermission/usePermission.cjs.map +1 -1
- package/dist/cjs/hooks/usePointerLock/usePointerLock.cjs.map +1 -1
- package/dist/cjs/hooks/usePostMessage/usePostMessage.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredContrast/usePreferredContrast.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredReducedMotion/usePreferredReducedMotion.cjs.map +1 -1
- package/dist/cjs/hooks/usePrevious/usePrevious.cjs +1 -1
- package/dist/cjs/hooks/usePrevious/usePrevious.cjs.map +1 -1
- package/dist/cjs/hooks/useQuery/useQuery.cjs +1 -1
- package/dist/cjs/hooks/useQuery/useQuery.cjs.map +1 -1
- package/dist/cjs/hooks/useQueue/useQueue.cjs.map +1 -1
- package/dist/cjs/hooks/useRaf/useRaf.cjs +1 -1
- package/dist/cjs/hooks/useRaf/useRaf.cjs.map +1 -1
- package/dist/cjs/hooks/useRafValue/useRafValue.cjs.map +1 -1
- package/dist/cjs/hooks/useRefState/useRefState.cjs.map +1 -1
- package/dist/cjs/hooks/useRenderCount/useRenderCount.cjs.map +1 -1
- package/dist/cjs/hooks/useRenderInfo/useRenderInfo.cjs.map +1 -1
- package/dist/cjs/hooks/useRerender/useRerender.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/useScreenOrientation/useScreenOrientation.cjs +1 -1
- package/dist/cjs/hooks/useScreenOrientation/useScreenOrientation.cjs.map +1 -1
- package/dist/cjs/hooks/useScript/useScript.cjs +1 -1
- package/dist/cjs/hooks/useScript/useScript.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.map +1 -1
- package/dist/cjs/hooks/useScrollTo/useScrollTo.cjs.map +1 -1
- package/dist/cjs/hooks/useSet/useSet.cjs.map +1 -1
- package/dist/cjs/hooks/useShare/useShare.cjs.map +1 -1
- package/dist/cjs/hooks/useSpeechRecognition/useSpeechRecognition.cjs +1 -1
- package/dist/cjs/hooks/useSpeechRecognition/useSpeechRecognition.cjs.map +1 -1
- package/dist/cjs/hooks/useSpeechSynthesis/useSpeechSynthesis.cjs +1 -1
- package/dist/cjs/hooks/useSpeechSynthesis/useSpeechSynthesis.cjs.map +1 -1
- package/dist/cjs/hooks/useStateHistory/useStateHistory.cjs.map +1 -1
- package/dist/cjs/hooks/useStep/useStep.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/useStopwatch/useStopwatch.cjs +1 -1
- package/dist/cjs/hooks/useStopwatch/useStopwatch.cjs.map +1 -1
- package/dist/cjs/hooks/useStorage/useStorage.cjs +1 -1
- package/dist/cjs/hooks/useStorage/useStorage.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/useTextSelection/useTextSelection.cjs +1 -1
- package/dist/cjs/hooks/useTextSelection/useTextSelection.cjs.map +1 -1
- package/dist/cjs/hooks/useThrottleCallback/useThrottleCallback.cjs.map +1 -1
- package/dist/cjs/hooks/useThrottleValue/useThrottleValue.cjs.map +1 -1
- package/dist/cjs/hooks/useTime/useTime.cjs.map +1 -1
- package/dist/cjs/hooks/useTimeout/useTimeout.cjs.map +1 -1
- package/dist/cjs/hooks/useTimer/useTimer.cjs +1 -1
- package/dist/cjs/hooks/useTimer/useTimer.cjs.map +1 -1
- package/dist/cjs/hooks/useToggle/useToggle.cjs.map +1 -1
- package/dist/cjs/hooks/useUnmount/useUnmount.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/useVibrate/useVibrate.cjs.map +1 -1
- package/dist/cjs/hooks/useWakeLock/useWakeLock.cjs +1 -1
- package/dist/cjs/hooks/useWakeLock/useWakeLock.cjs.map +1 -1
- package/dist/cjs/hooks/useWebSocket/useWebSocket.cjs +1 -1
- package/dist/cjs/hooks/useWebSocket/useWebSocket.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowEvent/useWindowEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowFocus/useWindowFocus.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowScroll/useWindowScroll.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/hooks/useWizard/useWizard.cjs +1 -1
- package/dist/cjs/hooks/useWizard/useWizard.cjs.map +1 -1
- package/dist/cjs/utils/helpers/copy.cjs.map +1 -1
- package/dist/cjs/utils/helpers/debounce.cjs.map +1 -1
- package/dist/cjs/utils/helpers/getDate.cjs.map +1 -1
- package/dist/cjs/utils/helpers/getElement.cjs.map +1 -1
- package/dist/cjs/utils/helpers/getRetry.cjs.map +1 -1
- package/dist/cjs/utils/helpers/isTarget.cjs.map +1 -1
- package/dist/cjs/utils/helpers/throttle.cjs.map +1 -1
- package/dist/esm/helpers/createContext/createContext.mjs.map +1 -1
- package/dist/esm/helpers/createReactiveContext/createReactiveContext.mjs.map +1 -1
- package/dist/esm/helpers/createStore/createStore.mjs.map +1 -1
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs +1 -1
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs.map +1 -1
- package/dist/esm/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/esm/hooks/useBattery/useBattery.mjs +10 -10
- package/dist/esm/hooks/useBattery/useBattery.mjs.map +1 -1
- package/dist/esm/hooks/useBluetooth/useBluetooth.mjs +14 -15
- package/dist/esm/hooks/useBluetooth/useBluetooth.mjs.map +1 -1
- package/dist/esm/hooks/useBoolean/useBoolean.mjs.map +1 -1
- package/dist/esm/hooks/useBreakpoints/useBreakpoints.mjs.map +1 -1
- package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.mjs.map +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.mjs.map +1 -1
- package/dist/esm/hooks/useClipboard/useClipboard.mjs +13 -14
- package/dist/esm/hooks/useClipboard/useClipboard.mjs.map +1 -1
- package/dist/esm/hooks/useConst/useConst.mjs.map +1 -1
- package/dist/esm/hooks/useCookie/useCookie.mjs +27 -27
- package/dist/esm/hooks/useCookie/useCookie.mjs.map +1 -1
- package/dist/esm/hooks/useCookies/useCookies.mjs +19 -19
- package/dist/esm/hooks/useCookies/useCookies.mjs.map +1 -1
- package/dist/esm/hooks/useCopy/useCopy.mjs.map +1 -1
- package/dist/esm/hooks/useCounter/useCounter.mjs +5 -6
- package/dist/esm/hooks/useCounter/useCounter.mjs.map +1 -1
- package/dist/esm/hooks/useCssVar/useCssVar.mjs +13 -14
- package/dist/esm/hooks/useCssVar/useCssVar.mjs.map +1 -1
- package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.mjs.map +1 -1
- package/dist/esm/hooks/useDebounceValue/useDebounceValue.mjs.map +1 -1
- package/dist/esm/hooks/useDefault/useDefault.mjs.map +1 -1
- package/dist/esm/hooks/useDeviceMotion/useDeviceMotion.mjs +18 -19
- package/dist/esm/hooks/useDeviceMotion/useDeviceMotion.mjs.map +1 -1
- package/dist/esm/hooks/useDeviceOrientation/useDeviceOrientation.mjs.map +1 -1
- package/dist/esm/hooks/useDevicePixelRatio/useDevicePixelRatio.mjs.map +1 -1
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.mjs.map +1 -1
- package/dist/esm/hooks/useDisclosure/useDisclosure.mjs +5 -11
- package/dist/esm/hooks/useDisclosure/useDisclosure.mjs.map +1 -1
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs +28 -28
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs.map +1 -1
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.mjs.map +1 -1
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.mjs +15 -15
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.mjs.map +1 -1
- package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.mjs.map +1 -1
- package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs +11 -13
- package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs.map +1 -1
- package/dist/esm/hooks/useDropZone/useDropZone.mjs +27 -28
- package/dist/esm/hooks/useDropZone/useDropZone.mjs.map +1 -1
- package/dist/esm/hooks/useElementSize/useElementSize.mjs.map +1 -1
- package/dist/esm/hooks/useEvent/useEvent.mjs.map +1 -1
- package/dist/esm/hooks/useEventListener/useEventListener.mjs.map +1 -1
- package/dist/esm/hooks/useEventSource/useEventSource.mjs +37 -40
- package/dist/esm/hooks/useEventSource/useEventSource.mjs.map +1 -1
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.mjs.map +1 -1
- package/dist/esm/hooks/useFavicon/useFavicon.mjs +11 -12
- package/dist/esm/hooks/useFavicon/useFavicon.mjs.map +1 -1
- package/dist/esm/hooks/useField/useField.mjs +45 -49
- package/dist/esm/hooks/useField/useField.mjs.map +1 -1
- package/dist/esm/hooks/useFileDialog/useFileDialog.mjs +22 -25
- package/dist/esm/hooks/useFileDialog/useFileDialog.mjs.map +1 -1
- package/dist/esm/hooks/useFocus/useFocus.mjs +24 -32
- package/dist/esm/hooks/useFocus/useFocus.mjs.map +1 -1
- package/dist/esm/hooks/useFps/useFps.mjs.map +1 -1
- package/dist/esm/hooks/useFul/useFul.mjs.map +1 -1
- package/dist/esm/hooks/useFullscreen/useFullscreen.mjs +23 -24
- package/dist/esm/hooks/useFullscreen/useFullscreen.mjs.map +1 -1
- package/dist/esm/hooks/useGamepad/useGamepad.mjs.map +1 -1
- package/dist/esm/hooks/useGeolocation/useGeolocation.mjs +24 -24
- package/dist/esm/hooks/useGeolocation/useGeolocation.mjs.map +1 -1
- package/dist/esm/hooks/useHash/useHash.mjs.map +1 -1
- package/dist/esm/hooks/useHotkeys/useHotkeys.mjs +24 -25
- package/dist/esm/hooks/useHotkeys/useHotkeys.mjs.map +1 -1
- package/dist/esm/hooks/useHover/useHover.mjs +20 -22
- package/dist/esm/hooks/useHover/useHover.mjs.map +1 -1
- package/dist/esm/hooks/useIdle/useIdle.mjs.map +1 -1
- package/dist/esm/hooks/useImage/useImage.mjs.map +1 -1
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs +14 -14
- 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/useInterval/useInterval.mjs +8 -8
- package/dist/esm/hooks/useInterval/useInterval.mjs.map +1 -1
- package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.mjs.map +1 -1
- package/dist/esm/hooks/useKeyPress/useKeyPress.mjs +22 -24
- package/dist/esm/hooks/useKeyPress/useKeyPress.mjs.map +1 -1
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.mjs +23 -23
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.mjs.map +1 -1
- package/dist/esm/hooks/useKeyboard/useKeyboard.mjs +16 -22
- package/dist/esm/hooks/useKeyboard/useKeyboard.mjs.map +1 -1
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.mjs +20 -20
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.mjs.map +1 -1
- package/dist/esm/hooks/useLastChanged/useLastChanged.mjs +6 -6
- package/dist/esm/hooks/useLastChanged/useLastChanged.mjs.map +1 -1
- package/dist/esm/hooks/useLatest/useLatest.mjs +12 -4
- package/dist/esm/hooks/useLatest/useLatest.mjs.map +1 -1
- package/dist/esm/hooks/useLess/useLess.mjs.map +1 -1
- package/dist/esm/hooks/useList/useList.mjs.map +1 -1
- package/dist/esm/hooks/useLockCallback/useLockCallback.mjs.map +1 -1
- package/dist/esm/hooks/useLogger/useLogger.mjs.map +1 -1
- package/dist/esm/hooks/useLongPress/useLongPress.mjs +23 -27
- package/dist/esm/hooks/useLongPress/useLongPress.mjs.map +1 -1
- package/dist/esm/hooks/useMap/useMap.mjs.map +1 -1
- package/dist/esm/hooks/useMeasure/useMeasure.mjs.map +1 -1
- package/dist/esm/hooks/useMediaQuery/useMediaQuery.mjs.map +1 -1
- package/dist/esm/hooks/useMemory/useMemory.mjs +1 -1
- package/dist/esm/hooks/useMemory/useMemory.mjs.map +1 -1
- package/dist/esm/hooks/useMount/useMount.mjs.map +1 -1
- package/dist/esm/hooks/useMouse/useMouse.mjs.map +1 -1
- package/dist/esm/hooks/useMutation/useMutation.mjs +38 -42
- package/dist/esm/hooks/useMutation/useMutation.mjs.map +1 -1
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs +12 -12
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs.map +1 -1
- package/dist/esm/hooks/useNetwork/useNetwork.mjs +28 -28
- package/dist/esm/hooks/useNetwork/useNetwork.mjs.map +1 -1
- package/dist/esm/hooks/useOffsetPagination/useOffsetPagination.mjs.map +1 -1
- package/dist/esm/hooks/useOnce/useOnce.mjs.map +1 -1
- package/dist/esm/hooks/useOnline/useOnline.mjs.map +1 -1
- package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.mjs.map +1 -1
- package/dist/esm/hooks/useOptimistic/useOptimistic.mjs.map +1 -1
- package/dist/esm/hooks/useOrientation/useOrientation.mjs.map +1 -1
- package/dist/esm/hooks/useOtpCredential/useOtpCredential.mjs +12 -13
- package/dist/esm/hooks/useOtpCredential/useOtpCredential.mjs.map +1 -1
- package/dist/esm/hooks/usePageLeave/usePageLeave.mjs +6 -6
- package/dist/esm/hooks/usePageLeave/usePageLeave.mjs.map +1 -1
- package/dist/esm/hooks/usePaint/usePaint.mjs +87 -93
- package/dist/esm/hooks/usePaint/usePaint.mjs.map +1 -1
- package/dist/esm/hooks/useParallax/useParallax.mjs.map +1 -1
- package/dist/esm/hooks/usePerformanceObserver/usePerformanceObserver.mjs +17 -19
- package/dist/esm/hooks/usePerformanceObserver/usePerformanceObserver.mjs.map +1 -1
- package/dist/esm/hooks/usePermission/usePermission.mjs +13 -13
- package/dist/esm/hooks/usePermission/usePermission.mjs.map +1 -1
- package/dist/esm/hooks/usePointerLock/usePointerLock.mjs.map +1 -1
- package/dist/esm/hooks/usePostMessage/usePostMessage.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredContrast/usePreferredContrast.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredDark/usePreferredDark.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.mjs.map +1 -1
- package/dist/esm/hooks/usePrevious/usePrevious.mjs +4 -4
- package/dist/esm/hooks/usePrevious/usePrevious.mjs.map +1 -1
- package/dist/esm/hooks/useQuery/useQuery.mjs +39 -41
- package/dist/esm/hooks/useQuery/useQuery.mjs.map +1 -1
- package/dist/esm/hooks/useQueue/useQueue.mjs.map +1 -1
- package/dist/esm/hooks/useRaf/useRaf.mjs +21 -21
- package/dist/esm/hooks/useRaf/useRaf.mjs.map +1 -1
- package/dist/esm/hooks/useRafValue/useRafValue.mjs.map +1 -1
- package/dist/esm/hooks/useRefState/useRefState.mjs.map +1 -1
- package/dist/esm/hooks/useRenderCount/useRenderCount.mjs.map +1 -1
- package/dist/esm/hooks/useRenderInfo/useRenderInfo.mjs.map +1 -1
- package/dist/esm/hooks/useRerender/useRerender.mjs.map +1 -1
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs +16 -17
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs.map +1 -1
- package/dist/esm/hooks/useScreenOrientation/useScreenOrientation.mjs +11 -11
- package/dist/esm/hooks/useScreenOrientation/useScreenOrientation.mjs.map +1 -1
- package/dist/esm/hooks/useScript/useScript.mjs +16 -16
- package/dist/esm/hooks/useScript/useScript.mjs.map +1 -1
- package/dist/esm/hooks/useScroll/useScroll.mjs +37 -39
- package/dist/esm/hooks/useScroll/useScroll.mjs.map +1 -1
- package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.mjs.map +1 -1
- package/dist/esm/hooks/useScrollTo/useScrollTo.mjs.map +1 -1
- package/dist/esm/hooks/useSet/useSet.mjs.map +1 -1
- package/dist/esm/hooks/useShare/useShare.mjs.map +1 -1
- package/dist/esm/hooks/useSpeechRecognition/useSpeechRecognition.mjs +35 -35
- package/dist/esm/hooks/useSpeechRecognition/useSpeechRecognition.mjs.map +1 -1
- package/dist/esm/hooks/useSpeechSynthesis/useSpeechSynthesis.mjs +36 -42
- package/dist/esm/hooks/useSpeechSynthesis/useSpeechSynthesis.mjs.map +1 -1
- package/dist/esm/hooks/useStateHistory/useStateHistory.mjs.map +1 -1
- package/dist/esm/hooks/useStep/useStep.mjs.map +1 -1
- package/dist/esm/hooks/useSticky/useSticky.mjs +12 -12
- package/dist/esm/hooks/useSticky/useSticky.mjs.map +1 -1
- package/dist/esm/hooks/useStopwatch/useStopwatch.mjs +10 -11
- package/dist/esm/hooks/useStopwatch/useStopwatch.mjs.map +1 -1
- package/dist/esm/hooks/useStorage/useStorage.mjs +27 -27
- package/dist/esm/hooks/useStorage/useStorage.mjs.map +1 -1
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs +21 -24
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs.map +1 -1
- package/dist/esm/hooks/useTextSelection/useTextSelection.mjs +7 -7
- package/dist/esm/hooks/useTextSelection/useTextSelection.mjs.map +1 -1
- package/dist/esm/hooks/useThrottleCallback/useThrottleCallback.mjs.map +1 -1
- package/dist/esm/hooks/useThrottleValue/useThrottleValue.mjs.map +1 -1
- package/dist/esm/hooks/useTime/useTime.mjs.map +1 -1
- package/dist/esm/hooks/useTimeout/useTimeout.mjs.map +1 -1
- package/dist/esm/hooks/useTimer/useTimer.mjs +51 -54
- package/dist/esm/hooks/useTimer/useTimer.mjs.map +1 -1
- package/dist/esm/hooks/useToggle/useToggle.mjs.map +1 -1
- package/dist/esm/hooks/useUnmount/useUnmount.mjs.map +1 -1
- package/dist/esm/hooks/useUrlSearchParam/useUrlSearchParam.mjs +38 -38
- package/dist/esm/hooks/useUrlSearchParam/useUrlSearchParam.mjs.map +1 -1
- package/dist/esm/hooks/useUrlSearchParams/useUrlSearchParams.mjs +29 -29
- package/dist/esm/hooks/useUrlSearchParams/useUrlSearchParams.mjs.map +1 -1
- package/dist/esm/hooks/useVibrate/useVibrate.mjs.map +1 -1
- package/dist/esm/hooks/useWakeLock/useWakeLock.mjs +16 -16
- package/dist/esm/hooks/useWakeLock/useWakeLock.mjs.map +1 -1
- package/dist/esm/hooks/useWebSocket/useWebSocket.mjs +28 -38
- package/dist/esm/hooks/useWebSocket/useWebSocket.mjs.map +1 -1
- package/dist/esm/hooks/useWindowEvent/useWindowEvent.mjs.map +1 -1
- package/dist/esm/hooks/useWindowFocus/useWindowFocus.mjs.map +1 -1
- package/dist/esm/hooks/useWindowScroll/useWindowScroll.mjs.map +1 -1
- package/dist/esm/hooks/useWindowSize/useWindowSize.mjs +9 -9
- package/dist/esm/hooks/useWindowSize/useWindowSize.mjs.map +1 -1
- package/dist/esm/hooks/useWizard/useWizard.mjs +9 -11
- package/dist/esm/hooks/useWizard/useWizard.mjs.map +1 -1
- package/dist/esm/utils/helpers/copy.mjs.map +1 -1
- package/dist/esm/utils/helpers/debounce.mjs.map +1 -1
- package/dist/esm/utils/helpers/getDate.mjs.map +1 -1
- package/dist/esm/utils/helpers/getElement.mjs.map +1 -1
- package/dist/esm/utils/helpers/getRetry.mjs.map +1 -1
- package/dist/esm/utils/helpers/isTarget.mjs.map +1 -1
- package/dist/esm/utils/helpers/throttle.mjs.map +1 -1
- package/dist/types/hooks/useLatest/useLatest.d.ts +7 -2
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowEvent.mjs","sources":["../../../../src/hooks/useWindowEvent/useWindowEvent.ts"],"sourcesContent":["import { target } from '@/utils/helpers';\n\nimport type { UseEventListenerOptions } from '../useEventListener/useEventListener';\n\nimport { useEventListener } from '../useEventListener/useEventListener';\n\n/**\n * @name useWindowEvent\n * @description - Hook attaches an event listener to the window object for the specified event\n * @category Browser\n *\n * @template Event Key of window event map.\n * @param {Event} event The event to listen for.\n * @param {(event: WindowEventMap[Event]) => void} listener The callback function to be executed when the event is triggered\n * @param {UseEventListenerOptions} [options] The options for the event listener\n * @returns {void}\n *\n * @example\n * useWindowEvent('click', () => console.log('clicked'));\n */\nexport const useWindowEvent = <Event extends keyof WindowEventMap>(\n event: Event,\n listener: (this: Window, event: WindowEventMap[Event]) => any,\n options?: UseEventListenerOptions\n) => useEventListener(target(window), event, listener, options);\n"],"names":["useWindowEvent","event","listener","options","useEventListener","target"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"useWindowEvent.mjs","sources":["../../../../src/hooks/useWindowEvent/useWindowEvent.ts"],"sourcesContent":["import { target } from '@/utils/helpers';\n\nimport type { UseEventListenerOptions } from '../useEventListener/useEventListener';\n\nimport { useEventListener } from '../useEventListener/useEventListener';\n\n/**\n * @name useWindowEvent\n * @description - Hook attaches an event listener to the window object for the specified event\n * @category Browser\n *\n * @template Event Key of window event map.\n * @param {Event} event The event to listen for.\n * @param {(event: WindowEventMap[Event]) => void} listener The callback function to be executed when the event is triggered\n * @param {UseEventListenerOptions} [options] The options for the event listener\n * @returns {void}\n *\n * @example\n * useWindowEvent('click', () => console.log('clicked'));\n */\nexport const useWindowEvent = <Event extends keyof WindowEventMap>(\n event: Event,\n listener: (this: Window, event: WindowEventMap[Event]) => any,\n options?: UseEventListenerOptions\n) => useEventListener(target(window), event, listener, options);\n"],"names":["useWindowEvent","event","listener","options","useEventListener","target"],"mappings":";;AAoBO,MAAMA,IAAiB,CAC5BC,GACAC,GACAC,MACGC,EAAiBC,EAAO,MAAM,GAAGJ,GAAOC,GAAUC,CAAO;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowFocus.mjs","sources":["../../../../src/hooks/useWindowFocus/useWindowFocus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * @name useWindowFocus\n * @description - Hook that provides the current focus state of the window\n * @category Elements\n *\n * @returns {boolean} The current focus state of the window\n *\n * @example\n * const focused = useWindowFocus();\n *\n * @see {@link https://siberiacancode.github.io/reactuse/functions/hooks/useWindowFocus.html}\n */\nexport const useWindowFocus = () => {\n const [focused, setFocused] = useState(false);\n\n useEffect(() => {\n const onFocus = () => setFocused(true);\n const onBlur = () => setFocused(false);\n\n window.addEventListener('focus', onFocus);\n window.addEventListener('blur', onBlur);\n\n return () => {\n window.removeEventListener('focus', onFocus);\n window.removeEventListener('blur', onBlur);\n };\n });\n\n return focused;\n};\n"],"names":["useWindowFocus","focused","setFocused","useState","useEffect","onFocus","onBlur"],"mappings":";AAcO,MAAMA,IAAiB,MAAM;AAClC,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK;AAE5C,SAAAC,EAAU,MAAM;
|
|
1
|
+
{"version":3,"file":"useWindowFocus.mjs","sources":["../../../../src/hooks/useWindowFocus/useWindowFocus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * @name useWindowFocus\n * @description - Hook that provides the current focus state of the window\n * @category Elements\n *\n * @returns {boolean} The current focus state of the window\n *\n * @example\n * const focused = useWindowFocus();\n *\n * @see {@link https://siberiacancode.github.io/reactuse/functions/hooks/useWindowFocus.html}\n */\nexport const useWindowFocus = () => {\n const [focused, setFocused] = useState(false);\n\n useEffect(() => {\n const onFocus = () => setFocused(true);\n const onBlur = () => setFocused(false);\n\n window.addEventListener('focus', onFocus);\n window.addEventListener('blur', onBlur);\n\n return () => {\n window.removeEventListener('focus', onFocus);\n window.removeEventListener('blur', onBlur);\n };\n });\n\n return focused;\n};\n"],"names":["useWindowFocus","focused","setFocused","useState","useEffect","onFocus","onBlur"],"mappings":";AAcO,MAAMA,IAAiB,MAAM;AAClC,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK;AAE5C,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAU,MAAMH,EAAW,EAAI,GAC/BI,IAAS,MAAMJ,EAAW,EAAK;AAErC,kBAAO,iBAAiB,SAASG,CAAO,GACxC,OAAO,iBAAiB,QAAQC,CAAM,GAE/B,MAAM;AACX,aAAO,oBAAoB,SAASD,CAAO,GAC3C,OAAO,oBAAoB,QAAQC,CAAM;AAAA,IAAA;AAAA,EAC3C,CACD,GAEML;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowScroll.mjs","sources":["../../../../src/hooks/useWindowScroll/useWindowScroll.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport interface ScrollPosition {\n x: number;\n y: number;\n}\n\nexport const scrollTo = ({\n x,\n y,\n behavior = 'smooth'\n}: Partial<ScrollPosition & ScrollOptions>) => {\n const scrollOptions: ScrollToOptions = { behavior };\n if (typeof x === 'number') scrollOptions.left = x;\n if (typeof y === 'number') scrollOptions.top = y;\n window.scrollTo(scrollOptions);\n};\n\n/**\n * @name useWindowScroll\n * @description - Hook that manages the window scroll position\n * @category Browser\n *\n * @returns {UseWindowScrollReturn} An object containing the current window scroll position\n *\n * @example\n * const { value, scrollTo } = useWindowScroll();\n */\nexport const useWindowScroll = () => {\n const [value, setValue] = useState<ScrollPosition>({\n x: typeof window !== 'undefined' ? window.scrollX : Number.POSITIVE_INFINITY,\n y: typeof window !== 'undefined' ? window.scrollY : Number.POSITIVE_INFINITY\n });\n\n useEffect(() => {\n const onChange = () => setValue({ x: window.scrollX, y: window.scrollY });\n window.addEventListener('scroll', onChange);\n window.addEventListener('resize', onChange);\n return () => {\n window.removeEventListener('scroll', onChange);\n window.removeEventListener('resize', onChange);\n };\n }, []);\n\n return { value, scrollTo };\n};\n"],"names":["scrollTo","x","y","behavior","scrollOptions","useWindowScroll","value","setValue","useState","useEffect","onChange"],"mappings":";AAOO,MAAMA,IAAW,CAAC;AAAA,EACvB,GAAAC;AAAA,EACA,GAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MAA+C;
|
|
1
|
+
{"version":3,"file":"useWindowScroll.mjs","sources":["../../../../src/hooks/useWindowScroll/useWindowScroll.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport interface ScrollPosition {\n x: number;\n y: number;\n}\n\nexport const scrollTo = ({\n x,\n y,\n behavior = 'smooth'\n}: Partial<ScrollPosition & ScrollOptions>) => {\n const scrollOptions: ScrollToOptions = { behavior };\n if (typeof x === 'number') scrollOptions.left = x;\n if (typeof y === 'number') scrollOptions.top = y;\n window.scrollTo(scrollOptions);\n};\n\n/**\n * @name useWindowScroll\n * @description - Hook that manages the window scroll position\n * @category Browser\n *\n * @returns {UseWindowScrollReturn} An object containing the current window scroll position\n *\n * @example\n * const { value, scrollTo } = useWindowScroll();\n */\nexport const useWindowScroll = () => {\n const [value, setValue] = useState<ScrollPosition>({\n x: typeof window !== 'undefined' ? window.scrollX : Number.POSITIVE_INFINITY,\n y: typeof window !== 'undefined' ? window.scrollY : Number.POSITIVE_INFINITY\n });\n\n useEffect(() => {\n const onChange = () => setValue({ x: window.scrollX, y: window.scrollY });\n window.addEventListener('scroll', onChange);\n window.addEventListener('resize', onChange);\n return () => {\n window.removeEventListener('scroll', onChange);\n window.removeEventListener('resize', onChange);\n };\n }, []);\n\n return { value, scrollTo };\n};\n"],"names":["scrollTo","x","y","behavior","scrollOptions","useWindowScroll","value","setValue","useState","useEffect","onChange"],"mappings":";AAOO,MAAMA,IAAW,CAAC;AAAA,EACvB,GAAAC;AAAA,EACA,GAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MAA+C;AAC7C,QAAMC,IAAiC,EAAE,UAAAD,EAAA;AACzC,EAAI,OAAOF,KAAM,aAAUG,EAAc,OAAOH,IAC5C,OAAOC,KAAM,aAAUE,EAAc,MAAMF,IAC/C,OAAO,SAASE,CAAa;AAC/B,GAYaC,IAAkB,MAAM;AACnC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAyB;AAAA,IACjD,GAAG,OAAO,SAAW,MAAc,OAAO,UAAU,OAAO;AAAA,IAC3D,GAAG,OAAO,SAAW,MAAc,OAAO,UAAU,OAAO;AAAA,EAAA,CAC5D;AAED,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAW,MAAMH,EAAS,EAAE,GAAG,OAAO,SAAS,GAAG,OAAO,SAAS;AACxE,kBAAO,iBAAiB,UAAUG,CAAQ,GAC1C,OAAO,iBAAiB,UAAUA,CAAQ,GACnC,MAAM;AACX,aAAO,oBAAoB,UAAUA,CAAQ,GAC7C,OAAO,oBAAoB,UAAUA,CAAQ;AAAA,IAAA;AAAA,EAC/C,GACC,EAAE,GAEE,EAAE,OAAAJ,GAAO,UAAAN,EAAA;AAClB;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { useState as o, useEffect as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
import { useState as o, useEffect as r } from "react";
|
|
2
|
+
const c = (n) => {
|
|
3
|
+
const e = n?.includeScrollbar ?? !0, [d, t] = o(() => typeof window > "u" ? {
|
|
4
4
|
width: Number.POSITIVE_INFINITY,
|
|
5
5
|
height: Number.POSITIVE_INFINITY
|
|
6
6
|
} : {
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
7
|
+
width: e ? window.innerWidth : window.document.documentElement.clientWidth,
|
|
8
|
+
height: e ? window.innerHeight : window.document.documentElement.clientHeight
|
|
9
9
|
});
|
|
10
|
-
return
|
|
10
|
+
return r(() => {
|
|
11
11
|
const i = () => {
|
|
12
|
-
t(
|
|
12
|
+
t(e ? {
|
|
13
13
|
width: window.innerWidth,
|
|
14
14
|
height: window.innerHeight
|
|
15
15
|
} : {
|
|
@@ -20,9 +20,9 @@ const u = (e) => {
|
|
|
20
20
|
return window.addEventListener("resize", i), () => {
|
|
21
21
|
window.removeEventListener("resize", i);
|
|
22
22
|
};
|
|
23
|
-
}, [
|
|
23
|
+
}, [n?.includeScrollbar]), d;
|
|
24
24
|
};
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
c as useWindowSize
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=useWindowSize.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowSize.mjs","sources":["../../../../src/hooks/useWindowSize/useWindowSize.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/** The use window size return type */\ninterface UseWindowSizeParams {\n /** Whether to include the scrollbar in the window size calculation */\n includeScrollbar?: boolean;\n}\n\n/** The use window size return type */\nexport interface UseWindowSizeReturn {\n /** The current window height */\n height: number;\n /** The current window width */\n width: number;\n}\n\n/**\n * @name useWindowSize\n * @description - Hook that manages a window size\n * @category Elements\n *\n * @param {number} [params.initialWidth=Number.POSITIVE_INFINITY] The initial window width\n * @param {number} [params.initialHeight=Number.POSITIVE_INFINITY] The initial window height\n * @returns {UseWindowSizeReturn} An object containing the current window width and height\n *\n * @example\n * const { width, height } = useWindowSize();\n */\nexport const useWindowSize = (params?: UseWindowSizeParams) => {\n const includeScrollbar = params?.includeScrollbar ?? true;\n const [size, setSize] = useState(() => {\n if (typeof window === 'undefined') {\n return {\n width: Number.POSITIVE_INFINITY,\n height: Number.POSITIVE_INFINITY\n };\n }\n\n return {\n width: includeScrollbar ? window.innerWidth : window.document.documentElement.clientWidth,\n height: includeScrollbar ? window.innerHeight : window.document.documentElement.clientHeight\n };\n });\n\n useEffect(() => {\n const onResize = () => {\n if (includeScrollbar) {\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n } else {\n setSize({\n width: window.document.documentElement.clientWidth,\n height: window.document.documentElement.clientHeight\n });\n }\n };\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [params?.includeScrollbar]);\n\n return size;\n};\n"],"names":["useWindowSize","params","includeScrollbar","size","setSize","useState","useEffect","onResize"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useWindowSize.mjs","sources":["../../../../src/hooks/useWindowSize/useWindowSize.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/** The use window size return type */\ninterface UseWindowSizeParams {\n /** Whether to include the scrollbar in the window size calculation */\n includeScrollbar?: boolean;\n}\n\n/** The use window size return type */\nexport interface UseWindowSizeReturn {\n /** The current window height */\n height: number;\n /** The current window width */\n width: number;\n}\n\n/**\n * @name useWindowSize\n * @description - Hook that manages a window size\n * @category Elements\n *\n * @param {number} [params.initialWidth=Number.POSITIVE_INFINITY] The initial window width\n * @param {number} [params.initialHeight=Number.POSITIVE_INFINITY] The initial window height\n * @returns {UseWindowSizeReturn} An object containing the current window width and height\n *\n * @example\n * const { width, height } = useWindowSize();\n */\nexport const useWindowSize = (params?: UseWindowSizeParams) => {\n const includeScrollbar = params?.includeScrollbar ?? true;\n const [size, setSize] = useState(() => {\n if (typeof window === 'undefined') {\n return {\n width: Number.POSITIVE_INFINITY,\n height: Number.POSITIVE_INFINITY\n };\n }\n\n return {\n width: includeScrollbar ? window.innerWidth : window.document.documentElement.clientWidth,\n height: includeScrollbar ? window.innerHeight : window.document.documentElement.clientHeight\n };\n });\n\n useEffect(() => {\n const onResize = () => {\n if (includeScrollbar) {\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n } else {\n setSize({\n width: window.document.documentElement.clientWidth,\n height: window.document.documentElement.clientHeight\n });\n }\n };\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [params?.includeScrollbar]);\n\n return size;\n};\n"],"names":["useWindowSize","params","includeScrollbar","size","setSize","useState","useEffect","onResize"],"mappings":";AA4BO,MAAMA,IAAgB,CAACC,MAAiC;AAC7D,QAAMC,IAAmBD,GAAQ,oBAAoB,IAC/C,CAACE,GAAMC,CAAO,IAAIC,EAAS,MAC3B,OAAO,SAAW,MACb;AAAA,IACL,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,EAAA,IAIZ;AAAA,IACL,OAAOH,IAAmB,OAAO,aAAa,OAAO,SAAS,gBAAgB;AAAA,IAC9E,QAAQA,IAAmB,OAAO,cAAc,OAAO,SAAS,gBAAgB;AAAA,EAAA,CAEnF;AAED,SAAAI,EAAU,MAAM;AACd,UAAMC,IAAW,MAAM;AACrB,MACEH,EADEF,IACM;AAAA,QACN,OAAO,OAAO;AAAA,QACd,QAAQ,OAAO;AAAA,MAAA,IAGT;AAAA,QACN,OAAO,OAAO,SAAS,gBAAgB;AAAA,QACvC,QAAQ,OAAO,SAAS,gBAAgB;AAAA,MAAA,CAJzC;AAAA,IAMH;AAGF,kBAAO,iBAAiB,UAAUK,CAAQ,GACnC,MAAM;AACX,aAAO,oBAAoB,UAAUA,CAAQ;AAAA,IAAA;AAAA,EAC/C,GACC,CAACN,GAAQ,gBAAgB,CAAC,GAEtBE;AACT;"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
import { useState as a } from "react";
|
|
2
|
+
const f = (c, u) => {
|
|
3
|
+
const r = u ?? c[0].id, i = new Map(c.map((t) => [t.id, t])), [o, n] = a(r), [e, s] = a([r]);
|
|
4
4
|
return { currentStepId: o, set: (t) => {
|
|
5
|
-
|
|
6
|
-
if (!((n = (r = u.get(o)) == null ? void 0 : r.nodes) != null && n.includes(t)))
|
|
5
|
+
if (!i.get(o)?.nodes?.includes(t))
|
|
7
6
|
throw new Error(`Can't go to ${t} from ${o}`);
|
|
8
|
-
|
|
7
|
+
s([...e, t]), n(t);
|
|
9
8
|
}, reset: () => {
|
|
10
|
-
|
|
9
|
+
n(r), s([r]);
|
|
11
10
|
}, back: () => {
|
|
12
|
-
var r, n;
|
|
13
11
|
if (e.length === 1) return;
|
|
14
12
|
const t = e[e.length - 2];
|
|
15
|
-
if (!
|
|
13
|
+
if (!i.get(o)?.nodes?.includes(t))
|
|
16
14
|
throw new Error(`Can't go to ${t} from ${o}`);
|
|
17
|
-
|
|
15
|
+
s(e.slice(0, -1)), n(e[e.length - 2]);
|
|
18
16
|
}, history: e };
|
|
19
17
|
};
|
|
20
18
|
export {
|
|
21
|
-
|
|
19
|
+
f as useWizard
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=useWizard.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizard.mjs","sources":["../../../../src/hooks/useWizard/useWizard.ts"],"sourcesContent":["import { useState } from 'react';\n\nexport interface WizardItem<WizardStepId> {\n id: WizardStepId;\n nodes?: WizardStepId[];\n}\n\n/**\n * @name useWizard\n * @description - Hook that manages a wizard\n * @category Utilities\n *\n * @param {WizardItem<WizardStepId>[]} map The map of the wizard\n * @param {WizardStepId} [initialStepId] The initial step id\n * @returns {UseWizardReturn<WizardStepId>} An object containing the current step id and functions to interact with the wizard\n *\n * @example\n * const { currentStepId, set, reset, back, history } = useWizard([\n * { id: 'step1', nodes: ['step2', 'step3'] },\n * { id: 'step2', nodes: ['step3'] },\n * { id: 'step3', nodes: [] },\n * ])\n */\nexport const useWizard = <WizardStepId extends string>(\n map: WizardItem<WizardStepId>[],\n initialStepId?: WizardStepId\n) => {\n const initialId = initialStepId ?? map[0].id;\n const wizardMap = new Map(map.map((wizardItem) => [wizardItem.id, wizardItem]));\n const [currentStepId, setCurrentStepId] = useState(initialId);\n const [history, setHistory] = useState<WizardStepId[]>([initialId]);\n\n const set = (id: WizardStepId) => {\n if (!wizardMap.get(currentStepId)?.nodes?.includes(id))\n throw new Error(`Can't go to ${id} from ${currentStepId}`);\n\n setHistory([...history, id]);\n setCurrentStepId(id);\n };\n\n const back = () => {\n if (history.length === 1) return;\n\n const previousStepId = history[history.length - 2];\n if (!wizardMap.get(currentStepId)?.nodes?.includes(previousStepId))\n throw new Error(`Can't go to ${previousStepId} from ${currentStepId}`);\n\n setHistory(history.slice(0, -1));\n setCurrentStepId(history[history.length - 2]);\n };\n\n const reset = () => {\n setCurrentStepId(initialId);\n setHistory([initialId]);\n };\n\n return { currentStepId, set, reset, back, history };\n};\n"],"names":["useWizard","map","initialStepId","initialId","wizardMap","wizardItem","currentStepId","setCurrentStepId","useState","history","setHistory","id","
|
|
1
|
+
{"version":3,"file":"useWizard.mjs","sources":["../../../../src/hooks/useWizard/useWizard.ts"],"sourcesContent":["import { useState } from 'react';\n\nexport interface WizardItem<WizardStepId> {\n id: WizardStepId;\n nodes?: WizardStepId[];\n}\n\n/**\n * @name useWizard\n * @description - Hook that manages a wizard\n * @category Utilities\n *\n * @param {WizardItem<WizardStepId>[]} map The map of the wizard\n * @param {WizardStepId} [initialStepId] The initial step id\n * @returns {UseWizardReturn<WizardStepId>} An object containing the current step id and functions to interact with the wizard\n *\n * @example\n * const { currentStepId, set, reset, back, history } = useWizard([\n * { id: 'step1', nodes: ['step2', 'step3'] },\n * { id: 'step2', nodes: ['step3'] },\n * { id: 'step3', nodes: [] },\n * ])\n */\nexport const useWizard = <WizardStepId extends string>(\n map: WizardItem<WizardStepId>[],\n initialStepId?: WizardStepId\n) => {\n const initialId = initialStepId ?? map[0].id;\n const wizardMap = new Map(map.map((wizardItem) => [wizardItem.id, wizardItem]));\n const [currentStepId, setCurrentStepId] = useState(initialId);\n const [history, setHistory] = useState<WizardStepId[]>([initialId]);\n\n const set = (id: WizardStepId) => {\n if (!wizardMap.get(currentStepId)?.nodes?.includes(id))\n throw new Error(`Can't go to ${id} from ${currentStepId}`);\n\n setHistory([...history, id]);\n setCurrentStepId(id);\n };\n\n const back = () => {\n if (history.length === 1) return;\n\n const previousStepId = history[history.length - 2];\n if (!wizardMap.get(currentStepId)?.nodes?.includes(previousStepId))\n throw new Error(`Can't go to ${previousStepId} from ${currentStepId}`);\n\n setHistory(history.slice(0, -1));\n setCurrentStepId(history[history.length - 2]);\n };\n\n const reset = () => {\n setCurrentStepId(initialId);\n setHistory([initialId]);\n };\n\n return { currentStepId, set, reset, back, history };\n};\n"],"names":["useWizard","map","initialStepId","initialId","wizardMap","wizardItem","currentStepId","setCurrentStepId","useState","history","setHistory","id","previousStepId"],"mappings":";AAuBO,MAAMA,IAAY,CACvBC,GACAC,MACG;AACH,QAAMC,IAAYD,KAAiBD,EAAI,CAAC,EAAE,IACpCG,IAAY,IAAI,IAAIH,EAAI,IAAI,CAACI,MAAe,CAACA,EAAW,IAAIA,CAAU,CAAC,CAAC,GACxE,CAACC,GAAeC,CAAgB,IAAIC,EAASL,CAAS,GACtD,CAACM,GAASC,CAAU,IAAIF,EAAyB,CAACL,CAAS,CAAC;AA0BlE,SAAO,EAAE,eAAAG,GAAe,KAxBZ,CAACK,MAAqB;AAChC,QAAI,CAACP,EAAU,IAAIE,CAAa,GAAG,OAAO,SAASK,CAAE;AACnD,YAAM,IAAI,MAAM,eAAeA,CAAE,SAASL,CAAa,EAAE;AAE3D,IAAAI,EAAW,CAAC,GAAGD,GAASE,CAAE,CAAC,GAC3BJ,EAAiBI,CAAE;AAAA,EAAA,GAmBQ,OALf,MAAM;AAClB,IAAAJ,EAAiBJ,CAAS,GAC1BO,EAAW,CAACP,CAAS,CAAC;AAAA,EAAA,GAGY,MAhBvB,MAAM;AACjB,QAAIM,EAAQ,WAAW,EAAG;AAE1B,UAAMG,IAAiBH,EAAQA,EAAQ,SAAS,CAAC;AACjD,QAAI,CAACL,EAAU,IAAIE,CAAa,GAAG,OAAO,SAASM,CAAc;AAC/D,YAAM,IAAI,MAAM,eAAeA,CAAc,SAASN,CAAa,EAAE;AAEvE,IAAAI,EAAWD,EAAQ,MAAM,GAAG,EAAE,CAAC,GAC/BF,EAAiBE,EAAQA,EAAQ,SAAS,CAAC,CAAC;AAAA,EAAA,GAQJ,SAAAA,EAAA;AAC5C;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.mjs","sources":["../../../../src/utils/helpers/copy.ts"],"sourcesContent":["export const legacyCopyToClipboard = (value: string) => {\n const tempTextArea = document.createElement('textarea');\n tempTextArea.value = value;\n tempTextArea.readOnly = true;\n tempTextArea.style.fontSize = '16px';\n document.body.appendChild(tempTextArea);\n tempTextArea.select();\n document.execCommand('copy');\n document.body.removeChild(tempTextArea);\n};\n\nexport const copy = async (value: string) => {\n try {\n try {\n await navigator.clipboard.writeText(value);\n } catch {\n return legacyCopyToClipboard(value);\n }\n } catch {\n return legacyCopyToClipboard(value);\n }\n};\n"],"names":["legacyCopyToClipboard","value","tempTextArea","copy"],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy.mjs","sources":["../../../../src/utils/helpers/copy.ts"],"sourcesContent":["export const legacyCopyToClipboard = (value: string) => {\n const tempTextArea = document.createElement('textarea');\n tempTextArea.value = value;\n tempTextArea.readOnly = true;\n tempTextArea.style.fontSize = '16px';\n document.body.appendChild(tempTextArea);\n tempTextArea.select();\n document.execCommand('copy');\n document.body.removeChild(tempTextArea);\n};\n\nexport const copy = async (value: string) => {\n try {\n try {\n await navigator.clipboard.writeText(value);\n } catch {\n return legacyCopyToClipboard(value);\n }\n } catch {\n return legacyCopyToClipboard(value);\n }\n};\n"],"names":["legacyCopyToClipboard","value","tempTextArea","copy"],"mappings":"AAAO,MAAMA,IAAwB,CAACC,MAAkB;AACtD,QAAMC,IAAe,SAAS,cAAc,UAAU;AACtD,EAAAA,EAAa,QAAQD,GACrBC,EAAa,WAAW,IACxBA,EAAa,MAAM,WAAW,QAC9B,SAAS,KAAK,YAAYA,CAAY,GACtCA,EAAa,OAAA,GACb,SAAS,YAAY,MAAM,GAC3B,SAAS,KAAK,YAAYA,CAAY;AACxC,GAEaC,IAAO,OAAOF,MAAkB;AAC3C,MAAI;AACF,QAAI;AACF,YAAM,UAAU,UAAU,UAAUA,CAAK;AAAA,IAAA,QACnC;AACN,aAAOD,EAAsBC,CAAK;AAAA,IAAA;AAAA,EACpC,QACM;AACN,WAAOD,EAAsBC,CAAK;AAAA,EAAA;AAEtC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.mjs","sources":["../../../../src/utils/helpers/debounce.ts"],"sourcesContent":["export function debounce<Params extends unknown[]>(\n callback: (...args: Params) => void,\n delay: number\n): (...args: Params) => void {\n let timer: ReturnType<typeof setTimeout>;\n\n return function (this: any, ...args: Params) {\n clearTimeout(timer);\n timer = setTimeout(() => callback.apply(this, args), delay);\n };\n}\n"],"names":["debounce","callback","delay","timer","args"],"mappings":"
|
|
1
|
+
{"version":3,"file":"debounce.mjs","sources":["../../../../src/utils/helpers/debounce.ts"],"sourcesContent":["export function debounce<Params extends unknown[]>(\n callback: (...args: Params) => void,\n delay: number\n): (...args: Params) => void {\n let timer: ReturnType<typeof setTimeout>;\n\n return function (this: any, ...args: Params) {\n clearTimeout(timer);\n timer = setTimeout(() => callback.apply(this, args), delay);\n };\n}\n"],"names":["debounce","callback","delay","timer","args"],"mappings":"AAAO,SAASA,EACdC,GACAC,GAC2B;AAC3B,MAAIC;AAEJ,SAAO,YAAwBC,GAAc;AAC3C,iBAAaD,CAAK,GAClBA,IAAQ,WAAW,MAAMF,EAAS,MAAM,MAAMG,CAAI,GAAGF,CAAK;AAAA,EAAA;AAE9D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDate.mjs","sources":["../../../../src/utils/helpers/getDate.ts"],"sourcesContent":["export const getDate = (now: Date = new Date()) => {\n const seconds = now.getSeconds();\n const minutes = now.getMinutes();\n const hours = now.getHours();\n const meridiemHours = hours % 12 === 0 ? 12 : hours % 12;\n const meridiemType = hours >= 12 ? 'pm' : 'am';\n const day = now.getDate();\n const month = now.getMonth() + 1;\n const year = now.getFullYear();\n const timestamp = now.getTime();\n\n return {\n seconds,\n minutes,\n hours,\n meridiemHours: { value: meridiemHours, type: meridiemType },\n day,\n month,\n year,\n timestamp\n };\n};\n"],"names":["getDate","now","seconds","minutes","hours","meridiemHours","meridiemType","day","month","year","timestamp"],"mappings":"AAAO,MAAMA,IAAU,CAACC,IAAY,oBAAI,WAAW;
|
|
1
|
+
{"version":3,"file":"getDate.mjs","sources":["../../../../src/utils/helpers/getDate.ts"],"sourcesContent":["export const getDate = (now: Date = new Date()) => {\n const seconds = now.getSeconds();\n const minutes = now.getMinutes();\n const hours = now.getHours();\n const meridiemHours = hours % 12 === 0 ? 12 : hours % 12;\n const meridiemType = hours >= 12 ? 'pm' : 'am';\n const day = now.getDate();\n const month = now.getMonth() + 1;\n const year = now.getFullYear();\n const timestamp = now.getTime();\n\n return {\n seconds,\n minutes,\n hours,\n meridiemHours: { value: meridiemHours, type: meridiemType },\n day,\n month,\n year,\n timestamp\n };\n};\n"],"names":["getDate","now","seconds","minutes","hours","meridiemHours","meridiemType","day","month","year","timestamp"],"mappings":"AAAO,MAAMA,IAAU,CAACC,IAAY,oBAAI,WAAW;AACjD,QAAMC,IAAUD,EAAI,WAAA,GACdE,IAAUF,EAAI,WAAA,GACdG,IAAQH,EAAI,SAAA,GACZI,IAAgBD,IAAQ,OAAO,IAAI,KAAKA,IAAQ,IAChDE,IAAeF,KAAS,KAAK,OAAO,MACpCG,IAAMN,EAAI,QAAA,GACVO,IAAQP,EAAI,SAAA,IAAa,GACzBQ,IAAOR,EAAI,YAAA,GACXS,IAAYT,EAAI,QAAA;AAEtB,SAAO;AAAA,IACL,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAe,EAAE,OAAOC,GAAe,MAAMC,EAAA;AAAA,IAC7C,KAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,EAAA;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRetry.mjs","sources":["../../../../src/utils/helpers/getRetry.ts"],"sourcesContent":["export const getRetry = (retry: boolean | number) => {\n if (typeof retry === 'number') return retry;\n return retry ? 1 : 0;\n};\n"],"names":["getRetry","retry"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getRetry.mjs","sources":["../../../../src/utils/helpers/getRetry.ts"],"sourcesContent":["export const getRetry = (retry: boolean | number) => {\n if (typeof retry === 'number') return retry;\n return retry ? 1 : 0;\n};\n"],"names":["getRetry","retry"],"mappings":"AAAO,MAAMA,IAAW,CAACC,MACnB,OAAOA,KAAU,WAAiBA,IAC/BA,IAAQ,IAAI;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTarget.mjs","sources":["../../../../src/utils/helpers/isTarget.ts"],"sourcesContent":["import type { HookTarget } from './getElement';\n\nimport { targetSymbol } from './getElement';\n\nexport const isTarget = (target: HookTarget) =>\n typeof target === 'object' && ('current' in target || target.type === targetSymbol);\n"],"names":["isTarget","target","targetSymbol"],"mappings":";
|
|
1
|
+
{"version":3,"file":"isTarget.mjs","sources":["../../../../src/utils/helpers/isTarget.ts"],"sourcesContent":["import type { HookTarget } from './getElement';\n\nimport { targetSymbol } from './getElement';\n\nexport const isTarget = (target: HookTarget) =>\n typeof target === 'object' && ('current' in target || target.type === targetSymbol);\n"],"names":["isTarget","target","targetSymbol"],"mappings":";AAIO,MAAMA,IAAW,CAACC,MACvB,OAAOA,KAAW,aAAa,aAAaA,KAAUA,EAAO,SAASC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttle.mjs","sources":["../../../../src/utils/helpers/throttle.ts"],"sourcesContent":["export const throttle = <Params extends any[]>(\n callback: (...args: Params) => void,\n delay: number\n): ((...args: Params) => void) => {\n let isCalled = false;\n let lastArgs: Params | null = null;\n\n const timer = () => {\n if (!lastArgs) {\n isCalled = false;\n return;\n }\n\n callback.apply(this, lastArgs);\n lastArgs = null;\n setTimeout(timer, delay);\n };\n\n return function (this: any, ...args: Params) {\n if (isCalled) {\n lastArgs = args;\n return;\n }\n\n callback.apply(this, args);\n isCalled = true;\n setTimeout(timer, delay);\n };\n};\n"],"names":["throttle","callback","delay","isCalled","lastArgs","timer","args"],"mappings":"
|
|
1
|
+
{"version":3,"file":"throttle.mjs","sources":["../../../../src/utils/helpers/throttle.ts"],"sourcesContent":["export const throttle = <Params extends any[]>(\n callback: (...args: Params) => void,\n delay: number\n): ((...args: Params) => void) => {\n let isCalled = false;\n let lastArgs: Params | null = null;\n\n const timer = () => {\n if (!lastArgs) {\n isCalled = false;\n return;\n }\n\n callback.apply(this, lastArgs);\n lastArgs = null;\n setTimeout(timer, delay);\n };\n\n return function (this: any, ...args: Params) {\n if (isCalled) {\n lastArgs = args;\n return;\n }\n\n callback.apply(this, args);\n isCalled = true;\n setTimeout(timer, delay);\n };\n};\n"],"names":["throttle","callback","delay","isCalled","lastArgs","timer","args"],"mappings":"AAAO,MAAMA,IAAW,CACtBC,GACAC,MACgC;AAChC,MAAIC,IAAW,IACXC,IAA0B;AAE9B,QAAMC,IAAQ,MAAM;AAClB,QAAI,CAACD,GAAU;AACb,MAAAD,IAAW;AACX;AAAA,IAAA;AAGF,IAAAF,EAAS,MAAM,QAAMG,CAAQ,GAC7BA,IAAW,MACX,WAAWC,GAAOH,CAAK;AAAA,EAAA;AAGzB,SAAO,YAAwBI,GAAc;AAC3C,QAAIH,GAAU;AACZ,MAAAC,IAAWE;AACX;AAAA,IAAA;AAGF,IAAAL,EAAS,MAAM,MAAMK,CAAI,GACzBH,IAAW,IACX,WAAWE,GAAOH,CAAK;AAAA,EAAA;AAE3B;"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export interface UseLatestReturn<Value> {
|
|
3
|
+
ref: RefObject<Value>;
|
|
4
|
+
value: Value;
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* @name useLatest
|
|
3
8
|
* @description - Hook that returns the stable reference of the value
|
|
@@ -5,9 +10,9 @@
|
|
|
5
10
|
*
|
|
6
11
|
* @template Value The type of the value
|
|
7
12
|
* @param {Value} value The value to get the previous value
|
|
8
|
-
* @returns {Value} The previous value
|
|
13
|
+
* @returns {UseLatestReturn<Value>} The previous value
|
|
9
14
|
*
|
|
10
15
|
* @example
|
|
11
16
|
* const latestValue = useLatest(value);
|
|
12
17
|
*/
|
|
13
|
-
export declare const useLatest: <Value>(value: Value) => Value
|
|
18
|
+
export declare const useLatest: <Value>(value: Value) => UseLatestReturn<Value>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siberiacancode/reactuse",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "The ultimate collection of react hooks",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SIBERIA CAN CODE 🧊",
|
|
@@ -68,17 +68,17 @@
|
|
|
68
68
|
"@testing-library/dom": "^10.4.0",
|
|
69
69
|
"@testing-library/react": "^16.3.0",
|
|
70
70
|
"@types/dom-speech-recognition": "^0.0.6",
|
|
71
|
-
"@types/react": "^19.1.
|
|
71
|
+
"@types/react": "^19.1.8",
|
|
72
72
|
"@types/react-dom": "^19.1.6",
|
|
73
73
|
"@types/web-bluetooth": "^0.0.21",
|
|
74
|
-
"@vitejs/plugin-react": "^4.
|
|
74
|
+
"@vitejs/plugin-react": "^4.6.0",
|
|
75
75
|
"core-js": "^3.43.0",
|
|
76
76
|
"react": "^19.1.0",
|
|
77
77
|
"react-dom": "^19.1.0",
|
|
78
78
|
"shx": "^0.4.0",
|
|
79
|
-
"vite": "^
|
|
79
|
+
"vite": "^7.0.0",
|
|
80
80
|
"vite-plugin-dts": "^4.5.4",
|
|
81
|
-
"vitest": "^3.2.
|
|
81
|
+
"vitest": "^3.2.4"
|
|
82
82
|
},
|
|
83
83
|
"lint-staged": {
|
|
84
84
|
"*.{js,ts,tsx}": [
|