@siberiacancode/reactuse 0.0.97 → 0.0.99
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-C-GU1yny.js} +3 -3
- package/dist/cjs/_rollupPluginBabelHelpers-C-GU1yny.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/useField/useField.js.map +1 -1
- package/dist/cjs/hooks/useFileDialog/useFileDialog.js +2 -2
- package/dist/cjs/hooks/useFileDialog/useFileDialog.js.map +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.js +2 -2
- package/dist/cjs/hooks/useFocus/useFocus.js.map +1 -1
- package/dist/cjs/hooks/useFps/useFps.js +2 -2
- package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
- package/dist/cjs/hooks/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/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
- 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/useLess/useLess.js +3 -0
- package/dist/cjs/hooks/useLess/useLess.js.map +1 -0
- 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 +2 -2
- package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js.map +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/usePerformanceObserver/usePerformanceObserver.js +3 -0
- package/dist/cjs/hooks/usePerformanceObserver/usePerformanceObserver.js.map +1 -0
- 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-D_XDB4a1.js} +3 -3
- package/dist/esm/_rollupPluginBabelHelpers-D_XDB4a1.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/useField/useField.js.map +1 -1
- package/dist/esm/hooks/useFileDialog/useFileDialog.js +2 -2
- package/dist/esm/hooks/useFileDialog/useFileDialog.js.map +1 -1
- package/dist/esm/hooks/useFocus/useFocus.js +2 -2
- package/dist/esm/hooks/useFocus/useFocus.js.map +1 -1
- package/dist/esm/hooks/useFps/useFps.js +2 -2
- package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
- package/dist/esm/hooks/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/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
- 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/useLess/useLess.js +3 -0
- package/dist/esm/hooks/useLess/useLess.js.map +1 -0
- 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 +2 -2
- package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js.map +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/usePerformanceObserver/usePerformanceObserver.js +3 -0
- package/dist/esm/hooks/usePerformanceObserver/usePerformanceObserver.js.map +1 -0
- 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 +100 -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
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { DependencyList, RefObject, Dispatch, SetStateAction, EffectCallback, ComponentProps, useEffect, MouseEventHandler, TouchEventHandler, MouseEvent as MouseEvent$1 } from 'react';
|
|
3
|
-
import { RemoveCookieParams as RemoveCookieParams$1, SetCookieParams as SetCookieParams$1 } from '@/utils/helpers';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @name useActiveElement
|
|
@@ -364,16 +363,46 @@ declare const useClipboard: (params?: UseCopyToClipboardParams) => UseCopyToClip
|
|
|
364
363
|
*/
|
|
365
364
|
declare const useConst: <Value>(initialValue: (() => Value) | Value) => Value;
|
|
366
365
|
|
|
366
|
+
declare const getCookies: () => {
|
|
367
|
+
[k: string]: string;
|
|
368
|
+
};
|
|
369
|
+
interface RemoveCookieParams {
|
|
370
|
+
domain?: string;
|
|
371
|
+
expires?: Date;
|
|
372
|
+
maxAge?: number;
|
|
373
|
+
path?: string;
|
|
374
|
+
sameSite?: 'Lax' | 'None' | 'Strict';
|
|
375
|
+
secure?: boolean;
|
|
376
|
+
}
|
|
377
|
+
declare const removeCookie: (key: string, options?: RemoveCookieParams) => void;
|
|
378
|
+
interface SetCookieParams {
|
|
379
|
+
domain?: string;
|
|
380
|
+
expires?: Date;
|
|
381
|
+
httpOnly?: boolean;
|
|
382
|
+
maxAge?: number;
|
|
383
|
+
path?: string;
|
|
384
|
+
sameSite?: 'Lax' | 'None' | 'Strict';
|
|
385
|
+
secure?: boolean;
|
|
386
|
+
}
|
|
387
|
+
declare const setCookie: (key: string, value: string, options?: SetCookieParams) => void;
|
|
367
388
|
type UseCookieInitialValue<Value> = (() => Value) | Value;
|
|
368
389
|
interface UseCookieOptions<Value> {
|
|
390
|
+
domain?: string;
|
|
391
|
+
expires?: Date;
|
|
392
|
+
httpOnly?: boolean;
|
|
369
393
|
initialValue?: UseCookieInitialValue<Value>;
|
|
394
|
+
maxAge?: number;
|
|
395
|
+
path?: string;
|
|
396
|
+
sameSite?: 'Lax' | 'None' | 'Strict';
|
|
397
|
+
secure?: boolean;
|
|
398
|
+
updateOnChange?: boolean;
|
|
370
399
|
deserializer?: (value: string) => Value;
|
|
371
400
|
serializer?: (value: Value) => string;
|
|
372
401
|
}
|
|
373
402
|
interface UseCookieReturn<Value> {
|
|
374
403
|
value: Value;
|
|
375
|
-
remove: (options?: RemoveCookieParams
|
|
376
|
-
set: (value: Value, options?: SetCookieParams
|
|
404
|
+
remove: (options?: RemoveCookieParams) => void;
|
|
405
|
+
set: (value: Value, options?: SetCookieParams) => void;
|
|
377
406
|
}
|
|
378
407
|
declare const COOKIE_EVENT = "reactuse-cookie";
|
|
379
408
|
declare const dispatchCookieEvent: () => boolean;
|
|
@@ -393,8 +422,35 @@ declare const dispatchCookieEvent: () => boolean;
|
|
|
393
422
|
*/
|
|
394
423
|
declare const useCookie: <Value>(key: string, params?: UseCookieInitialValue<Value> | UseCookieOptions<Value>) => {
|
|
395
424
|
value: Value | undefined;
|
|
396
|
-
set: (value: Value,
|
|
397
|
-
remove: (
|
|
425
|
+
set: (value: Value, params?: SetCookieParams) => void;
|
|
426
|
+
remove: (params?: RemoveCookieParams) => void;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
declare const getParsedCookies: () => {
|
|
430
|
+
[k: string]: any;
|
|
431
|
+
};
|
|
432
|
+
declare const clearCookies: () => void;
|
|
433
|
+
/**
|
|
434
|
+
* @name useCookies
|
|
435
|
+
* @description - Hook that manages cookie values
|
|
436
|
+
* @category Browser
|
|
437
|
+
*
|
|
438
|
+
* @overload
|
|
439
|
+
* @template {object} Value The type of the cookie values
|
|
440
|
+
* @param {string} key The key of the cookie
|
|
441
|
+
* @returns {UseCookieReturn<Value>} The value and the set function
|
|
442
|
+
*
|
|
443
|
+
* @example
|
|
444
|
+
* const { value, set, remove, getAll, clear } = useCookies();
|
|
445
|
+
*/
|
|
446
|
+
declare const useCookies: <Value>() => {
|
|
447
|
+
value: Value;
|
|
448
|
+
set: (key: string, value: Value, options?: SetCookieParams) => void;
|
|
449
|
+
remove: (key: string, options?: RemoveCookieParams) => void;
|
|
450
|
+
getAll: () => {
|
|
451
|
+
[k: string]: any;
|
|
452
|
+
};
|
|
453
|
+
clear: () => void;
|
|
398
454
|
};
|
|
399
455
|
|
|
400
456
|
/** The use counter options */
|
|
@@ -1870,6 +1926,20 @@ declare const useLastChanged: (source: any, options?: UseLastChangedOptions) =>
|
|
|
1870
1926
|
*/
|
|
1871
1927
|
declare const useLatest: <Value>(value: Value) => Value;
|
|
1872
1928
|
|
|
1929
|
+
/**
|
|
1930
|
+
* @name useLess
|
|
1931
|
+
* @description - Hook that humorously suggests using it less not for production
|
|
1932
|
+
* @category Humor
|
|
1933
|
+
*
|
|
1934
|
+
* @template Value The type of the value
|
|
1935
|
+
* @param {Value} [value] The value to be returned
|
|
1936
|
+
* @returns {Value} The value passed to the hook
|
|
1937
|
+
*
|
|
1938
|
+
* @example
|
|
1939
|
+
* const value = useLess(state);
|
|
1940
|
+
*/
|
|
1941
|
+
declare const useLess: (value?: any) => any;
|
|
1942
|
+
|
|
1873
1943
|
/** The use list return type */
|
|
1874
1944
|
interface UseListReturn<Item> {
|
|
1875
1945
|
/** The current list of items */
|
|
@@ -2568,7 +2638,6 @@ declare class Paint {
|
|
|
2568
2638
|
};
|
|
2569
2639
|
update(point: Point): boolean;
|
|
2570
2640
|
}
|
|
2571
|
-
|
|
2572
2641
|
interface UsePaintOptions {
|
|
2573
2642
|
/** Brush color */
|
|
2574
2643
|
color?: string;
|
|
@@ -2678,6 +2747,30 @@ interface UseParallax {
|
|
|
2678
2747
|
*/
|
|
2679
2748
|
declare const useParallax: UseParallax;
|
|
2680
2749
|
|
|
2750
|
+
/** The use performance observer options type */
|
|
2751
|
+
type UsePerformanceObserverOptions = PerformanceObserverInit & {
|
|
2752
|
+
/** Whether to start the observer immediately */
|
|
2753
|
+
immediate?: boolean;
|
|
2754
|
+
};
|
|
2755
|
+
/**
|
|
2756
|
+
* @name usePerformanceObserver
|
|
2757
|
+
* @description - Hook that allows you to observe performance entries
|
|
2758
|
+
* @category Sensor
|
|
2759
|
+
*
|
|
2760
|
+
* @param {UsePerformanceObserverOptions} options The options for the performance observer
|
|
2761
|
+
* @param {PerformanceObserverCallback} callback The function to handle performance entries
|
|
2762
|
+
* @returns {object} An object containing the observer's support status and methods to start and stop the observer
|
|
2763
|
+
*
|
|
2764
|
+
* @example
|
|
2765
|
+
* const { supported, entries, start, stop } = usePerformanceObserver();
|
|
2766
|
+
*/
|
|
2767
|
+
declare const usePerformanceObserver: (options: UsePerformanceObserverOptions, callback?: PerformanceObserverCallback) => {
|
|
2768
|
+
supported: boolean;
|
|
2769
|
+
entries: PerformanceEntry[];
|
|
2770
|
+
start: () => void;
|
|
2771
|
+
stop: () => void;
|
|
2772
|
+
};
|
|
2773
|
+
|
|
2681
2774
|
/** The permission name */
|
|
2682
2775
|
type UsePermissionName = 'accelerometer' | 'accessibility-events' | 'ambient-light-sensor' | 'background-sync' | 'camera' | 'clipboard-read' | 'clipboard-write' | 'gyroscope' | 'magnetometer' | 'microphone' | 'notifications' | 'payment-handler' | 'persistent-storage' | 'push' | 'speaker' | PermissionName;
|
|
2683
2776
|
/** The use permission options type */
|
|
@@ -3916,29 +4009,6 @@ declare const useWizard: <WizardStepId extends string>(map: WizardItem<WizardSte
|
|
|
3916
4009
|
history: WizardStepId[];
|
|
3917
4010
|
};
|
|
3918
4011
|
|
|
3919
|
-
declare const getCookies: () => {
|
|
3920
|
-
[k: string]: string;
|
|
3921
|
-
};
|
|
3922
|
-
interface RemoveCookieParams {
|
|
3923
|
-
domain?: string;
|
|
3924
|
-
expires?: Date;
|
|
3925
|
-
maxAge?: number;
|
|
3926
|
-
path?: string;
|
|
3927
|
-
sameSite?: 'Lax' | 'None' | 'Strict';
|
|
3928
|
-
secure?: boolean;
|
|
3929
|
-
}
|
|
3930
|
-
declare const removeCookie: (key: string, options?: RemoveCookieParams) => void;
|
|
3931
|
-
interface SetCookieParams {
|
|
3932
|
-
domain?: string;
|
|
3933
|
-
expires?: Date;
|
|
3934
|
-
httpOnly?: boolean;
|
|
3935
|
-
maxAge?: number;
|
|
3936
|
-
path?: string;
|
|
3937
|
-
sameSite?: 'Lax' | 'None' | 'Strict';
|
|
3938
|
-
secure?: boolean;
|
|
3939
|
-
}
|
|
3940
|
-
declare const setCookie: (key: string, value: string, options?: SetCookieParams) => void;
|
|
3941
|
-
|
|
3942
4012
|
declare function debounce<Params extends unknown[]>(callback: (...args: Params) => void, delay: number): (...args: Params) => void;
|
|
3943
4013
|
|
|
3944
4014
|
declare const getDate: (now?: Date) => {
|
|
@@ -3964,4 +4034,4 @@ declare const isTarget: (target: any) => any;
|
|
|
3964
4034
|
|
|
3965
4035
|
declare const throttle: <Params extends any[]>(callback: (...args: Params) => void, delay: number) => ((...args: Params) => void);
|
|
3966
4036
|
|
|
3967
|
-
export { BREAKPOINTS_ANT_DESIGN, BREAKPOINTS_BOOTSTRAP_V5, BREAKPOINTS_MANTINE, BREAKPOINTS_MASTER_CSS, BREAKPOINTS_MATERIAL_UI, BREAKPOINTS_PRIME_FLEX, BREAKPOINTS_QUASAR_V2, BREAKPOINTS_SEMANTIC, BREAKPOINTS_TAILWIND, type BatteryManager, type Breakpoints, COOKIE_EVENT, type ColorSelectionOptions, type ColorSelectionResult, type Connection, type ConnectionEffectiveType, type ConnectionType, type EyeDropper, type EyeDropperConstructor, type GetElementTarget, type LongPressReactEvents, type OperatingSystem, type OrientationLockType, type RemoveCookieParams, type RequestOptions, SCRIPT_STATUS_ATTRIBUTE_NAME, STORAGE_EVENT, type ScrollPosition, type SetCookieParams, type StateRef, type UseAsyncReturn, type UseBatteryStateReturn, type UseBatteryValue, type UseBluetoothOptions, type UseBluetoothReturn, type UseBooleanReturn, type UseBreakpointsReturn, type UseBreakpointsStrategy, type UseClickOutside, type UseClickOutsideTarget, type UseCookieInitialValue, type UseCookieOptions, type UseCookieReturn, type UseCopyToClipboardParams, type UseCopyToClipboardReturn, type UseCounter, type UseCounterOptions, type UseCounterReturn, type UseCssVar, type UseCssVarReturn, type UseCssVarTarget, type UseDeviceMotionParams, type UseDeviceMotionReturn, type UseDeviceOrientationReturn, type UseDeviceOrientationValue, type UseDevicePixelRatioReturn, type UseDisclosureOptions, type UseDisclosureReturn, type UseDisplayMediaOptions, type UseDisplayMediaOverload, type UseDisplayMediaReturn, type UseDisplayMediaTarget, type UseDocumentTitleOptions, type UseDocumentTitleReturn, type UseElementSize, type UseElementSizeReturn, type UseElementSizeTarget, type UseElementSizeValue, type UseEventListener, type UseEventListenerOptions, type UseEventListenerReturn, type UseEventListenerTarget, type UseEyeDropperReturn, type UseFaviconReturn, type UseFieldParams, type UseFieldRegisterParams, type UseFieldReturn, type UseFileDialog, type UseFileDialogOptions, type UseFileDialogReturn, type UseFocus, type UseFocusOptions, type UseFocusReturn, type UseFocusTarget, type UseFullScreen, type UseFullScreenOptions, type UseFullScreenReturn, type UseFullScreenTarget, type UseGamepadStateReturn, type UseGeolocationParams, type UseGeolocationReturn, type UseHotkeys, type UseHotkeysHotkeys, type UseHotkeysKey, type UseHotkeysOptions, type UseHotkeysTarget, type UseHover, type UseHoverOptions, type UseHoverTarget, type UseIdleOptions, type UseIdleReturn, type UseImageOptions, type UseImageReturn, type UseInfiniteScroll, type UseInfiniteScrollOptions, type UseInfiniteScrollTarget, type UseIntersectionObserver, type UseIntersectionObserverOptions, type UseIntersectionObserverReturn, type UseIntersectionObserverTarget, type UseIntervalOptions, type UseIntervalReturn, type UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseKeyboardParams, type UseKeysPressedParams, type UseLastChangedOptions, type UseListReturn, type UseLongPressBind, type UseLongPressOptions, type UseLongPressReturn, type UseLongPressTarget, type UseMapReturn, type UseMeasureReturn, type UseMeasureScreen, type UseMeasureTarget, type UseMemoryReturn, type UseMouse, type UseMouseReturn, type UseMouseTarget, type UseMutationObserver, type UseMutationObserverOptions, type UseMutationObserverReturn, type UseMutationObserverTarget, type UseNetworkReturn, type UseOffsetPaginationOptions, type UseOffsetPaginationReturn, type UseOptimisticReturn, type UseOrientationReturn, type UseOtpCredential, type UseOtpCredentialCallback, type UseOtpCredentialParams, type UseOtpCredentialReturn, type UsePaint, type UsePaintOptions, type UsePaintReturn, type UsePaintTarget, type UseParallax, type UseParallaxOptions, type UseParallaxValue, type UsePermissionName, type UsePermissionOptions, type UsePermissionReturn, type UsePostMessageReturn, type UsePreferredColorSchemeReturn, type UsePreferredContrastReturn, type UsePreferredReducedMotionReturn, type UsePreviousOptions, type UseQueryOptions, type UseQueryReturn, type UseQueueReturn, type UseRafCallback, type UseRafOptions, type UseRafParams, type UseRafReturn, type UseRafValueReturn, type UseRenderInfoReturn, type UseResizeObserver, type UseResizeObserverOptions, type UseResizeObserverReturn, type UseResizeObserverTarget, type UseScreenOrientationValue, type UseScriptOptions, type UseScriptStatus, type UseScroll, type UseScrollCallbackParams, type UseScrollIntoViewOptions, type UseScrollIntoViewOverload, type UseScrollIntoViewReturn, type UseScrollIntoViewTarget, type UseScrollOptions, type UseScrollTarget, type UseScrollTo, type UseScrollToOptions, type UseScrollToReturn, type UseScrollToTarget, type UseShareParams, type UseShareReturn, type UseStopwatchOptions, type UseStopwatchReturn, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseTextDirection, type UseTextDirectionReturn, type UseTextDirectionTarget, type UseTextDirectionValue, type UseTextSelectionReturn, type UseTimeReturn, type UseTimer, type UseTimerOptions, type UseTimerReturn, type UseToggleReturn, type UseVibratePattern, type UseVibrateReturn, type UseWebSocketOptions, type UseWebSocketReturn, type UseWebSocketStatus, type UseWebSocketUrl, type UseWindowSizeReturn, type WizardItem, debounce, dispatchCookieEvent, dispatchStorageEvent, getConnection, getCookies, getDate, getElement, getOperatingSystem, getRangesSelection, getRetry, getTimeFromSeconds, isHotkeyMatch, isPermissionAllowed, isTarget, legacyCopyToClipboard, mapGamepadToXbox360Controller, removeCookie, scrollTo, setCookie, throttle, useActiveElement, useAsync, useBattery, useBluetooth, useBoolean, useBreakpoints, useBrowserLanguage, useClickOutside, useClipboard, useConst, useCookie, useCounter, useCssVar, useDebounceCallback, useDebounceValue, useDefault, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDidUpdate, useDisclosure, useDisplayMedia, useDocumentEvent, useDocumentTitle, useDocumentVisibility, useElementSize, useEvent, useEventListener, useEyeDropper, useFavicon, useField, useFileDialog, useFocus, useFps, useFullscreen, useGamepad, useGeolocation, useHash, useHotkeys, useHover, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useInterval, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeyboard, useKeysPressed, useLastChanged, useLatest, useList, useLocalStorage, useLogger, useLongPress, useMap, useMeasure, useMediaQuery, useMemory, useMount, useMouse, useMutation, useMutationObserver, useNetwork, useOffsetPagination, useOnline, useOperatingSystem, useOptimistic, useOrientation, useOtpCredential, usePageLeave, usePaint, useParallax, usePermission, usePointerLock, usePostMessage, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useQuery, useQueue, useRaf, useRafValue, useRefState, useRenderCount, useRenderInfo, useRerender, useResizeObserver, useScreenOrientation, type useScreenOrientationReturn, useScript, useScroll, useScrollIntoView, useScrollTo, useSessionStorage, useSet, useShare, useStateHistory, useStep, useStopwatch, useStorage, useTextDirection, useTextSelection, useThrottleCallback, useThrottleValue, useTime, useTimeout, useTimer, useToggle, useUnmount, useVibrate, useWebSocket, useWindowEvent, useWindowFocus, useWindowScroll, useWindowSize, useWizard };
|
|
4037
|
+
export { BREAKPOINTS_ANT_DESIGN, BREAKPOINTS_BOOTSTRAP_V5, BREAKPOINTS_MANTINE, BREAKPOINTS_MASTER_CSS, BREAKPOINTS_MATERIAL_UI, BREAKPOINTS_PRIME_FLEX, BREAKPOINTS_QUASAR_V2, BREAKPOINTS_SEMANTIC, BREAKPOINTS_TAILWIND, type BatteryManager, type Breakpoints, COOKIE_EVENT, type ColorSelectionOptions, type ColorSelectionResult, type Connection, type ConnectionEffectiveType, type ConnectionType, type EyeDropper, type EyeDropperConstructor, type GetElementTarget, type LongPressReactEvents, type OperatingSystem, type OrientationLockType, Paint, type Point, Pointer, type RemoveCookieParams, type RequestOptions, SCRIPT_STATUS_ATTRIBUTE_NAME, STORAGE_EVENT, type ScrollPosition, type SetCookieParams, type StateRef, type UseAsyncReturn, type UseBatteryStateReturn, type UseBatteryValue, type UseBluetoothOptions, type UseBluetoothReturn, type UseBooleanReturn, type UseBreakpointsReturn, type UseBreakpointsStrategy, type UseClickOutside, type UseClickOutsideTarget, type UseCookieInitialValue, type UseCookieOptions, type UseCookieReturn, type UseCopyToClipboardParams, type UseCopyToClipboardReturn, type UseCounter, type UseCounterOptions, type UseCounterReturn, type UseCssVar, type UseCssVarReturn, type UseCssVarTarget, type UseDeviceMotionParams, type UseDeviceMotionReturn, type UseDeviceOrientationReturn, type UseDeviceOrientationValue, type UseDevicePixelRatioReturn, type UseDisclosureOptions, type UseDisclosureReturn, type UseDisplayMediaOptions, type UseDisplayMediaOverload, type UseDisplayMediaReturn, type UseDisplayMediaTarget, type UseDocumentTitleOptions, type UseDocumentTitleReturn, type UseElementSize, type UseElementSizeReturn, type UseElementSizeTarget, type UseElementSizeValue, type UseEventListener, type UseEventListenerOptions, type UseEventListenerReturn, type UseEventListenerTarget, type UseEyeDropperReturn, type UseFaviconReturn, type UseFieldParams, type UseFieldRegisterParams, type UseFieldReturn, type UseFileDialog, type UseFileDialogOptions, type UseFileDialogReturn, type UseFocus, type UseFocusOptions, type UseFocusReturn, type UseFocusTarget, type UseFullScreen, type UseFullScreenOptions, type UseFullScreenReturn, type UseFullScreenTarget, type UseGamepadStateReturn, type UseGeolocationParams, type UseGeolocationReturn, type UseHotkeys, type UseHotkeysHotkeys, type UseHotkeysKey, type UseHotkeysOptions, type UseHotkeysTarget, type UseHover, type UseHoverOptions, type UseHoverTarget, type UseIdleOptions, type UseIdleReturn, type UseImageOptions, type UseImageReturn, type UseInfiniteScroll, type UseInfiniteScrollOptions, type UseInfiniteScrollTarget, type UseIntersectionObserver, type UseIntersectionObserverOptions, type UseIntersectionObserverReturn, type UseIntersectionObserverTarget, type UseIntervalOptions, type UseIntervalReturn, type UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseKeyboardParams, type UseKeysPressedParams, type UseLastChangedOptions, type UseListReturn, type UseLongPressBind, type UseLongPressOptions, type UseLongPressReturn, type UseLongPressTarget, type UseMapReturn, type UseMeasureReturn, type UseMeasureScreen, type UseMeasureTarget, type UseMemoryReturn, type UseMouse, type UseMouseReturn, type UseMouseTarget, type UseMutationObserver, type UseMutationObserverOptions, type UseMutationObserverReturn, type UseMutationObserverTarget, type UseNetworkReturn, type UseOffsetPaginationOptions, type UseOffsetPaginationReturn, type UseOptimisticReturn, type UseOrientationReturn, type UseOtpCredential, type UseOtpCredentialCallback, type UseOtpCredentialParams, type UseOtpCredentialReturn, type UsePaint, type UsePaintOptions, type UsePaintReturn, type UsePaintTarget, type UseParallax, type UseParallaxOptions, type UseParallaxValue, type UsePerformanceObserverOptions, type UsePermissionName, type UsePermissionOptions, type UsePermissionReturn, type UsePostMessageReturn, type UsePreferredColorSchemeReturn, type UsePreferredContrastReturn, type UsePreferredReducedMotionReturn, type UsePreviousOptions, type UseQueryOptions, type UseQueryReturn, type UseQueueReturn, type UseRafCallback, type UseRafOptions, type UseRafParams, type UseRafReturn, type UseRafValueReturn, type UseRenderInfoReturn, type UseResizeObserver, type UseResizeObserverOptions, type UseResizeObserverReturn, type UseResizeObserverTarget, type UseScreenOrientationValue, type UseScriptOptions, type UseScriptStatus, type UseScroll, type UseScrollCallbackParams, type UseScrollIntoViewOptions, type UseScrollIntoViewOverload, type UseScrollIntoViewReturn, type UseScrollIntoViewTarget, type UseScrollOptions, type UseScrollTarget, type UseScrollTo, type UseScrollToOptions, type UseScrollToReturn, type UseScrollToTarget, type UseShareParams, type UseShareReturn, type UseStopwatchOptions, type UseStopwatchReturn, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseTextDirection, type UseTextDirectionReturn, type UseTextDirectionTarget, type UseTextDirectionValue, type UseTextSelectionReturn, type UseTimeReturn, type UseTimer, type UseTimerOptions, type UseTimerReturn, type UseToggleReturn, type UseVibratePattern, type UseVibrateReturn, type UseWebSocketOptions, type UseWebSocketReturn, type UseWebSocketStatus, type UseWebSocketUrl, type UseWindowSizeReturn, type WizardItem, clearCookies, debounce, dispatchCookieEvent, dispatchStorageEvent, getConnection, getCookies, getDate, getElement, getOperatingSystem, getParsedCookies, getRangesSelection, getRetry, getTimeFromSeconds, isHotkeyMatch, isPermissionAllowed, isTarget, legacyCopyToClipboard, mapGamepadToXbox360Controller, removeCookie, scrollTo, setCookie, throttle, useActiveElement, useAsync, useBattery, useBluetooth, useBoolean, useBreakpoints, useBrowserLanguage, useClickOutside, useClipboard, useConst, useCookie, useCookies, useCounter, useCssVar, useDebounceCallback, useDebounceValue, useDefault, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDidUpdate, useDisclosure, useDisplayMedia, useDocumentEvent, useDocumentTitle, useDocumentVisibility, useElementSize, useEvent, useEventListener, useEyeDropper, useFavicon, useField, useFileDialog, useFocus, useFps, useFullscreen, useGamepad, useGeolocation, useHash, useHotkeys, useHover, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useInterval, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeyboard, useKeysPressed, useLastChanged, useLatest, useLess, useList, useLocalStorage, useLogger, useLongPress, useMap, useMeasure, useMediaQuery, useMemory, useMount, useMouse, useMutation, useMutationObserver, useNetwork, useOffsetPagination, useOnline, useOperatingSystem, useOptimistic, useOrientation, useOtpCredential, usePageLeave, usePaint, useParallax, usePerformanceObserver, usePermission, usePointerLock, usePostMessage, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useQuery, useQueue, useRaf, useRafValue, useRefState, useRenderCount, useRenderInfo, useRerender, useResizeObserver, useScreenOrientation, type useScreenOrientationReturn, useScript, useScroll, useScrollIntoView, useScrollTo, useSessionStorage, useSet, useShare, useStateHistory, useStep, useStopwatch, useStorage, useTextDirection, useTextSelection, useThrottleCallback, useThrottleValue, useTime, useTimeout, useTimer, useToggle, useUnmount, useVibrate, useWebSocket, useWindowEvent, useWindowFocus, useWindowScroll, useWindowSize, useWizard };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers-B6-9bMtn.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.97 */
|
|
2
|
-
"use strict";var t=require("../../../_rollupPluginBabelHelpers-B6-9bMtn.js"),e=function(){function e(s,i){t._classCallCheck(this,e),this.x=s,this.y=i}return t._createClass(e,[{key:"update",value:function(t){this.x=t.x,this.y=t.y}},{key:"getDifferenceTo",value:function(t){return new e(this.x-t.x,this.y-t.y)}},{key:"getDistanceTo",value:function(t){var e=this.getDifferenceTo(t);return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}},{key:"getAngleTo",value:function(t){var e=this.getDifferenceTo(t);return Math.atan2(e.y,e.x)}},{key:"equalsTo",value:function(t){return this.x===t.x&&this.y===t.y}},{key:"moveByAngle",value:function(t,e){var s=t+Math.PI/2;return this.x+=Math.sin(s)*e,this.y-=Math.cos(s)*e,this}}])}(),s=function(){return t._createClass((function s(i){var r=i.x,n=i.y,h=i.radius,u=i.smooth;t._classCallCheck(this,s),t._defineProperty(this,"smooth",!1),t._defineProperty(this,"points",[]),t._defineProperty(this,"lines",[]),this.smooth=u,this.pointer=new e(r,n),this.brush=new e(r,n),this.radius=h,this.points=[],this.lines=[]}),[{key:"getBrushCoordinates",value:function(){return{x:this.brush.x,y:this.brush.y}}},{key:"getPointerCoordinates",value:function(){return{x:this.pointer.x,y:this.pointer.y}}},{key:"update",value:function(t){if(this.pointer.equalsTo(t))return!1;if(this.pointer.update(t),!this.smooth)return this.brush.update(t),this.points.push(this.getBrushCoordinates()),!0;var e=this.pointer.getDistanceTo(this.brush),s=this.pointer.getAngleTo(this.brush);if(Math.round(10*(e-this.radius))/10>0){var i=s+Math.PI/2;return this.brush.update({x:this.brush.x+Math.sin(i)*(e-this.radius),y:this.brush.y-Math.cos(i)*(e-this.radius)}),this.points.push(this.getBrushCoordinates()),!0}return!1}}])}();exports.Paint=s,exports.Pointer=e;
|
|
3
|
-
//# sourceMappingURL=Paint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Paint.js","sources":["../../../../../src/hooks/usePaint/helpers/Paint.ts"],"sourcesContent":["export interface Point {\n x: number;\n y: number;\n}\n\nexport class Pointer implements Point {\n x: number;\n\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n update(point: Point) {\n this.x = point.x;\n this.y = point.y;\n }\n\n getDifferenceTo(point: Point) {\n return new Pointer(this.x - point.x, this.y - point.y);\n }\n\n getDistanceTo(point: Point) {\n const diff = this.getDifferenceTo(point);\n return Math.sqrt(diff.x ** 2 + diff.y ** 2);\n }\n\n getAngleTo(point: Point) {\n const diff = this.getDifferenceTo(point);\n return Math.atan2(diff.y, diff.x);\n }\n\n equalsTo(point: Point) {\n return this.x === point.x && this.y === point.y;\n }\n\n moveByAngle(\n // The angle in radians\n angle: number,\n // How much the point should be moved\n distance: number\n ) {\n // Rotate the angle based on the browser coordinate system ([0,0] in the top left)\n const angleRotated = angle + Math.PI / 2;\n\n this.x += Math.sin(angleRotated) * distance;\n this.y -= Math.cos(angleRotated) * distance;\n\n return this;\n }\n}\n\nexport class Paint {\n pointer: Pointer;\n\n brush: Pointer;\n\n radius: number;\n\n smooth: boolean = false;\n\n points: Point[] = [];\n\n lines: { points: Point[]; color: string; radius: number; opacity: number }[] = [];\n\n constructor({ x, y, radius, smooth }: { x: number; y: number; radius: number; smooth: boolean }) {\n this.smooth = smooth;\n this.pointer = new Pointer(x, y);\n this.brush = new Pointer(x, y);\n this.radius = radius;\n this.points = [];\n this.lines = [];\n }\n\n getBrushCoordinates() {\n return {\n x: this.brush.x,\n y: this.brush.y\n };\n }\n\n getPointerCoordinates() {\n return {\n x: this.pointer.x,\n y: this.pointer.y\n };\n }\n\n update(point: Point) {\n if (this.pointer.equalsTo(point)) return false;\n this.pointer.update(point);\n\n if (!this.smooth) {\n this.brush.update(point);\n this.points.push(this.getBrushCoordinates());\n return true;\n }\n\n const distance = this.pointer.getDistanceTo(this.brush);\n const angle = this.pointer.getAngleTo(this.brush);\n const isOutside = Math.round((distance - this.radius) * 10) / 10 > 0;\n\n if (isOutside) {\n const angleRotated = angle + Math.PI / 2;\n this.brush.update({\n x: this.brush.x + Math.sin(angleRotated) * (distance - this.radius),\n y: this.brush.y - Math.cos(angleRotated) * (distance - this.radius)\n });\n this.points.push(this.getBrushCoordinates());\n return true;\n }\n\n return false;\n }\n}\n"],"names":["Pointer","x","y","_classCallCheck","this","_createClass","key","value","point","diff","getDifferenceTo","Math","sqrt","pow","atan2","angle","distance","angleRotated","PI","sin","cos","Paint","_ref","radius","smooth","_defineProperty","pointer","brush","points","lines","equalsTo","update","push","getBrushCoordinates","getDistanceTo","getAngleTo","round"],"mappings":";6EAKaA,EAAO,WAKlB,SAAAA,EAAYC,EAAWC,GAAWC,EAAAA,qBAAAH,GAChCI,KAAKH,EAAIA,EACTG,KAAKF,EAAIA,CACX,CAAC,OAAAG,EAAAA,aAAAL,EAAA,CAAA,CAAAM,IAAA,SAAAC,MAED,SAAOC,GACLJ,KAAKH,EAAIO,EAAMP,EACfG,KAAKF,EAAIM,EAAMN,CACjB,GAAC,CAAAI,IAAA,kBAAAC,MAED,SAAgBC,GACd,OAAO,IAAIR,EAAQI,KAAKH,EAAIO,EAAMP,EAAGG,KAAKF,EAAIM,EAAMN,EACtD,GAAC,CAAAI,IAAA,gBAAAC,MAED,SAAcC,GACZ,IAAMC,EAAOL,KAAKM,gBAAgBF,GAClC,OAAOG,KAAKC,KAAKD,KAAAE,IAAAJ,EAAKR,EAAK,GAACU,KAAAE,IAAGJ,EAAKP,EAAK,GAC3C,GAAC,CAAAI,IAAA,aAAAC,MAED,SAAWC,GACT,IAAMC,EAAOL,KAAKM,gBAAgBF,GAClC,OAAOG,KAAKG,MAAML,EAAKP,EAAGO,EAAKR,EACjC,GAAC,CAAAK,IAAA,WAAAC,MAED,SAASC,GACP,OAAOJ,KAAKH,IAAMO,EAAMP,GAAKG,KAAKF,IAAMM,EAAMN,CAChD,GAAC,CAAAI,IAAA,cAAAC,MAED,SAEEQ,EAEAC,GAGA,IAAMC,EAAeF,EAAQJ,KAAKO,GAAK,EAKvC,OAHAd,KAAKH,GAAKU,KAAKQ,IAAIF,GAAgBD,EACnCZ,KAAKF,GAAKS,KAAKS,IAAIH,GAAgBD,EAE5BZ,IACT,IAAC,CA9CiB,GAiDPiB,EAAK,WAoBf,OAAAhB,EAAAA,cAPD,SAAAgB,EAAAC,GAAiG,IAAnFrB,EAACqB,EAADrB,EAAGC,EAACoB,EAADpB,EAAGqB,EAAMD,EAANC,OAAQC,EAAMF,EAANE,OAAMrB,EAAAA,qBAAAkB,GAAAI,iCANhB,GAAKA,gCAEL,IAAEA,+BAE2D,IAG7ErB,KAAKoB,OAASA,EACdpB,KAAKsB,QAAU,IAAI1B,EAAQC,EAAGC,GAC9BE,KAAKuB,MAAQ,IAAI3B,EAAQC,EAAGC,GAC5BE,KAAKmB,OAASA,EACdnB,KAAKwB,OAAS,GACdxB,KAAKyB,MAAQ,EACf,GAAC,CAAA,CAAAvB,IAAA,sBAAAC,MAED,WACE,MAAO,CACLN,EAAGG,KAAKuB,MAAM1B,EACdC,EAAGE,KAAKuB,MAAMzB,EAElB,GAAC,CAAAI,IAAA,wBAAAC,MAED,WACE,MAAO,CACLN,EAAGG,KAAKsB,QAAQzB,EAChBC,EAAGE,KAAKsB,QAAQxB,EAEpB,GAAC,CAAAI,IAAA,SAAAC,MAED,SAAOC,GACL,GAAIJ,KAAKsB,QAAQI,SAAStB,GAAQ,OAAO,EAGzC,GAFAJ,KAAKsB,QAAQK,OAAOvB,IAEfJ,KAAKoB,OAGR,OAFApB,KAAKuB,MAAMI,OAAOvB,GAClBJ,KAAKwB,OAAOI,KAAK5B,KAAK6B,wBACf,EAGT,IAAMjB,EAAWZ,KAAKsB,QAAQQ,cAAc9B,KAAKuB,OAC3CZ,EAAQX,KAAKsB,QAAQS,WAAW/B,KAAKuB,OAG3C,GAFkBhB,KAAKyB,MAAiC,IAA1BpB,EAAWZ,KAAKmB,SAAgB,GAAK,EAEpD,CACb,IAAMN,EAAeF,EAAQJ,KAAKO,GAAK,EAMvC,OALAd,KAAKuB,MAAMI,OAAO,CAChB9B,EAAGG,KAAKuB,MAAM1B,EAAIU,KAAKQ,IAAIF,IAAiBD,EAAWZ,KAAKmB,QAC5DrB,EAAGE,KAAKuB,MAAMzB,EAAIS,KAAKS,IAAIH,IAAiBD,EAAWZ,KAAKmB,UAE9DnB,KAAKwB,OAAOI,KAAK5B,KAAK6B,wBACf,CACT,CAEA,OAAO,CACT,IAAC,CA7De"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.97 */
|
|
2
|
-
"use strict";var e=require("../../_rollupPluginBabelHelpers-B6-9bMtn.js");exports.getCookies=function(){return Object.fromEntries(document.cookie.split("; ").map((function(o){var t=o.split("="),n=e._toArray(t),c=n[0],a=n.slice(1);return[c,decodeURIComponent(a.join("="))]})))},exports.removeCookie=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};document.cookie="".concat(encodeURIComponent(e),"=; expires=Thu, 01 Jan 1970 00:00:00 GMT").concat(o.path?"; path=".concat(o.path):"").concat(o.domain?"; domain=".concat(o.domain):"").concat(o.maxAge?"; max-age=0":"").concat(o.expires?"; expires=Thu, 01 Jan 1970 00:00:00 GMT":"").concat(o.secure?"; secure":"").concat(o.sameSite?"; samesite=".concat(o.sameSite):"")},exports.setCookie=function(e,o){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=["".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(o))];t.path&&n.push("path=".concat(t.path)),t.domain&&n.push("domain=".concat(t.domain)),"number"==typeof t.maxAge&&n.push("max-age=".concat(t.maxAge)),t.expires&&n.push("expires=".concat(t.expires.toUTCString())),t.secure&&n.push("secure"),t.httpOnly&&n.push("httpOnly"),t.sameSite&&n.push("samesite=".concat(t.sameSite)),document.cookie=n.join("; ")};
|
|
3
|
-
//# sourceMappingURL=cookie.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.js","sources":["../../../../src/utils/helpers/cookie.ts"],"sourcesContent":["export 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"],"names":["Object","fromEntries","document","cookie","split","map","_cookie$split","_cookie$split2","_toArray","key","value","slice","decodeURIComponent","join","options","arguments","length","undefined","concat","encodeURIComponent","path","domain","maxAge","expires","secure","sameSite","push","toUTCString","httpOnly"],"mappings":";6FAA0B,WAAH,OACrBA,OAAOC,YACLC,SAASC,OAAOC,MAAM,MAAMC,KAAI,SAACF,GAC/B,IAAAG,EAAwBH,EAAOC,MAAM,KAAIG,EAAAC,EAAAA,SAAAF,GAAlCG,EAAGF,EAAA,GAAKG,EAAKH,EAAAI,MAAA,GAEpB,MAAO,CAACF,EADaG,mBAAmBF,EAAMG,KAAK,MAErD,IACD,uBAWyB,SAACJ,GAAkD,IAArCK,EAA2BC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EACxEb,SAASC,OAAMe,GAAAA,OAAMC,mBAAmBV,+CAAIS,OAC1CJ,EAAQM,KAAIF,UAAAA,OAAaJ,EAAQM,MAAS,IAAEF,OAC3CJ,EAAQO,mBAAMH,OAAeJ,EAAQO,QAAW,IAAEH,OAAGJ,EAAQQ,OAAM,cAAmB,IAAEJ,OACzFJ,EAAQS,QAAO,0CAA+C,IAAEL,OAC/DJ,EAAQU,kBAAsB,IAAEN,OAAGJ,EAAQW,SAAQP,cAAAA,OAAiBJ,EAAQW,UAAa,GAC9F,oBAYyB,SAAChB,EAAaC,GAAiD,IAAlCI,EAAwBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EAC3EZ,EAAmB,CAAA,GAAAe,OAAIC,mBAAmBV,GAAI,KAAAS,OAAIC,mBAAmBT,KAEvEI,EAAQM,MAAMjB,EAAOuB,KAAIR,QAAAA,OAASJ,EAAQM,OAC1CN,EAAQO,QAAQlB,EAAOuB,KAAIR,UAAAA,OAAWJ,EAAQO,SACpB,iBAAnBP,EAAQQ,QAAqBnB,EAAOuB,gBAAIR,OAAYJ,EAAQQ,SACnER,EAAQS,SAASpB,EAAOuB,KAAIR,WAAAA,OAAYJ,EAAQS,QAAQI,gBACxDb,EAAQU,QAAQrB,EAAOuB,eACvBZ,EAAQc,UAAUzB,EAAOuB,iBACzBZ,EAAQW,UAAUtB,EAAOuB,KAAIR,YAAAA,OAAaJ,EAAQW,WAEtDvB,SAASC,OAASA,EAAOU,KAAK,KAChC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers-WrSliisk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.97 */
|
|
2
|
-
import{i as t,j as i,f as s}from"../../../_rollupPluginBabelHelpers-WrSliisk.js";var e=function(){function s(t,e){i(this,s),this.x=t,this.y=e}return t(s,[{key:"update",value:function(t){this.x=t.x,this.y=t.y}},{key:"getDifferenceTo",value:function(t){return new s(this.x-t.x,this.y-t.y)}},{key:"getDistanceTo",value:function(t){var i=this.getDifferenceTo(t);return Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))}},{key:"getAngleTo",value:function(t){var i=this.getDifferenceTo(t);return Math.atan2(i.y,i.x)}},{key:"equalsTo",value:function(t){return this.x===t.x&&this.y===t.y}},{key:"moveByAngle",value:function(t,i){var s=t+Math.PI/2;return this.x+=Math.sin(s)*i,this.y-=Math.cos(s)*i,this}}])}(),h=function(){return t((function t(h){var n=h.x,r=h.y,u=h.radius,o=h.smooth;i(this,t),s(this,"smooth",!1),s(this,"points",[]),s(this,"lines",[]),this.smooth=o,this.pointer=new e(n,r),this.brush=new e(n,r),this.radius=u,this.points=[],this.lines=[]}),[{key:"getBrushCoordinates",value:function(){return{x:this.brush.x,y:this.brush.y}}},{key:"getPointerCoordinates",value:function(){return{x:this.pointer.x,y:this.pointer.y}}},{key:"update",value:function(t){if(this.pointer.equalsTo(t))return!1;if(this.pointer.update(t),!this.smooth)return this.brush.update(t),this.points.push(this.getBrushCoordinates()),!0;var i=this.pointer.getDistanceTo(this.brush),s=this.pointer.getAngleTo(this.brush);if(Math.round(10*(i-this.radius))/10>0){var e=s+Math.PI/2;return this.brush.update({x:this.brush.x+Math.sin(e)*(i-this.radius),y:this.brush.y-Math.cos(e)*(i-this.radius)}),this.points.push(this.getBrushCoordinates()),!0}return!1}}])}();export{h as Paint,e as Pointer};
|
|
3
|
-
//# sourceMappingURL=Paint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Paint.js","sources":["../../../../../src/hooks/usePaint/helpers/Paint.ts"],"sourcesContent":["export interface Point {\n x: number;\n y: number;\n}\n\nexport class Pointer implements Point {\n x: number;\n\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n update(point: Point) {\n this.x = point.x;\n this.y = point.y;\n }\n\n getDifferenceTo(point: Point) {\n return new Pointer(this.x - point.x, this.y - point.y);\n }\n\n getDistanceTo(point: Point) {\n const diff = this.getDifferenceTo(point);\n return Math.sqrt(diff.x ** 2 + diff.y ** 2);\n }\n\n getAngleTo(point: Point) {\n const diff = this.getDifferenceTo(point);\n return Math.atan2(diff.y, diff.x);\n }\n\n equalsTo(point: Point) {\n return this.x === point.x && this.y === point.y;\n }\n\n moveByAngle(\n // The angle in radians\n angle: number,\n // How much the point should be moved\n distance: number\n ) {\n // Rotate the angle based on the browser coordinate system ([0,0] in the top left)\n const angleRotated = angle + Math.PI / 2;\n\n this.x += Math.sin(angleRotated) * distance;\n this.y -= Math.cos(angleRotated) * distance;\n\n return this;\n }\n}\n\nexport class Paint {\n pointer: Pointer;\n\n brush: Pointer;\n\n radius: number;\n\n smooth: boolean = false;\n\n points: Point[] = [];\n\n lines: { points: Point[]; color: string; radius: number; opacity: number }[] = [];\n\n constructor({ x, y, radius, smooth }: { x: number; y: number; radius: number; smooth: boolean }) {\n this.smooth = smooth;\n this.pointer = new Pointer(x, y);\n this.brush = new Pointer(x, y);\n this.radius = radius;\n this.points = [];\n this.lines = [];\n }\n\n getBrushCoordinates() {\n return {\n x: this.brush.x,\n y: this.brush.y\n };\n }\n\n getPointerCoordinates() {\n return {\n x: this.pointer.x,\n y: this.pointer.y\n };\n }\n\n update(point: Point) {\n if (this.pointer.equalsTo(point)) return false;\n this.pointer.update(point);\n\n if (!this.smooth) {\n this.brush.update(point);\n this.points.push(this.getBrushCoordinates());\n return true;\n }\n\n const distance = this.pointer.getDistanceTo(this.brush);\n const angle = this.pointer.getAngleTo(this.brush);\n const isOutside = Math.round((distance - this.radius) * 10) / 10 > 0;\n\n if (isOutside) {\n const angleRotated = angle + Math.PI / 2;\n this.brush.update({\n x: this.brush.x + Math.sin(angleRotated) * (distance - this.radius),\n y: this.brush.y - Math.cos(angleRotated) * (distance - this.radius)\n });\n this.points.push(this.getBrushCoordinates());\n return true;\n }\n\n return false;\n }\n}\n"],"names":["Pointer","x","y","_classCallCheck","this","_createClass","key","value","point","diff","getDifferenceTo","Math","sqrt","pow","atan2","angle","distance","angleRotated","PI","sin","cos","Paint","_ref","radius","smooth","_defineProperty","pointer","brush","points","lines","equalsTo","update","push","getBrushCoordinates","getDistanceTo","getAngleTo","round"],"mappings":";iFAKA,IAAaA,EAAO,WAKlB,SAAAA,EAAYC,EAAWC,GAAWC,OAAAH,GAChCI,KAAKH,EAAIA,EACTG,KAAKF,EAAIA,CACX,CAAC,OAAAG,EAAAL,EAAA,CAAA,CAAAM,IAAA,SAAAC,MAED,SAAOC,GACLJ,KAAKH,EAAIO,EAAMP,EACfG,KAAKF,EAAIM,EAAMN,CACjB,GAAC,CAAAI,IAAA,kBAAAC,MAED,SAAgBC,GACd,OAAO,IAAIR,EAAQI,KAAKH,EAAIO,EAAMP,EAAGG,KAAKF,EAAIM,EAAMN,EACtD,GAAC,CAAAI,IAAA,gBAAAC,MAED,SAAcC,GACZ,IAAMC,EAAOL,KAAKM,gBAAgBF,GAClC,OAAOG,KAAKC,KAAKD,KAAAE,IAAAJ,EAAKR,EAAK,GAACU,KAAAE,IAAGJ,EAAKP,EAAK,GAC3C,GAAC,CAAAI,IAAA,aAAAC,MAED,SAAWC,GACT,IAAMC,EAAOL,KAAKM,gBAAgBF,GAClC,OAAOG,KAAKG,MAAML,EAAKP,EAAGO,EAAKR,EACjC,GAAC,CAAAK,IAAA,WAAAC,MAED,SAASC,GACP,OAAOJ,KAAKH,IAAMO,EAAMP,GAAKG,KAAKF,IAAMM,EAAMN,CAChD,GAAC,CAAAI,IAAA,cAAAC,MAED,SAEEQ,EAEAC,GAGA,IAAMC,EAAeF,EAAQJ,KAAKO,GAAK,EAKvC,OAHAd,KAAKH,GAAKU,KAAKQ,IAAIF,GAAgBD,EACnCZ,KAAKF,GAAKS,KAAKS,IAAIH,GAAgBD,EAE5BZ,IACT,IAAC,CA9CiB,GAiDPiB,EAAK,WAoBf,OAAAhB,GAPD,SAAAgB,EAAAC,GAAiG,IAAnFrB,EAACqB,EAADrB,EAAGC,EAACoB,EAADpB,EAAGqB,EAAMD,EAANC,OAAQC,EAAMF,EAANE,OAAMrB,OAAAkB,GAAAI,iBANhB,GAAKA,gBAEL,IAAEA,eAE2D,IAG7ErB,KAAKoB,OAASA,EACdpB,KAAKsB,QAAU,IAAI1B,EAAQC,EAAGC,GAC9BE,KAAKuB,MAAQ,IAAI3B,EAAQC,EAAGC,GAC5BE,KAAKmB,OAASA,EACdnB,KAAKwB,OAAS,GACdxB,KAAKyB,MAAQ,EACf,GAAC,CAAA,CAAAvB,IAAA,sBAAAC,MAED,WACE,MAAO,CACLN,EAAGG,KAAKuB,MAAM1B,EACdC,EAAGE,KAAKuB,MAAMzB,EAElB,GAAC,CAAAI,IAAA,wBAAAC,MAED,WACE,MAAO,CACLN,EAAGG,KAAKsB,QAAQzB,EAChBC,EAAGE,KAAKsB,QAAQxB,EAEpB,GAAC,CAAAI,IAAA,SAAAC,MAED,SAAOC,GACL,GAAIJ,KAAKsB,QAAQI,SAAStB,GAAQ,OAAO,EAGzC,GAFAJ,KAAKsB,QAAQK,OAAOvB,IAEfJ,KAAKoB,OAGR,OAFApB,KAAKuB,MAAMI,OAAOvB,GAClBJ,KAAKwB,OAAOI,KAAK5B,KAAK6B,wBACf,EAGT,IAAMjB,EAAWZ,KAAKsB,QAAQQ,cAAc9B,KAAKuB,OAC3CZ,EAAQX,KAAKsB,QAAQS,WAAW/B,KAAKuB,OAG3C,GAFkBhB,KAAKyB,MAAiC,IAA1BpB,EAAWZ,KAAKmB,SAAgB,GAAK,EAEpD,CACb,IAAMN,EAAeF,EAAQJ,KAAKO,GAAK,EAMvC,OALAd,KAAKuB,MAAMI,OAAO,CAChB9B,EAAGG,KAAKuB,MAAM1B,EAAIU,KAAKQ,IAAIF,IAAiBD,EAAWZ,KAAKmB,QAC5DrB,EAAGE,KAAKuB,MAAMzB,EAAIS,KAAKS,IAAIH,IAAiBD,EAAWZ,KAAKmB,UAE9DnB,KAAKwB,OAAOI,KAAK5B,KAAK6B,wBACf,CACT,CAEA,OAAO,CACT,IAAC,CA7De"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.97 */
|
|
2
|
-
import{h as e}from"../../_rollupPluginBabelHelpers-WrSliisk.js";var n=function(){return Object.fromEntries(document.cookie.split("; ").map((function(n){var o=n.split("="),t=e(o),c=t[0],a=t.slice(1);return[c,decodeURIComponent(a.join("="))]})))},o=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};document.cookie="".concat(encodeURIComponent(e),"=; expires=Thu, 01 Jan 1970 00:00:00 GMT").concat(n.path?"; path=".concat(n.path):"").concat(n.domain?"; domain=".concat(n.domain):"").concat(n.maxAge?"; max-age=0":"").concat(n.expires?"; expires=Thu, 01 Jan 1970 00:00:00 GMT":"").concat(n.secure?"; secure":"").concat(n.sameSite?"; samesite=".concat(n.sameSite):"")},t=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=["".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n))];o.path&&t.push("path=".concat(o.path)),o.domain&&t.push("domain=".concat(o.domain)),"number"==typeof o.maxAge&&t.push("max-age=".concat(o.maxAge)),o.expires&&t.push("expires=".concat(o.expires.toUTCString())),o.secure&&t.push("secure"),o.httpOnly&&t.push("httpOnly"),o.sameSite&&t.push("samesite=".concat(o.sameSite)),document.cookie=t.join("; ")};export{n as getCookies,o as removeCookie,t as setCookie};
|
|
3
|
-
//# sourceMappingURL=cookie.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.js","sources":["../../../../src/utils/helpers/cookie.ts"],"sourcesContent":["export 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"],"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"],"mappings":";gEAAaA,IAAAA,EAAa,WAAH,OACrBC,OAAOC,YACLC,SAASC,OAAOC,MAAM,MAAMC,KAAI,SAACF,GAC/B,IAAAG,EAAwBH,EAAOC,MAAM,KAAIG,EAAAC,EAAAF,GAAlCG,EAAGF,EAAA,GAAKG,EAAKH,EAAAI,MAAA,GAEpB,MAAO,CAACF,EADaG,mBAAmBF,EAAMG,KAAK,MAErD,IACD,EAWUC,EAAe,SAACL,GAAkD,IAArCM,EAA2BC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EACxEd,SAASC,OAAMgB,GAAAA,OAAMC,mBAAmBX,+CAAIU,OAC1CJ,EAAQM,KAAIF,UAAAA,OAAaJ,EAAQM,MAAS,IAAEF,OAC3CJ,EAAQO,mBAAMH,OAAeJ,EAAQO,QAAW,IAAEH,OAAGJ,EAAQQ,OAAM,cAAmB,IAAEJ,OACzFJ,EAAQS,QAAO,0CAA+C,IAAEL,OAC/DJ,EAAQU,kBAAsB,IAAEN,OAAGJ,EAAQW,SAAQP,cAAAA,OAAiBJ,EAAQW,UAAa,GAC9F,EAYaC,EAAY,SAAClB,EAAaC,GAAiD,IAAlCK,EAAwBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAE,EAC3Eb,EAAmB,CAAA,GAAAgB,OAAIC,mBAAmBX,GAAI,KAAAU,OAAIC,mBAAmBV,KAEvEK,EAAQM,MAAMlB,EAAOyB,KAAIT,QAAAA,OAASJ,EAAQM,OAC1CN,EAAQO,QAAQnB,EAAOyB,KAAIT,UAAAA,OAAWJ,EAAQO,SACpB,iBAAnBP,EAAQQ,QAAqBpB,EAAOyB,gBAAIT,OAAYJ,EAAQQ,SACnER,EAAQS,SAASrB,EAAOyB,KAAIT,WAAAA,OAAYJ,EAAQS,QAAQK,gBACxDd,EAAQU,QAAQtB,EAAOyB,eACvBb,EAAQe,UAAU3B,EAAOyB,iBACzBb,EAAQW,UAAUvB,EAAOyB,KAAIT,YAAAA,OAAaJ,EAAQW,WAEtDxB,SAASC,OAASA,EAAOU,KAAK,KAChC"}
|