@siberiacancode/reactuse 0.0.90 → 0.0.93
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/README.md +1 -1
- package/dist/cjs/{_rollupPluginBabelHelpers-BsWog5nG.js → _rollupPluginBabelHelpers-CuUcoGqg.js} +3 -3
- package/dist/cjs/_rollupPluginBabelHelpers-CuUcoGqg.js.map +1 -0
- package/dist/cjs/hooks/index.js +2 -2
- package/dist/cjs/hooks/useActiveElement/useActiveElement.js +2 -2
- package/dist/cjs/hooks/useAsync/useAsync.js +2 -2
- package/dist/cjs/hooks/useBattery/useBattery.js +2 -2
- package/dist/cjs/hooks/useBattery/useBattery.js.map +1 -1
- package/dist/cjs/hooks/useBluetooth/useBluetooth.js +2 -2
- package/dist/cjs/hooks/useBoolean/useBoolean.js +2 -2
- package/dist/cjs/hooks/useBreakpoints/constants/breakpoints.js +1 -1
- package/dist/cjs/hooks/useBreakpoints/useBreakpoints.js +2 -2
- package/dist/cjs/hooks/useBreakpoints/useBreakpoints.js.map +1 -1
- package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.js +2 -2
- package/dist/cjs/hooks/useClickOutside/useClickOutside.js.map +1 -1
- package/dist/cjs/hooks/useClipboard/useClipboard.js +2 -2
- package/dist/cjs/hooks/useConst/useConst.js +1 -1
- package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
- package/dist/cjs/hooks/useCssVar/useCssVar.js +2 -2
- package/dist/cjs/hooks/useCssVar/useCssVar.js.map +1 -1
- package/dist/cjs/hooks/useDebounceCallback/useDebounceCallback.js +2 -2
- package/dist/cjs/hooks/useDebounceCallback/useDebounceCallback.js.map +1 -1
- package/dist/cjs/hooks/useDebounceValue/useDebounceValue.js +2 -2
- package/dist/cjs/hooks/useDebounceValue/useDebounceValue.js.map +1 -1
- package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
- package/dist/cjs/hooks/useDeviceMotion/useDeviceMotion.js +2 -2
- package/dist/cjs/hooks/useDeviceMotion/useDeviceMotion.js.map +1 -1
- package/dist/cjs/hooks/useDeviceOrientation/useDeviceOrientation.js +2 -2
- package/dist/cjs/hooks/useDevicePixelRatio/useDevicePixelRatio.js +2 -2
- package/dist/cjs/hooks/useDevicePixelRatio/useDevicePixelRatio.js.map +1 -1
- package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +2 -2
- package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js.map +1 -1
- package/dist/cjs/hooks/useDisclosure/useDisclosure.js +2 -2
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.js +3 -0
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.js.map +1 -0
- package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +2 -2
- package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js.map +1 -1
- package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
- package/dist/cjs/hooks/useElementSize/useElementSize.js +2 -2
- package/dist/cjs/hooks/useElementSize/useElementSize.js.map +1 -1
- package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.js +2 -2
- package/dist/cjs/hooks/useEventListener/useEventListener.js.map +1 -1
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
- package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
- package/dist/cjs/hooks/useFavicon/useFavicon.js.map +1 -1
- package/dist/cjs/hooks/useField/useField.js +2 -2
- package/dist/cjs/hooks/useFileDialog/useFileDialog.js +2 -2
- package/dist/cjs/hooks/useFileDialog/useFileDialog.js.map +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.js +2 -2
- package/dist/cjs/hooks/useFocus/useFocus.js.map +1 -1
- package/dist/cjs/hooks/useFps/useFps.js +2 -2
- package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
- package/dist/cjs/hooks/useFullscreen/useFullscreen.js.map +1 -1
- package/dist/cjs/hooks/useGamepad/helpers/mapGamepadToXbox360Controller.js +1 -1
- package/dist/cjs/hooks/useGamepad/useGamepad.js +2 -2
- package/dist/cjs/hooks/useGeolocation/useGeolocation.js +2 -2
- package/dist/cjs/hooks/useHash/useHash.js +2 -2
- package/dist/cjs/hooks/useHotkeys/useHotkeys.js +2 -2
- package/dist/cjs/hooks/useHotkeys/useHotkeys.js.map +1 -1
- package/dist/cjs/hooks/useHover/useHover.js +2 -2
- package/dist/cjs/hooks/useHover/useHover.js.map +1 -1
- package/dist/cjs/hooks/useIdle/useIdle.js +2 -2
- package/dist/cjs/hooks/useIdle/useIdle.js.map +1 -1
- package/dist/cjs/hooks/useImage/useImage.js +2 -2
- package/dist/cjs/hooks/useImage/useImage.js.map +1 -1
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.js +2 -2
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.js.map +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
- package/dist/cjs/hooks/useInterval/useInterval.js +2 -2
- package/dist/cjs/hooks/useInterval/useInterval.js.map +1 -1
- package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
- package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +2 -2
- package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
- package/dist/cjs/hooks/useKeyPress/useKeyPress.js.map +1 -1
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js.map +1 -1
- package/dist/cjs/hooks/useKeyboard/useKeyboard.js +2 -2
- package/dist/cjs/hooks/useKeyboard/useKeyboard.js.map +1 -1
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
- package/dist/cjs/hooks/useLastChanged/useLastChanged.js +2 -2
- package/dist/cjs/hooks/useLastChanged/useLastChanged.js.map +1 -1
- package/dist/cjs/hooks/useLatest/useLatest.js +1 -1
- package/dist/cjs/hooks/useList/useList.js +2 -2
- package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
- package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js.map +1 -1
- package/dist/cjs/hooks/useLogger/useLogger.js +2 -2
- package/dist/cjs/hooks/useLogger/useLogger.js.map +1 -1
- package/dist/cjs/hooks/useLongPress/useLongPress.js +2 -2
- package/dist/cjs/hooks/useLongPress/useLongPress.js.map +1 -1
- package/dist/cjs/hooks/useMap/useMap.js +2 -2
- package/dist/cjs/hooks/useMeasure/useMeasure.js +2 -2
- package/dist/cjs/hooks/useMeasure/useMeasure.js.map +1 -1
- package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +1 -1
- package/dist/cjs/hooks/useMemory/useMemory.js +2 -2
- package/dist/cjs/hooks/useMount/useMount.js +1 -1
- package/dist/cjs/hooks/useMouse/useMouse.js +2 -2
- package/dist/cjs/hooks/useMouse/useMouse.js.map +1 -1
- package/dist/cjs/hooks/useMutation/useMutation.js +2 -2
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.js +2 -2
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.js.map +1 -1
- package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
- package/dist/cjs/hooks/useNetwork/useNetwork.js.map +1 -1
- package/dist/cjs/hooks/useOffsetPagination/useOffsetPagination.js +2 -2
- package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
- package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
- package/dist/cjs/hooks/useOptimistic/useOptimistic.js +2 -2
- package/dist/cjs/hooks/useOptimistic/useOptimistic.js.map +1 -1
- package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
- package/dist/cjs/hooks/useOrientation/useOrientation.js.map +1 -1
- package/dist/cjs/hooks/useOtpCredential/useOtpCredential.js +2 -2
- package/dist/cjs/hooks/usePageLeave/usePageLeave.js +2 -2
- package/dist/cjs/hooks/usePaint/helpers/Paint.js +2 -2
- package/dist/cjs/hooks/usePaint/helpers/Pointer.js +2 -2
- package/dist/cjs/hooks/usePaint/usePaint.js +2 -2
- package/dist/cjs/hooks/usePaint/usePaint.js.map +1 -1
- package/dist/cjs/hooks/useParallax/useParallax.js +2 -2
- package/dist/cjs/hooks/useParallax/useParallax.js.map +1 -1
- package/dist/cjs/hooks/usePermission/usePermission.js +2 -2
- package/dist/cjs/hooks/usePointerLock/usePointerLock.js +2 -2
- package/dist/cjs/hooks/usePostMessage/usePostMessage.js +1 -1
- package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
- package/dist/cjs/hooks/usePreferredContrast/usePreferredContrast.js +1 -1
- package/dist/cjs/hooks/usePreferredDark/usePreferredDark.js +1 -1
- package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
- package/dist/cjs/hooks/usePreferredReducedMotion/usePreferredReducedMotion.js +1 -1
- package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
- package/dist/cjs/hooks/useQuery/useQuery.js +2 -2
- package/dist/cjs/hooks/useQuery/useQuery.js.map +1 -1
- package/dist/cjs/hooks/useQueue/useQueue.js +2 -2
- package/dist/cjs/hooks/useRaf/useRaf.js +2 -2
- package/dist/cjs/hooks/useRaf/useRaf.js.map +1 -1
- package/dist/cjs/hooks/useRafValue/useRafValue.js +2 -2
- package/dist/cjs/hooks/useRefState/useRefState.js +2 -2
- package/dist/cjs/hooks/useRefState/useRefState.js.map +1 -1
- package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
- package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js +1 -1
- package/dist/cjs/hooks/useRerender/useRerender.js +1 -1
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.js +2 -2
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.js.map +1 -1
- package/dist/cjs/hooks/useScreenOrientation/useScreenOrientation.js +2 -2
- package/dist/cjs/hooks/useScript/useScript.js +2 -2
- package/dist/cjs/hooks/useScroll/useScroll.js +2 -2
- package/dist/cjs/hooks/useScroll/useScroll.js.map +1 -1
- package/dist/cjs/hooks/useScrollIntoView/useScrollIntoView.js +3 -0
- package/dist/cjs/hooks/useScrollIntoView/useScrollIntoView.js.map +1 -0
- package/dist/cjs/hooks/useScrollTo/useScrollTo.js +2 -2
- package/dist/cjs/hooks/useScrollTo/useScrollTo.js.map +1 -1
- package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
- package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js.map +1 -1
- package/dist/cjs/hooks/useSet/useSet.js +2 -2
- package/dist/cjs/hooks/useShare/useShare.js +2 -2
- package/dist/cjs/hooks/useShare/useShare.js.map +1 -1
- package/dist/cjs/hooks/useStateHistory/useStateHistory.js +3 -0
- package/dist/cjs/hooks/useStateHistory/useStateHistory.js.map +1 -0
- package/dist/cjs/hooks/useStep/useStep.js +2 -2
- package/dist/cjs/hooks/useStopwatch/useStopwatch.js +2 -2
- package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
- package/dist/cjs/hooks/useStorage/useStorage.js.map +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.js +2 -2
- package/dist/cjs/hooks/useTextDirection/useTextDirection.js.map +1 -1
- package/dist/cjs/hooks/useTextSelection/useTextSelection.js +2 -2
- package/dist/cjs/hooks/useTextSelection/useTextSelection.js.map +1 -1
- package/dist/cjs/hooks/useThrottleCallback/useThrottleCallback.js +2 -2
- package/dist/cjs/hooks/useThrottleCallback/useThrottleCallback.js.map +1 -1
- package/dist/cjs/hooks/useThrottleValue/useThrottleValue.js +2 -2
- package/dist/cjs/hooks/useThrottleValue/useThrottleValue.js.map +1 -1
- package/dist/cjs/hooks/useTime/useTime.js +2 -2
- package/dist/cjs/hooks/useTime/useTime.js.map +1 -1
- package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
- package/dist/cjs/hooks/useTimer/useTimer.js +2 -2
- package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
- package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
- package/dist/cjs/hooks/useVibrate/useVibrate.js +2 -2
- package/dist/cjs/hooks/useWebSocket/useWebSocket.js +2 -2
- package/dist/cjs/hooks/useWebSocket/useWebSocket.js.map +1 -1
- package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +2 -2
- package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js.map +1 -1
- package/dist/cjs/hooks/useWindowFocus/useWindowFocus.js +2 -2
- package/dist/cjs/hooks/useWindowScroll/useWindowScroll.js +2 -2
- package/dist/cjs/hooks/useWindowScroll/useWindowScroll.js.map +1 -1
- package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
- package/dist/cjs/hooks/useWindowSize/useWindowSize.js.map +1 -1
- package/dist/cjs/hooks/useWizard/useWizard.js +2 -2
- package/dist/cjs/hooks/useWizard/useWizard.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/utils/helpers/debounce.js +1 -1
- package/dist/cjs/utils/helpers/getElement.js +1 -1
- package/dist/cjs/utils/helpers/getRetry.js +1 -1
- package/dist/cjs/utils/helpers/index.js +2 -2
- package/dist/cjs/utils/helpers/isTarget.js +2 -2
- package/dist/cjs/utils/helpers/isTarget.js.map +1 -1
- package/dist/cjs/utils/helpers/throttle.js +1 -1
- package/dist/cjs/utils/helpers/throttle.js.map +1 -1
- package/dist/cjs/utils/helpers/time/getDate.js +1 -1
- package/dist/esm/{_rollupPluginBabelHelpers-CNZ3s-mD.js → _rollupPluginBabelHelpers-BQehtgCo.js} +3 -3
- package/dist/esm/_rollupPluginBabelHelpers-BQehtgCo.js.map +1 -0
- package/dist/esm/hooks/index.js +2 -2
- package/dist/esm/hooks/useActiveElement/useActiveElement.js +2 -2
- package/dist/esm/hooks/useAsync/useAsync.js +2 -2
- package/dist/esm/hooks/useBattery/useBattery.js +2 -2
- package/dist/esm/hooks/useBattery/useBattery.js.map +1 -1
- package/dist/esm/hooks/useBluetooth/useBluetooth.js +2 -2
- package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
- package/dist/esm/hooks/useBreakpoints/constants/breakpoints.js +1 -1
- package/dist/esm/hooks/useBreakpoints/useBreakpoints.js +2 -2
- package/dist/esm/hooks/useBreakpoints/useBreakpoints.js.map +1 -1
- package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.js +2 -2
- package/dist/esm/hooks/useClickOutside/useClickOutside.js.map +1 -1
- package/dist/esm/hooks/useClipboard/useClipboard.js +2 -2
- package/dist/esm/hooks/useConst/useConst.js +1 -1
- package/dist/esm/hooks/useCounter/useCounter.js +2 -2
- package/dist/esm/hooks/useCssVar/useCssVar.js +2 -2
- package/dist/esm/hooks/useCssVar/useCssVar.js.map +1 -1
- package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.js +2 -2
- package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.js.map +1 -1
- package/dist/esm/hooks/useDebounceValue/useDebounceValue.js +2 -2
- package/dist/esm/hooks/useDebounceValue/useDebounceValue.js.map +1 -1
- package/dist/esm/hooks/useDefault/useDefault.js +2 -2
- package/dist/esm/hooks/useDeviceMotion/useDeviceMotion.js +2 -2
- package/dist/esm/hooks/useDeviceMotion/useDeviceMotion.js.map +1 -1
- package/dist/esm/hooks/useDeviceOrientation/useDeviceOrientation.js +2 -2
- package/dist/esm/hooks/useDevicePixelRatio/useDevicePixelRatio.js +2 -2
- package/dist/esm/hooks/useDevicePixelRatio/useDevicePixelRatio.js.map +1 -1
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +2 -2
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.js.map +1 -1
- package/dist/esm/hooks/useDisclosure/useDisclosure.js +2 -2
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.js +3 -0
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.js.map +1 -0
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +2 -2
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js.map +1 -1
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js.map +1 -1
- package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
- package/dist/esm/hooks/useElementSize/useElementSize.js +2 -2
- package/dist/esm/hooks/useElementSize/useElementSize.js.map +1 -1
- package/dist/esm/hooks/useEvent/useEvent.js +1 -1
- package/dist/esm/hooks/useEventListener/useEventListener.js +2 -2
- package/dist/esm/hooks/useEventListener/useEventListener.js.map +1 -1
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
- package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
- package/dist/esm/hooks/useFavicon/useFavicon.js.map +1 -1
- package/dist/esm/hooks/useField/useField.js +2 -2
- package/dist/esm/hooks/useFileDialog/useFileDialog.js +2 -2
- package/dist/esm/hooks/useFileDialog/useFileDialog.js.map +1 -1
- package/dist/esm/hooks/useFocus/useFocus.js +2 -2
- package/dist/esm/hooks/useFocus/useFocus.js.map +1 -1
- package/dist/esm/hooks/useFps/useFps.js +2 -2
- package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
- package/dist/esm/hooks/useFullscreen/useFullscreen.js.map +1 -1
- package/dist/esm/hooks/useGamepad/helpers/mapGamepadToXbox360Controller.js +1 -1
- package/dist/esm/hooks/useGamepad/useGamepad.js +2 -2
- package/dist/esm/hooks/useGeolocation/useGeolocation.js +2 -2
- package/dist/esm/hooks/useHash/useHash.js +2 -2
- package/dist/esm/hooks/useHotkeys/useHotkeys.js +2 -2
- package/dist/esm/hooks/useHotkeys/useHotkeys.js.map +1 -1
- package/dist/esm/hooks/useHover/useHover.js +2 -2
- package/dist/esm/hooks/useHover/useHover.js.map +1 -1
- package/dist/esm/hooks/useIdle/useIdle.js +2 -2
- package/dist/esm/hooks/useIdle/useIdle.js.map +1 -1
- package/dist/esm/hooks/useImage/useImage.js +2 -2
- package/dist/esm/hooks/useImage/useImage.js.map +1 -1
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.js +2 -2
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.js.map +1 -1
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
- package/dist/esm/hooks/useInterval/useInterval.js +2 -2
- package/dist/esm/hooks/useInterval/useInterval.js.map +1 -1
- package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
- package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +2 -2
- package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
- package/dist/esm/hooks/useKeyPress/useKeyPress.js.map +1 -1
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js.map +1 -1
- package/dist/esm/hooks/useKeyboard/useKeyboard.js +2 -2
- package/dist/esm/hooks/useKeyboard/useKeyboard.js.map +1 -1
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
- package/dist/esm/hooks/useLastChanged/useLastChanged.js +2 -2
- package/dist/esm/hooks/useLastChanged/useLastChanged.js.map +1 -1
- package/dist/esm/hooks/useLatest/useLatest.js +1 -1
- package/dist/esm/hooks/useList/useList.js +2 -2
- package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
- package/dist/esm/hooks/useLocalStorage/useLocalStorage.js.map +1 -1
- package/dist/esm/hooks/useLogger/useLogger.js +2 -2
- package/dist/esm/hooks/useLogger/useLogger.js.map +1 -1
- package/dist/esm/hooks/useLongPress/useLongPress.js +2 -2
- package/dist/esm/hooks/useLongPress/useLongPress.js.map +1 -1
- package/dist/esm/hooks/useMap/useMap.js +2 -2
- package/dist/esm/hooks/useMeasure/useMeasure.js +2 -2
- package/dist/esm/hooks/useMeasure/useMeasure.js.map +1 -1
- package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +1 -1
- package/dist/esm/hooks/useMemory/useMemory.js +2 -2
- package/dist/esm/hooks/useMount/useMount.js +1 -1
- package/dist/esm/hooks/useMouse/useMouse.js +2 -2
- package/dist/esm/hooks/useMouse/useMouse.js.map +1 -1
- package/dist/esm/hooks/useMutation/useMutation.js +2 -2
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.js +2 -2
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.js.map +1 -1
- package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
- package/dist/esm/hooks/useNetwork/useNetwork.js.map +1 -1
- package/dist/esm/hooks/useOffsetPagination/useOffsetPagination.js +2 -2
- package/dist/esm/hooks/useOnline/useOnline.js +1 -1
- package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
- package/dist/esm/hooks/useOptimistic/useOptimistic.js +2 -2
- package/dist/esm/hooks/useOptimistic/useOptimistic.js.map +1 -1
- package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
- package/dist/esm/hooks/useOrientation/useOrientation.js.map +1 -1
- package/dist/esm/hooks/useOtpCredential/useOtpCredential.js +2 -2
- package/dist/esm/hooks/usePageLeave/usePageLeave.js +2 -2
- package/dist/esm/hooks/usePaint/helpers/Paint.js +2 -2
- package/dist/esm/hooks/usePaint/helpers/Pointer.js +2 -2
- package/dist/esm/hooks/usePaint/usePaint.js +2 -2
- package/dist/esm/hooks/usePaint/usePaint.js.map +1 -1
- package/dist/esm/hooks/useParallax/useParallax.js +2 -2
- package/dist/esm/hooks/useParallax/useParallax.js.map +1 -1
- package/dist/esm/hooks/usePermission/usePermission.js +2 -2
- package/dist/esm/hooks/usePointerLock/usePointerLock.js +2 -2
- package/dist/esm/hooks/usePostMessage/usePostMessage.js +1 -1
- package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
- package/dist/esm/hooks/usePreferredContrast/usePreferredContrast.js +1 -1
- package/dist/esm/hooks/usePreferredDark/usePreferredDark.js +1 -1
- package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
- package/dist/esm/hooks/usePreferredReducedMotion/usePreferredReducedMotion.js +1 -1
- package/dist/esm/hooks/usePrevious/usePrevious.js +1 -1
- package/dist/esm/hooks/useQuery/useQuery.js +2 -2
- package/dist/esm/hooks/useQuery/useQuery.js.map +1 -1
- package/dist/esm/hooks/useQueue/useQueue.js +2 -2
- package/dist/esm/hooks/useRaf/useRaf.js +2 -2
- package/dist/esm/hooks/useRaf/useRaf.js.map +1 -1
- package/dist/esm/hooks/useRafValue/useRafValue.js +2 -2
- package/dist/esm/hooks/useRefState/useRefState.js +2 -2
- package/dist/esm/hooks/useRefState/useRefState.js.map +1 -1
- package/dist/esm/hooks/useRenderCount/useRenderCount.js +1 -1
- package/dist/esm/hooks/useRenderInfo/useRenderInfo.js +1 -1
- package/dist/esm/hooks/useRerender/useRerender.js +1 -1
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.js +2 -2
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.js.map +1 -1
- package/dist/esm/hooks/useScreenOrientation/useScreenOrientation.js +2 -2
- package/dist/esm/hooks/useScript/useScript.js +2 -2
- package/dist/esm/hooks/useScroll/useScroll.js +2 -2
- package/dist/esm/hooks/useScroll/useScroll.js.map +1 -1
- package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.js +3 -0
- package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.js.map +1 -0
- package/dist/esm/hooks/useScrollTo/useScrollTo.js +2 -2
- package/dist/esm/hooks/useScrollTo/useScrollTo.js.map +1 -1
- package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
- package/dist/esm/hooks/useSessionStorage/useSessionStorage.js.map +1 -1
- package/dist/esm/hooks/useSet/useSet.js +2 -2
- package/dist/esm/hooks/useShare/useShare.js +2 -2
- package/dist/esm/hooks/useShare/useShare.js.map +1 -1
- package/dist/esm/hooks/useStateHistory/useStateHistory.js +3 -0
- package/dist/esm/hooks/useStateHistory/useStateHistory.js.map +1 -0
- package/dist/esm/hooks/useStep/useStep.js +2 -2
- package/dist/esm/hooks/useStopwatch/useStopwatch.js +2 -2
- package/dist/esm/hooks/useStorage/useStorage.js +2 -2
- package/dist/esm/hooks/useStorage/useStorage.js.map +1 -1
- package/dist/esm/hooks/useTextDirection/useTextDirection.js +2 -2
- package/dist/esm/hooks/useTextDirection/useTextDirection.js.map +1 -1
- package/dist/esm/hooks/useTextSelection/useTextSelection.js +2 -2
- package/dist/esm/hooks/useTextSelection/useTextSelection.js.map +1 -1
- package/dist/esm/hooks/useThrottleCallback/useThrottleCallback.js +2 -2
- package/dist/esm/hooks/useThrottleCallback/useThrottleCallback.js.map +1 -1
- package/dist/esm/hooks/useThrottleValue/useThrottleValue.js +2 -2
- package/dist/esm/hooks/useThrottleValue/useThrottleValue.js.map +1 -1
- package/dist/esm/hooks/useTime/useTime.js +2 -2
- package/dist/esm/hooks/useTime/useTime.js.map +1 -1
- package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
- package/dist/esm/hooks/useTimer/useTimer.js +2 -2
- package/dist/esm/hooks/useToggle/useToggle.js +2 -2
- package/dist/esm/hooks/useUnmount/useUnmount.js +1 -1
- package/dist/esm/hooks/useVibrate/useVibrate.js +2 -2
- package/dist/esm/hooks/useWebSocket/useWebSocket.js +2 -2
- package/dist/esm/hooks/useWebSocket/useWebSocket.js.map +1 -1
- package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +2 -2
- package/dist/esm/hooks/useWindowEvent/useWindowEvent.js.map +1 -1
- package/dist/esm/hooks/useWindowFocus/useWindowFocus.js +2 -2
- package/dist/esm/hooks/useWindowScroll/useWindowScroll.js +2 -2
- package/dist/esm/hooks/useWindowScroll/useWindowScroll.js.map +1 -1
- package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
- package/dist/esm/hooks/useWindowSize/useWindowSize.js.map +1 -1
- package/dist/esm/hooks/useWizard/useWizard.js +2 -2
- package/dist/esm/hooks/useWizard/useWizard.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/utils/helpers/debounce.js +1 -1
- package/dist/esm/utils/helpers/getElement.js +1 -1
- package/dist/esm/utils/helpers/getRetry.js +1 -1
- package/dist/esm/utils/helpers/index.js +2 -2
- package/dist/esm/utils/helpers/isTarget.js +2 -2
- package/dist/esm/utils/helpers/isTarget.js.map +1 -1
- package/dist/esm/utils/helpers/throttle.js +1 -1
- package/dist/esm/utils/helpers/throttle.js.map +1 -1
- package/dist/esm/utils/helpers/time/getDate.js +1 -1
- package/dist/types/index.d.ts +192 -30
- package/package.json +89 -114
- package/LICENSE +0 -21
- package/dist/cjs/_rollupPluginBabelHelpers-BsWog5nG.js.map +0 -1
- package/dist/cjs/utils/helpers/isClient.js +0 -3
- package/dist/cjs/utils/helpers/isClient.js.map +0 -1
- package/dist/esm/_rollupPluginBabelHelpers-CNZ3s-mD.js.map +0 -1
- package/dist/esm/utils/helpers/isClient.js +0 -3
- package/dist/esm/utils/helpers/isClient.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThrottleValue.js","sources":["../../../../src/hooks/useThrottleValue/useThrottleValue.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\
|
|
1
|
+
{"version":3,"file":"useThrottleValue.js","sources":["../../../../src/hooks/useThrottleValue/useThrottleValue.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport { useThrottleCallback } from '../useThrottleCallback/useThrottleCallback';\n\n/**\n * @name useThrottleValue\n * @description - Hook that creates a throttled value and returns a stable reference of it\n * @category Utilities\n *\n * @template Value The type of the value\n * @param {Value} value The value to be throttled\n * @param {number} delay The delay in milliseconds\n * @returns {Value} The throttled value\n *\n * @example\n * const throttledValue = useThrottleValue(value, 500);\n */\nexport const useThrottleValue = <Value>(value: Value, delay: number) => {\n const previousValueRef = useRef(value);\n const [throttledValue, setThrottleValue] = useState(value);\n\n const throttledSetState = useThrottleCallback(setThrottleValue, delay);\n\n useEffect(() => {\n if (previousValueRef.current === value) return;\n throttledSetState(value);\n previousValueRef.current = value;\n }, [value]);\n\n return throttledValue;\n};\n"],"names":["useThrottleValue","value","delay","previousValueRef","useRef","_useState","useState","_useState2","_slicedToArray","throttledValue","setThrottleValue","throttledSetState","useThrottleCallback","useEffect","current"],"mappings":";wRAiBO,IAAMA,EAAmB,SAAQC,EAAcC,GACpD,IAAMC,EAAmBC,EAAOH,GAChCI,EAA2CC,EAASL,GAAMM,EAAAC,EAAAH,EAAA,GAAnDI,EAAcF,EAAA,GAAEG,EAAgBH,EAAA,GAEjCI,EAAoBC,EAAoBF,EAAkBR,GAQhE,OANAW,GAAU,WACJV,EAAiBW,UAAYb,IACjCU,EAAkBV,GAClBE,EAAiBW,QAAUb,EAC7B,GAAG,CAACA,IAEGQ,CACT"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useState as e}from"react";import{getDate as t}from"../../utils/helpers/time/getDate.js";import{useInterval as o}from"../useInterval/useInterval.js";import"../useEvent/useEvent.js";var s=function(){var s=e(t()),n=r(s,2),u=n[0],i=n[1];return o((function(){return i(t())}),1e3),u};export{s as useTime};
|
|
3
3
|
//# sourceMappingURL=useTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTime.js","sources":["../../../../src/hooks/useTime/useTime.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport { getDate } from '@/utils/helpers';\n\nimport { useInterval } from '../useInterval/useInterval';\n\nexport interface UseTimeReturn {\n day: number;\n hours: number;\n meridiemHours: { value: number; type: string };\n minutes: number;\n month: number;\n seconds: number;\n timestamp: number;\n year: number;\n}\n\n/**\n * @name useTime\n * @description - Hook that gives you current time in different values\n * @category Time\n *\n * @returns {UseTimeReturn} An object containing the current time\n *\n * @example\n * const { seconds, minutes, hours, meridiemHours, day, month, year, timestamp } = useTime();\n */\nexport const useTime = (): UseTimeReturn => {\n const [time, setTime] = useState(getDate());\n useInterval(() => setTime(getDate()), 1000);\n return time;\n};\n"],"names":["useTime","_useState","useState","getDate","_useState2","_slicedToArray","time","setTime","useInterval"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTime.js","sources":["../../../../src/hooks/useTime/useTime.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport { getDate } from '@/utils/helpers';\n\nimport { useInterval } from '../useInterval/useInterval';\n\nexport interface UseTimeReturn {\n day: number;\n hours: number;\n meridiemHours: { value: number; type: string };\n minutes: number;\n month: number;\n seconds: number;\n timestamp: number;\n year: number;\n}\n\n/**\n * @name useTime\n * @description - Hook that gives you current time in different values\n * @category Time\n *\n * @returns {UseTimeReturn} An object containing the current time\n *\n * @example\n * const { seconds, minutes, hours, meridiemHours, day, month, year, timestamp } = useTime();\n */\nexport const useTime = (): UseTimeReturn => {\n const [time, setTime] = useState(getDate());\n useInterval(() => setTime(getDate()), 1000);\n return time;\n};\n"],"names":["useTime","_useState","useState","getDate","_useState2","_slicedToArray","time","setTime","useInterval"],"mappings":";+PA2BaA,EAAU,WACrB,IAAAC,EAAwBC,EAASC,KAAUC,EAAAC,EAAAJ,EAAA,GAApCK,EAAIF,EAAA,GAAEG,EAAOH,EAAA,GAEpB,OADAI,GAAY,WAAA,OAAMD,EAAQJ,IAAU,GAAE,KAC/BG,CACT"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useState as e,useRef as t,useEffect as n}from"react";import{useEvent as u}from"../useEvent/useEvent.js";function o(o,c){var i=e(!1),m=r(i,2),a=m[0],f=m[1],l=t(),s=u(o);n((function(){return l.current=setTimeout((function(){s(),f(!0)}),c),function(){clearTimeout(l.current)}}),[c]);return{ready:a,clear:function(){clearTimeout(l.current),f(!0)}}}export{o as useTimeout};
|
|
3
3
|
//# sourceMappingURL=useTimeout.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{b as t,_ as n,c as o}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{b as t,_ as n,c as o}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useState as e}from"react";import{useInterval as l}from"../useInterval/useInterval.js";import"../useEvent/useEvent.js";var r=function(t){var n=Math.ceil(t),o=Math.floor(n/86400),e=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return{seconds:Math.floor(n%60),minutes:l,hours:e,days:o}},i=function(){var i,a=arguments.length<=0?void 0:arguments[0],u="object"===t(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:{onExpire:arguments.length<=1?void 0:arguments[1]},s=null===(i=null==u?void 0:u.autostart)||void 0===i||i,c=e(Math.ceil(a/1e3)),v=n(c,2),f=v[0],h=v[1],d=e(s),p=n(d,2),g=p[0],m=p[1];return l((function(){var t,n,o=f-1;(null==u||null===(t=u.onTick)||void 0===t||t.call(u,f),h(o),0===o)&&(m(!1),null==u||null===(n=u.onExpire)||void 0===n||n.call(u))}),1e3,{enabled:g}),o(o({},r(f)),{},{pause:function(){return m(!1)},toggle:function(){return m(!g)},start:function(){m(!0),h(Math.ceil(a/1e3))},restart:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];h(Math.ceil(t/1e3)),m(n)},running:g})};export{r as getTimeFromSeconds,i as useTimer};
|
|
3
3
|
//# sourceMappingURL=useTimer.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useReducer as n}from"react";var t=function(){var t=n((function(r,n){var t=n instanceof Function?n(r[0]):n,e=Math.abs(r.indexOf(t));return r.slice(e).concat(r.slice(0,e))}),arguments.length>0&&void 0!==arguments[0]?arguments[0]:[!1,!0]),e=r(t,2);return[r(e[0],1)[0],e[1]]};export{t as useToggle};
|
|
3
3
|
//# sourceMappingURL=useToggle.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
2
|
import{useRef as r,useEffect as n}from"react";var t=function(t){var c=r(t);c.current=t,n((function(){return function(){c.current()}}),[])};export{t as useUnmount};
|
|
3
3
|
//# sourceMappingURL=useUnmount.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useRef as t,useState as n,useEffect as e}from"react";var a=function(a){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o="undefined"!=typeof navigator&&"vibrate"in navigator,u=t(),c=n(!1),v=r(c,2),l=v[0],f=v[1],g=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;o&&navigator.vibrate(r)},p=function(){o&&(navigator.vibrate(0),f(!1),u.current&&clearInterval(u.current))},s=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;o&&(u.current&&clearInterval(u.current),f(!0),u.current=setInterval(g,r))};return e((function(){if(o&&!(i<=0))return s(i),function(){p()}}),[i,a]),{supported:o,trigger:g,stop:p,active:l,pause:function(){o&&(f(!1),u.current&&clearInterval(u.current))},resume:s}};export{a as useVibrate};
|
|
3
3
|
//# sourceMappingURL=useVibrate.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as n}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useRef as r,useState as e,useEffect as o}from"react";import{getRetry as t}from"../../utils/helpers/getRetry.js";import{useEvent as u}from"../useEvent/useEvent.js";var c=function(c,l){var i=r(),s=r(null!=l&&l.retry?t(l.retry):0),v=r(!1),a=e("connecting"),d=n(a,2),f=d[0],p=d[1],m=u((function(){i.current=new WebSocket("function"==typeof c?c():c,null==l?void 0:l.protocols),p("connecting");var n=i.current;n&&(n.onopen=function(){var r;p("connected"),null==l||null===(r=l.onConnected)||void 0===r||r.call(l,n)},n.onerror=function(r){var e;p("failed"),null==l||null===(e=l.onError)||void 0===e||e.call(l,r,n)},n.onmessage=function(r){var e;return null==l||null===(e=l.onMessage)||void 0===e?void 0:e.call(l,r,n)},n.onclose=function(r){var e;if(p("disconnected"),null==l||null===(e=l.onDisconnected)||void 0===e||e.call(l,r,n),!v.current)return s.current>0?(s.current-=1,m()):void(s.current=null!=l&&l.retry?t(l.retry):0)})}));o((function(){return m(),function(){i.current&&(i.current.close(),i.current=void 0)}}),[c]);return{client:i.current,close:function(){var n;v.current=!0,null===(n=i.current)||void 0===n||n.close()},open:function(){v.current=!1,m()},send:function(n){var r;return null===(r=i.current)||void 0===r?void 0:r.send(n)},status:f}};export{c as useWebSocket};
|
|
3
3
|
//# sourceMappingURL=useWebSocket.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebSocket.js","sources":["../../../../src/hooks/useWebSocket/useWebSocket.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport { getRetry } from '@/utils/helpers';\n\nimport { useEvent } from '../useEvent/useEvent';\n\nexport type UseWebSocketUrl = (() => string) | string;\n\nexport interface UseWebSocketOptions {\n protocols?: Array<'soap' | 'wasm'>;\n retry?: boolean | number;\n onConnected?: (webSocket: WebSocket) => void;\n onDisconnected?: (event: CloseEvent, webSocket: WebSocket) => void;\n onError?: (event: Event, webSocket: WebSocket) => void;\n onMessage?: (event: MessageEvent, webSocket: WebSocket) => void;\n}\n\nexport type UseWebSocketStatus = 'connected' | 'connecting' | 'disconnected' | 'failed';\n\nexport interface UseWebSocketReturn {\n client?: WebSocket;\n close: WebSocket['close'];\n send: WebSocket['send'];\n status: UseWebSocketStatus;\n open: () => void;\n}\n\n/**\n * @name useWebSocket\n * @description - Hook that connects to a WebSocket server and handles incoming and outgoing messages\n * @category Network\n *\n * @param {UseWebSocketUrl} url The URL of the WebSocket server\n * @param {(webSocket: WebSocket) => void} [options.onConnected] The callback function that is called when the WebSocket connection is established\n * @param {(event: CloseEvent, webSocket: WebSocket) => void} [options.onDisconnected] The callback function that is called when the WebSocket connection is closed\n * @param {(event: Event, webSocket: WebSocket) => void} [options.onError] The callback function that is called when an error occurs\n * @param {(event: MessageEvent, webSocket: WebSocket) => void} [options.onMessage] The callback function that is called when a message is received\n * @param {boolean | number} [options.retry] The number of times to retry the connection\n * @param {Array<'soap' | 'wasm'>} [options.protocols] The list of protocols to use\n * @returns {UseWebSocketReturn} An object with the status, close, send, open, and ws properties\n *\n * @example\n * const { status, close, send, open, client } = useWebSocket('url');\n */\nexport const useWebSocket = (\n url: UseWebSocketUrl,\n options?: UseWebSocketOptions\n): UseWebSocketReturn => {\n const webSocketRef = useRef<WebSocket>();\n const retryCountRef = useRef(options?.retry ? getRetry(options.retry) : 0);\n const explicityCloseRef = useRef(false);\n\n const [status, setStatus] = useState<UseWebSocketStatus>('connecting');\n\n const send = (data: string | ArrayBufferLike | ArrayBufferView | Blob) =>\n webSocketRef.current?.send(data);\n\n const close = () => {\n explicityCloseRef.current = true;\n webSocketRef.current?.close();\n };\n\n const init = useEvent(() => {\n webSocketRef.current = new WebSocket(\n typeof url === 'function' ? url() : url,\n options?.protocols\n );\n setStatus('connecting');\n\n const webSocket = webSocketRef.current;\n if (!webSocket) return;\n\n webSocket.onopen = () => {\n setStatus('connected');\n options?.onConnected?.(webSocket);\n };\n\n webSocket.onerror = (event) => {\n setStatus('failed');\n options?.onError?.(event, webSocket);\n };\n\n webSocket.onmessage = (event) => options?.onMessage?.(event, webSocket);\n\n webSocket.onclose = (event) => {\n setStatus('disconnected');\n options?.onDisconnected?.(event, webSocket);\n if (explicityCloseRef.current) return;\n\n if (retryCountRef.current > 0) {\n retryCountRef.current -= 1;\n return init();\n }\n retryCountRef.current = options?.retry ? getRetry(options.retry) : 0;\n };\n });\n\n useEffect(() => {\n init();\n\n return () => {\n if (!webSocketRef.current) return;\n webSocketRef.current.close();\n webSocketRef.current = undefined;\n };\n }, [url]);\n\n const open = () => {\n explicityCloseRef.current = false;\n init();\n };\n\n return { client: webSocketRef.current, close, open, send, status };\n};\n"],"names":["useWebSocket","url","options","webSocketRef","useRef","retryCountRef","retry","getRetry","explicityCloseRef","_useState","useState","_useState2","_slicedToArray","status","setStatus","init","useEvent","current","WebSocket","protocols","webSocket","onopen","_options$onConnected","onConnected","call","onerror","event","_options$onError","onError","onmessage","_options$onMessage","onMessage","onclose","_options$onDisconnect","onDisconnected","useEffect","close","undefined","client","_webSocketRef$current2","open","send","data","_webSocketRef$current"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useWebSocket.js","sources":["../../../../src/hooks/useWebSocket/useWebSocket.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport { getRetry } from '@/utils/helpers';\n\nimport { useEvent } from '../useEvent/useEvent';\n\nexport type UseWebSocketUrl = (() => string) | string;\n\nexport interface UseWebSocketOptions {\n protocols?: Array<'soap' | 'wasm'>;\n retry?: boolean | number;\n onConnected?: (webSocket: WebSocket) => void;\n onDisconnected?: (event: CloseEvent, webSocket: WebSocket) => void;\n onError?: (event: Event, webSocket: WebSocket) => void;\n onMessage?: (event: MessageEvent, webSocket: WebSocket) => void;\n}\n\nexport type UseWebSocketStatus = 'connected' | 'connecting' | 'disconnected' | 'failed';\n\nexport interface UseWebSocketReturn {\n client?: WebSocket;\n close: WebSocket['close'];\n send: WebSocket['send'];\n status: UseWebSocketStatus;\n open: () => void;\n}\n\n/**\n * @name useWebSocket\n * @description - Hook that connects to a WebSocket server and handles incoming and outgoing messages\n * @category Network\n *\n * @param {UseWebSocketUrl} url The URL of the WebSocket server\n * @param {(webSocket: WebSocket) => void} [options.onConnected] The callback function that is called when the WebSocket connection is established\n * @param {(event: CloseEvent, webSocket: WebSocket) => void} [options.onDisconnected] The callback function that is called when the WebSocket connection is closed\n * @param {(event: Event, webSocket: WebSocket) => void} [options.onError] The callback function that is called when an error occurs\n * @param {(event: MessageEvent, webSocket: WebSocket) => void} [options.onMessage] The callback function that is called when a message is received\n * @param {boolean | number} [options.retry] The number of times to retry the connection\n * @param {Array<'soap' | 'wasm'>} [options.protocols] The list of protocols to use\n * @returns {UseWebSocketReturn} An object with the status, close, send, open, and ws properties\n *\n * @example\n * const { status, close, send, open, client } = useWebSocket('url');\n */\nexport const useWebSocket = (\n url: UseWebSocketUrl,\n options?: UseWebSocketOptions\n): UseWebSocketReturn => {\n const webSocketRef = useRef<WebSocket>();\n const retryCountRef = useRef(options?.retry ? getRetry(options.retry) : 0);\n const explicityCloseRef = useRef(false);\n\n const [status, setStatus] = useState<UseWebSocketStatus>('connecting');\n\n const send = (data: string | ArrayBufferLike | ArrayBufferView | Blob) =>\n webSocketRef.current?.send(data);\n\n const close = () => {\n explicityCloseRef.current = true;\n webSocketRef.current?.close();\n };\n\n const init = useEvent(() => {\n webSocketRef.current = new WebSocket(\n typeof url === 'function' ? url() : url,\n options?.protocols\n );\n setStatus('connecting');\n\n const webSocket = webSocketRef.current;\n if (!webSocket) return;\n\n webSocket.onopen = () => {\n setStatus('connected');\n options?.onConnected?.(webSocket);\n };\n\n webSocket.onerror = (event) => {\n setStatus('failed');\n options?.onError?.(event, webSocket);\n };\n\n webSocket.onmessage = (event) => options?.onMessage?.(event, webSocket);\n\n webSocket.onclose = (event) => {\n setStatus('disconnected');\n options?.onDisconnected?.(event, webSocket);\n if (explicityCloseRef.current) return;\n\n if (retryCountRef.current > 0) {\n retryCountRef.current -= 1;\n return init();\n }\n retryCountRef.current = options?.retry ? getRetry(options.retry) : 0;\n };\n });\n\n useEffect(() => {\n init();\n\n return () => {\n if (!webSocketRef.current) return;\n webSocketRef.current.close();\n webSocketRef.current = undefined;\n };\n }, [url]);\n\n const open = () => {\n explicityCloseRef.current = false;\n init();\n };\n\n return { client: webSocketRef.current, close, open, send, status };\n};\n"],"names":["useWebSocket","url","options","webSocketRef","useRef","retryCountRef","retry","getRetry","explicityCloseRef","_useState","useState","_useState2","_slicedToArray","status","setStatus","init","useEvent","current","WebSocket","protocols","webSocket","onopen","_options$onConnected","onConnected","call","onerror","event","_options$onError","onError","onmessage","_options$onMessage","onMessage","onclose","_options$onDisconnect","onDisconnected","useEffect","close","undefined","client","_webSocketRef$current2","open","send","data","_webSocketRef$current"],"mappings":";0OA4CO,IAAMA,EAAe,SAC1BC,EACAC,GAEA,IAAMC,EAAeC,IACfC,EAAgBD,EAAOF,SAAAA,EAASI,MAAQC,EAASL,EAAQI,OAAS,GAClEE,EAAoBJ,GAAO,GAEjCK,EAA4BC,EAA6B,cAAaC,EAAAC,EAAAH,EAAA,GAA/DI,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAUlBI,EAAOC,GAAS,WACpBb,EAAac,QAAU,IAAIC,UACV,mBAARjB,EAAqBA,IAAQA,EACpCC,aAAAA,EAAAA,EAASiB,WAEXL,EAAU,cAEV,IAAMM,EAAYjB,EAAac,QAC1BG,IAELA,EAAUC,OAAS,WAAM,IAAAC,EACvBR,EAAU,aACVZ,SAAoB,QAAboB,EAAPpB,EAASqB,mBAAW,IAAAD,GAApBA,EAAAE,KAAAtB,EAAuBkB,EACxB,EAEDA,EAAUK,QAAU,SAACC,GAAU,IAAAC,EAC7Bb,EAAU,UACVZ,SAAgByB,QAATA,EAAPzB,EAAS0B,mBAAOD,GAAhBA,EAAAH,KAAAtB,EAAmBwB,EAAON,EAC3B,EAEDA,EAAUS,UAAY,SAACH,GAAK,IAAAI,EAAA,OAAK5B,SAAkB,QAAX4B,EAAP5B,EAAS6B,iBAATD,IAAkBA,OAAlBA,EAAAA,EAAAN,KAAAtB,EAAqBwB,EAAON,EAAU,EAEvEA,EAAUY,QAAU,SAACN,GAAU,IAAAO,EAG7B,GAFAnB,EAAU,gBACVZ,SAAuB+B,QAAhBA,EAAP/B,EAASgC,0BAAcD,GAAvBA,EAAAT,KAAAtB,EAA0BwB,EAAON,IAC7BZ,EAAkBS,QAEtB,OAAIZ,EAAcY,QAAU,GAC1BZ,EAAcY,SAAW,EAClBF,UAETV,EAAcY,QAAUf,SAAAA,EAASI,MAAQC,EAASL,EAAQI,OAAS,EACpE,EACH,IAEA6B,GAAU,WAGR,OAFApB,IAEO,WACAZ,EAAac,UAClBd,EAAac,QAAQmB,QACrBjC,EAAac,aAAUoB,EACxB,CACH,GAAG,CAACpC,IAOJ,MAAO,CAAEqC,OAAQnC,EAAac,QAASmB,MAvDzB,WAAM,IAAAG,EAClB/B,EAAkBS,SAAU,EACR,QAApBsB,EAAApC,EAAac,eAAO,IAAAsB,GAApBA,EAAsBH,OACvB,EAoD6CI,KALjC,WACXhC,EAAkBS,SAAU,EAC5BF,GACD,EAEmD0B,KA1DvC,SAACC,GAAuD,IAAAC,EAAA,OAC/C,QAD+CA,EACnExC,EAAac,eAAO,IAAA0B,OAAA,EAApBA,EAAsBF,KAAKC,EAAK,EAyDwB7B,OAAAA,EAC5D"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{useEventListener as e}from"../useEventListener/useEventListener.js";import"react";import"../../utils/helpers/getElement.js";import"
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{useEventListener as e}from"../useEventListener/useEventListener.js";import"react";import"../../utils/helpers/getElement.js";import"../useEvent/useEvent.js";import"../useRefState/useRefState.js";import"../../_rollupPluginBabelHelpers-BQehtgCo.js";var t=function(t,r,s){return e(window,t,r,s)};export{t as useWindowEvent};
|
|
3
3
|
//# sourceMappingURL=useWindowEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowEvent.js","sources":["../../../../src/hooks/useWindowEvent/useWindowEvent.ts"],"sourcesContent":["import 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(window, event, listener, options);\n"],"names":["useWindowEvent","event","listener","options","useEventListener","window"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useWindowEvent.js","sources":["../../../../src/hooks/useWindowEvent/useWindowEvent.ts"],"sourcesContent":["import 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(window, event, listener, options);\n"],"names":["useWindowEvent","event","listener","options","useEventListener","window"],"mappings":";6PAkBO,IAAMA,EAAiB,SAC5BC,EACAC,EACAC,GAAiC,OAC9BC,EAAiBC,OAAQJ,EAAOC,EAAUC,EAAQ"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as n}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useState as r,useEffect as e}from"react";var t=function(){var t=r(!1),o=n(t,2),i=o[0],u=o[1];return e((function(){var n=function(){return u(!0)},r=function(){return u(!1)};return window.addEventListener("focus",n),window.addEventListener("blur",r),function(){window.removeEventListener("focus",n),window.removeEventListener("blur",r)}})),i};export{t as useWindowFocus};
|
|
3
3
|
//# sourceMappingURL=useWindowFocus.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useState as o,useEffect as r}from"react";var n=function(e){var o=e.x,r=e.y,n=e.behavior,i={behavior:void 0===n?"smooth":n};"number"==typeof o&&(i.left=o),"number"==typeof r&&(i.top=r),window.scrollTo(i)},i=function(){var i=o({x:"undefined"!=typeof window?window.scrollX:Number.POSITIVE_INFINITY,y:"undefined"!=typeof window?window.scrollY:Number.POSITIVE_INFINITY}),t=e(i,2),l=t[0],w=t[1];return r((function(){var e=function(){return w({x:window.scrollX,y:window.scrollY})};return window.addEventListener("scroll",e),window.addEventListener("resize",e),function(){window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[]),{value:l,scrollTo:n}};export{n as scrollTo,i as useWindowScroll};
|
|
3
3
|
//# sourceMappingURL=useWindowScroll.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowScroll.js","sources":["../../../../src/hooks/useWindowScroll/useWindowScroll.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\
|
|
1
|
+
{"version":3,"file":"useWindowScroll.js","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","_ref","x","y","_ref$behavior","behavior","scrollOptions","left","top","window","useWindowScroll","_useState","useState","scrollX","Number","POSITIVE_INFINITY","scrollY","_useState2","_slicedToArray","value","setValue","useEffect","onChange","addEventListener","removeEventListener"],"mappings":";oHAOaA,EAAW,SAAHC,GAI0B,IAH7CC,EAACD,EAADC,EACAC,EAACF,EAADE,EAACC,EAAAH,EACDI,SAEMC,EAAiC,CAAED,cAF9B,IAAHD,EAAG,SAAQA,GAGF,iBAANF,IAAgBI,EAAcC,KAAOL,GAC/B,iBAANC,IAAgBG,EAAcE,IAAML,GAC/CM,OAAOT,SAASM,EAClB,EAYaI,EAAkB,WAC7B,IAAAC,EAA0BC,EAAyB,CACjDV,EAAqB,oBAAXO,OAAyBA,OAAOI,QAAUC,OAAOC,kBAC3DZ,EAAqB,oBAAXM,OAAyBA,OAAOO,QAAUF,OAAOC,oBAC3DE,EAAAC,EAAAP,EAAA,GAHKQ,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAetB,OAVAI,GAAU,WACR,IAAMC,EAAW,WAAH,OAASF,EAAS,CAAElB,EAAGO,OAAOI,QAASV,EAAGM,OAAOO,SAAU,EAGzE,OAFAP,OAAOc,iBAAiB,SAAUD,GAClCb,OAAOc,iBAAiB,SAAUD,GAC3B,WACLb,OAAOe,oBAAoB,SAAUF,GACrCb,OAAOe,oBAAoB,SAAUF,EACtC,CACF,GAAE,IAEI,CAAEH,MAAAA,EAAOnB,SAAAA,EAClB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as n}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useState as e,useEffect as i}from"react";var t=function(t){var o,d=null===(o=null==t?void 0:t.includeScrollbar)||void 0===o||o,r=e((function(){return"undefined"==typeof window?{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY}:{width:d?window.innerWidth:window.document.documentElement.clientWidth,height:d?window.innerHeight:window.document.documentElement.clientHeight}})),u=n(r,2),w=u[0],l=u[1];return i((function(){var n=function(){l(d?{width:window.innerWidth,height:window.innerHeight}:{width:window.document.documentElement.clientWidth,height:window.document.documentElement.clientHeight})};return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}),[null==t?void 0:t.includeScrollbar]),w};export{t as useWindowSize};
|
|
3
3
|
//# sourceMappingURL=useWindowSize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowSize.js","sources":["../../../../src/hooks/useWindowSize/useWindowSize.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\
|
|
1
|
+
{"version":3,"file":"useWindowSize.js","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","_params$includeScroll","includeScrollbar","_useState","useState","window","width","Number","POSITIVE_INFINITY","height","innerWidth","document","documentElement","clientWidth","innerHeight","clientHeight","_useState2","_slicedToArray","size","setSize","useEffect","onResize","addEventListener","removeEventListener"],"mappings":";oHA4BaA,EAAgB,SAACC,GAAiC,IAAAC,EACvDC,EAA2CD,QAA3BA,EAAGD,aAAM,EAANA,EAAQE,wBAAgBD,IAAAA,GAAAA,EACjDE,EAAwBC,GAAS,WAC/B,MAAsB,oBAAXC,OACF,CACLC,MAAOC,OAAOC,kBACdC,OAAQF,OAAOC,mBAIZ,CACLF,MAAOJ,EAAmBG,OAAOK,WAAaL,OAAOM,SAASC,gBAAgBC,YAC9EJ,OAAQP,EAAmBG,OAAOS,YAAcT,OAAOM,SAASC,gBAAgBG,aAEpF,IAAEC,EAAAC,EAAAd,EAAA,GAZKe,EAAIF,EAAA,GAAEG,EAAOH,EAAA,GAmCpB,OArBAI,GAAU,WACR,IAAMC,EAAW,WAEbF,EADEjB,EACM,CACNI,MAAOD,OAAOK,WACdD,OAAQJ,OAAOS,aAGT,CACNR,MAAOD,OAAOM,SAASC,gBAAgBC,YACvCJ,OAAQJ,OAAOM,SAASC,gBAAgBG,cAG7C,EAGD,OADAV,OAAOiB,iBAAiB,SAAUD,GAC3B,WACLhB,OAAOkB,oBAAoB,SAAUF,EACtC,IACA,CAACrB,eAAAA,EAAQE,mBAELgB,CACT"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n,a as o}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{_ as n,a as o}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";import{useState as t}from"react";var r=function(r,e){var c=null!=e?e:r[0].id,i=new Map(r.map((function(n){return[n.id,n]}))),l=t(c),a=n(l,2),u=a[0],f=a[1],s=t([c]),d=n(s,2),v=d[0],g=d[1];return{currentStepId:u,set:function(n){var t;if(null===(t=i.get(u))||void 0===t||null===(t=t.nodes)||void 0===t||!t.includes(n))throw new Error("Can't go to ".concat(n," from ").concat(u));g([].concat(o(v),[n])),f(n)},reset:function(){f(c),g([c])},back:function(){var n;if(1!==v.length){var o=v[v.length-2];if(null===(n=i.get(u))||void 0===n||null===(n=n.nodes)||void 0===n||!n.includes(o))throw new Error("Can't go to ".concat(o," from ").concat(u));g(v.slice(0,-1)),f(v[v.length-2])}},history:v}};export{r as useWizard};
|
|
3
3
|
//# sourceMappingURL=useWizard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizard.js","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","id","wizardMap","Map","wizardItem","_useState","useState","_useState2","_slicedToArray","currentStepId","setCurrentStepId","_useState3","_useState4","history","setHistory","set","_wizardMap$get","get","nodes","includes","Error","concat","_toConsumableArray","reset","back","_wizardMap$get2","length","previousStepId","slice"],"mappings":";wGAuBO,IAAMA,EAAY,SACvBC,EACAC,GAEA,IAAMC,EAAYD,QAAAA,EAAiBD,EAAI,GAAGG,GACpCC,EAAY,IAAIC,IAAIL,EAAIA,KAAI,SAACM,GAAU,MAAK,CAACA,EAAWH,GAAIG,EAAW,KAC7EC,EAA0CC,EAASN,GAAUO,EAAAC,EAAAH,EAAA,GAAtDI,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GACtCI,EAA8BL,EAAyB,CAACN,IAAWY,EAAAJ,EAAAG,EAAA,GAA5DE,EAAOD,EAAA,GAAEE,EAAUF,EAAA,GA0B1B,MAAO,CAAEH,cAAAA,EAAeM,IAxBZ,SAACd,GAAqB,IAAAe,EAChC,GAAiC,QAA7BA,EAACd,EAAUe,IAAIR,UAAcO,IAAAA,GAAOA,QAAPA,EAA5BA,EAA8BE,aAA9BF,IAAmCA,IAAnCA,EAAqCG,SAASlB,GACjD,MAAM,IAAImB,MAAKC,eAAAA,OAAgBpB,EAAE,UAAAoB,OAASZ,IAE5CK,EAAU,GAAAO,OAAAC,EAAKT,GAAO,CAAEZ,KACxBS,EAAiBT,EAClB,EAkB4BsB,MALf,WACZb,EAAiBV,GACjBc,EAAW,CAACd,GACb,EAEmCwB,KAhBvB,WAAM,IAAAC,EACjB,GAAuB,IAAnBZ,EAAQa,OAAZ,CAEA,IAAMC,EAAiBd,EAAQA,EAAQa,OAAS,GAChD,GAAiC,QAA7BD,EAACvB,EAAUe,IAAIR,UAAcgB,IAAAA,GAAOA,QAAPA,EAA5BA,EAA8BP,aAA9BO,IAAmCA,IAAnCA,EAAqCN,SAASQ,GACjD,MAAM,IAAIP,MAAKC,eAAAA,OAAgBM,EAAc,UAAAN,OAASZ,IAExDK,EAAWD,EAAQe,MAAM,
|
|
1
|
+
{"version":3,"file":"useWizard.js","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","id","wizardMap","Map","wizardItem","_useState","useState","_useState2","_slicedToArray","currentStepId","setCurrentStepId","_useState3","_useState4","history","setHistory","set","_wizardMap$get","get","nodes","includes","Error","concat","_toConsumableArray","reset","back","_wizardMap$get2","length","previousStepId","slice"],"mappings":";wGAuBO,IAAMA,EAAY,SACvBC,EACAC,GAEA,IAAMC,EAAYD,QAAAA,EAAiBD,EAAI,GAAGG,GACpCC,EAAY,IAAIC,IAAIL,EAAIA,KAAI,SAACM,GAAU,MAAK,CAACA,EAAWH,GAAIG,EAAW,KAC7EC,EAA0CC,EAASN,GAAUO,EAAAC,EAAAH,EAAA,GAAtDI,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GACtCI,EAA8BL,EAAyB,CAACN,IAAWY,EAAAJ,EAAAG,EAAA,GAA5DE,EAAOD,EAAA,GAAEE,EAAUF,EAAA,GA0B1B,MAAO,CAAEH,cAAAA,EAAeM,IAxBZ,SAACd,GAAqB,IAAAe,EAChC,GAAiC,QAA7BA,EAACd,EAAUe,IAAIR,UAAcO,IAAAA,GAAOA,QAAPA,EAA5BA,EAA8BE,aAA9BF,IAAmCA,IAAnCA,EAAqCG,SAASlB,GACjD,MAAM,IAAImB,MAAKC,eAAAA,OAAgBpB,EAAE,UAAAoB,OAASZ,IAE5CK,EAAU,GAAAO,OAAAC,EAAKT,GAAO,CAAEZ,KACxBS,EAAiBT,EAClB,EAkB4BsB,MALf,WACZb,EAAiBV,GACjBc,EAAW,CAACd,GACb,EAEmCwB,KAhBvB,WAAM,IAAAC,EACjB,GAAuB,IAAnBZ,EAAQa,OAAZ,CAEA,IAAMC,EAAiBd,EAAQA,EAAQa,OAAS,GAChD,GAAiC,QAA7BD,EAACvB,EAAUe,IAAIR,UAAcgB,IAAAA,GAAOA,QAAPA,EAA5BA,EAA8BP,aAA9BO,IAAmCA,IAAnCA,EAAqCN,SAASQ,GACjD,MAAM,IAAIP,MAAKC,eAAAA,OAAgBM,EAAc,UAAAN,OAASZ,IAExDK,EAAWD,EAAQe,MAAM,GAAK,IAC9BlB,EAAiBG,EAAQA,EAAQa,OAAS,GAPhB,CAQ3B,EAOyCb,QAAAA,EAC5C"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
export{useActiveElement}from"./hooks/useActiveElement/useActiveElement.js";export{useAsync}from"./hooks/useAsync/useAsync.js";export{useBattery}from"./hooks/useBattery/useBattery.js";export{useBluetooth}from"./hooks/useBluetooth/useBluetooth.js";export{useBoolean}from"./hooks/useBoolean/useBoolean.js";export{useBreakpoints}from"./hooks/useBreakpoints/useBreakpoints.js";export{useBrowserLanguage}from"./hooks/useBrowserLanguage/useBrowserLanguage.js";export{useClickOutside}from"./hooks/useClickOutside/useClickOutside.js";export{isPermissionAllowed,legacyCopyToClipboard,useClipboard}from"./hooks/useClipboard/useClipboard.js";export{useConst}from"./hooks/useConst/useConst.js";export{useCounter}from"./hooks/useCounter/useCounter.js";export{useCssVar}from"./hooks/useCssVar/useCssVar.js";export{useDebounceCallback}from"./hooks/useDebounceCallback/useDebounceCallback.js";export{useDebounceValue}from"./hooks/useDebounceValue/useDebounceValue.js";export{useDefault}from"./hooks/useDefault/useDefault.js";export{useDeviceMotion}from"./hooks/useDeviceMotion/useDeviceMotion.js";export{useDeviceOrientation}from"./hooks/useDeviceOrientation/useDeviceOrientation.js";export{useDevicePixelRatio}from"./hooks/useDevicePixelRatio/useDevicePixelRatio.js";export{useDidUpdate}from"./hooks/useDidUpdate/useDidUpdate.js";export{useDisclosure}from"./hooks/useDisclosure/useDisclosure.js";export{useDocumentEvent}from"./hooks/useDocumentEvent/useDocumentEvent.js";export{useDocumentTitle}from"./hooks/useDocumentTitle/useDocumentTitle.js";export{useDocumentVisibility}from"./hooks/useDocumentVisibility/useDocumentVisibility.js";export{useElementSize}from"./hooks/useElementSize/useElementSize.js";export{useEvent}from"./hooks/useEvent/useEvent.js";export{useEventListener}from"./hooks/useEventListener/useEventListener.js";export{useEyeDropper}from"./hooks/useEyeDropper/useEyeDropper.js";export{useFavicon}from"./hooks/useFavicon/useFavicon.js";export{useField}from"./hooks/useField/useField.js";export{useFileDialog}from"./hooks/useFileDialog/useFileDialog.js";export{useFocus}from"./hooks/useFocus/useFocus.js";export{useFps}from"./hooks/useFps/useFps.js";export{useFullscreen}from"./hooks/useFullscreen/useFullscreen.js";export{useGamepad}from"./hooks/useGamepad/useGamepad.js";export{useGeolocation}from"./hooks/useGeolocation/useGeolocation.js";export{useHash}from"./hooks/useHash/useHash.js";export{isHotkeyMatch,useHotkeys}from"./hooks/useHotkeys/useHotkeys.js";export{useHover}from"./hooks/useHover/useHover.js";export{useIdle}from"./hooks/useIdle/useIdle.js";export{useImage}from"./hooks/useImage/useImage.js";export{useInfiniteScroll}from"./hooks/useInfiniteScroll/useInfiniteScroll.js";export{useIntersectionObserver}from"./hooks/useIntersectionObserver/useIntersectionObserver.js";export{useInterval}from"./hooks/useInterval/useInterval.js";export{useIsFirstRender}from"./hooks/useIsFirstRender/useIsFirstRender.js";export{useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";export{useKeyboard}from"./hooks/useKeyboard/useKeyboard.js";export{useKeyPress}from"./hooks/useKeyPress/useKeyPress.js";export{useKeyPressEvent}from"./hooks/useKeyPressEvent/useKeyPressEvent.js";export{useKeysPressed}from"./hooks/useKeysPressed/useKeysPressed.js";export{useLastChanged}from"./hooks/useLastChanged/useLastChanged.js";export{useLatest}from"./hooks/useLatest/useLatest.js";export{useList}from"./hooks/useList/useList.js";export{useLocalStorage}from"./hooks/useLocalStorage/useLocalStorage.js";export{useLogger}from"./hooks/useLogger/useLogger.js";export{useLongPress}from"./hooks/useLongPress/useLongPress.js";export{useMap}from"./hooks/useMap/useMap.js";export{useMeasure}from"./hooks/useMeasure/useMeasure.js";export{useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";export{useMemory}from"./hooks/useMemory/useMemory.js";export{useMount}from"./hooks/useMount/useMount.js";export{useMouse}from"./hooks/useMouse/useMouse.js";export{useMutation}from"./hooks/useMutation/useMutation.js";export{useMutationObserver}from"./hooks/useMutationObserver/useMutationObserver.js";export{getConnection,useNetwork}from"./hooks/useNetwork/useNetwork.js";export{useOffsetPagination}from"./hooks/useOffsetPagination/useOffsetPagination.js";export{useOnline}from"./hooks/useOnline/useOnline.js";export{getOperatingSystem,useOperatingSystem}from"./hooks/useOperatingSystem/useOperatingSystem.js";export{useOptimistic}from"./hooks/useOptimistic/useOptimistic.js";export{useOrientation}from"./hooks/useOrientation/useOrientation.js";export{useOtpCredential}from"./hooks/useOtpCredential/useOtpCredential.js";export{usePageLeave}from"./hooks/usePageLeave/usePageLeave.js";export{usePaint}from"./hooks/usePaint/usePaint.js";export{useParallax}from"./hooks/useParallax/useParallax.js";export{usePermission}from"./hooks/usePermission/usePermission.js";export{usePointerLock}from"./hooks/usePointerLock/usePointerLock.js";export{usePostMessage}from"./hooks/usePostMessage/usePostMessage.js";export{usePreferredColorScheme}from"./hooks/usePreferredColorScheme/usePreferredColorScheme.js";export{usePreferredContrast}from"./hooks/usePreferredContrast/usePreferredContrast.js";export{usePreferredDark}from"./hooks/usePreferredDark/usePreferredDark.js";export{usePreferredLanguages}from"./hooks/usePreferredLanguages/usePreferredLanguages.js";export{usePreferredReducedMotion}from"./hooks/usePreferredReducedMotion/usePreferredReducedMotion.js";export{usePrevious}from"./hooks/usePrevious/usePrevious.js";export{useQuery}from"./hooks/useQuery/useQuery.js";export{useQueue}from"./hooks/useQueue/useQueue.js";export{useRaf}from"./hooks/useRaf/useRaf.js";export{useRafValue}from"./hooks/useRafValue/useRafValue.js";export{useRefState}from"./hooks/useRefState/useRefState.js";export{useRenderCount}from"./hooks/useRenderCount/useRenderCount.js";export{useRenderInfo}from"./hooks/useRenderInfo/useRenderInfo.js";export{useRerender}from"./hooks/useRerender/useRerender.js";export{useResizeObserver}from"./hooks/useResizeObserver/useResizeObserver.js";export{useScreenOrientation}from"./hooks/useScreenOrientation/useScreenOrientation.js";export{SCRIPT_STATUS_ATTRIBUTE_NAME,useScript}from"./hooks/useScript/useScript.js";export{useScroll}from"./hooks/useScroll/useScroll.js";export{useScrollTo}from"./hooks/useScrollTo/useScrollTo.js";export{useSessionStorage}from"./hooks/useSessionStorage/useSessionStorage.js";export{useSet}from"./hooks/useSet/useSet.js";export{useShare}from"./hooks/useShare/useShare.js";export{useStep}from"./hooks/useStep/useStep.js";export{useStopwatch}from"./hooks/useStopwatch/useStopwatch.js";export{dispatchStorageEvent,useStorage}from"./hooks/useStorage/useStorage.js";export{useTextDirection}from"./hooks/useTextDirection/useTextDirection.js";export{getRangesSelection,useTextSelection}from"./hooks/useTextSelection/useTextSelection.js";export{useThrottleCallback}from"./hooks/useThrottleCallback/useThrottleCallback.js";export{useThrottleValue}from"./hooks/useThrottleValue/useThrottleValue.js";export{useTime}from"./hooks/useTime/useTime.js";export{useTimeout}from"./hooks/useTimeout/useTimeout.js";export{getTimeFromSeconds,useTimer}from"./hooks/useTimer/useTimer.js";export{useToggle}from"./hooks/useToggle/useToggle.js";export{useUnmount}from"./hooks/useUnmount/useUnmount.js";export{useVibrate}from"./hooks/useVibrate/useVibrate.js";export{useWebSocket}from"./hooks/useWebSocket/useWebSocket.js";export{useWindowEvent}from"./hooks/useWindowEvent/useWindowEvent.js";export{useWindowFocus}from"./hooks/useWindowFocus/useWindowFocus.js";export{scrollTo,useWindowScroll}from"./hooks/useWindowScroll/useWindowScroll.js";export{useWindowSize}from"./hooks/useWindowSize/useWindowSize.js";export{useWizard}from"./hooks/useWizard/useWizard.js";export{debounce}from"./utils/helpers/debounce.js";export{getElement}from"./utils/helpers/getElement.js";export{getRetry}from"./utils/helpers/getRetry.js";export{
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
export{useActiveElement}from"./hooks/useActiveElement/useActiveElement.js";export{useAsync}from"./hooks/useAsync/useAsync.js";export{useBattery}from"./hooks/useBattery/useBattery.js";export{useBluetooth}from"./hooks/useBluetooth/useBluetooth.js";export{useBoolean}from"./hooks/useBoolean/useBoolean.js";export{useBreakpoints}from"./hooks/useBreakpoints/useBreakpoints.js";export{useBrowserLanguage}from"./hooks/useBrowserLanguage/useBrowserLanguage.js";export{useClickOutside}from"./hooks/useClickOutside/useClickOutside.js";export{isPermissionAllowed,legacyCopyToClipboard,useClipboard}from"./hooks/useClipboard/useClipboard.js";export{useConst}from"./hooks/useConst/useConst.js";export{useCounter}from"./hooks/useCounter/useCounter.js";export{useCssVar}from"./hooks/useCssVar/useCssVar.js";export{useDebounceCallback}from"./hooks/useDebounceCallback/useDebounceCallback.js";export{useDebounceValue}from"./hooks/useDebounceValue/useDebounceValue.js";export{useDefault}from"./hooks/useDefault/useDefault.js";export{useDeviceMotion}from"./hooks/useDeviceMotion/useDeviceMotion.js";export{useDeviceOrientation}from"./hooks/useDeviceOrientation/useDeviceOrientation.js";export{useDevicePixelRatio}from"./hooks/useDevicePixelRatio/useDevicePixelRatio.js";export{useDidUpdate}from"./hooks/useDidUpdate/useDidUpdate.js";export{useDisclosure}from"./hooks/useDisclosure/useDisclosure.js";export{useDisplayMedia}from"./hooks/useDisplayMedia/useDisplayMedia.js";export{useDocumentEvent}from"./hooks/useDocumentEvent/useDocumentEvent.js";export{useDocumentTitle}from"./hooks/useDocumentTitle/useDocumentTitle.js";export{useDocumentVisibility}from"./hooks/useDocumentVisibility/useDocumentVisibility.js";export{useElementSize}from"./hooks/useElementSize/useElementSize.js";export{useEvent}from"./hooks/useEvent/useEvent.js";export{useEventListener}from"./hooks/useEventListener/useEventListener.js";export{useEyeDropper}from"./hooks/useEyeDropper/useEyeDropper.js";export{useFavicon}from"./hooks/useFavicon/useFavicon.js";export{useField}from"./hooks/useField/useField.js";export{useFileDialog}from"./hooks/useFileDialog/useFileDialog.js";export{useFocus}from"./hooks/useFocus/useFocus.js";export{useFps}from"./hooks/useFps/useFps.js";export{useFullscreen}from"./hooks/useFullscreen/useFullscreen.js";export{useGamepad}from"./hooks/useGamepad/useGamepad.js";export{useGeolocation}from"./hooks/useGeolocation/useGeolocation.js";export{useHash}from"./hooks/useHash/useHash.js";export{isHotkeyMatch,useHotkeys}from"./hooks/useHotkeys/useHotkeys.js";export{useHover}from"./hooks/useHover/useHover.js";export{useIdle}from"./hooks/useIdle/useIdle.js";export{useImage}from"./hooks/useImage/useImage.js";export{useInfiniteScroll}from"./hooks/useInfiniteScroll/useInfiniteScroll.js";export{useIntersectionObserver}from"./hooks/useIntersectionObserver/useIntersectionObserver.js";export{useInterval}from"./hooks/useInterval/useInterval.js";export{useIsFirstRender}from"./hooks/useIsFirstRender/useIsFirstRender.js";export{useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";export{useKeyboard}from"./hooks/useKeyboard/useKeyboard.js";export{useKeyPress}from"./hooks/useKeyPress/useKeyPress.js";export{useKeyPressEvent}from"./hooks/useKeyPressEvent/useKeyPressEvent.js";export{useKeysPressed}from"./hooks/useKeysPressed/useKeysPressed.js";export{useLastChanged}from"./hooks/useLastChanged/useLastChanged.js";export{useLatest}from"./hooks/useLatest/useLatest.js";export{useList}from"./hooks/useList/useList.js";export{useLocalStorage}from"./hooks/useLocalStorage/useLocalStorage.js";export{useLogger}from"./hooks/useLogger/useLogger.js";export{useLongPress}from"./hooks/useLongPress/useLongPress.js";export{useMap}from"./hooks/useMap/useMap.js";export{useMeasure}from"./hooks/useMeasure/useMeasure.js";export{useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";export{useMemory}from"./hooks/useMemory/useMemory.js";export{useMount}from"./hooks/useMount/useMount.js";export{useMouse}from"./hooks/useMouse/useMouse.js";export{useMutation}from"./hooks/useMutation/useMutation.js";export{useMutationObserver}from"./hooks/useMutationObserver/useMutationObserver.js";export{getConnection,useNetwork}from"./hooks/useNetwork/useNetwork.js";export{useOffsetPagination}from"./hooks/useOffsetPagination/useOffsetPagination.js";export{useOnline}from"./hooks/useOnline/useOnline.js";export{getOperatingSystem,useOperatingSystem}from"./hooks/useOperatingSystem/useOperatingSystem.js";export{useOptimistic}from"./hooks/useOptimistic/useOptimistic.js";export{useOrientation}from"./hooks/useOrientation/useOrientation.js";export{useOtpCredential}from"./hooks/useOtpCredential/useOtpCredential.js";export{usePageLeave}from"./hooks/usePageLeave/usePageLeave.js";export{usePaint}from"./hooks/usePaint/usePaint.js";export{useParallax}from"./hooks/useParallax/useParallax.js";export{usePermission}from"./hooks/usePermission/usePermission.js";export{usePointerLock}from"./hooks/usePointerLock/usePointerLock.js";export{usePostMessage}from"./hooks/usePostMessage/usePostMessage.js";export{usePreferredColorScheme}from"./hooks/usePreferredColorScheme/usePreferredColorScheme.js";export{usePreferredContrast}from"./hooks/usePreferredContrast/usePreferredContrast.js";export{usePreferredDark}from"./hooks/usePreferredDark/usePreferredDark.js";export{usePreferredLanguages}from"./hooks/usePreferredLanguages/usePreferredLanguages.js";export{usePreferredReducedMotion}from"./hooks/usePreferredReducedMotion/usePreferredReducedMotion.js";export{usePrevious}from"./hooks/usePrevious/usePrevious.js";export{useQuery}from"./hooks/useQuery/useQuery.js";export{useQueue}from"./hooks/useQueue/useQueue.js";export{useRaf}from"./hooks/useRaf/useRaf.js";export{useRafValue}from"./hooks/useRafValue/useRafValue.js";export{useRefState}from"./hooks/useRefState/useRefState.js";export{useRenderCount}from"./hooks/useRenderCount/useRenderCount.js";export{useRenderInfo}from"./hooks/useRenderInfo/useRenderInfo.js";export{useRerender}from"./hooks/useRerender/useRerender.js";export{useResizeObserver}from"./hooks/useResizeObserver/useResizeObserver.js";export{useScreenOrientation}from"./hooks/useScreenOrientation/useScreenOrientation.js";export{SCRIPT_STATUS_ATTRIBUTE_NAME,useScript}from"./hooks/useScript/useScript.js";export{useScroll}from"./hooks/useScroll/useScroll.js";export{useScrollIntoView}from"./hooks/useScrollIntoView/useScrollIntoView.js";export{useScrollTo}from"./hooks/useScrollTo/useScrollTo.js";export{useSessionStorage}from"./hooks/useSessionStorage/useSessionStorage.js";export{useSet}from"./hooks/useSet/useSet.js";export{useShare}from"./hooks/useShare/useShare.js";export{useStateHistory}from"./hooks/useStateHistory/useStateHistory.js";export{useStep}from"./hooks/useStep/useStep.js";export{useStopwatch}from"./hooks/useStopwatch/useStopwatch.js";export{dispatchStorageEvent,useStorage}from"./hooks/useStorage/useStorage.js";export{useTextDirection}from"./hooks/useTextDirection/useTextDirection.js";export{getRangesSelection,useTextSelection}from"./hooks/useTextSelection/useTextSelection.js";export{useThrottleCallback}from"./hooks/useThrottleCallback/useThrottleCallback.js";export{useThrottleValue}from"./hooks/useThrottleValue/useThrottleValue.js";export{useTime}from"./hooks/useTime/useTime.js";export{useTimeout}from"./hooks/useTimeout/useTimeout.js";export{getTimeFromSeconds,useTimer}from"./hooks/useTimer/useTimer.js";export{useToggle}from"./hooks/useToggle/useToggle.js";export{useUnmount}from"./hooks/useUnmount/useUnmount.js";export{useVibrate}from"./hooks/useVibrate/useVibrate.js";export{useWebSocket}from"./hooks/useWebSocket/useWebSocket.js";export{useWindowEvent}from"./hooks/useWindowEvent/useWindowEvent.js";export{useWindowFocus}from"./hooks/useWindowFocus/useWindowFocus.js";export{scrollTo,useWindowScroll}from"./hooks/useWindowScroll/useWindowScroll.js";export{useWindowSize}from"./hooks/useWindowSize/useWindowSize.js";export{useWizard}from"./hooks/useWizard/useWizard.js";export{debounce}from"./utils/helpers/debounce.js";export{getElement}from"./utils/helpers/getElement.js";export{getRetry}from"./utils/helpers/getRetry.js";export{isTarget}from"./utils/helpers/isTarget.js";export{throttle}from"./utils/helpers/throttle.js";export{getDate}from"./utils/helpers/time/getDate.js";export{BREAKPOINTS_ANT_DESIGN,BREAKPOINTS_BOOTSTRAP_V5,BREAKPOINTS_MANTINE,BREAKPOINTS_MASTER_CSS,BREAKPOINTS_MATERIAL_UI,BREAKPOINTS_PRIME_FLEX,BREAKPOINTS_QUASAR_V2,BREAKPOINTS_SEMANTIC,BREAKPOINTS_TAILWIND}from"./hooks/useBreakpoints/constants/breakpoints.js";export{mapGamepadToXbox360Controller}from"./hooks/useGamepad/helpers/mapGamepadToXbox360Controller.js";import"./_rollupPluginBabelHelpers-BQehtgCo.js";import"react";import"./hooks/usePaint/helpers/Paint.js";import"./hooks/usePaint/helpers/Pointer.js";import"react-dom";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
2
|
function r(r,t){var n;return function(){for(var e=this,o=arguments.length,u=new Array(o),i=0;i<o;i++)u[i]=arguments[i];clearTimeout(n),n=setTimeout((function(){return r.apply(e,u)}),t)}}export{r as debounce};
|
|
3
3
|
//# sourceMappingURL=debounce.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
2
|
var n=function(n){return"function"==typeof n?n():"string"==typeof n?document.querySelector(n):n instanceof Document||n instanceof Window||n instanceof Element?n:n.current};export{n as getElement};
|
|
3
3
|
//# sourceMappingURL=getElement.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
export{debounce}from"./debounce.js";export{getElement}from"./getElement.js";export{getRetry}from"./getRetry.js";export{
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
export{debounce}from"./debounce.js";export{getElement}from"./getElement.js";export{getRetry}from"./getRetry.js";export{isTarget}from"./isTarget.js";export{throttle}from"./throttle.js";export{getDate}from"./time/getDate.js";import"../../_rollupPluginBabelHelpers-BQehtgCo.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
var
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
|
+
import{b as n}from"../../_rollupPluginBabelHelpers-BQehtgCo.js";var e=function(e){return"string"==typeof e||e instanceof Element||e instanceof Window||e instanceof Document||e&&"object"===n(e)&&"current"in e};export{e as isTarget};
|
|
3
3
|
//# sourceMappingURL=isTarget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTarget.js","sources":["../../../../src/utils/helpers/isTarget.ts"],"sourcesContent":["export const isTarget = (target: any) =>\n typeof target === 'string' ||\n
|
|
1
|
+
{"version":3,"file":"isTarget.js","sources":["../../../../src/utils/helpers/isTarget.ts"],"sourcesContent":["export const isTarget = (target: any) =>\n typeof target === 'string' ||\n target instanceof Element ||\n target instanceof Window ||\n target instanceof Document ||\n (target && typeof target === 'object' && 'current' in target);\n"],"names":["isTarget","target","Element","Window","Document","_typeof"],"mappings":";oEAAaA,EAAW,SAACC,GAAW,MAChB,iBAAXA,GACPA,aAAkBC,SAClBD,aAAkBE,QAClBF,aAAkBG,UACjBH,GAA4B,WAAlBI,EAAOJ,IAAuB,YAAaA,CAAO"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
2
|
var n=function(n,t){var e=!1,r=null,u=function(){r?(n.apply(undefined,r),r=null,setTimeout(u,t)):e=!1};return function(){for(var i=arguments.length,l=new Array(i),o=0;o<i;o++)l[o]=arguments[o];e?r=l:(n.apply(this,l),e=!0,setTimeout(u,t))}};export{n as throttle};
|
|
3
3
|
//# sourceMappingURL=throttle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttle.js","sources":["../../../../src/utils/helpers/throttle.ts"],"sourcesContent":["export const throttle = <Params extends any[]>(\
|
|
1
|
+
{"version":3,"file":"throttle.js","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","apply","setTimeout","_len","arguments","length","args","Array","_key","this"],"mappings":";IAAaA,EAAW,SACtBC,EACAC,GAEA,IAAIC,GAAW,EACXC,EAA0B,KAExBC,EAAQ,WACPD,GAKLH,EAASK,gBAAYF,GACrBA,EAAW,KACXG,WAAWF,EAAOH,IANhBC,GAAW,CAOd,EAED,OAAO,WAAsC,IAAA,IAAAK,EAAAC,UAAAC,OAAdC,EAAIC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAJF,EAAIE,GAAAJ,UAAAI,GAC7BV,EACFC,EAAWO,GAIbV,EAASK,MAAMQ,KAAMH,GACrBR,GAAW,EACXI,WAAWF,EAAOH,GACnB,CACH"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.93 */
|
|
2
2
|
var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getSeconds(),n=e.getMinutes(),r=e.getHours();return{seconds:t,minutes:n,hours:r,meridiemHours:{value:r%12==0?12:r%12,type:r>=12?"pm":"am"},day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear(),timestamp:e.getTime()}};export{e as getDate};
|
|
3
3
|
//# sourceMappingURL=getDate.js.map
|