@siberiacancode/reactuse 0.0.28 → 0.0.31

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 (280) hide show
  1. package/dist/cjs/{_rollupPluginBabelHelpers-CntznmQ7.js → _rollupPluginBabelHelpers-XknWBRG7.js} +2 -2
  2. package/dist/cjs/_rollupPluginBabelHelpers-XknWBRG7.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/useDebouncedValue/useDebouncedValue.js +2 -2
  16. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js.map +1 -1
  17. package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
  18. package/dist/cjs/hooks/useDefault/useDefault.js.map +1 -1
  19. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
  20. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js.map +1 -1
  21. package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
  22. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  23. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js.map +1 -1
  24. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  25. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js.map +1 -1
  26. package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
  27. package/dist/cjs/hooks/useEvent/useEvent.js.map +1 -1
  28. package/dist/cjs/hooks/useEventListener/useEventListener.js +1 -1
  29. package/dist/cjs/hooks/useEventListener/useEventListener.js.map +1 -1
  30. package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
  31. package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js.map +1 -1
  32. package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
  33. package/dist/cjs/hooks/useFavicon/useFavicon.js.map +1 -1
  34. package/dist/cjs/hooks/useField/useField.js +3 -0
  35. package/dist/cjs/hooks/useField/useField.js.map +1 -0
  36. package/dist/cjs/hooks/useFps/useFps.js +2 -2
  37. package/dist/cjs/hooks/useFps/useFps.js.map +1 -1
  38. package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
  39. package/dist/cjs/hooks/useFullscreen/useFullscreen.js.map +1 -1
  40. package/dist/cjs/hooks/useHash/useHash.js +2 -2
  41. package/dist/cjs/hooks/useHash/useHash.js.map +1 -1
  42. package/dist/cjs/hooks/useHotkeys/useHotkeys.js +2 -2
  43. package/dist/cjs/hooks/useHotkeys/useHotkeys.js.map +1 -1
  44. package/dist/cjs/hooks/useHover/useHover.js +2 -2
  45. package/dist/cjs/hooks/useHover/useHover.js.map +1 -1
  46. package/dist/cjs/hooks/useIdle/useIdle.js +2 -2
  47. package/dist/cjs/hooks/useIdle/useIdle.js.map +1 -1
  48. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  49. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
  50. package/dist/cjs/hooks/useInterval/useInterval.js +2 -2
  51. package/dist/cjs/hooks/useInterval/useInterval.js.map +1 -1
  52. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  53. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js.map +1 -1
  54. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  55. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js.map +1 -1
  56. package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
  57. package/dist/cjs/hooks/useKeyPress/useKeyPress.js.map +1 -1
  58. package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  59. package/dist/cjs/hooks/useKeyboard/useKeyboard.js +1 -1
  60. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
  61. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
  62. package/dist/cjs/hooks/useList/useList.js +2 -2
  63. package/dist/cjs/hooks/useList/useList.js.map +1 -1
  64. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
  65. package/dist/cjs/hooks/useLogger/useLogger.js +2 -2
  66. package/dist/cjs/hooks/useLogger/useLogger.js.map +1 -1
  67. package/dist/cjs/hooks/useLongPress/useLongPress.js +2 -2
  68. package/dist/cjs/hooks/useLongPress/useLongPress.js.map +1 -1
  69. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +1 -1
  70. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js.map +1 -1
  71. package/dist/cjs/hooks/useMount/useMount.js +1 -1
  72. package/dist/cjs/hooks/useMount/useMount.js.map +1 -1
  73. package/dist/cjs/hooks/useMouse/useMouse.js +2 -2
  74. package/dist/cjs/hooks/useMouse/useMouse.js.map +1 -1
  75. package/dist/cjs/hooks/useMutation/useMutation.js +2 -2
  76. package/dist/cjs/hooks/useMutation/useMutation.js.map +1 -1
  77. package/dist/cjs/hooks/useMutationObserver.js +1 -1
  78. package/dist/cjs/hooks/useMutationObserver.js.map +1 -1
  79. package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
  80. package/dist/cjs/hooks/useNetwork/useNetwork.js.map +1 -1
  81. package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
  82. package/dist/cjs/hooks/useOnline/useOnline.js.map +1 -1
  83. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  84. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js.map +1 -1
  85. package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
  86. package/dist/cjs/hooks/useOrientation/useOrientation.js.map +1 -1
  87. package/dist/cjs/hooks/usePageLeave/usePageLeave.js +2 -2
  88. package/dist/cjs/hooks/usePageLeave/usePageLeave.js.map +1 -1
  89. package/dist/cjs/hooks/usePaint/usePaint.js +2 -2
  90. package/dist/cjs/hooks/usePaint/usePaint.js.map +1 -1
  91. package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  92. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
  93. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js.map +1 -1
  94. package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
  95. package/dist/cjs/hooks/usePrevious/usePrevious.js.map +1 -1
  96. package/dist/cjs/hooks/useQRCode/useQRCode.js +2 -2
  97. package/dist/cjs/hooks/useQRCode/useQRCode.js.map +1 -1
  98. package/dist/cjs/hooks/useQuery/useQuery.js +2 -2
  99. package/dist/cjs/hooks/useQuery/useQuery.js.map +1 -1
  100. package/dist/cjs/hooks/useQueue/useQueue.js +2 -2
  101. package/dist/cjs/hooks/useQueue/useQueue.js.map +1 -1
  102. package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
  103. package/dist/cjs/hooks/useRenderCount/useRenderCount.js.map +1 -1
  104. package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js +1 -1
  105. package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js.map +1 -1
  106. package/dist/cjs/hooks/useRerender/useRerender.js +2 -2
  107. package/dist/cjs/hooks/useRerender/useRerender.js.map +1 -1
  108. package/dist/cjs/hooks/useScript/useScript.js +2 -2
  109. package/dist/cjs/hooks/useScript/useScript.js.map +1 -1
  110. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
  111. package/dist/cjs/hooks/useSet/useSet.js +2 -2
  112. package/dist/cjs/hooks/useSet/useSet.js.map +1 -1
  113. package/dist/cjs/hooks/useStep/useStep.js +2 -2
  114. package/dist/cjs/hooks/useStep/useStep.js.map +1 -1
  115. package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
  116. package/dist/cjs/hooks/useStorage/useStorage.js.map +1 -1
  117. package/dist/cjs/hooks/useTextSelection/useTextSelection.js +2 -2
  118. package/dist/cjs/hooks/useTextSelection/useTextSelection.js.map +1 -1
  119. package/dist/cjs/hooks/useTime/useTime.js +2 -2
  120. package/dist/cjs/hooks/useTime/useTime.js.map +1 -1
  121. package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
  122. package/dist/cjs/hooks/useTimeout/useTimeout.js.map +1 -1
  123. package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
  124. package/dist/cjs/hooks/useToggle/useToggle.js.map +1 -1
  125. package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
  126. package/dist/cjs/hooks/useUnmount/useUnmount.js.map +1 -1
  127. package/dist/cjs/hooks/useWebSocket/useWebSocket.js +2 -2
  128. package/dist/cjs/hooks/useWebSocket/useWebSocket.js.map +1 -1
  129. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +1 -1
  130. package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
  131. package/dist/cjs/hooks/useWindowSize/useWindowSize.js.map +1 -1
  132. package/dist/cjs/index.js +2 -2
  133. package/dist/cjs/utils/helpers/debounce.js +1 -1
  134. package/dist/cjs/utils/helpers/getRetry.js +1 -1
  135. package/dist/cjs/utils/helpers/index.js +1 -1
  136. package/dist/cjs/utils/helpers/isClient.js +1 -1
  137. package/dist/cjs/utils/helpers/throttle.js +1 -1
  138. package/dist/cjs/utils/helpers/time/getDate.js +1 -1
  139. package/dist/esm/{_rollupPluginBabelHelpers-DsV9C8-q.js → _rollupPluginBabelHelpers-DmI4-Pc6.js} +2 -2
  140. package/dist/esm/_rollupPluginBabelHelpers-DmI4-Pc6.js.map +1 -0
  141. package/dist/esm/hooks/index.js +2 -2
  142. package/dist/esm/hooks/useBattery/useBattery.js +2 -2
  143. package/dist/esm/hooks/useBattery/useBattery.js.map +1 -1
  144. package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
  145. package/dist/esm/hooks/useBoolean/useBoolean.js.map +1 -1
  146. package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
  147. package/dist/esm/hooks/useClickOutside/useClickOutside.js +2 -2
  148. package/dist/esm/hooks/useClickOutside/useClickOutside.js.map +1 -1
  149. package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  150. package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js.map +1 -1
  151. package/dist/esm/hooks/useCounter/useCounter.js +2 -2
  152. package/dist/esm/hooks/useCounter/useCounter.js.map +1 -1
  153. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  154. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js.map +1 -1
  155. package/dist/esm/hooks/useDefault/useDefault.js +2 -2
  156. package/dist/esm/hooks/useDefault/useDefault.js.map +1 -1
  157. package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +2 -2
  158. package/dist/esm/hooks/useDidUpdate/useDidUpdate.js.map +1 -1
  159. package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
  160. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  161. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js.map +1 -1
  162. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +2 -2
  163. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js.map +1 -1
  164. package/dist/esm/hooks/useEvent/useEvent.js +2 -2
  165. package/dist/esm/hooks/useEvent/useEvent.js.map +1 -1
  166. package/dist/esm/hooks/useEventListener/useEventListener.js +2 -2
  167. package/dist/esm/hooks/useEventListener/useEventListener.js.map +1 -1
  168. package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
  169. package/dist/esm/hooks/useEyeDropper/useEyeDropper.js.map +1 -1
  170. package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
  171. package/dist/esm/hooks/useFavicon/useFavicon.js.map +1 -1
  172. package/dist/esm/hooks/useField/useField.js +3 -0
  173. package/dist/esm/hooks/useField/useField.js.map +1 -0
  174. package/dist/esm/hooks/useFps/useFps.js +2 -2
  175. package/dist/esm/hooks/useFps/useFps.js.map +1 -1
  176. package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
  177. package/dist/esm/hooks/useFullscreen/useFullscreen.js.map +1 -1
  178. package/dist/esm/hooks/useHash/useHash.js +2 -2
  179. package/dist/esm/hooks/useHash/useHash.js.map +1 -1
  180. package/dist/esm/hooks/useHotkeys/useHotkeys.js +2 -2
  181. package/dist/esm/hooks/useHotkeys/useHotkeys.js.map +1 -1
  182. package/dist/esm/hooks/useHover/useHover.js +2 -2
  183. package/dist/esm/hooks/useHover/useHover.js.map +1 -1
  184. package/dist/esm/hooks/useIdle/useIdle.js +2 -2
  185. package/dist/esm/hooks/useIdle/useIdle.js.map +1 -1
  186. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  187. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
  188. package/dist/esm/hooks/useInterval/useInterval.js +2 -2
  189. package/dist/esm/hooks/useInterval/useInterval.js.map +1 -1
  190. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +2 -2
  191. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js.map +1 -1
  192. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +2 -2
  193. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js.map +1 -1
  194. package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
  195. package/dist/esm/hooks/useKeyPress/useKeyPress.js.map +1 -1
  196. package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  197. package/dist/esm/hooks/useKeyboard/useKeyboard.js +1 -1
  198. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
  199. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
  200. package/dist/esm/hooks/useList/useList.js +2 -2
  201. package/dist/esm/hooks/useList/useList.js.map +1 -1
  202. package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
  203. package/dist/esm/hooks/useLogger/useLogger.js +2 -2
  204. package/dist/esm/hooks/useLogger/useLogger.js.map +1 -1
  205. package/dist/esm/hooks/useLongPress/useLongPress.js +2 -2
  206. package/dist/esm/hooks/useLongPress/useLongPress.js.map +1 -1
  207. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +2 -2
  208. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js.map +1 -1
  209. package/dist/esm/hooks/useMount/useMount.js +2 -2
  210. package/dist/esm/hooks/useMount/useMount.js.map +1 -1
  211. package/dist/esm/hooks/useMouse/useMouse.js +2 -2
  212. package/dist/esm/hooks/useMouse/useMouse.js.map +1 -1
  213. package/dist/esm/hooks/useMutation/useMutation.js +2 -2
  214. package/dist/esm/hooks/useMutation/useMutation.js.map +1 -1
  215. package/dist/esm/hooks/useMutationObserver.js +2 -2
  216. package/dist/esm/hooks/useMutationObserver.js.map +1 -1
  217. package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
  218. package/dist/esm/hooks/useNetwork/useNetwork.js.map +1 -1
  219. package/dist/esm/hooks/useOnline/useOnline.js +2 -2
  220. package/dist/esm/hooks/useOnline/useOnline.js.map +1 -1
  221. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +2 -2
  222. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js.map +1 -1
  223. package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
  224. package/dist/esm/hooks/useOrientation/useOrientation.js.map +1 -1
  225. package/dist/esm/hooks/usePageLeave/usePageLeave.js +2 -2
  226. package/dist/esm/hooks/usePageLeave/usePageLeave.js.map +1 -1
  227. package/dist/esm/hooks/usePaint/usePaint.js +2 -2
  228. package/dist/esm/hooks/usePaint/usePaint.js.map +1 -1
  229. package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  230. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +2 -2
  231. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js.map +1 -1
  232. package/dist/esm/hooks/usePrevious/usePrevious.js +2 -2
  233. package/dist/esm/hooks/usePrevious/usePrevious.js.map +1 -1
  234. package/dist/esm/hooks/useQRCode/useQRCode.js +2 -2
  235. package/dist/esm/hooks/useQRCode/useQRCode.js.map +1 -1
  236. package/dist/esm/hooks/useQuery/useQuery.js +2 -2
  237. package/dist/esm/hooks/useQuery/useQuery.js.map +1 -1
  238. package/dist/esm/hooks/useQueue/useQueue.js +2 -2
  239. package/dist/esm/hooks/useQueue/useQueue.js.map +1 -1
  240. package/dist/esm/hooks/useRenderCount/useRenderCount.js +2 -2
  241. package/dist/esm/hooks/useRenderCount/useRenderCount.js.map +1 -1
  242. package/dist/esm/hooks/useRenderInfo/useRenderInfo.js +2 -2
  243. package/dist/esm/hooks/useRenderInfo/useRenderInfo.js.map +1 -1
  244. package/dist/esm/hooks/useRerender/useRerender.js +2 -2
  245. package/dist/esm/hooks/useRerender/useRerender.js.map +1 -1
  246. package/dist/esm/hooks/useScript/useScript.js +2 -2
  247. package/dist/esm/hooks/useScript/useScript.js.map +1 -1
  248. package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
  249. package/dist/esm/hooks/useSet/useSet.js +2 -2
  250. package/dist/esm/hooks/useSet/useSet.js.map +1 -1
  251. package/dist/esm/hooks/useStep/useStep.js +2 -2
  252. package/dist/esm/hooks/useStep/useStep.js.map +1 -1
  253. package/dist/esm/hooks/useStorage/useStorage.js +2 -2
  254. package/dist/esm/hooks/useStorage/useStorage.js.map +1 -1
  255. package/dist/esm/hooks/useTextSelection/useTextSelection.js +2 -2
  256. package/dist/esm/hooks/useTextSelection/useTextSelection.js.map +1 -1
  257. package/dist/esm/hooks/useTime/useTime.js +2 -2
  258. package/dist/esm/hooks/useTime/useTime.js.map +1 -1
  259. package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
  260. package/dist/esm/hooks/useTimeout/useTimeout.js.map +1 -1
  261. package/dist/esm/hooks/useToggle/useToggle.js +2 -2
  262. package/dist/esm/hooks/useToggle/useToggle.js.map +1 -1
  263. package/dist/esm/hooks/useUnmount/useUnmount.js +2 -2
  264. package/dist/esm/hooks/useUnmount/useUnmount.js.map +1 -1
  265. package/dist/esm/hooks/useWebSocket/useWebSocket.js +2 -2
  266. package/dist/esm/hooks/useWebSocket/useWebSocket.js.map +1 -1
  267. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +1 -1
  268. package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
  269. package/dist/esm/hooks/useWindowSize/useWindowSize.js.map +1 -1
  270. package/dist/esm/index.js +2 -2
  271. package/dist/esm/utils/helpers/debounce.js +1 -1
  272. package/dist/esm/utils/helpers/getRetry.js +1 -1
  273. package/dist/esm/utils/helpers/index.js +1 -1
  274. package/dist/esm/utils/helpers/isClient.js +1 -1
  275. package/dist/esm/utils/helpers/throttle.js +1 -1
  276. package/dist/esm/utils/helpers/time/getDate.js +1 -1
  277. package/dist/index.d.ts +186 -39
  278. package/package.json +1 -1
  279. package/dist/cjs/_rollupPluginBabelHelpers-CntznmQ7.js.map +0 -1
  280. package/dist/esm/_rollupPluginBabelHelpers-DsV9C8-q.js.map +0 -1
