@siberiacancode/reactuse 0.0.35 → 0.0.37
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-KdNaXDbY.js → _rollupPluginBabelHelpers-KriNlOmj.js} +2 -2
- package/dist/cjs/_rollupPluginBabelHelpers-KriNlOmj.js.map +1 -0
- package/dist/cjs/hooks/index.js +2 -2
- package/dist/cjs/hooks/useBattery/useBattery.js +2 -2
- package/dist/cjs/hooks/useBattery/useBattery.js.map +1 -1
- package/dist/cjs/hooks/useBoolean/useBoolean.js +2 -2
- package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.js +1 -1
- package/dist/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
- package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
- package/dist/cjs/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
- package/dist/cjs/hooks/useDebounceValue/useDebounceValue.js +2 -2
- package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
- package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
- package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
- package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
- package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.js +1 -1
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js.map +1 -1
- package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
- package/dist/cjs/hooks/useField/useField.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/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/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 +1 -1
- package/dist/cjs/hooks/useKeyboard/useKeyboard.js +1 -1
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
- 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/useMediaQuery/useMediaQuery.js +1 -1
- 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.js +1 -1
- package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
- package/dist/cjs/hooks/useNetwork/useNetwork.js.map +1 -1
- package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
- package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
- package/dist/cjs/hooks/useOrientation/useOrientation.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/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
- package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
- package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
- package/dist/cjs/hooks/useQuery/useQuery.js +2 -2
- package/dist/cjs/hooks/useQueue/useQueue.js +2 -2
- package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
- package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js +1 -1
- package/dist/cjs/hooks/useRerender/useRerender.js +2 -2
- package/dist/cjs/hooks/useScript/useScript.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/useStep/useStep.js +2 -2
- package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
- package/dist/cjs/hooks/useTextSelection/useTextSelection.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/useToggle/useToggle.js +2 -2
- package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
- package/dist/cjs/hooks/useWebSocket/useWebSocket.js +2 -2
- package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +1 -1
- package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/utils/helpers/debounce.js +1 -1
- package/dist/cjs/utils/helpers/getRetry.js +1 -1
- package/dist/cjs/utils/helpers/index.js +1 -1
- package/dist/cjs/utils/helpers/isClient.js +1 -1
- package/dist/cjs/utils/helpers/throttle.js +1 -1
- package/dist/cjs/utils/helpers/time/getDate.js +1 -1
- package/dist/cjs/utils/types/index.js +3 -0
- package/dist/cjs/utils/types/index.js.map +1 -0
- package/dist/esm/{_rollupPluginBabelHelpers-CEUGrTA3.js → _rollupPluginBabelHelpers-BUclQybi.js} +2 -2
- package/dist/esm/_rollupPluginBabelHelpers-BUclQybi.js.map +1 -0
- package/dist/esm/hooks/index.js +2 -2
- package/dist/esm/hooks/useBattery/useBattery.js +2 -2
- package/dist/esm/hooks/useBattery/useBattery.js.map +1 -1
- package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
- package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.js +1 -1
- package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
- package/dist/esm/hooks/useCounter/useCounter.js +2 -2
- package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
- package/dist/esm/hooks/useDebounceValue/useDebounceValue.js +2 -2
- package/dist/esm/hooks/useDefault/useDefault.js +2 -2
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +1 -1
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
- package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
- package/dist/esm/hooks/useEvent/useEvent.js +1 -1
- package/dist/esm/hooks/useEventListener/useEventListener.js +1 -1
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.js.map +1 -1
- package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
- package/dist/esm/hooks/useField/useField.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/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/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 +1 -1
- package/dist/esm/hooks/useKeyboard/useKeyboard.js +1 -1
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
- 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/useMediaQuery/useMediaQuery.js +1 -1
- 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.js +1 -1
- package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
- package/dist/esm/hooks/useNetwork/useNetwork.js.map +1 -1
- package/dist/esm/hooks/useOnline/useOnline.js +1 -1
- package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
- package/dist/esm/hooks/useOrientation/useOrientation.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/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
- package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
- package/dist/esm/hooks/usePrevious/usePrevious.js +1 -1
- package/dist/esm/hooks/useQuery/useQuery.js +2 -2
- package/dist/esm/hooks/useQueue/useQueue.js +2 -2
- package/dist/esm/hooks/useRenderCount/useRenderCount.js +1 -1
- package/dist/esm/hooks/useRenderInfo/useRenderInfo.js +1 -1
- package/dist/esm/hooks/useRerender/useRerender.js +2 -2
- package/dist/esm/hooks/useScript/useScript.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/useStep/useStep.js +2 -2
- package/dist/esm/hooks/useStorage/useStorage.js +2 -2
- package/dist/esm/hooks/useTextSelection/useTextSelection.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/useToggle/useToggle.js +2 -2
- package/dist/esm/hooks/useUnmount/useUnmount.js +1 -1
- package/dist/esm/hooks/useWebSocket/useWebSocket.js +2 -2
- package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +1 -1
- package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/utils/helpers/debounce.js +1 -1
- package/dist/esm/utils/helpers/getRetry.js +1 -1
- package/dist/esm/utils/helpers/index.js +1 -1
- package/dist/esm/utils/helpers/isClient.js +1 -1
- package/dist/esm/utils/helpers/throttle.js +1 -1
- package/dist/esm/utils/helpers/time/getDate.js +1 -1
- package/dist/esm/utils/types/index.js +2 -0
- package/dist/esm/utils/types/index.js.map +1 -0
- package/dist/index.d.ts +19 -67
- package/package.json +4 -8
- package/dist/cjs/_rollupPluginBabelHelpers-KdNaXDbY.js.map +0 -1
- package/dist/cjs/hooks/useQRCode/useQRCode.js +0 -3
- package/dist/cjs/hooks/useQRCode/useQRCode.js.map +0 -1
- package/dist/esm/_rollupPluginBabelHelpers-CEUGrTA3.js.map +0 -1
- package/dist/esm/hooks/useQRCode/useQRCode.js +0 -3
- package/dist/esm/hooks/useQRCode/useQRCode.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as t}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useRef as e,useState as o}from"react";import{useIsomorphicLayoutEffect as n}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import{useMutationObserver as r}from"../useMutationObserver.js";import"../../utils/helpers/isClient.js";function i(i,u){var c=e(document.title),l=o(null!=i?i:document.title),m=t(l,2),s=m[0],f=m[1];r((function(){document&&document.title!==s&&f(document.title)}),{childList:!0},document.head.querySelector("title")),n((function(){if(null!=u&&u.restoreOnUnmount)return function(){document.title=c.current}}),[]);var p=function(t){var e=t.trim();e.length>0&&(document.title=e)};return n((function(){"string"==typeof i&&p(i)}),[i]),[s,p]}export{i as useDocumentTitle};
|
|
3
3
|
//# sourceMappingURL=useDocumentTitle.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
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.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useRef as r,useCallback as t}from"react";import{useIsomorphicLayoutEffect as o}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var e=function(e){var i=r(e);return o((function(){i.current=e}),[e]),t((function(){return i.current.apply(void 0,arguments)}),[])};export{e as useEvent};
|
|
3
3
|
//# sourceMappingURL=useEvent.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useRef as n,useEffect as t}from"react";import{useEvent as e}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){var o=(arguments.length<=1?void 0:arguments[1])instanceof Function?null:arguments.length<=0?void 0:arguments[0],r=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],i=Array.isArray(r)?r:[r],u=o?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],c=o?arguments.length<=3?void 0:arguments[3]:arguments.length<=2?void 0:arguments[2],f=n(null),s=e(u);if(t((function(){var n=function(n){return s(n)},t=o?function(n){return"function"==typeof n?n():n instanceof Element||n instanceof Window||n instanceof Document?n:n.current}(o):f.current;if(t)return i.forEach((function(e){return t.addEventListener(e,n,c)})),function(){i.forEach((function(e){return t.removeEventListener(e,n,c)}))}}),[o,r,c]),!o)return f};export{o as useEventListener};
|
|
3
3
|
//# sourceMappingURL=useEventListener.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r,e,f as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as r,e,f as n}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as t}from"react";import{isClient as o}from"../../utils/helpers/isClient.js";var p=function(){var p=!!o&&"EyeDropper"in window,i=t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0),s=r(i,2),a=s[0],u=s[1],c=function(){var r=e(n().mark((function r(e){var t,o;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 t=new window.EyeDropper,r.next=5,t.open(e);case 5:return o=r.sent,u(o.sRGBHex),r.abrupt("return",o);case 8:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}();return{supported:p,value:a,open:c}};export{p as useEyeDropper};
|
|
3
3
|
//# sourceMappingURL=useEyeDropper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEyeDropper.js","sources":["../../../../src/hooks/useEyeDropper/useEyeDropper.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport { isClient } from '@/utils/helpers';\n\n/** The color selection return type */\nexport interface UseEyeDropperReturn {\n supported: boolean;\n value?: string;\n open: (colorSelectionOptions?: ColorSelectionOptions) => Promise<ColorSelectionResult>;\n}\n\n/**\n * @name useEyeDropper\n * @description - Hook that gives you access to the eye dropper\n *\n * @param {string} [initialValue=undefined] The initial value for the eye dropper\n * @returns {UseEyeDropperReturn} An object containing the supported status, the value and the open method\n *\n * @example\n * const { supported, value, open } = useEyeDropper();\n */\nexport const useEyeDropper = (\n initialValue: string | undefined = undefined\n): UseEyeDropperReturn => {\n const supported = isClient ? 'EyeDropper' in window : false;\n const [value, setValue] = useState(initialValue);\n\n const open = async (colorSelectionOptions?: ColorSelectionOptions) => {\n if (!window.EyeDropper) throw new Error('EyeDropper is not supported');\n const eyeDropper = new window.EyeDropper();\n const result = await eyeDropper.open(colorSelectionOptions);\n setValue(result.sRGBHex);\n return result;\n };\n\n return {\n supported,\n value,\n open\n };\n};\n"],"names":["useEyeDropper","supported","isClient","window","_useState","useState","arguments","length","undefined","_useState2","_slicedToArray","value","setValue","open","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","colorSelectionOptions","eyeDropper","result","wrap","_context","prev","next","EyeDropper","Error","sent","sRGBHex","abrupt","stop","_x","apply","this"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useEyeDropper.js","sources":["../../../../src/hooks/useEyeDropper/useEyeDropper.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport { isClient } from '@/utils/helpers';\nimport type {\n ColorSelectionOptions,\n ColorSelectionResult,\n EyeDropperConstructor\n} from '@/utils/types';\n\ndeclare global {\n interface Window {\n EyeDropper?: EyeDropperConstructor | undefined;\n }\n}\n\n/** The color selection return type */\nexport interface UseEyeDropperReturn {\n supported: boolean;\n value?: string;\n open: (colorSelectionOptions?: ColorSelectionOptions) => Promise<ColorSelectionResult>;\n}\n\n/**\n * @name useEyeDropper\n * @description - Hook that gives you access to the eye dropper\n *\n * @param {string} [initialValue=undefined] The initial value for the eye dropper\n * @returns {UseEyeDropperReturn} An object containing the supported status, the value and the open method\n *\n * @example\n * const { supported, value, open } = useEyeDropper();\n */\nexport const useEyeDropper = (\n initialValue: string | undefined = undefined\n): UseEyeDropperReturn => {\n const supported = isClient ? 'EyeDropper' in window : false;\n const [value, setValue] = useState(initialValue);\n\n const open = async (colorSelectionOptions?: ColorSelectionOptions) => {\n if (!window.EyeDropper) throw new Error('EyeDropper is not supported');\n const eyeDropper = new window.EyeDropper();\n const result = await eyeDropper.open(colorSelectionOptions);\n setValue(result.sRGBHex);\n return result;\n };\n\n return {\n supported,\n value,\n open\n };\n};\n"],"names":["useEyeDropper","supported","isClient","window","_useState","useState","arguments","length","undefined","_useState2","_slicedToArray","value","setValue","open","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","colorSelectionOptions","eyeDropper","result","wrap","_context","prev","next","EyeDropper","Error","sent","sRGBHex","abrupt","stop","_x","apply","this"],"mappings":";yKAgCaA,EAAgB,WAEH,IAClBC,IAAYC,GAAW,eAAgBC,OAC7CC,EAA0BC,EAHMC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,QAAGE,GAGaC,EAAAC,EAAAN,EAAA,GAAzCO,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAEhBI,EAAI,WAAA,IAAAC,EAAAC,EAAAC,IAAAC,MAAG,SAAAC,EAAOC,GAA6C,IAAAC,EAAAC,EAAA,OAAAL,IAAAM,MAAA,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,GAC1DtB,OAAOuB,WAAU,CAAAH,EAAAE,KAAA,EAAA,KAAA,CAAA,MAAQ,IAAIE,MAAM,+BAA8B,KAAA,EAC5B,OAApCP,EAAa,IAAIjB,OAAOuB,WAAYH,EAAAE,KAAA,EACrBL,EAAWP,KAAKM,GAAsB,KAAA,EAClC,OADnBE,EAAME,EAAAK,KACZhB,EAASS,EAAOQ,SAASN,EAAAO,OAAA,SAClBT,GAAM,KAAA,EAAA,IAAA,MAAA,OAAAE,EAAAQ,OAAA,GAAAb,EACd,KAAA,OANKL,SAAImB,GAAA,OAAAlB,EAAAmB,MAAAC,KAAA5B,UAAA,EAAA,GAQV,MAAO,CACLL,UAAAA,EACAU,MAAAA,EACAE,KAAAA,EAEJ"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BUclQybi.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";import"../../utils/helpers/isClient.js";var n=function(n){var i,u=o(null!=n?n:null===(i=document.querySelector('link[rel*="icon"]'))||void 0===i?void 0:i.href),c=e(u,2),l=c[0],p=c[1],s=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&&s(n)})),t((function(){n&&(p(n),s(n))}),[n]),{href:l,set:function(e){p(e),s(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,e as r,f as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e,e as r,f as n}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useRef as t,useState as u}from"react";import{useRerender as a}from"../useRerender/useRerender.js";var i=function(i){var l,c,o=null!==(l=null==i?void 0:i.initialValue)&&void 0!==l?l:"",v=t(),d=t(!1),f=a(),s=u(!1),p=e(s,2),m=p[0],h=p[1],g=u(null!==(c=null==i?void 0:i.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;"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.value=e:v.current.checked=e},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!=i&&i.autoFocus&&r.focus(),v.current=r,"radio"===v.current.type)return void(v.current.defaultChecked=(null==i?void 0:i.initialValue)===r.value);if("checkbox"===v.current.type)return void(v.current.defaultChecked=!(null==i||!i.initialValue));v.current.defaultValue=String(o),e&&null!=i&&i.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.update());case 2:if(v.current.value!==o&&h(!0),m&&v.current.value===o&&h(!1),!e||null==i||!i.validateOnChange){r.next=7;break}return r.next=7,O(e);case 7:e&&null!=i&&i.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==i||!i.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:m,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{i as useField};
|
|
3
3
|
//# sourceMappingURL=useField.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-BUclQybi.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();return r=requestAnimationFrame((function a(){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)})),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,b as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e,b as n}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useRef as l,useState as r}from"react";import{useUnmount as t}from"../useUnmount/useUnmount.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"]],o=(()=>{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})(),u={change:o.fullscreenchange,error:o.fullscreenerror};let s={request:(e=document.documentElement,n)=>new Promise(((l,r)=>{const t=()=>{s.off("change",t),l()};s.on("change",t);const c=e[o.requestFullscreen](n);c instanceof Promise&&c.then(t).catch(r)})),exit:()=>new Promise(((e,n)=>{if(!s.isFullscreen)return void e();const l=()=>{s.off("change",l),e()};s.on("change",l);const r=document[o.exitFullscreen]();r instanceof Promise&&r.then(l).catch(n)})),toggle:(e,n)=>s.isFullscreen?s.exit():s.request(e,n),onchange(e){s.on("change",e)},onerror(e){s.on("error",e)},on(e,n){const l=u[e];l&&document.addEventListener(l,n,!1)},off(e,n){const l=u[e];l&&document.removeEventListener(l,n,!1)},raw:o};Object.defineProperties(s,{isFullscreen:{get:()=>Boolean(document[o.fullscreenElement])},element:{enumerable:!0,get:()=>document[o.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[o.fullscreenEnabled])}}),o||(s={isEnabled:!1});var i=s,a=function(){var c,o=void 0===(arguments.length<=1?void 0:arguments[1])||arguments.length<=0?void 0:arguments[0],u=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],s=l(null),a=r(null!==(c=null==u?void 0:u.initialValue)&&void 0!==c&&c),f=e(a,2),m=f[0],d=f[1],b=function e(){if(i.isEnabled){var n,l;if(i.isFullscreen)null==u||null===(n=u.onEnter)||void 0===n||n.call(u);else i.off("change",e),null==u||null===(l=u.onExit)||void 0===l||l.call(u);d(i.isFullscreen)}},g=function(){var e=o?function(e){return"function"==typeof e?e():e instanceof Element?e:e.current}(o):s.current;if(e&&i.isEnabled)try{i.request(e),i.on("change",b)}catch(e){console.error(e)}},E=function(){i.isEnabled&&i.exit()};return t((function(){i.isEnabled&&i.off("change",b)})),n(n({},!o&&{ref:s}),{},{enter:g,exit:E,toggle:function(){if(m)return E();g()},value:m})};export{a as useFullscreen};
|
|
3
3
|
//# sourceMappingURL=useFullscreen.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as n}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as o,useEffect as e}from"react";var r=function(){return decodeURIComponent(window.location.hash.replace("#",""))},t=function(){var t=o(window?r():""),i=n(t,2),a=i[0],c=i[1];return e((function(){var n=function(){return c(r())};return window.addEventListener("hashchange",n),function(){window.removeEventListener("hashchange",n)}})),[a,function(n){window.location.hash=n,c(n)}]};export{t as useHash};
|
|
3
3
|
//# sourceMappingURL=useHash.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e,c as o}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e,c as o}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as n}from"react";import{useDidUpdate as t}from"../useDidUpdate/useDidUpdate.js";import{useEventListener as r}from"../useEventListener/useEventListener.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";import"../useEvent/useEvent.js";var i=function(e,o){return e.toLowerCase().split(/[+_-]/g).map((function(e){return e.trim()})).every((function(e){return o.find((function(o){return e===o.code.toLocaleLowerCase()||e===o.key.toLocaleLowerCase()||e===o.alias.toLocaleLowerCase()}))}))},u=function(u,l,a){var s,c,d,f,v=null===(s=null==a?void 0:a.enabled)||void 0===s||s,p=null===(c=null==a?void 0:a.preventDefault)||void 0===c||c,m=n([]),y=e(m,2)[1];t((function(){y([])}),[v]),r(null!==(d=null==a?void 0:a.target)&&void 0!==d?d:window,"keydown",(function(e){p&&e.preventDefault(),v&&y((function(n){var t,r,s,c;if(n.some((function(o){return o.code===e.code})))return n;var d=null!==(t=null!==(r=null==a||null===(s=a.aliasMap)||void 0===s?void 0:s[e.key])&&void 0!==r?r:null==a||null===(c=a.aliasMap)||void 0===c?void 0:c[e.key])&&void 0!==t?t:e.code,f=[].concat(o(n),[{key:e.key,code:e.code,alias:d}]);Array.isArray(u)?u.forEach((function(o){i(o,f)&&l(e)})):i(u,f)&&l(e);return f}))})),r(null!==(f=null==a?void 0:a.target)&&void 0!==f?f:window,"keyup",(function(e){v&&y((function(o){return o.filter((function(o){return o.code!==e.code}))}))}))};export{i as isHotkeyMatch,u as useHotkeys};
|
|
3
3
|
//# sourceMappingURL=useHotkeys.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{a as e,_ as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{a as e,_ as n}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as t,useRef as o}from"react";import{useEventListener as l}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(){var i=(arguments.length<=0?void 0:arguments[0])instanceof Function||!("current"in(arguments.length<=0?void 0:arguments[0]))||arguments.length<=0?void 0:arguments[0],r=i?"object"===e(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:{onEntry:arguments.length<=1?void 0:arguments[1]}:"object"===e(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:{onEntry:arguments.length<=0?void 0:arguments[0]},u=t(!1),s=n(u,2),v=s[0],a=s[1],c=o(null);return l(null!=i?i:c,"mouseenter",(function(){var e;null==r||null===(e=r.onEntry)||void 0===e||e.call(r),a(!0)})),l(null!=i?i:c,"mouseleave",(function(){var e;null==r||null===(e=r.onLeave)||void 0===e||e.call(r),a(!1)})),i?v:[c,v]};export{i as useHover};
|
|
3
3
|
//# sourceMappingURL=useHover.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as t,useEffect as n}from"react";import"../../utils/helpers/isClient.js";import{throttle as i}from"../../utils/helpers/throttle.js";var o=["mousemove","mousedown","keydown","touchstart","wheel","resize"],r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e4,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=u.initialValue,l=void 0!==s&&s,a=u.events,c=void 0===a?o:a,d=t(l),m=e(d,2),v=m[0],f=m[1],h=t(Date.now()),p=e(h,2),w=p[0],E=p[1];return n((function(){var e,t=function(){return f(!0)},n=i((function(){f(!1),E(Date.now()),clearTimeout(e),e=setTimeout(t,r)}),500),o=function(){document.hidden||n()};return e=setTimeout(t,r),c.forEach((function(e){return window.addEventListener(e,n)})),document.addEventListener("visibilitychange",o),function(){c.forEach((function(e){return window.addEventListener(e,n)})),document.removeEventListener("visibilitychange",o),clearTimeout(e)}}),[r,c]),{idle:v,lastActive:w}};export{r as useIdle};
|
|
3
3
|
//# sourceMappingURL=useIdle.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{a as n,_ as e,b as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{a as n,_ as e,b as t}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as r,useRef as o,useEffect as i}from"react";var l=function(){var l,u="object"!==n(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,c=u?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],v=null===(l=null==c?void 0:c.enabled)||void 0===l||l,a=r(),d=e(a,2),s=d[0],f=d[1],g=o(null),h=o();return h.current=null==c?void 0:c.onChange,i((function(){if(v){var n,r=u?function(n){return"function"==typeof n?n():n instanceof Element?n:n.current}(u):g.current,o=new IntersectionObserver((function(n){var t,r=e(n,1)[0];f(r),null===(t=h.current)||void 0===t||t.call(h,r)}),t(t({},c),{},{root:(n=null==c?void 0:c.root,n?n instanceof Element||n instanceof Document?n:n.current:document)}));return o.observe(r),function(){o.disconnect()}}}),[u,null==c?void 0:c.rootMargin,null==c?void 0:c.threshold,v]),u?{entry:s,inView:!(null==s||!s.isIntersecting)}:{ref:g,entry:s,inView:!(null==s||!s.isIntersecting)}};export{l as useIntersectionObserver};
|
|
3
3
|
//# sourceMappingURL=useIntersectionObserver.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{a as e,_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{a as e,_ as r}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as t,useRef as n,useEffect as u}from"react";import{useEvent as l}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){for(var o,i,a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];var f=s[0],v=null!==(o="number"==typeof s[1]?s[1]:s[1].interval)&&void 0!==o?o:1e3,p="object"===e(s[1])?s[1]:s[2],m=null===(i=null==p?void 0:p.enabled)||void 0===i||i,I=t(null==m||m),j=r(I,2),b=j[0],d=j[1],h=n(),y=l(f);u((function(){if(m)return h.current=setInterval(y,v),function(){clearInterval(h.current)}}),[m,v]);return{isActive:b,pause:function(){d(!1),clearInterval(h.current)},resume:function(){v<=0||(d(!0),clearInterval(h.current),h.current=setInterval(y,v))}}};export{o as useInterval};
|
|
3
3
|
//# sourceMappingURL=useInterval.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useRef as r}from"react";var t=function(){var t=r(!0);return!0===t.current?(t.current=!1,!0):t.current};export{t as useIsFirstRender};
|
|
3
3
|
//# sourceMappingURL=useIsFirstRender.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useLayoutEffect as r,useEffect as t}from"react";import{isClient as e}from"../../utils/helpers/isClient.js";var i=e?r:t;export{i as useIsomorphicLayoutEffect};
|
|
3
3
|
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as r}from"react";import{useEventListener as t}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(i,o){var n,s,u=r(!1),l=e(u,2),a=l[0],p=l[1];return t(null!==(n=null==o?void 0:o.target)&&void 0!==n?n:window,"keydown",(function(e){(Array.isArray(i)?i.includes(e.key):e.key===i)&&p(!0)})),t(null!==(s=null==o?void 0:o.target)&&void 0!==s?s:window,"keyup",(function(e){(Array.isArray(i)?i.includes(e.key):e.key===i)&&p(!1)})),a};export{i as useKeyPress};
|
|
3
3
|
//# sourceMappingURL=useKeyPress.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useEventListener as e}from"../useEventListener/useEventListener.js";import"react";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var t=function(){var t=Array.isArray(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:[arguments.length<=0?void 0:arguments[0]],n=(arguments.length<=1?void 0:arguments[1])instanceof Function?null:arguments.length<=1?void 0:arguments[1],i=n?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1];e(null!=n?n:window,"keydown",(function(e){t.includes(e.key)&&i(e)}),n?arguments.length<=3?void 0:arguments[3]:arguments.length<=2?void 0:arguments[2])};export{t as useKeyPressEvent};
|
|
3
3
|
//# sourceMappingURL=useKeyPressEvent.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useEventListener as o}from"../useEventListener/useEventListener.js";import"react";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var e=function(e){var n,t;o(null!==(n=null==e?void 0:e.target)&&void 0!==n?n:window,"keydown",(function(o){var n;return null==e||null===(n=e.onKeyDown)||void 0===n?void 0:n.call(e,o)})),o(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:window,"keyup",(function(o){var n;return null==e||null===(n=e.onKeyUp)||void 0===n?void 0:n.call(e,o)}))};export{e as useKeyboard};
|
|
3
3
|
//# sourceMappingURL=useKeyboard.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e,c as o}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e,c as o}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as t}from"react";import{useDidUpdate as n}from"../useDidUpdate/useDidUpdate.js";import{useEventListener as r}from"../useEventListener/useEventListener.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";import"../useEvent/useEvent.js";var i=function(i){var u,s,c,l=null===(u=null==i?void 0:i.enabled)||void 0===u||u,d=t([]),f=e(d,2),p=f[0],a=f[1];return n((function(){a([])}),[l]),r(null!==(s=null==i?void 0:i.target)&&void 0!==s?s:window,"keydown",(function(e){l&&a((function(t){return t.some((function(o){return o.code===e.code}))?t:[].concat(o(t),[{key:e.key,code:e.code}])}))})),r(null!==(c=null==i?void 0:i.target)&&void 0!==c?c:window,"keyup",(function(e){l&&a((function(o){return o.filter((function(o){return o.code!==e.code}))}))})),p};export{i as useKeysPressed};
|
|
3
3
|
//# sourceMappingURL=useKeysPressed.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n,c as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as n,c as t}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as r}from"react";var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=r(e),c=n(u,2),o=c[0],i=c[1];return{value:o,set:function(n){return i(n)},push:function(n){return i((function(r){return[].concat(t(r),[n])}))},removeAt:function(n){return i((function(r){return[].concat(t(r.slice(0,n)),t(r.slice(n+1)))}))},insertAt:function(n,r){return i((function(e){return[].concat(t(e.slice(0,n)),[r],t(e.slice(n)))}))},updateAt:function(n,t){return i((function(r){return r.map((function(r,e){return e===n?t:r}))}))},clear:function(){return i([])},reset:function(){return i(e)}}};export{e as useList};
|
|
3
3
|
//# sourceMappingURL=useList.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{b as o}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{b as o}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useStorage as r}from"../useStorage/useStorage.js";import"react";import"../../utils/helpers/isClient.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var e=function(e,t,i){return r(e,o({initialValue:t,storage:window.localStorage},i))};export{e as useLocalStorage};
|
|
3
3
|
//# sourceMappingURL=useLocalStorage.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{c as o}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{c as o}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useEffect as t}from"react";import{useDidUpdate as e}from"../useDidUpdate/useDidUpdate.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var c=function(c,n){t((function(){var t;return(t=console).log.apply(t,["".concat(c," mounted")].concat(o(n))),function(){return console.log("".concat(c," unmounted"))}}),[]),e((function(){var t;(t=console).log.apply(t,["".concat(c," updated")].concat(o(n)))}),n)};export{c as useLogger};
|
|
3
3
|
//# sourceMappingURL=useLogger.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as n}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as e,useRef as l}from"react";import{useEventListener as t}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){var o=(arguments.length<=0?void 0:arguments[0])instanceof Function||!("current"in(arguments.length<=0?void 0:arguments[0]))||arguments.length<=0?void 0:arguments[0],u=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],r=o?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],i=e(!1),s=n(i,2),c=s[0],v=s[1],a=l(null),d=l(),h=l(!1),m=function(n){var e,l;null==r||null===(e=r.onStart)||void 0===e||e.call(r,n),h.current=!0,d.current=setTimeout((function(){u(n),v(!0)}),null!==(l=null==r?void 0:r.threshold)&&void 0!==l?l:400)},f=function(n){var e;if(c)null==r||null===(e=r.onFinish)||void 0===e||e.call(r,n);else if(h.current){var l;null==r||null===(l=r.onCancel)||void 0===l||l.call(r,n)}v(!1),h.current=!1,d.current&&clearTimeout(d.current)};return t(null!=o?o:a,"mousedown",m),t(null!=o?o:a,"touchstart",m),t(null!=o?o:a,"mouseup",f),t(null!=o?o:a,"touchend",f),o?c:[a,c]};export{o as useLongPress};
|
|
3
3
|
//# sourceMappingURL=useLongPress.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useCallback as n,useSyncExternalStore as e}from"react";var t=function(){return!1},r=function(r){var a=n((function(n){var e=window.matchMedia(r);return e.addEventListener("change",n),function(){e.removeEventListener("change",n)}}),[r]);return e(a,(function(){return window.matchMedia(r).matches}),t)};export{r as useMediaQuery};
|
|
3
3
|
//# sourceMappingURL=useMediaQuery.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e,b as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e,b as t}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as n,useRef as o}from"react";import{useIsomorphicLayoutEffect as r}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(){for(var i=arguments.length,l=new Array(i),u=0;u<i;u++)l[u]=arguments[u];var m=l[0],s=n({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),c=e(s,2),f=c[0],a=c[1],p=o(null);return r((function(){var e=function(e){var n=m?function(e){return"function"==typeof e?e():e instanceof Element?e:e.current}(m):p.current;if(n){var o={x:e.pageX,y:e.pageY},r=n.getBoundingClientRect(),i=r.left,l=r.top,u=i+window.scrollX,s=l+window.scrollY,c=e.pageX-u,f=e.pageY-s;o.elementX=c,o.elementY=f,o.elementPositionX=u,o.elementPositionY=s,a((function(e){return t(t({},e),o)}))}};return document.addEventListener("mousemove",e),function(){document.removeEventListener("mousemove",e)}}),[]),m?f:t(t({},f),{},{ref:p})};export{i as useMouse};
|
|
3
3
|
//# sourceMappingURL=useMouse.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r,e as n,f as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as r,e as n,f as t}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useRef as e,useState as u}from"react";import{getRetry as l}from"../../utils/helpers/getRetry.js";import"../../utils/helpers/isClient.js";var o=function(o,i){var c=e(null!=i&&i.retry?l(i.retry):0),s=u(!1),a=r(s,2),f=a[0],p=a[1],m=u(!1),v=r(m,2),y=v[0],h=v[1],d=u(!1),g=r(d,2),j=g[0],b=g[1],w=u(null),x=r(w,2),E=x[0],S=x[1],_=u(null),k=r(_,2),A=k[0],B=k[1],C=function r(n){return p(!0),o(n).then((function(r){var n;return null==i||null===(n=i.onSuccess)||void 0===n||n.call(i,r),B(r),b(!0),p(!1),S(null),h(!1),r})).catch((function(t){var e;if(c.current>0)return c.current-=1,r(n);null==i||null===(e=i.onError)||void 0===e||e.call(i,t),B(null),b(!1),p(!1),S(t),h(!0),c.current=null!=i&&i.retry?l(i.retry):0}))},H=function(){var r=n(t().mark((function r(n){return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",C(n));case 1:case"end":return r.stop()}}),r)})));return function(n){return r.apply(this,arguments)}}();return{data:A,error:E,mutate:function(r){C(r)},mutateAsync:H,isLoading:f,isError:y,isSuccess:j}};export{o as useMutation};
|
|
3
3
|
//# sourceMappingURL=useMutation.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useRef as r,useEffect as n}from"react";function t(t,e,u){var c=r(),o=r(null);return n((function(){var r="function"==typeof u?u():u;return(r||o.current)&&(c.current=new MutationObserver(t),c.current.observe(r||o.current,e)),function(){var r;null===(r=c.current)||void 0===r||r.disconnect()}}),[t,e]),o}export{t as useMutationObserver};
|
|
3
3
|
//# sourceMappingURL=useMutationObserver.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as n}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as e,useEffect as i}from"react";import{isClient as o}from"../../utils/helpers/isClient.js";var t=function(){var n,e,i;return(null===(n=navigator)||void 0===n?void 0:n.connection)||(null===(e=navigator)||void 0===e?void 0:e.mozConnection)||(null===(i=navigator)||void 0===i?void 0:i.webkitConnection)},l=function(){var l=e((function(){if(!o)return{online:!1,type:void 0,effectiveType:void 0,saveData:!1,downlink:0,downlinkMax:0,rtt:0};var n=navigator.onLine,e=t();return{online:n,downlink:null==e?void 0:e.downlink,downlinkMax:null==e?void 0:e.downlinkMax,effectiveType:null==e?void 0:e.effectiveType,rtt:null==e?void 0:e.rtt,saveData:null==e?void 0:e.saveData,type:null==e?void 0:e.type}})),v=n(l,2),a=v[0],r=v[1];return i((function(){var n=function(){var n=navigator.onLine,e=t();r({online:n,downlink:null==e?void 0:e.downlink,downlinkMax:null==e?void 0:e.downlinkMax,effectiveType:null==e?void 0:e.effectiveType,rtt:null==e?void 0:e.rtt,saveData:null==e?void 0:e.saveData,type:null==e?void 0:e.type})};window.addEventListener("online",n,{passive:!0}),window.addEventListener("offline",n,{passive:!0});var e=t();return e&&e.addEventListener("change",n,{passive:!0}),function(){window.removeEventListener("online",n),window.removeEventListener("offline",n),e&&e.removeEventListener("change",n)}})),a};export{t as getConnection,l as useNetwork};
|
|
3
3
|
//# sourceMappingURL=useNetwork.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNetwork.js","sources":["../../../../src/hooks/useNetwork/useNetwork.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { isClient } from '@/utils/helpers';\n\nexport type ConnectionType = Connection['type'];\nexport type ConnectionEffectiveType = Connection['effectiveType'];\n\n/** The use network return type */\nexport interface UseNetworkReturn {\n /** Indicates if the device is currently online */\n online: boolean;\n /** The estimated downlink speed in megabits per seconds */\n downlink?: Connection['downlink'];\n /** The maximum downlink speed, if available */\n downlinkMax?: Connection['downlinkMax'];\n /** The effective type of connection (e.g., '2g', '3g', '4g') */\n effectiveType?: Connection['effectiveType'];\n /** The estimated round-trip time in milliseconds */\n rtt?: Connection['rtt'];\n /** Indicates if the user has enabled data saving mode */\n saveData?: Connection['saveData'];\n /** The type of network connection (e.g., 'wifi', 'cellular') */\n type?: Connection['type'];\n}\n\nexport const getConnection = () =>\n navigator?.connection || navigator?.mozConnection || navigator?.webkitConnection;\n\n/**\n * @name useNetwork\n * @description - Hook to track network status\n *\n * @returns {UseNetworkReturn} An object containing the network status\n *\n * @example\n * const { online, downlink, downlinkMax, effectiveType, rtt, saveData, type } = useNetwork();\n */\nexport const useNetwork = (): UseNetworkReturn => {\n const [value, setValue] = useState(() => {\n if (!isClient) {\n return {\n online: false,\n type: undefined,\n effectiveType: undefined,\n saveData: false,\n downlink: 0,\n downlinkMax: 0,\n rtt: 0\n };\n }\n const online = navigator.onLine;\n const connection = getConnection();\n\n return {\n online,\n downlink: connection?.downlink,\n downlinkMax: connection?.downlinkMax,\n effectiveType: connection?.effectiveType,\n rtt: connection?.rtt,\n saveData: connection?.saveData,\n type: connection?.type\n };\n });\n\n useEffect(() => {\n const callback = () => {\n const online = navigator.onLine;\n const connection = getConnection();\n\n setValue({\n online,\n downlink: connection?.downlink,\n downlinkMax: connection?.downlinkMax,\n effectiveType: connection?.effectiveType,\n rtt: connection?.rtt,\n saveData: connection?.saveData,\n type: connection?.type\n });\n };\n window.addEventListener('online', callback, { passive: true });\n window.addEventListener('offline', callback, { passive: true });\n\n const connection = getConnection();\n\n if (connection) {\n connection.addEventListener('change', callback, { passive: true });\n }\n\n return () => {\n window.removeEventListener('online', callback);\n window.removeEventListener('offline', callback);\n\n if (connection) {\n connection.removeEventListener('change', callback);\n }\n };\n });\n\n return value;\n};\n"],"names":["getConnection","_navigator","_navigator2","_navigator3","navigator","connection","mozConnection","webkitConnection","useNetwork","_useState","useState","isClient","online","type","undefined","effectiveType","saveData","downlink","downlinkMax","rtt","onLine","_useState2","_slicedToArray","value","setValue","useEffect","callback","window","addEventListener","passive","removeEventListener"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useNetwork.js","sources":["../../../../src/hooks/useNetwork/useNetwork.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { isClient } from '@/utils/helpers';\nimport type { Connection } from '@/utils/types';\n\ndeclare global {\n interface Navigator {\n readonly connection: Connection;\n readonly mozConnection: Connection;\n readonly webkitConnection: Connection;\n }\n}\n\n/** The type of network connection */\nexport type ConnectionType = Connection['type'];\n/** The effective type of connection */\nexport type ConnectionEffectiveType = Connection['effectiveType'];\n\n/** The use network return type */\nexport interface UseNetworkReturn {\n /** Indicates if the device is currently online */\n online: boolean;\n /** The estimated downlink speed in megabits per seconds */\n downlink?: Connection['downlink'];\n /** The maximum downlink speed, if available */\n downlinkMax?: Connection['downlinkMax'];\n /** The effective type of connection (e.g., '2g', '3g', '4g') */\n effectiveType?: Connection['effectiveType'];\n /** The estimated round-trip time in milliseconds */\n rtt?: Connection['rtt'];\n /** Indicates if the user has enabled data saving mode */\n saveData?: Connection['saveData'];\n /** The type of network connection (e.g., 'wifi', 'cellular') */\n type?: Connection['type'];\n}\n\nexport const getConnection = () =>\n navigator?.connection || navigator?.mozConnection || navigator?.webkitConnection;\n\n/**\n * @name useNetwork\n * @description - Hook to track network status\n *\n * @returns {UseNetworkReturn} An object containing the network status\n *\n * @example\n * const { online, downlink, downlinkMax, effectiveType, rtt, saveData, type } = useNetwork();\n */\nexport const useNetwork = (): UseNetworkReturn => {\n const [value, setValue] = useState(() => {\n if (!isClient) {\n return {\n online: false,\n type: undefined,\n effectiveType: undefined,\n saveData: false,\n downlink: 0,\n downlinkMax: 0,\n rtt: 0\n };\n }\n const online = navigator.onLine;\n const connection = getConnection();\n\n return {\n online,\n downlink: connection?.downlink,\n downlinkMax: connection?.downlinkMax,\n effectiveType: connection?.effectiveType,\n rtt: connection?.rtt,\n saveData: connection?.saveData,\n type: connection?.type\n };\n });\n\n useEffect(() => {\n const callback = () => {\n const online = navigator.onLine;\n const connection = getConnection();\n\n setValue({\n online,\n downlink: connection?.downlink,\n downlinkMax: connection?.downlinkMax,\n effectiveType: connection?.effectiveType,\n rtt: connection?.rtt,\n saveData: connection?.saveData,\n type: connection?.type\n });\n };\n window.addEventListener('online', callback, { passive: true });\n window.addEventListener('offline', callback, { passive: true });\n\n const connection = getConnection();\n\n if (connection) {\n connection.addEventListener('change', callback, { passive: true });\n }\n\n return () => {\n window.removeEventListener('online', callback);\n window.removeEventListener('offline', callback);\n\n if (connection) {\n connection.removeEventListener('change', callback);\n }\n };\n });\n\n return value;\n};\n"],"names":["getConnection","_navigator","_navigator2","_navigator3","navigator","connection","mozConnection","webkitConnection","useNetwork","_useState","useState","isClient","online","type","undefined","effectiveType","saveData","downlink","downlinkMax","rtt","onLine","_useState2","_slicedToArray","value","setValue","useEffect","callback","window","addEventListener","passive","removeEventListener"],"mappings":";2KAoCaA,IAAAA,EAAgB,WAAH,IAAAC,EAAAC,EAAAC,EAAA,OACfF,QAATA,EAAAG,iBAAAH,IAASA,OAATA,EAAAA,EAAWI,cAAuBH,QAAbA,EAAIE,iBAAAF,IAASA,OAATA,EAAAA,EAAWI,iBAA0BH,QAAbA,EAAIC,iBAAAD,IAASA,OAATA,EAAAA,EAAWI,iBAAgB,EAWrEC,EAAa,WACxB,IAAAC,EAA0BC,GAAS,WACjC,IAAKC,EACH,MAAO,CACLC,QAAQ,EACRC,UAAMC,EACNC,mBAAeD,EACfE,UAAU,EACVC,SAAU,EACVC,YAAa,EACbC,IAAK,GAGT,IAAMP,EAASR,UAAUgB,OACnBf,EAAaL,IAEnB,MAAO,CACLY,OAAAA,EACAK,SAAUZ,aAAAA,EAAAA,EAAYY,SACtBC,YAAab,aAAAA,EAAAA,EAAYa,YACzBH,cAAeV,aAAAA,EAAAA,EAAYU,cAC3BI,IAAKd,aAAAA,EAAAA,EAAYc,IACjBH,SAAUX,aAAAA,EAAAA,EAAYW,SACtBH,KAAMR,aAAU,EAAVA,EAAYQ,KAEtB,IAAEQ,EAAAC,EAAAb,EAAA,GAxBKc,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GA4DtB,OAlCAI,GAAU,WACR,IAAMC,EAAW,WACf,IAAMd,EAASR,UAAUgB,OACnBf,EAAaL,IAEnBwB,EAAS,CACPZ,OAAAA,EACAK,SAAUZ,aAAAA,EAAAA,EAAYY,SACtBC,YAAab,aAAAA,EAAAA,EAAYa,YACzBH,cAAeV,aAAAA,EAAAA,EAAYU,cAC3BI,IAAKd,aAAAA,EAAAA,EAAYc,IACjBH,SAAUX,aAAAA,EAAAA,EAAYW,SACtBH,KAAMR,aAAU,EAAVA,EAAYQ,QAGtBc,OAAOC,iBAAiB,SAAUF,EAAU,CAAEG,SAAS,IACvDF,OAAOC,iBAAiB,UAAWF,EAAU,CAAEG,SAAS,IAExD,IAAMxB,EAAaL,IAMnB,OAJIK,GACFA,EAAWuB,iBAAiB,SAAUF,EAAU,CAAEG,SAAS,IAGtD,WACLF,OAAOG,oBAAoB,SAAUJ,GACrCC,OAAOG,oBAAoB,UAAWJ,GAElCrB,GACFA,EAAWyB,oBAAoB,SAAUJ,GAG/C,IAEOH,CACT"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useSyncExternalStore as n}from"react";var e=function(){return navigator.onLine},t=function(){return!1},i=function(n){return window.addEventListener("online",n),window.addEventListener("offline",n),function(){window.removeEventListener("online",n),window.removeEventListener("offline",n)}},o=function(){return n(i,e,t)};export{o as useOnline};
|
|
3
3
|
//# sourceMappingURL=useOnline.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useRef as n}from"react";var i=function(){if("undefined"==typeof window)return"undetermined";var n=window.navigator.userAgent;return/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i.test(n)?"macos":/(iPhone)|(iPad)|(iPod)/i.test(n)?"ios":/(Win32)|(Win64)|(Windows)|(WinCE)/i.test(n)?"windows":/Android/i.test(n)?"android":/Linux/i.test(n)?"linux":"undetermined"},t=function(){return n(i()).current};export{i as getOperatingSystem,t as useOperatingSystem};
|
|
3
3
|
//# sourceMappingURL=useOperatingSystem.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as n}from"react";import{useIsomorphicLayoutEffect as r}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){var o=n({angle:0,type:"landscape-primary"}),t=e(o,2),i=t[0],a=t[1];return r((function(){var e,n=function(){var e=window.screen.orientation,n=e.angle,r=e.type;a({angle:n,type:r})};return null===(e=window.screen.orientation)||void 0===e||e.addEventListener("change",n),function(){var e;return null===(e=window.screen.orientation)||void 0===e?void 0:e.removeEventListener("change",n)}}),[]),i};export{o as useOrientation};
|
|
3
3
|
//# sourceMappingURL=useOrientation.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as t,useEffect as r}from"react";import{useEvent as n}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(o){var s=t(!1),u=e(s,2),i=u[0],m=u[1],v=n((function(){if(i)return m(!1);null==o||o(),m(!0)}));return r((function(){return document.addEventListener("mouseleave",v,{passive:!0}),document.addEventListener("mouseenter",v,{passive:!0}),function(){document.removeEventListener("mouseenter",v),document.removeEventListener("mouseleave",v)}}),[]),i};export{o as usePageLeave};
|
|
3
3
|
//# sourceMappingURL=usePageLeave.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{a as e,_ as t,b as n}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{a as e,_ as t,b as n}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as r,useRef as o,useEffect as i}from"react";import{useEvent as u}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var c=function(e){return"function"==typeof e?e():e instanceof Element?e:e.current},l=function(){var l,s,d,v="object"!==e(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,f=v?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],a=r(!1),m=t(a,2),p=m[0],h=m[1],E=o(null),g=o(null),w=r({width:null!==(l=null==f?void 0:f.width)&&void 0!==l?l:5,color:null!==(s=null==f?void 0:f.color)&&void 0!==s?s:"black",opacity:null!==(d=null==f?void 0:f.opacity)&&void 0!==d?d:.1}),L=t(w,2),y=L[0],b=L[1],j=u((function(e){p&&g.current&&(g.current.lineTo(e.offsetX,e.offsetY),g.current.stroke())}));return i((function(){var e=v?c(v):E.current;if(e){g.current=e.getContext("2d");var t=function(e){g.current&&(g.current.beginPath(),g.current.moveTo(e.offsetX,e.offsetY),h(!0))},n=function(){g.current&&(g.current.closePath(),h(!1))};return e.addEventListener("mousedown",t),e.addEventListener("mousemove",j),e.addEventListener("mouseup",n),function(){e&&(e.removeEventListener("mousedown",t),e.removeEventListener("mousemove",j),e.removeEventListener("mouseup",n))}}}),[]),i((function(){g.current&&(g.current.strokeStyle=y.color,g.current.lineWidth=y.width,g.current.lineCap="round",g.current.lineJoin="round")}),[y.color,y.width,y.opacity]),v?{pencil:n(n({},y),{},{set:b}),drawing:p}:{pencil:n(n({},y),{},{set:b}),ref:E,drawing:p}};export{c as getTargetElement,l as usePaint};
|
|
3
3
|
//# sourceMappingURL=usePaint.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useMediaQuery as e}from"../useMediaQuery/useMediaQuery.js";import"react";var r=function(){var r=e("(prefers-color-scheme: light)"),o=e("(prefers-color-scheme: dark)");return r?"light":o?"dark":"no-preference"};export{r as usePreferredColorScheme};
|
|
3
3
|
//# sourceMappingURL=usePreferredColorScheme.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useSyncExternalStore as n}from"react";var e=function(){return window.navigator.languages},r=function(){return[]},t=function(n){return window.addEventListener("languagechange",n),function(){window.removeEventListener("languagechange",n)}},a=function(){return n(t,e,r)};export{a as usePreferredLanguages};
|
|
3
3
|
//# sourceMappingURL=usePreferredLanguages.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useRef as r,useEffect as t}from"react";var n=function(n){var c=r();return t((function(){c.current=n})),c.current};export{n as usePrevious};
|
|
3
3
|
//# sourceMappingURL=usePrevious.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as l}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as l}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useRef as r,useState as e,useEffect as n}from"react";import{getRetry as t}from"../../utils/helpers/getRetry.js";import"../../utils/helpers/isClient.js";var i=function(i,o){var u,a=r(null!=o&&o.retry?t(o.retry):0),c=e(!1),s=l(c,2),d=s[0],f=s[1],v=e(!1),h=l(v,2),p=h[0],m=h[1],y=e(!1),D=l(y,2),g=D[0],j=D[1],E=e(!(null==o||!o.initialData)),R=l(E,2),S=R[0],_=R[1],b=e(void 0),k=l(b,2),x=k[0],B=k[1],C=e(null==o?void 0:o.initialData),F=l(C,2),H=F[0],L=F[1],P=function l(r){f(!0),"refetch"===r&&j(!0),i().then((function(l){var e,n=null!=o&&o.select?null==o?void 0:o.select(l):l;null==o||null===(e=o.onSuccess)||void 0===e||e.call(o,n),L(n),_(!0),f(!1),B(void 0),m(!1),"refetch"===r&&j(!1)})).catch((function(e){var n;if(a.current>0)return a.current-=1,l(r);null==o||null===(n=o.onError)||void 0===n||n.call(o,e),L(void 0),_(!1),f(!1),B(e),m(!0),"refetch"===r&&j(!1),a.current=null!=o&&o.retry?t(o.retry):0}))};n((function(){null!=o&&o.initialData||P("init")}),null!==(u=null==o?void 0:o.keys)&&void 0!==u?u:[]);var q=(null==o?void 0:o.placeholderData)instanceof Function?null==o?void 0:o.placeholderData():null==o?void 0:o.placeholderData;return{data:null!=H?H:q,error:x,refetch:function(){return P("refetch")},isLoading:d,isError:p,isSuccess:S,isRefetching:g}};export{i as useQuery};
|
|
3
3
|
//# sourceMappingURL=useQuery.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r,c as n,d as t}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as r,c as n,d as t}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as e}from"react";import{flushSync as o}from"react-dom";var u=function(){var u=e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),i=r(u,2),a=i[0],c=i[1];return{add:function(r){return c((function(t){return[].concat(n(t),[r])}))},remove:function(){var r;return o((function(){c((function(n){var e=t(n),o=e[0],u=e.slice(1);return r=o,u}))})),r},clear:function(){return c([])},first:a[0],last:a[a.length-1],size:a.length,queue:a}};export{u as useQueue};
|
|
3
3
|
//# sourceMappingURL=useQueue.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useRef as r,useEffect as t}from"react";var n=function(){var n=r(0);return t((function(){n.current+=1})),n.current};export{n as useRenderCount};
|
|
3
3
|
//# sourceMappingURL=useRenderCount.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
2
|
import{useRef as e}from"react";var n=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Unknown",r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e({component:n,renders:0,timestamp:Date.now(),sinceLast:0}),c=Date.now();return t.current.renders+=1,t.current.sinceLast=t.current.timestamp?c-t.current.timestamp:0,t.current.timestamp=c,r&&(console.group("".concat(n," info, render number: ").concat(t.current.renders)),console.log("Timestamp: ".concat(t.current.timestamp)),console.log("Since last render: ".concat(t.current.sinceLast)),console.log("Renders: ".concat(t.current.renders)),console.dir(t.current),console.groupEnd()),t.current};export{n as useRenderInfo};
|
|
3
3
|
//# sourceMappingURL=useRenderInfo.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useId as t,useState as o}from"react";var n=function(){var n=t(),a=o(n),e=r(a,2),i=e[0],u=e[1];return{id:i,update:function(){return u(Math.random().toString())}}};export{n as useRerender};
|
|
3
3
|
//# sourceMappingURL=useRerender.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as r}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as t,useEffect as e}from"react";var n="script-status",o=function(o){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=t((function(){var r=document.querySelector('script[src="'.concat(o,'"]')),t=null==r?void 0:r.getAttribute(n);return t||(r?"unknown":"loading")})),c=r(u,2),a=c[0],s=c[1],d=i.removeOnUnmount,v=void 0===d||d,l=i.async,m=void 0===l||l;return e((function(){var t=document.querySelector('script[src="'.concat(o,'"]')),e=null==t?void 0:t.getAttribute(n);if(e)return s(e);if(t)return s("unknown");var u=document.createElement("script");u.src=o,u.async=m;for(var c=0,a=Object.entries(i);c<a.length;c++){var d=r(a[c],2),l=d[0],f=d[1];u.setAttribute(l,String(f))}u.setAttribute(n,"loading"),document.body.appendChild(u);var p=function(){u.setAttribute(n,"ready"),s("ready")},b=function(){u.setAttribute(n,"error"),s("error")};return u.addEventListener("load",p),u.addEventListener("error",b),function(){v&&(u.remove(),u.removeEventListener("load",p),u.removeEventListener("error",b))}}),[o,v]),a};export{n as SCRIPT_STATUS_ATTRIBUTE_NAME,o as useScript};
|
|
3
3
|
//# sourceMappingURL=useScript.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{b as o}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{b as o}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useStorage as e}from"../useStorage/useStorage.js";import"react";import"../../utils/helpers/isClient.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var r=function(r,t,s){return e(r,o({initialValue:t,storage:window.sessionStorage},s))};export{r as useSessionStorage};
|
|
3
3
|
//# sourceMappingURL=useSessionStorage.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as n}from"react";var r=function(r){var t=n(new Set(r)),u=e(t,2),i=u[0],f=u[1];return{value:i,size:i.size,has:function(e){return i.has(e)},add:function(e){return f((function(n){return new Set(n).add(e)}))},remove:function(e){return f((function(n){if(!n.has(e))return n;var r=new Set(n);return r.delete(e),r}))},clear:function(){return f(new Set)},reset:function(){return f(new Set(r))},toggle:function(e){return f((function(n){if(!n.has(e))return new Set(n).add(e);var r=new Set(n);return r.delete(e),r}))},union:function(e){return f(i.union(e))},difference:function(e){return f(i.difference(e))},symmetricDifference:function(e){return f(i.symmetricDifference(e))},intersection:function(e){return f(i.intersection(e))}}};export{r as useSet};
|
|
3
3
|
//# sourceMappingURL=useSet.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{a as t,_ as r}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{a as t,_ as r}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useRef as n,useState as e}from"react";var i=function(i){var u="object"===t(i)?i.max:i,o="object"===t(i)?i.initial:1,c=n(o>u||o<1?1:o),s=e(o),a=r(s,2),f=a[0],l=a[1],p=1===f,m=f===u;return{counts:u,currentStep:f,isFirst:p,isLast:m,next:function(){m||l((function(t){return t+1}))},back:function(){p||l((function(t){return t-1}))},reset:function(){return l(c.current)},set:function(t){return"first"===t?l(c.current):"last"===t||t>=u?l(u):t<=1?l(1):void l(t)}}};export{i as useStep};
|
|
3
3
|
//# sourceMappingURL=useStep.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{a as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{a as e}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useSyncExternalStore as n}from"react";import{isClient as t}from"../../utils/helpers/isClient.js";import{useIsomorphicLayoutEffect as r}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var i=function(e){return window.dispatchEvent(new StorageEvent("storage",e))},o=function(e,n,t){var r=e.getItem(n);e.setItem(n,t),i({key:n,oldValue:r,newValue:t,storageArea:e})},u=function(e,n){var t=e.getItem(n);e.removeItem(n),i({key:n,oldValue:t,newValue:null,storageArea:e})},a=function(e,n){var t=e.getItem(n);if(t)return t},l=function(e){return window.addEventListener("storage",e),function(){return window.removeEventListener("storage",e)}},f=function(){},s=function(i,s){var c,d="object"===e(s)?s:void 0,v=d?null==d?void 0:d.initialValue:s,m=null!==(c=null==d?void 0:d.storage)&&void 0!==c?c:window.localStorage,g=function(e){return null!=d&&d.serializer?d.serializer(e):JSON.stringify(e)},p=n(l,(function(){return a(m,i)}),f),w=function(e){if(null===e)return u(m,i);o(m,i,g(e))};r((function(){(void 0===a(m,i)||v)&&o(m,i,g(v instanceof Function?v():v))}),[i]);var I=function(){return u(m,i)};return t?[p?function(e){if(null!=d&&d.deserializer)return d.deserializer(e);if("undefined"!==e)try{return JSON.parse(e)}catch(n){return e}}(p):void 0,w,I]:[v instanceof Function?v():v,w,I]};export{i as dispatchStorageEvent,s as useStorage};
|
|
3
3
|
//# sourceMappingURL=useStorage.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as n,useEffect as t}from"react";import{isClient as r}from"../../utils/helpers/isClient.js";import{useRerender as o}from"../useRerender/useRerender.js";var u=function(e){var n,t=null!==(n=e.rangeCount)&&void 0!==n?n:0;return Array.from({length:t},(function(n,t){return e.getRangeAt(t)}))},i=function(){var i,l=o(),c=n(r?document.getSelection():null),a=e(c,2),s=a[0],m=a[1];t((function(){var e=function(){m(document.getSelection()),l.update()};return document.addEventListener("selectionchange",e),function(){return document.removeEventListener("selectionchange",e)}}),[]);var d=null!==(i=null==s?void 0:s.toString())&&void 0!==i?i:"",g=s?u(s):[],f=g.map((function(e){return e.getBoundingClientRect()}));return{text:d,ranges:g,rects:f,selection:s}};export{u as getRangesSelection,i as useTextSelection};
|
|
3
3
|
//# sourceMappingURL=useTextSelection.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.37 */
|
|
2
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-BUclQybi.js";import{useState as r}from"react";import"../../utils/helpers/isClient.js";import{getDate as t}from"../../utils/helpers/time/getDate.js";import{useInterval as o}from"../useInterval/useInterval.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var s=function(){var s=r(t()),i=e(s,2),u=i[0],m=i[1];return o((function(){return m(t())}),1e3),u};export{s as useTime};
|
|
3
3
|
//# sourceMappingURL=useTime.js.map
|