@siberiacancode/reactuse 0.0.97 → 0.0.98
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-B6-9bMtn.js → _rollupPluginBabelHelpers-Du0ODElA.js} +3 -3
- package/dist/cjs/_rollupPluginBabelHelpers-Du0ODElA.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/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/useClipboard/useClipboard.js +2 -2
- package/dist/cjs/hooks/useConst/useConst.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/useCookies/useCookies.js +3 -0
- package/dist/cjs/hooks/useCookies/useCookies.js.map +1 -0
- 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 +2 -2
- 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/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/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/useFileDialog/useFileDialog.js.map +1 -1
- 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/useKeyPressEvent/useKeyPressEvent.js.map +1 -1
- 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/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/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/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/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/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/useScroll/useScroll.js.map +1 -1
- 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/useTextDirection/useTextDirection.js +2 -2
- package/dist/cjs/hooks/useTextSelection/useTextSelection.js +2 -2
- package/dist/cjs/hooks/useThrottleCallback/useThrottleCallback.js +2 -2
- 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/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/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-WrSliisk.js → _rollupPluginBabelHelpers-DMxTFLvA.js} +3 -3
- package/dist/esm/_rollupPluginBabelHelpers-DMxTFLvA.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/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/useClipboard/useClipboard.js +2 -2
- package/dist/esm/hooks/useConst/useConst.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/useCookies/useCookies.js +3 -0
- package/dist/esm/hooks/useCookies/useCookies.js.map +1 -0
- 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 +2 -2
- 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/useFileDialog/useFileDialog.js.map +1 -1
- 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/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/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/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/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/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/useScroll/useScroll.js.map +1 -1
- 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/useTextDirection/useTextDirection.js +2 -2
- package/dist/esm/hooks/useTextSelection/useTextSelection.js +2 -2
- package/dist/esm/hooks/useThrottleCallback/useThrottleCallback.js +2 -2
- 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/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/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 +62 -30
- package/package.json +1 -1
- package/dist/cjs/_rollupPluginBabelHelpers-B6-9bMtn.js.map +0 -1
- package/dist/cjs/hooks/usePaint/helpers/Paint.js +0 -3
- package/dist/cjs/hooks/usePaint/helpers/Paint.js.map +0 -1
- package/dist/cjs/hooks/usePaint/helpers/index.js +0 -3
- package/dist/cjs/hooks/usePaint/helpers/index.js.map +0 -1
- package/dist/cjs/utils/helpers/cookie.js +0 -3
- package/dist/cjs/utils/helpers/cookie.js.map +0 -1
- package/dist/esm/_rollupPluginBabelHelpers-WrSliisk.js.map +0 -1
- package/dist/esm/hooks/usePaint/helpers/Paint.js +0 -3
- package/dist/esm/hooks/usePaint/helpers/Paint.js.map +0 -1
- package/dist/esm/hooks/usePaint/helpers/index.js +0 -3
- package/dist/esm/hooks/usePaint/helpers/index.js.map +0 -1
- package/dist/esm/utils/helpers/cookie.js +0 -3
- package/dist/esm/utils/helpers/cookie.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e,d as t,e as r,c as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e,d as t,e as r,c as n}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as a,useEffect as c}from"react";var i=function(i){var o="undefined"!=typeof navigator&&"bluetooth"in navigator,s=null!=i?i:{},u=s.acceptAllDevices,v=void 0!==u&&u,p=s.filters,f=s.optionalServices,l=a(!1),d=e(l,2),g=d[0],b=d[1],m=a(void 0),x=e(m,2),h=x[0],D=x[1],k=a(void 0),w=e(k,2),y=w[0],A=w[1],q=function(){var e=t(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,navigator.bluetooth.requestDevice(n({acceptAllDevices:v,optionalServices:f},p&&{filters:p,acceptAllDevices:!1}));case 4:t=e.sent,D(t);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return c((function(){if(h&&h.gatt){var e=function(){var e=t(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.gatt){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,h.gatt.connect();case 4:t=e.sent,A(t),b(t.connected);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){A(void 0),D(void 0),b(!1)};return h.addEventListener("gattserverdisconnected",n),e(),function(){var e;h.removeEventListener("gattserverdisconnected",n),null===(e=h.gatt)||void 0===e||e.disconnect()}}}),[h]),{supported:o,connected:g,device:h,requestDevice:q,server:y}};export{i as useBluetooth};
|
|
3
3
|
//# sourceMappingURL=useBluetooth.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as n}from"react";var t=function(){var t=n(arguments.length>0&&void 0!==arguments[0]&&arguments[0]),o=r(t,2),e=o[0],u=o[1];return[e,function(r){return u((function(n){return null!=r?r:!n}))}]};export{t as useBoolean};
|
|
3
3
|
//# sourceMappingURL=useBoolean.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{c as e,_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{c as e,_ as r}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useEffect as t}from"react";import{useRerender as n}from"../useRerender/useRerender.js";var i=function(e){return window.matchMedia(e).matches},l=function(l){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mobile-first",a=n(),u=function(e,r){return"".concat(r?Number(l[e])+r:l[e],"px")};t((function(){var e=function(){return a()};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var m=function(e){return i("(min-width: ".concat(u(e),")"))},c=function(e){return i("(max-width: ".concat(u(e),")"))},s=function(){return Object.keys(l).map((function(e){return[e,m(e)]})).filter((function(e){return r(e,2)[1]})).map((function(e){return r(e,1)[0]}))},x=function(e){return i("(min-width: ".concat(u(e,.1),")"))},d=function(e){return i("(max-width: ".concat(u(e,-.1),")"))},f=function(e,r){return i("(min-width: ".concat(u(e),") and (max-width: ").concat(u(r,-.1),")"))},p=Object.keys(l).reduce((function(e,r){var t="mobile-first"===o?m(r):c(r);return e[r]=t,e}),{});return e({current:s,greaterOrEqual:m,smallerOrEqual:c,active:function(){var e=s();return e.length?e.at(-1):void 0},greater:x,smaller:d,between:f,isGreater:x,isGreaterOrEqual:m,isSmaller:d,isSmallerOrEqual:c,isInBetween:f},p)},o={xs:0,sm:600,md:900,lg:1200,xl:1536},a={xs:576,sm:768,md:992,lg:1200,xl:1408},u={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},m={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},c={xs:480,sm:576,md:768,lg:992,xl:1200,xxl:1600},s={xs:0,sm:600,md:1024,lg:1440,xl:1920},x={mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop4K:2560},d={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},f={sm:576,md:768,lg:992,xl:1200};export{c as BREAKPOINTS_ANT_DESIGN,m as BREAKPOINTS_BOOTSTRAP_V5,a as BREAKPOINTS_MANTINE,d as BREAKPOINTS_MASTER_CSS,o as BREAKPOINTS_MATERIAL_UI,f as BREAKPOINTS_PRIME_FLEX,s as BREAKPOINTS_QUASAR_V2,x as BREAKPOINTS_SEMANTIC,u as BREAKPOINTS_TAILWIND,l as useBreakpoints};
|
|
3
3
|
//# sourceMappingURL=useBreakpoints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoints.js","sources":["../../../../src/hooks/useBreakpoints/useBreakpoints.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useRerender } from '../useRerender/useRerender';\n\n/** The breakpoints type */\nexport type Breakpoints<Breakpoint extends string = string> = Record<Breakpoint, number>;\n\n/** The use breakpoints strategy */\nexport type UseBreakpointsStrategy = 'desktop-first' | 'mobile-first';\n\nconst match = (query: string) => window.matchMedia(query).matches;\n\n/** The use breakpoints return type */\nexport type UseBreakpointsReturn<Breakpoint extends string = string> = {\n /** The function that checks if the current breakpoint is greater than to the given breakpoint */\n greater: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is greater than or equal to the given breakpoint */\n greaterOrEqual: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is smaller than to the given breakpoint */\n smaller: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is smaller than or equal to the given breakpoint */\n smallerOrEqual: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is between to the given breakpoints */\n between: (a: Breakpoint, b: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is greater than to the given breakpoint */\n isGreater: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is greater than or equal to the given breakpoint */\n isGreaterOrEqual: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is smaller than to the given breakpoint */\n isSmaller: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is smaller than or equal to the given breakpoint */\n isSmallerOrEqual: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is between to the given breakpoints */\n isInBetween: (a: Breakpoint, b: Breakpoint) => boolean;\n /** The function that returns the current breakpoints */\n current: () => Breakpoint[];\n /** The function that returns the current active breakpoint */\n active: () => Breakpoint;\n} & Record<Breakpoint, boolean>;\n\n/**\n * @name useBreakpoints\n * @description - Hook that manages breakpoints\n * @category Browser\n *\n * @template {string} Breakpoint The name of the breakpoint\n * @param {Breakpoints<Breakpoint>} breakpoints The breakpoints to use\n * @param {UseBreakpointsStrategy} [strategy=min-width] The strategy to use for matching\n * @returns {UseBreakpointsReturn<Breakpoint>} An object containing the current breakpoint\n *\n * @example\n * const { greaterOrEqual, smallerOrEqual, current } = useBreakpoints({ mobile: 0, tablet: 640, laptop: 1024, desktop: 1280 });\n */\nexport const useBreakpoints = <Breakpoint extends string>(\n breakpoints: Breakpoints<Breakpoint>,\n strategy: UseBreakpointsStrategy = 'mobile-first'\n): UseBreakpointsReturn<Breakpoint> => {\n const rerender = useRerender();\n\n const getValue = (breakpoint: Breakpoint, delta?: number) => {\n if (delta) return `${Number(breakpoints[breakpoint]) + delta}px`;\n return `${breakpoints[breakpoint]}px`;\n };\n\n useEffect(() => {\n const onResize = () => rerender();\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n const greaterOrEqual = (breakpoint: Breakpoint) => match(`(min-width: ${getValue(breakpoint)})`);\n const smallerOrEqual = (breakpoint: Breakpoint) => match(`(max-width: ${getValue(breakpoint)})`);\n const current = () =>\n Object.keys(breakpoints)\n .map((breakpoint) => [breakpoint, greaterOrEqual(breakpoint as Breakpoint)])\n .filter(([, value]) => value)\n .map(([breakpoint]) => breakpoint) as Breakpoint[];\n const active = () => {\n const breakpoints = current();\n return (breakpoints.length ? breakpoints.at(-1) : undefined) as Breakpoint;\n };\n\n const greater = (breakpoint: Breakpoint) => match(`(min-width: ${getValue(breakpoint, 0.1)})`);\n const smaller = (breakpoint: Breakpoint) => match(`(max-width: ${getValue(breakpoint, -0.1)})`);\n const between = (a: Breakpoint, b: Breakpoint) =>\n match(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`);\n\n const breakpointsKeys = (Object.keys(breakpoints) as Breakpoint[]).reduce(\n (acc, breakpoint) => {\n const value =\n strategy === 'mobile-first' ? greaterOrEqual(breakpoint) : smallerOrEqual(breakpoint);\n acc[breakpoint] = value;\n return acc;\n },\n {} as Record<Breakpoint, boolean>\n );\n\n return {\n current,\n greaterOrEqual,\n smallerOrEqual,\n active,\n greater,\n smaller,\n between,\n isGreater: greater,\n isGreaterOrEqual: greaterOrEqual,\n isSmaller: smaller,\n isSmallerOrEqual: smallerOrEqual,\n isInBetween: between,\n ...breakpointsKeys\n };\n};\n\n/** Breakpoints from Material UI */\nexport const BREAKPOINTS_MATERIAL_UI = {\n xs: 0,\n sm: 600,\n md: 900,\n lg: 1200,\n xl: 1536\n};\n\n/** Breakpoints from Mantine */\nexport const BREAKPOINTS_MANTINE = {\n xs: 576,\n sm: 768,\n md: 992,\n lg: 1200,\n xl: 1408\n};\n\n/** Breakpoints from Tailwind */\nexport const BREAKPOINTS_TAILWIND = {\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n '2xl': 1536\n};\n\n/** Breakpoints from Bootstrap V5 */\nexport const BREAKPOINTS_BOOTSTRAP_V5 = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400\n};\n\n/** Breakpoints from Ant Design */\nexport const BREAKPOINTS_ANT_DESIGN = {\n xs: 480,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1600\n};\n\n/** Breakpoints from Quasar V2 */\nexport const BREAKPOINTS_QUASAR_V2 = {\n xs: 0,\n sm: 600,\n md: 1024,\n lg: 1440,\n xl: 1920\n};\n\n/** Sematic Breakpoints */\nexport const BREAKPOINTS_SEMANTIC = {\n mobileS: 320,\n mobileM: 375,\n mobileL: 425,\n tablet: 768,\n laptop: 1024,\n laptopL: 1440,\n desktop4K: 2560\n};\n\n/** Breakpoints from Master CSS */\nexport const BREAKPOINTS_MASTER_CSS = {\n '3xs': 360,\n '2xs': 480,\n xs: 600,\n sm: 768,\n md: 1024,\n lg: 1280,\n xl: 1440,\n '2xl': 1600,\n '3xl': 1920,\n '4xl': 2560\n};\n\n/** Breakpoints from PrimeFlex */\nexport const BREAKPOINTS_PRIME_FLEX = {\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200\n};\n"],"names":["match","query","window","matchMedia","matches","useBreakpoints","breakpoints","strategy","arguments","length","undefined","rerender","useRerender","getValue","breakpoint","delta","concat","Number","useEffect","onResize","addEventListener","removeEventListener","greaterOrEqual","smallerOrEqual","current","Object","keys","map","filter","_ref","_slicedToArray","_ref3","greater","smaller","between","a","b","breakpointsKeys","reduce","acc","value","_objectSpread","active","at","isGreater","isGreaterOrEqual","isSmaller","isSmallerOrEqual","isInBetween","BREAKPOINTS_MATERIAL_UI","xs","sm","md","lg","xl","BREAKPOINTS_MANTINE","BREAKPOINTS_TAILWIND","BREAKPOINTS_BOOTSTRAP_V5","xxl","BREAKPOINTS_ANT_DESIGN","BREAKPOINTS_QUASAR_V2","BREAKPOINTS_SEMANTIC","mobileS","mobileM","mobileL","tablet","laptop","laptopL","desktop4K","BREAKPOINTS_MASTER_CSS","BREAKPOINTS_PRIME_FLEX"],"mappings":";qKAUA,IAAMA,EAAQ,SAACC,GAAa,OAAKC,OAAOC,WAAWF,GAAOG,OAAO,EA2CpDC,EAAiB,SAC5BC,GAEqC,IADrCC,EAAgCC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,eAE7BG,EAAWC,IAEXC,EAAW,SAACC,EAAwBC,GACxC,MAAWC,GAAAA,OAAPD,EAAiBE,OAAOX,EAAYQ,IAAeC,EAC7CT,EAAYQ,GADsC,KAE7D,EAEDI,GAAU,WACR,IAAMC,EAAW,WAAH,OAASR,GAAU,EAEjC,OADAT,OAAOkB,iBAAiB,SAAUD,GAC3B,WACLjB,OAAOmB,oBAAoB,SAAUF,EACtC,CACF,GAAE,IAEH,IAAMG,EAAiB,SAACR,GAAsB,OAAKd,iBAAKgB,OAAgBH,EAASC,GAAW,KAAI,EAC1FS,EAAiB,SAACT,GAAsB,OAAKd,iBAAKgB,OAAgBH,EAASC,GAAW,KAAI,EAC1FU,EAAU,WAAH,OACXC,OAAOC,KAAKpB,GACTqB,KAAI,SAACb,GAAU,MAAK,CAACA,EAAYQ,EAAeR,GAA0B,IAC1Ec,QAAO,SAAAC,GAAS,OAATC,EAAAD,EAAA,GAAS,EAAW,IAC3BF,KAAI,SAAAI,GAAY,OAAZD,EAAAC,EAAA,GAAY,KAAiC,EAMhDC,EAAU,SAAClB,GAAsB,OAAKd,EAAKgB,eAAAA,OAAgBH,EAASC,EAAY,IAAI,KAAI,EACxFmB,EAAU,SAACnB,GAAsB,OAAKd,EAAK,eAAAgB,OAAgBH,EAASC,
|
|
1
|
+
{"version":3,"file":"useBreakpoints.js","sources":["../../../../src/hooks/useBreakpoints/useBreakpoints.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useRerender } from '../useRerender/useRerender';\n\n/** The breakpoints type */\nexport type Breakpoints<Breakpoint extends string = string> = Record<Breakpoint, number>;\n\n/** The use breakpoints strategy */\nexport type UseBreakpointsStrategy = 'desktop-first' | 'mobile-first';\n\nconst match = (query: string) => window.matchMedia(query).matches;\n\n/** The use breakpoints return type */\nexport type UseBreakpointsReturn<Breakpoint extends string = string> = {\n /** The function that checks if the current breakpoint is greater than to the given breakpoint */\n greater: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is greater than or equal to the given breakpoint */\n greaterOrEqual: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is smaller than to the given breakpoint */\n smaller: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is smaller than or equal to the given breakpoint */\n smallerOrEqual: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is between to the given breakpoints */\n between: (a: Breakpoint, b: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is greater than to the given breakpoint */\n isGreater: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is greater than or equal to the given breakpoint */\n isGreaterOrEqual: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is smaller than to the given breakpoint */\n isSmaller: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is smaller than or equal to the given breakpoint */\n isSmallerOrEqual: (breakpoint: Breakpoint) => boolean;\n /** The function that checks if the current breakpoint is between to the given breakpoints */\n isInBetween: (a: Breakpoint, b: Breakpoint) => boolean;\n /** The function that returns the current breakpoints */\n current: () => Breakpoint[];\n /** The function that returns the current active breakpoint */\n active: () => Breakpoint;\n} & Record<Breakpoint, boolean>;\n\n/**\n * @name useBreakpoints\n * @description - Hook that manages breakpoints\n * @category Browser\n *\n * @template {string} Breakpoint The name of the breakpoint\n * @param {Breakpoints<Breakpoint>} breakpoints The breakpoints to use\n * @param {UseBreakpointsStrategy} [strategy=min-width] The strategy to use for matching\n * @returns {UseBreakpointsReturn<Breakpoint>} An object containing the current breakpoint\n *\n * @example\n * const { greaterOrEqual, smallerOrEqual, current } = useBreakpoints({ mobile: 0, tablet: 640, laptop: 1024, desktop: 1280 });\n */\nexport const useBreakpoints = <Breakpoint extends string>(\n breakpoints: Breakpoints<Breakpoint>,\n strategy: UseBreakpointsStrategy = 'mobile-first'\n): UseBreakpointsReturn<Breakpoint> => {\n const rerender = useRerender();\n\n const getValue = (breakpoint: Breakpoint, delta?: number) => {\n if (delta) return `${Number(breakpoints[breakpoint]) + delta}px`;\n return `${breakpoints[breakpoint]}px`;\n };\n\n useEffect(() => {\n const onResize = () => rerender();\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n const greaterOrEqual = (breakpoint: Breakpoint) => match(`(min-width: ${getValue(breakpoint)})`);\n const smallerOrEqual = (breakpoint: Breakpoint) => match(`(max-width: ${getValue(breakpoint)})`);\n const current = () =>\n Object.keys(breakpoints)\n .map((breakpoint) => [breakpoint, greaterOrEqual(breakpoint as Breakpoint)])\n .filter(([, value]) => value)\n .map(([breakpoint]) => breakpoint) as Breakpoint[];\n const active = () => {\n const breakpoints = current();\n return (breakpoints.length ? breakpoints.at(-1) : undefined) as Breakpoint;\n };\n\n const greater = (breakpoint: Breakpoint) => match(`(min-width: ${getValue(breakpoint, 0.1)})`);\n const smaller = (breakpoint: Breakpoint) => match(`(max-width: ${getValue(breakpoint, -0.1)})`);\n const between = (a: Breakpoint, b: Breakpoint) =>\n match(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`);\n\n const breakpointsKeys = (Object.keys(breakpoints) as Breakpoint[]).reduce(\n (acc, breakpoint) => {\n const value =\n strategy === 'mobile-first' ? greaterOrEqual(breakpoint) : smallerOrEqual(breakpoint);\n acc[breakpoint] = value;\n return acc;\n },\n {} as Record<Breakpoint, boolean>\n );\n\n return {\n current,\n greaterOrEqual,\n smallerOrEqual,\n active,\n greater,\n smaller,\n between,\n isGreater: greater,\n isGreaterOrEqual: greaterOrEqual,\n isSmaller: smaller,\n isSmallerOrEqual: smallerOrEqual,\n isInBetween: between,\n ...breakpointsKeys\n };\n};\n\n/** Breakpoints from Material UI */\nexport const BREAKPOINTS_MATERIAL_UI = {\n xs: 0,\n sm: 600,\n md: 900,\n lg: 1200,\n xl: 1536\n};\n\n/** Breakpoints from Mantine */\nexport const BREAKPOINTS_MANTINE = {\n xs: 576,\n sm: 768,\n md: 992,\n lg: 1200,\n xl: 1408\n};\n\n/** Breakpoints from Tailwind */\nexport const BREAKPOINTS_TAILWIND = {\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n '2xl': 1536\n};\n\n/** Breakpoints from Bootstrap V5 */\nexport const BREAKPOINTS_BOOTSTRAP_V5 = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400\n};\n\n/** Breakpoints from Ant Design */\nexport const BREAKPOINTS_ANT_DESIGN = {\n xs: 480,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1600\n};\n\n/** Breakpoints from Quasar V2 */\nexport const BREAKPOINTS_QUASAR_V2 = {\n xs: 0,\n sm: 600,\n md: 1024,\n lg: 1440,\n xl: 1920\n};\n\n/** Sematic Breakpoints */\nexport const BREAKPOINTS_SEMANTIC = {\n mobileS: 320,\n mobileM: 375,\n mobileL: 425,\n tablet: 768,\n laptop: 1024,\n laptopL: 1440,\n desktop4K: 2560\n};\n\n/** Breakpoints from Master CSS */\nexport const BREAKPOINTS_MASTER_CSS = {\n '3xs': 360,\n '2xs': 480,\n xs: 600,\n sm: 768,\n md: 1024,\n lg: 1280,\n xl: 1440,\n '2xl': 1600,\n '3xl': 1920,\n '4xl': 2560\n};\n\n/** Breakpoints from PrimeFlex */\nexport const BREAKPOINTS_PRIME_FLEX = {\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200\n};\n"],"names":["match","query","window","matchMedia","matches","useBreakpoints","breakpoints","strategy","arguments","length","undefined","rerender","useRerender","getValue","breakpoint","delta","concat","Number","useEffect","onResize","addEventListener","removeEventListener","greaterOrEqual","smallerOrEqual","current","Object","keys","map","filter","_ref","_slicedToArray","_ref3","greater","smaller","between","a","b","breakpointsKeys","reduce","acc","value","_objectSpread","active","at","isGreater","isGreaterOrEqual","isSmaller","isSmallerOrEqual","isInBetween","BREAKPOINTS_MATERIAL_UI","xs","sm","md","lg","xl","BREAKPOINTS_MANTINE","BREAKPOINTS_TAILWIND","BREAKPOINTS_BOOTSTRAP_V5","xxl","BREAKPOINTS_ANT_DESIGN","BREAKPOINTS_QUASAR_V2","BREAKPOINTS_SEMANTIC","mobileS","mobileM","mobileL","tablet","laptop","laptopL","desktop4K","BREAKPOINTS_MASTER_CSS","BREAKPOINTS_PRIME_FLEX"],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
2
|
import{useSyncExternalStore as n}from"react";var e=function(){return navigator.language},r=function(){return"undetermined"},t=function(n){return window.addEventListener("languagechange",n),function(){return window.removeEventListener("languagechange",n)}},u=function(){return n(t,e,r)};export{u as useBrowserLanguage};
|
|
3
3
|
//# sourceMappingURL=useBrowserLanguage.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{useRef as t,useEffect as e}from"react";import{
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{useRef as t,useEffect as e}from"react";import{getElement as r}from"../../utils/helpers/getElement.js";import{isTarget as n}from"../../utils/helpers/isTarget.js";import{useRefState as i}from"../useRefState/useRefState.js";import"../../_rollupPluginBabelHelpers-DMxTFLvA.js";var o=function(){var o=n(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,l=(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],s=i(),u=t(l);if(u.current=l,e((function(){if(o||s.state){var t=function(t){var e=o?r(o):s.current;e&&!e.contains(t.target)&&u.current(t)};return document.addEventListener("click",t),function(){document.removeEventListener("click",t)}}}),[o,s.state]),!o)return s};export{o as useClickOutside};
|
|
3
3
|
//# sourceMappingURL=useClickOutside.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e,d as n,e as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e,d as n,e as t}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as r,useEffect as o,useCallback as a}from"react";import{usePermission as i}from"../usePermission/usePermission.js";import"../useEvent/useEvent.js";var c=function(e){return"granted"===e||"prompt"===e},u=function(e){var n=document.createElement("textarea");n.value=e,n.readOnly=!0,n.style.fontSize="16px",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)},l=function(l){var d,s="undefined"!=typeof navigator&&"clipboard"in navigator,v=r(null),p=e(v,2),m=p[0],f=p[1],x=i("clipboard-read"),b=i("clipboard-write"),y=null!==(d=null==l?void 0:l.enabled)&&void 0!==d&&d,g=function(){var e=n(t().mark((function e(){var n,r,o,a,i,u,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!s||!c(x.state)){e.next=8;break}return e.next=4,navigator.clipboard.readText();case 4:a=e.sent,f(a),e.next=9;break;case 8:f(null!==(n=null===(r=document)||void 0===r||null===(o=r.getSelection)||void 0===o||null===(o=o.call(r))||void 0===o?void 0:o.toString())&&void 0!==n?n:"");case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),f(null!==(i=null===(u=document)||void 0===u||null===(l=u.getSelection)||void 0===l||null===(l=l.call(u))||void 0===l?void 0:l.toString())&&void 0!==i?i:"");case 14:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}();o((function(){if(y)return document.addEventListener("copy",g),document.addEventListener("cut",g),function(){document.removeEventListener("copy",g),document.removeEventListener("cut",g)}}),[y]);var h=a(function(){var e=n(t().mark((function e(n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!s&&!c(b.state)){e.next=6;break}return e.next=4,navigator.clipboard.writeText(n);case 4:e.next=7;break;case 6:u(n);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),u(n);case 12:f(n);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(n){return e.apply(this,arguments)}}(),[]);return{supported:s,value:m,copy:h}};export{c as isPermissionAllowed,u as legacyCopyToClipboard,l as useClipboard};
|
|
3
3
|
//# sourceMappingURL=useClipboard.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{f as n,b as e,_ as t,c as i}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as o,useEffect as r}from"react";var a=function(){return Object.fromEntries(document.cookie.split("; ").map((function(e){var t=e.split("="),i=n(t),o=i[0],r=i.slice(1);return[o,decodeURIComponent(r.join("="))]})))},c=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};document.cookie="".concat(encodeURIComponent(n),"=; expires=Thu, 01 Jan 1970 00:00:00 GMT").concat(e.path?"; path=".concat(e.path):"").concat(e.domain?"; domain=".concat(e.domain):"").concat(e.maxAge?"; max-age=0":"").concat(e.expires?"; expires=Thu, 01 Jan 1970 00:00:00 GMT":"").concat(e.secure?"; secure":"").concat(e.sameSite?"; samesite=".concat(e.sameSite):"")},u=function(n,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=["".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(e))];t.path&&i.push("path=".concat(t.path)),t.domain&&i.push("domain=".concat(t.domain)),"number"==typeof t.maxAge&&i.push("max-age=".concat(t.maxAge)),t.expires&&i.push("expires=".concat(t.expires.toUTCString())),t.secure&&i.push("secure"),t.httpOnly&&i.push("httpOnly"),t.sameSite&&i.push("samesite=".concat(t.sameSite)),document.cookie=i.join("; ")},s="reactuse-cookie",p=function(){return window.dispatchEvent(new Event(s))},d=function(n,e,t){u(n,e,t),p()},m=function(n){return a()[n]},f=function(n,a){var u="object"===e(a)&&a&&("serializer"in a||"deserializer"in a||"initialValue"in a)?a:void 0,f=u?null==u?void 0:u.initialValue:a;if("undefined"==typeof document)return{value:f instanceof Function?f():f};var l=function(n){return null!=u&&u.serializer?u.serializer(n):JSON.stringify(n)},v=function(n){if(null!=u&&u.deserializer)return u.deserializer(n);if("undefined"!==n)try{return JSON.parse(n)}catch(e){return n}},h=o((function(){var e=m(n);if(void 0===e&&void 0!==f){var t=f instanceof Function?f():f;return d(n,l(t),u),t}return e?v(e):void 0})),x=t(h,2),g=x[0],w=x[1];r((function(){var e=function(){var e=m(n);w(e?v(e):void 0)};return window.addEventListener(s,e),function(){return window.removeEventListener(s,e)}}),[n]);return{value:g,set:function(e,t){return d(n,l(e),i(i({},u),t))},remove:function(e){return function(n,e){c(n,e),p()}(n,i(i({},u),e))}}};export{s as COOKIE_EVENT,p as dispatchCookieEvent,a as getCookies,c as removeCookie,u as setCookie,f as useCookie};
|
|
3
3
|
//# sourceMappingURL=useCookie.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCookie.js","sources":["../../../../src/hooks/useCookie/useCookie.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\
|
|
1
|
+
{"version":3,"file":"useCookie.js","sources":["../../../../src/hooks/useCookie/useCookie.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport const getCookies = () =>\n Object.fromEntries(\n document.cookie.split('; ').map((cookie) => {\n const [key, ...value] = cookie.split('=');\n const decodedValue = decodeURIComponent(value.join('='));\n return [key, decodedValue];\n })\n );\n\nexport interface RemoveCookieParams {\n domain?: string;\n expires?: Date;\n maxAge?: number;\n path?: string;\n sameSite?: 'Lax' | 'None' | 'Strict';\n secure?: boolean;\n}\n\nexport const removeCookie = (key: string, options: RemoveCookieParams = {}) => {\n document.cookie = `${encodeURIComponent(key)}=; expires=Thu, 01 Jan 1970 00:00:00 GMT${\n options.path ? `; path=${options.path}` : ''\n }${options.domain ? `; domain=${options.domain}` : ''}${options.maxAge ? `; max-age=0` : ''}${\n options.expires ? `; expires=Thu, 01 Jan 1970 00:00:00 GMT` : ''\n }${options.secure ? `; secure` : ''}${options.sameSite ? `; samesite=${options.sameSite}` : ''}`;\n};\n\nexport interface SetCookieParams {\n domain?: string;\n expires?: Date;\n httpOnly?: boolean;\n maxAge?: number;\n path?: string;\n sameSite?: 'Lax' | 'None' | 'Strict';\n secure?: boolean;\n}\n\nexport const setCookie = (key: string, value: string, options: SetCookieParams = {}) => {\n const cookie: string[] = [`${encodeURIComponent(key)}=${encodeURIComponent(value)}`];\n\n if (options.path) cookie.push(`path=${options.path}`);\n if (options.domain) cookie.push(`domain=${options.domain}`);\n if (typeof options.maxAge === 'number') cookie.push(`max-age=${options.maxAge}`);\n if (options.expires) cookie.push(`expires=${options.expires.toUTCString()}`);\n if (options.secure) cookie.push(`secure`);\n if (options.httpOnly) cookie.push(`httpOnly`);\n if (options.sameSite) cookie.push(`samesite=${options.sameSite}`);\n\n document.cookie = cookie.join('; ');\n};\n\n/* The use storage initial value type */\nexport type UseCookieInitialValue<Value> = (() => Value) | Value;\n\n/* The use storage options type */\nexport interface UseCookieOptions<Value> {\n /* The domain of the cookie */\n domain?: string;\n /* The expiration date of the cookie */\n expires?: Date;\n /* Whether the cookie is httpOnly */\n httpOnly?: boolean;\n /* The initial value of the storage */\n initialValue?: UseCookieInitialValue<Value>;\n /* The maximum age of the cookie */\n maxAge?: number;\n /* The path of the cookie */\n path?: string;\n /* The sameSite of the cookie */\n sameSite?: 'Lax' | 'None' | 'Strict';\n /* Whether the cookie is secure */\n secure?: boolean;\n /* Whether to update the cookie on change */\n updateOnChange?: boolean;\n /* The deserializer function to be invoked */\n deserializer?: (value: string) => Value;\n /* The serializer function to be invoked */\n serializer?: (value: Value) => string;\n}\n\n/* The use cookie return type */\nexport interface UseCookieReturn<Value> {\n /* The value of the cookie */\n value: Value;\n /* The remove function */\n remove: (options?: RemoveCookieParams) => void;\n /* The set function */\n set: (value: Value, options?: SetCookieParams) => void;\n}\n\nexport const COOKIE_EVENT = 'reactuse-cookie';\n\nexport const dispatchCookieEvent = () => window.dispatchEvent(new Event(COOKIE_EVENT));\n\nconst setCookieItem = (key: string, value: string, 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 getCookieItem = (key: string): string | undefined => {\n const cookies = getCookies();\n return cookies[key];\n};\n\n/**\n * @name useCookie\n * @description - Hook that manages cookie value\n * @category Browser\n *\n * @overload\n * @template Value The type of the cookie value\n * @param {string} key The key of the cookie\n * @param {UseCookieInitialValue<Value>} [initialValue] The initial value of the cookie\n * @returns {UseCookieReturn<Value>} The value and the set function\n *\n * @example\n * const { value, set, remove } = useCookie('key', 'value');\n */\nexport const useCookie = <Value>(\n key: string,\n params?: UseCookieInitialValue<Value> | UseCookieOptions<Value>\n) => {\n const options = (\n typeof params === 'object' &&\n params &&\n ('serializer' in params || 'deserializer' in params || 'initialValue' in params)\n ? params\n : undefined\n ) as UseCookieOptions<Value>;\n const initialValue = (options ? options?.initialValue : params) as UseCookieInitialValue<Value>;\n\n if (typeof document === 'undefined')\n return {\n value: initialValue instanceof Function ? initialValue() : initialValue\n } as UseCookieReturn<Value>;\n\n const serializer = (value: Value) => {\n if (options?.serializer) return options.serializer(value);\n return JSON.stringify(value);\n };\n\n const deserializer = (value: string) => {\n if (options?.deserializer) return options.deserializer(value);\n if (value === 'undefined') return undefined as unknown as Value;\n\n try {\n return JSON.parse(value) as Value;\n } catch {\n return value as Value;\n }\n };\n\n const [value, setValue] = useState<Value | undefined>(() => {\n const cookieValue = getCookieItem(key);\n if (cookieValue === undefined && initialValue !== undefined) {\n const value = initialValue instanceof Function ? initialValue() : initialValue;\n setCookieItem(key, serializer(value), options);\n return value;\n }\n return cookieValue ? deserializer(cookieValue) : undefined;\n });\n\n useEffect(() => {\n const onChange = () => {\n const cookieValue = getCookieItem(key);\n setValue(cookieValue ? deserializer(cookieValue) : undefined);\n };\n window.addEventListener(COOKIE_EVENT, onChange);\n return () => window.removeEventListener(COOKIE_EVENT, onChange);\n }, [key]);\n\n const set = (value: Value, params?: SetCookieParams) =>\n setCookieItem(key, serializer(value), { ...options, ...params });\n const remove = (params?: RemoveCookieParams) => removeCookieItem(key, { ...options, ...params });\n\n return { value, set, remove };\n};\n"],"names":["getCookies","Object","fromEntries","document","cookie","split","map","_cookie$split","_cookie$split2","_toArray","key","value","slice","decodeURIComponent","join","removeCookie","options","arguments","length","undefined","concat","encodeURIComponent","path","domain","maxAge","expires","secure","sameSite","setCookie","push","toUTCString","httpOnly","COOKIE_EVENT","dispatchCookieEvent","window","dispatchEvent","Event","setCookieItem","getCookieItem","useCookie","params","_typeof","initialValue","Function","serializer","JSON","stringify","deserializer","parse","_unused","_useState","useState","cookieValue","_useState2","_slicedToArray","setValue","useEffect","onChange","addEventListener","removeEventListener","set","_objectSpread","remove","removeCookieItem"],"mappings":"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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{f as n,_ as e}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as t,useEffect as o}from"react";import{removeCookie as r,COOKIE_EVENT as i,dispatchCookieEvent as u,setCookie as c}from"../useCookie/useCookie.js";var f=function(){return Object.fromEntries(document.cookie.split("; ").map((function(e){var t=e.split("="),o=n(t),r=o[0],i=o.slice(1),u=decodeURIComponent(i.join("="));try{return[r,JSON.parse(u)]}catch(n){return[r,u]}})))},s=function(){document.cookie.split("; ").forEach((function(n){var t=n.split("="),o=e(t,1)[0];r(o)}))},a=function(n,e){r(n,e),u()},l=function(){var n=t("undefined"!=typeof window?f():{}),r=e(n,2),l=r[0],p=r[1];o((function(){var n=function(){return p(f())};return window.addEventListener(i,n),function(){window.removeEventListener(i,n)}}),[]);return{value:l,set:function(n,e,t){if(null===e)return a(n);!function(n,e,t){c(n,e,t),u()}(n,e,t)},remove:function(n,e){return a(n,e)},getAll:function(){return f()},clear:function(){return s(),void u()}}};export{s as clearCookies,f as getParsedCookies,l as useCookies};
|
|
3
|
+
//# sourceMappingURL=useCookies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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/useCookie';\n\nimport { COOKIE_EVENT, dispatchCookieEvent, removeCookie, setCookie } from '../useCookie/useCookie';\n\nexport const getParsedCookies = () =>\n Object.fromEntries(\n document.cookie.split('; ').map((cookie) => {\n const [key, ...value] = cookie.split('=');\n const decodedValue = decodeURIComponent(value.join('='));\n try {\n return [key, JSON.parse(decodedValue)];\n } catch {\n return [key, decodedValue];\n }\n })\n );\n\nexport const clearCookies = () => {\n document.cookie.split('; ').forEach((cookie) => {\n const [name] = cookie.split('=');\n removeCookie(name);\n });\n};\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/**\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' ? (getParsedCookies() as Value) : ({} as Value)\n );\n\n useEffect(() => {\n const onChange = () => setValue(getParsedCookies() 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 = () => getParsedCookies();\n const clear = () => clearCookieItems();\n\n return { value, set, remove, getAll, clear };\n};\n"],"names":["getParsedCookies","Object","fromEntries","document","cookie","split","map","_cookie$split","_cookie$split2","_toArray","key","value","slice","decodedValue","decodeURIComponent","join","JSON","parse","_unused","clearCookies","forEach","_cookie$split3","name","_slicedToArray","removeCookie","removeCookieItem","options","dispatchCookieEvent","useCookies","_useState","useState","window","_useState2","setValue","useEffect","onChange","addEventListener","COOKIE_EVENT","removeEventListener","set","setCookie","setCookieItem","remove","getAll","clear"],"mappings":";0OAMaA,IAAAA,EAAmB,WAAH,OAC3BC,OAAOC,YACLC,SAASC,OAAOC,MAAM,MAAMC,KAAI,SAACF,GAC/B,IAAAG,EAAwBH,EAAOC,MAAM,KAAIG,EAAAC,EAAAF,GAAlCG,EAAGF,EAAA,GAAKG,EAAKH,EAAAI,MAAA,GACdC,EAAeC,mBAAmBH,EAAMI,KAAK,MACnD,IACE,MAAO,CAACL,EAAKM,KAAKC,MAAMJ,GACzB,CAAC,MAAAK,GACA,MAAO,CAACR,EAAKG,EACf,CACF,IACD,EAEUM,EAAe,WAC1BhB,SAASC,OAAOC,MAAM,MAAMe,SAAQ,SAAChB,GACnC,IAAAiB,EAAejB,EAAOC,MAAM,KAArBiB,EAAyBC,EAAAF,EAAA,GAArB,GACXG,EAAaF,EACf,GACF,EAOMG,EAAmB,SAACf,EAAagB,GACrCF,EAAad,EAAKgB,GAClBC,GACF,EAoBaC,EAAa,WACxB,IAAAC,EAA0BC,EACN,oBAAXC,OAA0B/B,IAAgC,IAClEgC,EAAAT,EAAAM,EAAA,GAFMlB,EAAKqB,EAAA,GAAEC,EAAQD,EAAA,GAItBE,GAAU,WACR,IAAMC,EAAW,WAAH,OAASF,EAASjC,IAA4B,EAG5D,OADA+B,OAAOK,iBAAiBC,EAAcF,GAC/B,WACLJ,OAAOO,oBAAoBD,EAAcF,EAC1C,CACF,GAAE,IAWH,MAAO,CAAExB,MAAAA,EAAO4B,IATJ,SAAC7B,EAAaC,EAAce,GACtC,GAAc,OAAVf,EAAgB,OAAOc,EAAiBf,IA3C1B,SAACA,EAAaC,EAAYe,GAC9Cc,EAAU9B,EAAKC,EAAOe,GACtBC,GACF,CAyCIc,CAAc/B,EAAKC,EAAOe,EAC3B,EAMoBgB,OAJN,SAAChC,EAAagB,GAA4B,OAAKD,EAAiBf,EAAKgB,EAAQ,EAI/DiB,OAHd,WAAH,OAAS3C,GAAkB,EAGF4C,MAFvB,WAAH,OAtCXzB,SACAQ,GAqCsC,EAGxC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as n}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as r}from"react";var e=function(){for(var e,t,o,u=arguments.length,i=new Array(u),a=0;a<u;a++)i[a]=arguments[a];var l="number"==typeof i[0]?i[0]:null===(e=i[0])||void 0===e?void 0:e.initialValue,m="number"==typeof i[0]?null!==(t=i[1])&&void 0!==t?t:{}:null!==(o=i[0])&&void 0!==o?o:{},f=m.max,v=void 0===f?Number.POSITIVE_INFINITY:f,p=m.min,c=void 0===p?Number.NEGATIVE_INFINITY:p,b=r(null!=l?l:0),d=n(b,2),h=d[0],I=d[1];return{value:h,set:function(n){I((function(r){return Math.max(c,Math.min(v,"number"==typeof n?n:n(r)))}))},inc:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;I((function(r){return"number"==typeof v&&r===v?r:Math.max(Math.min(v,r+n),c)}))},dec:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;I((function(r){return"number"==typeof c&&r===c?r:Math.min(Math.max(c,r-n),v)}))},reset:function(){var n=null!=l?l:0;return"number"==typeof v&&n>v?I(v):"number"==typeof c&&n<c?I(c):void I(n)}}};export{e as useCounter};
|
|
3
3
|
//# sourceMappingURL=useCounter.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{b as e,_ as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{b as e,_ as t}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as r,useEffect as o}from"react";import{getElement as n}from"../../utils/helpers/getElement.js";import{useRefState as i}from"../useRefState/useRefState.js";var l=function(){var l="object"===e(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,u=l?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],s=l?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],v=r(null!=s?s:""),a=t(v,2),d=a[0],f=a[1],c=i(window.document.documentElement),m=function(e){var t=l?n(l):c.current;if(t&&t.style){if(!e)return t.style.removeProperty(u),void f(e);t.style.setProperty(u,e),f(e)}};return o((function(){s&&m(s)}),[]),o((function(){if(l||c.state){var e=l?n(l):c.current;if(e){var t=new MutationObserver((function(){var t,r=null===(t=window.getComputedStyle(e).getPropertyValue(u))||void 0===t?void 0:t.trim();f(null!=r?r:s)}));return t.observe(e,{attributeFilter:["style","class"]}),function(){t.disconnect()}}}}),[l,c.state]),{value:d,set:m}};export{l as useCssVar};
|
|
3
3
|
//# sourceMappingURL=useCssVar.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{useMemo as r}from"react";import{
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{useMemo as r}from"react";import{debounce as e}from"../../utils/helpers/debounce.js";import{useEvent as t}from"../useEvent/useEvent.js";var o=function(o,n){var u=t(o);return r((function(){return e(u,n)}),[n])};export{o as useDebounceCallback};
|
|
3
3
|
//# sourceMappingURL=useDebounceCallback.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useRef as r,useState as o,useEffect as t}from"react";import{useDebounceCallback as u}from"../useDebounceCallback/useDebounceCallback.js";import"../../utils/helpers/debounce.js";import"../useEvent/useEvent.js";var n=function(n,s){var l=r(n),c=o(n),a=e(c,2),i=a[0],p=a[1],m=u(p,s);return t((function(){l.current!==n&&(m(n),l.current=n)}),[n]),i};export{n as useDebounceValue};
|
|
3
3
|
//# sourceMappingURL=useDebounceValue.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as l}from"react";var o=function(o,e){var t=l(o),a=r(t,2),n=a[0];return[null==n?e:n,a[1]]};export{o as useDefault};
|
|
3
3
|
//# sourceMappingURL=useDefault.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as l,c as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as l,c as n}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as a,useRef as e,useEffect as t}from"react";import{throttle as i}from"../../utils/helpers/throttle.js";var r=function(r){var o,c,u=null===(o=null==r?void 0:r.enabled)||void 0===o||o,v=null!==(c=null==r?void 0:r.delay)&&void 0!==c?c:1e3,d=a({interval:0,rotationRate:{alpha:null,beta:null,gamma:null},acceleration:{x:null,y:null,z:null},accelerationIncludingGravity:{x:null,y:null,z:null}}),m=l(d,2),s=m[0],f=m[1],p=e(null==r?void 0:r.callback);return p.current=null==r?void 0:r.callback,t((function(){if(u){var l=i((function(l){var a;null===(a=p.current)||void 0===a||a.call(p,l),f({interval:l.interval,rotationRate:n(n({},s.rotationRate),l.rotationRate),acceleration:n(n({},s.acceleration),l.acceleration),accelerationIncludingGravity:n(n({},s.accelerationIncludingGravity),l.accelerationIncludingGravity)})}),v);return window.addEventListener("devicemotion",l),function(){window.removeEventListener("devicemotion",l)}}}),[v,u]),s};export{r as useDeviceMotion};
|
|
3
3
|
//# sourceMappingURL=useDeviceMotion.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as n,useEffect as t}from"react";var a=function(){var a="undefined"!=typeof window&&"DeviceOrientationEvent"in window,i=n({alpha:null,beta:null,gamma:null,absolute:!1}),o=e(i,2),r=o[0],l=o[1];return t((function(){if(a){var e=function(e){return l({alpha:e.alpha,beta:e.beta,gamma:e.gamma,absolute:e.absolute})};return window.addEventListener("deviceorientation",e),function(){window.removeEventListener("deviceorientation",e)}}}),[]),{supported:a,value:r}};export{a as useDeviceOrientation};
|
|
3
3
|
//# sourceMappingURL=useDeviceOrientation.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as i,useEffect as n}from"react";var o=function(){var o,t="undefined"!=typeof window&&"function"==typeof window.matchMedia&&"number"==typeof window.devicePixelRatio,r=i(null!==(o=window.devicePixelRatio)&&void 0!==o?o:1),d=e(r,2),a=d[0],c=d[1];return n((function(){if(t){var e=function(){return c(window.devicePixelRatio)},i=window.matchMedia("(resolution: ".concat(window.devicePixelRatio,"dppx)"));return i.addEventListener("change",e),function(){i.removeEventListener("change",e)}}}),[a]),{supported:t,ratio:a}};export{o as useDevicePixelRatio};
|
|
3
3
|
//# sourceMappingURL=useDevicePixelRatio.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
2
|
import{useRef as r}from"react";import{useIsomorphicLayoutEffect as o}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var t=function(t,f){var c=r(!0);o((function(){if(!c.current){var r=t();return r&&"function"==typeof r?r:void 0}c.current=!1}),f)};export{t as useDidUpdate};
|
|
3
3
|
//# sourceMappingURL=useDidUpdate.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as n}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as r}from"react";var o=function(){var o=arguments.length>1?arguments[1]:void 0,l=r(arguments.length>0&&void 0!==arguments[0]&&arguments[0]),e=n(l,2),t=e[0],u=e[1],i=function(){return u((function(n){var r;return n||(null==o||null===(r=o.onOpen)||void 0===r||r.call(o),!0)}))},c=function(){return u((function(n){var r;return n?(null==o||null===(r=o.onClose)||void 0===r||r.call(o),!1):n}))};return{opened:t,open:i,close:c,toggle:function(){return t?c():i()}}};export{o as useDisclosure};
|
|
3
3
|
//# sourceMappingURL=useDisclosure.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e,d as r,e as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e,d as r,e as t}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as n,useRef as i,useEffect as a}from"react";import{getElement as u}from"../../utils/helpers/getElement.js";import{isTarget as o}from"../../utils/helpers/isTarget.js";import{useRefState as s}from"../useRefState/useRefState.js";var c=function(){var c,l="undefined"!=typeof navigator&&"mediaDevices"in navigator&&!!navigator.mediaDevices&&"getDisplayMedia"in navigator.mediaDevices,d=o(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,p=(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],f=null!==(c=null==p?void 0:p.enabled)&&void 0!==c&&c,v=n(!1),g=e(v,2),m=g[0],h=g[1],b=i(null),j=s(),D=function(){if(b.current&&l){var e=d?u(d):j.current;e&&(h(!1),e.srcObject=null,b.current.getTracks().forEach((function(e){return e.stop()})),b.current=null)}},k=function(){var e=r(t().mark((function e(){var r,n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=2;break}return e.abrupt("return");case 2:if(r=d?u(d):j.current){e.next=5;break}return e.abrupt("return");case 5:return e.next=7,navigator.mediaDevices.getDisplayMedia({video:null==p?void 0:p.video,audio:null==p?void 0:p.audio});case 7:return n=e.sent,h(!0),b.current=n,r.srcObject=n,n.getTracks().forEach((function(e){return e.onended=D})),e.abrupt("return",n);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return a((function(){if(l&&f&&((d||j.state)&&(d?u(d):j.current)))return k(),function(){D()}}),[d,j.state]),d?{stream:b.current,sharing:m,supported:l,start:k,stop:D}:{stream:b.current,sharing:m,supported:l,start:k,stop:D,ref:j}};export{c as useDisplayMedia};
|
|
3
3
|
//# sourceMappingURL=useDisplayMedia.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{useEventListener as e}from"../useEventListener/useEventListener.js";import"react";import"../useEvent/useEvent.js";import"../useRefState/useRefState.js";import"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
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-DMxTFLvA.js";var t=function(t,r,s){return e(document,t,r,s)};export{t as useDocumentEvent};
|
|
3
3
|
//# sourceMappingURL=useDocumentEvent.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as t}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useRef as n,useState as e,useEffect as o}from"react";function r(r,u){var i=n(document.title),c=e(null!=r?r:document.title),l=t(c,2),m=l[0],f=l[1],d=function(t){var n=t.trim();n.length>0&&(document.title=n)};return o((function(){"string"==typeof m&&d(m)}),[m]),o((function(){var t=new MutationObserver((function(){f((function(t){return document&&document.title!==t?document.title:t}))}));return t.observe(document.head.querySelector("title"),{childList:!0}),function(){t.disconnect()}}),[]),o((function(){if(null!=u&&u.restoreOnUnmount)return function(){document.title=i.current}}),[]),{value:m,set:d}}export{r as useDocumentTitle};
|
|
3
3
|
//# sourceMappingURL=useDocumentTitle.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
2
|
import{useSyncExternalStore as n}from"react";var t=function(){return document.visibilityState},e=function(){return"hidden"},i=function(n){return document.addEventListener("visibilitychange",n),function(){document.removeEventListener("visibilitychange",n)}},r=function(){return n(i,t,e)};export{r as useDocumentVisibility};
|
|
3
3
|
//# sourceMappingURL=useDocumentVisibility.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as t}from"react";import{getElement as r}from"../../utils/helpers/getElement.js";import{isTarget as i}from"../../utils/helpers/isTarget.js";import{useIsomorphicLayoutEffect as o}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import{useRefState as n}from"../useRefState/useRefState.js";var s=function(){var s=i(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,u=t({width:0,height:0}),h=e(u,2),f=h[0],a=h[1],l=n();return o((function(){var e=s?r(s):l.current;if(e){var t=e.getBoundingClientRect(),i=t.width,o=t.height;a({width:i,height:o});var n=new ResizeObserver((function(){var t=e.getBoundingClientRect(),r=t.width,i=t.height;a({width:r,height:i})}));return n.observe(e),function(){n.disconnect()}}}),[l.current,s]),s?{value:f}:{ref:l,value:f}};export{s as useElementSize};
|
|
3
3
|
//# sourceMappingURL=useElementSize.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
2
|
import{useRef as r,useCallback as t}from"react";var n=function(n){var e=r(n);return e.current=n,t((function(){return e.current.apply(void 0,arguments)}),[])};export{n as useEvent};
|
|
3
3
|
//# sourceMappingURL=useEvent.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{useEffect as e}from"react";import{
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{useEffect as e}from"react";import{getElement as t}from"../../utils/helpers/getElement.js";import{useEvent as n}from"../useEvent/useEvent.js";import{useRefState as r}from"../useRefState/useRefState.js";import"../../_rollupPluginBabelHelpers-DMxTFLvA.js";var o=function(){var o=(arguments.length<=1?void 0:arguments[1])instanceof Function||arguments.length<=0?void 0:arguments[0],i=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],u=Array.isArray(i)?i:[i],f=o?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],v=o?arguments.length<=3?void 0:arguments[3]:arguments.length<=2?void 0:arguments[2],l=r(window),s=n(f);if(e((function(){var e=o?t(o):l.current;if(e){var n=function(e){return s(e)};return u.forEach((function(t){return e.addEventListener(t,n,v)})),function(){u.forEach((function(t){return e.removeEventListener(t,n,v)}))}}}),[o,l.state,i,v]),!o)return l};export{o as useEventListener};
|
|
3
3
|
//# sourceMappingURL=useEventListener.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r,d as e,e as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as r,d as e,e as n}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as o}from"react";var t=function(){var t="undefined"!=typeof window&&"EyeDropper"in window,p=o(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0),a=r(p,2),i=a[0],u=a[1],s=function(){var r=e(n().mark((function r(e){var o,t;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(window.EyeDropper){r.next=2;break}throw new Error("EyeDropper is not supported");case 2:return o=new window.EyeDropper,r.next=5,o.open(e);case 5:return t=r.sent,u(t.sRGBHex),r.abrupt("return",t);case 8:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}();return{supported:t,value:i,open:s}};export{t as useEyeDropper};
|
|
3
3
|
//# sourceMappingURL=useEyeDropper.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as o}from"react";import{useDidUpdate as t}from"../useDidUpdate/useDidUpdate.js";import{useMount as r}from"../useMount/useMount.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var n=function(n){var u,i=o(null!=n?n:null===(u=document.querySelector('link[rel*="icon"]'))||void 0===u?void 0:u.href),c=e(i,2),l=c[0],p=c[1],m=function(e){var o=document.querySelector('link[rel*="icon"]')||document.createElement("link");o.rel="icon",o.href=e,o.type="image/".concat(e.split(".").pop()),document.head.append(o)};return r((function(){n&&m(n)})),t((function(){n&&(p(n),m(n))}),[n]),{href:l,set:function(e){p(e),m(e)}}};export{n as useFavicon};
|
|
3
3
|
//# sourceMappingURL=useFavicon.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e,d as r,e as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e,d as r,e as n}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useRef as t,useState as u}from"react";import{useRerender as i}from"../useRerender/useRerender.js";var a=function(a){var l,c,o=null!==(l=null==a?void 0:a.initialValue)&&void 0!==l?l:"",v=t(),d=t(!1),f=i(),s=u(!1),m=e(s,2),p=m[0],h=m[1],g=u(null!==(c=null==a?void 0:a.initialTouched)&&void 0!==c&&c),x=e(g,2),k=x[0],b=x[1],y=u(void 0),L=e(y,2),V=L[0],w=L[1],B=function(){var e,r,n,t;return"radio"===(null===(e=v.current)||void 0===e?void 0:e.type)||"checkbox"===(null===(r=v.current)||void 0===r?void 0:r.type)?v.current.checked:null!==(n=null===(t=v.current)||void 0===t?void 0:t.value)&&void 0!==n?n:o},C=function(e){var r,n;return"radio"===(null===(r=v.current)||void 0===r?void 0:r.type)||"checkbox"===(null===(n=v.current)||void 0===n?void 0:n.type)?(v.current.checked=e,d.current?f():void 0):(v.current.value=e,d.current?f():void 0)},O=function(e){if(e.required&&!v.current.value)return w(e.required);if(e.minLength&&v.current.value.length<e.minLength.value)return w(e.minLength.message);if(e.maxLength&&v.current.value.length>e.maxLength.value)return w(e.maxLength.message);if(e.min&&Number(v.current.value)<e.min.value)return w(e.min.message);if(e.max&&Number(v.current.value)>e.max.value)return w(e.max.message);if(e.pattern&&!e.pattern.value.test(v.current.value))return w(e.pattern.message);if(e.validate){var r=e.validate(v.current.value);if("string"==typeof r)return w(r)}w(void 0)};return{register:function(e){return{ref:function(r){if(!v.current&&r){if(null!=a&&a.autoFocus&&r.focus(),v.current=r,"radio"===v.current.type)return void(v.current.defaultChecked=(null==a?void 0:a.initialValue)===r.value);if("checkbox"===v.current.type)return void(v.current.defaultChecked=!(null==a||!a.initialValue));v.current.defaultValue=String(o),e&&null!=a&&a.validateOnMount&&O(e)}},onChange:(u=r(n().mark((function r(){return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!d.current){r.next=2;break}return r.abrupt("return",f());case 2:if(v.current.value!==o&&h(!0),p&&v.current.value===o&&h(!1),!e||null==a||!a.validateOnChange){r.next=7;break}return r.next=7,O(e);case 7:e&&null!=a&&a.validateOnBlur&&w(void 0);case 8:case"end":return r.stop()}}),r)}))),function(){return u.apply(this,arguments)}),onBlur:(t=r(n().mark((function r(){return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e||null==a||!a.validateOnBlur){r.next=3;break}return r.next=3,O(e);case 3:b(!0);case 4:case"end":return r.stop()}}),r)}))),function(){return t.apply(this,arguments)})};var t,u},dirty:p,touched:k,error:V,setError:w,clearError:function(){return w(void 0)},getValue:B,setValue:C,reset:function(){C(o),h(!1),b(!1),w(void 0)},watch:function(){return d.current=!0,B()},focus:function(){v.current.focus()}}};export{a as useField};
|
|
3
3
|
//# sourceMappingURL=useField.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as l}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as l}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as n,useRef as u,useEffect as e}from"react";var r=!0,t="*",i=!1,o=function(){var o="function"==typeof(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,c=o?arguments.length<=0?void 0:arguments[0]:arguments.length<=1?void 0:arguments[1],v=n(null),d=l(v,2),a=d[0],p=d[1],f=u(),m=u(o);m.current=o;var s=function(){var l;p(null),null===(l=m.current)||void 0===l||l.call(m,null),f.current&&(f.current.value="")};return e((function(){var l;return f.current=((l=document.createElement("input")).type="file",l.onchange=function(l){var n,u=l.target.files;p(u),null===(n=m.current)||void 0===n||n.call(m,u)},l),function(){var l;null===(l=f.current)||void 0===l||l.remove()}}),[null==c?void 0:c.multiple,null==c?void 0:c.accept,null==c?void 0:c.capture,null==c?void 0:c.reset]),{value:a,open:function(l){var n,u,e,o,v,d,a;if(f.current){f.current.multiple=null!==(n=null!==(u=null==l?void 0:l.multiple)&&void 0!==u?u:null==c?void 0:c.multiple)&&void 0!==n?n:r,f.current.accept=null!==(e=null!==(o=null==l?void 0:l.accept)&&void 0!==o?o:null==c?void 0:c.accept)&&void 0!==e?e:t;var p=null!==(v=null==l?void 0:l.capture)&&void 0!==v?v:null==c?void 0:c.capture;p&&(f.current.capture=p),(null!==(d=null!==(a=null==l?void 0:l.reset)&&void 0!==a?a:null==c?void 0:c.reset)&&void 0!==d?d:i)&&s(),f.current.click()}},reset:s}};export{o as useFileDialog};
|
|
3
3
|
//# sourceMappingURL=useFileDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileDialog.js","sources":["../../../../src/hooks/useFileDialog/useFileDialog.ts"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { useEffect, useRef, useState } from 'react';\n\n/* The use file dialog options */\nexport interface UseFileDialogOptions extends Pick<ComponentProps<'input'>, 'accept' | 'multiple'> {\n /** The capture value */\n capture?: string;\n /** The reset value */\n reset?: boolean;\n}\n\nconst DEFAULT_OPTIONS = {\n multiple: true,\n accept: '*',\n reset: false\n} satisfies UseFileDialogOptions;\n\n/* The use file dialog return type */\nexport interface UseFileDialogReturn {\n /** The selected files */\n value: FileList | null;\n /** The open function */\n open: (openParams?: UseFileDialogOptions) => void;\n /** The reset function */\n reset: () => void;\n}\n\nexport interface UseFileDialog {\n (\n callback?: (value: FileList | null) => void,\n options?: UseFileDialogOptions\n ): UseFileDialogReturn;\n\n (options?: UseFileDialogOptions, callback?: never): UseFileDialogReturn;\n}\n\n/**\n * @name useFileDialog\n * @description - Hook to handle file input\n * @category Browser\n *\n * @overload\n * @param {(value: FileList | null) => void} callback The callback to execute when a file is selected\n * @param {boolean} [options.multiple=true] Whether multiple files can be selected\n * @param {string} [options.accept='*'] The accepted file types\n * @param {boolean} [options.reset=false] Whether the input should be reset when the callback is called\n * @param {string} [options.capture] The capture value\n * @returns {UseFileDialogReturn} An object containing the selected files\n *\n * @example\n * const { values, open, reset } = useFileDialog((value) => console.log(value));\n *\n * @overload\n * @param {boolean} [options.multiple=true] Whether multiple files can be selected\n * @param {string} [options.accept='*'] The accepted file types\n * @param {boolean} [options.reset=false] Whether the input should be reset when the callback is called\n * @param {string} [options.capture] The capture value\n * @returns {UseFileDialogReturn} An object containing the selected files\n *\n * @example\n * const { values, open, reset } = useFileDialog({ accept: 'image/*' });\n */\nexport const useFileDialog = ((...params: any[]) => {\n const callback = (typeof params[0] === 'function' ? params[0] : undefined) as\n | ((value: FileList | null) => void)\n | undefined;\n const options = (callback ? params[0] : params[1]) as UseFileDialogOptions | undefined;\n\n const [value, setValue] = useState<FileList | null>(null);\n const inputRef = useRef<HTMLInputElement>();\n const internalCallbackRef = useRef(callback);\n internalCallbackRef.current = callback;\n\n const reset = () => {\n setValue(null);\n internalCallbackRef.current?.(null);\n if (inputRef.current) inputRef.current.value = '';\n };\n\n const open = (openParams?: UseFileDialogOptions) => {\n if (!inputRef.current) return;\n\n inputRef.current.multiple =\n openParams?.multiple ?? options?.multiple ?? DEFAULT_OPTIONS.multiple;\n inputRef.current.accept = openParams?.accept ?? options?.accept ?? DEFAULT_OPTIONS.accept;\n\n const capture = openParams?.capture ?? options?.capture;\n if (capture) inputRef.current.capture = capture;\n\n if (openParams?.reset ?? options?.reset ?? DEFAULT_OPTIONS.reset) reset();\n\n inputRef.current.click();\n };\n\n useEffect(() => {\n const init = () => {\n const input = document.createElement('input');\n input.type = 'file';\n\n input.onchange = (event: Event) => {\n const { files } = event.target as HTMLInputElement;\n setValue(files);\n internalCallbackRef.current?.(files);\n };\n return input;\n };\n\n inputRef.current = init();\n return () => {\n inputRef.current?.remove();\n };\n }, [options?.multiple, options?.accept, options?.capture, options?.reset]);\n\n return { value, open, reset };\n}) as UseFileDialog;\n"],"names":["DEFAULT_OPTIONS","useFileDialog","callback","arguments","length","undefined","options","_useState","useState","_useState2","_slicedToArray","value","setValue","inputRef","useRef","internalCallbackRef","current","reset","_internalCallbackRef$","call","useEffect","input","document","createElement","type","onchange","event","_internalCallbackRef$2","files","target","_inputRef$current","remove","multiple","accept","capture","open","openParams","_ref","_openParams$multiple","_ref2","_openParams$accept","_openParams$capture","_ref3","_openParams$reset","click"],"mappings":";4HAYA,IAAMA,GACM,EADNA,EAEI,IAFJA,GAGG,EAgDIC,EAAiB,WAC5B,IAAMC,EAAiC,mBAArBC,UAAAC,QAAA,OAAAC,EAAAF,UAAA,IAA+BA,UAAAC,eAAAC,EAAAF,UAAA,QAAeE,EAG1DC,EAAWJ,EAAQC,UAAAC,QAAAC,OAAAA,EAAAF,UAAA,GAAAA,UAAAC,eAAAC,EAAAF,UAA6D,GAEtFI,EAA0BC,EAA0B,MAAKC,EAAAC,EAAAH,EAAA,GAAlDI,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAChBI,EAAWC,IACXC,EAAsBD,EAAOZ,GACnCa,EAAoBC,QAAUd,EAE9B,IAAMe,EAAQ,WAAM,IAAAC,EAClBN,EAAS,MACkBM,QAA3BA,EAAAH,EAAoBC,eAApBE,IAA2BA,GAA3BA,EAAAC,KAAAJ,EAA8B,MAC1BF,EAASG,UAASH,EAASG,QAAQL,MAAQ,GAChD,EAoCD,OAnBAS,GAAU,WACR,IACQC,EAYR,OADAR,EAASG,UAXDK,EAAQC,SAASC,cAAc,UAC/BC,KAAO,OAEbH,EAAMI,SAAW,SAACC,GAAiB,IAAAC,EACzBC,EAAUF,EAAMG,OAAhBD,MACRhB,EAASgB,GACkBD,QAA3BA,EAAAZ,EAAoBC,eAApBW,IAA2BA,GAA3BA,EAAAR,KAAAJ,EAA8Ba,EAC/B,EACMP,GAIF,WAAM,IAAAS,EACK,QAAhBA,EAAAjB,EAASG,eAAO,IAAAc,GAAhBA,EAAkBC,QACnB,
|
|
1
|
+
{"version":3,"file":"useFileDialog.js","sources":["../../../../src/hooks/useFileDialog/useFileDialog.ts"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { useEffect, useRef, useState } from 'react';\n\n/* The use file dialog options */\nexport interface UseFileDialogOptions extends Pick<ComponentProps<'input'>, 'accept' | 'multiple'> {\n /** The capture value */\n capture?: string;\n /** The reset value */\n reset?: boolean;\n}\n\nconst DEFAULT_OPTIONS = {\n multiple: true,\n accept: '*',\n reset: false\n} satisfies UseFileDialogOptions;\n\n/* The use file dialog return type */\nexport interface UseFileDialogReturn {\n /** The selected files */\n value: FileList | null;\n /** The open function */\n open: (openParams?: UseFileDialogOptions) => void;\n /** The reset function */\n reset: () => void;\n}\n\nexport interface UseFileDialog {\n (\n callback?: (value: FileList | null) => void,\n options?: UseFileDialogOptions\n ): UseFileDialogReturn;\n\n (options?: UseFileDialogOptions, callback?: never): UseFileDialogReturn;\n}\n\n/**\n * @name useFileDialog\n * @description - Hook to handle file input\n * @category Browser\n *\n * @overload\n * @param {(value: FileList | null) => void} callback The callback to execute when a file is selected\n * @param {boolean} [options.multiple=true] Whether multiple files can be selected\n * @param {string} [options.accept='*'] The accepted file types\n * @param {boolean} [options.reset=false] Whether the input should be reset when the callback is called\n * @param {string} [options.capture] The capture value\n * @returns {UseFileDialogReturn} An object containing the selected files\n *\n * @example\n * const { values, open, reset } = useFileDialog((value) => console.log(value));\n *\n * @overload\n * @param {boolean} [options.multiple=true] Whether multiple files can be selected\n * @param {string} [options.accept='*'] The accepted file types\n * @param {boolean} [options.reset=false] Whether the input should be reset when the callback is called\n * @param {string} [options.capture] The capture value\n * @returns {UseFileDialogReturn} An object containing the selected files\n *\n * @example\n * const { values, open, reset } = useFileDialog({ accept: 'image/*' });\n */\nexport const useFileDialog = ((...params: any[]) => {\n const callback = (typeof params[0] === 'function' ? params[0] : undefined) as\n | ((value: FileList | null) => void)\n | undefined;\n const options = (callback ? params[0] : params[1]) as UseFileDialogOptions | undefined;\n\n const [value, setValue] = useState<FileList | null>(null);\n const inputRef = useRef<HTMLInputElement>();\n const internalCallbackRef = useRef(callback);\n internalCallbackRef.current = callback;\n\n const reset = () => {\n setValue(null);\n internalCallbackRef.current?.(null);\n if (inputRef.current) inputRef.current.value = '';\n };\n\n const open = (openParams?: UseFileDialogOptions) => {\n if (!inputRef.current) return;\n\n inputRef.current.multiple =\n openParams?.multiple ?? options?.multiple ?? DEFAULT_OPTIONS.multiple;\n inputRef.current.accept = openParams?.accept ?? options?.accept ?? DEFAULT_OPTIONS.accept;\n\n const capture = openParams?.capture ?? options?.capture;\n if (capture) inputRef.current.capture = capture;\n\n if (openParams?.reset ?? options?.reset ?? DEFAULT_OPTIONS.reset) reset();\n\n inputRef.current.click();\n };\n\n useEffect(() => {\n const init = () => {\n const input = document.createElement('input');\n input.type = 'file';\n\n input.onchange = (event: Event) => {\n const { files } = event.target as HTMLInputElement;\n setValue(files);\n internalCallbackRef.current?.(files);\n };\n return input;\n };\n\n inputRef.current = init();\n return () => {\n inputRef.current?.remove();\n };\n }, [options?.multiple, options?.accept, options?.capture, options?.reset]);\n\n return { value, open, reset };\n}) as UseFileDialog;\n"],"names":["DEFAULT_OPTIONS","useFileDialog","callback","arguments","length","undefined","options","_useState","useState","_useState2","_slicedToArray","value","setValue","inputRef","useRef","internalCallbackRef","current","reset","_internalCallbackRef$","call","useEffect","input","document","createElement","type","onchange","event","_internalCallbackRef$2","files","target","_inputRef$current","remove","multiple","accept","capture","open","openParams","_ref","_openParams$multiple","_ref2","_openParams$accept","_openParams$capture","_ref3","_openParams$reset","click"],"mappings":";4HAYA,IAAMA,GACM,EADNA,EAEI,IAFJA,GAGG,EAgDIC,EAAiB,WAC5B,IAAMC,EAAiC,mBAArBC,UAAAC,QAAA,OAAAC,EAAAF,UAAA,IAA+BA,UAAAC,eAAAC,EAAAF,UAAA,QAAeE,EAG1DC,EAAWJ,EAAQC,UAAAC,QAAAC,OAAAA,EAAAF,UAAA,GAAAA,UAAAC,eAAAC,EAAAF,UAA6D,GAEtFI,EAA0BC,EAA0B,MAAKC,EAAAC,EAAAH,EAAA,GAAlDI,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAChBI,EAAWC,IACXC,EAAsBD,EAAOZ,GACnCa,EAAoBC,QAAUd,EAE9B,IAAMe,EAAQ,WAAM,IAAAC,EAClBN,EAAS,MACkBM,QAA3BA,EAAAH,EAAoBC,eAApBE,IAA2BA,GAA3BA,EAAAC,KAAAJ,EAA8B,MAC1BF,EAASG,UAASH,EAASG,QAAQL,MAAQ,GAChD,EAoCD,OAnBAS,GAAU,WACR,IACQC,EAYR,OADAR,EAASG,UAXDK,EAAQC,SAASC,cAAc,UAC/BC,KAAO,OAEbH,EAAMI,SAAW,SAACC,GAAiB,IAAAC,EACzBC,EAAUF,EAAMG,OAAhBD,MACRhB,EAASgB,GACkBD,QAA3BA,EAAAZ,EAAoBC,eAApBW,IAA2BA,GAA3BA,EAAAR,KAAAJ,EAA8Ba,EAC/B,EACMP,GAIF,WAAM,IAAAS,EACK,QAAhBA,EAAAjB,EAASG,eAAO,IAAAc,GAAhBA,EAAkBC,QACnB,CACF,GAAE,CAACzB,aAAAA,EAAAA,EAAS0B,SAAU1B,aAAO,EAAPA,EAAS2B,OAAQ3B,aAAAA,EAAAA,EAAS4B,QAAS5B,aAAAA,EAAAA,EAASW,QAE5D,CAAEN,MAAAA,EAAOwB,KAlCH,SAACC,GAAsC,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAClD,GAAK9B,EAASG,QAAd,CAEAH,EAASG,QAAQgB,SAC0B,QADlBK,EACH,QADGC,EACvBF,aAAAA,EAAAA,EAAYJ,gBAAQ,IAAAM,EAAAA,EAAIhC,eAAAA,EAAS0B,gBAAQK,IAAAA,EAAAA,EAAIrC,EAC/Ca,EAASG,QAAQiB,OAA8C,QAAxCM,EAAqB,QAArBC,EAAGJ,aAAAA,EAAAA,EAAYH,cAAM,IAAAO,EAAAA,EAAIlC,eAAAA,EAAS2B,cAAMM,IAAAA,EAAAA,EAAIvC,EAEnE,IAAMkC,UAAOO,EAAGL,aAAAA,EAAAA,EAAYF,eAAO,IAAAO,EAAAA,EAAInC,aAAO,EAAPA,EAAS4B,QAC5CA,IAASrB,EAASG,QAAQkB,QAAUA,YAExCQ,EAAqB,QAArBC,EAAIP,aAAAA,EAAAA,EAAYnB,aAAK,IAAA0B,EAAAA,EAAIrC,aAAAA,EAAAA,EAASW,aAAK,IAAAyB,EAAAA,EAAI1C,IAAuBiB,IAElEJ,EAASG,QAAQ4B,OAXM,CAYxB,EAqBqB3B,MAAAA,EACxB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as r,useRef as t,useEffect as n}from"react";import{getElement as o}from"../../utils/helpers/getElement.js";import{isTarget as u}from"../../utils/helpers/isTarget.js";import{useRefState as i}from"../useRefState/useRefState.js";var l=function(){var l,s,f=u(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,v=null!==(s=(null!==(l=f?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0])&&void 0!==l?l:{}).initialValue)&&void 0!==s&&s,c=r(v),a=e(c,2),d=a[0],m=a[1],p=i(),g=t(),b=function(){var e;return null===(e=g.current)||void 0===e?void 0:e.focus()},h=function(){var e;return null===(e=g.current)||void 0===e?void 0:e.blur()};return n((function(){if(f||p.state){var e=f?o(f):p.current;if(e){g.current=e;var r=function(e){var r,t;(!b||null!==(r=(t=e.target).matches)&&void 0!==r&&r.call(t,":focus-visible"))&&m(!0)},t=function(){return m(!1)};return v&&e.focus(),e.addEventListener("focus",r),e.addEventListener("blur",t),function(){e.removeEventListener("focus",r),e.removeEventListener("blur",t)}}}}),[f,p.state]),f?{focus:b,blur:h,focused:d}:{ref:p,focus:b,blur:h,focused:d}};export{l as useFocus};
|
|
3
3
|
//# sourceMappingURL=useFocus.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as n,useEffect as e}from"react";var a=function(){var a=n(0),o=r(a,2),t=o[0],i=o[1];return e((function(){var r,n=0,e=performance.now(),a=function(){n+=1;var o=performance.now(),t=o-e;if(t>=1e3){var m=Math.round(1e3*n/t);i(m),n=0,e=o}r=requestAnimationFrame(a)};return r=requestAnimationFrame(a),function(){cancelAnimationFrame(r)}}),[]),t};export{a as useFps};
|
|
3
3
|
//# sourceMappingURL=useFps.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as n,useEffect as l}from"react";import{getElement as r}from"../../utils/helpers/getElement.js";import{isTarget as t}from"../../utils/helpers/isTarget.js";import{useRefState as o}from"../useRefState/useRefState.js";const c=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],u=(()=>{if("undefined"==typeof document)return!1;const e=c[0],n={};for(const l of c){const r=l?.[1];if(r in document){for(const[r,t]of l.entries())n[e[r]]=t;return n}}return!1})(),s={change:u.fullscreenchange,error:u.fullscreenerror};let i={request:(e=document.documentElement,n)=>new Promise(((l,r)=>{const t=()=>{i.off("change",t),l()};i.on("change",t);const o=e[u.requestFullscreen](n);o instanceof Promise&&o.then(t).catch(r)})),exit:()=>new Promise(((e,n)=>{if(!i.isFullscreen)return void e();const l=()=>{i.off("change",l),e()};i.on("change",l);const r=document[u.exitFullscreen]();r instanceof Promise&&r.then(l).catch(n)})),toggle:(e,n)=>i.isFullscreen?i.exit():i.request(e,n),onchange(e){i.on("change",e)},onerror(e){i.on("error",e)},on(e,n){const l=s[e];l&&document.addEventListener(l,n,!1)},off(e,n){const l=s[e];l&&document.removeEventListener(l,n,!1)},raw:u};Object.defineProperties(i,{isFullscreen:{get:()=>Boolean(document[u.fullscreenElement])},element:{enumerable:!0,get:()=>document[u.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[u.fullscreenEnabled])}}),u||(i={isEnabled:!1});var a=i,f=function(){var c,u=t(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,s=u?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],i=n(null!==(c=null==s?void 0:s.initialValue)&&void 0!==c&&c),f=e(i,2),m=f[0],d=f[1],g=o(),b=function(){if(a.isEnabled){var e,n;if(a.isFullscreen)null==s||null===(e=s.onEnter)||void 0===e||e.call(s);else a.off("change",b),null==s||null===(n=s.onExit)||void 0===n||n.call(s);d(a.isFullscreen)}},h=function(){var e=u?r(u):g.current;if(e&&a.isEnabled)try{a.request(e),a.on("change",b)}catch(e){console.error(e)}},E=function(){a.isEnabled&&a.exit()},F=function(){if(m)return E();h()};return l((function(){return function(){a.isEnabled&&a.off("change",b)}}),[]),u?{enter:h,exit:E,toggle:F,value:m}:{ref:g,enter:h,exit:E,toggle:F,value:m}};export{f as useFullscreen};
|
|
3
3
|
//# sourceMappingURL=useFullscreen.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
2
|
var t=function(t){return{buttons:{a:t.buttons[0],b:t.buttons[1],x:t.buttons[2],y:t.buttons[3]},bumper:{left:t.buttons[4],right:t.buttons[5]},triggers:{left:t.buttons[6],right:t.buttons[7]},stick:{left:{horizontal:t.axes[0],vertical:t.axes[1],button:t.buttons[10]},right:{horizontal:t.axes[2],vertical:t.axes[3],button:t.buttons[11]}},dpad:{up:t.buttons[12],down:t.buttons[13],left:t.buttons[14],right:t.buttons[15]},back:t.buttons[8],start:t.buttons[9]}};export{t as mapGamepadToXbox360Controller};
|
|
3
3
|
//# sourceMappingURL=mapGamepadToXbox360Controller.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e,c as a,
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.98 */
|
|
2
|
+
import{_ as e,c as a,g as t,h as n,a as r}from"../../_rollupPluginBabelHelpers-DMxTFLvA.js";import{useState as o,useEffect as i}from"react";import{useRaf as d}from"../useRaf/useRaf.js";export{mapGamepadToXbox360Controller}from"./helpers/mapGamepadToXbox360Controller.js";var c=function(){var c="undefined"!=typeof navigator&&"getGamepads"in navigator,u=o({}),p=e(u,2),s=p[0],m=p[1],v=function(e){var t=[],n="vibrationActuator"in e?e.vibrationActuator:null;return n&&t.push(n),e.hapticActuators&&t.push.apply(t,r(e.hapticActuators)),a(a({},e),{},{hapticActuators:t})},l=d((function(){var e,a,t=n(null!==(e=navigator.getGamepads())&&void 0!==e?e:[]);try{for(t.s();!(a=t.n()).done;){var r=a.value;r&&s[r.index]&&(s[r.index]=v(r))}}catch(e){t.e(e)}finally{t.f()}}),{enabled:!!Object.keys(s).length}).active;return i((function(){if(c){var e=navigator.getGamepads();m(e.reduce((function(e,n){return a(a({},e),n&&t({},n.index,v(n)))}),{}))}}),[]),i((function(){var e=function(e){var n=e.gamepad;m(a(a({},s),{},t({},n.index,v(n))))},n=function(e){var t=e.gamepad,n=a({},s);delete n[t.index],m(n)};return document.addEventListener("gamepadconnected",e),document.addEventListener("gamepaddisconnected",n),function(){document.removeEventListener("gamepadconnected",e),document.removeEventListener("gamepaddisconnected",n)}}),[]),{active:l,supported:c,gamepads:Object.values(s)}};export{c as useGamepad};
|
|
3
3
|
//# sourceMappingURL=useGamepad.js.map
|