@siberiacancode/reactuse 0.0.17 → 0.0.18

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 (174) hide show
  1. package/dist/cjs/{_rollupPluginBabelHelpers-Cq4UMJ5e.js → _rollupPluginBabelHelpers-_CVoF3od.js} +2 -2
  2. package/dist/cjs/_rollupPluginBabelHelpers-_CVoF3od.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/useBoolean/useBoolean.js +2 -2
  6. package/dist/cjs/hooks/useClickOutside/useClickOutside.js +2 -2
  7. package/dist/cjs/hooks/useClickOutside/useClickOutside.js.map +1 -1
  8. package/dist/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  9. package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
  10. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  11. package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
  12. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
  13. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  14. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  15. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js.map +1 -1
  16. package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
  17. package/dist/cjs/hooks/useEventListener/useEventListener.js +2 -2
  18. package/dist/cjs/hooks/useEventListener/useEventListener.js.map +1 -1
  19. package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
  20. package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
  21. package/dist/cjs/hooks/useFullscreen/useFullscreen.js.map +1 -1
  22. package/dist/cjs/hooks/useHash/useHash.js +2 -2
  23. package/dist/cjs/hooks/useHash/useHash.js.map +1 -1
  24. package/dist/cjs/hooks/useHotkeys/useHotkeys.js +2 -2
  25. package/dist/cjs/hooks/useHotkeys/useHotkeys.js.map +1 -1
  26. package/dist/cjs/hooks/useHover/useHover.js +2 -2
  27. package/dist/cjs/hooks/useHover/useHover.js.map +1 -1
  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/useIsFirstRender/useIsFirstRender.js +1 -1
  31. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  32. package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
  33. package/dist/cjs/hooks/useKeyPress/useKeyPress.js.map +1 -1
  34. package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
  35. package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js.map +1 -1
  36. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
  37. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
  38. package/dist/cjs/hooks/useList/useList.js +3 -0
  39. package/dist/cjs/hooks/useList/useList.js.map +1 -0
  40. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
  41. package/dist/cjs/hooks/useLogger/useLogger.js +2 -2
  42. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +1 -1
  43. package/dist/cjs/hooks/useMount/useMount.js +1 -1
  44. package/dist/cjs/hooks/useMouse/useMouse.js +3 -0
  45. package/dist/cjs/hooks/useMouse/useMouse.js.map +1 -0
  46. package/dist/cjs/hooks/useMutationObserver.js +1 -1
  47. package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
  48. package/dist/cjs/hooks/useNetwork/useNetwork.js.map +1 -1
  49. package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
  50. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  51. package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
  52. package/dist/cjs/hooks/usePageLeave/usePageLeave.js +2 -2
  53. package/dist/cjs/hooks/usePageLeave/usePageLeave.js.map +1 -1
  54. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +2 -2
  55. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js.map +1 -1
  56. package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
  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/useRerender/useRerender.js +2 -2
  60. package/dist/cjs/hooks/useScript/useScript.js +2 -2
  61. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
  62. package/dist/cjs/hooks/useSet/useSet.js +2 -2
  63. package/dist/cjs/hooks/useStep/useStep.js +2 -2
  64. package/dist/cjs/hooks/useStep/useStep.js.map +1 -1
  65. package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
  66. package/dist/cjs/hooks/useTextSelection/useTextSelection.js +3 -0
  67. package/dist/cjs/hooks/useTextSelection/useTextSelection.js.map +1 -0
  68. package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
  69. package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
  70. package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
  71. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +2 -2
  72. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js.map +1 -1
  73. package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
  74. package/dist/cjs/hooks/useWindowSize/useWindowSize.js.map +1 -1
  75. package/dist/cjs/{index-CcLcscf2.js → index-CkeDLili.js} +2 -2
  76. package/dist/cjs/{index-CcLcscf2.js.map → index-CkeDLili.js.map} +1 -1
  77. package/dist/cjs/index-sUuDzgrc.js +3 -0
  78. package/dist/cjs/index-sUuDzgrc.js.map +1 -0
  79. package/dist/cjs/index.js +2 -2
  80. package/dist/cjs/utils/helpers/debounce.js +1 -1
  81. package/dist/cjs/utils/helpers/index.js +2 -2
  82. package/dist/cjs/utils/helpers/isClient.js +1 -1
  83. package/dist/cjs/utils/helpers/throttle.js +1 -1
  84. package/dist/esm/{_rollupPluginBabelHelpers-BzIoFaF6.js → _rollupPluginBabelHelpers-I2MqA1tp.js} +2 -2
  85. package/dist/esm/_rollupPluginBabelHelpers-I2MqA1tp.js.map +1 -0
  86. package/dist/esm/hooks/index.js +2 -2
  87. package/dist/esm/hooks/useBattery/useBattery.js +2 -2
  88. package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
  89. package/dist/esm/hooks/useClickOutside/useClickOutside.js +2 -2
  90. package/dist/esm/hooks/useClickOutside/useClickOutside.js.map +1 -1
  91. package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  92. package/dist/esm/hooks/useCounter/useCounter.js +2 -2
  93. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  94. package/dist/esm/hooks/useDefault/useDefault.js +2 -2
  95. package/dist/esm/hooks/useDidUpdate/useDidUpdate.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/useDocumentVisibility/useDocumentVisibility.js.map +1 -1
  99. package/dist/esm/hooks/useEvent/useEvent.js +1 -1
  100. package/dist/esm/hooks/useEventListener/useEventListener.js +2 -2
  101. package/dist/esm/hooks/useEventListener/useEventListener.js.map +1 -1
  102. package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
  103. package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
  104. package/dist/esm/hooks/useFullscreen/useFullscreen.js.map +1 -1
  105. package/dist/esm/hooks/useHash/useHash.js +2 -2
  106. package/dist/esm/hooks/useHash/useHash.js.map +1 -1
  107. package/dist/esm/hooks/useHotkeys/useHotkeys.js +2 -2
  108. package/dist/esm/hooks/useHotkeys/useHotkeys.js.map +1 -1
  109. package/dist/esm/hooks/useHover/useHover.js +2 -2
  110. package/dist/esm/hooks/useHover/useHover.js.map +1 -1
  111. package/dist/esm/hooks/useIdle/useIdle.js +2 -2
  112. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  113. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  114. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  115. package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
  116. package/dist/esm/hooks/useKeyPress/useKeyPress.js.map +1 -1
  117. package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
  118. package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js.map +1 -1
  119. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
  120. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
  121. package/dist/esm/hooks/useList/useList.js +3 -0
  122. package/dist/esm/hooks/useList/useList.js.map +1 -0
  123. package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
  124. package/dist/esm/hooks/useLogger/useLogger.js +2 -2
  125. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +1 -1
  126. package/dist/esm/hooks/useMount/useMount.js +1 -1
  127. package/dist/esm/hooks/useMouse/useMouse.js +3 -0
  128. package/dist/esm/hooks/useMouse/useMouse.js.map +1 -0
  129. package/dist/esm/hooks/useMutationObserver.js +1 -1
  130. package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
  131. package/dist/esm/hooks/useNetwork/useNetwork.js.map +1 -1
  132. package/dist/esm/hooks/useOnline/useOnline.js +1 -1
  133. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  134. package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
  135. package/dist/esm/hooks/usePageLeave/usePageLeave.js +2 -2
  136. package/dist/esm/hooks/usePageLeave/usePageLeave.js.map +1 -1
  137. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +2 -2
  138. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js.map +1 -1
  139. package/dist/esm/hooks/usePrevious/usePrevious.js +1 -1
  140. package/dist/esm/hooks/useQueue/useQueue.js +2 -2
  141. package/dist/esm/hooks/useRenderCount/useRenderCount.js +1 -1
  142. package/dist/esm/hooks/useRerender/useRerender.js +2 -2
  143. package/dist/esm/hooks/useScript/useScript.js +2 -2
  144. package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
  145. package/dist/esm/hooks/useSet/useSet.js +2 -2
  146. package/dist/esm/hooks/useStep/useStep.js +2 -2
  147. package/dist/esm/hooks/useStep/useStep.js.map +1 -1
  148. package/dist/esm/hooks/useStorage/useStorage.js +2 -2
  149. package/dist/esm/hooks/useTextSelection/useTextSelection.js +3 -0
  150. package/dist/esm/hooks/useTextSelection/useTextSelection.js.map +1 -0
  151. package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
  152. package/dist/esm/hooks/useToggle/useToggle.js +2 -2
  153. package/dist/esm/hooks/useUnmount/useUnmount.js +1 -1
  154. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +2 -2
  155. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js.map +1 -1
  156. package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
  157. package/dist/esm/hooks/useWindowSize/useWindowSize.js.map +1 -1
  158. package/dist/esm/index-CrKe-XWk.js +3 -0
  159. package/dist/esm/index-CrKe-XWk.js.map +1 -0
  160. package/dist/esm/{index-DCpdzFtI.js → index-Dbp67dKU.js} +2 -2
  161. package/dist/esm/{index-DCpdzFtI.js.map → index-Dbp67dKU.js.map} +1 -1
  162. package/dist/esm/index.js +2 -2
  163. package/dist/esm/utils/helpers/debounce.js +1 -1
  164. package/dist/esm/utils/helpers/index.js +2 -2
  165. package/dist/esm/utils/helpers/isClient.js +1 -1
  166. package/dist/esm/utils/helpers/throttle.js +1 -1
  167. package/dist/index.d.ts +162 -6
  168. package/package.json +5 -5
  169. package/dist/cjs/_rollupPluginBabelHelpers-Cq4UMJ5e.js.map +0 -1
  170. package/dist/cjs/utils/helpers/isShallowEqual.js +0 -3
  171. package/dist/cjs/utils/helpers/isShallowEqual.js.map +0 -1
  172. package/dist/esm/_rollupPluginBabelHelpers-BzIoFaF6.js.map +0 -1
  173. package/dist/esm/utils/helpers/isShallowEqual.js +0 -3
  174. package/dist/esm/utils/helpers/isShallowEqual.js.map +0 -1
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.17 */
2
- export{useBattery}from"./hooks/useBattery/useBattery.js";export{useBoolean}from"./hooks/useBoolean/useBoolean.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{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{useFavicon}from"./hooks/useFavicon/useFavicon.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{useIsFirstRender}from"./hooks/useIsFirstRender/useIsFirstRender.js";export{useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";export{useKeyPress}from"./hooks/useKeyPress/useKeyPress.js";export{useKeyPressEvent}from"./hooks/useKeyPressEvent/useKeyPressEvent.js";export{useKeysPressed}from"./hooks/useKeysPressed/useKeysPressed.js";export{useLocalStorage}from"./hooks/useLocalStorage/useLocalStorage.js";export{useLogger}from"./hooks/useLogger/useLogger.js";export{useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";export{useMount}from"./hooks/useMount/useMount.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{usePreferredLanguages}from"./hooks/usePreferredLanguages/usePreferredLanguages.js";export{usePrevious}from"./hooks/usePrevious/usePrevious.js";export{useQueue}from"./hooks/useQueue/useQueue.js";export{useRenderCount}from"./hooks/useRenderCount/useRenderCount.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{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";import"./_rollupPluginBabelHelpers-BzIoFaF6.js";import"react";import"./utils/helpers/debounce.js";import"./utils/helpers/isClient.js";import"./hooks/useMutationObserver.js";import"./utils/helpers/throttle.js";import"./utils/helpers/isShallowEqual.js";import"./index-DCpdzFtI.js";
1
+ /* @license @siberiacancode/reactuse v0.0.18 */
2
+ export{useBattery}from"./hooks/useBattery/useBattery.js";export{useBoolean}from"./hooks/useBoolean/useBoolean.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{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{useFavicon}from"./hooks/useFavicon/useFavicon.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{useIsFirstRender}from"./hooks/useIsFirstRender/useIsFirstRender.js";export{useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.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{useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";export{useMount}from"./hooks/useMount/useMount.js";export{useMouse}from"./hooks/useMouse/useMouse.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{usePreferredLanguages}from"./hooks/usePreferredLanguages/usePreferredLanguages.js";export{usePrevious}from"./hooks/usePrevious/usePrevious.js";export{useQueue}from"./hooks/useQueue/useQueue.js";export{useRenderCount}from"./hooks/useRenderCount/useRenderCount.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{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";import"./_rollupPluginBabelHelpers-I2MqA1tp.js";import"react";import"./utils/helpers/debounce.js";import"./utils/helpers/isClient.js";import"./hooks/useMutationObserver.js";import"./index-CrKe-XWk.js";import"./utils/helpers/throttle.js";import"./index-Dbp67dKU.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.17 */
1
+ /* @license @siberiacancode/reactuse v0.0.18 */
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.17 */
2
- export{debounce}from"./debounce.js";export{isClient}from"./isClient.js";export{isShallowEqual}from"./isShallowEqual.js";export{throttle}from"./throttle.js";
1
+ /* @license @siberiacancode/reactuse v0.0.18 */
2
+ export{debounce}from"./debounce.js";export{isClient}from"./isClient.js";export{throttle}from"./throttle.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.17 */
1
+ /* @license @siberiacancode/reactuse v0.0.18 */
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.17 */
1
+ /* @license @siberiacancode/reactuse v0.0.18 */
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
package/dist/index.d.ts CHANGED
@@ -73,7 +73,6 @@ type UseClickOutside = {
73
73
  *
74
74
  * @example
75
75
  * const ref = useClickOutside<HMLDiTvElement>(() => console.log('click outside'));
76
- *
77
76
  */
78
77
  declare const useClickOutside: UseClickOutside;
79
78
 
@@ -265,6 +264,57 @@ declare const useFavicon: (initialHref?: string) => {
265
264
  readonly set: (favicon: string) => void;
266
265
  };
267
266
 
267
+ /** The use fullscreen target element type */
268
+ type UseFullScreenTarget = React.RefObject<Element | null> | (() => Element) | Element;
269
+ /** The use fullscreen options */
270
+ interface UseFullScreenOptions {
271
+ /** initial value */
272
+ initialValue?: boolean;
273
+ /** on enter fullscreen */
274
+ onEnter?: () => void;
275
+ /** on exit fullscreen */
276
+ onExit?: () => void;
277
+ }
278
+ /** The use click outside return type */
279
+ interface UseFullScreenReturn {
280
+ enter: () => void;
281
+ exit: () => void;
282
+ toggle: () => void;
283
+ value: boolean;
284
+ }
285
+ type UseFullScreen = {
286
+ <Target extends UseFullScreenTarget>(target: Target, options?: UseFullScreenOptions): UseFullScreenReturn;
287
+ <Target extends UseFullScreenTarget>(options?: UseFullScreenOptions, target?: never): UseFullScreenReturn & {
288
+ ref: React.RefObject<Target>;
289
+ };
290
+ };
291
+ /**
292
+ * @name useFullscreen
293
+ * @description - Hook to handle fullscreen events
294
+ *
295
+ * @overload
296
+ * @template Target The target element for fullscreen
297
+ * @param {Target} target The target element for fullscreen
298
+ * @param {boolean} [options.initialValue=false] initial value of fullscreen
299
+ * @param {() => void} [options.onEnter] on enter fullscreen
300
+ * @param {() => void} [options.onExit] on exit fullscreen
301
+ * @returns {UseFullScreenReturn} An object with the fullscreen state and methods
302
+ *
303
+ * @example
304
+ * const { enter, exit, toggle, value } = useFullscreen(ref);
305
+ *
306
+ * @overload
307
+ * @template Target The target element for fullscreen
308
+ * @param {boolean} [options.initialValue=false] initial value of fullscreen
309
+ * @param {() => void} [options.onEnter] on enter fullscreen
310
+ * @param {() => void} [options.onExit] on exit fullscreen
311
+ * @returns {UseFullScreenReturn & { ref: React.RefObject<Target> }} An object with the fullscreen state and methods
312
+ *
313
+ * @example
314
+ * const { ref, enter, exit, toggle, value } = useFullscreen();
315
+ */
316
+ declare const useFullscreen: UseFullScreen;
317
+
268
318
  /** The use hash return type */
269
319
  type UseHashReturn = [string, (value: string) => void];
270
320
  /**
@@ -278,7 +328,7 @@ type UseHashReturn = [string, (value: string) => void];
278
328
  */
279
329
  declare const useHash: () => UseHashReturn;
280
330
 
281
- /** The use keys pressed params */
331
+ /** The use hotkeys params */
282
332
  interface UseHotkeysOptions {
283
333
  /** The target to attach the event listeners to */
284
334
  target?: UseEventListenerTarget;
@@ -491,6 +541,45 @@ declare const useKeysPressed: (params?: UseKeysPressedParams) => {
491
541
  code: string;
492
542
  }[];
493
543
 
544
+ /** The use list return type */
545
+ interface UseListReturn<Item> {
546
+ /** The current list of items */
547
+ value: Item[];
548
+ /** Sets the list of items */
549
+ set: (list: Item[]) => void;
550
+ /** Adds an item to the list */
551
+ push: (item: Item) => void;
552
+ /** Removes an item from the list */
553
+ removeAt: (removeAtIndex: number) => void;
554
+ /** Inserts an item at the specified index */
555
+ insertAt: (insertAtIndex: number, item: Item) => void;
556
+ /** Updates an item at the specified index */
557
+ updateAt: (updateAtIndex: number, item: Item) => void;
558
+ /** Clears the list */
559
+ clear: () => void;
560
+ }
561
+ /**
562
+ * @name useList
563
+ * @description - Hook that defines the logic when unmounting a component
564
+ *
565
+ * @template Item - The type of the item
566
+ * @param {Item[] | (() => Item[])} initialList - The initial list of items
567
+ * @returns {UseListReturn} An object containing the current list and functions to interact with the list
568
+ *
569
+ * @example
570
+ * const { value, set, push, removeAt, insertAt, updateAt, clear } = useList();
571
+ */
572
+ declare const useList: <Item>(initialList?: Item[]) => {
573
+ value: Item[];
574
+ set: (list: Item[]) => void;
575
+ push: (item: Item) => void;
576
+ removeAt: (removeAtIndex: number) => void;
577
+ insertAt: (insertAtIndex: number, item: Item) => void;
578
+ updateAt: (updateAtIndex: number, item: Item) => void;
579
+ clear: () => void;
580
+ reset: () => void;
581
+ };
582
+
494
583
  type UseStorageInitialValue<Value> = Value | (() => Value);
495
584
  interface UseStorageOptions<Value> {
496
585
  serializer?: (value: Value) => string;
@@ -555,6 +644,50 @@ declare const useMediaQuery: (query: string) => boolean;
555
644
  */
556
645
  declare const useMount: (effect: React.EffectCallback) => void;
557
646
 
647
+ /** The use mouse target element type */
648
+ type UseMouseTarget = React.RefObject<Element | null> | (() => Element) | Element;
649
+ /** The use mouse return type */
650
+ interface UseMouseReturn {
651
+ /** The current mouse x position */
652
+ x: number;
653
+ /** The current mouse y position */
654
+ y: number;
655
+ /** The current element x position */
656
+ elementX: number;
657
+ /** The current element y position */
658
+ elementY: number;
659
+ /** The current element position x */
660
+ elementPositionX: number;
661
+ /** The current element position y */
662
+ elementPositionY: number;
663
+ }
664
+ type UseMouse = {
665
+ <Target extends UseMouseTarget>(target: Target): UseMouseReturn;
666
+ <Target extends UseMouseTarget>(target?: never): UseMouseReturn & {
667
+ ref: React.RefObject<Target>;
668
+ };
669
+ };
670
+ /**
671
+ * @name useMouse
672
+ * @description - Hook that manages a mouse position
673
+ *
674
+ * @overload
675
+ * @template Target The target element
676
+ * @param {Target} target The target element to manage the mouse position for
677
+ * @returns {UseMouseReturn} An object with the current mouse position
678
+ *
679
+ * @example
680
+ * const { x, y, elementX, elementY, elementPositionX, elementPositionY } = useMouse(target);
681
+ *
682
+ * @overload
683
+ * @template Target The target element
684
+ * @returns {UseMouseReturn & { ref: React.RefObject<Target> }} An object with the current mouse position and a ref
685
+ *
686
+ * @example
687
+ * const { ref, x, y, elementX, elementY, elementPositionX, elementPositionY } = useMouse();
688
+ */
689
+ declare const useMouse: UseMouse;
690
+
558
691
  type ConnectionType = Connection['type'];
559
692
  type ConnectionEffectiveType = Connection['effectiveType'];
560
693
  /** The use network return type */
@@ -632,12 +765,12 @@ declare const useOrientation: () => UseOrientationReturn;
632
765
  * @name usePageLeave
633
766
  * @description - Hook what calls given function when mouse leaves the page
634
767
  *
635
- * @param {() => void} onPageLeave The callback function what calls then mouse leaves the page
768
+ * @param {() => void} callback The callback function what calls then mouse leaves the page
636
769
  *
637
770
  * @example
638
771
  * usePageLeave(() => console.log('on leave'))
639
772
  */
640
- declare const usePageLeave: (onPageLeave: () => void) => void;
773
+ declare const usePageLeave: (callback: () => void) => void;
641
774
 
642
775
  /**
643
776
  * @name usePreferredLanguages
@@ -807,7 +940,7 @@ interface UseStepReturn {
807
940
  * @returns {UseStepReturn} An object contains variables and functions to change the step
808
941
  *
809
942
  * @example
810
- * const step = useStep(5);
943
+ * const stepper = useStep(5);
811
944
  *
812
945
  * @overload
813
946
  * @param {number} params.max Maximum number of steps
@@ -819,6 +952,29 @@ interface UseStepReturn {
819
952
  */
820
953
  declare const useStep: (params: number | UseStepParams) => UseStepReturn;
821
954
 
955
+ declare const getRangesSelection: (selection: Selection) => Range[];
956
+ /** The use text selection return type */
957
+ interface UseTextSelectionReturn {
958
+ /** The current selection text */
959
+ text: string;
960
+ /** The current selection ranges */
961
+ ranges: Range[];
962
+ /** The current selection rects */
963
+ rects: DOMRect[];
964
+ /** The current selection */
965
+ selection: Selection | null;
966
+ }
967
+ /**
968
+ * @name useTextSelection
969
+ * @description - Hook that manages the text selection
970
+ *
971
+ * @returns {UseTextSelectionReturn} An object containing the current text selection
972
+ *
973
+ * @example
974
+ * const selection = useTextSelection();
975
+ */
976
+ declare const useTextSelection: () => UseTextSelectionReturn;
977
+
822
978
  /** The use timeout return type */
823
979
  interface UseTimeoutReturn {
824
980
  /** Timeout is ready state value */
@@ -913,4 +1069,4 @@ declare const useWindowSize: (params?: UseWindowSizeParams) => {
913
1069
  height: number;
914
1070
  };
915
1071
 
916
- 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 UseFaviconReturn, type UseHover, type UseHoverOptions, type UseHoverReturn, type UseHoverTarget, type UseIdleReturn, type UseIntersectionObserver, type UseIntersectionObserverOptions, type UseIntersectionObserverReturn, type UseIntersectionObserverTarget, type UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseNetworkReturn, type UseOrientationReturn, type UseQueueReturn, type UseScriptOptions, type UseScriptStatus, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseToggleReturn, type UseWindowSizeReturn, dispatchStorageEvent, getConnection, getOperatingSystem, isHotkeyMatch, legacyCopyToClipboard, useBattery, useBoolean, useClickOutside, useCopyToClipboard, useCounter, useDebouncedValue, useDefault, useDidUpdate, useDocumentTitle, useDocumentVisibility, useEvent, useEventListener, useFavicon, useHash, useHotkeys, useHover, useIdle, useIntersectionObserver, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeysPressed, useLocalStorage, useLogger, useMediaQuery, useMount, useNetwork, useOnline, useOperatingSystem, useOrientation, usePageLeave, usePreferredLanguages, usePrevious, useQueue, useRenderCount, useRerender, useScript, useSessionStorage, useSet, useStep, useStorage, useTimeout, useToggle, useUnmount, useWindowEvent, useWindowSize };
1072
+ 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 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 UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseListReturn, type UseMouse, type UseMouseReturn, type UseNetworkReturn, type UseOrientationReturn, type UseQueueReturn, type UseScriptOptions, type UseScriptStatus, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseTextSelectionReturn, type UseToggleReturn, type UseWindowSizeReturn, dispatchStorageEvent, getConnection, getOperatingSystem, getRangesSelection, isHotkeyMatch, legacyCopyToClipboard, useBattery, useBoolean, useClickOutside, useCopyToClipboard, useCounter, useDebouncedValue, useDefault, useDidUpdate, useDocumentTitle, useDocumentVisibility, useEvent, useEventListener, useFavicon, useFullscreen, useHash, useHotkeys, useHover, useIdle, useIntersectionObserver, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeysPressed, useList, useLocalStorage, useLogger, useMediaQuery, useMount, useMouse, useNetwork, useOnline, useOperatingSystem, useOrientation, usePageLeave, usePreferredLanguages, usePrevious, useQueue, useRenderCount, useRerender, useScript, useSessionStorage, useSet, useStep, useStorage, useTextSelection, useTimeout, useToggle, useUnmount, useWindowEvent, useWindowSize };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siberiacancode/reactuse",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Ultimate tool",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -51,6 +51,9 @@
51
51
  "eslint --no-error-on-unmatched-pattern --fix"
52
52
  ]
53
53
  },
54
+ "dependencies": {
55
+ "screenfull": "^6.0.2"
56
+ },
54
57
  "peerDependencies": {
55
58
  "@types/react": "^18.0.0",
56
59
  "react": "^17.0.2 || ^18.0.0"
@@ -90,8 +93,5 @@
90
93
  "react use",
91
94
  "use",
92
95
  "hooks"
93
- ],
94
- "dependencies": {
95
- "screenfull": "^6.0.2"
96
- }
96
+ ]
97
97
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers-Cq4UMJ5e.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,3 +0,0 @@
1
- /* @license @siberiacancode/reactuse v0.0.17 */
2
- "use strict";exports.isShallowEqual=function(e,r){var t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(var l=0,s=t;l<s.length;l++){var u=s[l];if(e[u]!==r[u])return!1}return!0};
3
- //# sourceMappingURL=isShallowEqual.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isShallowEqual.js","sources":["../../../../src/utils/helpers/isShallowEqual.ts"],"sourcesContent":["export const isShallowEqual = <Obj extends Record<string, unknown>>(object1: Obj, object2: Obj) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n"],"names":["object1","object2","keys1","Object","keys","keys2","length","_i","_keys","key"],"mappings":";oCAA8B,SAAsCA,EAAcC,GAChF,IAAMC,EAAQC,OAAOC,KAAKJ,GACpBK,EAAQF,OAAOC,KAAKH,GAE1B,GAAIC,EAAMI,SAAWD,EAAMC,OACzB,OAAO,EAIT,IAAA,IAAAC,EAAA,EAAAC,EAAkBN,EAAKK,EAAAC,EAAAF,OAAAC,IAAE,CAApB,IAAME,EAAGD,EAAAD,GACZ,GAAIP,EAAQS,KAASR,EAAQQ,GAC3B,OAAO,CAEX,CAEA,OAAO,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers-BzIoFaF6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,3 +0,0 @@
1
- /* @license @siberiacancode/reactuse v0.0.17 */
2
- var r=function(r,e){var t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;for(var a=0,f=t;a<f.length;a++){var u=f[a];if(r[u]!==e[u])return!1}return!0};export{r as isShallowEqual};
3
- //# sourceMappingURL=isShallowEqual.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isShallowEqual.js","sources":["../../../../src/utils/helpers/isShallowEqual.ts"],"sourcesContent":["export const isShallowEqual = <Obj extends Record<string, unknown>>(object1: Obj, object2: Obj) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n"],"names":["isShallowEqual","object1","object2","keys1","Object","keys","keys2","length","_i","_keys","key"],"mappings":";AAAO,IAAMA,EAAiB,SAAsCC,EAAcC,GAChF,IAAMC,EAAQC,OAAOC,KAAKJ,GACpBK,EAAQF,OAAOC,KAAKH,GAE1B,GAAIC,EAAMI,SAAWD,EAAMC,OACzB,OAAO,EAIT,IAAA,IAAAC,EAAA,EAAAC,EAAkBN,EAAKK,EAAAC,EAAAF,OAAAC,IAAE,CAApB,IAAME,EAAGD,EAAAD,GACZ,GAAIP,EAAQS,KAASR,EAAQQ,GAC3B,OAAO,CAEX,CAEA,OAAO,CACT"}