@siberiacancode/reactuse 0.0.28 → 0.0.30

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 (166) hide show
  1. package/dist/cjs/{_rollupPluginBabelHelpers-CntznmQ7.js → _rollupPluginBabelHelpers-B5ln7UDR.js} +2 -2
  2. package/dist/cjs/_rollupPluginBabelHelpers-B5ln7UDR.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/useBrowserLanguage/useBrowserLanguage.js +1 -1
  8. package/dist/cjs/hooks/useClickOutside/useClickOutside.js +1 -1
  9. package/dist/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  10. package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
  11. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  12. package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
  13. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
  14. package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
  15. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  16. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  17. package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
  18. package/dist/cjs/hooks/useEventListener/useEventListener.js +1 -1
  19. package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
  20. package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
  21. package/dist/cjs/hooks/useField/useField.js +3 -0
  22. package/dist/cjs/hooks/useField/useField.js.map +1 -0
  23. package/dist/cjs/hooks/useFps/useFps.js +2 -2
  24. package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
  25. package/dist/cjs/hooks/useHash/useHash.js +2 -2
  26. package/dist/cjs/hooks/useHotkeys/useHotkeys.js +2 -2
  27. package/dist/cjs/hooks/useHover/useHover.js +2 -2
  28. package/dist/cjs/hooks/useIdle/useIdle.js +2 -2
  29. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  30. package/dist/cjs/hooks/useInterval/useInterval.js +2 -2
  31. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  32. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  33. package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
  34. package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  35. package/dist/cjs/hooks/useKeyboard/useKeyboard.js +1 -1
  36. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
  37. package/dist/cjs/hooks/useList/useList.js +2 -2
  38. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
  39. package/dist/cjs/hooks/useLogger/useLogger.js +2 -2
  40. package/dist/cjs/hooks/useLongPress/useLongPress.js +2 -2
  41. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +1 -1
  42. package/dist/cjs/hooks/useMount/useMount.js +1 -1
  43. package/dist/cjs/hooks/useMouse/useMouse.js +2 -2
  44. package/dist/cjs/hooks/useMutation/useMutation.js +2 -2
  45. package/dist/cjs/hooks/useMutationObserver.js +1 -1
  46. package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
  47. package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
  48. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  49. package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
  50. package/dist/cjs/hooks/usePageLeave/usePageLeave.js +2 -2
  51. package/dist/cjs/hooks/usePaint/usePaint.js +2 -2
  52. package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  53. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
  54. package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
  55. package/dist/cjs/hooks/useQRCode/useQRCode.js +2 -2
  56. package/dist/cjs/hooks/useQuery/useQuery.js +2 -2
  57. package/dist/cjs/hooks/useQueue/useQueue.js +2 -2
  58. package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
  59. package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js +1 -1
  60. package/dist/cjs/hooks/useRerender/useRerender.js +2 -2
  61. package/dist/cjs/hooks/useScript/useScript.js +2 -2
  62. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
  63. package/dist/cjs/hooks/useSet/useSet.js +2 -2
  64. package/dist/cjs/hooks/useStep/useStep.js +2 -2
  65. package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
  66. package/dist/cjs/hooks/useTextSelection/useTextSelection.js +2 -2
  67. package/dist/cjs/hooks/useTime/useTime.js +2 -2
  68. package/dist/cjs/hooks/useTime/useTime.js.map +1 -1
  69. package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
  70. package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
  71. package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
  72. package/dist/cjs/hooks/useWebSocket/useWebSocket.js +2 -2
  73. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +1 -1
  74. package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
  75. package/dist/cjs/index.js +2 -2
  76. package/dist/cjs/utils/helpers/debounce.js +1 -1
  77. package/dist/cjs/utils/helpers/getRetry.js +1 -1
  78. package/dist/cjs/utils/helpers/index.js +1 -1
  79. package/dist/cjs/utils/helpers/isClient.js +1 -1
  80. package/dist/cjs/utils/helpers/throttle.js +1 -1
  81. package/dist/cjs/utils/helpers/time/getDate.js +1 -1
  82. package/dist/esm/{_rollupPluginBabelHelpers-DsV9C8-q.js → _rollupPluginBabelHelpers-BO0nvURb.js} +2 -2
  83. package/dist/esm/_rollupPluginBabelHelpers-BO0nvURb.js.map +1 -0
  84. package/dist/esm/hooks/index.js +2 -2
  85. package/dist/esm/hooks/useBattery/useBattery.js +2 -2
  86. package/dist/esm/hooks/useBattery/useBattery.js.map +1 -1
  87. package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
  88. package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
  89. package/dist/esm/hooks/useClickOutside/useClickOutside.js +1 -1
  90. package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  91. package/dist/esm/hooks/useCounter/useCounter.js +2 -2
  92. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  93. package/dist/esm/hooks/useDefault/useDefault.js +2 -2
  94. package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +1 -1
  95. package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
  96. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  97. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  98. package/dist/esm/hooks/useEvent/useEvent.js +1 -1
  99. package/dist/esm/hooks/useEventListener/useEventListener.js +1 -1
  100. package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
  101. package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
  102. package/dist/esm/hooks/useField/useField.js +3 -0
  103. package/dist/esm/hooks/useField/useField.js.map +1 -0
  104. package/dist/esm/hooks/useFps/useFps.js +2 -2
  105. package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
  106. package/dist/esm/hooks/useHash/useHash.js +2 -2
  107. package/dist/esm/hooks/useHotkeys/useHotkeys.js +2 -2
  108. package/dist/esm/hooks/useHover/useHover.js +2 -2
  109. package/dist/esm/hooks/useIdle/useIdle.js +2 -2
  110. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  111. package/dist/esm/hooks/useInterval/useInterval.js +2 -2
  112. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  113. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  114. package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
  115. package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  116. package/dist/esm/hooks/useKeyboard/useKeyboard.js +1 -1
  117. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
  118. package/dist/esm/hooks/useList/useList.js +2 -2
  119. package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
  120. package/dist/esm/hooks/useLogger/useLogger.js +2 -2
  121. package/dist/esm/hooks/useLongPress/useLongPress.js +2 -2
  122. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +1 -1
  123. package/dist/esm/hooks/useMount/useMount.js +1 -1
  124. package/dist/esm/hooks/useMouse/useMouse.js +2 -2
  125. package/dist/esm/hooks/useMutation/useMutation.js +2 -2
  126. package/dist/esm/hooks/useMutationObserver.js +1 -1
  127. package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
  128. package/dist/esm/hooks/useOnline/useOnline.js +1 -1
  129. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  130. package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
  131. package/dist/esm/hooks/usePageLeave/usePageLeave.js +2 -2
  132. package/dist/esm/hooks/usePaint/usePaint.js +2 -2
  133. package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  134. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
  135. package/dist/esm/hooks/usePrevious/usePrevious.js +1 -1
  136. package/dist/esm/hooks/useQRCode/useQRCode.js +2 -2
  137. package/dist/esm/hooks/useQuery/useQuery.js +2 -2
  138. package/dist/esm/hooks/useQueue/useQueue.js +2 -2
  139. package/dist/esm/hooks/useRenderCount/useRenderCount.js +1 -1
  140. package/dist/esm/hooks/useRenderInfo/useRenderInfo.js +1 -1
  141. package/dist/esm/hooks/useRerender/useRerender.js +2 -2
  142. package/dist/esm/hooks/useScript/useScript.js +2 -2
  143. package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
  144. package/dist/esm/hooks/useSet/useSet.js +2 -2
  145. package/dist/esm/hooks/useStep/useStep.js +2 -2
  146. package/dist/esm/hooks/useStorage/useStorage.js +2 -2
  147. package/dist/esm/hooks/useTextSelection/useTextSelection.js +2 -2
  148. package/dist/esm/hooks/useTime/useTime.js +2 -2
  149. package/dist/esm/hooks/useTime/useTime.js.map +1 -1
  150. package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
  151. package/dist/esm/hooks/useToggle/useToggle.js +2 -2
  152. package/dist/esm/hooks/useUnmount/useUnmount.js +1 -1
  153. package/dist/esm/hooks/useWebSocket/useWebSocket.js +2 -2
  154. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +1 -1
  155. package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
  156. package/dist/esm/index.js +2 -2
  157. package/dist/esm/utils/helpers/debounce.js +1 -1
  158. package/dist/esm/utils/helpers/getRetry.js +1 -1
  159. package/dist/esm/utils/helpers/index.js +1 -1
  160. package/dist/esm/utils/helpers/isClient.js +1 -1
  161. package/dist/esm/utils/helpers/throttle.js +1 -1
  162. package/dist/esm/utils/helpers/time/getDate.js +1 -1
  163. package/dist/index.d.ts +149 -1
  164. package/package.json +1 -1
  165. package/dist/cjs/_rollupPluginBabelHelpers-CntznmQ7.js.map +0 -1
  166. package/dist/esm/_rollupPluginBabelHelpers-DsV9C8-q.js.map +0 -1
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.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";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.28 */
1
+ /* @license @siberiacancode/reactuse v0.0.30 */
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.30 */
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.30 */
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.30 */
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.30 */
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.30 */
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
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import QRCode from 'qrcode';
2
3
 
