@siberiacancode/reactuse 0.0.30 → 0.0.32

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.
Files changed (284) hide show
  1. package/dist/cjs/{_rollupPluginBabelHelpers-B5ln7UDR.js → _rollupPluginBabelHelpers-CDDZUuwn.js} +2 -2
  2. package/dist/cjs/_rollupPluginBabelHelpers-CDDZUuwn.js.map +1 -0
  3. package/dist/cjs/hooks/index.js +2 -2
  4. package/dist/cjs/hooks/useBattery/useBattery.js +2 -2
  5. package/dist/cjs/hooks/useBattery/useBattery.js.map +1 -1
  6. package/dist/cjs/hooks/useBoolean/useBoolean.js +2 -2
  7. package/dist/cjs/hooks/useBoolean/useBoolean.js.map +1 -1
  8. package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
  9. package/dist/cjs/hooks/useClickOutside/useClickOutside.js +1 -1
  10. package/dist/cjs/hooks/useClickOutside/useClickOutside.js.map +1 -1
  11. package/dist/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  12. package/dist/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js.map +1 -1
  13. package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
  14. package/dist/cjs/hooks/useCounter/useCounter.js.map +1 -1
  15. package/dist/cjs/hooks/useDebouncedCallback/useDebouncedCallback.js +3 -0
  16. package/dist/cjs/hooks/useDebouncedCallback/useDebouncedCallback.js.map +1 -0
  17. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  18. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js.map +1 -1
  19. package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
  20. package/dist/cjs/hooks/useDefault/useDefault.js.map +1 -1
  21. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
  22. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js.map +1 -1
  23. package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
  24. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  25. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js.map +1 -1
  26. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  27. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js.map +1 -1
  28. package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
  29. package/dist/cjs/hooks/useEvent/useEvent.js.map +1 -1
  30. package/dist/cjs/hooks/useEventListener/useEventListener.js +1 -1
  31. package/dist/cjs/hooks/useEventListener/useEventListener.js.map +1 -1
  32. package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
  33. package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js.map +1 -1
  34. package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
  35. package/dist/cjs/hooks/useFavicon/useFavicon.js.map +1 -1
  36. package/dist/cjs/hooks/useField/useField.js +2 -2
  37. package/dist/cjs/hooks/useField/useField.js.map +1 -1
  38. package/dist/cjs/hooks/useFps/useFps.js +2 -2
  39. package/dist/cjs/hooks/useFps/useFps.js.map +1 -1
  40. package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
  41. package/dist/cjs/hooks/useFullscreen/useFullscreen.js.map +1 -1
  42. package/dist/cjs/hooks/useHash/useHash.js +2 -2
  43. package/dist/cjs/hooks/useHash/useHash.js.map +1 -1
  44. package/dist/cjs/hooks/useHotkeys/useHotkeys.js +2 -2
  45. package/dist/cjs/hooks/useHotkeys/useHotkeys.js.map +1 -1
  46. package/dist/cjs/hooks/useHover/useHover.js +2 -2
  47. package/dist/cjs/hooks/useHover/useHover.js.map +1 -1
  48. package/dist/cjs/hooks/useIdle/useIdle.js +2 -2
  49. package/dist/cjs/hooks/useIdle/useIdle.js.map +1 -1
  50. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  51. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
  52. package/dist/cjs/hooks/useInterval/useInterval.js +2 -2
  53. package/dist/cjs/hooks/useInterval/useInterval.js.map +1 -1
  54. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  55. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js.map +1 -1
  56. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  57. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js.map +1 -1
  58. package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
  59. package/dist/cjs/hooks/useKeyPress/useKeyPress.js.map +1 -1
  60. package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  61. package/dist/cjs/hooks/useKeyboard/useKeyboard.js +1 -1
  62. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
  63. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
  64. package/dist/cjs/hooks/useList/useList.js +2 -2
  65. package/dist/cjs/hooks/useList/useList.js.map +1 -1
  66. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
  67. package/dist/cjs/hooks/useLogger/useLogger.js +2 -2
  68. package/dist/cjs/hooks/useLogger/useLogger.js.map +1 -1
  69. package/dist/cjs/hooks/useLongPress/useLongPress.js +2 -2
  70. package/dist/cjs/hooks/useLongPress/useLongPress.js.map +1 -1
  71. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +1 -1
  72. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js.map +1 -1
  73. package/dist/cjs/hooks/useMount/useMount.js +1 -1
  74. package/dist/cjs/hooks/useMount/useMount.js.map +1 -1
  75. package/dist/cjs/hooks/useMouse/useMouse.js +2 -2
  76. package/dist/cjs/hooks/useMouse/useMouse.js.map +1 -1
  77. package/dist/cjs/hooks/useMutation/useMutation.js +2 -2
  78. package/dist/cjs/hooks/useMutation/useMutation.js.map +1 -1
  79. package/dist/cjs/hooks/useMutationObserver.js +1 -1
  80. package/dist/cjs/hooks/useMutationObserver.js.map +1 -1
  81. package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
  82. package/dist/cjs/hooks/useNetwork/useNetwork.js.map +1 -1
  83. package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
  84. package/dist/cjs/hooks/useOnline/useOnline.js.map +1 -1
  85. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  86. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js.map +1 -1
  87. package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
  88. package/dist/cjs/hooks/useOrientation/useOrientation.js.map +1 -1
  89. package/dist/cjs/hooks/usePageLeave/usePageLeave.js +2 -2
  90. package/dist/cjs/hooks/usePageLeave/usePageLeave.js.map +1 -1
  91. package/dist/cjs/hooks/usePaint/usePaint.js +2 -2
  92. package/dist/cjs/hooks/usePaint/usePaint.js.map +1 -1
  93. package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  94. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
  95. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js.map +1 -1
  96. package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
  97. package/dist/cjs/hooks/usePrevious/usePrevious.js.map +1 -1
  98. package/dist/cjs/hooks/useQRCode/useQRCode.js +2 -2
  99. package/dist/cjs/hooks/useQRCode/useQRCode.js.map +1 -1
  100. package/dist/cjs/hooks/useQuery/useQuery.js +2 -2
  101. package/dist/cjs/hooks/useQuery/useQuery.js.map +1 -1
  102. package/dist/cjs/hooks/useQueue/useQueue.js +2 -2
  103. package/dist/cjs/hooks/useQueue/useQueue.js.map +1 -1
  104. package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
  105. package/dist/cjs/hooks/useRenderCount/useRenderCount.js.map +1 -1
  106. package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js +1 -1
  107. package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js.map +1 -1
  108. package/dist/cjs/hooks/useRerender/useRerender.js +2 -2
  109. package/dist/cjs/hooks/useRerender/useRerender.js.map +1 -1
  110. package/dist/cjs/hooks/useScript/useScript.js +2 -2
  111. package/dist/cjs/hooks/useScript/useScript.js.map +1 -1
  112. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
  113. package/dist/cjs/hooks/useSet/useSet.js +2 -2
  114. package/dist/cjs/hooks/useSet/useSet.js.map +1 -1
  115. package/dist/cjs/hooks/useStep/useStep.js +2 -2
  116. package/dist/cjs/hooks/useStep/useStep.js.map +1 -1
  117. package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
  118. package/dist/cjs/hooks/useStorage/useStorage.js.map +1 -1
  119. package/dist/cjs/hooks/useTextSelection/useTextSelection.js +2 -2
  120. package/dist/cjs/hooks/useTextSelection/useTextSelection.js.map +1 -1
  121. package/dist/cjs/hooks/useTime/useTime.js +2 -2
  122. package/dist/cjs/hooks/useTime/useTime.js.map +1 -1
  123. package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
  124. package/dist/cjs/hooks/useTimeout/useTimeout.js.map +1 -1
  125. package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
  126. package/dist/cjs/hooks/useToggle/useToggle.js.map +1 -1
  127. package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
  128. package/dist/cjs/hooks/useUnmount/useUnmount.js.map +1 -1
  129. package/dist/cjs/hooks/useWebSocket/useWebSocket.js +2 -2
  130. package/dist/cjs/hooks/useWebSocket/useWebSocket.js.map +1 -1
  131. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +1 -1
  132. package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
  133. package/dist/cjs/hooks/useWindowSize/useWindowSize.js.map +1 -1
  134. package/dist/cjs/index.js +2 -2
  135. package/dist/cjs/utils/helpers/debounce.js +1 -1
  136. package/dist/cjs/utils/helpers/getRetry.js +1 -1
  137. package/dist/cjs/utils/helpers/index.js +1 -1
  138. package/dist/cjs/utils/helpers/isClient.js +1 -1
  139. package/dist/cjs/utils/helpers/throttle.js +1 -1
  140. package/dist/cjs/utils/helpers/time/getDate.js +1 -1
  141. package/dist/esm/{_rollupPluginBabelHelpers-BO0nvURb.js → _rollupPluginBabelHelpers-MCjhm_0B.js} +2 -2
  142. package/dist/esm/_rollupPluginBabelHelpers-MCjhm_0B.js.map +1 -0
  143. package/dist/esm/hooks/index.js +2 -2
  144. package/dist/esm/hooks/useBattery/useBattery.js +2 -2
  145. package/dist/esm/hooks/useBattery/useBattery.js.map +1 -1
  146. package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
  147. package/dist/esm/hooks/useBoolean/useBoolean.js.map +1 -1
  148. package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
  149. package/dist/esm/hooks/useClickOutside/useClickOutside.js +2 -2
  150. package/dist/esm/hooks/useClickOutside/useClickOutside.js.map +1 -1
  151. package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  152. package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js.map +1 -1
  153. package/dist/esm/hooks/useCounter/useCounter.js +2 -2
  154. package/dist/esm/hooks/useCounter/useCounter.js.map +1 -1
  155. package/dist/esm/hooks/useDebouncedCallback/useDebouncedCallback.js +3 -0
  156. package/dist/esm/hooks/useDebouncedCallback/useDebouncedCallback.js.map +1 -0
  157. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  158. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js.map +1 -1
  159. package/dist/esm/hooks/useDefault/useDefault.js +2 -2
  160. package/dist/esm/hooks/useDefault/useDefault.js.map +1 -1
  161. package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +2 -2
  162. package/dist/esm/hooks/useDidUpdate/useDidUpdate.js.map +1 -1
  163. package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
  164. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  165. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js.map +1 -1
  166. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +2 -2
  167. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js.map +1 -1
  168. package/dist/esm/hooks/useEvent/useEvent.js +2 -2
  169. package/dist/esm/hooks/useEvent/useEvent.js.map +1 -1
  170. package/dist/esm/hooks/useEventListener/useEventListener.js +2 -2
  171. package/dist/esm/hooks/useEventListener/useEventListener.js.map +1 -1
  172. package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
  173. package/dist/esm/hooks/useEyeDropper/useEyeDropper.js.map +1 -1
  174. package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
  175. package/dist/esm/hooks/useFavicon/useFavicon.js.map +1 -1
  176. package/dist/esm/hooks/useField/useField.js +2 -2
  177. package/dist/esm/hooks/useField/useField.js.map +1 -1
  178. package/dist/esm/hooks/useFps/useFps.js +2 -2
  179. package/dist/esm/hooks/useFps/useFps.js.map +1 -1
  180. package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
  181. package/dist/esm/hooks/useFullscreen/useFullscreen.js.map +1 -1
  182. package/dist/esm/hooks/useHash/useHash.js +2 -2
  183. package/dist/esm/hooks/useHash/useHash.js.map +1 -1
  184. package/dist/esm/hooks/useHotkeys/useHotkeys.js +2 -2
  185. package/dist/esm/hooks/useHotkeys/useHotkeys.js.map +1 -1
  186. package/dist/esm/hooks/useHover/useHover.js +2 -2
  187. package/dist/esm/hooks/useHover/useHover.js.map +1 -1
  188. package/dist/esm/hooks/useIdle/useIdle.js +2 -2
  189. package/dist/esm/hooks/useIdle/useIdle.js.map +1 -1
  190. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  191. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
  192. package/dist/esm/hooks/useInterval/useInterval.js +2 -2
  193. package/dist/esm/hooks/useInterval/useInterval.js.map +1 -1
  194. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +2 -2
  195. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js.map +1 -1
  196. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +2 -2
  197. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js.map +1 -1
  198. package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
  199. package/dist/esm/hooks/useKeyPress/useKeyPress.js.map +1 -1
  200. package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  201. package/dist/esm/hooks/useKeyboard/useKeyboard.js +1 -1
  202. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
  203. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
  204. package/dist/esm/hooks/useList/useList.js +2 -2
  205. package/dist/esm/hooks/useList/useList.js.map +1 -1
  206. package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
  207. package/dist/esm/hooks/useLogger/useLogger.js +2 -2
  208. package/dist/esm/hooks/useLogger/useLogger.js.map +1 -1
  209. package/dist/esm/hooks/useLongPress/useLongPress.js +2 -2
  210. package/dist/esm/hooks/useLongPress/useLongPress.js.map +1 -1
  211. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +2 -2
  212. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js.map +1 -1
  213. package/dist/esm/hooks/useMount/useMount.js +2 -2
  214. package/dist/esm/hooks/useMount/useMount.js.map +1 -1
  215. package/dist/esm/hooks/useMouse/useMouse.js +2 -2
  216. package/dist/esm/hooks/useMouse/useMouse.js.map +1 -1
  217. package/dist/esm/hooks/useMutation/useMutation.js +2 -2
  218. package/dist/esm/hooks/useMutation/useMutation.js.map +1 -1
  219. package/dist/esm/hooks/useMutationObserver.js +2 -2
  220. package/dist/esm/hooks/useMutationObserver.js.map +1 -1
  221. package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
  222. package/dist/esm/hooks/useNetwork/useNetwork.js.map +1 -1
  223. package/dist/esm/hooks/useOnline/useOnline.js +2 -2
  224. package/dist/esm/hooks/useOnline/useOnline.js.map +1 -1
  225. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +2 -2
  226. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js.map +1 -1
  227. package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
  228. package/dist/esm/hooks/useOrientation/useOrientation.js.map +1 -1
  229. package/dist/esm/hooks/usePageLeave/usePageLeave.js +2 -2
  230. package/dist/esm/hooks/usePageLeave/usePageLeave.js.map +1 -1
  231. package/dist/esm/hooks/usePaint/usePaint.js +2 -2
  232. package/dist/esm/hooks/usePaint/usePaint.js.map +1 -1
  233. package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  234. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +2 -2
  235. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js.map +1 -1
  236. package/dist/esm/hooks/usePrevious/usePrevious.js +2 -2
  237. package/dist/esm/hooks/usePrevious/usePrevious.js.map +1 -1
  238. package/dist/esm/hooks/useQRCode/useQRCode.js +2 -2
  239. package/dist/esm/hooks/useQRCode/useQRCode.js.map +1 -1
  240. package/dist/esm/hooks/useQuery/useQuery.js +2 -2
  241. package/dist/esm/hooks/useQuery/useQuery.js.map +1 -1
  242. package/dist/esm/hooks/useQueue/useQueue.js +2 -2
  243. package/dist/esm/hooks/useQueue/useQueue.js.map +1 -1
  244. package/dist/esm/hooks/useRenderCount/useRenderCount.js +2 -2
  245. package/dist/esm/hooks/useRenderCount/useRenderCount.js.map +1 -1
  246. package/dist/esm/hooks/useRenderInfo/useRenderInfo.js +2 -2
  247. package/dist/esm/hooks/useRenderInfo/useRenderInfo.js.map +1 -1
  248. package/dist/esm/hooks/useRerender/useRerender.js +2 -2
  249. package/dist/esm/hooks/useRerender/useRerender.js.map +1 -1
  250. package/dist/esm/hooks/useScript/useScript.js +2 -2
  251. package/dist/esm/hooks/useScript/useScript.js.map +1 -1
  252. package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
  253. package/dist/esm/hooks/useSet/useSet.js +2 -2
  254. package/dist/esm/hooks/useSet/useSet.js.map +1 -1
  255. package/dist/esm/hooks/useStep/useStep.js +2 -2
  256. package/dist/esm/hooks/useStep/useStep.js.map +1 -1
  257. package/dist/esm/hooks/useStorage/useStorage.js +2 -2
  258. package/dist/esm/hooks/useStorage/useStorage.js.map +1 -1
  259. package/dist/esm/hooks/useTextSelection/useTextSelection.js +2 -2
  260. package/dist/esm/hooks/useTextSelection/useTextSelection.js.map +1 -1
  261. package/dist/esm/hooks/useTime/useTime.js +2 -2
  262. package/dist/esm/hooks/useTime/useTime.js.map +1 -1
  263. package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
  264. package/dist/esm/hooks/useTimeout/useTimeout.js.map +1 -1
  265. package/dist/esm/hooks/useToggle/useToggle.js +2 -2
  266. package/dist/esm/hooks/useToggle/useToggle.js.map +1 -1
  267. package/dist/esm/hooks/useUnmount/useUnmount.js +2 -2
  268. package/dist/esm/hooks/useUnmount/useUnmount.js.map +1 -1
  269. package/dist/esm/hooks/useWebSocket/useWebSocket.js +2 -2
  270. package/dist/esm/hooks/useWebSocket/useWebSocket.js.map +1 -1
  271. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +1 -1
  272. package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
  273. package/dist/esm/hooks/useWindowSize/useWindowSize.js.map +1 -1
  274. package/dist/esm/index.js +2 -2
  275. package/dist/esm/utils/helpers/debounce.js +1 -1
  276. package/dist/esm/utils/helpers/getRetry.js +1 -1
  277. package/dist/esm/utils/helpers/index.js +1 -1
  278. package/dist/esm/utils/helpers/isClient.js +1 -1
  279. package/dist/esm/utils/helpers/throttle.js +1 -1
  280. package/dist/esm/utils/helpers/time/getDate.js +1 -1
  281. package/dist/index.d.ts +50 -42
  282. package/package.json +1 -1
  283. package/dist/cjs/_rollupPluginBabelHelpers-B5ln7UDR.js.map +0 -1
  284. package/dist/esm/_rollupPluginBabelHelpers-BO0nvURb.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useScript.js","sources":["../../../../src/hooks/useScript/useScript.ts"],"sourcesContent":["import React from 'react';\n\n/** The use script status */\nexport type UseScriptStatus = 'loading' | 'ready' | 'error' | 'unknown';\nexport const SCRIPT_STATUS_ATTRIBUTE_NAME = 'script-status';\n\n/** The use script options extends from attributes script tag */\nexport interface UseScriptOptions extends React.ComponentProps<'script'> {\n /** Whether to remove the script on unmount */\n removeOnUnmount?: boolean;\n}\n\n/**\n * @name useScript\n * @description - Hook that manages a script with onLoad, onError, and removeOnUnmount functionalities\n *\n * @param {string} src The source of the script\n * @param {UseScriptOptions} [options] The options of the script extends from attributes script tag\n * @param {boolean} [options.removeOnUnmount=true] Whether to remove the script on unmount\n * @param {boolean} [options.async=true] Whether to load the script asynchronously\n * @returns {UseScriptStatus} The status of the script\n *\n * @example\n * const status = useScript('https://example.com/script.js');\n */\nexport const useScript = (src: string, options: UseScriptOptions = {}) => {\n const [status, setStatus] = React.useState<UseScriptStatus>(() => {\n const script = document.querySelector(`script[src=\"${src}\"]`) as HTMLScriptElement;\n const scriptStatus = script?.getAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME) as UseScriptStatus;\n if (scriptStatus) return scriptStatus;\n if (script) return 'unknown';\n\n return 'loading';\n });\n const { removeOnUnmount = true, async = true } = options;\n\n React.useEffect(() => {\n const existedScript = document.querySelector(`script[src=\"${src}\"]`) as HTMLScriptElement;\n const scriptStatus = existedScript?.getAttribute(\n SCRIPT_STATUS_ATTRIBUTE_NAME\n ) as UseScriptStatus;\n if (scriptStatus) return setStatus(scriptStatus);\n if (existedScript) return setStatus('unknown');\n\n const script = document.createElement('script');\n script.src = src;\n script.async = async;\n\n for (const [key, value] of Object.entries(options)) {\n script.setAttribute(key, String(value));\n }\n\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'loading');\n document.body.appendChild(script);\n\n const onLoad = () => {\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'ready');\n setStatus('ready');\n };\n\n const onError = () => {\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'error');\n setStatus('error');\n };\n\n const removeEventListeners = () => {\n script.removeEventListener('load', onLoad);\n script.removeEventListener('error', onError);\n };\n\n script.addEventListener('load', onLoad);\n script.addEventListener('error', onError);\n\n return () => {\n if (removeOnUnmount) {\n script.remove();\n removeEventListeners();\n }\n };\n }, [src, removeOnUnmount]);\n\n return status;\n};\n"],"names":["SCRIPT_STATUS_ATTRIBUTE_NAME","useScript","src","options","arguments","length","undefined","_React$useState","React","useState","script","document","querySelector","concat","scriptStatus","getAttribute","_React$useState2","_slicedToArray","status","setStatus","_options$removeOnUnmo","removeOnUnmount","_options$async","async","useEffect","existedScript","createElement","_i","_Object$entries","Object","entries","_Object$entries$_i","key","value","setAttribute","String","body","appendChild","onLoad","onError","addEventListener","remove","removeEventListener"],"mappings":";qFAIO,IAAMA,EAA+B,gBAqB/BC,EAAY,SAACC,GAAgD,IAAnCC,EAAyBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAA,EACjEG,EAA4BC,EAAMC,UAA0B,WAC1D,IAAMC,EAASC,SAASC,6BAAaC,OAAgBX,EAAG,OAClDY,EAAeJ,aAAAA,EAAAA,EAAQK,aAAaf,GAC1C,OAAIc,IACAJ,EAAe,UAEZ,UACT,IAAEM,EAAAC,EAAAV,EAAA,GAPKW,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAQxBI,EAAiDjB,EAAzCkB,gBAAAA,OAAkB,IAAHD,GAAOA,EAAAE,EAAmBnB,EAAjBoB,MAAAA,OAAQ,IAAHD,GAAOA,EA+C5C,OA7CAd,EAAMgB,WAAU,WACd,IAAMC,EAAgBd,SAASC,6BAAaC,OAAgBX,EAAG,OACzDY,EAAeW,aAAAA,EAAAA,EAAeV,aAClCf,GAEF,GAAIc,EAAc,OAAOK,EAAUL,GACnC,GAAIW,EAAe,OAAON,EAAU,WAEpC,IAAMT,EAASC,SAASe,cAAc,UACtChB,EAAOR,IAAMA,EACbQ,EAAOa,MAAQA,EAEf,IAAA,IAAAI,EAAAC,EAAAA,EAA2BC,OAAOC,QAAQ3B,GAAQwB,EAAAC,EAAAvB,OAAAsB,IAAE,CAA/C,IAAAI,EAAAd,EAAAW,EAAAD,GAAA,GAAOK,EAAGD,EAAA,GAAEE,EAAKF,EAAA,GACpBrB,EAAOwB,aAAaF,EAAKG,OAAOF,GAClC,CAEAvB,EAAOwB,aAAalC,EAA8B,WAClDW,SAASyB,KAAKC,YAAY3B,GAE1B,IAAM4B,EAAS,WACb5B,EAAOwB,aAAalC,EAA8B,SAClDmB,EAAU,UAGNoB,EAAU,WACd7B,EAAOwB,aAAalC,EAA8B,SAClDmB,EAAU,UAWZ,OAHAT,EAAO8B,iBAAiB,OAAQF,GAChC5B,EAAO8B,iBAAiB,QAASD,GAE1B,WACDlB,IACFX,EAAO+B,SATT/B,EAAOgC,oBAAoB,OAAQJ,GACnC5B,EAAOgC,oBAAoB,QAASH,IAYxC,GAAG,CAACrC,EAAKmB,IAEFH,CACT"}
