@siberiacancode/reactuse 0.0.95 → 0.0.96
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/{_rollupPluginBabelHelpers-DIvgGtEH.js → _rollupPluginBabelHelpers-zZt1zBDH.js} +2 -2
- package/dist/cjs/_rollupPluginBabelHelpers-zZt1zBDH.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/useBluetooth/useBluetooth.js +2 -2
- package/dist/cjs/hooks/useBoolean/useBoolean.js +2 -2
- package/dist/cjs/hooks/useBreakpoints/helpers/breakpoints.js +1 -1
- package/dist/cjs/hooks/useBreakpoints/helpers/index.js +1 -1
- package/dist/cjs/hooks/useBreakpoints/useBreakpoints.js +2 -2
- package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.js +2 -2
- package/dist/cjs/hooks/useClipboard/useClipboard.js +2 -2
- package/dist/cjs/hooks/useConst/useConst.js +1 -1
- package/dist/cjs/hooks/useCookie/helpers/clearCookies.js +2 -2
- package/dist/cjs/hooks/useCookie/helpers/getCookies.js +2 -2
- package/dist/cjs/hooks/useCookie/helpers/getCookies.js.map +1 -1
- package/dist/cjs/hooks/useCookie/helpers/index.js +2 -2
- package/dist/cjs/hooks/useCookie/helpers/removeCookie.js +1 -1
- package/dist/cjs/hooks/useCookie/helpers/setCookie.js +1 -1
- package/dist/cjs/hooks/useCookie/useCookie.js +2 -2
- package/dist/cjs/hooks/useCookie/useCookie.js.map +1 -1
- package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
- package/dist/cjs/hooks/useCssVar/useCssVar.js +2 -2
- package/dist/cjs/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
- package/dist/cjs/hooks/useDebounceValue/useDebounceValue.js +2 -2
- package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
- package/dist/cjs/hooks/useDeviceMotion/useDeviceMotion.js +2 -2
- package/dist/cjs/hooks/useDeviceOrientation/useDeviceOrientation.js +2 -2
- package/dist/cjs/hooks/useDevicePixelRatio/useDevicePixelRatio.js +2 -2
- package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
- package/dist/cjs/hooks/useDisclosure/useDisclosure.js +2 -2
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.js +2 -2
- package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +2 -2
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
- package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
- package/dist/cjs/hooks/useElementSize/useElementSize.js +2 -2
- package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.js +2 -2
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
- package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
- package/dist/cjs/hooks/useField/useField.js +2 -2
- package/dist/cjs/hooks/useFileDialog/useFileDialog.js +2 -2
- package/dist/cjs/hooks/useFocus/useFocus.js +2 -2
- package/dist/cjs/hooks/useFps/useFps.js +2 -2
- package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
- package/dist/cjs/hooks/useGamepad/helpers/index.js +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/useHover/useHover.js +2 -2
- package/dist/cjs/hooks/useIdle/useIdle.js +2 -2
- package/dist/cjs/hooks/useImage/useImage.js +2 -2
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.js +2 -2
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
- package/dist/cjs/hooks/useInterval/useInterval.js +2 -2
- package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
- package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
- package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
- package/dist/cjs/hooks/useKeyboard/useKeyboard.js +2 -2
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
- package/dist/cjs/hooks/useLastChanged/useLastChanged.js +2 -2
- 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/useLogger/useLogger.js +2 -2
- package/dist/cjs/hooks/useLongPress/useLongPress.js +2 -2
- package/dist/cjs/hooks/useMap/useMap.js +2 -2
- package/dist/cjs/hooks/useMeasure/useMeasure.js +2 -2
- 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/useMutation/useMutation.js +2 -2
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.js +2 -2
- package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
- 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/useOrientation/useOrientation.js +2 -2
- 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/useParallax/useParallax.js +2 -2
- 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/useQueue/useQueue.js +2 -2
- package/dist/cjs/hooks/useRaf/useRaf.js +2 -2
- package/dist/cjs/hooks/useRafValue/useRafValue.js +2 -2
- package/dist/cjs/hooks/useRefState/useRefState.js +2 -2
- 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/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/useScrollIntoView/useScrollIntoView.js +2 -2
- package/dist/cjs/hooks/useScrollTo/useScrollTo.js +2 -2
- package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
- package/dist/cjs/hooks/useSet/useSet.js +2 -2
- package/dist/cjs/hooks/useShare/useShare.js +2 -2
- package/dist/cjs/hooks/useStateHistory/useStateHistory.js +2 -2
- 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/useTextSelection/useTextSelection.js +2 -2
- package/dist/cjs/hooks/useThrottleCallback/useThrottleCallback.js +1 -1
- package/dist/cjs/hooks/useThrottleValue/useThrottleValue.js +2 -2
- package/dist/cjs/hooks/useTime/useTime.js +2 -2
- 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/useWindowEvent/useWindowEvent.js +2 -2
- package/dist/cjs/hooks/useWindowFocus/useWindowFocus.js +2 -2
- package/dist/cjs/hooks/useWindowScroll/useWindowScroll.js +2 -2
- package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
- package/dist/cjs/hooks/useWizard/useWizard.js +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/utils/helpers/debounce.js +1 -1
- package/dist/cjs/utils/helpers/getDate.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/throttle.js +1 -1
- package/dist/esm/{_rollupPluginBabelHelpers-iXwxU9oY.js → _rollupPluginBabelHelpers-B03Kl8w9.js} +2 -2
- package/dist/esm/_rollupPluginBabelHelpers-B03Kl8w9.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/useBluetooth/useBluetooth.js +2 -2
- package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
- package/dist/esm/hooks/useBreakpoints/helpers/breakpoints.js +1 -1
- package/dist/esm/hooks/useBreakpoints/helpers/index.js +1 -1
- package/dist/esm/hooks/useBreakpoints/useBreakpoints.js +2 -2
- package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.js +2 -2
- package/dist/esm/hooks/useClipboard/useClipboard.js +2 -2
- package/dist/esm/hooks/useConst/useConst.js +1 -1
- package/dist/esm/hooks/useCookie/helpers/clearCookies.js +2 -2
- package/dist/esm/hooks/useCookie/helpers/getCookies.js +2 -2
- package/dist/esm/hooks/useCookie/helpers/getCookies.js.map +1 -1
- package/dist/esm/hooks/useCookie/helpers/index.js +2 -2
- package/dist/esm/hooks/useCookie/helpers/removeCookie.js +1 -1
- package/dist/esm/hooks/useCookie/helpers/setCookie.js +1 -1
- package/dist/esm/hooks/useCookie/useCookie.js +2 -2
- package/dist/esm/hooks/useCookie/useCookie.js.map +1 -1
- package/dist/esm/hooks/useCounter/useCounter.js +2 -2
- package/dist/esm/hooks/useCssVar/useCssVar.js +2 -2
- package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
- package/dist/esm/hooks/useDebounceValue/useDebounceValue.js +2 -2
- package/dist/esm/hooks/useDefault/useDefault.js +2 -2
- package/dist/esm/hooks/useDeviceMotion/useDeviceMotion.js +2 -2
- package/dist/esm/hooks/useDeviceOrientation/useDeviceOrientation.js +2 -2
- package/dist/esm/hooks/useDevicePixelRatio/useDevicePixelRatio.js +2 -2
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +1 -1
- package/dist/esm/hooks/useDisclosure/useDisclosure.js +2 -2
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.js +2 -2
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +2 -2
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
- package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
- package/dist/esm/hooks/useElementSize/useElementSize.js +2 -2
- package/dist/esm/hooks/useEvent/useEvent.js +1 -1
- package/dist/esm/hooks/useEventListener/useEventListener.js +2 -2
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
- package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
- package/dist/esm/hooks/useField/useField.js +2 -2
- package/dist/esm/hooks/useFileDialog/useFileDialog.js +2 -2
- package/dist/esm/hooks/useFocus/useFocus.js +2 -2
- package/dist/esm/hooks/useFps/useFps.js +2 -2
- package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
- package/dist/esm/hooks/useGamepad/helpers/index.js +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/useHover/useHover.js +2 -2
- package/dist/esm/hooks/useIdle/useIdle.js +2 -2
- package/dist/esm/hooks/useImage/useImage.js +2 -2
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.js +2 -2
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
- package/dist/esm/hooks/useInterval/useInterval.js +2 -2
- package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
- package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
- package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
- package/dist/esm/hooks/useKeyboard/useKeyboard.js +2 -2
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
- package/dist/esm/hooks/useLastChanged/useLastChanged.js +2 -2
- 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/useLogger/useLogger.js +2 -2
- package/dist/esm/hooks/useLongPress/useLongPress.js +2 -2
- package/dist/esm/hooks/useMap/useMap.js +2 -2
- package/dist/esm/hooks/useMeasure/useMeasure.js +2 -2
- 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/useMutation/useMutation.js +2 -2
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.js +2 -2
- package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
- 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/useOrientation/useOrientation.js +2 -2
- 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/useParallax/useParallax.js +2 -2
- 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/useQueue/useQueue.js +2 -2
- package/dist/esm/hooks/useRaf/useRaf.js +2 -2
- package/dist/esm/hooks/useRafValue/useRafValue.js +2 -2
- package/dist/esm/hooks/useRefState/useRefState.js +2 -2
- 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/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/useScrollIntoView/useScrollIntoView.js +2 -2
- package/dist/esm/hooks/useScrollTo/useScrollTo.js +2 -2
- package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
- package/dist/esm/hooks/useSet/useSet.js +2 -2
- package/dist/esm/hooks/useShare/useShare.js +2 -2
- package/dist/esm/hooks/useStateHistory/useStateHistory.js +2 -2
- 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/useTextSelection/useTextSelection.js +2 -2
- package/dist/esm/hooks/useThrottleCallback/useThrottleCallback.js +1 -1
- package/dist/esm/hooks/useThrottleValue/useThrottleValue.js +2 -2
- package/dist/esm/hooks/useTime/useTime.js +2 -2
- 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/useWindowEvent/useWindowEvent.js +2 -2
- package/dist/esm/hooks/useWindowFocus/useWindowFocus.js +2 -2
- package/dist/esm/hooks/useWindowScroll/useWindowScroll.js +2 -2
- package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
- package/dist/esm/hooks/useWizard/useWizard.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/utils/helpers/debounce.js +1 -1
- package/dist/esm/utils/helpers/getDate.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/throttle.js +1 -1
- package/dist/types/index.d.ts +9 -24
- package/package.json +1 -1
- package/dist/cjs/_rollupPluginBabelHelpers-DIvgGtEH.js.map +0 -1
- package/dist/cjs/hooks/useCookies/useCookies.js +0 -3
- package/dist/cjs/hooks/useCookies/useCookies.js.map +0 -1
- package/dist/esm/_rollupPluginBabelHelpers-iXwxU9oY.js.map +0 -1
- package/dist/esm/hooks/useCookies/useCookies.js +0 -3
- package/dist/esm/hooks/useCookies/useCookies.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.96 */
|
|
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{getDate}from"./getDate.js";export{getElement}from"./getElement.js";export{getRetry}from"./getRetry.js";export{isTarget}from"./isTarget.js";export{throttle}from"./throttle.js";import"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.96 */
|
|
2
|
+
export{debounce}from"./debounce.js";export{getDate}from"./getDate.js";export{getElement}from"./getElement.js";export{getRetry}from"./getRetry.js";export{isTarget}from"./isTarget.js";export{throttle}from"./throttle.js";import"../../_rollupPluginBabelHelpers-B03Kl8w9.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{b as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.96 */
|
|
2
|
+
import{b as n}from"../../_rollupPluginBabelHelpers-B03Kl8w9.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,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.96 */
|
|
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
|
package/dist/types/index.d.ts
CHANGED
|
@@ -364,6 +364,12 @@ declare const useClipboard: (params?: UseCopyToClipboardParams) => UseCopyToClip
|
|
|
364
364
|
*/
|
|
365
365
|
declare const useConst: <Value>(initialValue: (() => Value) | Value) => Value;
|
|
366
366
|
|
|
367
|
+
declare const clearCookies: () => void;
|
|
368
|
+
|
|
369
|
+
declare const getCookies: () => {
|
|
370
|
+
[k: string]: string;
|
|
371
|
+
};
|
|
372
|
+
|
|
367
373
|
interface RemoveCookieParams {
|
|
368
374
|
domain?: string;
|
|
369
375
|
expires?: Date;
|
|
@@ -372,6 +378,7 @@ interface RemoveCookieParams {
|
|
|
372
378
|
sameSite?: 'Lax' | 'None' | 'Strict';
|
|
373
379
|
secure?: boolean;
|
|
374
380
|
}
|
|
381
|
+
declare const removeCookie: (key: string, options?: RemoveCookieParams) => void;
|
|
375
382
|
|
|
376
383
|
interface SetCookieParams {
|
|
377
384
|
domain?: string;
|
|
@@ -382,6 +389,7 @@ interface SetCookieParams {
|
|
|
382
389
|
sameSite?: 'Lax' | 'None' | 'Strict';
|
|
383
390
|
secure?: boolean;
|
|
384
391
|
}
|
|
392
|
+
declare const setCookie: (key: string, value: string, options?: SetCookieParams) => void;
|
|
385
393
|
|
|
386
394
|
type UseCookieInitialValue<Value> = (() => Value) | Value;
|
|
387
395
|
interface UseCookieOptions<Value> {
|
|
@@ -416,29 +424,6 @@ declare const useCookie: <Value>(key: string, params?: UseCookieInitialValue<Val
|
|
|
416
424
|
remove: (options?: RemoveCookieParams) => void;
|
|
417
425
|
};
|
|
418
426
|
|
|
419
|
-
/**
|
|
420
|
-
* @name useCookies
|
|
421
|
-
* @description - Hook that manages cookie values
|
|
422
|
-
* @category Browser
|
|
423
|
-
*
|
|
424
|
-
* @overload
|
|
425
|
-
* @template {object} Value The type of the cookie values
|
|
426
|
-
* @param {string} key The key of the cookie
|
|
427
|
-
* @returns {UseCookieReturn<Value>} The value and the set function
|
|
428
|
-
*
|
|
429
|
-
* @example
|
|
430
|
-
* const { value, set, remove, getAll, clear } = useCookies();
|
|
431
|
-
*/
|
|
432
|
-
declare const useCookies: <Value>() => {
|
|
433
|
-
value: Value;
|
|
434
|
-
set: (key: string, value: Value, options?: SetCookieParams) => void;
|
|
435
|
-
remove: (key: string, options?: RemoveCookieParams) => void;
|
|
436
|
-
getAll: () => {
|
|
437
|
-
[k: string]: any;
|
|
438
|
-
};
|
|
439
|
-
clear: () => void;
|
|
440
|
-
};
|
|
441
|
-
|
|
442
427
|
/** The use counter options */
|
|
443
428
|
interface UseCounterOptions {
|
|
444
429
|
/** The max of count value */
|
|
@@ -3984,4 +3969,4 @@ declare const isTarget: (target: any) => any;
|
|
|
3984
3969
|
|
|
3985
3970
|
declare const throttle: <Params extends any[]>(callback: (...args: Params) => void, delay: number) => ((...args: Params) => void);
|
|
3986
3971
|
|
|
3987
|
-
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, type BatteryManager, type Breakpoints, COOKIE_EVENT, type ColorSelectionOptions, type ColorSelectionResult, type Connection, type ConnectionEffectiveType, type ConnectionType, type EyeDropper, type EyeDropperConstructor, type GetElementTarget, type LongPressReactEvents, type OperatingSystem, type OrientationLockType, type RequestOptions, SCRIPT_STATUS_ATTRIBUTE_NAME, STORAGE_EVENT, type ScrollPosition, type StateRef, type UseAsyncReturn, type UseBatteryStateReturn, type UseBatteryValue, type UseBluetoothOptions, type UseBluetoothReturn, type UseBooleanReturn, type UseBreakpointsReturn, type UseBreakpointsStrategy, type UseClickOutside, type UseClickOutsideTarget, type UseCookieInitialValue, type UseCookieOptions, type UseCookieReturn, type UseCopyToClipboardParams, type UseCopyToClipboardReturn, type UseCounter, type UseCounterOptions, type UseCounterReturn, type UseCssVar, type UseCssVarReturn, type UseCssVarTarget, type UseDeviceMotionParams, type UseDeviceMotionReturn, type UseDeviceOrientationReturn, type UseDeviceOrientationValue, type UseDevicePixelRatioReturn, type UseDisclosureOptions, type UseDisclosureReturn, type UseDisplayMediaOptions, type UseDisplayMediaOverload, type UseDisplayMediaReturn, type UseDisplayMediaTarget, type UseDocumentTitleOptions, type UseDocumentTitleReturn, type UseElementSize, type UseElementSizeReturn, type UseElementSizeTarget, type UseElementSizeValue, type UseEventListener, type UseEventListenerOptions, type UseEventListenerReturn, type UseEventListenerTarget, type UseEyeDropperReturn, type UseFaviconReturn, type UseFieldParams, type UseFieldRegisterParams, type UseFieldReturn, type UseFileDialog, type UseFileDialogOptions, type UseFileDialogReturn, type UseFocus, type UseFocusOptions, type UseFocusReturn, type UseFocusTarget, type UseFullScreen, type UseFullScreenOptions, type UseFullScreenReturn, type UseFullScreenTarget, type UseGamepadStateReturn, type UseGeolocationParams, type UseGeolocationReturn, type UseHotkeys, type UseHotkeysHotkeys, type UseHotkeysKey, type UseHotkeysOptions, type UseHotkeysTarget, type UseHover, type UseHoverOptions, type UseHoverTarget, type UseIdleOptions, type UseIdleReturn, type UseImageOptions, type UseImageReturn, type UseInfiniteScroll, type UseInfiniteScrollOptions, type UseInfiniteScrollTarget, type UseIntersectionObserver, type UseIntersectionObserverOptions, type UseIntersectionObserverReturn, type UseIntersectionObserverTarget, type UseIntervalOptions, type UseIntervalReturn, type UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseKeyboardParams, type UseKeysPressedParams, type UseLastChangedOptions, type UseListReturn, type UseLongPressBind, type UseLongPressOptions, type UseLongPressReturn, type UseLongPressTarget, type UseMapReturn, type UseMeasureReturn, type UseMeasureScreen, type UseMeasureTarget, type UseMemoryReturn, type UseMouse, type UseMouseReturn, type UseMouseTarget, type UseMutationObserver, type UseMutationObserverOptions, type UseMutationObserverReturn, type UseMutationObserverTarget, type UseNetworkReturn, type UseOffsetPaginationOptions, type UseOffsetPaginationReturn, type UseOptimisticReturn, type UseOrientationReturn, type UseOtpCredential, type UseOtpCredentialCallback, type UseOtpCredentialParams, type UseOtpCredentialReturn, type UsePaint, type UsePaintOptions, type UsePaintReturn, type UsePaintTarget, type UseParallax, type UseParallaxOptions, type UseParallaxValue, type UsePermissionName, type UsePermissionOptions, type UsePermissionReturn, type UsePostMessageReturn, type UsePreferredColorSchemeReturn, type UsePreferredContrastReturn, type UsePreferredReducedMotionReturn, type UsePreviousOptions, type UseQueryOptions, type UseQueryReturn, type UseQueueReturn, type UseRafCallback, type UseRafOptions, type UseRafParams, type UseRafReturn, type UseRafValueReturn, type UseRenderInfoReturn, type UseResizeObserver, type UseResizeObserverOptions, type UseResizeObserverReturn, type UseResizeObserverTarget, type UseScreenOrientationValue, type UseScriptOptions, type UseScriptStatus, type UseScroll, type UseScrollCallbackParams, type UseScrollIntoViewOptions, type UseScrollIntoViewOverload, type UseScrollIntoViewReturn, type UseScrollIntoViewTarget, type UseScrollOptions, type UseScrollTarget, type UseScrollTo, type UseScrollToOptions, type UseScrollToReturn, type UseScrollToTarget, type UseShareParams, type UseShareReturn, type UseStopwatchOptions, type UseStopwatchReturn, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseTextDirection, type UseTextDirectionReturn, type UseTextDirectionTarget, type UseTextDirectionValue, type UseTextSelectionReturn, type UseTimeReturn, type UseTimer, type UseTimerOptions, type UseTimerReturn, type UseToggleReturn, type UseVibratePattern, type UseVibrateReturn, type UseWebSocketOptions, type UseWebSocketReturn, type UseWebSocketStatus, type UseWebSocketUrl, type UseWindowSizeReturn, type WizardItem, debounce, dispatchCookieEvent, dispatchStorageEvent, getConnection, getDate, getElement, getOperatingSystem, getRangesSelection, getRetry, getTimeFromSeconds, isHotkeyMatch, isPermissionAllowed, isTarget, legacyCopyToClipboard, mapGamepadToXbox360Controller, scrollTo, throttle, useActiveElement, useAsync, useBattery, useBluetooth, useBoolean, useBreakpoints, useBrowserLanguage, useClickOutside, useClipboard, useConst, useCookie,
|
|
3972
|
+
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, type BatteryManager, type Breakpoints, COOKIE_EVENT, type ColorSelectionOptions, type ColorSelectionResult, type Connection, type ConnectionEffectiveType, type ConnectionType, type EyeDropper, type EyeDropperConstructor, type GetElementTarget, type LongPressReactEvents, type OperatingSystem, type OrientationLockType, type RemoveCookieParams, type RequestOptions, SCRIPT_STATUS_ATTRIBUTE_NAME, STORAGE_EVENT, type ScrollPosition, type SetCookieParams, type StateRef, type UseAsyncReturn, type UseBatteryStateReturn, type UseBatteryValue, type UseBluetoothOptions, type UseBluetoothReturn, type UseBooleanReturn, type UseBreakpointsReturn, type UseBreakpointsStrategy, type UseClickOutside, type UseClickOutsideTarget, type UseCookieInitialValue, type UseCookieOptions, type UseCookieReturn, type UseCopyToClipboardParams, type UseCopyToClipboardReturn, type UseCounter, type UseCounterOptions, type UseCounterReturn, type UseCssVar, type UseCssVarReturn, type UseCssVarTarget, type UseDeviceMotionParams, type UseDeviceMotionReturn, type UseDeviceOrientationReturn, type UseDeviceOrientationValue, type UseDevicePixelRatioReturn, type UseDisclosureOptions, type UseDisclosureReturn, type UseDisplayMediaOptions, type UseDisplayMediaOverload, type UseDisplayMediaReturn, type UseDisplayMediaTarget, type UseDocumentTitleOptions, type UseDocumentTitleReturn, type UseElementSize, type UseElementSizeReturn, type UseElementSizeTarget, type UseElementSizeValue, type UseEventListener, type UseEventListenerOptions, type UseEventListenerReturn, type UseEventListenerTarget, type UseEyeDropperReturn, type UseFaviconReturn, type UseFieldParams, type UseFieldRegisterParams, type UseFieldReturn, type UseFileDialog, type UseFileDialogOptions, type UseFileDialogReturn, type UseFocus, type UseFocusOptions, type UseFocusReturn, type UseFocusTarget, type UseFullScreen, type UseFullScreenOptions, type UseFullScreenReturn, type UseFullScreenTarget, type UseGamepadStateReturn, type UseGeolocationParams, type UseGeolocationReturn, type UseHotkeys, type UseHotkeysHotkeys, type UseHotkeysKey, type UseHotkeysOptions, type UseHotkeysTarget, type UseHover, type UseHoverOptions, type UseHoverTarget, type UseIdleOptions, type UseIdleReturn, type UseImageOptions, type UseImageReturn, type UseInfiniteScroll, type UseInfiniteScrollOptions, type UseInfiniteScrollTarget, type UseIntersectionObserver, type UseIntersectionObserverOptions, type UseIntersectionObserverReturn, type UseIntersectionObserverTarget, type UseIntervalOptions, type UseIntervalReturn, type UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseKeyboardParams, type UseKeysPressedParams, type UseLastChangedOptions, type UseListReturn, type UseLongPressBind, type UseLongPressOptions, type UseLongPressReturn, type UseLongPressTarget, type UseMapReturn, type UseMeasureReturn, type UseMeasureScreen, type UseMeasureTarget, type UseMemoryReturn, type UseMouse, type UseMouseReturn, type UseMouseTarget, type UseMutationObserver, type UseMutationObserverOptions, type UseMutationObserverReturn, type UseMutationObserverTarget, type UseNetworkReturn, type UseOffsetPaginationOptions, type UseOffsetPaginationReturn, type UseOptimisticReturn, type UseOrientationReturn, type UseOtpCredential, type UseOtpCredentialCallback, type UseOtpCredentialParams, type UseOtpCredentialReturn, type UsePaint, type UsePaintOptions, type UsePaintReturn, type UsePaintTarget, type UseParallax, type UseParallaxOptions, type UseParallaxValue, type UsePermissionName, type UsePermissionOptions, type UsePermissionReturn, type UsePostMessageReturn, type UsePreferredColorSchemeReturn, type UsePreferredContrastReturn, type UsePreferredReducedMotionReturn, type UsePreviousOptions, type UseQueryOptions, type UseQueryReturn, type UseQueueReturn, type UseRafCallback, type UseRafOptions, type UseRafParams, type UseRafReturn, type UseRafValueReturn, type UseRenderInfoReturn, type UseResizeObserver, type UseResizeObserverOptions, type UseResizeObserverReturn, type UseResizeObserverTarget, type UseScreenOrientationValue, type UseScriptOptions, type UseScriptStatus, type UseScroll, type UseScrollCallbackParams, type UseScrollIntoViewOptions, type UseScrollIntoViewOverload, type UseScrollIntoViewReturn, type UseScrollIntoViewTarget, type UseScrollOptions, type UseScrollTarget, type UseScrollTo, type UseScrollToOptions, type UseScrollToReturn, type UseScrollToTarget, type UseShareParams, type UseShareReturn, type UseStopwatchOptions, type UseStopwatchReturn, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseTextDirection, type UseTextDirectionReturn, type UseTextDirectionTarget, type UseTextDirectionValue, type UseTextSelectionReturn, type UseTimeReturn, type UseTimer, type UseTimerOptions, type UseTimerReturn, type UseToggleReturn, type UseVibratePattern, type UseVibrateReturn, type UseWebSocketOptions, type UseWebSocketReturn, type UseWebSocketStatus, type UseWebSocketUrl, type UseWindowSizeReturn, type WizardItem, clearCookies, debounce, dispatchCookieEvent, dispatchStorageEvent, getConnection, getCookies, getDate, getElement, getOperatingSystem, getRangesSelection, getRetry, getTimeFromSeconds, isHotkeyMatch, isPermissionAllowed, isTarget, legacyCopyToClipboard, mapGamepadToXbox360Controller, removeCookie, scrollTo, setCookie, throttle, useActiveElement, useAsync, useBattery, useBluetooth, useBoolean, useBreakpoints, useBrowserLanguage, useClickOutside, useClipboard, useConst, useCookie, useCounter, useCssVar, useDebounceCallback, useDebounceValue, useDefault, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDidUpdate, useDisclosure, useDisplayMedia, useDocumentEvent, useDocumentTitle, useDocumentVisibility, useElementSize, useEvent, useEventListener, useEyeDropper, useFavicon, useField, useFileDialog, useFocus, useFps, useFullscreen, useGamepad, useGeolocation, useHash, useHotkeys, useHover, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useInterval, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeyboard, useKeysPressed, useLastChanged, useLatest, useList, useLocalStorage, useLogger, useLongPress, useMap, useMeasure, useMediaQuery, useMemory, useMount, useMouse, useMutation, useMutationObserver, useNetwork, useOffsetPagination, useOnline, useOperatingSystem, useOptimistic, useOrientation, useOtpCredential, usePageLeave, usePaint, useParallax, usePermission, usePointerLock, usePostMessage, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useQuery, useQueue, useRaf, useRafValue, useRefState, useRenderCount, useRenderInfo, useRerender, useResizeObserver, useScreenOrientation, type useScreenOrientationReturn, useScript, useScroll, useScrollIntoView, useScrollTo, useSessionStorage, useSet, useShare, useStateHistory, useStep, useStopwatch, useStorage, useTextDirection, useTextSelection, useThrottleCallback, useThrottleValue, useTime, useTimeout, useTimer, useToggle, useUnmount, useVibrate, useWebSocket, useWindowEvent, useWindowFocus, useWindowScroll, useWindowSize, useWizard };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers-DIvgGtEH.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.95 */
|
|
2
|
-
"use strict";var e=require("../../_rollupPluginBabelHelpers-DIvgGtEH.js"),o=require("react"),i=require("../useCookie/helpers/clearCookies.js"),r=require("../useCookie/helpers/getCookies.js"),t=require("../useCookie/helpers/removeCookie.js"),n=require("../useCookie/helpers/setCookie.js"),s=require("../useCookie/useCookie.js"),u=function(e,o){t.removeCookie(e,o),s.dispatchCookieEvent()};exports.useCookies=function(){var t=o.useState("undefined"!=typeof window?r.getCookies(!0):{}),C=e._slicedToArray(t,2),c=C[0],k=C[1];o.useEffect((function(){var e=function(){return k(r.getCookies(!0))};return window.addEventListener(s.COOKIE_EVENT,e),function(){window.removeEventListener(s.COOKIE_EVENT,e)}}),[]);return{value:c,set:function(e,o,i){if(null===o)return u(e);!function(e,o,i){n.setCookie(e,o,i),s.dispatchCookieEvent()}(e,o,i)},remove:function(e,o){return u(e,o)},getAll:function(){return r.getCookies(!0)},clear:function(){return i.clearCookies(),void s.dispatchCookieEvent()}}};
|
|
3
|
-
//# sourceMappingURL=useCookies.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCookies.js","sources":["../../../../src/hooks/useCookies/useCookies.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport type { RemoveCookieParams, SetCookieParams } from '../useCookie/helpers';\n\nimport { clearCookies, getCookies, removeCookie, setCookie } from '../useCookie/helpers';\nimport { COOKIE_EVENT, dispatchCookieEvent } from '../useCookie/useCookie';\n\nconst setCookieItem = (key: string, value: any, options?: SetCookieParams) => {\n setCookie(key, value, options);\n dispatchCookieEvent();\n};\n\nconst removeCookieItem = (key: string, options?: RemoveCookieParams) => {\n removeCookie(key, options);\n dispatchCookieEvent();\n};\n\nconst clearCookieItems = () => {\n clearCookies();\n dispatchCookieEvent();\n};\n/**\n * @name useCookies\n * @description - Hook that manages cookie values\n * @category Browser\n *\n * @overload\n * @template {object} Value The type of the cookie values\n * @param {string} key The key of the cookie\n * @returns {UseCookieReturn<Value>} The value and the set function\n *\n * @example\n * const { value, set, remove, getAll, clear } = useCookies();\n */\nexport const useCookies = <Value>() => {\n const [value, setValue] = useState<Value>(\n typeof window !== 'undefined' ? (getCookies(true) as Value) : ({} as Value)\n );\n\n useEffect(() => {\n const onChange = () => setValue(getCookies(true) as Value);\n\n window.addEventListener(COOKIE_EVENT, onChange);\n return () => {\n window.removeEventListener(COOKIE_EVENT, onChange);\n };\n }, []);\n\n const set = (key: string, value: Value, options?: SetCookieParams) => {\n if (value === null) return removeCookieItem(key);\n setCookieItem(key, value, options);\n };\n\n const remove = (key: string, options?: RemoveCookieParams) => removeCookieItem(key, options);\n const getAll = () => getCookies(true);\n const clear = () => clearCookieItems();\n\n return { value, set, remove, getAll, clear };\n};\n"],"names":["removeCookieItem","key","options","removeCookie","dispatchCookieEvent","_useState","useState","window","getCookies","_useState2","_slicedToArray","value","setValue","useEffect","onChange","addEventListener","COOKIE_EVENT","removeEventListener","set","setCookie","setCookieItem","remove","getAll","clear","clearCookies"],"mappings":";uUAYMA,EAAmB,SAACC,EAAaC,GACrCC,EAAYA,aAACF,EAAKC,GAClBE,uBACF,qBAmB0B,WACxB,IAAAC,EAA0BC,EAAQA,SACd,oBAAXC,OAA0BC,cAAW,GAAmB,IAChEC,EAAAC,EAAAA,eAAAL,EAAA,GAFMM,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAItBI,EAAAA,WAAU,WACR,IAAMC,EAAW,WAAH,OAASF,EAASJ,cAAW,GAAe,EAG1D,OADAD,OAAOQ,iBAAiBC,EAAYA,aAAEF,GAC/B,WACLP,OAAOU,oBAAoBD,EAAYA,aAAEF,EAC1C,CACF,GAAE,IAWH,MAAO,CAAEH,MAAAA,EAAOO,IATJ,SAACjB,EAAaU,EAAcT,GACtC,GAAc,OAAVS,EAAgB,OAAOX,EAAiBC,IA1C1B,SAACA,EAAaU,EAAYT,GAC9CiB,YAAUlB,EAAKU,EAAOT,GACtBE,uBACF,CAwCIgB,CAAcnB,EAAKU,EAAOT,EAC3B,EAMoBmB,OAJN,SAACpB,EAAaC,GAA4B,OAAKF,EAAiBC,EAAKC,EAAQ,EAI/DoB,OAHd,WAAH,OAASd,EAAAA,YAAW,EAAK,EAGAe,MAFvB,WAAH,OArCXC,sBACApB,uBAoCsC,EAGxC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers-iXwxU9oY.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.95 */
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-iXwxU9oY.js";import{useState as o,useEffect as r}from"react";import{clearCookies as n}from"../useCookie/helpers/clearCookies.js";import{getCookies as i}from"../useCookie/helpers/getCookies.js";import{removeCookie as t}from"../useCookie/helpers/removeCookie.js";import{setCookie as u}from"../useCookie/helpers/setCookie.js";import{COOKIE_EVENT as s,dispatchCookieEvent as f}from"../useCookie/useCookie.js";var m=function(e,o){t(e,o),f()},l=function(){var t=o("undefined"!=typeof window?i(!0):{}),l=e(t,2),p=l[0],c=l[1];r((function(){var e=function(){return c(i(!0))};return window.addEventListener(s,e),function(){window.removeEventListener(s,e)}}),[]);return{value:p,set:function(e,o,r){if(null===o)return m(e);!function(e,o,r){u(e,o,r),f()}(e,o,r)},remove:function(e,o){return m(e,o)},getAll:function(){return i(!0)},clear:function(){return n(),void f()}}};export{l as useCookies};
|
|
3
|
-
//# sourceMappingURL=useCookies.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCookies.js","sources":["../../../../src/hooks/useCookies/useCookies.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport type { RemoveCookieParams, SetCookieParams } from '../useCookie/helpers';\n\nimport { clearCookies, getCookies, removeCookie, setCookie } from '../useCookie/helpers';\nimport { COOKIE_EVENT, dispatchCookieEvent } from '../useCookie/useCookie';\n\nconst setCookieItem = (key: string, value: any, options?: SetCookieParams) => {\n setCookie(key, value, options);\n dispatchCookieEvent();\n};\n\nconst removeCookieItem = (key: string, options?: RemoveCookieParams) => {\n removeCookie(key, options);\n dispatchCookieEvent();\n};\n\nconst clearCookieItems = () => {\n clearCookies();\n dispatchCookieEvent();\n};\n/**\n * @name useCookies\n * @description - Hook that manages cookie values\n * @category Browser\n *\n * @overload\n * @template {object} Value The type of the cookie values\n * @param {string} key The key of the cookie\n * @returns {UseCookieReturn<Value>} The value and the set function\n *\n * @example\n * const { value, set, remove, getAll, clear } = useCookies();\n */\nexport const useCookies = <Value>() => {\n const [value, setValue] = useState<Value>(\n typeof window !== 'undefined' ? (getCookies(true) as Value) : ({} as Value)\n );\n\n useEffect(() => {\n const onChange = () => setValue(getCookies(true) as Value);\n\n window.addEventListener(COOKIE_EVENT, onChange);\n return () => {\n window.removeEventListener(COOKIE_EVENT, onChange);\n };\n }, []);\n\n const set = (key: string, value: Value, options?: SetCookieParams) => {\n if (value === null) return removeCookieItem(key);\n setCookieItem(key, value, options);\n };\n\n const remove = (key: string, options?: RemoveCookieParams) => removeCookieItem(key, options);\n const getAll = () => getCookies(true);\n const clear = () => clearCookieItems();\n\n return { value, set, remove, getAll, clear };\n};\n"],"names":["removeCookieItem","key","options","removeCookie","dispatchCookieEvent","useCookies","_useState","useState","window","getCookies","_useState2","_slicedToArray","value","setValue","useEffect","onChange","addEventListener","COOKIE_EVENT","removeEventListener","set","setCookie","setCookieItem","remove","getAll","clear","clearCookies"],"mappings":";wcAOA,IAKMA,EAAmB,SAACC,EAAaC,GACrCC,EAAaF,EAAKC,GAClBE,GACF,EAmBaC,EAAa,WACxB,IAAAC,EAA0BC,EACN,oBAAXC,OAA0BC,GAAW,GAAmB,IAChEC,EAAAC,EAAAL,EAAA,GAFMM,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAItBI,GAAU,WACR,IAAMC,EAAW,WAAH,OAASF,EAASJ,GAAW,GAAe,EAG1D,OADAD,OAAOQ,iBAAiBC,EAAcF,GAC/B,WACLP,OAAOU,oBAAoBD,EAAcF,EAC1C,CACF,GAAE,IAWH,MAAO,CAAEH,MAAAA,EAAOO,IATJ,SAAClB,EAAaW,EAAcV,GACtC,GAAc,OAAVU,EAAgB,OAAOZ,EAAiBC,IA1C1B,SAACA,EAAaW,EAAYV,GAC9CkB,EAAUnB,EAAKW,EAAOV,GACtBE,GACF,CAwCIiB,CAAcpB,EAAKW,EAAOV,EAC3B,EAMoBoB,OAJN,SAACrB,EAAaC,GAA4B,OAAKF,EAAiBC,EAAKC,EAAQ,EAI/DqB,OAHd,WAAH,OAASd,GAAW,EAAK,EAGAe,MAFvB,WAAH,OArCXC,SACArB,GAoCsC,EAGxC"}
|