3
4
  /** State for hook use battery */
4
5
  interface UseBatteryStateReturn {
@@ -305,6 +306,101 @@ declare const useFavicon: (initialHref?: string) => {
305
306
  readonly set: (favicon: string) => void;
306
307
  };
307
308
 
309
+ /** The use field params */
310
+ interface UseFieldParams<Value> {
311
+ /** The initial value */
312
+ initialValue?: Value;
313
+ /** The initial touched */
314
+ initialTouched?: boolean;
315
+ /** The auto focus */
316
+ autoFocus?: boolean;
317
+ /** The validate on mount */
318
+ validateOnChange?: boolean;
319
+ /** The validate on blur */
320
+ validateOnBlur?: boolean;
321
+ /** The validate on mount */
322
+ validateOnMount?: boolean;
323
+ }
324
+ /** The use field register params */
325
+ interface UseFieldRegisterParams {
326
+ /** The required validation */
327
+ required?: string;
328
+ /** The min value validation */
329
+ max?: {
330
+ value: number;
331
+ message: string;
332
+ };
333
+ /** The max value validation */
334
+ min?: {
335
+ value: number;
336
+ message: string;
337
+ };
338
+ /** The max length validation */
339
+ maxLength?: {
340
+ value: number;
341
+ message: string;
342
+ };
343
+ /** The min length validation */
344
+ minLength?: {
345
+ value: number;
346
+ message: string;
347
+ };
348
+ /** The pattern validation */
349
+ pattern?: {
350
+ value: RegExp;
351
+ message: string;
352
+ };
353
+ /** The custom validation */
354
+ validate?: (value: string) => Promise<string | true>;
355
+ }
356
+ /** The use field return type */
357
+ interface UseFieldReturn<Value> {
358
+ /** The register function */
359
+ register: (params?: UseFieldRegisterParams) => {
360
+ onBlur: () => void;
361
+ onChange: () => void;
362
+ ref: (node: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null) => void;
363
+ };
364
+ /** The get value function */
365
+ getValue: () => Value;
366
+ /** The set value function */
367
+ setValue: (value: Value) => void;
368
+ /** The dirty state */
369
+ dirty: boolean;
370
+ /** The error state */
371
+ error?: string;
372
+ /** The set error function */
373
+ touched: boolean;
374
+ /** The focus function */
375
+ focus: () => void;
376
+ /** The watch function */
377
+ watch: () => Value;
378
+ /** The reset function */
379
+ reset: () => void;
380
+ /** The set error function */
381
+ setError: (error: string) => void;
382
+ /** The set error function */
383
+ clearError: () => void;
384
+ }
385
+ /**
386
+ * @name UseField
387
+ * @description - Hook to manage a form field
388
+ *
389
+ * @template Value The input value
390
+ * @template Type The input value type
391
+ * @param {Value} [params.initialValue] Initial value
392
+ * @param {boolean} [params.initialTouched=false] Initial touched state
393
+ * @param {boolean} [params.autoFocus=false] Auto focus
394
+ * @param {boolean} [params.validateOnChange=false] Validate on change
395
+ * @param {boolean} [params.validateOnBlur=false] Validate on blur
396
+ * @param {boolean} [params.validateOnMount=false] Validate on mount
397
+ * @returns {UseFieldReturn<Value>} An object containing input information
398
+ *
399
+ * @example
400
+ * const { register, getValue, setValue, reset, dirty, error, setError, clearError, touched, focus, watch } = useField();
401
+ */
402
+ declare const useField: <Value extends string | boolean = string, Type = Value extends string ? string : boolean>(params?: UseFieldParams<Value>) => UseFieldReturn<Type>;
403
+
308
404
  /**
309
405
  * @name useFps
310
406
  * @description - Hook that measures frames per second
@@ -1048,6 +1144,23 @@ declare const usePreferredLanguages: () => readonly string[];
1048
1144
  */
1049
1145
  declare const usePrevious: <Value>(value: Value) => Value | undefined;
1050
1146
 
1147
+ /**
1148
+ * @name useQRCode
1149
+ * @description - Hook that generates a QR code
1150
+ *
1151
+ * @param {string} text The text to be encoded in the QR code
1152
+ * @param {QRCode.QRCodeToDataURLOptions} [options] The options of the QR code
1153
+ * @returns {UseQrCodeReturn} An object with the QR code value and a setter
1154
+ *
1155
+ * @example
1156
+ * const { value, set } = useQRCode('url');
1157
+ */
1158
+ declare const useQRCode: (text?: string, options?: QRCode.QRCodeToDataURLOptions) => {
1159
+ value: string | undefined;
1160
+ set: (value: string) => Promise<void>;
1161
+ isLoading: boolean;
1162
+ };
1163
+
1051
1164
  interface UseQueryOptions<QueryData, Data> {
1052
1165
  keys?: React.DependencyList;
1053
1166
  onSuccess?: (data: Data) => void;
@@ -1395,6 +1508,41 @@ declare const useToggle: <Value = boolean>(values?: readonly Value[]) => readonl
1395
1508
  */
1396
1509
  declare const useUnmount: (callback: () => void) => void;
1397
1510
 
1511
+ type UseWebSocketUrl = string | (() => string);
1512
+ interface UseWebSocketOptions {
1513
+ onConnected?: (webSocket: WebSocket) => void;
1514
+ onDisconnected?: (event: CloseEvent, webSocket: WebSocket) => void;
1515
+ onError?: (event: Event, webSocket: WebSocket) => void;
1516
+ onMessage?: (event: MessageEvent, webSocket: WebSocket) => void;
1517
+ retry?: boolean | number;
1518
+ protocols?: Array<'soap' | 'wasm'>;
1519
+ }
1520
+ type UseWebSocketStatus = 'connecting' | 'failed' | 'connected' | 'disconnected';
1521
+ interface UseWebSocketReturn {
1522
+ status: UseWebSocketStatus;
1523
+ close: WebSocket['close'];
1524
+ send: WebSocket['send'];
1525
+ open: () => void;
1526
+ client?: WebSocket;
1527
+ }
1528
+ /**
1529
+ * @name useWebSocket
1530
+ * @description - Hook that connects to a WebSocket server and handles incoming and outgoing messages
1531
+ *
1532
+ * @param {UseWebSocketUrl} url The URL of the WebSocket server
1533
+ * @param {(webSocket: WebSocket) => void} [options.onConnected] The callback function that is called when the WebSocket connection is established
1534
+ * @param {(event: CloseEvent, webSocket: WebSocket) => void} [options.onDisconnected] The callback function that is called when the WebSocket connection is closed
1535
+ * @param {(event: Event, webSocket: WebSocket) => void} [options.onError] The callback function that is called when an error occurs
1536
+ * @param {(event: MessageEvent, webSocket: WebSocket) => void} [options.onMessage] The callback function that is called when a message is received
1537
+ * @param {boolean | number} [options.retry] The number of times to retry the connection
1538
+ * @param {Array<'soap' | 'wasm'>} [options.protocols] The list of protocols to use
1539
+ * @returns {UseWebSocketReturn} An object with the status, close, send, open, and ws properties
1540
+ *
1541
+ * @example
1542
+ * const { status, close, send, open, client } = useWebSocket('url');
1543
+ */
1544
+ declare const useWebSocket: (url: UseWebSocketUrl, options?: UseWebSocketOptions) => UseWebSocketReturn;
1545
+
1398
1546
  /**
1399
1547
  * @name useWindowEvent
1400
1548
  * @description - Hook attaches an event listener to the window object for the specified event
@@ -1462,4 +1610,4 @@ declare const getDate: (now?: Date) => {
1462
1610
  timestamp: number;
1463
1611
  };
1464
1612
 
1465
- export { type ConnectionEffectiveType, type ConnectionType, type OperatingSystem, SCRIPT_STATUS_ATTRIBUTE_NAME, type UseClickOutside, type UseClickOutsideReturn, type UseCounter, type UseCounterOptions, type UseCounterParams, type UseCounterReturn, type UseDocumentTitleOptions, type UseDocumentTitleReturn, type UseEventListener, type UseEventListenerOptions, type UseEventListenerReturn, type UseEventListenerTarget, type UseEyeDropperReturn, type UseFaviconReturn, type UseFullScreen, type UseFullScreenOptions, type UseFullScreenReturn, type UseHotkeysHotkeys, type UseHotkeysKey, type UseHotkeysOptions, type UseHover, type UseHoverOptions, type UseHoverReturn, type UseHoverTarget, type UseIdleReturn, type UseIntersectionObserver, type UseIntersectionObserverOptions, type UseIntersectionObserverReturn, type UseIntersectionObserverTarget, type UseIntervalOptions, type UseIntervalReturn, type UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseKeyboardParams, type UseListReturn, type UseLongPress, type UseLongPressReturn, type UseLongPressTarget, type UseMouse, type UseMouseReturn, type UseNetworkReturn, type UseOrientationReturn, type UsePaint, type UsePaintOptions, type UsePaintPencil, type UsePaintReturn, type UsePaintTarget, type UsePreferredColorSchemeReturn, type UseQueueReturn, type UseRenderInfoReturn, type UseScriptOptions, type UseScriptStatus, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseTextSelectionReturn, type UseTimeReturn, type UseToggleReturn, type UseWindowSizeReturn, debounce, dispatchStorageEvent, getConnection, getDate, getOperatingSystem, getRangesSelection, getRetry, getTargetElement, isClient, isHotkeyMatch, legacyCopyToClipboard, throttle, useBattery, useBoolean, useBrowserLanguage, useClickOutside, useCopyToClipboard, useCounter, useDebouncedValue, useDefault, useDidUpdate, useDocumentEvent, useDocumentTitle, useDocumentVisibility, useEvent, useEventListener, useEyeDropper, useFavicon, useFps, useFullscreen, useHash, useHotkeys, useHover, useIdle, useIntersectionObserver, useInterval, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeyboard, useKeysPressed, useList, useLocalStorage, useLogger, useLongPress, useMediaQuery, useMount, useMouse, useMutation, useNetwork, useOnline, useOperatingSystem, useOrientation, usePageLeave, usePaint, usePreferredColorScheme, usePreferredLanguages, usePrevious, useQuery, useQueue, useRenderCount, useRenderInfo, useRerender, useScript, useSessionStorage, useSet, useStep, useStorage, useTextSelection, useTime, useTimeout, useToggle, useUnmount, useWindowEvent, useWindowSize };
1613
+ export { type ConnectionEffectiveType, type ConnectionType, type OperatingSystem, SCRIPT_STATUS_ATTRIBUTE_NAME, type UseClickOutside, type UseClickOutsideReturn, type UseCounter, type UseCounterOptions, type UseCounterParams, type UseCounterReturn, type UseDocumentTitleOptions, type UseDocumentTitleReturn, type UseEventListener, type UseEventListenerOptions, type UseEventListenerReturn, type UseEventListenerTarget, type UseEyeDropperReturn, type UseFaviconReturn, type UseFieldParams, type UseFieldRegisterParams, type UseFieldReturn, type UseFullScreen, type UseFullScreenOptions, type UseFullScreenReturn, type UseHotkeysHotkeys, type UseHotkeysKey, type UseHotkeysOptions, type UseHover, type UseHoverOptions, type UseHoverReturn, type UseHoverTarget, type UseIdleReturn, type UseIntersectionObserver, type UseIntersectionObserverOptions, type UseIntersectionObserverReturn, type UseIntersectionObserverTarget, type UseIntervalOptions, type UseIntervalReturn, type UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseKeyboardParams, type UseListReturn, type UseLongPress, type UseLongPressReturn, type UseLongPressTarget, type UseMouse, type UseMouseReturn, type UseNetworkReturn, type UseOrientationReturn, type UsePaint, type UsePaintOptions, type UsePaintPencil, type UsePaintReturn, type UsePaintTarget, type UsePreferredColorSchemeReturn, type UseQueueReturn, type UseRenderInfoReturn, type UseScriptOptions, type UseScriptStatus, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseTextSelectionReturn, type UseTimeReturn, type UseToggleReturn, type UseWebSocketOptions, type UseWebSocketReturn, type UseWebSocketStatus, type UseWebSocketUrl, type UseWindowSizeReturn, debounce, dispatchStorageEvent, getConnection, getDate, getOperatingSystem, getRangesSelection, getRetry, getTargetElement, isClient, isHotkeyMatch, legacyCopyToClipboard, throttle, useBattery, useBoolean, useBrowserLanguage, useClickOutside, useCopyToClipboard, useCounter, useDebouncedValue, useDefault, useDidUpdate, useDocumentEvent, useDocumentTitle, useDocumentVisibility, useEvent, useEventListener, useEyeDropper, useFavicon, useField, useFps, useFullscreen, useHash, useHotkeys, useHover, useIdle, useIntersectionObserver, useInterval, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeyboard, useKeysPressed, useList, useLocalStorage, useLogger, useLongPress, useMediaQuery, useMount, useMouse, useMutation, useNetwork, useOnline, useOperatingSystem, useOrientation, usePageLeave, usePaint, usePreferredColorScheme, usePreferredLanguages, usePrevious, useQRCode, useQuery, useQueue, useRenderCount, useRenderInfo, useRerender, useScript, useSessionStorage, useSet, useStep, useStorage, useTextSelection, useTime, useTimeout, useToggle, useUnmount, useWebSocket, useWindowEvent, useWindowSize };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siberiacancode/reactuse",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "Ultimate tool",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers-CntznmQ7.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers-DsV9C8-q.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}