1
+ {"version":3,"file":"useScript.js","sources":["../../../../src/hooks/useScript/useScript.ts"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { useEffect, useState } from 'react';\n\n/** The use script status */\nexport type UseScriptStatus = 'loading' | 'ready' | 'error' | 'unknown';\nexport const SCRIPT_STATUS_ATTRIBUTE_NAME = 'script-status';\n\n/** The use script options extends from attributes script tag */\nexport interface UseScriptOptions extends ComponentProps<'script'> {\n /** Whether to remove the script on unmount */\n removeOnUnmount?: boolean;\n}\n\n/**\n * @name useScript\n * @description - Hook that manages a script with onLoad, onError, and removeOnUnmount functionalities\n *\n * @param {string} src The source of the script\n * @param {UseScriptOptions} [options] The options of the script extends from attributes script tag\n * @param {boolean} [options.removeOnUnmount=true] Whether to remove the script on unmount\n * @param {boolean} [options.async=true] Whether to load the script asynchronously\n * @returns {UseScriptStatus} The status of the script\n *\n * @example\n * const status = useScript('https://example.com/script.js');\n */\nexport const useScript = (src: string, options: UseScriptOptions = {}) => {\n const [status, setStatus] = useState<UseScriptStatus>(() => {\n const script = document.querySelector(`script[src=\"${src}\"]`) as HTMLScriptElement;\n const scriptStatus = script?.getAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME) as UseScriptStatus;\n if (scriptStatus) return scriptStatus;\n if (script) return 'unknown';\n\n return 'loading';\n });\n const { removeOnUnmount = true, async = true } = options;\n\n useEffect(() => {\n const existedScript = document.querySelector(`script[src=\"${src}\"]`) as HTMLScriptElement;\n const scriptStatus = existedScript?.getAttribute(\n SCRIPT_STATUS_ATTRIBUTE_NAME\n ) as UseScriptStatus;\n if (scriptStatus) return setStatus(scriptStatus);\n if (existedScript) return setStatus('unknown');\n\n const script = document.createElement('script');\n script.src = src;\n script.async = async;\n\n for (const [key, value] of Object.entries(options)) {\n script.setAttribute(key, String(value));\n }\n\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'loading');\n document.body.appendChild(script);\n\n const onLoad = () => {\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'ready');\n setStatus('ready');\n };\n\n const onError = () => {\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'error');\n setStatus('error');\n };\n\n const removeEventListeners = () => {\n script.removeEventListener('load', onLoad);\n script.removeEventListener('error', onError);\n };\n\n script.addEventListener('load', onLoad);\n script.addEventListener('error', onError);\n\n return () => {\n if (removeOnUnmount) {\n script.remove();\n removeEventListeners();\n }\n };\n }, [src, removeOnUnmount]);\n\n return status;\n};\n"],"names":["SCRIPT_STATUS_ATTRIBUTE_NAME","useScript","src","options","arguments","length","undefined","_useState","useState","script","document","querySelector","concat","scriptStatus","getAttribute","_useState2","_slicedToArray","status","setStatus","_options$removeOnUnmo","removeOnUnmount","_options$async","async","useEffect","existedScript","createElement","_i","_Object$entries","Object","entries","_Object$entries$_i","key","value","setAttribute","String","body","appendChild","onLoad","onError","addEventListener","remove","removeEventListener"],"mappings":";gHAKO,IAAMA,EAA+B,gBAqB/BC,EAAY,SAACC,GAAgD,IAAnCC,EAAyBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAA,EACjEG,EAA4BC,GAA0B,WACpD,IAAMC,EAASC,SAASC,6BAAaC,OAAgBV,EAAG,OAClDW,EAAeJ,aAAAA,EAAAA,EAAQK,aAAad,GAC1C,OAAIa,IACAJ,EAAe,UAEZ,UACT,IAAEM,EAAAC,EAAAT,EAAA,GAPKU,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAQxBI,EAAiDhB,EAAzCiB,gBAAAA,OAAkB,IAAHD,GAAOA,EAAAE,EAAmBlB,EAAjBmB,MAAAA,OAAQ,IAAHD,GAAOA,EA+C5C,OA7CAE,GAAU,WACR,IAAMC,EAAgBd,SAASC,6BAAaC,OAAgBV,EAAG,OACzDW,EAAeW,aAAAA,EAAAA,EAAeV,aAClCd,GAEF,GAAIa,EAAc,OAAOK,EAAUL,GACnC,GAAIW,EAAe,OAAON,EAAU,WAEpC,IAAMT,EAASC,SAASe,cAAc,UACtChB,EAAOP,IAAMA,EACbO,EAAOa,MAAQA,EAEf,IAAA,IAAAI,EAAAC,EAAAA,EAA2BC,OAAOC,QAAQ1B,GAAQuB,EAAAC,EAAAtB,OAAAqB,IAAE,CAA/C,IAAAI,EAAAd,EAAAW,EAAAD,GAAA,GAAOK,EAAGD,EAAA,GAAEE,EAAKF,EAAA,GACpBrB,EAAOwB,aAAaF,EAAKG,OAAOF,GAClC,CAEAvB,EAAOwB,aAAajC,EAA8B,WAClDU,SAASyB,KAAKC,YAAY3B,GAE1B,IAAM4B,EAAS,WACb5B,EAAOwB,aAAajC,EAA8B,SAClDkB,EAAU,UAGNoB,EAAU,WACd7B,EAAOwB,aAAajC,EAA8B,SAClDkB,EAAU,UAWZ,OAHAT,EAAO8B,iBAAiB,OAAQF,GAChC5B,EAAO8B,iBAAiB,QAASD,GAE1B,WACDlB,IACFX,EAAO+B,SATT/B,EAAOgC,oBAAoB,OAAQJ,GACnC5B,EAAOgC,oBAAoB,QAASH,IAYxC,GAAG,CAACpC,EAAKkB,IAEFH,CACT"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{b as o}from"../../_rollupPluginBabelHelpers-BO0nvURb.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};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{b as o}from"../../_rollupPluginBabelHelpers-MCjhm_0B.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.30 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import n from"react";var r=function(r){var t=n.useState(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};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-MCjhm_0B.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 +1 @@
1
- {"version":3,"file":"useSet.js","sources":["../../../../src/hooks/useSet/useSet.ts"],"sourcesContent":["import React from 'react';\n\ndeclare global {\n interface Set<T> {\n union(other: Set<T>): Set<T>;\n difference(other: Set<T>): Set<T>;\n symmetricDifference(other: Set<T>): Set<T>;\n intersection(other: Set<T>): Set<T>;\n isDisjointFrom(other: Set<T>): boolean;\n isSubsetOf(other: Set<T>): boolean;\n isSupersetOf(other: Set<T>): boolean;\n }\n}\n\n/** The use set return type */\ninterface UseSetReturn<Value> {\n /** The current set */\n value: Set<Value>;\n /** The size of the set */\n size: number;\n /** Function to check if a value exists in the set */\n has: (value: Value) => boolean;\n /** Function to add a value to the set */\n add: (value: Value) => void;\n /** Function to remove a value from the set */\n remove: (value: Value) => void;\n /** Function to clear the set */\n clear: () => void;\n /** Function to toggle a value in the set */\n reset: () => void;\n /** Function to toggle a value in the set */\n toggle: (value: Value) => void;\n /** Function to get the union of two sets */\n union: (other: Set<Value>) => void;\n /** Function to get the difference of two sets */\n intersection: (other: Set<Value>) => void;\n /** Function to get the symmetric difference of two sets */\n difference: (other: Set<Value>) => void;\n /** Function to get the symmetric difference of two sets */\n symmetricDifference: (other: Set<Value>) => void;\n}\n\n/**\n * @name useSet\n * @description - Hook that manages a set structure\n *\n * @template Value The type of the value\n * @param {Value[]} [values] The initial array of the set\n * @returns {UseSetReturn} An object containing the current set and functions to interact with the set\n *\n * @example\n * const { value, add, remove, clear, reset, toggle, union, intersection, difference, symmetricDifference, size, has } = useSet([1, 2, 3]);\n */\nexport const useSet = <Value>(values?: Value[]): UseSetReturn<Value> => {\n const [set, setSet] = React.useState(new Set(values));\n\n const add = (value: Value) => setSet((prevSet) => new Set(prevSet).add(value));\n const remove = (value: Value) =>\n setSet((prevSet) => {\n if (!prevSet.has(value)) return prevSet;\n const newSet = new Set(prevSet);\n newSet.delete(value);\n return newSet;\n });\n const clear = () => setSet(new Set());\n const reset = () => setSet(new Set(values));\n const toggle = (value: Value) =>\n setSet((prevSet) => {\n if (!prevSet.has(value)) return new Set(prevSet).add(value);\n const newSet = new Set(prevSet);\n newSet.delete(value);\n return newSet;\n });\n const union = (other: Set<Value>) => setSet(set.union(other));\n const difference = (other: Set<Value>) => setSet(set.difference(other));\n const symmetricDifference = (other: Set<Value>) => setSet(set.symmetricDifference(other));\n const intersection = (other: Set<Value>) => setSet(set.intersection(other));\n const has = (value: Value) => set.has(value);\n\n return {\n value: set,\n size: set.size,\n has,\n add,\n remove,\n clear,\n reset,\n toggle,\n union,\n difference,\n symmetricDifference,\n intersection\n };\n};\n"],"names":["useSet","values","_React$useState","React","useState","Set","_React$useState2","_slicedToArray","set","setSet","value","size","has","add","prevSet","remove","newSet","clear","reset","toggle","union","other","difference","symmetricDifference","intersection"],"mappings":";yFAqDaA,EAAS,SAAQC,GAC5B,IAAAC,EAAsBC,EAAMC,SAAS,IAAIC,IAAIJ,IAAQK,EAAAC,EAAAL,EAAA,GAA9CM,EAAGF,EAAA,GAAEG,EAAMH,EAAA,GAyBlB,MAAO,CACLI,MAAOF,EACPG,KAAMH,EAAIG,KACVC,IALU,SAACF,GAAY,OAAKF,EAAII,IAAIF,EAAM,EAM1CG,IA3BU,SAACH,GAAY,OAAKD,GAAO,SAACK,GAAO,OAAK,IAAIT,IAAIS,GAASD,IAAIH,KAAO,EA4B5EK,OA3Ba,SAACL,GAAY,OAC1BD,GAAO,SAACK,GACN,IAAKA,EAAQF,IAAIF,GAAQ,OAAOI,EAChC,IAAME,EAAS,IAAIX,IAAIS,GAEvB,OADAE,EAAM,OAAQN,GACPM,CACT,GAAE,EAsBFC,MArBY,WAAH,OAASR,EAAO,IAAIJ,IAAM,EAsBnCa,MArBY,WAAH,OAAST,EAAO,IAAIJ,IAAIJ,GAAQ,EAsBzCkB,OArBa,SAACT,GAAY,OAC1BD,GAAO,SAACK,GACN,IAAKA,EAAQF,IAAIF,GAAQ,OAAO,IAAIL,IAAIS,GAASD,IAAIH,GACrD,IAAMM,EAAS,IAAIX,IAAIS,GAEvB,OADAE,EAAM,OAAQN,GACPM,CACT,GAAE,EAgBFI,MAfY,SAACC,GAAiB,OAAKZ,EAAOD,EAAIY,MAAMC,GAAO,EAgB3DC,WAfiB,SAACD,GAAiB,OAAKZ,EAAOD,EAAIc,WAAWD,GAAO,EAgBrEE,oBAf0B,SAACF,GAAiB,OAAKZ,EAAOD,EAAIe,oBAAoBF,GAAO,EAgBvFG,aAfmB,SAACH,GAAiB,OAAKZ,EAAOD,EAAIgB,aAAaH,GAAO,EAiB7E"}
1
+ {"version":3,"file":"useSet.js","sources":["../../../../src/hooks/useSet/useSet.ts"],"sourcesContent":["import { useState } from 'react';\n\ndeclare global {\n interface Set<T> {\n union(other: Set<T>): Set<T>;\n difference(other: Set<T>): Set<T>;\n symmetricDifference(other: Set<T>): Set<T>;\n intersection(other: Set<T>): Set<T>;\n isDisjointFrom(other: Set<T>): boolean;\n isSubsetOf(other: Set<T>): boolean;\n isSupersetOf(other: Set<T>): boolean;\n }\n}\n\n/** The use set return type */\ninterface UseSetReturn<Value> {\n /** The current set */\n value: Set<Value>;\n /** The size of the set */\n size: number;\n /** Function to check if a value exists in the set */\n has: (value: Value) => boolean;\n /** Function to add a value to the set */\n add: (value: Value) => void;\n /** Function to remove a value from the set */\n remove: (value: Value) => void;\n /** Function to clear the set */\n clear: () => void;\n /** Function to toggle a value in the set */\n reset: () => void;\n /** Function to toggle a value in the set */\n toggle: (value: Value) => void;\n /** Function to get the union of two sets */\n union: (other: Set<Value>) => void;\n /** Function to get the difference of two sets */\n intersection: (other: Set<Value>) => void;\n /** Function to get the symmetric difference of two sets */\n difference: (other: Set<Value>) => void;\n /** Function to get the symmetric difference of two sets */\n symmetricDifference: (other: Set<Value>) => void;\n}\n\n/**\n * @name useSet\n * @description - Hook that manages a set structure\n *\n * @template Value The type of the value\n * @param {Value[]} [values] The initial array of the set\n * @returns {UseSetReturn} An object containing the current set and functions to interact with the set\n *\n * @example\n * const { value, add, remove, clear, reset, toggle, union, intersection, difference, symmetricDifference, size, has } = useSet([1, 2, 3]);\n */\nexport const useSet = <Value>(values?: Value[]): UseSetReturn<Value> => {\n const [set, setSet] = useState(new Set(values));\n\n const add = (value: Value) => setSet((prevSet) => new Set(prevSet).add(value));\n const remove = (value: Value) =>\n setSet((prevSet) => {\n if (!prevSet.has(value)) return prevSet;\n const newSet = new Set(prevSet);\n newSet.delete(value);\n return newSet;\n });\n const clear = () => setSet(new Set());\n const reset = () => setSet(new Set(values));\n const toggle = (value: Value) =>\n setSet((prevSet) => {\n if (!prevSet.has(value)) return new Set(prevSet).add(value);\n const newSet = new Set(prevSet);\n newSet.delete(value);\n return newSet;\n });\n const union = (other: Set<Value>) => setSet(set.union(other));\n const difference = (other: Set<Value>) => setSet(set.difference(other));\n const symmetricDifference = (other: Set<Value>) => setSet(set.symmetricDifference(other));\n const intersection = (other: Set<Value>) => setSet(set.intersection(other));\n const has = (value: Value) => set.has(value);\n\n return {\n value: set,\n size: set.size,\n has,\n add,\n remove,\n clear,\n reset,\n toggle,\n union,\n difference,\n symmetricDifference,\n intersection\n };\n};\n"],"names":["useSet","values","_useState","useState","Set","_useState2","_slicedToArray","set","setSet","value","size","has","add","prevSet","remove","newSet","clear","reset","toggle","union","other","difference","symmetricDifference","intersection"],"mappings":";qGAqDaA,EAAS,SAAQC,GAC5B,IAAAC,EAAsBC,EAAS,IAAIC,IAAIH,IAAQI,EAAAC,EAAAJ,EAAA,GAAxCK,EAAGF,EAAA,GAAEG,EAAMH,EAAA,GAyBlB,MAAO,CACLI,MAAOF,EACPG,KAAMH,EAAIG,KACVC,IALU,SAACF,GAAY,OAAKF,EAAII,IAAIF,EAAM,EAM1CG,IA3BU,SAACH,GAAY,OAAKD,GAAO,SAACK,GAAO,OAAK,IAAIT,IAAIS,GAASD,IAAIH,KAAO,EA4B5EK,OA3Ba,SAACL,GAAY,OAC1BD,GAAO,SAACK,GACN,IAAKA,EAAQF,IAAIF,GAAQ,OAAOI,EAChC,IAAME,EAAS,IAAIX,IAAIS,GAEvB,OADAE,EAAM,OAAQN,GACPM,CACT,GAAE,EAsBFC,MArBY,WAAH,OAASR,EAAO,IAAIJ,IAAM,EAsBnCa,MArBY,WAAH,OAAST,EAAO,IAAIJ,IAAIH,GAAQ,EAsBzCiB,OArBa,SAACT,GAAY,OAC1BD,GAAO,SAACK,GACN,IAAKA,EAAQF,IAAIF,GAAQ,OAAO,IAAIL,IAAIS,GAASD,IAAIH,GACrD,IAAMM,EAAS,IAAIX,IAAIS,GAEvB,OADAE,EAAM,OAAQN,GACPM,CACT,GAAE,EAgBFI,MAfY,SAACC,GAAiB,OAAKZ,EAAOD,EAAIY,MAAMC,GAAO,EAgB3DC,WAfiB,SAACD,GAAiB,OAAKZ,EAAOD,EAAIc,WAAWD,GAAO,EAgBrEE,oBAf0B,SAACF,GAAiB,OAAKZ,EAAOD,EAAIe,oBAAoBF,GAAO,EAgBvFG,aAfmB,SAACH,GAAiB,OAAKZ,EAAOD,EAAIgB,aAAaH,GAAO,EAiB7E"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{a as t,_ as r}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import n from"react";var e=function(e){var u="object"===t(e)?e.max:e,i="object"===t(e)?e.initial:1,o=n.useRef(i>u||i<1?1:i),c=n.useState(i),s=r(c,2),a=s[0],f=s[1],l=1===a,p=a===u;return{counts:u,currentStep:a,isFirst:l,isLast:p,next:function(){p||f((function(t){return t+1}))},back:function(){l||f((function(t){return t-1}))},reset:function(){return f(o.current)},set:function(t){return"first"===t?f(o.current):"last"===t||t>=u?f(u):t<=1?f(1):void f(t)}}};export{e as useStep};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{a as t,_ as r}from"../../_rollupPluginBabelHelpers-MCjhm_0B.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 +1 @@
1
- {"version":3,"file":"useStep.js","sources":["../../../../src/hooks/useStep/useStep.ts"],"sourcesContent":["import React from 'react';\n\n/** The use step params */\ninterface UseStepParams {\n /** Initial value for step */\n initial: number;\n /** Maximum value for step */\n max: number;\n}\n\n/** The use step return type */\ninterface UseStepReturn {\n /** Counts of steps */\n counts: number;\n /** Current value of step */\n currentStep: number;\n /** Boolean value if current step is first */\n isFirst: boolean;\n /** Boolean value if current step is last */\n isLast: boolean;\n /** Go to next step */\n next: () => void;\n /** Go to back step */\n back: () => void;\n /** Reset current step to initial value */\n reset: () => void;\n /** Go to custom step */\n set: (value: number | 'last' | 'first') => void;\n}\n\nconst FIRST_STEP_VALUE = 1;\n\n/**\n * @name useStep\n * @description - Hook that create stepper\n *\n * @overload\n * @param {number} max Maximum number of steps\n * @returns {UseStepReturn} An object contains variables and functions to change the step\n *\n * @example\n * const stepper = useStep(5);\n *\n * @overload\n * @param {number} params.max Maximum number of steps\n * @param {number} params.initial Initial value for step\n * @returns {UseStepReturn} An object contains variables and functions to change the step\n *\n * @example\n * const stepper = useStep({ initial: 2, max: 5 });\n */\nexport const useStep = (params: number | UseStepParams): UseStepReturn => {\n const max = typeof params === 'object' ? params.max : params;\n const initial = typeof params === 'object' ? params.initial : FIRST_STEP_VALUE;\n\n const initialStep = React.useRef(\n initial > max || initial < FIRST_STEP_VALUE ? FIRST_STEP_VALUE : initial\n );\n const [currentStep, setCurrentStep] = React.useState(initial);\n\n const isFirst = currentStep === FIRST_STEP_VALUE;\n const isLast = currentStep === max;\n\n const next = () => {\n if (isLast) return;\n setCurrentStep((prevStep) => prevStep + 1);\n };\n\n const back = () => {\n if (isFirst) return;\n setCurrentStep((prevStep) => prevStep - 1);\n };\n\n const reset = () => setCurrentStep(initialStep.current);\n\n const set = (value: number | 'last' | 'first') => {\n if (value === 'first') return setCurrentStep(initialStep.current);\n if (value === 'last') return setCurrentStep(max);\n if (value >= max) return setCurrentStep(max);\n if (value <= FIRST_STEP_VALUE) return setCurrentStep(FIRST_STEP_VALUE);\n setCurrentStep(value);\n };\n\n return {\n counts: max,\n currentStep,\n isFirst,\n isLast,\n next,\n back,\n reset,\n set\n };\n};\n"],"names":["useStep","params","max","_typeof","initial","initialStep","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","currentStep","setCurrentStep","isFirst","isLast","counts","next","prevStep","back","reset","current","set","value"],"mappings":";4FA8BA,IAqBaA,EAAU,SAACC,GACtB,IAAMC,EAAwB,WAAlBC,EAAOF,GAAsBA,EAAOC,IAAMD,EAChDG,EAA4B,WAAlBD,EAAOF,GAAsBA,EAAOG,QAvB7B,EAyBjBC,EAAcC,EAAMC,OACxBH,EAAUF,GAAOE,EA1BI,IA0B4CA,GAEnEI,EAAsCF,EAAMG,SAASL,GAAQM,EAAAC,EAAAH,EAAA,GAAtDI,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAE5BI,EA9BiB,IA8BPF,EACVG,EAASH,IAAgBV,EAsB/B,MAAO,CACLc,OAAQd,EACRU,YAAAA,EACAE,QAAAA,EACAC,OAAAA,EACAE,KAzBW,WACPF,GACJF,GAAe,SAACK,GAAQ,OAAKA,EAAW,MAwBxCC,KArBW,WACPL,GACJD,GAAe,SAACK,GAAQ,OAAKA,EAAW,MAoBxCE,MAjBY,WAAH,OAASP,EAAeR,EAAYgB,QAAQ,EAkBrDC,IAhBU,SAACC,GACX,MAAc,UAAVA,EAA0BV,EAAeR,EAAYgB,SAC3C,SAAVE,GACAA,GAASrB,EADgBW,EAAeX,GAExCqB,GAjDiB,EAiDiBV,EAjDjB,QAkDrBA,EAAeU,IAanB"}
1
+ {"version":3,"file":"useStep.js","sources":["../../../../src/hooks/useStep/useStep.ts"],"sourcesContent":["import { useRef, useState } from 'react';\n\n/** The use step params */\ninterface UseStepParams {\n /** Initial value for step */\n initial: number;\n /** Maximum value for step */\n max: number;\n}\n\n/** The use step return type */\ninterface UseStepReturn {\n /** Counts of steps */\n counts: number;\n /** Current value of step */\n currentStep: number;\n /** Boolean value if current step is first */\n isFirst: boolean;\n /** Boolean value if current step is last */\n isLast: boolean;\n /** Go to next step */\n next: () => void;\n /** Go to back step */\n back: () => void;\n /** Reset current step to initial value */\n reset: () => void;\n /** Go to custom step */\n set: (value: number | 'last' | 'first') => void;\n}\n\nconst FIRST_STEP_VALUE = 1;\n\n/**\n * @name useStep\n * @description - Hook that create stepper\n *\n * @overload\n * @param {number} max Maximum number of steps\n * @returns {UseStepReturn} An object contains variables and functions to change the step\n *\n * @example\n * const stepper = useStep(5);\n *\n * @overload\n * @param {number} params.max Maximum number of steps\n * @param {number} params.initial Initial value for step\n * @returns {UseStepReturn} An object contains variables and functions to change the step\n *\n * @example\n * const stepper = useStep({ initial: 2, max: 5 });\n */\nexport const useStep = (params: number | UseStepParams): UseStepReturn => {\n const max = typeof params === 'object' ? params.max : params;\n const initial = typeof params === 'object' ? params.initial : FIRST_STEP_VALUE;\n\n const initialStep = useRef(\n initial > max || initial < FIRST_STEP_VALUE ? FIRST_STEP_VALUE : initial\n );\n const [currentStep, setCurrentStep] = useState(initial);\n\n const isFirst = currentStep === FIRST_STEP_VALUE;\n const isLast = currentStep === max;\n\n const next = () => {\n if (isLast) return;\n setCurrentStep((prevStep) => prevStep + 1);\n };\n\n const back = () => {\n if (isFirst) return;\n setCurrentStep((prevStep) => prevStep - 1);\n };\n\n const reset = () => setCurrentStep(initialStep.current);\n\n const set = (value: number | 'last' | 'first') => {\n if (value === 'first') return setCurrentStep(initialStep.current);\n if (value === 'last') return setCurrentStep(max);\n if (value >= max) return setCurrentStep(max);\n if (value <= FIRST_STEP_VALUE) return setCurrentStep(FIRST_STEP_VALUE);\n setCurrentStep(value);\n };\n\n return {\n counts: max,\n currentStep,\n isFirst,\n isLast,\n next,\n back,\n reset,\n set\n };\n};\n"],"names":["useStep","params","max","_typeof","initial","initialStep","useRef","_useState","useState","_useState2","_slicedToArray","currentStep","setCurrentStep","isFirst","isLast","counts","next","prevStep","back","reset","current","set","value"],"mappings":";oHA8BA,IAqBaA,EAAU,SAACC,GACtB,IAAMC,EAAwB,WAAlBC,EAAOF,GAAsBA,EAAOC,IAAMD,EAChDG,EAA4B,WAAlBD,EAAOF,GAAsBA,EAAOG,QAvB7B,EAyBjBC,EAAcC,EAClBF,EAAUF,GAAOE,EA1BI,IA0B4CA,GAEnEG,EAAsCC,EAASJ,GAAQK,EAAAC,EAAAH,EAAA,GAAhDI,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAE5BI,EA9BiB,IA8BPF,EACVG,EAASH,IAAgBT,EAsB/B,MAAO,CACLa,OAAQb,EACRS,YAAAA,EACAE,QAAAA,EACAC,OAAAA,EACAE,KAzBW,WACPF,GACJF,GAAe,SAACK,GAAQ,OAAKA,EAAW,MAwBxCC,KArBW,WACPL,GACJD,GAAe,SAACK,GAAQ,OAAKA,EAAW,MAoBxCE,MAjBY,WAAH,OAASP,EAAeP,EAAYe,QAAQ,EAkBrDC,IAhBU,SAACC,GACX,MAAc,UAAVA,EAA0BV,EAAeP,EAAYe,SAC3C,SAAVE,GACAA,GAASpB,EADgBU,EAAeV,GAExCoB,GAjDiB,EAiDiBV,EAjDjB,QAkDrBA,EAAeU,IAanB"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{a as e}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import 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)}},s=function(){},f=function(i,f){var c,d="object"===e(f)?f:void 0,v=d?null==d?void 0:d.initialValue:f,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.useSyncExternalStore(l,(function(){return a(m,i)}),s),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 y=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,y]:[v instanceof Function?v():v,w,y]};export{i as dispatchStorageEvent,f as useStorage};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{a as e}from"../../_rollupPluginBabelHelpers-MCjhm_0B.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 +1 @@
1
- {"version":3,"file":"useStorage.js","sources":["../../../../src/hooks/useStorage/useStorage.ts"],"sourcesContent":["import React from 'react';\n\nimport { isClient } from '@/utils/helpers';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';\n\nexport type UseStorageInitialValue<Value> = Value | (() => Value);\nexport interface UseStorageOptions<Value> {\n serializer?: (value: Value) => string;\n deserializer?: (value: string) => Value;\n storage?: Storage;\n initialValue?: UseStorageInitialValue<Value>;\n}\n\nexport type UseStorageReturn<Value> = [\n value: Value,\n set: (value: Value) => void,\n remove: () => void\n];\n\nexport const dispatchStorageEvent = (params: Partial<StorageEvent>) =>\n window.dispatchEvent(new StorageEvent('storage', params));\n\nconst setStorageItem = (storage: Storage, key: string, value: string) => {\n const oldValue = storage.getItem(key);\n\n storage.setItem(key, value);\n dispatchStorageEvent({ key, oldValue, newValue: value, storageArea: storage });\n};\n\nconst removeStorageItem = (storage: Storage, key: string) => {\n const oldValue = storage.getItem(key);\n\n storage.removeItem(key);\n dispatchStorageEvent({ key, oldValue, newValue: null, storageArea: storage });\n};\n\nconst getStorageItem = (storage: Storage, key: string) => {\n const value = storage.getItem(key);\n if (!value) return undefined;\n return value;\n};\n\nconst storageSubscribe = (callback: () => void) => {\n window.addEventListener('storage', callback);\n return () => window.removeEventListener('storage', callback);\n};\n\nconst getServerSnapshot = () => undefined;\n\nexport const useStorage = <Value>(\n key: string,\n params?: UseStorageInitialValue<Value> | UseStorageOptions<Value>\n) => {\n const options = (typeof params === 'object' ? params : undefined) as UseStorageOptions<Value>;\n const initialValue = (options ? options?.initialValue : params) as UseStorageInitialValue<Value>;\n\n const storage = options?.storage ?? window.localStorage;\n const serializer = (value: Value) => {\n if (options?.serializer) return options.serializer(value);\n return JSON.stringify(value);\n };\n\n const deserializer = (value: string) => {\n if (options?.deserializer) return options.deserializer(value);\n\n if (value === 'undefined') {\n return undefined as unknown as Value;\n }\n\n try {\n return JSON.parse(value) as Value;\n } catch (error) {\n return value as Value;\n }\n };\n\n const getSnapshot = () => getStorageItem(storage, key);\n const store = React.useSyncExternalStore(storageSubscribe, getSnapshot, getServerSnapshot);\n\n const set = (value: Value) => {\n if (value === null) return removeStorageItem(storage, key);\n setStorageItem(storage, key, serializer(value));\n };\n\n useIsomorphicLayoutEffect(() => {\n const value = getStorageItem(storage, key);\n if (value !== undefined && !initialValue) return;\n\n setStorageItem(\n storage,\n key,\n serializer(initialValue instanceof Function ? initialValue() : initialValue)\n );\n }, [key]);\n\n const remove = () => removeStorageItem(storage, key);\n\n if (!isClient)\n return [initialValue instanceof Function ? initialValue() : initialValue, set, remove] as const;\n return [store ? deserializer(store) : undefined, set, remove] as const;\n};\n"],"names":["dispatchStorageEvent","params","window","dispatchEvent","StorageEvent","setStorageItem","storage","key","value","oldValue","getItem","setItem","newValue","storageArea","removeStorageItem","removeItem","getStorageItem","storageSubscribe","callback","addEventListener","removeEventListener","getServerSnapshot","useStorage","_options$storage","options","_typeof","undefined","initialValue","localStorage","serializer","JSON","stringify","store","React","useSyncExternalStore","set","useIsomorphicLayoutEffect","Function","remove","isClient","deserializer","parse","error"],"mappings":";0PAoBaA,EAAuB,SAACC,GAA6B,OAChEC,OAAOC,cAAc,IAAIC,aAAa,UAAWH,GAAQ,EAErDI,EAAiB,SAACC,EAAkBC,EAAaC,GACrD,IAAMC,EAAWH,EAAQI,QAAQH,GAEjCD,EAAQK,QAAQJ,EAAKC,GACrBR,EAAqB,CAAEO,IAAAA,EAAKE,SAAAA,EAAUG,SAAUJ,EAAOK,YAAaP,GACtE,EAEMQ,EAAoB,SAACR,EAAkBC,GAC3C,IAAME,EAAWH,EAAQI,QAAQH,GAEjCD,EAAQS,WAAWR,GACnBP,EAAqB,CAAEO,IAAAA,EAAKE,SAAAA,EAAUG,SAAU,KAAMC,YAAaP,GACrE,EAEMU,EAAiB,SAACV,EAAkBC,GACxC,IAAMC,EAAQF,EAAQI,QAAQH,GAC9B,GAAKC,EACL,OAAOA,CACT,EAEMS,EAAmB,SAACC,GAExB,OADAhB,OAAOiB,iBAAiB,UAAWD,GAC5B,WAAA,OAAMhB,OAAOkB,oBAAoB,UAAWF,EAAS,CAC9D,EAEMG,EAAoB,WAAe,EAE5BC,EAAa,SACxBf,EACAN,GACG,IAAAsB,EACGC,EAA6B,WAAlBC,EAAOxB,GAAsBA,OAASyB,EACjDC,EAAgBH,EAAUA,aAAO,EAAPA,EAASG,aAAe1B,EAElDK,UAAOiB,EAAGC,aAAAA,EAAAA,EAASlB,eAAO,IAAAiB,EAAAA,EAAIrB,OAAO0B,aACrCC,EAAa,SAACrB,GAClB,OAAIgB,SAAAA,EAASK,WAAmBL,EAAQK,WAAWrB,GAC5CsB,KAAKC,UAAUvB,IAkBlBwB,EAAQC,EAAMC,qBAAqBjB,GADrB,WAAH,OAASD,EAAeV,EAASC,EAAI,GACkBc,GAElEc,EAAM,SAAC3B,GACX,GAAc,OAAVA,EAAgB,OAAOM,EAAkBR,EAASC,GACtDF,EAAeC,EAASC,EAAKsB,EAAWrB,KAG1C4B,GAA0B,iBAEVV,IADAV,EAAeV,EAASC,IACVoB,IAE5BtB,EACEC,EACAC,EACAsB,EAAWF,aAAwBU,SAAWV,IAAiBA,GAEnE,GAAG,CAACpB,IAEJ,IAAM+B,EAAS,WAAH,OAASxB,EAAkBR,EAASC,EAAI,EAEpD,OAAKgC,EAEE,CAACP,EArCa,SAACxB,GACpB,GAAIgB,SAAAA,EAASgB,aAAc,OAAOhB,EAAQgB,aAAahC,GAEvD,GAAc,cAAVA,EAIJ,IACE,OAAOsB,KAAKW,MAAMjC,EACnB,CAAC,MAAOkC,GACP,OAAOlC,CACT,EA0BcgC,CAAaR,QAASN,EAAWS,EAAKG,GAD7C,CAACX,aAAwBU,SAAWV,IAAiBA,EAAcQ,EAAKG,EAEnF"}
1
+ {"version":3,"file":"useStorage.js","sources":["../../../../src/hooks/useStorage/useStorage.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react';\n\nimport { isClient } from '@/utils/helpers';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';\n\nexport type UseStorageInitialValue<Value> = Value | (() => Value);\nexport interface UseStorageOptions<Value> {\n serializer?: (value: Value) => string;\n deserializer?: (value: string) => Value;\n storage?: Storage;\n initialValue?: UseStorageInitialValue<Value>;\n}\n\nexport type UseStorageReturn<Value> = [\n value: Value,\n set: (value: Value) => void,\n remove: () => void\n];\n\nexport const dispatchStorageEvent = (params: Partial<StorageEvent>) =>\n window.dispatchEvent(new StorageEvent('storage', params));\n\nconst setStorageItem = (storage: Storage, key: string, value: string) => {\n const oldValue = storage.getItem(key);\n\n storage.setItem(key, value);\n dispatchStorageEvent({ key, oldValue, newValue: value, storageArea: storage });\n};\n\nconst removeStorageItem = (storage: Storage, key: string) => {\n const oldValue = storage.getItem(key);\n\n storage.removeItem(key);\n dispatchStorageEvent({ key, oldValue, newValue: null, storageArea: storage });\n};\n\nconst getStorageItem = (storage: Storage, key: string) => {\n const value = storage.getItem(key);\n if (!value) return undefined;\n return value;\n};\n\nconst storageSubscribe = (callback: () => void) => {\n window.addEventListener('storage', callback);\n return () => window.removeEventListener('storage', callback);\n};\n\nconst getServerSnapshot = () => undefined;\n\nexport const useStorage = <Value>(\n key: string,\n params?: UseStorageInitialValue<Value> | UseStorageOptions<Value>\n) => {\n const options = (typeof params === 'object' ? params : undefined) as UseStorageOptions<Value>;\n const initialValue = (options ? options?.initialValue : params) as UseStorageInitialValue<Value>;\n\n const storage = options?.storage ?? window.localStorage;\n const serializer = (value: Value) => {\n if (options?.serializer) return options.serializer(value);\n return JSON.stringify(value);\n };\n\n const deserializer = (value: string) => {\n if (options?.deserializer) return options.deserializer(value);\n\n if (value === 'undefined') {\n return undefined as unknown as Value;\n }\n\n try {\n return JSON.parse(value) as Value;\n } catch (error) {\n return value as Value;\n }\n };\n\n const getSnapshot = () => getStorageItem(storage, key);\n const store = useSyncExternalStore(storageSubscribe, getSnapshot, getServerSnapshot);\n\n const set = (value: Value) => {\n if (value === null) return removeStorageItem(storage, key);\n setStorageItem(storage, key, serializer(value));\n };\n\n useIsomorphicLayoutEffect(() => {\n const value = getStorageItem(storage, key);\n if (value !== undefined && !initialValue) return;\n\n setStorageItem(\n storage,\n key,\n serializer(initialValue instanceof Function ? initialValue() : initialValue)\n );\n }, [key]);\n\n const remove = () => removeStorageItem(storage, key);\n\n if (!isClient)\n return [initialValue instanceof Function ? initialValue() : initialValue, set, remove] as const;\n return [store ? deserializer(store) : undefined, set, remove] as const;\n};\n"],"names":["dispatchStorageEvent","params","window","dispatchEvent","StorageEvent","setStorageItem","storage","key","value","oldValue","getItem","setItem","newValue","storageArea","removeStorageItem","removeItem","getStorageItem","storageSubscribe","callback","addEventListener","removeEventListener","getServerSnapshot","useStorage","_options$storage","options","_typeof","undefined","initialValue","localStorage","serializer","JSON","stringify","store","useSyncExternalStore","set","useIsomorphicLayoutEffect","Function","remove","isClient","deserializer","parse","error"],"mappings":";kRAoBaA,EAAuB,SAACC,GAA6B,OAChEC,OAAOC,cAAc,IAAIC,aAAa,UAAWH,GAAQ,EAErDI,EAAiB,SAACC,EAAkBC,EAAaC,GACrD,IAAMC,EAAWH,EAAQI,QAAQH,GAEjCD,EAAQK,QAAQJ,EAAKC,GACrBR,EAAqB,CAAEO,IAAAA,EAAKE,SAAAA,EAAUG,SAAUJ,EAAOK,YAAaP,GACtE,EAEMQ,EAAoB,SAACR,EAAkBC,GAC3C,IAAME,EAAWH,EAAQI,QAAQH,GAEjCD,EAAQS,WAAWR,GACnBP,EAAqB,CAAEO,IAAAA,EAAKE,SAAAA,EAAUG,SAAU,KAAMC,YAAaP,GACrE,EAEMU,EAAiB,SAACV,EAAkBC,GACxC,IAAMC,EAAQF,EAAQI,QAAQH,GAC9B,GAAKC,EACL,OAAOA,CACT,EAEMS,EAAmB,SAACC,GAExB,OADAhB,OAAOiB,iBAAiB,UAAWD,GAC5B,WAAA,OAAMhB,OAAOkB,oBAAoB,UAAWF,EAAS,CAC9D,EAEMG,EAAoB,WAAe,EAE5BC,EAAa,SACxBf,EACAN,GACG,IAAAsB,EACGC,EAA6B,WAAlBC,EAAOxB,GAAsBA,OAASyB,EACjDC,EAAgBH,EAAUA,aAAO,EAAPA,EAASG,aAAe1B,EAElDK,UAAOiB,EAAGC,aAAAA,EAAAA,EAASlB,eAAO,IAAAiB,EAAAA,EAAIrB,OAAO0B,aACrCC,EAAa,SAACrB,GAClB,OAAIgB,SAAAA,EAASK,WAAmBL,EAAQK,WAAWrB,GAC5CsB,KAAKC,UAAUvB,IAkBlBwB,EAAQC,EAAqBhB,GADf,WAAH,OAASD,EAAeV,EAASC,EAAI,GACYc,GAE5Da,EAAM,SAAC1B,GACX,GAAc,OAAVA,EAAgB,OAAOM,EAAkBR,EAASC,GACtDF,EAAeC,EAASC,EAAKsB,EAAWrB,KAG1C2B,GAA0B,iBAEVT,IADAV,EAAeV,EAASC,IACVoB,IAE5BtB,EACEC,EACAC,EACAsB,EAAWF,aAAwBS,SAAWT,IAAiBA,GAEnE,GAAG,CAACpB,IAEJ,IAAM8B,EAAS,WAAH,OAASvB,EAAkBR,EAASC,EAAI,EAEpD,OAAK+B,EAEE,CAACN,EArCa,SAACxB,GACpB,GAAIgB,SAAAA,EAASe,aAAc,OAAOf,EAAQe,aAAa/B,GAEvD,GAAc,cAAVA,EAIJ,IACE,OAAOsB,KAAKU,MAAMhC,EACnB,CAAC,MAAOiC,GACP,OAAOjC,CACT,EA0Bc+B,CAAaP,QAASN,EAAWQ,EAAKG,GAD7C,CAACV,aAAwBS,SAAWT,IAAiBA,EAAcO,EAAKG,EAEnF"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import n from"react";import{isClient as t}from"../../utils/helpers/isClient.js";import{useRerender as r}from"../useRerender/useRerender.js";var o=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)}))},u=function(){var u,i=r(),l=n.useState(t?document.getSelection():null),c=e(l,2),s=c[0],a=c[1];n.useEffect((function(){var e=function(){a(document.getSelection()),i.update()};return document.addEventListener("selectionchange",e),function(){return document.removeEventListener("selectionchange",e)}}),[]);var m=null!==(u=null==s?void 0:s.toString())&&void 0!==u?u:"",f=s?o(s):[],d=f.map((function(e){return e.getBoundingClientRect()}));return{text:m,ranges:f,rects:d,selection:s}};export{o as getRangesSelection,u as useTextSelection};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-MCjhm_0B.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 +1 @@
1
- {"version":3,"file":"useTextSelection.js","sources":["../../../../src/hooks/useTextSelection/useTextSelection.ts"],"sourcesContent":["import React from 'react';\n\nimport { isClient } from '@/utils/helpers';\n\nimport { useRerender } from '../useRerender/useRerender';\n\nexport const getRangesSelection = (selection: Selection) => {\n const rangeCount = selection.rangeCount ?? 0;\n return Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n};\n\n/** The use text selection return type */\nexport interface UseTextSelectionReturn {\n /** The current selection text */\n text: string;\n /** The current selection ranges */\n ranges: Range[];\n /** The current selection rects */\n rects: DOMRect[];\n /** The current selection */\n selection: Selection | null;\n}\n\n/**\n * @name useTextSelection\n * @description - Hook that manages the text selection\n *\n * @returns {UseTextSelectionReturn} An object containing the current text selection\n *\n * @example\n * const selection = useTextSelection();\n */\nexport const useTextSelection = (): UseTextSelectionReturn => {\n const rerender = useRerender();\n const [selection, setSelection] = React.useState<Selection | null>(\n isClient ? document.getSelection() : null\n );\n\n React.useEffect(() => {\n const onSelectionChange = () => {\n setSelection(document.getSelection());\n rerender.update();\n };\n\n document.addEventListener('selectionchange', onSelectionChange);\n return () => document.removeEventListener('selectionchange', onSelectionChange);\n }, []);\n\n const text = selection?.toString() ?? '';\n const ranges = selection ? getRangesSelection(selection) : [];\n const rects = ranges.map((range) => range.getBoundingClientRect());\n\n return {\n text,\n ranges,\n rects,\n selection\n };\n};\n"],"names":["getRangesSelection","selection","_selection$rangeCount","rangeCount","Array","from","length","_","i","getRangeAt","useTextSelection","_selection$toString","rerender","useRerender","_React$useState","React","useState","isClient","document","getSelection","_React$useState2","_slicedToArray","setSelection","useEffect","onSelectionChange","update","addEventListener","removeEventListener","text","toString","ranges","rects","map","range","getBoundingClientRect"],"mappings":";gNAMaA,EAAqB,SAACC,GAAyB,IAAAC,EACpDC,EAAiC,QAAvBD,EAAGD,EAAUE,kBAAU,IAAAD,EAAAA,EAAI,EAC3C,OAAOE,MAAMC,KAAK,CAAEC,OAAQH,IAAc,SAACI,EAAGC,GAAC,OAAKP,EAAUQ,WAAWD,KAC3E,EAuBaE,EAAmB,WAA8B,IAAAC,EACtDC,EAAWC,IACjBC,EAAkCC,EAAMC,SACtCC,EAAWC,SAASC,eAAiB,MACtCC,EAAAC,EAAAP,EAAA,GAFMb,EAASmB,EAAA,GAAEE,EAAYF,EAAA,GAI9BL,EAAMQ,WAAU,WACd,IAAMC,EAAoB,WACxBF,EAAaJ,SAASC,gBACtBP,EAASa,UAIX,OADAP,SAASQ,iBAAiB,kBAAmBF,GACtC,WAAA,OAAMN,SAASS,oBAAoB,kBAAmBH,EAAkB,CAChF,GAAE,IAEH,IAAMI,EAA4B,QAAxBjB,EAAGV,aAAAA,EAAAA,EAAW4B,kBAAUlB,IAAAA,EAAAA,EAAI,GAChCmB,EAAS7B,EAAYD,EAAmBC,GAAa,GACrD8B,EAAQD,EAAOE,KAAI,SAACC,GAAK,OAAKA,EAAMC,2BAE1C,MAAO,CACLN,KAAAA,EACAE,OAAAA,EACAC,MAAAA,EACA9B,UAAAA,EAEJ"}
1
+ {"version":3,"file":"useTextSelection.js","sources":["../../../../src/hooks/useTextSelection/useTextSelection.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { isClient } from '@/utils/helpers';\n\nimport { useRerender } from '../useRerender/useRerender';\n\nexport const getRangesSelection = (selection: Selection) => {\n const rangeCount = selection.rangeCount ?? 0;\n return Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n};\n\n/** The use text selection return type */\nexport interface UseTextSelectionReturn {\n /** The current selection text */\n text: string;\n /** The current selection ranges */\n ranges: Range[];\n /** The current selection rects */\n rects: DOMRect[];\n /** The current selection */\n selection: Selection | null;\n}\n\n/**\n * @name useTextSelection\n * @description - Hook that manages the text selection\n *\n * @returns {UseTextSelectionReturn} An object containing the current text selection\n *\n * @example\n * const selection = useTextSelection();\n */\nexport const useTextSelection = (): UseTextSelectionReturn => {\n const rerender = useRerender();\n const [selection, setSelection] = useState<Selection | null>(\n isClient ? document.getSelection() : null\n );\n\n useEffect(() => {\n const onSelectionChange = () => {\n setSelection(document.getSelection());\n rerender.update();\n };\n\n document.addEventListener('selectionchange', onSelectionChange);\n return () => document.removeEventListener('selectionchange', onSelectionChange);\n }, []);\n\n const text = selection?.toString() ?? '';\n const ranges = selection ? getRangesSelection(selection) : [];\n const rects = ranges.map((range) => range.getBoundingClientRect());\n\n return {\n text,\n ranges,\n rects,\n selection\n };\n};\n"],"names":["getRangesSelection","selection","_selection$rangeCount","rangeCount","Array","from","length","_","i","getRangeAt","useTextSelection","_selection$toString","rerender","useRerender","_useState","useState","isClient","document","getSelection","_useState2","_slicedToArray","setSelection","useEffect","onSelectionChange","update","addEventListener","removeEventListener","text","toString","ranges","rects","map","range","getBoundingClientRect"],"mappings":";2OAMaA,EAAqB,SAACC,GAAyB,IAAAC,EACpDC,EAAiC,QAAvBD,EAAGD,EAAUE,kBAAU,IAAAD,EAAAA,EAAI,EAC3C,OAAOE,MAAMC,KAAK,CAAEC,OAAQH,IAAc,SAACI,EAAGC,GAAC,OAAKP,EAAUQ,WAAWD,KAC3E,EAuBaE,EAAmB,WAA8B,IAAAC,EACtDC,EAAWC,IACjBC,EAAkCC,EAChCC,EAAWC,SAASC,eAAiB,MACtCC,EAAAC,EAAAN,EAAA,GAFMb,EAASkB,EAAA,GAAEE,EAAYF,EAAA,GAI9BG,GAAU,WACR,IAAMC,EAAoB,WACxBF,EAAaJ,SAASC,gBACtBN,EAASY,UAIX,OADAP,SAASQ,iBAAiB,kBAAmBF,GACtC,WAAA,OAAMN,SAASS,oBAAoB,kBAAmBH,EAAkB,CAChF,GAAE,IAEH,IAAMI,EAA4B,QAAxBhB,EAAGV,aAAAA,EAAAA,EAAW2B,kBAAUjB,IAAAA,EAAAA,EAAI,GAChCkB,EAAS5B,EAAYD,EAAmBC,GAAa,GACrD6B,EAAQD,EAAOE,KAAI,SAACC,GAAK,OAAKA,EAAMC,2BAE1C,MAAO,CACLN,KAAAA,EACAE,OAAAA,EACAC,MAAAA,EACA7B,UAAAA,EAEJ"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import r from"react";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";import{getDate as t}from"../../utils/helpers/time/getDate.js";import"screenfull";import{useInterval as o}from"../useInterval/useInterval.js";import"qrcode";import"react-dom";import"../useEvent/useEvent.js";var s=function(){var s=r.useState(t()),i=e(s,2),m=i[0],u=i[1];return o((function(){return u(t())}),1e3),m};export{s as useTime};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{_ as r}from"../../_rollupPluginBabelHelpers-MCjhm_0B.js";import{useState as e}from"react";import"../../utils/helpers/isClient.js";import{getDate as t}from"../../utils/helpers/time/getDate.js";import"screenfull";import{useInterval as o}from"../useInterval/useInterval.js";import"qrcode";import"react-dom";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var s=function(){var s=e(t()),i=r(s,2),m=i[0],p=i[1];return o((function(){return p(t())}),1e3),m};export{s as useTime};
3
3
  //# sourceMappingURL=useTime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTime.js","sources":["../../../../src/hooks/useTime/useTime.ts"],"sourcesContent":["import React from 'react';\n\nimport { useInterval } from '@/hooks';\nimport { getDate } from '@/utils/helpers';\n\nexport interface UseTimeReturn {\n seconds: number;\n minutes: number;\n hours: number;\n meridiemHours: { value: number; type: string };\n day: number;\n month: number;\n year: number;\n timestamp: number;\n}\n\n/**\n * @name useTime\n * @description - Hook that gives you current time in different values\n *\n * @returns {UseTimeReturn} An object containing the current time\n *\n * @example\n * const { seconds, minutes, hours, meridiemHours, day, month, year, timestamp } = useTime();\n */\n\nexport const useTime = (): UseTimeReturn => {\n const [time, setTime] = React.useState(getDate());\n useInterval(() => setTime(getDate()), 1000);\n return time;\n};\n"],"names":["useTime","_React$useState","React","useState","getDate","_React$useState2","_slicedToArray","time","setTime","useInterval"],"mappings":";iZA0BaA,EAAU,WACrB,IAAAC,EAAwBC,EAAMC,SAASC,KAAUC,EAAAC,EAAAL,EAAA,GAA1CM,EAAIF,EAAA,GAAEG,EAAOH,EAAA,GAEpB,OADAI,GAAY,WAAA,OAAMD,EAAQJ,IAAU,GAAE,KAC/BG,CACT"}
1
+ {"version":3,"file":"useTime.js","sources":["../../../../src/hooks/useTime/useTime.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport { useInterval } from '@/hooks';\nimport { getDate } from '@/utils/helpers';\n\nexport interface UseTimeReturn {\n seconds: number;\n minutes: number;\n hours: number;\n meridiemHours: { value: number; type: string };\n day: number;\n month: number;\n year: number;\n timestamp: number;\n}\n\n/**\n * @name useTime\n * @description - Hook that gives you current time in different values\n *\n * @returns {UseTimeReturn} An object containing the current time\n *\n * @example\n * const { seconds, minutes, hours, meridiemHours, day, month, year, timestamp } = useTime();\n */\n\nexport const useTime = (): UseTimeReturn => {\n const [time, setTime] = useState(getDate());\n useInterval(() => setTime(getDate()), 1000);\n return time;\n};\n"],"names":["useTime","_useState","useState","getDate","_useState2","_slicedToArray","time","setTime","useInterval"],"mappings":";6ZA0BaA,EAAU,WACrB,IAAAC,EAAwBC,EAASC,KAAUC,EAAAC,EAAAJ,EAAA,GAApCK,EAAIF,EAAA,GAAEG,EAAOH,EAAA,GAEpB,OADAI,GAAY,WAAA,OAAMD,EAAQJ,IAAU,GAAE,KAC/BG,CACT"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import t from"react";import{useEvent as r}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";function u(u,o){var i=t.useState(!1),n=e(i,2),s=n[0],c=n[1],f=t.useRef(),m=r(u);t.useEffect((function(){return f.current=setTimeout((function(){m(),c(!0)}),o),function(){clearTimeout(f.current)}}),[o]);return{ready:s,clear:function(){clearTimeout(f.current),c(!0)}}}export{u as useTimeout};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{_ as r}from"../../_rollupPluginBabelHelpers-MCjhm_0B.js";import{useState as e,useRef as t,useEffect as o}from"react";import{useEvent as u}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";function i(i,n){var c=e(!1),s=r(c,2),m=s[0],f=s[1],l=t(),p=u(i);o((function(){return l.current=setTimeout((function(){p(),f(!0)}),n),function(){clearTimeout(l.current)}}),[n]);return{ready:m,clear:function(){clearTimeout(l.current),f(!0)}}}export{i as useTimeout};
3
3
  //# sourceMappingURL=useTimeout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTimeout.js","sources":["../../../../src/hooks/useTimeout/useTimeout.ts"],"sourcesContent":["import React from 'react';\n\nimport { useEvent } from '../useEvent/useEvent';\n\n/** The use timeout return type */\ninterface UseTimeoutReturn {\n /** Timeout is ready state value */\n ready: boolean;\n /** Function to clear timeout */\n clear: () => void;\n}\n\n/**\n * @name useTimeout\n * @description - Hook that executes a callback function after a specified delay\n *\n * @param {() => void} callback The function to be executed after the timeout\n * @param {number} delay The delay in milliseconds before the timeout executes the callback function\n * @returns {UseTimeoutReturn} An object with a `ready` boolean state value and a `clear` function to clear timeout\n *\n * @example\n * const { clear, ready } = useTimeout(() => {}, 5000);\n */\nexport function useTimeout(callback: () => void, delay: number): UseTimeoutReturn {\n const [ready, setReady] = React.useState(false);\n\n const timeoutIdRef = React.useRef<ReturnType<typeof setTimeout>>();\n const internalCallback = useEvent(callback);\n\n React.useEffect(() => {\n timeoutIdRef.current = setTimeout(() => {\n internalCallback();\n setReady(true);\n }, delay);\n\n return () => {\n clearTimeout(timeoutIdRef.current);\n };\n }, [delay]);\n\n const clear = () => {\n clearTimeout(timeoutIdRef.current);\n setReady(true);\n };\n\n return { ready, clear };\n}\n"],"names":["useTimeout","callback","delay","_React$useState","React","useState","_React$useState2","_slicedToArray","ready","setReady","timeoutIdRef","useRef","internalCallback","useEvent","useEffect","current","setTimeout","clearTimeout","clear"],"mappings":";kPAuBO,SAASA,EAAWC,EAAsBC,GAC/C,IAAAC,EAA0BC,EAAMC,UAAS,GAAMC,EAAAC,EAAAJ,EAAA,GAAxCK,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAEhBI,EAAeN,EAAMO,SACrBC,EAAmBC,EAASZ,GAElCG,EAAMU,WAAU,WAMd,OALAJ,EAAaK,QAAUC,YAAW,WAChCJ,IACAH,GAAS,EACV,GAAEP,GAEI,WACLe,aAAaP,EAAaK,SAE9B,GAAG,CAACb,IAOJ,MAAO,CAAEM,MAAAA,EAAOU,MALF,WACZD,aAAaP,EAAaK,SAC1BN,GAAS,IAIb"}
1
+ {"version":3,"file":"useTimeout.js","sources":["../../../../src/hooks/useTimeout/useTimeout.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport { useEvent } from '../useEvent/useEvent';\n\n/** The use timeout return type */\ninterface UseTimeoutReturn {\n /** Timeout is ready state value */\n ready: boolean;\n /** Function to clear timeout */\n clear: () => void;\n}\n\n/**\n * @name useTimeout\n * @description - Hook that executes a callback function after a specified delay\n *\n * @param {() => void} callback The function to be executed after the timeout\n * @param {number} delay The delay in milliseconds before the timeout executes the callback function\n * @returns {UseTimeoutReturn} An object with a `ready` boolean state value and a `clear` function to clear timeout\n *\n * @example\n * const { clear, ready } = useTimeout(() => {}, 5000);\n */\nexport function useTimeout(callback: () => void, delay: number): UseTimeoutReturn {\n const [ready, setReady] = useState(false);\n\n const timeoutIdRef = useRef<ReturnType<typeof setTimeout>>();\n const internalCallback = useEvent(callback);\n\n useEffect(() => {\n timeoutIdRef.current = setTimeout(() => {\n internalCallback();\n setReady(true);\n }, delay);\n\n return () => {\n clearTimeout(timeoutIdRef.current);\n };\n }, [delay]);\n\n const clear = () => {\n clearTimeout(timeoutIdRef.current);\n setReady(true);\n };\n\n return { ready, clear };\n}\n"],"names":["useTimeout","callback","delay","_useState","useState","_useState2","_slicedToArray","ready","setReady","timeoutIdRef","useRef","internalCallback","useEvent","useEffect","current","setTimeout","clearTimeout","clear"],"mappings":";yRAuBO,SAASA,EAAWC,EAAsBC,GAC/C,IAAAC,EAA0BC,GAAS,GAAMC,EAAAC,EAAAH,EAAA,GAAlCI,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAEhBI,EAAeC,IACfC,EAAmBC,EAASX,GAElCY,GAAU,WAMR,OALAJ,EAAaK,QAAUC,YAAW,WAChCJ,IACAH,GAAS,EACV,GAAEN,GAEI,WACLc,aAAaP,EAAaK,SAE9B,GAAG,CAACZ,IAOJ,MAAO,CAAEK,MAAAA,EAAOU,MALF,WACZD,aAAaP,EAAaK,SAC1BN,GAAS,IAIb"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{_ as r}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import e from"react";var n=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[!1,!0],t=e.useReducer((function(r,e){var n=e instanceof Function?e(r[0]):e,t=Math.abs(r.indexOf(n));return r.slice(t).concat(r.slice(0,t))}),n),o=r(t,2);return[r(o[0],1)[0],o[1]]};export{n as useToggle};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{_ as r}from"../../_rollupPluginBabelHelpers-MCjhm_0B.js";import{useReducer as n}from"react";var t=function(){var t=n((function(r,n){var t=n instanceof Function?n(r[0]):n,e=Math.abs(r.indexOf(t));return r.slice(e).concat(r.slice(0,e))}),arguments.length>0&&void 0!==arguments[0]?arguments[0]:[!1,!0]),e=r(t,2);return[r(e[0],1)[0],e[1]]};export{t as useToggle};
3
3
  //# sourceMappingURL=useToggle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useToggle.js","sources":["../../../../src/hooks/useToggle/useToggle.ts"],"sourcesContent":["import React from 'react';\n\n/** The use toggle return type */\nexport type UseToggleReturn<Value> = readonly [Value, (value?: Value) => void];\n\n/**\n * @name useToggle\n * @description - Hook that create toggle\n *\n * @template Value The type of the value\n * @param {Value[]} [values=[false, true]] The values to toggle\n *\n * @example\n * const [on, toggle] = useToggle();\n *\n * @example\n * const [value, toggle] = useToggle(['light', 'dark'] as const);\n */\nexport const useToggle = <Value = boolean>(values: readonly Value[] = [false, true] as any) => {\n const [[option], toggle] = React.useReducer(\n (state: Value[], action: React.SetStateAction<Value>) => {\n const value = action instanceof Function ? action(state[0]) : action;\n const index = Math.abs(state.indexOf(value));\n return state.slice(index).concat(state.slice(0, index));\n },\n values as Value[]\n );\n\n return [option, toggle as (value?: React.SetStateAction<Value>) => void] as const;\n};\n"],"names":["useToggle","values","arguments","length","undefined","_React$useReducer","React","useReducer","state","action","value","Function","index","Math","abs","indexOf","slice","concat","_React$useReducer2","_slicedToArray"],"mappings":";yFAkBaA,EAAY,WAAsE,IAApDC,EAAwBC,UAAAC,eAAAC,IAAAF,UAAA,GAAAA,UAAG,GAAA,EAAC,GAAO,GAC5EG,EAA2BC,EAAMC,YAC/B,SAACC,EAAgBC,GACf,IAAMC,EAAQD,aAAkBE,SAAWF,EAAOD,EAAM,IAAMC,EACxDG,EAAQC,KAAKC,IAAIN,EAAMO,QAAQL,IACrC,OAAOF,EAAMQ,MAAMJ,GAAOK,OAAOT,EAAMQ,MAAM,EAAGJ,GACjD,GACDX,GACDiB,EAAAC,EAAAd,EAAA,GAED,MAAO,CAFNc,EAAAD,EAAA,GAAA,GAPa,GAASA,EAAA,GAUzB"}
1
+ {"version":3,"file":"useToggle.js","sources":["../../../../src/hooks/useToggle/useToggle.ts"],"sourcesContent":["import type { SetStateAction } from 'react';\nimport { useReducer } from 'react';\n\n/** The use toggle return type */\nexport type UseToggleReturn<Value> = readonly [Value, (value?: Value) => void];\n\n/**\n * @name useToggle\n * @description - Hook that create toggle\n *\n * @template Value The type of the value\n * @param {Value[]} [values=[false, true]] The values to toggle\n *\n * @example\n * const [on, toggle] = useToggle();\n *\n * @example\n * const [value, toggle] = useToggle(['light', 'dark'] as const);\n */\nexport const useToggle = <Value = boolean>(values: readonly Value[] = [false, true] as any) => {\n const [[option], toggle] = useReducer((state: Value[], action: SetStateAction<Value>) => {\n const value = action instanceof Function ? action(state[0]) : action;\n const index = Math.abs(state.indexOf(value));\n return state.slice(index).concat(state.slice(0, index));\n }, values as Value[]);\n\n return [option, toggle as (value?: SetStateAction<Value>) => void] as const;\n};\n"],"names":["useToggle","_useReducer","useReducer","state","action","value","Function","index","Math","abs","indexOf","slice","concat","arguments","length","undefined","_useReducer2","_slicedToArray"],"mappings":";uGAmBaA,EAAY,WAAsE,IAC7FC,EAA2BC,GAAW,SAACC,EAAgBC,GACrD,IAAMC,EAAQD,aAAkBE,SAAWF,EAAOD,EAAM,IAAMC,EACxDG,EAAQC,KAAKC,IAAIN,EAAMO,QAAQL,IACrC,OAAOF,EAAMQ,MAAMJ,GAAOK,OAAOT,EAAMQ,MAAM,EAAGJ,GACjD,GALgEM,UAAAC,eAAAC,IAAAF,UAAA,GAAAA,UAAG,GAAA,EAAC,GAAO,IAKvDG,EAAAC,EAAAhB,EAAA,GAErB,MAAO,CAFcgB,EAAAD,EAAA,GAAA,GAJP,GAASA,EAAA,GAOzB"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import r from"react";var t=function(t){var e=r.useRef(t);e.current=t,r.useEffect((function(){return function(){e.current()}}),[])};export{t as useUnmount};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{useRef as r,useEffect as n}from"react";var t=function(t){var c=r(t);c.current=t,n((function(){return function(){c.current()}}),[])};export{t as useUnmount};
3
3
  //# sourceMappingURL=useUnmount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useUnmount.js","sources":["../../../../src/hooks/useUnmount/useUnmount.ts"],"sourcesContent":["import React from 'react';\n\n/**\n * @name useUnmount\n * @description - Hook that defines the logic when unmounting a component\n *\n * @param {() => void} callback The callback function to be invoked on component unmount\n * @returns {void}\n *\n * @example\n * useUnmount(() => console.log('This effect runs on component unmount'));\n */\n\nexport const useUnmount = (callback: () => void) => {\n const callbackRef = React.useRef(callback);\n callbackRef.current = callback;\n\n React.useEffect(\n () => () => {\n callbackRef.current();\n },\n []\n );\n};\n"],"names":["useUnmount","callback","callbackRef","React","useRef","current","useEffect"],"mappings":";yBAaaA,EAAa,SAACC,GACzB,IAAMC,EAAcC,EAAMC,OAAOH,GACjCC,EAAYG,QAAUJ,EAEtBE,EAAMG,WACJ,WAAA,OAAM,WACJJ,EAAYG,UACb,GACD,GAEJ"}
1
+ {"version":3,"file":"useUnmount.js","sources":["../../../../src/hooks/useUnmount/useUnmount.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n/**\n * @name useUnmount\n * @description - Hook that defines the logic when unmounting a component\n *\n * @param {() => void} callback The callback function to be invoked on component unmount\n * @returns {void}\n *\n * @example\n * useUnmount(() => console.log('This effect runs on component unmount'));\n */\n\nexport const useUnmount = (callback: () => void) => {\n const callbackRef = useRef(callback);\n callbackRef.current = callback;\n\n useEffect(\n () => () => {\n callbackRef.current();\n },\n []\n );\n};\n"],"names":["useUnmount","callback","callbackRef","useRef","current","useEffect"],"mappings":";kDAaaA,EAAa,SAACC,GACzB,IAAMC,EAAcC,EAAOF,GAC3BC,EAAYE,QAAUH,EAEtBI,GACE,WAAA,OAAM,WACJH,EAAYE,UACb,GACD,GAEJ"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{_ as n}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import e from"react";import{getRetry as r}from"../../utils/helpers/getRetry.js";import"../../utils/helpers/isClient.js";import{useEvent as t}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var o=function(o,u){var c=e.useRef(),l=e.useRef(null!=u&&u.retry?r(u.retry):0),i=e.useRef(!1),s=e.useState("connecting"),f=n(s,2),a=f[0],v=f[1],d=t((function(){c.current=new WebSocket("function"==typeof o?o():o,null==u?void 0:u.protocols),v("connecting");var n=c.current;n&&(n.onopen=function(){var e;v("connected"),null==u||null===(e=u.onConnected)||void 0===e||e.call(u,n)},n.onerror=function(e){var r;v("failed"),null==u||null===(r=u.onError)||void 0===r||r.call(u,e,n)},n.onmessage=function(e){var r;return null==u||null===(r=u.onMessage)||void 0===r?void 0:r.call(u,e,n)},n.onclose=function(e){var t;if(v("disconnected"),null==u||null===(t=u.onDisconnected)||void 0===t||t.call(u,e,n),!i.current)return l.current>0?(l.current-=1,d()):void(l.current=null!=u&&u.retry?r(u.retry):0)})}));e.useEffect((function(){return d(),function(){c.current&&(c.current.close(),c.current=void 0)}}),[o]);return{client:c.current,close:function(){var n;i.current=!0,null===(n=c.current)||void 0===n||n.close()},open:function(){i.current=!1,d()},send:function(n){var e;return null===(e=c.current)||void 0===e?void 0:e.send(n)},status:a}};export{o as useWebSocket};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{_ as n}from"../../_rollupPluginBabelHelpers-MCjhm_0B.js";import{useRef as r,useState as e,useEffect as o}from"react";import{getRetry as t}from"../../utils/helpers/getRetry.js";import"../../utils/helpers/isClient.js";import{useEvent as u}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var c=function(c,l){var i=r(),s=r(null!=l&&l.retry?t(l.retry):0),f=r(!1),a=e("connecting"),v=n(a,2),d=v[0],p=v[1],m=u((function(){i.current=new WebSocket("function"==typeof c?c():c,null==l?void 0:l.protocols),p("connecting");var n=i.current;n&&(n.onopen=function(){var r;p("connected"),null==l||null===(r=l.onConnected)||void 0===r||r.call(l,n)},n.onerror=function(r){var e;p("failed"),null==l||null===(e=l.onError)||void 0===e||e.call(l,r,n)},n.onmessage=function(r){var e;return null==l||null===(e=l.onMessage)||void 0===e?void 0:e.call(l,r,n)},n.onclose=function(r){var e;if(p("disconnected"),null==l||null===(e=l.onDisconnected)||void 0===e||e.call(l,r,n),!f.current)return s.current>0?(s.current-=1,m()):void(s.current=null!=l&&l.retry?t(l.retry):0)})}));o((function(){return m(),function(){i.current&&(i.current.close(),i.current=void 0)}}),[c]);return{client:i.current,close:function(){var n;f.current=!0,null===(n=i.current)||void 0===n||n.close()},open:function(){f.current=!1,m()},send:function(n){var r;return null===(r=i.current)||void 0===r?void 0:r.send(n)},status:d}};export{c as useWebSocket};
3
3
  //# sourceMappingURL=useWebSocket.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWebSocket.js","sources":["../../../../src/hooks/useWebSocket/useWebSocket.ts"],"sourcesContent":["import React from 'react';\n\nimport { getRetry } from '@/utils/helpers';\n\nimport { useEvent } from '../useEvent/useEvent';\n\nexport type UseWebSocketUrl = string | (() => string);\n\nexport interface UseWebSocketOptions {\n onConnected?: (webSocket: WebSocket) => void;\n onDisconnected?: (event: CloseEvent, webSocket: WebSocket) => void;\n onError?: (event: Event, webSocket: WebSocket) => void;\n onMessage?: (event: MessageEvent, webSocket: WebSocket) => void;\n retry?: boolean | number;\n protocols?: Array<'soap' | 'wasm'>;\n}\n\nexport type UseWebSocketStatus = 'connecting' | 'failed' | 'connected' | 'disconnected';\n\nexport interface UseWebSocketReturn {\n status: UseWebSocketStatus;\n close: WebSocket['close'];\n send: WebSocket['send'];\n open: () => void;\n client?: WebSocket;\n}\n\n/**\n * @name useWebSocket\n * @description - Hook that connects to a WebSocket server and handles incoming and outgoing messages\n *\n * @param {UseWebSocketUrl} url The URL of the WebSocket server\n * @param {(webSocket: WebSocket) => void} [options.onConnected] The callback function that is called when the WebSocket connection is established\n * @param {(event: CloseEvent, webSocket: WebSocket) => void} [options.onDisconnected] The callback function that is called when the WebSocket connection is closed\n * @param {(event: Event, webSocket: WebSocket) => void} [options.onError] The callback function that is called when an error occurs\n * @param {(event: MessageEvent, webSocket: WebSocket) => void} [options.onMessage] The callback function that is called when a message is received\n * @param {boolean | number} [options.retry] The number of times to retry the connection\n * @param {Array<'soap' | 'wasm'>} [options.protocols] The list of protocols to use\n * @returns {UseWebSocketReturn} An object with the status, close, send, open, and ws properties\n *\n * @example\n * const { status, close, send, open, client } = useWebSocket('url');\n */\nexport const useWebSocket = (\n url: UseWebSocketUrl,\n options?: UseWebSocketOptions\n): UseWebSocketReturn => {\n const webSocketRef = React.useRef<WebSocket>();\n const retryCountRef = React.useRef(options?.retry ? getRetry(options.retry) : 0);\n const explicityCloseRef = React.useRef(false);\n\n const [status, setStatus] = React.useState<UseWebSocketStatus>('connecting');\n\n const send = (data: string | Blob | ArrayBufferLike | ArrayBufferView) =>\n webSocketRef.current?.send(data);\n\n const close = () => {\n explicityCloseRef.current = true;\n webSocketRef.current?.close();\n };\n\n const init = useEvent(() => {\n webSocketRef.current = new WebSocket(\n typeof url === 'function' ? url() : url,\n options?.protocols\n );\n setStatus('connecting');\n\n const webSocket = webSocketRef.current;\n if (!webSocket) return;\n\n webSocket.onopen = () => {\n setStatus('connected');\n options?.onConnected?.(webSocket);\n };\n\n webSocket.onerror = (event) => {\n setStatus('failed');\n options?.onError?.(event, webSocket);\n };\n\n webSocket.onmessage = (event) => options?.onMessage?.(event, webSocket);\n\n webSocket.onclose = (event) => {\n setStatus('disconnected');\n options?.onDisconnected?.(event, webSocket);\n if (explicityCloseRef.current) return;\n\n if (retryCountRef.current > 0) {\n retryCountRef.current -= 1;\n return init();\n }\n retryCountRef.current = options?.retry ? getRetry(options.retry) : 0;\n };\n });\n\n React.useEffect(() => {\n init();\n\n return () => {\n if (!webSocketRef.current) return;\n webSocketRef.current.close();\n webSocketRef.current = undefined;\n };\n }, [url]);\n\n const open = () => {\n explicityCloseRef.current = false;\n init();\n };\n\n return { client: webSocketRef.current, close, open, send, status };\n};\n"],"names":["useWebSocket","url","options","webSocketRef","React","useRef","retryCountRef","retry","getRetry","explicityCloseRef","_React$useState","useState","_React$useState2","_slicedToArray","status","setStatus","init","useEvent","current","WebSocket","protocols","webSocket","onopen","_options$onConnected","onConnected","call","onerror","event","_options$onError","onError","onmessage","_options$onMessage","onMessage","onclose","_options$onDisconnect","onDisconnected","useEffect","close","undefined","client","_webSocketRef$current2","open","send","data","_webSocketRef$current"],"mappings":";6SA2CO,IAAMA,EAAe,SAC1BC,EACAC,GAEA,IAAMC,EAAeC,EAAMC,SACrBC,EAAgBF,EAAMC,OAAOH,SAAAA,EAASK,MAAQC,EAASN,EAAQK,OAAS,GACxEE,EAAoBL,EAAMC,QAAO,GAEvCK,EAA4BN,EAAMO,SAA6B,cAAaC,EAAAC,EAAAH,EAAA,GAArEI,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAUlBI,EAAOC,GAAS,WACpBd,EAAae,QAAU,IAAIC,UACV,mBAARlB,EAAqBA,IAAQA,EACpCC,aAAAA,EAAAA,EAASkB,WAEXL,EAAU,cAEV,IAAMM,EAAYlB,EAAae,QAC1BG,IAELA,EAAUC,OAAS,WAAM,IAAAC,EACvBR,EAAU,aACVb,SAAoB,QAAbqB,EAAPrB,EAASsB,mBAAW,IAAAD,GAApBA,EAAAE,KAAAvB,EAAuBmB,IAGzBA,EAAUK,QAAU,SAACC,GAAU,IAAAC,EAC7Bb,EAAU,UACVb,SAAgB0B,QAATA,EAAP1B,EAAS2B,mBAAOD,GAAhBA,EAAAH,KAAAvB,EAAmByB,EAAON,IAG5BA,EAAUS,UAAY,SAACH,GAAK,IAAAI,EAAA,OAAK7B,SAAkB,QAAX6B,EAAP7B,EAAS8B,iBAATD,IAAkBA,OAAlBA,EAAAA,EAAAN,KAAAvB,EAAqByB,EAAON,EAAU,EAEvEA,EAAUY,QAAU,SAACN,GAAU,IAAAO,EAG7B,GAFAnB,EAAU,gBACVb,SAAuBgC,QAAhBA,EAAPhC,EAASiC,0BAAcD,GAAvBA,EAAAT,KAAAvB,EAA0ByB,EAAON,IAC7BZ,EAAkBS,QAEtB,OAAIZ,EAAcY,QAAU,GAC1BZ,EAAcY,SAAW,EAClBF,UAETV,EAAcY,QAAUhB,SAAAA,EAASK,MAAQC,EAASN,EAAQK,OAAS,IAEvE,IAEAH,EAAMgC,WAAU,WAGd,OAFApB,IAEO,WACAb,EAAae,UAClBf,EAAae,QAAQmB,QACrBlC,EAAae,aAAUoB,GAE3B,GAAG,CAACrC,IAOJ,MAAO,CAAEsC,OAAQpC,EAAae,QAASmB,MAvDzB,WAAM,IAAAG,EAClB/B,EAAkBS,SAAU,EACR,QAApBsB,EAAArC,EAAae,eAAO,IAAAsB,GAApBA,EAAsBH,SAqDsBI,KALjC,WACXhC,EAAkBS,SAAU,EAC5BF,KAGkD0B,KA1DvC,SAACC,GAAuD,IAAAC,EAAA,OAC/C,QAD+CA,EACnEzC,EAAae,eAAO,IAAA0B,OAAA,EAApBA,EAAsBF,KAAKC,EAAK,EAyDwB7B,OAAAA,EAC5D"}
1
+ {"version":3,"file":"useWebSocket.js","sources":["../../../../src/hooks/useWebSocket/useWebSocket.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport { getRetry } from '@/utils/helpers';\n\nimport { useEvent } from '../useEvent/useEvent';\n\nexport type UseWebSocketUrl = string | (() => string);\n\nexport interface UseWebSocketOptions {\n onConnected?: (webSocket: WebSocket) => void;\n onDisconnected?: (event: CloseEvent, webSocket: WebSocket) => void;\n onError?: (event: Event, webSocket: WebSocket) => void;\n onMessage?: (event: MessageEvent, webSocket: WebSocket) => void;\n retry?: boolean | number;\n protocols?: Array<'soap' | 'wasm'>;\n}\n\nexport type UseWebSocketStatus = 'connecting' | 'failed' | 'connected' | 'disconnected';\n\nexport interface UseWebSocketReturn {\n status: UseWebSocketStatus;\n close: WebSocket['close'];\n send: WebSocket['send'];\n open: () => void;\n client?: WebSocket;\n}\n\n/**\n * @name useWebSocket\n * @description - Hook that connects to a WebSocket server and handles incoming and outgoing messages\n *\n * @param {UseWebSocketUrl} url The URL of the WebSocket server\n * @param {(webSocket: WebSocket) => void} [options.onConnected] The callback function that is called when the WebSocket connection is established\n * @param {(event: CloseEvent, webSocket: WebSocket) => void} [options.onDisconnected] The callback function that is called when the WebSocket connection is closed\n * @param {(event: Event, webSocket: WebSocket) => void} [options.onError] The callback function that is called when an error occurs\n * @param {(event: MessageEvent, webSocket: WebSocket) => void} [options.onMessage] The callback function that is called when a message is received\n * @param {boolean | number} [options.retry] The number of times to retry the connection\n * @param {Array<'soap' | 'wasm'>} [options.protocols] The list of protocols to use\n * @returns {UseWebSocketReturn} An object with the status, close, send, open, and ws properties\n *\n * @example\n * const { status, close, send, open, client } = useWebSocket('url');\n */\nexport const useWebSocket = (\n url: UseWebSocketUrl,\n options?: UseWebSocketOptions\n): UseWebSocketReturn => {\n const webSocketRef = useRef<WebSocket>();\n const retryCountRef = useRef(options?.retry ? getRetry(options.retry) : 0);\n const explicityCloseRef = useRef(false);\n\n const [status, setStatus] = useState<UseWebSocketStatus>('connecting');\n\n const send = (data: string | Blob | ArrayBufferLike | ArrayBufferView) =>\n webSocketRef.current?.send(data);\n\n const close = () => {\n explicityCloseRef.current = true;\n webSocketRef.current?.close();\n };\n\n const init = useEvent(() => {\n webSocketRef.current = new WebSocket(\n typeof url === 'function' ? url() : url,\n options?.protocols\n );\n setStatus('connecting');\n\n const webSocket = webSocketRef.current;\n if (!webSocket) return;\n\n webSocket.onopen = () => {\n setStatus('connected');\n options?.onConnected?.(webSocket);\n };\n\n webSocket.onerror = (event) => {\n setStatus('failed');\n options?.onError?.(event, webSocket);\n };\n\n webSocket.onmessage = (event) => options?.onMessage?.(event, webSocket);\n\n webSocket.onclose = (event) => {\n setStatus('disconnected');\n options?.onDisconnected?.(event, webSocket);\n if (explicityCloseRef.current) return;\n\n if (retryCountRef.current > 0) {\n retryCountRef.current -= 1;\n return init();\n }\n retryCountRef.current = options?.retry ? getRetry(options.retry) : 0;\n };\n });\n\n useEffect(() => {\n init();\n\n return () => {\n if (!webSocketRef.current) return;\n webSocketRef.current.close();\n webSocketRef.current = undefined;\n };\n }, [url]);\n\n const open = () => {\n explicityCloseRef.current = false;\n init();\n };\n\n return { client: webSocketRef.current, close, open, send, status };\n};\n"],"names":["useWebSocket","url","options","webSocketRef","useRef","retryCountRef","retry","getRetry","explicityCloseRef","_useState","useState","_useState2","_slicedToArray","status","setStatus","init","useEvent","current","WebSocket","protocols","webSocket","onopen","_options$onConnected","onConnected","call","onerror","event","_options$onError","onError","onmessage","_options$onMessage","onMessage","onclose","_options$onDisconnect","onDisconnected","useEffect","close","undefined","client","_webSocketRef$current2","open","send","data","_webSocketRef$current"],"mappings":";oVA2CO,IAAMA,EAAe,SAC1BC,EACAC,GAEA,IAAMC,EAAeC,IACfC,EAAgBD,EAAOF,SAAAA,EAASI,MAAQC,EAASL,EAAQI,OAAS,GAClEE,EAAoBJ,GAAO,GAEjCK,EAA4BC,EAA6B,cAAaC,EAAAC,EAAAH,EAAA,GAA/DI,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAUlBI,EAAOC,GAAS,WACpBb,EAAac,QAAU,IAAIC,UACV,mBAARjB,EAAqBA,IAAQA,EACpCC,aAAAA,EAAAA,EAASiB,WAEXL,EAAU,cAEV,IAAMM,EAAYjB,EAAac,QAC1BG,IAELA,EAAUC,OAAS,WAAM,IAAAC,EACvBR,EAAU,aACVZ,SAAoB,QAAboB,EAAPpB,EAASqB,mBAAW,IAAAD,GAApBA,EAAAE,KAAAtB,EAAuBkB,IAGzBA,EAAUK,QAAU,SAACC,GAAU,IAAAC,EAC7Bb,EAAU,UACVZ,SAAgByB,QAATA,EAAPzB,EAAS0B,mBAAOD,GAAhBA,EAAAH,KAAAtB,EAAmBwB,EAAON,IAG5BA,EAAUS,UAAY,SAACH,GAAK,IAAAI,EAAA,OAAK5B,SAAkB,QAAX4B,EAAP5B,EAAS6B,iBAATD,IAAkBA,OAAlBA,EAAAA,EAAAN,KAAAtB,EAAqBwB,EAAON,EAAU,EAEvEA,EAAUY,QAAU,SAACN,GAAU,IAAAO,EAG7B,GAFAnB,EAAU,gBACVZ,SAAuB+B,QAAhBA,EAAP/B,EAASgC,0BAAcD,GAAvBA,EAAAT,KAAAtB,EAA0BwB,EAAON,IAC7BZ,EAAkBS,QAEtB,OAAIZ,EAAcY,QAAU,GAC1BZ,EAAcY,SAAW,EAClBF,UAETV,EAAcY,QAAUf,SAAAA,EAASI,MAAQC,EAASL,EAAQI,OAAS,IAEvE,IAEA6B,GAAU,WAGR,OAFApB,IAEO,WACAZ,EAAac,UAClBd,EAAac,QAAQmB,QACrBjC,EAAac,aAAUoB,GAE3B,GAAG,CAACpC,IAOJ,MAAO,CAAEqC,OAAQnC,EAAac,QAASmB,MAvDzB,WAAM,IAAAG,EAClB/B,EAAkBS,SAAU,EACR,QAApBsB,EAAApC,EAAac,eAAO,IAAAsB,GAApBA,EAAsBH,SAqDsBI,KALjC,WACXhC,EAAkBS,SAAU,EAC5BF,KAGkD0B,KA1DvC,SAACC,GAAuD,IAAAC,EAAA,OAC/C,QAD+CA,EACnExC,EAAac,eAAO,IAAA0B,OAAA,EAApBA,EAAsBF,KAAKC,EAAK,EAyDwB7B,OAAAA,EAC5D"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
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(t,s,r){return e(window,t,s,r)};export{t as useWindowEvent};
3
3
  //# sourceMappingURL=useWindowEvent.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- import{_ as i}from"../../_rollupPluginBabelHelpers-BO0nvURb.js";import e from"react";import{isClient as n}from"../../utils/helpers/isClient.js";var t=function(t){var r,o,d=e.useState({width:n?window.innerWidth:null!==(r=null==t?void 0:t.initialWidth)&&void 0!==r?r:Number.POSITIVE_INFINITY,height:n?window.innerHeight:null!==(o=null==t?void 0:t.initialWidth)&&void 0!==o?o:Number.POSITIVE_INFINITY}),l=i(d,2),u=l[0],w=l[1];return e.useEffect((function(){var i=function(){w({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",i),function(){window.removeEventListener("resize",i)}}),[]),u};export{t as useWindowSize};
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ import{_ as i}from"../../_rollupPluginBabelHelpers-MCjhm_0B.js";import{useState as n,useEffect as e}from"react";import{isClient as r}from"../../utils/helpers/isClient.js";var t=function(t){var o,d,l=n({width:r?window.innerWidth:null!==(o=null==t?void 0:t.initialWidth)&&void 0!==o?o:Number.POSITIVE_INFINITY,height:r?window.innerHeight:null!==(d=null==t?void 0:t.initialWidth)&&void 0!==d?d:Number.POSITIVE_INFINITY}),u=i(l,2),w=u[0],h=u[1];return e((function(){var i=function(){h({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",i),function(){window.removeEventListener("resize",i)}}),[]),w};export{t as useWindowSize};
3
3
  //# sourceMappingURL=useWindowSize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWindowSize.js","sources":["../../../../src/hooks/useWindowSize/useWindowSize.ts"],"sourcesContent":["import React from 'react';\n\nimport { isClient } from '@/utils/helpers';\n\n/** The use window size return type */\ninterface UseWindowSizeParams {\n /** The initial window width */\n initialWidth?: number;\n /** The initial window height */\n initialHeight?: number;\n}\n\n/** The use window size return type */\nexport interface UseWindowSizeReturn {\n /** The current window width */\n width: number;\n /** The current window height */\n height: number;\n}\n\n/**\n * @name useWindowSize\n * @description - Hook that manages a window size\n *\n * @param {number} [params.initialWidth=Number.POSITIVE_INFINITY] The initial window width\n * @param {number} [params.initialHeight=Number.POSITIVE_INFINITY] The initial window height\n * @returns {UseWindowSizeReturn} An object containing the current window width and height\n *\n * @example\n * const { width, height } = useWindowSize();\n */\nexport const useWindowSize = (params?: UseWindowSizeParams) => {\n const [size, setSize] = React.useState({\n width: isClient ? window.innerWidth : params?.initialWidth ?? Number.POSITIVE_INFINITY,\n height: isClient ? window.innerHeight : params?.initialWidth ?? Number.POSITIVE_INFINITY\n });\n\n React.useEffect(() => {\n const onResize = () => {\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n };\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return size;\n};\n"],"names":["useWindowSize","params","_params$initialWidth","_params$initialWidth2","_React$useState","React","useState","width","isClient","window","innerWidth","initialWidth","Number","POSITIVE_INFINITY","height","innerHeight","_React$useState2","_slicedToArray","size","setSize","useEffect","onResize","addEventListener","removeEventListener"],"mappings":";oJA+BaA,EAAgB,SAACC,GAAiC,IAAAC,EAAAC,EAC7DC,EAAwBC,EAAMC,SAAS,CACrCC,MAAOC,EAAWC,OAAOC,WAAiCR,QAAvBA,EAAGD,aAAAA,EAAAA,EAAQU,wBAAYT,EAAAA,EAAIU,OAAOC,kBACrEC,OAAQN,EAAWC,OAAOM,YAAkC,QAAvBZ,EAAGF,aAAAA,EAAAA,EAAQU,oBAAYR,IAAAA,EAAAA,EAAIS,OAAOC,oBACvEG,EAAAC,EAAAb,EAAA,GAHKc,EAAIF,EAAA,GAAEG,EAAOH,EAAA,GAmBpB,OAdAX,EAAMe,WAAU,WACd,IAAMC,EAAW,WACfF,EAAQ,CACNZ,MAAOE,OAAOC,WACdI,OAAQL,OAAOM,eAKnB,OADAN,OAAOa,iBAAiB,SAAUD,GAC3B,WACLZ,OAAOc,oBAAoB,SAAUF,GAExC,GAAE,IAEIH,CACT"}
1
+ {"version":3,"file":"useWindowSize.js","sources":["../../../../src/hooks/useWindowSize/useWindowSize.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { isClient } from '@/utils/helpers';\n\n/** The use window size return type */\ninterface UseWindowSizeParams {\n /** The initial window width */\n initialWidth?: number;\n /** The initial window height */\n initialHeight?: number;\n}\n\n/** The use window size return type */\nexport interface UseWindowSizeReturn {\n /** The current window width */\n width: number;\n /** The current window height */\n height: number;\n}\n\n/**\n * @name useWindowSize\n * @description - Hook that manages a window size\n *\n * @param {number} [params.initialWidth=Number.POSITIVE_INFINITY] The initial window width\n * @param {number} [params.initialHeight=Number.POSITIVE_INFINITY] The initial window height\n * @returns {UseWindowSizeReturn} An object containing the current window width and height\n *\n * @example\n * const { width, height } = useWindowSize();\n */\nexport const useWindowSize = (params?: UseWindowSizeParams) => {\n const [size, setSize] = useState({\n width: isClient ? window.innerWidth : params?.initialWidth ?? Number.POSITIVE_INFINITY,\n height: isClient ? window.innerHeight : params?.initialWidth ?? Number.POSITIVE_INFINITY\n });\n\n useEffect(() => {\n const onResize = () => {\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n };\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return size;\n};\n"],"names":["useWindowSize","params","_params$initialWidth","_params$initialWidth2","_useState","useState","width","isClient","window","innerWidth","initialWidth","Number","POSITIVE_INFINITY","height","innerHeight","_useState2","_slicedToArray","size","setSize","useEffect","onResize","addEventListener","removeEventListener"],"mappings":";+KA+BaA,EAAgB,SAACC,GAAiC,IAAAC,EAAAC,EAC7DC,EAAwBC,EAAS,CAC/BC,MAAOC,EAAWC,OAAOC,WAAiCP,QAAvBA,EAAGD,aAAAA,EAAAA,EAAQS,wBAAYR,EAAAA,EAAIS,OAAOC,kBACrEC,OAAQN,EAAWC,OAAOM,YAAkC,QAAvBX,EAAGF,aAAAA,EAAAA,EAAQS,oBAAYP,IAAAA,EAAAA,EAAIQ,OAAOC,oBACvEG,EAAAC,EAAAZ,EAAA,GAHKa,EAAIF,EAAA,GAAEG,EAAOH,EAAA,GAmBpB,OAdAI,GAAU,WACR,IAAMC,EAAW,WACfF,EAAQ,CACNZ,MAAOE,OAAOC,WACdI,OAAQL,OAAOM,eAKnB,OADAN,OAAOa,iBAAiB,SAAUD,GAC3B,WACLZ,OAAOc,oBAAoB,SAAUF,GAExC,GAAE,IAEIH,CACT"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
2
- export{useBattery}from"./hooks/useBattery/useBattery.js";export{useBoolean}from"./hooks/useBoolean/useBoolean.js";export{useBrowserLanguage}from"./hooks/useBrowserLanguage/useBrowserLanguage.js";export{useClickOutside}from"./hooks/useClickOutside/useClickOutside.js";export{legacyCopyToClipboard,useCopyToClipboard}from"./hooks/useCopyToClipboard/useCopyToClipboard.js";export{useCounter}from"./hooks/useCounter/useCounter.js";export{useDebouncedValue}from"./hooks/useDebouncedValue/useDebouncedValue.js";export{useDefault}from"./hooks/useDefault/useDefault.js";export{useDidUpdate}from"./hooks/useDidUpdate/useDidUpdate.js";export{useDocumentEvent}from"./hooks/useDocumentEvent/useDocumentEvent.js";export{useDocumentTitle}from"./hooks/useDocumentTitle/useDocumentTitle.js";export{useDocumentVisibility}from"./hooks/useDocumentVisibility/useDocumentVisibility.js";export{useEvent}from"./hooks/useEvent/useEvent.js";export{useEventListener}from"./hooks/useEventListener/useEventListener.js";export{useEyeDropper}from"./hooks/useEyeDropper/useEyeDropper.js";export{useFavicon}from"./hooks/useFavicon/useFavicon.js";export{useField}from"./hooks/useField/useField.js";export{useFps}from"./hooks/useFps/useFps.js";export{useFullscreen}from"./hooks/useFullscreen/useFullscreen.js";export{useHash}from"./hooks/useHash/useHash.js";export{isHotkeyMatch,useHotkeys}from"./hooks/useHotkeys/useHotkeys.js";export{useHover}from"./hooks/useHover/useHover.js";export{useIdle}from"./hooks/useIdle/useIdle.js";export{useIntersectionObserver}from"./hooks/useIntersectionObserver/useIntersectionObserver.js";export{useInterval}from"./hooks/useInterval/useInterval.js";export{useIsFirstRender}from"./hooks/useIsFirstRender/useIsFirstRender.js";export{useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";export{useKeyboard}from"./hooks/useKeyboard/useKeyboard.js";export{useKeyPress}from"./hooks/useKeyPress/useKeyPress.js";export{useKeyPressEvent}from"./hooks/useKeyPressEvent/useKeyPressEvent.js";export{useKeysPressed}from"./hooks/useKeysPressed/useKeysPressed.js";export{useList}from"./hooks/useList/useList.js";export{useLocalStorage}from"./hooks/useLocalStorage/useLocalStorage.js";export{useLogger}from"./hooks/useLogger/useLogger.js";export{useLongPress}from"./hooks/useLongPress/useLongPress.js";export{useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";export{useMount}from"./hooks/useMount/useMount.js";export{useMouse}from"./hooks/useMouse/useMouse.js";export{useMutation}from"./hooks/useMutation/useMutation.js";export{getConnection,useNetwork}from"./hooks/useNetwork/useNetwork.js";export{useOnline}from"./hooks/useOnline/useOnline.js";export{getOperatingSystem,useOperatingSystem}from"./hooks/useOperatingSystem/useOperatingSystem.js";export{useOrientation}from"./hooks/useOrientation/useOrientation.js";export{usePageLeave}from"./hooks/usePageLeave/usePageLeave.js";export{getTargetElement,usePaint}from"./hooks/usePaint/usePaint.js";export{usePreferredColorScheme}from"./hooks/usePreferredColorScheme/usePreferredColorScheme.js";export{usePreferredLanguages}from"./hooks/usePreferredLanguages/usePreferredLanguages.js";export{usePrevious}from"./hooks/usePrevious/usePrevious.js";export{useQRCode}from"./hooks/useQRCode/useQRCode.js";export{useQuery}from"./hooks/useQuery/useQuery.js";export{useQueue}from"./hooks/useQueue/useQueue.js";export{useRenderCount}from"./hooks/useRenderCount/useRenderCount.js";export{useRenderInfo}from"./hooks/useRenderInfo/useRenderInfo.js";export{useRerender}from"./hooks/useRerender/useRerender.js";export{SCRIPT_STATUS_ATTRIBUTE_NAME,useScript}from"./hooks/useScript/useScript.js";export{useSessionStorage}from"./hooks/useSessionStorage/useSessionStorage.js";export{useSet}from"./hooks/useSet/useSet.js";export{useStep}from"./hooks/useStep/useStep.js";export{dispatchStorageEvent,useStorage}from"./hooks/useStorage/useStorage.js";export{getRangesSelection,useTextSelection}from"./hooks/useTextSelection/useTextSelection.js";export{useTime}from"./hooks/useTime/useTime.js";export{useTimeout}from"./hooks/useTimeout/useTimeout.js";export{useToggle}from"./hooks/useToggle/useToggle.js";export{useUnmount}from"./hooks/useUnmount/useUnmount.js";export{useWebSocket}from"./hooks/useWebSocket/useWebSocket.js";export{useWindowEvent}from"./hooks/useWindowEvent/useWindowEvent.js";export{useWindowSize}from"./hooks/useWindowSize/useWindowSize.js";export{debounce}from"./utils/helpers/debounce.js";export{getRetry}from"./utils/helpers/getRetry.js";export{isClient}from"./utils/helpers/isClient.js";export{throttle}from"./utils/helpers/throttle.js";export{getDate}from"./utils/helpers/time/getDate.js";import"./_rollupPluginBabelHelpers-BO0nvURb.js";import"react";import"./hooks/useMutationObserver.js";import"screenfull";import"qrcode";import"react-dom";
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
+ export{useBattery}from"./hooks/useBattery/useBattery.js";export{useBoolean}from"./hooks/useBoolean/useBoolean.js";export{useBrowserLanguage}from"./hooks/useBrowserLanguage/useBrowserLanguage.js";export{useClickOutside}from"./hooks/useClickOutside/useClickOutside.js";export{legacyCopyToClipboard,useCopyToClipboard}from"./hooks/useCopyToClipboard/useCopyToClipboard.js";export{useCounter}from"./hooks/useCounter/useCounter.js";export{useDebouncedValue}from"./hooks/useDebouncedValue/useDebouncedValue.js";export{useDefault}from"./hooks/useDefault/useDefault.js";export{useDidUpdate}from"./hooks/useDidUpdate/useDidUpdate.js";export{useDocumentEvent}from"./hooks/useDocumentEvent/useDocumentEvent.js";export{useDocumentTitle}from"./hooks/useDocumentTitle/useDocumentTitle.js";export{useDocumentVisibility}from"./hooks/useDocumentVisibility/useDocumentVisibility.js";export{useEvent}from"./hooks/useEvent/useEvent.js";export{useEventListener}from"./hooks/useEventListener/useEventListener.js";export{useEyeDropper}from"./hooks/useEyeDropper/useEyeDropper.js";export{useFavicon}from"./hooks/useFavicon/useFavicon.js";export{useField}from"./hooks/useField/useField.js";export{useFps}from"./hooks/useFps/useFps.js";export{useFullscreen}from"./hooks/useFullscreen/useFullscreen.js";export{useHash}from"./hooks/useHash/useHash.js";export{isHotkeyMatch,useHotkeys}from"./hooks/useHotkeys/useHotkeys.js";export{useHover}from"./hooks/useHover/useHover.js";export{useIdle}from"./hooks/useIdle/useIdle.js";export{useIntersectionObserver}from"./hooks/useIntersectionObserver/useIntersectionObserver.js";export{useInterval}from"./hooks/useInterval/useInterval.js";export{useIsFirstRender}from"./hooks/useIsFirstRender/useIsFirstRender.js";export{useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";export{useKeyboard}from"./hooks/useKeyboard/useKeyboard.js";export{useKeyPress}from"./hooks/useKeyPress/useKeyPress.js";export{useKeyPressEvent}from"./hooks/useKeyPressEvent/useKeyPressEvent.js";export{useKeysPressed}from"./hooks/useKeysPressed/useKeysPressed.js";export{useList}from"./hooks/useList/useList.js";export{useLocalStorage}from"./hooks/useLocalStorage/useLocalStorage.js";export{useLogger}from"./hooks/useLogger/useLogger.js";export{useLongPress}from"./hooks/useLongPress/useLongPress.js";export{useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";export{useMount}from"./hooks/useMount/useMount.js";export{useMouse}from"./hooks/useMouse/useMouse.js";export{useMutation}from"./hooks/useMutation/useMutation.js";export{getConnection,useNetwork}from"./hooks/useNetwork/useNetwork.js";export{useOnline}from"./hooks/useOnline/useOnline.js";export{getOperatingSystem,useOperatingSystem}from"./hooks/useOperatingSystem/useOperatingSystem.js";export{useOrientation}from"./hooks/useOrientation/useOrientation.js";export{usePageLeave}from"./hooks/usePageLeave/usePageLeave.js";export{getTargetElement,usePaint}from"./hooks/usePaint/usePaint.js";export{usePreferredColorScheme}from"./hooks/usePreferredColorScheme/usePreferredColorScheme.js";export{usePreferredLanguages}from"./hooks/usePreferredLanguages/usePreferredLanguages.js";export{usePrevious}from"./hooks/usePrevious/usePrevious.js";export{useQRCode}from"./hooks/useQRCode/useQRCode.js";export{useQuery}from"./hooks/useQuery/useQuery.js";export{useQueue}from"./hooks/useQueue/useQueue.js";export{useRenderCount}from"./hooks/useRenderCount/useRenderCount.js";export{useRenderInfo}from"./hooks/useRenderInfo/useRenderInfo.js";export{useRerender}from"./hooks/useRerender/useRerender.js";export{SCRIPT_STATUS_ATTRIBUTE_NAME,useScript}from"./hooks/useScript/useScript.js";export{useSessionStorage}from"./hooks/useSessionStorage/useSessionStorage.js";export{useSet}from"./hooks/useSet/useSet.js";export{useStep}from"./hooks/useStep/useStep.js";export{dispatchStorageEvent,useStorage}from"./hooks/useStorage/useStorage.js";export{getRangesSelection,useTextSelection}from"./hooks/useTextSelection/useTextSelection.js";export{useTime}from"./hooks/useTime/useTime.js";export{useTimeout}from"./hooks/useTimeout/useTimeout.js";export{useToggle}from"./hooks/useToggle/useToggle.js";export{useUnmount}from"./hooks/useUnmount/useUnmount.js";export{useWebSocket}from"./hooks/useWebSocket/useWebSocket.js";export{useWindowEvent}from"./hooks/useWindowEvent/useWindowEvent.js";export{useWindowSize}from"./hooks/useWindowSize/useWindowSize.js";export{debounce}from"./utils/helpers/debounce.js";export{getRetry}from"./utils/helpers/getRetry.js";export{isClient}from"./utils/helpers/isClient.js";export{throttle}from"./utils/helpers/throttle.js";export{getDate}from"./utils/helpers/time/getDate.js";import"./_rollupPluginBabelHelpers-MCjhm_0B.js";import"react";import"./hooks/useDebouncedCallback/useDebouncedCallback.js";import"./hooks/useMutationObserver.js";import"screenfull";import"qrcode";import"react-dom";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
2
  var r=function(r,n){var t;return function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];clearTimeout(t),t=setTimeout((function(){return r.apply(void 0,o)}),n)}};export{r as debounce};
3
3
  //# sourceMappingURL=debounce.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
2
  var r=function(r){return"number"==typeof r?r:r?1:0};export{r as getRetry};
3
3
  //# sourceMappingURL=getRetry.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
2
  export{debounce}from"./debounce.js";export{getRetry}from"./getRetry.js";export{isClient}from"./isClient.js";export{throttle}from"./throttle.js";export{getDate}from"./time/getDate.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
2
  var n,d,e=!("undefined"==typeof window||null===(n=window)||void 0===n||!n.document||null===(d=window)||void 0===d||null===(d=d.document)||void 0===d||!d.createElement);export{e as isClient};
3
3
  //# sourceMappingURL=isClient.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
2
  var n=function(n,t){var o=!1;return function(){o||(n.apply(void 0,arguments),o=!0,setTimeout((function(){o=!1}),t))}};export{n as throttle};
3
3
  //# sourceMappingURL=throttle.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.30 */
1
+ /* @license @siberiacancode/reactuse v0.0.32 */
2
2
  var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getSeconds(),n=e.getMinutes(),r=e.getHours();return{seconds:t,minutes:n,hours:r,meridiemHours:{value:r%12==0?12:r%12,type:r>=12?"pm":"am"},day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear(),timestamp:e.getTime()}};export{e as getDate};
3
3
  //# sourceMappingURL=getDate.js.map