@@ -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.28 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-DsV9C8-q.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.31 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-DmI4-Pc6.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.28 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-DsV9C8-q.js";import t from"react";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";import{getDate as r}from"../../utils/helpers/time/getDate.js";import"screenfull";import{useInterval as o}from"../useInterval/useInterval.js";import"react-dom";import"../useEvent/useEvent.js";var s=function(){var s=t.useState(r()),i=e(s,2),u=i[0],m=i[1];return o((function(){return m(r())}),1e3),u};export{s as useTime};
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
2
+ import{_ as r}from"../../_rollupPluginBabelHelpers-DmI4-Pc6.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":";kYA0BaA,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.28 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-DsV9C8-q.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.31 */
2
+ import{_ as r}from"../../_rollupPluginBabelHelpers-DmI4-Pc6.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.28 */
2
- import{_ as r}from"../../_rollupPluginBabelHelpers-DsV9C8-q.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.31 */
2
+ import{_ as r}from"../../_rollupPluginBabelHelpers-DmI4-Pc6.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.28 */
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.31 */
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.28 */
2
- import{_ as n}from"../../_rollupPluginBabelHelpers-DsV9C8-q.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.31 */
2
+ import{_ as n}from"../../_rollupPluginBabelHelpers-DmI4-Pc6.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.28 */
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
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.28 */
2
- import{_ as i}from"../../_rollupPluginBabelHelpers-DsV9C8-q.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.31 */
2
+ import{_ as i}from"../../_rollupPluginBabelHelpers-DmI4-Pc6.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.28 */
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{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{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{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-DsV9C8-q.js";import"react";import"./hooks/useMutationObserver.js";import"screenfull";import"react-dom";
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
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-DmI4-Pc6.js";import"react";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.28 */
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
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.28 */
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
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.28 */
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
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.28 */
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
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.28 */
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
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.28 */
1
+ /* @license @siberiacancode/reactuse v0.0.31 */
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