@contember/react-utils 1.3.0-rc.3 → 2.0.0-alpha.10

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 (657) hide show
  1. package/api-extractor.json +3 -0
  2. package/dist/development/index.cjs +35 -72
  3. package/dist/development/index.cjs.map +1 -1
  4. package/dist/development/index.js +35 -72
  5. package/dist/development/index.js.map +1 -1
  6. package/dist/development/{context → src/context}/createContext.cjs +3 -3
  7. package/dist/development/src/context/createContext.cjs.map +1 -0
  8. package/dist/development/src/context/createContext.js.map +1 -0
  9. package/dist/{production → development/src}/context/createRequiredContext.cjs +3 -3
  10. package/dist/development/src/context/createRequiredContext.cjs.map +1 -0
  11. package/dist/development/src/context/createRequiredContext.js.map +1 -0
  12. package/dist/development/src/debug-context/Constants.cjs.map +1 -0
  13. package/dist/development/src/debug-context/Constants.js.map +1 -0
  14. package/dist/development/{debug-context → src/debug-context}/Context.cjs +8 -8
  15. package/dist/development/src/debug-context/Context.cjs.map +1 -0
  16. package/dist/development/{debug-context → src/debug-context}/Context.js +1 -1
  17. package/dist/development/src/debug-context/Context.js.map +1 -0
  18. package/dist/development/src/hooks/unwrapRefValue.cjs.map +1 -0
  19. package/dist/development/src/hooks/unwrapRefValue.js.map +1 -0
  20. package/dist/development/{hooks → src/hooks}/useAbortController.cjs +4 -4
  21. package/dist/development/src/hooks/useAbortController.cjs.map +1 -0
  22. package/dist/development/src/hooks/useAbortController.js.map +1 -0
  23. package/dist/development/{hooks → src/hooks}/useArrayMapMemo.cjs +3 -3
  24. package/dist/development/src/hooks/useArrayMapMemo.cjs.map +1 -0
  25. package/dist/development/src/hooks/useArrayMapMemo.js.map +1 -0
  26. package/dist/development/{hooks → src/hooks}/useAutoHeightTextArea.cjs +3 -3
  27. package/dist/development/src/hooks/useAutoHeightTextArea.cjs.map +1 -0
  28. package/dist/development/src/hooks/useAutoHeightTextArea.js.map +1 -0
  29. package/dist/development/{hooks → src/hooks}/useChildrenAsLabel.cjs +4 -5
  30. package/dist/development/src/hooks/useChildrenAsLabel.cjs.map +1 -0
  31. package/dist/development/{hooks → src/hooks}/useChildrenAsLabel.js +1 -2
  32. package/dist/development/src/hooks/useChildrenAsLabel.js.map +1 -0
  33. package/dist/development/{hooks → src/hooks}/useComposeRef.cjs +3 -3
  34. package/dist/development/src/hooks/useComposeRef.cjs.map +1 -0
  35. package/dist/development/src/hooks/useComposeRef.js.map +1 -0
  36. package/dist/development/src/hooks/useConstantLengthInvariant.cjs.map +1 -0
  37. package/dist/development/src/hooks/useConstantLengthInvariant.js.map +1 -0
  38. package/dist/development/src/hooks/useConstantValueInvariant.cjs.map +1 -0
  39. package/dist/development/src/hooks/useConstantValueInvariant.js.map +1 -0
  40. package/dist/development/{hooks → src/hooks}/useDebounce.cjs +3 -3
  41. package/dist/development/src/hooks/useDebounce.cjs.map +1 -0
  42. package/dist/development/src/hooks/useDebounce.js.map +1 -0
  43. package/dist/development/{hooks → src/hooks}/useDebounceCallback.cjs +5 -5
  44. package/dist/development/src/hooks/useDebounceCallback.cjs.map +1 -0
  45. package/dist/development/src/hooks/useDebounceCallback.js.map +1 -0
  46. package/dist/development/{hooks → src/hooks}/useDocumentTitle.cjs +3 -3
  47. package/dist/development/src/hooks/useDocumentTitle.cjs.map +1 -0
  48. package/dist/development/src/hooks/useDocumentTitle.js.map +1 -0
  49. package/dist/development/{hooks → src/hooks}/useExpectSameValueReference.cjs +4 -4
  50. package/dist/development/src/hooks/useExpectSameValueReference.cjs.map +1 -0
  51. package/dist/development/{hooks → src/hooks}/useExpectSameValueReference.js +2 -2
  52. package/dist/development/src/hooks/useExpectSameValueReference.js.map +1 -0
  53. package/dist/development/{hooks → src/hooks}/useForceRender.cjs +2 -2
  54. package/dist/development/src/hooks/useForceRender.cjs.map +1 -0
  55. package/dist/development/src/hooks/useForceRender.js.map +1 -0
  56. package/dist/{production → development/src}/hooks/useId.cjs +2 -2
  57. package/dist/development/src/hooks/useId.cjs.map +1 -0
  58. package/dist/development/src/hooks/useId.js.map +1 -0
  59. package/dist/development/{hooks → src/hooks}/useIsMounted.cjs +3 -3
  60. package/dist/development/src/hooks/useIsMounted.cjs.map +1 -0
  61. package/dist/development/src/hooks/useIsMounted.js.map +1 -0
  62. package/dist/{production → development/src}/hooks/useObjectMemo.cjs +2 -2
  63. package/dist/development/src/hooks/useObjectMemo.cjs.map +1 -0
  64. package/dist/development/src/hooks/useObjectMemo.js.map +1 -0
  65. package/dist/{production → development/src}/hooks/useOnElementClickOutsideCallback.cjs +2 -2
  66. package/dist/development/src/hooks/useOnElementClickOutsideCallback.cjs.map +1 -0
  67. package/dist/development/src/hooks/useOnElementClickOutsideCallback.js.map +1 -0
  68. package/dist/development/{hooks → src/hooks}/useOnElementMouseEnterDelayedCallback.cjs +2 -2
  69. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +1 -0
  70. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +1 -0
  71. package/dist/{production → development/src}/hooks/useOnElementResize.cjs +5 -5
  72. package/dist/development/src/hooks/useOnElementResize.cjs.map +1 -0
  73. package/dist/development/{hooks → src/hooks}/useOnElementResize.js +1 -1
  74. package/dist/development/src/hooks/useOnElementResize.js.map +1 -0
  75. package/dist/{production → development/src}/hooks/useOnWindowResize.cjs +5 -5
  76. package/dist/development/src/hooks/useOnWindowResize.cjs.map +1 -0
  77. package/dist/development/{hooks → src/hooks}/useOnWindowResize.js +1 -1
  78. package/dist/development/src/hooks/useOnWindowResize.js.map +1 -0
  79. package/dist/development/{hooks → src/hooks}/usePreviousValue.cjs +3 -3
  80. package/dist/development/src/hooks/usePreviousValue.cjs.map +1 -0
  81. package/dist/development/src/hooks/usePreviousValue.js.map +1 -0
  82. package/dist/{production → development/src}/hooks/useStoredState.cjs +4 -4
  83. package/dist/development/src/hooks/useStoredState.cjs.map +1 -0
  84. package/dist/development/src/hooks/useStoredState.js.map +1 -0
  85. package/dist/development/{hooks → src/hooks}/useUpdatedRef.cjs +2 -2
  86. package/dist/development/src/hooks/useUpdatedRef.cjs.map +1 -0
  87. package/dist/development/src/hooks/useUpdatedRef.js.map +1 -0
  88. package/dist/development/{hooks → src/hooks}/useWindowSize.cjs +4 -4
  89. package/dist/development/src/hooks/useWindowSize.cjs.map +1 -0
  90. package/dist/development/src/hooks/useWindowSize.js.map +1 -0
  91. package/dist/development/src/referentiallyStable/emptyArray.cjs.map +1 -0
  92. package/dist/development/src/referentiallyStable/emptyArray.js.map +1 -0
  93. package/dist/development/src/referentiallyStable/emptyObject.cjs.map +1 -0
  94. package/dist/development/src/referentiallyStable/emptyObject.js.map +1 -0
  95. package/dist/development/src/referentiallyStable/identityFunction.cjs.map +1 -0
  96. package/dist/development/src/referentiallyStable/identityFunction.js.map +1 -0
  97. package/dist/development/src/referentiallyStable/noop.cjs.map +1 -0
  98. package/dist/development/src/referentiallyStable/noop.js.map +1 -0
  99. package/dist/development/src/referentiallyStable/returnFalse.cjs.map +1 -0
  100. package/dist/development/src/referentiallyStable/returnFalse.js.map +1 -0
  101. package/dist/development/src/referentiallyStable/returnTrue.cjs.map +1 -0
  102. package/dist/development/src/referentiallyStable/returnTrue.js.map +1 -0
  103. package/dist/{production → development/src}/referentiallyStable/useReferentiallyStableCallback.cjs +3 -3
  104. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +1 -0
  105. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.js.map +1 -0
  106. package/dist/production/index.cjs +35 -72
  107. package/dist/production/index.cjs.map +1 -1
  108. package/dist/production/index.js +35 -72
  109. package/dist/production/index.js.map +1 -1
  110. package/dist/production/{context → src/context}/createContext.cjs +3 -3
  111. package/dist/production/src/context/createContext.cjs.map +1 -0
  112. package/dist/production/src/context/createContext.js.map +1 -0
  113. package/dist/{development → production/src}/context/createRequiredContext.cjs +3 -3
  114. package/dist/production/src/context/createRequiredContext.cjs.map +1 -0
  115. package/dist/production/src/context/createRequiredContext.js.map +1 -0
  116. package/dist/production/src/debug-context/Constants.cjs.map +1 -0
  117. package/dist/production/src/debug-context/Constants.js.map +1 -0
  118. package/dist/production/{debug-context → src/debug-context}/Context.cjs +7 -7
  119. package/dist/production/src/debug-context/Context.cjs.map +1 -0
  120. package/dist/production/src/debug-context/Context.js.map +1 -0
  121. package/dist/production/src/hooks/unwrapRefValue.cjs.map +1 -0
  122. package/dist/production/src/hooks/unwrapRefValue.js.map +1 -0
  123. package/dist/production/{hooks → src/hooks}/useAbortController.cjs +4 -4
  124. package/dist/production/src/hooks/useAbortController.cjs.map +1 -0
  125. package/dist/production/src/hooks/useAbortController.js.map +1 -0
  126. package/dist/production/{hooks → src/hooks}/useArrayMapMemo.cjs +3 -3
  127. package/dist/production/src/hooks/useArrayMapMemo.cjs.map +1 -0
  128. package/dist/production/src/hooks/useArrayMapMemo.js.map +1 -0
  129. package/dist/production/{hooks → src/hooks}/useAutoHeightTextArea.cjs +3 -3
  130. package/dist/production/src/hooks/useAutoHeightTextArea.cjs.map +1 -0
  131. package/dist/production/src/hooks/useAutoHeightTextArea.js.map +1 -0
  132. package/dist/production/{hooks → src/hooks}/useChildrenAsLabel.cjs +5 -7
  133. package/dist/production/src/hooks/useChildrenAsLabel.cjs.map +1 -0
  134. package/dist/production/{hooks → src/hooks}/useChildrenAsLabel.js +2 -4
  135. package/dist/production/src/hooks/useChildrenAsLabel.js.map +1 -0
  136. package/dist/production/{hooks → src/hooks}/useComposeRef.cjs +3 -3
  137. package/dist/production/src/hooks/useComposeRef.cjs.map +1 -0
  138. package/dist/production/src/hooks/useComposeRef.js.map +1 -0
  139. package/dist/production/src/hooks/useConstantLengthInvariant.cjs.map +1 -0
  140. package/dist/production/src/hooks/useConstantLengthInvariant.js.map +1 -0
  141. package/dist/production/src/hooks/useConstantValueInvariant.cjs.map +1 -0
  142. package/dist/production/src/hooks/useConstantValueInvariant.js.map +1 -0
  143. package/dist/production/{hooks → src/hooks}/useDebounce.cjs +3 -3
  144. package/dist/production/src/hooks/useDebounce.cjs.map +1 -0
  145. package/dist/production/src/hooks/useDebounce.js.map +1 -0
  146. package/dist/production/{hooks → src/hooks}/useDebounceCallback.cjs +5 -5
  147. package/dist/production/src/hooks/useDebounceCallback.cjs.map +1 -0
  148. package/dist/production/src/hooks/useDebounceCallback.js.map +1 -0
  149. package/dist/production/{hooks → src/hooks}/useDocumentTitle.cjs +3 -3
  150. package/dist/production/src/hooks/useDocumentTitle.cjs.map +1 -0
  151. package/dist/production/src/hooks/useDocumentTitle.js.map +1 -0
  152. package/dist/production/{hooks → src/hooks}/useExpectSameValueReference.cjs +4 -4
  153. package/dist/production/src/hooks/useExpectSameValueReference.cjs.map +1 -0
  154. package/dist/production/{hooks → src/hooks}/useExpectSameValueReference.js +2 -2
  155. package/dist/production/src/hooks/useExpectSameValueReference.js.map +1 -0
  156. package/dist/production/{hooks → src/hooks}/useForceRender.cjs +2 -2
  157. package/dist/production/src/hooks/useForceRender.cjs.map +1 -0
  158. package/dist/production/src/hooks/useForceRender.js.map +1 -0
  159. package/dist/{development → production/src}/hooks/useId.cjs +2 -2
  160. package/dist/production/src/hooks/useId.cjs.map +1 -0
  161. package/dist/production/src/hooks/useId.js.map +1 -0
  162. package/dist/production/{hooks → src/hooks}/useIsMounted.cjs +3 -3
  163. package/dist/production/src/hooks/useIsMounted.cjs.map +1 -0
  164. package/dist/production/src/hooks/useIsMounted.js.map +1 -0
  165. package/dist/{development → production/src}/hooks/useObjectMemo.cjs +2 -2
  166. package/dist/production/src/hooks/useObjectMemo.cjs.map +1 -0
  167. package/dist/production/src/hooks/useObjectMemo.js.map +1 -0
  168. package/dist/{development → production/src}/hooks/useOnElementClickOutsideCallback.cjs +2 -2
  169. package/dist/production/src/hooks/useOnElementClickOutsideCallback.cjs.map +1 -0
  170. package/dist/production/src/hooks/useOnElementClickOutsideCallback.js.map +1 -0
  171. package/dist/production/{hooks → src/hooks}/useOnElementMouseEnterDelayedCallback.cjs +2 -2
  172. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +1 -0
  173. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +1 -0
  174. package/dist/{development → production/src}/hooks/useOnElementResize.cjs +5 -5
  175. package/dist/production/src/hooks/useOnElementResize.cjs.map +1 -0
  176. package/dist/production/{hooks → src/hooks}/useOnElementResize.js +1 -1
  177. package/dist/production/src/hooks/useOnElementResize.js.map +1 -0
  178. package/dist/{development → production/src}/hooks/useOnWindowResize.cjs +5 -5
  179. package/dist/production/src/hooks/useOnWindowResize.cjs.map +1 -0
  180. package/dist/production/{hooks → src/hooks}/useOnWindowResize.js +1 -1
  181. package/dist/production/src/hooks/useOnWindowResize.js.map +1 -0
  182. package/dist/production/{hooks → src/hooks}/usePreviousValue.cjs +3 -3
  183. package/dist/production/src/hooks/usePreviousValue.cjs.map +1 -0
  184. package/dist/production/src/hooks/usePreviousValue.js.map +1 -0
  185. package/dist/{development → production/src}/hooks/useStoredState.cjs +4 -4
  186. package/dist/production/src/hooks/useStoredState.cjs.map +1 -0
  187. package/dist/production/src/hooks/useStoredState.js.map +1 -0
  188. package/dist/production/{hooks → src/hooks}/useUpdatedRef.cjs +2 -2
  189. package/dist/production/src/hooks/useUpdatedRef.cjs.map +1 -0
  190. package/dist/production/src/hooks/useUpdatedRef.js.map +1 -0
  191. package/dist/production/{hooks → src/hooks}/useWindowSize.cjs +4 -4
  192. package/dist/production/src/hooks/useWindowSize.cjs.map +1 -0
  193. package/dist/production/src/hooks/useWindowSize.js.map +1 -0
  194. package/dist/production/src/referentiallyStable/emptyArray.cjs.map +1 -0
  195. package/dist/production/src/referentiallyStable/emptyArray.js.map +1 -0
  196. package/dist/production/src/referentiallyStable/emptyObject.cjs.map +1 -0
  197. package/dist/production/src/referentiallyStable/emptyObject.js.map +1 -0
  198. package/dist/production/src/referentiallyStable/identityFunction.cjs.map +1 -0
  199. package/dist/production/src/referentiallyStable/identityFunction.js.map +1 -0
  200. package/dist/production/src/referentiallyStable/noop.cjs.map +1 -0
  201. package/dist/production/src/referentiallyStable/noop.js.map +1 -0
  202. package/dist/production/src/referentiallyStable/returnFalse.cjs.map +1 -0
  203. package/dist/production/src/referentiallyStable/returnFalse.js.map +1 -0
  204. package/dist/production/src/referentiallyStable/returnTrue.cjs.map +1 -0
  205. package/dist/production/src/referentiallyStable/returnTrue.js.map +1 -0
  206. package/dist/{development → production/src}/referentiallyStable/useReferentiallyStableCallback.cjs +3 -3
  207. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +1 -0
  208. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.js.map +1 -0
  209. package/dist/types/debug-context/Types.d.ts.map +1 -1
  210. package/dist/types/hooks/index.d.ts +0 -10
  211. package/dist/types/hooks/index.d.ts.map +1 -1
  212. package/dist/types/hooks/useArrayMapMemo.d.ts.map +1 -1
  213. package/dist/types/hooks/useAutoHeightTextArea.d.ts.map +1 -1
  214. package/dist/types/hooks/useComposeRef.d.ts.map +1 -1
  215. package/dist/types/hooks/useConstantLengthInvariant.d.ts.map +1 -1
  216. package/dist/types/hooks/useConstantValueInvariant.d.ts.map +1 -1
  217. package/dist/types/hooks/useDebounce.d.ts.map +1 -1
  218. package/dist/types/hooks/useObjectMemo.d.ts.map +1 -1
  219. package/dist/types/hooks/usePreviousValue.d.ts.map +1 -1
  220. package/dist/types/hooks/useStoredState.d.ts.map +1 -1
  221. package/dist/types/index.d.ts +0 -1
  222. package/dist/types/index.d.ts.map +1 -1
  223. package/dist/types/referentiallyStable/emptyArray.d.ts.map +1 -1
  224. package/dist/types/referentiallyStable/identityFunction.d.ts.map +1 -1
  225. package/dist/types/referentiallyStable/useReferentiallyStableCallback.d.ts.map +1 -1
  226. package/dist/types/tsconfig.tsbuildinfo +1 -1
  227. package/dist/types/types/PropsWithRequiredChildren.d.ts.map +1 -1
  228. package/package.json +5 -13
  229. package/src/context/createContext.ts +3 -3
  230. package/src/context/createRequiredContext.ts +10 -10
  231. package/src/debug-context/Types.ts +8 -8
  232. package/src/hooks/index.ts +0 -10
  233. package/src/hooks/useComposeRef.ts +1 -1
  234. package/src/hooks/useExpectSameValueReference.ts +3 -3
  235. package/src/hooks/useOnElementResize.ts +1 -1
  236. package/src/hooks/useOnWindowResize.ts +1 -1
  237. package/src/hooks/useStoredState.ts +2 -2
  238. package/src/hooks/useWindowSize.ts +12 -12
  239. package/src/index.ts +0 -1
  240. package/src/tsconfig.json +5 -2
  241. package/src/types/PropsWithRequiredChildren.ts +1 -1
  242. package/tests/hooks/useChildrenAsLabel.test.tsx +96 -0
  243. package/tests/hooks/useId.test.ts +13 -0
  244. package/tests/tsconfig.json +10 -0
  245. package/tsconfig.json +8 -0
  246. package/tsdoc.json +6 -0
  247. package/dist/development/context/createContext.cjs.map +0 -1
  248. package/dist/development/context/createContext.js.map +0 -1
  249. package/dist/development/context/createRequiredContext.cjs.map +0 -1
  250. package/dist/development/context/createRequiredContext.js.map +0 -1
  251. package/dist/development/debug-context/Constants.cjs.map +0 -1
  252. package/dist/development/debug-context/Constants.js.map +0 -1
  253. package/dist/development/debug-context/Context.cjs.map +0 -1
  254. package/dist/development/debug-context/Context.js.map +0 -1
  255. package/dist/development/hooks/unwrapRefValue.cjs.map +0 -1
  256. package/dist/development/hooks/unwrapRefValue.js.map +0 -1
  257. package/dist/development/hooks/useAbortController.cjs.map +0 -1
  258. package/dist/development/hooks/useAbortController.js.map +0 -1
  259. package/dist/development/hooks/useAddClassNameDuringResize.cjs +0 -32
  260. package/dist/development/hooks/useAddClassNameDuringResize.cjs.map +0 -1
  261. package/dist/development/hooks/useAddClassNameDuringResize.js +0 -32
  262. package/dist/development/hooks/useAddClassNameDuringResize.js.map +0 -1
  263. package/dist/development/hooks/useArrayMapMemo.cjs.map +0 -1
  264. package/dist/development/hooks/useArrayMapMemo.js.map +0 -1
  265. package/dist/development/hooks/useAutoHeightTextArea.cjs.map +0 -1
  266. package/dist/development/hooks/useAutoHeightTextArea.js.map +0 -1
  267. package/dist/development/hooks/useChildrenAsLabel.cjs.map +0 -1
  268. package/dist/development/hooks/useChildrenAsLabel.js.map +0 -1
  269. package/dist/development/hooks/useCloseOnClickOutside.cjs +0 -25
  270. package/dist/development/hooks/useCloseOnClickOutside.cjs.map +0 -1
  271. package/dist/development/hooks/useCloseOnClickOutside.js +0 -25
  272. package/dist/development/hooks/useCloseOnClickOutside.js.map +0 -1
  273. package/dist/development/hooks/useCloseOnEscape.cjs +0 -20
  274. package/dist/development/hooks/useCloseOnEscape.cjs.map +0 -1
  275. package/dist/development/hooks/useCloseOnEscape.js +0 -20
  276. package/dist/development/hooks/useCloseOnEscape.js.map +0 -1
  277. package/dist/development/hooks/useComposeRef.cjs.map +0 -1
  278. package/dist/development/hooks/useComposeRef.js.map +0 -1
  279. package/dist/development/hooks/useConstantLengthInvariant.cjs.map +0 -1
  280. package/dist/development/hooks/useConstantLengthInvariant.js.map +0 -1
  281. package/dist/development/hooks/useConstantValueInvariant.cjs.map +0 -1
  282. package/dist/development/hooks/useConstantValueInvariant.js.map +0 -1
  283. package/dist/development/hooks/useContainerWidth.cjs +0 -14
  284. package/dist/development/hooks/useContainerWidth.cjs.map +0 -1
  285. package/dist/development/hooks/useContainerWidth.js +0 -14
  286. package/dist/development/hooks/useContainerWidth.js.map +0 -1
  287. package/dist/development/hooks/useDebounce.cjs.map +0 -1
  288. package/dist/development/hooks/useDebounce.js.map +0 -1
  289. package/dist/development/hooks/useDebounceCallback.cjs.map +0 -1
  290. package/dist/development/hooks/useDebounceCallback.js.map +0 -1
  291. package/dist/development/hooks/useDocumentTitle.cjs.map +0 -1
  292. package/dist/development/hooks/useDocumentTitle.js.map +0 -1
  293. package/dist/development/hooks/useElementSize.cjs +0 -37
  294. package/dist/development/hooks/useElementSize.cjs.map +0 -1
  295. package/dist/development/hooks/useElementSize.js +0 -37
  296. package/dist/development/hooks/useElementSize.js.map +0 -1
  297. package/dist/development/hooks/useElementTopOffset.cjs +0 -29
  298. package/dist/development/hooks/useElementTopOffset.cjs.map +0 -1
  299. package/dist/development/hooks/useElementTopOffset.js +0 -29
  300. package/dist/development/hooks/useElementTopOffset.js.map +0 -1
  301. package/dist/development/hooks/useEventHandler.cjs +0 -19
  302. package/dist/development/hooks/useEventHandler.cjs.map +0 -1
  303. package/dist/development/hooks/useEventHandler.js +0 -19
  304. package/dist/development/hooks/useEventHandler.js.map +0 -1
  305. package/dist/development/hooks/useExpectSameValueReference.cjs.map +0 -1
  306. package/dist/development/hooks/useExpectSameValueReference.js.map +0 -1
  307. package/dist/development/hooks/useForceRender.cjs.map +0 -1
  308. package/dist/development/hooks/useForceRender.js.map +0 -1
  309. package/dist/development/hooks/useId.cjs.map +0 -1
  310. package/dist/development/hooks/useId.js.map +0 -1
  311. package/dist/development/hooks/useIsMounted.cjs.map +0 -1
  312. package/dist/development/hooks/useIsMounted.js.map +0 -1
  313. package/dist/development/hooks/useObjectMemo.cjs.map +0 -1
  314. package/dist/development/hooks/useObjectMemo.js.map +0 -1
  315. package/dist/development/hooks/useOnElementClickOutsideCallback.cjs.map +0 -1
  316. package/dist/development/hooks/useOnElementClickOutsideCallback.js.map +0 -1
  317. package/dist/development/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +0 -1
  318. package/dist/development/hooks/useOnElementMouseEnterDelayedCallback.js.map +0 -1
  319. package/dist/development/hooks/useOnElementMutation.cjs +0 -35
  320. package/dist/development/hooks/useOnElementMutation.cjs.map +0 -1
  321. package/dist/development/hooks/useOnElementMutation.js +0 -35
  322. package/dist/development/hooks/useOnElementMutation.js.map +0 -1
  323. package/dist/development/hooks/useOnElementResize.cjs.map +0 -1
  324. package/dist/development/hooks/useOnElementResize.js.map +0 -1
  325. package/dist/development/hooks/useOnScrollWithin.cjs +0 -52
  326. package/dist/development/hooks/useOnScrollWithin.cjs.map +0 -1
  327. package/dist/development/hooks/useOnScrollWithin.js +0 -52
  328. package/dist/development/hooks/useOnScrollWithin.js.map +0 -1
  329. package/dist/development/hooks/useOnWindowResize.cjs.map +0 -1
  330. package/dist/development/hooks/useOnWindowResize.js.map +0 -1
  331. package/dist/development/hooks/usePreviousValue.cjs.map +0 -1
  332. package/dist/development/hooks/usePreviousValue.js.map +0 -1
  333. package/dist/development/hooks/useScrollOffsets.cjs +0 -67
  334. package/dist/development/hooks/useScrollOffsets.cjs.map +0 -1
  335. package/dist/development/hooks/useScrollOffsets.js +0 -67
  336. package/dist/development/hooks/useScrollOffsets.js.map +0 -1
  337. package/dist/development/hooks/useStoredState.cjs.map +0 -1
  338. package/dist/development/hooks/useStoredState.js.map +0 -1
  339. package/dist/development/hooks/useUpdatedRef.cjs.map +0 -1
  340. package/dist/development/hooks/useUpdatedRef.js.map +0 -1
  341. package/dist/development/hooks/useWindowSize.cjs.map +0 -1
  342. package/dist/development/hooks/useWindowSize.js.map +0 -1
  343. package/dist/development/referentiallyStable/emptyArray.cjs.map +0 -1
  344. package/dist/development/referentiallyStable/emptyArray.js.map +0 -1
  345. package/dist/development/referentiallyStable/emptyObject.cjs.map +0 -1
  346. package/dist/development/referentiallyStable/emptyObject.js.map +0 -1
  347. package/dist/development/referentiallyStable/identityFunction.cjs.map +0 -1
  348. package/dist/development/referentiallyStable/identityFunction.js.map +0 -1
  349. package/dist/development/referentiallyStable/noop.cjs.map +0 -1
  350. package/dist/development/referentiallyStable/noop.js.map +0 -1
  351. package/dist/development/referentiallyStable/returnFalse.cjs.map +0 -1
  352. package/dist/development/referentiallyStable/returnFalse.js.map +0 -1
  353. package/dist/development/referentiallyStable/returnTrue.cjs.map +0 -1
  354. package/dist/development/referentiallyStable/returnTrue.js.map +0 -1
  355. package/dist/development/referentiallyStable/useReferentiallyStableCallback.cjs.map +0 -1
  356. package/dist/development/referentiallyStable/useReferentiallyStableCallback.js.map +0 -1
  357. package/dist/development/theming/ColorSchemeProvider.cjs +0 -16
  358. package/dist/development/theming/ColorSchemeProvider.cjs.map +0 -1
  359. package/dist/development/theming/ColorSchemeProvider.js +0 -16
  360. package/dist/development/theming/ColorSchemeProvider.js.map +0 -1
  361. package/dist/development/theming/GlobalClassNamePrefixContext.cjs +0 -6
  362. package/dist/development/theming/GlobalClassNamePrefixContext.cjs.map +0 -1
  363. package/dist/development/theming/GlobalClassNamePrefixContext.js +0 -6
  364. package/dist/development/theming/GlobalClassNamePrefixContext.js.map +0 -1
  365. package/dist/development/theming/contexts.cjs +0 -12
  366. package/dist/development/theming/contexts.cjs.map +0 -1
  367. package/dist/development/theming/contexts.js +0 -12
  368. package/dist/development/theming/contexts.js.map +0 -1
  369. package/dist/development/theming/useClassName.cjs +0 -17
  370. package/dist/development/theming/useClassName.cjs.map +0 -1
  371. package/dist/development/theming/useClassName.js +0 -17
  372. package/dist/development/theming/useClassName.js.map +0 -1
  373. package/dist/development/theming/useClassNameFactory.cjs +0 -22
  374. package/dist/development/theming/useClassNameFactory.cjs.map +0 -1
  375. package/dist/development/theming/useClassNameFactory.js +0 -22
  376. package/dist/development/theming/useClassNameFactory.js.map +0 -1
  377. package/dist/development/theming/useThemedClassName.cjs +0 -17
  378. package/dist/development/theming/useThemedClassName.cjs.map +0 -1
  379. package/dist/development/theming/useThemedClassName.js +0 -17
  380. package/dist/development/theming/useThemedClassName.js.map +0 -1
  381. package/dist/development/theming/useThemedClassNameFactory.cjs +0 -29
  382. package/dist/development/theming/useThemedClassNameFactory.cjs.map +0 -1
  383. package/dist/development/theming/useThemedClassNameFactory.js +0 -29
  384. package/dist/development/theming/useThemedClassNameFactory.js.map +0 -1
  385. package/dist/production/context/createContext.cjs.map +0 -1
  386. package/dist/production/context/createContext.js.map +0 -1
  387. package/dist/production/context/createRequiredContext.cjs.map +0 -1
  388. package/dist/production/context/createRequiredContext.js.map +0 -1
  389. package/dist/production/debug-context/Constants.cjs.map +0 -1
  390. package/dist/production/debug-context/Constants.js.map +0 -1
  391. package/dist/production/debug-context/Context.cjs.map +0 -1
  392. package/dist/production/debug-context/Context.js.map +0 -1
  393. package/dist/production/hooks/unwrapRefValue.cjs.map +0 -1
  394. package/dist/production/hooks/unwrapRefValue.js.map +0 -1
  395. package/dist/production/hooks/useAbortController.cjs.map +0 -1
  396. package/dist/production/hooks/useAbortController.js.map +0 -1
  397. package/dist/production/hooks/useAddClassNameDuringResize.cjs +0 -32
  398. package/dist/production/hooks/useAddClassNameDuringResize.cjs.map +0 -1
  399. package/dist/production/hooks/useAddClassNameDuringResize.js +0 -32
  400. package/dist/production/hooks/useAddClassNameDuringResize.js.map +0 -1
  401. package/dist/production/hooks/useArrayMapMemo.cjs.map +0 -1
  402. package/dist/production/hooks/useArrayMapMemo.js.map +0 -1
  403. package/dist/production/hooks/useAutoHeightTextArea.cjs.map +0 -1
  404. package/dist/production/hooks/useAutoHeightTextArea.js.map +0 -1
  405. package/dist/production/hooks/useChildrenAsLabel.cjs.map +0 -1
  406. package/dist/production/hooks/useChildrenAsLabel.js.map +0 -1
  407. package/dist/production/hooks/useCloseOnClickOutside.cjs +0 -25
  408. package/dist/production/hooks/useCloseOnClickOutside.cjs.map +0 -1
  409. package/dist/production/hooks/useCloseOnClickOutside.js +0 -25
  410. package/dist/production/hooks/useCloseOnClickOutside.js.map +0 -1
  411. package/dist/production/hooks/useCloseOnEscape.cjs +0 -20
  412. package/dist/production/hooks/useCloseOnEscape.cjs.map +0 -1
  413. package/dist/production/hooks/useCloseOnEscape.js +0 -20
  414. package/dist/production/hooks/useCloseOnEscape.js.map +0 -1
  415. package/dist/production/hooks/useComposeRef.cjs.map +0 -1
  416. package/dist/production/hooks/useComposeRef.js.map +0 -1
  417. package/dist/production/hooks/useConstantLengthInvariant.cjs.map +0 -1
  418. package/dist/production/hooks/useConstantLengthInvariant.js.map +0 -1
  419. package/dist/production/hooks/useConstantValueInvariant.cjs.map +0 -1
  420. package/dist/production/hooks/useConstantValueInvariant.js.map +0 -1
  421. package/dist/production/hooks/useContainerWidth.cjs +0 -14
  422. package/dist/production/hooks/useContainerWidth.cjs.map +0 -1
  423. package/dist/production/hooks/useContainerWidth.js +0 -14
  424. package/dist/production/hooks/useContainerWidth.js.map +0 -1
  425. package/dist/production/hooks/useDebounce.cjs.map +0 -1
  426. package/dist/production/hooks/useDebounce.js.map +0 -1
  427. package/dist/production/hooks/useDebounceCallback.cjs.map +0 -1
  428. package/dist/production/hooks/useDebounceCallback.js.map +0 -1
  429. package/dist/production/hooks/useDocumentTitle.cjs.map +0 -1
  430. package/dist/production/hooks/useDocumentTitle.js.map +0 -1
  431. package/dist/production/hooks/useElementSize.cjs +0 -37
  432. package/dist/production/hooks/useElementSize.cjs.map +0 -1
  433. package/dist/production/hooks/useElementSize.js +0 -37
  434. package/dist/production/hooks/useElementSize.js.map +0 -1
  435. package/dist/production/hooks/useElementTopOffset.cjs +0 -29
  436. package/dist/production/hooks/useElementTopOffset.cjs.map +0 -1
  437. package/dist/production/hooks/useElementTopOffset.js +0 -29
  438. package/dist/production/hooks/useElementTopOffset.js.map +0 -1
  439. package/dist/production/hooks/useEventHandler.cjs +0 -19
  440. package/dist/production/hooks/useEventHandler.cjs.map +0 -1
  441. package/dist/production/hooks/useEventHandler.js +0 -19
  442. package/dist/production/hooks/useEventHandler.js.map +0 -1
  443. package/dist/production/hooks/useExpectSameValueReference.cjs.map +0 -1
  444. package/dist/production/hooks/useExpectSameValueReference.js.map +0 -1
  445. package/dist/production/hooks/useForceRender.cjs.map +0 -1
  446. package/dist/production/hooks/useForceRender.js.map +0 -1
  447. package/dist/production/hooks/useId.cjs.map +0 -1
  448. package/dist/production/hooks/useId.js.map +0 -1
  449. package/dist/production/hooks/useIsMounted.cjs.map +0 -1
  450. package/dist/production/hooks/useIsMounted.js.map +0 -1
  451. package/dist/production/hooks/useObjectMemo.cjs.map +0 -1
  452. package/dist/production/hooks/useObjectMemo.js.map +0 -1
  453. package/dist/production/hooks/useOnElementClickOutsideCallback.cjs.map +0 -1
  454. package/dist/production/hooks/useOnElementClickOutsideCallback.js.map +0 -1
  455. package/dist/production/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +0 -1
  456. package/dist/production/hooks/useOnElementMouseEnterDelayedCallback.js.map +0 -1
  457. package/dist/production/hooks/useOnElementMutation.cjs +0 -35
  458. package/dist/production/hooks/useOnElementMutation.cjs.map +0 -1
  459. package/dist/production/hooks/useOnElementMutation.js +0 -35
  460. package/dist/production/hooks/useOnElementMutation.js.map +0 -1
  461. package/dist/production/hooks/useOnElementResize.cjs.map +0 -1
  462. package/dist/production/hooks/useOnElementResize.js.map +0 -1
  463. package/dist/production/hooks/useOnScrollWithin.cjs +0 -52
  464. package/dist/production/hooks/useOnScrollWithin.cjs.map +0 -1
  465. package/dist/production/hooks/useOnScrollWithin.js +0 -52
  466. package/dist/production/hooks/useOnScrollWithin.js.map +0 -1
  467. package/dist/production/hooks/useOnWindowResize.cjs.map +0 -1
  468. package/dist/production/hooks/useOnWindowResize.js.map +0 -1
  469. package/dist/production/hooks/usePreviousValue.cjs.map +0 -1
  470. package/dist/production/hooks/usePreviousValue.js.map +0 -1
  471. package/dist/production/hooks/useScrollOffsets.cjs +0 -67
  472. package/dist/production/hooks/useScrollOffsets.cjs.map +0 -1
  473. package/dist/production/hooks/useScrollOffsets.js +0 -67
  474. package/dist/production/hooks/useScrollOffsets.js.map +0 -1
  475. package/dist/production/hooks/useStoredState.cjs.map +0 -1
  476. package/dist/production/hooks/useStoredState.js.map +0 -1
  477. package/dist/production/hooks/useUpdatedRef.cjs.map +0 -1
  478. package/dist/production/hooks/useUpdatedRef.js.map +0 -1
  479. package/dist/production/hooks/useWindowSize.cjs.map +0 -1
  480. package/dist/production/hooks/useWindowSize.js.map +0 -1
  481. package/dist/production/referentiallyStable/emptyArray.cjs.map +0 -1
  482. package/dist/production/referentiallyStable/emptyArray.js.map +0 -1
  483. package/dist/production/referentiallyStable/emptyObject.cjs.map +0 -1
  484. package/dist/production/referentiallyStable/emptyObject.js.map +0 -1
  485. package/dist/production/referentiallyStable/identityFunction.cjs.map +0 -1
  486. package/dist/production/referentiallyStable/identityFunction.js.map +0 -1
  487. package/dist/production/referentiallyStable/noop.cjs.map +0 -1
  488. package/dist/production/referentiallyStable/noop.js.map +0 -1
  489. package/dist/production/referentiallyStable/returnFalse.cjs.map +0 -1
  490. package/dist/production/referentiallyStable/returnFalse.js.map +0 -1
  491. package/dist/production/referentiallyStable/returnTrue.cjs.map +0 -1
  492. package/dist/production/referentiallyStable/returnTrue.js.map +0 -1
  493. package/dist/production/referentiallyStable/useReferentiallyStableCallback.cjs.map +0 -1
  494. package/dist/production/referentiallyStable/useReferentiallyStableCallback.js.map +0 -1
  495. package/dist/production/theming/ColorSchemeProvider.cjs +0 -12
  496. package/dist/production/theming/ColorSchemeProvider.cjs.map +0 -1
  497. package/dist/production/theming/ColorSchemeProvider.js +0 -12
  498. package/dist/production/theming/ColorSchemeProvider.js.map +0 -1
  499. package/dist/production/theming/GlobalClassNamePrefixContext.cjs +0 -6
  500. package/dist/production/theming/GlobalClassNamePrefixContext.cjs.map +0 -1
  501. package/dist/production/theming/GlobalClassNamePrefixContext.js +0 -6
  502. package/dist/production/theming/GlobalClassNamePrefixContext.js.map +0 -1
  503. package/dist/production/theming/contexts.cjs +0 -12
  504. package/dist/production/theming/contexts.cjs.map +0 -1
  505. package/dist/production/theming/contexts.js +0 -12
  506. package/dist/production/theming/contexts.js.map +0 -1
  507. package/dist/production/theming/useClassName.cjs +0 -17
  508. package/dist/production/theming/useClassName.cjs.map +0 -1
  509. package/dist/production/theming/useClassName.js +0 -17
  510. package/dist/production/theming/useClassName.js.map +0 -1
  511. package/dist/production/theming/useClassNameFactory.cjs +0 -22
  512. package/dist/production/theming/useClassNameFactory.cjs.map +0 -1
  513. package/dist/production/theming/useClassNameFactory.js +0 -22
  514. package/dist/production/theming/useClassNameFactory.js.map +0 -1
  515. package/dist/production/theming/useThemedClassName.cjs +0 -17
  516. package/dist/production/theming/useThemedClassName.cjs.map +0 -1
  517. package/dist/production/theming/useThemedClassName.js +0 -17
  518. package/dist/production/theming/useThemedClassName.js.map +0 -1
  519. package/dist/production/theming/useThemedClassNameFactory.cjs +0 -29
  520. package/dist/production/theming/useThemedClassNameFactory.cjs.map +0 -1
  521. package/dist/production/theming/useThemedClassNameFactory.js +0 -29
  522. package/dist/production/theming/useThemedClassNameFactory.js.map +0 -1
  523. package/dist/types/hooks/useAddClassNameDuringResize.d.ts +0 -13
  524. package/dist/types/hooks/useAddClassNameDuringResize.d.ts.map +0 -1
  525. package/dist/types/hooks/useCloseOnClickOutside.d.ts +0 -7
  526. package/dist/types/hooks/useCloseOnClickOutside.d.ts.map +0 -1
  527. package/dist/types/hooks/useCloseOnEscape.d.ts +0 -5
  528. package/dist/types/hooks/useCloseOnEscape.d.ts.map +0 -1
  529. package/dist/types/hooks/useContainerWidth.d.ts +0 -4
  530. package/dist/types/hooks/useContainerWidth.d.ts.map +0 -1
  531. package/dist/types/hooks/useElementSize.d.ts +0 -16
  532. package/dist/types/hooks/useElementSize.d.ts.map +0 -1
  533. package/dist/types/hooks/useElementTopOffset.d.ts +0 -3
  534. package/dist/types/hooks/useElementTopOffset.d.ts.map +0 -1
  535. package/dist/types/hooks/useEventHandler.d.ts +0 -10
  536. package/dist/types/hooks/useEventHandler.d.ts.map +0 -1
  537. package/dist/types/hooks/useOnElementMutation.d.ts +0 -3
  538. package/dist/types/hooks/useOnElementMutation.d.ts.map +0 -1
  539. package/dist/types/hooks/useOnScrollWithin.d.ts +0 -10
  540. package/dist/types/hooks/useOnScrollWithin.d.ts.map +0 -1
  541. package/dist/types/hooks/useScrollOffsets.d.ts +0 -14
  542. package/dist/types/hooks/useScrollOffsets.d.ts.map +0 -1
  543. package/dist/types/theming/ColorSchemeProvider.d.ts +0 -6
  544. package/dist/types/theming/ColorSchemeProvider.d.ts.map +0 -1
  545. package/dist/types/theming/GlobalClassNamePrefixContext.d.ts +0 -2
  546. package/dist/types/theming/GlobalClassNamePrefixContext.d.ts.map +0 -1
  547. package/dist/types/theming/contexts.d.ts +0 -12
  548. package/dist/types/theming/contexts.d.ts.map +0 -1
  549. package/dist/types/theming/index.d.ts +0 -8
  550. package/dist/types/theming/index.d.ts.map +0 -1
  551. package/dist/types/theming/useClassName.d.ts +0 -11
  552. package/dist/types/theming/useClassName.d.ts.map +0 -1
  553. package/dist/types/theming/useClassNameFactory.d.ts +0 -17
  554. package/dist/types/theming/useClassNameFactory.d.ts.map +0 -1
  555. package/dist/types/theming/useThemedClassName.d.ts +0 -39
  556. package/dist/types/theming/useThemedClassName.d.ts.map +0 -1
  557. package/dist/types/theming/useThemedClassNameFactory.d.ts +0 -3
  558. package/dist/types/theming/useThemedClassNameFactory.d.ts.map +0 -1
  559. package/src/hooks/useAddClassNameDuringResize.ts +0 -56
  560. package/src/hooks/useCloseOnClickOutside.ts +0 -27
  561. package/src/hooks/useCloseOnEscape.ts +0 -18
  562. package/src/hooks/useContainerWidth.ts +0 -13
  563. package/src/hooks/useElementSize.ts +0 -56
  564. package/src/hooks/useElementTopOffset.ts +0 -35
  565. package/src/hooks/useEventHandler.ts +0 -24
  566. package/src/hooks/useOnElementMutation.ts +0 -42
  567. package/src/hooks/useOnScrollWithin.ts +0 -68
  568. package/src/hooks/useScrollOffsets.ts +0 -87
  569. package/src/theming/ColorSchemeProvider.tsx +0 -16
  570. package/src/theming/GlobalClassNamePrefixContext.ts +0 -3
  571. package/src/theming/contexts.ts +0 -18
  572. package/src/theming/index.ts +0 -7
  573. package/src/theming/useClassName.ts +0 -28
  574. package/src/theming/useClassNameFactory.ts +0 -50
  575. package/src/theming/useThemedClassName.ts +0 -54
  576. package/src/theming/useThemedClassNameFactory.ts +0 -44
  577. /package/dist/development/{context → src/context}/createContext.js +0 -0
  578. /package/dist/development/{context → src/context}/createRequiredContext.js +0 -0
  579. /package/dist/development/{debug-context → src/debug-context}/Constants.cjs +0 -0
  580. /package/dist/development/{debug-context → src/debug-context}/Constants.js +0 -0
  581. /package/dist/development/{hooks → src/hooks}/unwrapRefValue.cjs +0 -0
  582. /package/dist/development/{hooks → src/hooks}/unwrapRefValue.js +0 -0
  583. /package/dist/development/{hooks → src/hooks}/useAbortController.js +0 -0
  584. /package/dist/development/{hooks → src/hooks}/useArrayMapMemo.js +0 -0
  585. /package/dist/development/{hooks → src/hooks}/useAutoHeightTextArea.js +0 -0
  586. /package/dist/development/{hooks → src/hooks}/useComposeRef.js +0 -0
  587. /package/dist/development/{hooks → src/hooks}/useConstantLengthInvariant.cjs +0 -0
  588. /package/dist/development/{hooks → src/hooks}/useConstantLengthInvariant.js +0 -0
  589. /package/dist/development/{hooks → src/hooks}/useConstantValueInvariant.cjs +0 -0
  590. /package/dist/development/{hooks → src/hooks}/useConstantValueInvariant.js +0 -0
  591. /package/dist/development/{hooks → src/hooks}/useDebounce.js +0 -0
  592. /package/dist/development/{hooks → src/hooks}/useDebounceCallback.js +0 -0
  593. /package/dist/development/{hooks → src/hooks}/useDocumentTitle.js +0 -0
  594. /package/dist/development/{hooks → src/hooks}/useForceRender.js +0 -0
  595. /package/dist/development/{hooks → src/hooks}/useId.js +0 -0
  596. /package/dist/development/{hooks → src/hooks}/useIsMounted.js +0 -0
  597. /package/dist/development/{hooks → src/hooks}/useObjectMemo.js +0 -0
  598. /package/dist/development/{hooks → src/hooks}/useOnElementClickOutsideCallback.js +0 -0
  599. /package/dist/development/{hooks → src/hooks}/useOnElementMouseEnterDelayedCallback.js +0 -0
  600. /package/dist/development/{hooks → src/hooks}/usePreviousValue.js +0 -0
  601. /package/dist/development/{hooks → src/hooks}/useStoredState.js +0 -0
  602. /package/dist/development/{hooks → src/hooks}/useUpdatedRef.js +0 -0
  603. /package/dist/development/{hooks → src/hooks}/useWindowSize.js +0 -0
  604. /package/dist/development/{referentiallyStable → src/referentiallyStable}/emptyArray.cjs +0 -0
  605. /package/dist/development/{referentiallyStable → src/referentiallyStable}/emptyArray.js +0 -0
  606. /package/dist/development/{referentiallyStable → src/referentiallyStable}/emptyObject.cjs +0 -0
  607. /package/dist/development/{referentiallyStable → src/referentiallyStable}/emptyObject.js +0 -0
  608. /package/dist/development/{referentiallyStable → src/referentiallyStable}/identityFunction.cjs +0 -0
  609. /package/dist/development/{referentiallyStable → src/referentiallyStable}/identityFunction.js +0 -0
  610. /package/dist/development/{referentiallyStable → src/referentiallyStable}/noop.cjs +0 -0
  611. /package/dist/development/{referentiallyStable → src/referentiallyStable}/noop.js +0 -0
  612. /package/dist/development/{referentiallyStable → src/referentiallyStable}/returnFalse.cjs +0 -0
  613. /package/dist/development/{referentiallyStable → src/referentiallyStable}/returnFalse.js +0 -0
  614. /package/dist/development/{referentiallyStable → src/referentiallyStable}/returnTrue.cjs +0 -0
  615. /package/dist/development/{referentiallyStable → src/referentiallyStable}/returnTrue.js +0 -0
  616. /package/dist/development/{referentiallyStable → src/referentiallyStable}/useReferentiallyStableCallback.js +0 -0
  617. /package/dist/production/{context → src/context}/createContext.js +0 -0
  618. /package/dist/production/{context → src/context}/createRequiredContext.js +0 -0
  619. /package/dist/production/{debug-context → src/debug-context}/Constants.cjs +0 -0
  620. /package/dist/production/{debug-context → src/debug-context}/Constants.js +0 -0
  621. /package/dist/production/{debug-context → src/debug-context}/Context.js +0 -0
  622. /package/dist/production/{hooks → src/hooks}/unwrapRefValue.cjs +0 -0
  623. /package/dist/production/{hooks → src/hooks}/unwrapRefValue.js +0 -0
  624. /package/dist/production/{hooks → src/hooks}/useAbortController.js +0 -0
  625. /package/dist/production/{hooks → src/hooks}/useArrayMapMemo.js +0 -0
  626. /package/dist/production/{hooks → src/hooks}/useAutoHeightTextArea.js +0 -0
  627. /package/dist/production/{hooks → src/hooks}/useComposeRef.js +0 -0
  628. /package/dist/production/{hooks → src/hooks}/useConstantLengthInvariant.cjs +0 -0
  629. /package/dist/production/{hooks → src/hooks}/useConstantLengthInvariant.js +0 -0
  630. /package/dist/production/{hooks → src/hooks}/useConstantValueInvariant.cjs +0 -0
  631. /package/dist/production/{hooks → src/hooks}/useConstantValueInvariant.js +0 -0
  632. /package/dist/production/{hooks → src/hooks}/useDebounce.js +0 -0
  633. /package/dist/production/{hooks → src/hooks}/useDebounceCallback.js +0 -0
  634. /package/dist/production/{hooks → src/hooks}/useDocumentTitle.js +0 -0
  635. /package/dist/production/{hooks → src/hooks}/useForceRender.js +0 -0
  636. /package/dist/production/{hooks → src/hooks}/useId.js +0 -0
  637. /package/dist/production/{hooks → src/hooks}/useIsMounted.js +0 -0
  638. /package/dist/production/{hooks → src/hooks}/useObjectMemo.js +0 -0
  639. /package/dist/production/{hooks → src/hooks}/useOnElementClickOutsideCallback.js +0 -0
  640. /package/dist/production/{hooks → src/hooks}/useOnElementMouseEnterDelayedCallback.js +0 -0
  641. /package/dist/production/{hooks → src/hooks}/usePreviousValue.js +0 -0
  642. /package/dist/production/{hooks → src/hooks}/useStoredState.js +0 -0
  643. /package/dist/production/{hooks → src/hooks}/useUpdatedRef.js +0 -0
  644. /package/dist/production/{hooks → src/hooks}/useWindowSize.js +0 -0
  645. /package/dist/production/{referentiallyStable → src/referentiallyStable}/emptyArray.cjs +0 -0
  646. /package/dist/production/{referentiallyStable → src/referentiallyStable}/emptyArray.js +0 -0
  647. /package/dist/production/{referentiallyStable → src/referentiallyStable}/emptyObject.cjs +0 -0
  648. /package/dist/production/{referentiallyStable → src/referentiallyStable}/emptyObject.js +0 -0
  649. /package/dist/production/{referentiallyStable → src/referentiallyStable}/identityFunction.cjs +0 -0
  650. /package/dist/production/{referentiallyStable → src/referentiallyStable}/identityFunction.js +0 -0
  651. /package/dist/production/{referentiallyStable → src/referentiallyStable}/noop.cjs +0 -0
  652. /package/dist/production/{referentiallyStable → src/referentiallyStable}/noop.js +0 -0
  653. /package/dist/production/{referentiallyStable → src/referentiallyStable}/returnFalse.cjs +0 -0
  654. /package/dist/production/{referentiallyStable → src/referentiallyStable}/returnFalse.js +0 -0
  655. /package/dist/production/{referentiallyStable → src/referentiallyStable}/returnTrue.cjs +0 -0
  656. /package/dist/production/{referentiallyStable → src/referentiallyStable}/returnTrue.js +0 -0
  657. /package/dist/production/{referentiallyStable → src/referentiallyStable}/useReferentiallyStableCallback.js +0 -0
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const useArrayMapMemo = (items, map) => {
5
- const mapped = react.useMemo(() => items.map(map), [map, ...items]);
6
- return react.useMemo(() => mapped, mapped);
5
+ const mapped = React.useMemo(() => items.map(map), [map, ...items]);
6
+ return React.useMemo(() => mapped, mapped);
7
7
  };
8
8
  exports.useArrayMapMemo = useArrayMapMemo;
9
9
  //# sourceMappingURL=useArrayMapMemo.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useArrayMapMemo.cjs","sources":["../../../../../packages/react-utils/src/hooks/useArrayMapMemo.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { useConstantLengthInvariant } from './useConstantLengthInvariant'\n\n/**\n * ⚠️ ONLY USE THIS IF YOU *REALLY* KNOW WHAT YOU'RE DOING! ⚠️\n * ⚠ HERE BE DRAGONS THAT KNOW WHERE YOU LIVE! ⚠\n *\n * This is a bit of React naughtiness that allows us to memoize outputs of Array.prototype.map() based on the contents\n * of the original array, and not its referential equality. That way, if we create a new array with identical items,\n * we get an array that is referentially equal to the previous one.\n */\nexport const useArrayMapMemo = <Item, OutputItem>(\n\titems: Item[],\n\tmap: (value: Item, index: number, array: Item[]) => OutputItem,\n): OutputItem[] => {\n\tuseConstantLengthInvariant(items)\n\n\t// This is tricky. We don't want to exclude the map function from the dependency list because if it changes but the\n\t// items array remains the same, we still want to re-compute the new array. However, if that yields the same array,\n\t// in the sense that the items are identical, albeit computed via a different map function, we still want to\n\t// preserve the referential equality of the original. Hence the second memo.\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst mapped = useMemo(() => items.map(map), [map, ...items])\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\treturn useMemo(() => mapped, mapped) // This is deliberately not `[mapped]`\n}\n"],"names":["useMemo"],"mappings":";;;AAWa,MAAA,kBAAkB,CAC9B,OACA,QACkB;AASZ,QAAA,SAASA,MAAAA,QAAQ,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAGrD,SAAAA,cAAQ,MAAM,QAAQ,MAAM;AACpC;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useArrayMapMemo.js","sources":["../../../../../packages/react-utils/src/hooks/useArrayMapMemo.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { useConstantLengthInvariant } from './useConstantLengthInvariant'\n\n/**\n * ⚠️ ONLY USE THIS IF YOU *REALLY* KNOW WHAT YOU'RE DOING! ⚠️\n * ⚠ HERE BE DRAGONS THAT KNOW WHERE YOU LIVE! ⚠\n *\n * This is a bit of React naughtiness that allows us to memoize outputs of Array.prototype.map() based on the contents\n * of the original array, and not its referential equality. That way, if we create a new array with identical items,\n * we get an array that is referentially equal to the previous one.\n */\nexport const useArrayMapMemo = <Item, OutputItem>(\n\titems: Item[],\n\tmap: (value: Item, index: number, array: Item[]) => OutputItem,\n): OutputItem[] => {\n\tuseConstantLengthInvariant(items)\n\n\t// This is tricky. We don't want to exclude the map function from the dependency list because if it changes but the\n\t// items array remains the same, we still want to re-compute the new array. However, if that yields the same array,\n\t// in the sense that the items are identical, albeit computed via a different map function, we still want to\n\t// preserve the referential equality of the original. Hence the second memo.\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst mapped = useMemo(() => items.map(map), [map, ...items])\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\treturn useMemo(() => mapped, mapped) // This is deliberately not `[mapped]`\n}\n"],"names":[],"mappings":";AAWa,MAAA,kBAAkB,CAC9B,OACA,QACkB;AASZ,QAAA,SAAS,QAAQ,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAGrD,SAAA,QAAQ,MAAM,QAAQ,MAAM;AACpC;"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const utilities = require("@contember/utilities");
4
- const react = require("react");
4
+ const React = require("react");
5
5
  const unwrapRefValue = require("./unwrapRefValue.cjs");
6
6
  const useOnElementResize = require("./useOnElementResize.cjs");
7
7
  const useAutoHeightTextArea = (textAreaRef, value, minRows, maxRows) => {
8
- const measure = react.useCallback(async (ref, minRows2, maxRows2) => {
8
+ const measure = React.useCallback(async (ref, minRows2, maxRows2) => {
9
9
  if (ref) {
10
10
  const rowsAttribute = ref.rows;
11
11
  ref.style.height = "";
@@ -33,7 +33,7 @@ const useAutoHeightTextArea = (textAreaRef, value, minRows, maxRows) => {
33
33
  useOnElementResize.useOnElementResize(textAreaRef, () => {
34
34
  measure(unwrapRefValue.unwrapRefValue(textAreaRef), minRows, maxRows);
35
35
  });
36
- react.useLayoutEffect(() => {
36
+ React.useLayoutEffect(() => {
37
37
  measure(unwrapRefValue.unwrapRefValue(textAreaRef), minRows, maxRows);
38
38
  }, [maxRows, measure, minRows, textAreaRef, value]);
39
39
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoHeightTextArea.cjs","sources":["../../../../../packages/react-utils/src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { px } from '@contember/utilities'\nimport { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nexport const useAutoHeightTextArea = (\n\ttextAreaRef: RefObjectOrElement<HTMLTextAreaElement>,\n\tvalue: string,\n\tminRows: number,\n\tmaxRows: number,\n) => {\n\tconst measure = useCallback(async (ref: HTMLTextAreaElement | null, minRows: number, maxRows: number) => {\n\t\tif (ref) {\n\t\t\tconst rowsAttribute = ref.rows\n\n\t\t\tref.style.height = ''\n\t\t\tref.style.minHeight = ''\n\t\t\tref.style.maxHeight = ''\n\n\t\t\tif (minRows !== maxRows) {\n\t\t\t\tconst height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight\n\t\t\t\tlet minHeight: number\n\t\t\t\tlet maxHeight: number\n\n\t\t\t\tref.rows = minRows\n\t\t\t\tminHeight = await ref.getBoundingClientRect().height\n\n\t\t\t\tif (maxRows === Infinity) {\n\t\t\t\t\tmaxHeight = Infinity\n\t\t\t\t} else {\n\t\t\t\t\tref.rows = maxRows\n\t\t\t\t\tmaxHeight = await ref.getBoundingClientRect().height\n\t\t\t\t}\n\n\t\t\t\tref.style.height = px(height)\n\t\t\t\tref.style.minHeight = px(minHeight)\n\t\t\t\tref.style.maxHeight = px(maxHeight)\n\t\t\t}\n\n\t\t\tref.rows = rowsAttribute\n\t\t}\n\t}, [])\n\n\tuseOnElementResize(textAreaRef, () => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t})\n\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["useCallback","minRows","maxRows","px","useOnElementResize","unwrapRefValue","useLayoutEffect"],"mappings":";;;;;;AAKO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAUA,MAAA,YAAY,OAAO,KAAiCC,UAAiBC,aAAoB;AACxG,QAAI,KAAK;AACR,YAAM,gBAAgB,IAAI;AAE1B,UAAI,MAAM,SAAS;AACnB,UAAI,MAAM,YAAY;AACtB,UAAI,MAAM,YAAY;AAEtB,UAAID,aAAYC,UAAS;AACxB,cAAM,SAAS,IAAI,eAAe,IAAI,eAAe,IAAI;AACrD,YAAA;AACA,YAAA;AAEJ,YAAI,OAAOD;AACC,oBAAA,MAAM,IAAI,sBAAA,EAAwB;AAE9C,YAAIC,aAAY,UAAU;AACb,sBAAA;AAAA,QAAA,OACN;AACN,cAAI,OAAOA;AACC,sBAAA,MAAM,IAAI,sBAAA,EAAwB;AAAA,QAC/C;AAEI,YAAA,MAAM,SAASC,UAAA,GAAG,MAAM;AACxB,YAAA,MAAM,YAAYA,UAAA,GAAG,SAAS;AAC9B,YAAA,MAAM,YAAYA,UAAA,GAAG,SAAS;AAAA,MACnC;AAEA,UAAI,OAAO;AAAA,IACZ;AAAA,EACD,GAAG,CAAE,CAAA;AAELC,qBAAA,mBAAmB,aAAa,MAAM;AACrC,YAAQC,eAAAA,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EAAA,CACrD;AAEDC,QAAAA,gBAAgB,MAAM;AACrB,YAAQD,eAAAA,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EAAA,GACnD,CAAC,SAAS,SAAS,SAAS,aAAa,KAAK,CAAC;AACnD;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoHeightTextArea.js","sources":["../../../../../packages/react-utils/src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { px } from '@contember/utilities'\nimport { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nexport const useAutoHeightTextArea = (\n\ttextAreaRef: RefObjectOrElement<HTMLTextAreaElement>,\n\tvalue: string,\n\tminRows: number,\n\tmaxRows: number,\n) => {\n\tconst measure = useCallback(async (ref: HTMLTextAreaElement | null, minRows: number, maxRows: number) => {\n\t\tif (ref) {\n\t\t\tconst rowsAttribute = ref.rows\n\n\t\t\tref.style.height = ''\n\t\t\tref.style.minHeight = ''\n\t\t\tref.style.maxHeight = ''\n\n\t\t\tif (minRows !== maxRows) {\n\t\t\t\tconst height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight\n\t\t\t\tlet minHeight: number\n\t\t\t\tlet maxHeight: number\n\n\t\t\t\tref.rows = minRows\n\t\t\t\tminHeight = await ref.getBoundingClientRect().height\n\n\t\t\t\tif (maxRows === Infinity) {\n\t\t\t\t\tmaxHeight = Infinity\n\t\t\t\t} else {\n\t\t\t\t\tref.rows = maxRows\n\t\t\t\t\tmaxHeight = await ref.getBoundingClientRect().height\n\t\t\t\t}\n\n\t\t\t\tref.style.height = px(height)\n\t\t\t\tref.style.minHeight = px(minHeight)\n\t\t\t\tref.style.maxHeight = px(maxHeight)\n\t\t\t}\n\n\t\t\tref.rows = rowsAttribute\n\t\t}\n\t}, [])\n\n\tuseOnElementResize(textAreaRef, () => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t})\n\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["minRows","maxRows"],"mappings":";;;;AAKO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAU,YAAY,OAAO,KAAiCA,UAAiBC,aAAoB;AACxG,QAAI,KAAK;AACR,YAAM,gBAAgB,IAAI;AAE1B,UAAI,MAAM,SAAS;AACnB,UAAI,MAAM,YAAY;AACtB,UAAI,MAAM,YAAY;AAEtB,UAAID,aAAYC,UAAS;AACxB,cAAM,SAAS,IAAI,eAAe,IAAI,eAAe,IAAI;AACrD,YAAA;AACA,YAAA;AAEJ,YAAI,OAAOD;AACC,oBAAA,MAAM,IAAI,sBAAA,EAAwB;AAE9C,YAAIC,aAAY,UAAU;AACb,sBAAA;AAAA,QAAA,OACN;AACN,cAAI,OAAOA;AACC,sBAAA,MAAM,IAAI,sBAAA,EAAwB;AAAA,QAC/C;AAEI,YAAA,MAAM,SAAS,GAAG,MAAM;AACxB,YAAA,MAAM,YAAY,GAAG,SAAS;AAC9B,YAAA,MAAM,YAAY,GAAG,SAAS;AAAA,MACnC;AAEA,UAAI,OAAO;AAAA,IACZ;AAAA,EACD,GAAG,CAAE,CAAA;AAEL,qBAAmB,aAAa,MAAM;AACrC,YAAQ,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EAAA,CACrD;AAED,kBAAgB,MAAM;AACrB,YAAQ,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EAAA,GACnD,CAAC,SAAS,SAAS,SAAS,aAAa,KAAK,CAAC;AACnD;"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const MULTIPLE_SPACES_REG_EXP = / +/g;
5
5
  function normalize(text) {
6
6
  return text.replace(MULTIPLE_SPACES_REG_EXP, " ").trim();
@@ -14,9 +14,8 @@ function getChildrenAsLabel(node) {
14
14
  return normalize(node.map(getChildrenAsLabel).join(""));
15
15
  } else {
16
16
  let label = [];
17
- react.Children.map(node, (child) => {
18
- if (child === null || child === void 0 || typeof child === "boolean")
19
- ;
17
+ React.Children.map(node, (child) => {
18
+ if (child === null || child === void 0 || typeof child === "boolean") ;
20
19
  else if (typeof child === "string") {
21
20
  label.push(child);
22
21
  } else if (typeof child === "number") {
@@ -37,15 +36,14 @@ function getChildrenAsLabel(node) {
37
36
  if (childLabel) {
38
37
  label.push(childLabel);
39
38
  }
40
- } else
41
- ;
39
+ } else ;
42
40
  }
43
41
  });
44
42
  return label.length > 0 ? label.join("") : void 0;
45
43
  }
46
44
  }
47
45
  function useChildrenAsLabel(node) {
48
- return react.useMemo(() => getChildrenAsLabel(node), [node]);
46
+ return React.useMemo(() => getChildrenAsLabel(node), [node]);
49
47
  }
50
48
  exports.getChildrenAsLabel = getChildrenAsLabel;
51
49
  exports.useChildrenAsLabel = useChildrenAsLabel;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChildrenAsLabel.cjs","sources":["../../../../../packages/react-utils/src/hooks/useChildrenAsLabel.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react'\n\nconst MULTIPLE_SPACES_REG_EXP = / +/g\n\nfunction normalize(text: string): string {\n\treturn text.replace(MULTIPLE_SPACES_REG_EXP, ' ').trim()\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n *\n */\nexport function getChildrenAsLabel(node: ReactNode): string | undefined {\n\tif (typeof node === 'string' || typeof node === 'number') {\n\t\treturn String(node)\n\t} else if (node === null || node === undefined || typeof node === 'boolean') {\n\t\treturn undefined\n\t} else if (Array.isArray(node)) {\n\t\treturn normalize(node.map(getChildrenAsLabel).join(''))\n\t} else {\n\t\tlet label: (string | number)[] = []\n\n\t\tChildren.map(node, child => {\n\t\t\tif (child === null || child === undefined || typeof child === 'boolean') {\n\t\t\t} else if (typeof child === 'string') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (typeof child === 'number') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (Array.isArray(child)) {\n\t\t\t\tconst childLabel = getChildrenAsLabel(child)\n\n\t\t\t\tif (childLabel) {\n\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// ReactElement | JSXElementConstructor | ReactPortal\n\t\t\t\tif ('props' in child && 'children' in child.props) {\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.props.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if ('children' in child) {\n\t\t\t\t\t// ReactPortal\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if (import.meta.env.DEV) {\n\t\t\t\t\tconsole.warn('Unsupported child:', child)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn label.length > 0 ? label.join('') : undefined\n\t}\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n *\n */\nexport function useChildrenAsLabel(node: ReactNode): string | undefined {\n\treturn useMemo(() => getChildrenAsLabel(node), [node])\n}\n"],"names":["Children","useMemo"],"mappings":";;;AAEA,MAAM,0BAA0B;AAEhC,SAAS,UAAU,MAAsB;AACxC,SAAO,KAAK,QAAQ,yBAAyB,GAAG,EAAE,KAAK;AACxD;AASO,SAAS,mBAAmB,MAAqC;AACvE,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AACzD,WAAO,OAAO,IAAI;AAAA,EAAA,WACR,SAAS,QAAQ,SAAS,UAAa,OAAO,SAAS,WAAW;AACrE,WAAA;AAAA,EACG,WAAA,MAAM,QAAQ,IAAI,GAAG;AAC/B,WAAO,UAAU,KAAK,IAAI,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAAA,EAAA,OAChD;AACN,QAAI,QAA6B,CAAA;AAExBA,UAAAA,SAAA,IAAI,MAAM,CAAS,UAAA;AAC3B,UAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,UAAW;AAAA,eAC9D,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MAAA,WACN,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MACN,WAAA,MAAM,QAAQ,KAAK,GAAG;AAC1B,cAAA,aAAa,mBAAmB,KAAK;AAE3C,YAAI,YAAY;AACf,gBAAM,KAAK,UAAU;AAAA,QACtB;AAAA,MAAA,OACM;AAEN,YAAI,WAAW,SAAS,cAAc,MAAM,OAAO;AAClD,gBAAM,aAAa,mBAAmB,MAAM,MAAM,QAAQ;AAE1D,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QAAA,WACU,cAAc,OAAO;AAEzB,gBAAA,aAAa,mBAAmB,MAAM,QAAQ;AAEpD,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QAAA;MAIF;AAAA,IAAA,CACA;AAED,WAAO,MAAM,SAAS,IAAI,MAAM,KAAK,EAAE,IAAI;AAAA,EAC5C;AACD;AASO,SAAS,mBAAmB,MAAqC;AACvE,SAAOC,MAAAA,QAAQ,MAAM,mBAAmB,IAAI,GAAG,CAAC,IAAI,CAAC;AACtD;;;"}
@@ -13,8 +13,7 @@ function getChildrenAsLabel(node) {
13
13
  } else {
14
14
  let label = [];
15
15
  Children.map(node, (child) => {
16
- if (child === null || child === void 0 || typeof child === "boolean")
17
- ;
16
+ if (child === null || child === void 0 || typeof child === "boolean") ;
18
17
  else if (typeof child === "string") {
19
18
  label.push(child);
20
19
  } else if (typeof child === "number") {
@@ -35,8 +34,7 @@ function getChildrenAsLabel(node) {
35
34
  if (childLabel) {
36
35
  label.push(childLabel);
37
36
  }
38
- } else
39
- ;
37
+ } else ;
40
38
  }
41
39
  });
42
40
  return label.length > 0 ? label.join("") : void 0;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChildrenAsLabel.js","sources":["../../../../../packages/react-utils/src/hooks/useChildrenAsLabel.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react'\n\nconst MULTIPLE_SPACES_REG_EXP = / +/g\n\nfunction normalize(text: string): string {\n\treturn text.replace(MULTIPLE_SPACES_REG_EXP, ' ').trim()\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n *\n */\nexport function getChildrenAsLabel(node: ReactNode): string | undefined {\n\tif (typeof node === 'string' || typeof node === 'number') {\n\t\treturn String(node)\n\t} else if (node === null || node === undefined || typeof node === 'boolean') {\n\t\treturn undefined\n\t} else if (Array.isArray(node)) {\n\t\treturn normalize(node.map(getChildrenAsLabel).join(''))\n\t} else {\n\t\tlet label: (string | number)[] = []\n\n\t\tChildren.map(node, child => {\n\t\t\tif (child === null || child === undefined || typeof child === 'boolean') {\n\t\t\t} else if (typeof child === 'string') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (typeof child === 'number') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (Array.isArray(child)) {\n\t\t\t\tconst childLabel = getChildrenAsLabel(child)\n\n\t\t\t\tif (childLabel) {\n\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// ReactElement | JSXElementConstructor | ReactPortal\n\t\t\t\tif ('props' in child && 'children' in child.props) {\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.props.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if ('children' in child) {\n\t\t\t\t\t// ReactPortal\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if (import.meta.env.DEV) {\n\t\t\t\t\tconsole.warn('Unsupported child:', child)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn label.length > 0 ? label.join('') : undefined\n\t}\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n *\n */\nexport function useChildrenAsLabel(node: ReactNode): string | undefined {\n\treturn useMemo(() => getChildrenAsLabel(node), [node])\n}\n"],"names":[],"mappings":";AAEA,MAAM,0BAA0B;AAEhC,SAAS,UAAU,MAAsB;AACxC,SAAO,KAAK,QAAQ,yBAAyB,GAAG,EAAE,KAAK;AACxD;AASO,SAAS,mBAAmB,MAAqC;AACvE,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AACzD,WAAO,OAAO,IAAI;AAAA,EAAA,WACR,SAAS,QAAQ,SAAS,UAAa,OAAO,SAAS,WAAW;AACrE,WAAA;AAAA,EACG,WAAA,MAAM,QAAQ,IAAI,GAAG;AAC/B,WAAO,UAAU,KAAK,IAAI,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAAA,EAAA,OAChD;AACN,QAAI,QAA6B,CAAA;AAExB,aAAA,IAAI,MAAM,CAAS,UAAA;AAC3B,UAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,UAAW;AAAA,eAC9D,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MAAA,WACN,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MACN,WAAA,MAAM,QAAQ,KAAK,GAAG;AAC1B,cAAA,aAAa,mBAAmB,KAAK;AAE3C,YAAI,YAAY;AACf,gBAAM,KAAK,UAAU;AAAA,QACtB;AAAA,MAAA,OACM;AAEN,YAAI,WAAW,SAAS,cAAc,MAAM,OAAO;AAClD,gBAAM,aAAa,mBAAmB,MAAM,MAAM,QAAQ;AAE1D,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QAAA,WACU,cAAc,OAAO;AAEzB,gBAAA,aAAa,mBAAmB,MAAM,QAAQ;AAEpD,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QAAA;MAIF;AAAA,IAAA,CACA;AAED,WAAO,MAAM,SAAS,IAAI,MAAM,KAAK,EAAE,IAAI;AAAA,EAC5C;AACD;AASO,SAAS,mBAAmB,MAAqC;AACvE,SAAO,QAAQ,MAAM,mBAAmB,IAAI,GAAG,CAAC,IAAI,CAAC;AACtD;"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  function setRef(ref, instance) {
5
5
  if (ref) {
6
6
  if (typeof ref === "function") {
@@ -11,8 +11,8 @@ function setRef(ref, instance) {
11
11
  }
12
12
  }
13
13
  function useComposeRef(...refs) {
14
- const initialRefs = react.useRef(refs);
15
- const composeRef = react.useMemo(() => {
14
+ const initialRefs = React.useRef(refs);
15
+ const composeRef = React.useMemo(() => {
16
16
  function composedRefCallback(instance) {
17
17
  initialRefs.current.forEach((ref) => setRef(ref, instance));
18
18
  setCurrent(instance);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComposeRef.cjs","sources":["../../../../../packages/react-utils/src/hooks/useComposeRef.ts"],"sourcesContent":["import { MutableRefObject, RefCallback, useMemo, useRef } from 'react'\n\nexport type MaybeRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null | undefined\nexport type ComposedRefCallback<T> = RefCallback<T> & { current: T | null }\n\nfunction setRef<T>(ref: MaybeRef<T>, instance: T | null): void {\n\tif (ref) {\n\t\tif (typeof ref === 'function') {\n\t\t\tref(instance)\n\t\t} else if (instance) {\n\t\t\tref.current = instance\n\t\t}\n\t}\n}\n\n/**\n * Fills any number of refs with an instance\n *\n * Useful when you need to use outer ref and inner in the same time, e.g. passing element\n * back to forwardedRef an also using the same value within the component locally.\n *\n * @param refs - Rest parameter of refs to fill with instance\n * @returns Returns a function similar to a RefCallback\n */\nexport function useComposeRef<T>(...refs: MaybeRef<T>[]): ComposedRefCallback<T> {\n\tconst initialRefs = useRef(refs)\n\n\tconst composeRef: ComposedRefCallback<T> = useMemo(() => {\n\t\tfunction composedRefCallback(instance: T | null) {\n\t\t\tinitialRefs.current.forEach(ref => setRef(ref, instance))\n\t\t\tsetCurrent(instance)\n\t\t}\n\n\t\tfunction setCurrent(instance: T | null) {\n\t\t\tif (instance) {\n\t\t\t\tcomposedRefCallback.current = instance\n\t\t\t}\n\t\t}\n\n\t\tcomposedRefCallback.current = null as T | null\n\n\t\treturn composedRefCallback\n\t}, [])\n\n\treturn composeRef\n}\n"],"names":["useRef","useMemo"],"mappings":";;;AAKA,SAAS,OAAU,KAAkB,UAA0B;AAC9D,MAAI,KAAK;AACJ,QAAA,OAAO,QAAQ,YAAY;AAC9B,UAAI,QAAQ;AAAA,eACF,UAAU;AACpB,UAAI,UAAU;AAAA,IACf;AAAA,EACD;AACD;AAWO,SAAS,iBAAoB,MAA6C;AAC1E,QAAA,cAAcA,aAAO,IAAI;AAEzB,QAAA,aAAqCC,MAAAA,QAAQ,MAAM;AACxD,aAAS,oBAAoB,UAAoB;AAChD,kBAAY,QAAQ,QAAQ,CAAA,QAAO,OAAO,KAAK,QAAQ,CAAC;AACxD,iBAAW,QAAQ;AAAA,IACpB;AAEA,aAAS,WAAW,UAAoB;AACvC,UAAI,UAAU;AACb,4BAAoB,UAAU;AAAA,MAC/B;AAAA,IACD;AAEA,wBAAoB,UAAU;AAEvB,WAAA;AAAA,EACR,GAAG,CAAE,CAAA;AAEE,SAAA;AACR;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComposeRef.js","sources":["../../../../../packages/react-utils/src/hooks/useComposeRef.ts"],"sourcesContent":["import { MutableRefObject, RefCallback, useMemo, useRef } from 'react'\n\nexport type MaybeRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null | undefined\nexport type ComposedRefCallback<T> = RefCallback<T> & { current: T | null }\n\nfunction setRef<T>(ref: MaybeRef<T>, instance: T | null): void {\n\tif (ref) {\n\t\tif (typeof ref === 'function') {\n\t\t\tref(instance)\n\t\t} else if (instance) {\n\t\t\tref.current = instance\n\t\t}\n\t}\n}\n\n/**\n * Fills any number of refs with an instance\n *\n * Useful when you need to use outer ref and inner in the same time, e.g. passing element\n * back to forwardedRef an also using the same value within the component locally.\n *\n * @param refs - Rest parameter of refs to fill with instance\n * @returns Returns a function similar to a RefCallback\n */\nexport function useComposeRef<T>(...refs: MaybeRef<T>[]): ComposedRefCallback<T> {\n\tconst initialRefs = useRef(refs)\n\n\tconst composeRef: ComposedRefCallback<T> = useMemo(() => {\n\t\tfunction composedRefCallback(instance: T | null) {\n\t\t\tinitialRefs.current.forEach(ref => setRef(ref, instance))\n\t\t\tsetCurrent(instance)\n\t\t}\n\n\t\tfunction setCurrent(instance: T | null) {\n\t\t\tif (instance) {\n\t\t\t\tcomposedRefCallback.current = instance\n\t\t\t}\n\t\t}\n\n\t\tcomposedRefCallback.current = null as T | null\n\n\t\treturn composedRefCallback\n\t}, [])\n\n\treturn composeRef\n}\n"],"names":[],"mappings":";AAKA,SAAS,OAAU,KAAkB,UAA0B;AAC9D,MAAI,KAAK;AACJ,QAAA,OAAO,QAAQ,YAAY;AAC9B,UAAI,QAAQ;AAAA,eACF,UAAU;AACpB,UAAI,UAAU;AAAA,IACf;AAAA,EACD;AACD;AAWO,SAAS,iBAAoB,MAA6C;AAC1E,QAAA,cAAc,OAAO,IAAI;AAEzB,QAAA,aAAqC,QAAQ,MAAM;AACxD,aAAS,oBAAoB,UAAoB;AAChD,kBAAY,QAAQ,QAAQ,CAAA,QAAO,OAAO,KAAK,QAAQ,CAAC;AACxD,iBAAW,QAAQ;AAAA,IACpB;AAEA,aAAS,WAAW,UAAoB;AACvC,UAAI,UAAU;AACb,4BAAoB,UAAU;AAAA,MAC/B;AAAA,IACD;AAEA,wBAAoB,UAAU;AAEvB,WAAA;AAAA,EACR,GAAG,CAAE,CAAA;AAEE,SAAA;AACR;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConstantLengthInvariant.cjs","sources":["../../../../../packages/react-utils/src/hooks/useConstantLengthInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantLengthInvariant = <Item>(items: Item[], message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst previous = usePreviousValue(items)\n\t\tif (previous.length !== items.length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invariant violation: ${message || 'Changing the length of an array whose length must remain constant between renders.'\n\t\t\t\t}`,\n\t\t\t)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAGa,MAAA,6BAA6B,CAAO,OAAe,YAAqB;AAWrF;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConstantLengthInvariant.js","sources":["../../../../../packages/react-utils/src/hooks/useConstantLengthInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantLengthInvariant = <Item>(items: Item[], message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst previous = usePreviousValue(items)\n\t\tif (previous.length !== items.length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invariant violation: ${message || 'Changing the length of an array whose length must remain constant between renders.'\n\t\t\t\t}`,\n\t\t\t)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAGa,MAAA,6BAA6B,CAAO,OAAe,YAAqB;AAWrF;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConstantValueInvariant.cjs","sources":["../../../../../packages/react-utils/src/hooks/useConstantValueInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantValueInvariant = <Value>(value: Value, message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst previous = usePreviousValue(value)\n\t\tif (previous !== value) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invariant violation: ${message || 'Changing a value which must remain constant between renders.'}`,\n\t\t\t)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAGa,MAAA,4BAA4B,CAAQ,OAAc,YAAqB;AAUpF;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConstantValueInvariant.js","sources":["../../../../../packages/react-utils/src/hooks/useConstantValueInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantValueInvariant = <Value>(value: Value, message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst previous = usePreviousValue(value)\n\t\tif (previous !== value) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invariant violation: ${message || 'Changing a value which must remain constant between renders.'}`,\n\t\t\t)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAGa,MAAA,4BAA4B,CAAQ,OAAc,YAAqB;AAUpF;"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const useDebounce = (value, debounceMs) => {
5
- const [debounced, setDebounced] = react.useState(value);
6
- react.useEffect(() => {
5
+ const [debounced, setDebounced] = React.useState(value);
6
+ React.useEffect(() => {
7
7
  const handle = window.setTimeout(() => setDebounced(value), debounceMs);
8
8
  return () => {
9
9
  window.clearTimeout(handle);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebounce.cjs","sources":["../../../../../packages/react-utils/src/hooks/useDebounce.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nexport const useDebounce = <T>(value: T, debounceMs: number): T => {\n\tconst [debounced, setDebounced] = useState(value)\n\tuseEffect(() => {\n\t\tconst handle = window.setTimeout(() => setDebounced(value), debounceMs)\n\t\treturn () => {\n\t\t\twindow.clearTimeout(handle)\n\t\t}\n\t}, [value, debounceMs])\n\treturn debounced\n}\n"],"names":["useState","useEffect"],"mappings":";;;AAEa,MAAA,cAAc,CAAI,OAAU,eAA0B;AAClE,QAAM,CAAC,WAAW,YAAY,IAAIA,eAAS,KAAK;AAChDC,QAAAA,UAAU,MAAM;AACf,UAAM,SAAS,OAAO,WAAW,MAAM,aAAa,KAAK,GAAG,UAAU;AACtE,WAAO,MAAM;AACZ,aAAO,aAAa,MAAM;AAAA,IAAA;AAAA,EAC3B,GACE,CAAC,OAAO,UAAU,CAAC;AACf,SAAA;AACR;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebounce.js","sources":["../../../../../packages/react-utils/src/hooks/useDebounce.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nexport const useDebounce = <T>(value: T, debounceMs: number): T => {\n\tconst [debounced, setDebounced] = useState(value)\n\tuseEffect(() => {\n\t\tconst handle = window.setTimeout(() => setDebounced(value), debounceMs)\n\t\treturn () => {\n\t\t\twindow.clearTimeout(handle)\n\t\t}\n\t}, [value, debounceMs])\n\treturn debounced\n}\n"],"names":[],"mappings":";AAEa,MAAA,cAAc,CAAI,OAAU,eAA0B;AAClE,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,YAAU,MAAM;AACf,UAAM,SAAS,OAAO,WAAW,MAAM,aAAa,KAAK,GAAG,UAAU;AACtE,WAAO,MAAM;AACZ,aAAO,aAAa,MAAM;AAAA,IAAA;AAAA,EAC3B,GACE,CAAC,OAAO,UAAU,CAAC;AACf,SAAA;AACR;"}
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const useDebounceCallback = (cb, debounceMs) => {
5
- const timerRef = react.useRef();
6
- const cbRef = react.useRef(cb);
5
+ const timerRef = React.useRef();
6
+ const cbRef = React.useRef(cb);
7
7
  cbRef.current = cb;
8
- react.useEffect(() => {
8
+ React.useEffect(() => {
9
9
  return () => clearTimeout(timerRef.current);
10
10
  }, []);
11
- return react.useCallback(() => {
11
+ return React.useCallback(() => {
12
12
  timerRef.current && clearTimeout(timerRef.current);
13
13
  timerRef.current = setTimeout(() => {
14
14
  cbRef.current();
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebounceCallback.cjs","sources":["../../../../../packages/react-utils/src/hooks/useDebounceCallback.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useDebounceCallback = (cb: () => any, debounceMs: number) => {\n\tconst timerRef = useRef<ReturnType<typeof setTimeout>>()\n\tconst cbRef = useRef(cb)\n\tcbRef.current = cb\n\n\tuseEffect(() => {\n\t\treturn () => clearTimeout(timerRef.current)\n\t}, [])\n\n\treturn useCallback(() => {\n\t\ttimerRef.current && clearTimeout(timerRef.current)\n\n\t\ttimerRef.current = setTimeout(() => {\n\t\t\tcbRef.current()\n\t\t}, debounceMs)\n\t}, [debounceMs])\n}\n"],"names":["useRef","useEffect","useCallback"],"mappings":";;;AAEa,MAAA,sBAAsB,CAAC,IAAe,eAAuB;AACzE,QAAM,WAAWA,MAAAA;AACX,QAAA,QAAQA,aAAO,EAAE;AACvB,QAAM,UAAU;AAEhBC,QAAAA,UAAU,MAAM;AACR,WAAA,MAAM,aAAa,SAAS,OAAO;AAAA,EAC3C,GAAG,CAAE,CAAA;AAEL,SAAOC,kBAAY,MAAM;AACf,aAAA,WAAW,aAAa,SAAS,OAAO;AAExC,aAAA,UAAU,WAAW,MAAM;AACnC,YAAM,QAAQ;AAAA,OACZ,UAAU;AAAA,EAAA,GACX,CAAC,UAAU,CAAC;AAChB;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebounceCallback.js","sources":["../../../../../packages/react-utils/src/hooks/useDebounceCallback.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useDebounceCallback = (cb: () => any, debounceMs: number) => {\n\tconst timerRef = useRef<ReturnType<typeof setTimeout>>()\n\tconst cbRef = useRef(cb)\n\tcbRef.current = cb\n\n\tuseEffect(() => {\n\t\treturn () => clearTimeout(timerRef.current)\n\t}, [])\n\n\treturn useCallback(() => {\n\t\ttimerRef.current && clearTimeout(timerRef.current)\n\n\t\ttimerRef.current = setTimeout(() => {\n\t\t\tcbRef.current()\n\t\t}, debounceMs)\n\t}, [debounceMs])\n}\n"],"names":[],"mappings":";AAEa,MAAA,sBAAsB,CAAC,IAAe,eAAuB;AACzE,QAAM,WAAW;AACX,QAAA,QAAQ,OAAO,EAAE;AACvB,QAAM,UAAU;AAEhB,YAAU,MAAM;AACR,WAAA,MAAM,aAAa,SAAS,OAAO;AAAA,EAC3C,GAAG,CAAE,CAAA;AAEL,SAAO,YAAY,MAAM;AACf,aAAA,WAAW,aAAa,SAAS,OAAO;AAExC,aAAA,UAAU,WAAW,MAAM;AACnC,YAAM,QAAQ;AAAA,OACZ,UAAU;AAAA,EAAA,GACX,CAAC,UAAU,CAAC;AAChB;"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  function useDocumentTitle(title, formatter) {
5
- const initialTitle = react.useRef(document.title).current;
6
- react.useEffect(() => {
5
+ const initialTitle = React.useRef(document.title).current;
6
+ React.useEffect(() => {
7
7
  if (title) {
8
8
  if (formatter) {
9
9
  document.title = formatter(title, initialTitle);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocumentTitle.cjs","sources":["../../../../../packages/react-utils/src/hooks/useDocumentTitle.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\n\nexport function useDocumentTitle(title: string | null | undefined, formatter?: (title: string, initialTitle: string) => string) {\n\tconst initialTitle = useRef(document.title).current\n\n\tuseEffect(() => {\n\t\tif (title) {\n\t\t\tif (formatter) {\n\t\t\t\tdocument.title = formatter(title, initialTitle)\n\t\t\t} else {\n\t\t\t\tdocument.title = title\n\t\t\t}\n\t\t} else {\n\t\t\tdocument.title = initialTitle\n\t\t}\n\n\t\treturn () => {\n\t\t\tdocument.title = initialTitle\n\t\t}\n\t}, [formatter, initialTitle, title])\n}\n"],"names":["useRef","useEffect"],"mappings":";;;AAEgB,SAAA,iBAAiB,OAAkC,WAA6D;AAC/H,QAAM,eAAeA,MAAA,OAAO,SAAS,KAAK,EAAE;AAE5CC,QAAAA,UAAU,MAAM;AACf,QAAI,OAAO;AACV,UAAI,WAAW;AACL,iBAAA,QAAQ,UAAU,OAAO,YAAY;AAAA,MAAA,OACxC;AACN,iBAAS,QAAQ;AAAA,MAClB;AAAA,IAAA,OACM;AACN,eAAS,QAAQ;AAAA,IAClB;AAEA,WAAO,MAAM;AACZ,eAAS,QAAQ;AAAA,IAAA;AAAA,EAEhB,GAAA,CAAC,WAAW,cAAc,KAAK,CAAC;AACpC;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocumentTitle.js","sources":["../../../../../packages/react-utils/src/hooks/useDocumentTitle.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\n\nexport function useDocumentTitle(title: string | null | undefined, formatter?: (title: string, initialTitle: string) => string) {\n\tconst initialTitle = useRef(document.title).current\n\n\tuseEffect(() => {\n\t\tif (title) {\n\t\t\tif (formatter) {\n\t\t\t\tdocument.title = formatter(title, initialTitle)\n\t\t\t} else {\n\t\t\t\tdocument.title = title\n\t\t\t}\n\t\t} else {\n\t\t\tdocument.title = initialTitle\n\t\t}\n\n\t\treturn () => {\n\t\t\tdocument.title = initialTitle\n\t\t}\n\t}, [formatter, initialTitle, title])\n}\n"],"names":[],"mappings":";AAEgB,SAAA,iBAAiB,OAAkC,WAA6D;AAC/H,QAAM,eAAe,OAAO,SAAS,KAAK,EAAE;AAE5C,YAAU,MAAM;AACf,QAAI,OAAO;AACV,UAAI,WAAW;AACL,iBAAA,QAAQ,UAAU,OAAO,YAAY;AAAA,MAAA,OACxC;AACN,iBAAS,QAAQ;AAAA,MAClB;AAAA,IAAA,OACM;AACN,eAAS,QAAQ;AAAA,IAClB;AAEA,WAAO,MAAM;AACZ,eAAS,QAAQ;AAAA,IAAA;AAAA,EAEhB,GAAA,CAAC,WAAW,cAAc,KAAK,CAAC;AACpC;"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const deepEqual = require("fast-deep-equal/es6/index.js");
4
- const react = require("react");
3
+ const equal = require("fast-deep-equal/es6/index.js");
4
+ const React = require("react");
5
5
  function useExpectSameValueReference(next, shouldThrow = false) {
6
- const previous = react.useRef(next);
7
- if (next !== previous.current && typeof next === "object" && typeof previous.current === "object" && deepEqual(next, previous.current)) {
6
+ const previous = React.useRef(next);
7
+ if (next !== previous.current && typeof next === "object" && typeof previous.current === "object" && equal(next, previous.current)) {
8
8
  if (shouldThrow) {
9
9
  throw new Error("Expecting same reference for same values");
10
10
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExpectSameValueReference.cjs","sources":["../../../../../packages/react-utils/src/hooks/useExpectSameValueReference.ts"],"sourcesContent":["import deepEqual from 'fast-deep-equal/es6/index.js'\nimport { useRef } from 'react'\n\n/**\n * Checks whether the next value is the same reference as the previous one\n *\n * If not, it checks whether the values are deeply equal. If not, it logs an error.\n *\n * @param next - Value to be checked.\n * @param shouldThrow - If true, it throws an error instead of logging it. Defaults to false.\n * @returns void\n * -\n * @example\n * ```ts\n * useExpectSameValueReference(style)\n * ```\n * @example\n * ```ts\n * useExpectSameValueReference(style, true)\n * ```\n * @example\n * ```ts\n * useExpectSameValueReference(style, import.meta.env.DEV)\n * ```\n */\nexport function useExpectSameValueReference<T>(next: T, shouldThrow: boolean = false) {\n\tconst previous = useRef(next)\n\n\tif (next !== previous.current\n\t\t&& typeof next === 'object'\n\t\t&& typeof previous.current === 'object'\n\t\t&& deepEqual(next, previous.current)\n\t) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.error(\n\t\t\t\t'Previous and next values do not match in reference although match in value. ' +\n\t\t\t\t'Try declaring constants outside of the component scope. ' +\n\t\t\t\t'Otherwise try to memoize callbacks with useCallback, ' +\n\t\t\t\t'useReferentiallyStableCallback useEvent, useRef or useMemo.', {\n\t\t\t\t\tprevious: previous.current,\n\t\t\t\t\tnext,\n\t\t\t\t})\n\t\t}\n\n\t\tif (shouldThrow) {\n\t\t\tthrow new Error('Expecting same reference for same values')\n\t\t}\n\t}\n\n\tprevious.current = next\n}\n"],"names":["useRef","deepEqual"],"mappings":";;;;AAyBgB,SAAA,4BAA+B,MAAS,cAAuB,OAAO;AAC/E,QAAA,WAAWA,aAAO,IAAI;AAE5B,MAAI,SAAS,SAAS,WAClB,OAAO,SAAS,YAChB,OAAO,SAAS,YAAY,YAC5BC,MAAU,MAAM,SAAS,OAAO,GAClC;AAYD,QAAI,aAAa;AACV,YAAA,IAAI,MAAM,0CAA0C;AAAA,IAC3D;AAAA,EACD;AAEA,WAAS,UAAU;AACpB;;"}
@@ -1,8 +1,8 @@
1
- import deepEqual from "fast-deep-equal/es6/index.js";
1
+ import equal from "fast-deep-equal/es6/index.js";
2
2
  import { useRef } from "react";
3
3
  function useExpectSameValueReference(next, shouldThrow = false) {
4
4
  const previous = useRef(next);
5
- if (next !== previous.current && typeof next === "object" && typeof previous.current === "object" && deepEqual(next, previous.current)) {
5
+ if (next !== previous.current && typeof next === "object" && typeof previous.current === "object" && equal(next, previous.current)) {
6
6
  if (shouldThrow) {
7
7
  throw new Error("Expecting same reference for same values");
8
8
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExpectSameValueReference.js","sources":["../../../../../packages/react-utils/src/hooks/useExpectSameValueReference.ts"],"sourcesContent":["import deepEqual from 'fast-deep-equal/es6/index.js'\nimport { useRef } from 'react'\n\n/**\n * Checks whether the next value is the same reference as the previous one\n *\n * If not, it checks whether the values are deeply equal. If not, it logs an error.\n *\n * @param next - Value to be checked.\n * @param shouldThrow - If true, it throws an error instead of logging it. Defaults to false.\n * @returns void\n * -\n * @example\n * ```ts\n * useExpectSameValueReference(style)\n * ```\n * @example\n * ```ts\n * useExpectSameValueReference(style, true)\n * ```\n * @example\n * ```ts\n * useExpectSameValueReference(style, import.meta.env.DEV)\n * ```\n */\nexport function useExpectSameValueReference<T>(next: T, shouldThrow: boolean = false) {\n\tconst previous = useRef(next)\n\n\tif (next !== previous.current\n\t\t&& typeof next === 'object'\n\t\t&& typeof previous.current === 'object'\n\t\t&& deepEqual(next, previous.current)\n\t) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.error(\n\t\t\t\t'Previous and next values do not match in reference although match in value. ' +\n\t\t\t\t'Try declaring constants outside of the component scope. ' +\n\t\t\t\t'Otherwise try to memoize callbacks with useCallback, ' +\n\t\t\t\t'useReferentiallyStableCallback useEvent, useRef or useMemo.', {\n\t\t\t\t\tprevious: previous.current,\n\t\t\t\t\tnext,\n\t\t\t\t})\n\t\t}\n\n\t\tif (shouldThrow) {\n\t\t\tthrow new Error('Expecting same reference for same values')\n\t\t}\n\t}\n\n\tprevious.current = next\n}\n"],"names":["deepEqual"],"mappings":";;AAyBgB,SAAA,4BAA+B,MAAS,cAAuB,OAAO;AAC/E,QAAA,WAAW,OAAO,IAAI;AAE5B,MAAI,SAAS,SAAS,WAClB,OAAO,SAAS,YAChB,OAAO,SAAS,YAAY,YAC5BA,MAAU,MAAM,SAAS,OAAO,GAClC;AAYD,QAAI,aAAa;AACV,YAAA,IAAI,MAAM,0CAA0C;AAAA,IAC3D;AAAA,EACD;AAEA,WAAS,UAAU;AACpB;"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const useForceRender = () => {
5
- const [, forceRender] = react.useReducer((s) => s + 1, 0);
5
+ const [, forceRender] = React.useReducer((s) => s + 1, 0);
6
6
  return forceRender;
7
7
  };
8
8
  exports.useForceRender = useForceRender;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useForceRender.cjs","sources":["../../../../../packages/react-utils/src/hooks/useForceRender.ts"],"sourcesContent":["import { useReducer } from 'react'\n\nexport const useForceRender = () => {\n\tconst [, forceRender] = useReducer((s: number) => s + 1, 0)\n\treturn forceRender\n}\n"],"names":["useReducer"],"mappings":";;;AAEO,MAAM,iBAAiB,MAAM;AAC7B,QAAA,CAAG,EAAA,WAAW,IAAIA,iBAAW,CAAC,MAAc,IAAI,GAAG,CAAC;AACnD,SAAA;AACR;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useForceRender.js","sources":["../../../../../packages/react-utils/src/hooks/useForceRender.ts"],"sourcesContent":["import { useReducer } from 'react'\n\nexport const useForceRender = () => {\n\tconst [, forceRender] = useReducer((s: number) => s + 1, 0)\n\treturn forceRender\n}\n"],"names":[],"mappings":";AAEO,MAAM,iBAAiB,MAAM;AAC7B,QAAA,CAAG,EAAA,WAAW,IAAI,WAAW,CAAC,MAAc,IAAI,GAAG,CAAC;AACnD,SAAA;AACR;"}
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const count = { current: 360 };
5
5
  function nextId() {
6
6
  count.current += 1;
7
7
  return `:${count.current.toString(36)}:`;
8
8
  }
9
9
  function useId() {
10
- return react.useMemo(() => nextId(), []);
10
+ return React.useMemo(() => nextId(), []);
11
11
  }
12
12
  exports.useId = useId;
13
13
  //# sourceMappingURL=useId.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useId.cjs","sources":["../../../../../packages/react-utils/src/hooks/useId.ts"],"sourcesContent":["import { useMemo, useRef } from 'react'\n\nconst count = { current: 360 }\n\nfunction nextId() {\n\tcount.current += 1\n\n\treturn `:${count.current.toString(36)}:`\n}\n\n/**\n * Returns a unique ID string\n * @internal\n *\n * NOTE: This hook is a temporary solution until we stop supporting React < 18\n *\n * @returns a unique id\n */\nexport function useId() {\n\treturn useMemo(() => nextId(), [])\n}\n"],"names":["useMemo"],"mappings":";;;AAEA,MAAM,QAAQ,EAAE,SAAS;AAEzB,SAAS,SAAS;AACjB,QAAM,WAAW;AAEjB,SAAO,IAAI,MAAM,QAAQ,SAAS,EAAE,CAAC;AACtC;AAUO,SAAS,QAAQ;AACvB,SAAOA,cAAQ,MAAM,OAAO,GAAG,CAAE,CAAA;AAClC;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useId.js","sources":["../../../../../packages/react-utils/src/hooks/useId.ts"],"sourcesContent":["import { useMemo, useRef } from 'react'\n\nconst count = { current: 360 }\n\nfunction nextId() {\n\tcount.current += 1\n\n\treturn `:${count.current.toString(36)}:`\n}\n\n/**\n * Returns a unique ID string\n * @internal\n *\n * NOTE: This hook is a temporary solution until we stop supporting React < 18\n *\n * @returns a unique id\n */\nexport function useId() {\n\treturn useMemo(() => nextId(), [])\n}\n"],"names":[],"mappings":";AAEA,MAAM,QAAQ,EAAE,SAAS;AAEzB,SAAS,SAAS;AACjB,QAAM,WAAW;AAEjB,SAAO,IAAI,MAAM,QAAQ,SAAS,EAAE,CAAC;AACtC;AAUO,SAAS,QAAQ;AACvB,SAAO,QAAQ,MAAM,OAAO,GAAG,CAAE,CAAA;AAClC;"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const useIsMounted = () => {
5
- const isMountedRef = react.useRef(true);
6
- react.useEffect(
5
+ const isMountedRef = React.useRef(true);
6
+ React.useEffect(
7
7
  () => {
8
8
  isMountedRef.current = true;
9
9
  return () => {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsMounted.cjs","sources":["../../../../../packages/react-utils/src/hooks/useIsMounted.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\n\nexport const useIsMounted = () => {\n\tconst isMountedRef = useRef(true)\n\tuseEffect(\n\t\t() => {\n\t\t\tisMountedRef.current = true\n\t\t\treturn () => {\n\t\t\t\tisMountedRef.current = false\n\t\t\t}\n\t\t},\n\t\t[],\n\t)\n\treturn isMountedRef\n}\n"],"names":["useRef","useEffect"],"mappings":";;;AAEO,MAAM,eAAe,MAAM;AAC3B,QAAA,eAAeA,aAAO,IAAI;AAChCC,QAAA;AAAA,IACC,MAAM;AACL,mBAAa,UAAU;AACvB,aAAO,MAAM;AACZ,qBAAa,UAAU;AAAA,MAAA;AAAA,IAEzB;AAAA,IACA,CAAC;AAAA,EAAA;AAEK,SAAA;AACR;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsMounted.js","sources":["../../../../../packages/react-utils/src/hooks/useIsMounted.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\n\nexport const useIsMounted = () => {\n\tconst isMountedRef = useRef(true)\n\tuseEffect(\n\t\t() => {\n\t\t\tisMountedRef.current = true\n\t\t\treturn () => {\n\t\t\t\tisMountedRef.current = false\n\t\t\t}\n\t\t},\n\t\t[],\n\t)\n\treturn isMountedRef\n}\n"],"names":[],"mappings":";AAEO,MAAM,eAAe,MAAM;AAC3B,QAAA,eAAe,OAAO,IAAI;AAChC;AAAA,IACC,MAAM;AACL,mBAAa,UAAU;AACvB,aAAO,MAAM;AACZ,qBAAa,UAAU;AAAA,MAAA;AAAA,IAEzB;AAAA,IACA,CAAC;AAAA,EAAA;AAEK,SAAA;AACR;"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const compareObjects = (a, b) => {
5
5
  if (a === b) {
6
6
  return true;
@@ -17,7 +17,7 @@ const compareObjects = (a, b) => {
17
17
  return true;
18
18
  };
19
19
  const useObjectMemo = (value) => {
20
- const valueRef = react.useRef(value);
20
+ const valueRef = React.useRef(value);
21
21
  if (!compareObjects(valueRef.current, value)) {
22
22
  valueRef.current = value;
23
23
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useObjectMemo.cjs","sources":["../../../../../packages/react-utils/src/hooks/useObjectMemo.ts"],"sourcesContent":["import { useRef } from 'react'\n\nconst compareObjects = (a: object, b: object): boolean => {\n\tif (a === b) {\n\t\treturn true\n\t}\n\tconst aEntries = Object.entries(a)\n\tif (aEntries.length !== Object.keys(b).length) {\n\t\treturn false\n\t}\n\tfor (const [key, val] of aEntries) {\n\t\tif (!(key in b) || (b as any)[key] !== val) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nexport const useObjectMemo = <A extends object>(value: A): A => {\n\tconst valueRef = useRef(value)\n\tif (!compareObjects(valueRef.current, value)) {\n\t\tvalueRef.current = value\n\t}\n\treturn valueRef.current\n}\n"],"names":["useRef"],"mappings":";;;AAEA,MAAM,iBAAiB,CAAC,GAAW,MAAuB;AACzD,MAAI,MAAM,GAAG;AACL,WAAA;AAAA,EACR;AACM,QAAA,WAAW,OAAO,QAAQ,CAAC;AACjC,MAAI,SAAS,WAAW,OAAO,KAAK,CAAC,EAAE,QAAQ;AACvC,WAAA;AAAA,EACR;AACA,aAAW,CAAC,KAAK,GAAG,KAAK,UAAU;AAClC,QAAI,EAAE,OAAO,MAAO,EAAU,GAAG,MAAM,KAAK;AACpC,aAAA;AAAA,IACR;AAAA,EACD;AACO,SAAA;AACR;AAEa,MAAA,gBAAgB,CAAmB,UAAgB;AACzD,QAAA,WAAWA,aAAO,KAAK;AAC7B,MAAI,CAAC,eAAe,SAAS,SAAS,KAAK,GAAG;AAC7C,aAAS,UAAU;AAAA,EACpB;AACA,SAAO,SAAS;AACjB;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useObjectMemo.js","sources":["../../../../../packages/react-utils/src/hooks/useObjectMemo.ts"],"sourcesContent":["import { useRef } from 'react'\n\nconst compareObjects = (a: object, b: object): boolean => {\n\tif (a === b) {\n\t\treturn true\n\t}\n\tconst aEntries = Object.entries(a)\n\tif (aEntries.length !== Object.keys(b).length) {\n\t\treturn false\n\t}\n\tfor (const [key, val] of aEntries) {\n\t\tif (!(key in b) || (b as any)[key] !== val) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nexport const useObjectMemo = <A extends object>(value: A): A => {\n\tconst valueRef = useRef(value)\n\tif (!compareObjects(valueRef.current, value)) {\n\t\tvalueRef.current = value\n\t}\n\treturn valueRef.current\n}\n"],"names":[],"mappings":";AAEA,MAAM,iBAAiB,CAAC,GAAW,MAAuB;AACzD,MAAI,MAAM,GAAG;AACL,WAAA;AAAA,EACR;AACM,QAAA,WAAW,OAAO,QAAQ,CAAC;AACjC,MAAI,SAAS,WAAW,OAAO,KAAK,CAAC,EAAE,QAAQ;AACvC,WAAA;AAAA,EACR;AACA,aAAW,CAAC,KAAK,GAAG,KAAK,UAAU;AAClC,QAAI,EAAE,OAAO,MAAO,EAAU,GAAG,MAAM,KAAK;AACpC,aAAA;AAAA,IACR;AAAA,EACD;AACO,SAAA;AACR;AAEa,MAAA,gBAAgB,CAAmB,UAAgB;AACzD,QAAA,WAAW,OAAO,KAAK;AAC7B,MAAI,CAAC,eAAe,SAAS,SAAS,KAAK,GAAG;AAC7C,aAAS,UAAU;AAAA,EACpB;AACA,SAAO,SAAS;AACjB;"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const unwrapRefValue = require("./unwrapRefValue.cjs");
5
5
  function useOnElementClickOutsideCallback(refOrElement, callback) {
6
- react.useEffect(() => {
6
+ React.useEffect(() => {
7
7
  const refValue = unwrapRefValue.unwrapRefValue(refOrElement);
8
8
  const handleClickOutside = (event) => {
9
9
  if (refValue && !refValue.contains(event.target)) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnElementClickOutsideCallback.cjs","sources":["../../../../../packages/react-utils/src/hooks/useOnElementClickOutsideCallback.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\n\nexport function useOnElementClickOutsideCallback(\n\trefOrElement: RefObjectOrElement<HTMLElement>,\n\tcallback: (event: MouseEvent) => void,\n): void {\n\tuseEffect(() => {\n\t\tconst refValue = unwrapRefValue(refOrElement)\n\n\t\tconst handleClickOutside = (event: MouseEvent) => {\n\t\t\tif (refValue && !refValue.contains(event.target as Node)) {\n\t\t\t\tcallback(event)\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('mousedown', handleClickOutside)\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('mousedown', handleClickOutside)\n\t\t}\n\t}, [callback, refOrElement])\n}\n"],"names":["useEffect","unwrapRefValue"],"mappings":";;;;AAGgB,SAAA,iCACf,cACA,UACO;AACPA,QAAAA,UAAU,MAAM;AACT,UAAA,WAAWC,8BAAe,YAAY;AAEtC,UAAA,qBAAqB,CAAC,UAAsB;AACjD,UAAI,YAAY,CAAC,SAAS,SAAS,MAAM,MAAc,GAAG;AACzD,iBAAS,KAAK;AAAA,MACf;AAAA,IAAA;AAGQ,aAAA,iBAAiB,aAAa,kBAAkB;AAEzD,WAAO,MAAM;AACH,eAAA,oBAAoB,aAAa,kBAAkB;AAAA,IAAA;AAAA,EAC7D,GACE,CAAC,UAAU,YAAY,CAAC;AAC5B;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnElementClickOutsideCallback.js","sources":["../../../../../packages/react-utils/src/hooks/useOnElementClickOutsideCallback.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\n\nexport function useOnElementClickOutsideCallback(\n\trefOrElement: RefObjectOrElement<HTMLElement>,\n\tcallback: (event: MouseEvent) => void,\n): void {\n\tuseEffect(() => {\n\t\tconst refValue = unwrapRefValue(refOrElement)\n\n\t\tconst handleClickOutside = (event: MouseEvent) => {\n\t\t\tif (refValue && !refValue.contains(event.target as Node)) {\n\t\t\t\tcallback(event)\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('mousedown', handleClickOutside)\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('mousedown', handleClickOutside)\n\t\t}\n\t}, [callback, refOrElement])\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,iCACf,cACA,UACO;AACP,YAAU,MAAM;AACT,UAAA,WAAW,eAAe,YAAY;AAEtC,UAAA,qBAAqB,CAAC,UAAsB;AACjD,UAAI,YAAY,CAAC,SAAS,SAAS,MAAM,MAAc,GAAG;AACzD,iBAAS,KAAK;AAAA,MACf;AAAA,IAAA;AAGQ,aAAA,iBAAiB,aAAa,kBAAkB;AAEzD,WAAO,MAAM;AACH,eAAA,oBAAoB,aAAa,kBAAkB;AAAA,IAAA;AAAA,EAC7D,GACE,CAAC,UAAU,YAAY,CAAC;AAC5B;"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const unwrapRefValue = require("./unwrapRefValue.cjs");
5
5
  function useOnElementMouseEnterDelayedCallback(refOrElement, callback, timeoutMs = 300) {
6
- react.useEffect(() => {
6
+ React.useEffect(() => {
7
7
  const refValue = unwrapRefValue.unwrapRefValue(refOrElement);
8
8
  if (refValue) {
9
9
  let handleMouseEnter = function(event) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnElementMouseEnterDelayedCallback.cjs","sources":["../../../../../packages/react-utils/src/hooks/useOnElementMouseEnterDelayedCallback.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\n\n/**\n * Calls the callback when the mouse enters the element, but only after a timeout, e.g. for tooltips or dropdown menus.\n *\n * Calls the callback immediately if the mouse is pressed down with `event.type` of `mousedown`. This is useful for\n * dropdown menus, where the user may click on the menu item before the callback is called resulting in the menu\n * opening and closing immediately.\n *\n * @param refOrElement - The element or ref to the element to attach the event listener to.\n * @param callback - The callback to call when the mouse enters the element.\n * @param timeoutMs - The timeout in milliseconds to wait before calling the callback.\n */\nexport function useOnElementMouseEnterDelayedCallback(\n\trefOrElement: RefObjectOrElement<HTMLElement>,\n\tcallback: (event: MouseEvent) => void,\n\ttimeoutMs: number = 300,\n): void {\n\tuseEffect(() => {\n\t\tconst refValue = unwrapRefValue(refOrElement)\n\n\t\tif (refValue) {\n\t\t\tlet timeoutID: ReturnType<typeof setTimeout> | undefined = undefined\n\n\t\t\tfunction handleMouseEnter(event: MouseEvent) {\n\t\t\t\tclearTimeout(timeoutID)\n\n\t\t\t\ttimeoutID = setTimeout(() => {\n\t\t\t\t\tcallback(event)\n\t\t\t\t}, timeoutMs)\n\t\t\t}\n\n\t\t\tfunction handleMouseLeave() {\n\t\t\t\tclearTimeout(timeoutID)\n\t\t\t}\n\n\t\t\tfunction handleMouseDown(event: MouseEvent) {\n\t\t\t\tclearTimeout(timeoutID)\n\t\t\t\tcallback(event)\n\t\t\t}\n\n\t\t\trefValue.addEventListener('mouseenter', handleMouseEnter)\n\t\t\trefValue.addEventListener('mouseleave', handleMouseLeave)\n\t\t\trefValue.addEventListener('mousedown', handleMouseDown)\n\n\t\t\treturn () => {\n\t\t\t\trefValue.removeEventListener('mouseover', handleMouseEnter)\n\t\t\t\trefValue.removeEventListener('mouseleave', handleMouseLeave)\n\t\t\t\trefValue.removeEventListener('mousedown', handleMouseDown)\n\t\t\t}\n\t\t}\n\t}, [callback, refOrElement, timeoutMs])\n}\n"],"names":["useEffect","unwrapRefValue"],"mappings":";;;;AAcO,SAAS,sCACf,cACA,UACA,YAAoB,KACb;AACPA,QAAAA,UAAU,MAAM;AACT,UAAA,WAAWC,8BAAe,YAAY;AAE5C,QAAI,UAAU;AAGJ,UAAA,mBAAT,SAA0B,OAAmB;AAC5C,qBAAa,SAAS;AAEtB,oBAAY,WAAW,MAAM;AAC5B,mBAAS,KAAK;AAAA,WACZ,SAAS;AAAA,MACb,GAES,mBAAT,WAA4B;AAC3B,qBAAa,SAAS;AAAA,MAAA,GAGd,kBAAT,SAAyB,OAAmB;AAC3C,qBAAa,SAAS;AACtB,iBAAS,KAAK;AAAA,MAAA;AAhBf,UAAI,YAAuD;AAmBlD,eAAA,iBAAiB,cAAc,gBAAgB;AAC/C,eAAA,iBAAiB,cAAc,gBAAgB;AAC/C,eAAA,iBAAiB,aAAa,eAAe;AAEtD,aAAO,MAAM;AACH,iBAAA,oBAAoB,aAAa,gBAAgB;AACjD,iBAAA,oBAAoB,cAAc,gBAAgB;AAClD,iBAAA,oBAAoB,aAAa,eAAe;AAAA,MAAA;AAAA,IAE3D;AAAA,EACE,GAAA,CAAC,UAAU,cAAc,SAAS,CAAC;AACvC;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnElementMouseEnterDelayedCallback.js","sources":["../../../../../packages/react-utils/src/hooks/useOnElementMouseEnterDelayedCallback.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\n\n/**\n * Calls the callback when the mouse enters the element, but only after a timeout, e.g. for tooltips or dropdown menus.\n *\n * Calls the callback immediately if the mouse is pressed down with `event.type` of `mousedown`. This is useful for\n * dropdown menus, where the user may click on the menu item before the callback is called resulting in the menu\n * opening and closing immediately.\n *\n * @param refOrElement - The element or ref to the element to attach the event listener to.\n * @param callback - The callback to call when the mouse enters the element.\n * @param timeoutMs - The timeout in milliseconds to wait before calling the callback.\n */\nexport function useOnElementMouseEnterDelayedCallback(\n\trefOrElement: RefObjectOrElement<HTMLElement>,\n\tcallback: (event: MouseEvent) => void,\n\ttimeoutMs: number = 300,\n): void {\n\tuseEffect(() => {\n\t\tconst refValue = unwrapRefValue(refOrElement)\n\n\t\tif (refValue) {\n\t\t\tlet timeoutID: ReturnType<typeof setTimeout> | undefined = undefined\n\n\t\t\tfunction handleMouseEnter(event: MouseEvent) {\n\t\t\t\tclearTimeout(timeoutID)\n\n\t\t\t\ttimeoutID = setTimeout(() => {\n\t\t\t\t\tcallback(event)\n\t\t\t\t}, timeoutMs)\n\t\t\t}\n\n\t\t\tfunction handleMouseLeave() {\n\t\t\t\tclearTimeout(timeoutID)\n\t\t\t}\n\n\t\t\tfunction handleMouseDown(event: MouseEvent) {\n\t\t\t\tclearTimeout(timeoutID)\n\t\t\t\tcallback(event)\n\t\t\t}\n\n\t\t\trefValue.addEventListener('mouseenter', handleMouseEnter)\n\t\t\trefValue.addEventListener('mouseleave', handleMouseLeave)\n\t\t\trefValue.addEventListener('mousedown', handleMouseDown)\n\n\t\t\treturn () => {\n\t\t\t\trefValue.removeEventListener('mouseover', handleMouseEnter)\n\t\t\t\trefValue.removeEventListener('mouseleave', handleMouseLeave)\n\t\t\t\trefValue.removeEventListener('mousedown', handleMouseDown)\n\t\t\t}\n\t\t}\n\t}, [callback, refOrElement, timeoutMs])\n}\n"],"names":[],"mappings":";;AAcO,SAAS,sCACf,cACA,UACA,YAAoB,KACb;AACP,YAAU,MAAM;AACT,UAAA,WAAW,eAAe,YAAY;AAE5C,QAAI,UAAU;AAGJ,UAAA,mBAAT,SAA0B,OAAmB;AAC5C,qBAAa,SAAS;AAEtB,oBAAY,WAAW,MAAM;AAC5B,mBAAS,KAAK;AAAA,WACZ,SAAS;AAAA,MACb,GAES,mBAAT,WAA4B;AAC3B,qBAAa,SAAS;AAAA,MAAA,GAGd,kBAAT,SAAyB,OAAmB;AAC3C,qBAAa,SAAS;AACtB,iBAAS,KAAK;AAAA,MAAA;AAhBf,UAAI,YAAuD;AAmBlD,eAAA,iBAAiB,cAAc,gBAAgB;AAC/C,eAAA,iBAAiB,cAAc,gBAAgB;AAC/C,eAAA,iBAAiB,aAAa,eAAe;AAEtD,aAAO,MAAM;AACH,iBAAA,oBAAoB,aAAa,gBAAgB;AACjD,iBAAA,oBAAoB,cAAc,gBAAgB;AAClD,iBAAA,oBAAoB,aAAa,eAAe;AAAA,MAAA;AAAA,IAE3D;AAAA,EACE,GAAA,CAAC,UAAU,cAAc,SAAS,CAAC;AACvC;"}
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const unwrapRefValue = require("./unwrapRefValue.cjs");
5
5
  const Context = require("../debug-context/Context.cjs");
6
6
  function useOnElementResize(refOrElement, callback, options = {}, timeout = 300) {
7
7
  const scopedConsoleRef = Context.useScopedConsoleRef("useOnElementResize");
8
8
  const { box = "border-box" } = options;
9
- const callbackRef = react.useRef(callback);
9
+ const callbackRef = React.useRef(callback);
10
10
  callbackRef.current = callback;
11
- const lastTimeStamp = react.useRef(0);
12
- react.useLayoutEffect(() => {
11
+ const lastTimeStamp = React.useRef(0);
12
+ React.useLayoutEffect(() => {
13
13
  const element = unwrapRefValue.unwrapRefValue(refOrElement);
14
14
  if (!element) {
15
15
  return;
@@ -17,7 +17,7 @@ function useOnElementResize(refOrElement, callback, options = {}, timeout = 300)
17
17
  if (!(element instanceof HTMLElement)) {
18
18
  throw new Error("Exhaustive error: Expecting element to be instance of HTMLElement");
19
19
  }
20
- let timeoutID = void 0;
20
+ let timeoutID;
21
21
  function debouncedOnChange([entry]) {
22
22
  const timeStamp = Date.now();
23
23
  const delta = timeStamp - lastTimeStamp.current;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnElementResize.cjs","sources":["../../../../../packages/react-utils/src/hooks/useOnElementResize.ts"],"sourcesContent":["import { useLayoutEffect, useRef } from 'react'\nimport { useScopedConsoleRef } from '../debug-context'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\n\nexport function useOnElementResize(\n\trefOrElement: RefObjectOrElement<HTMLElement | null> | null,\n\tcallback: (entries: ResizeObserverEntry) => void,\n\toptions: ResizeObserverOptions = {},\n\ttimeout: number = 300,\n): void {\n\tconst scopedConsoleRef = useScopedConsoleRef('useOnElementResize')\n\n\tconst { box = 'border-box' } = options\n\tconst callbackRef = useRef(callback); callbackRef.current = callback\n\tconst lastTimeStamp = useRef<number>(0)\n\n\tuseLayoutEffect(() => {\n\t\tconst element = unwrapRefValue(refOrElement)\n\t\tif (!element) {\n\t\t\treturn\n\t\t}\n\t\tif (!(element instanceof HTMLElement)) {\n\t\t\tthrow new Error('Exhaustive error: Expecting element to be instance of HTMLElement')\n\t\t}\n\n\t\tlet timeoutID: ReturnType<typeof setTimeout>\n\n\t\tfunction debouncedOnChange([entry]: ResizeObserverEntry[]) {\n\t\t\tconst timeStamp = Date.now()\n\t\t\tconst delta = timeStamp - lastTimeStamp.current\n\n\t\t\tclearTimeout(timeoutID)\n\t\t\tconst timeoutFinal = delta > timeout ? 0 : timeout\n\n\t\t\ttimeoutID = setTimeout(() => {\n\t\t\t\tconst message = timeoutFinal > 0 ? 'element.resize:debounced' : 'element.resize:immediate'\n\t\t\t\tscopedConsoleRef.current.warned(message, null)\n\t\t\t\tcallbackRef.current(entry)\n\t\t\t\tlastTimeStamp.current = timeStamp\n\t\t\t}, timeoutFinal)\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver(debouncedOnChange)\n\n\t\tresizeObserver.observe(element, { box })\n\n\t\treturn () => {\n\t\t\tclearTimeout(timeoutID)\n\t\t\tresizeObserver.unobserve(element)\n\t\t}\n\t}, [box, refOrElement, scopedConsoleRef, timeout])\n}\n"],"names":["useScopedConsoleRef","useRef","useLayoutEffect","unwrapRefValue"],"mappings":";;;;;AAIO,SAAS,mBACf,cACA,UACA,UAAiC,CAAC,GAClC,UAAkB,KACX;AACD,QAAA,mBAAmBA,4BAAoB,oBAAoB;AAE3D,QAAA,EAAE,MAAM,aAAiB,IAAA;AACzB,QAAA,cAAcC,aAAO,QAAQ;AAAG,cAAY,UAAU;AACtD,QAAA,gBAAgBA,aAAe,CAAC;AAEtCC,QAAAA,gBAAgB,MAAM;AACf,UAAA,UAAUC,8BAAe,YAAY;AAC3C,QAAI,CAAC,SAAS;AACb;AAAA,IACD;AACI,QAAA,EAAE,mBAAmB,cAAc;AAChC,YAAA,IAAI,MAAM,mEAAmE;AAAA,IACpF;AAEI,QAAA;AAEK,aAAA,kBAAkB,CAAC,KAAK,GAA0B;AACpD,YAAA,YAAY,KAAK;AACjB,YAAA,QAAQ,YAAY,cAAc;AAExC,mBAAa,SAAS;AAChB,YAAA,eAAe,QAAQ,UAAU,IAAI;AAE3C,kBAAY,WAAW,MAAM;AACtB,cAAA,UAAU,eAAe,IAAI,6BAA6B;AAC/C,yBAAA,QAAQ,OAAO,SAAS,IAAI;AAC7C,oBAAY,QAAQ,KAAK;AACzB,sBAAc,UAAU;AAAA,SACtB,YAAY;AAAA,IAChB;AAEM,UAAA,iBAAiB,IAAI,eAAe,iBAAiB;AAE3D,mBAAe,QAAQ,SAAS,EAAE,IAAK,CAAA;AAEvC,WAAO,MAAM;AACZ,mBAAa,SAAS;AACtB,qBAAe,UAAU,OAAO;AAAA,IAAA;AAAA,KAE/B,CAAC,KAAK,cAAc,kBAAkB,OAAO,CAAC;AAClD;;"}
@@ -15,7 +15,7 @@ function useOnElementResize(refOrElement, callback, options = {}, timeout = 300)
15
15
  if (!(element instanceof HTMLElement)) {
16
16
  throw new Error("Exhaustive error: Expecting element to be instance of HTMLElement");
17
17
  }
18
- let timeoutID = void 0;
18
+ let timeoutID;
19
19
  function debouncedOnChange([entry]) {
20
20
  const timeStamp = Date.now();
21
21
  const delta = timeStamp - lastTimeStamp.current;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnElementResize.js","sources":["../../../../../packages/react-utils/src/hooks/useOnElementResize.ts"],"sourcesContent":["import { useLayoutEffect, useRef } from 'react'\nimport { useScopedConsoleRef } from '../debug-context'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\n\nexport function useOnElementResize(\n\trefOrElement: RefObjectOrElement<HTMLElement | null> | null,\n\tcallback: (entries: ResizeObserverEntry) => void,\n\toptions: ResizeObserverOptions = {},\n\ttimeout: number = 300,\n): void {\n\tconst scopedConsoleRef = useScopedConsoleRef('useOnElementResize')\n\n\tconst { box = 'border-box' } = options\n\tconst callbackRef = useRef(callback); callbackRef.current = callback\n\tconst lastTimeStamp = useRef<number>(0)\n\n\tuseLayoutEffect(() => {\n\t\tconst element = unwrapRefValue(refOrElement)\n\t\tif (!element) {\n\t\t\treturn\n\t\t}\n\t\tif (!(element instanceof HTMLElement)) {\n\t\t\tthrow new Error('Exhaustive error: Expecting element to be instance of HTMLElement')\n\t\t}\n\n\t\tlet timeoutID: ReturnType<typeof setTimeout>\n\n\t\tfunction debouncedOnChange([entry]: ResizeObserverEntry[]) {\n\t\t\tconst timeStamp = Date.now()\n\t\t\tconst delta = timeStamp - lastTimeStamp.current\n\n\t\t\tclearTimeout(timeoutID)\n\t\t\tconst timeoutFinal = delta > timeout ? 0 : timeout\n\n\t\t\ttimeoutID = setTimeout(() => {\n\t\t\t\tconst message = timeoutFinal > 0 ? 'element.resize:debounced' : 'element.resize:immediate'\n\t\t\t\tscopedConsoleRef.current.warned(message, null)\n\t\t\t\tcallbackRef.current(entry)\n\t\t\t\tlastTimeStamp.current = timeStamp\n\t\t\t}, timeoutFinal)\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver(debouncedOnChange)\n\n\t\tresizeObserver.observe(element, { box })\n\n\t\treturn () => {\n\t\t\tclearTimeout(timeoutID)\n\t\t\tresizeObserver.unobserve(element)\n\t\t}\n\t}, [box, refOrElement, scopedConsoleRef, timeout])\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,mBACf,cACA,UACA,UAAiC,CAAC,GAClC,UAAkB,KACX;AACD,QAAA,mBAAmB,oBAAoB,oBAAoB;AAE3D,QAAA,EAAE,MAAM,aAAiB,IAAA;AACzB,QAAA,cAAc,OAAO,QAAQ;AAAG,cAAY,UAAU;AACtD,QAAA,gBAAgB,OAAe,CAAC;AAEtC,kBAAgB,MAAM;AACf,UAAA,UAAU,eAAe,YAAY;AAC3C,QAAI,CAAC,SAAS;AACb;AAAA,IACD;AACI,QAAA,EAAE,mBAAmB,cAAc;AAChC,YAAA,IAAI,MAAM,mEAAmE;AAAA,IACpF;AAEI,QAAA;AAEK,aAAA,kBAAkB,CAAC,KAAK,GAA0B;AACpD,YAAA,YAAY,KAAK;AACjB,YAAA,QAAQ,YAAY,cAAc;AAExC,mBAAa,SAAS;AAChB,YAAA,eAAe,QAAQ,UAAU,IAAI;AAE3C,kBAAY,WAAW,MAAM;AACtB,cAAA,UAAU,eAAe,IAAI,6BAA6B;AAC/C,yBAAA,QAAQ,OAAO,SAAS,IAAI;AAC7C,oBAAY,QAAQ,KAAK;AACzB,sBAAc,UAAU;AAAA,SACtB,YAAY;AAAA,IAChB;AAEM,UAAA,iBAAiB,IAAI,eAAe,iBAAiB;AAE3D,mBAAe,QAAQ,SAAS,EAAE,IAAK,CAAA;AAEvC,WAAO,MAAM;AACZ,mBAAa,SAAS;AACtB,qBAAe,UAAU,OAAO;AAAA,IAAA;AAAA,KAE/B,CAAC,KAAK,cAAc,kBAAkB,OAAO,CAAC;AAClD;"}
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
3
+ const React = require("react");
4
4
  const Context = require("../debug-context/Context.cjs");
5
5
  function useOnWindowResize(callback, interval = 300) {
6
6
  const scopedConsoleRef = Context.useScopedConsoleRef("useOnWindowResize");
7
- const callbackRef = react.useRef(callback);
7
+ const callbackRef = React.useRef(callback);
8
8
  callbackRef.current = callback;
9
- const lastTimeStamp = react.useRef(0);
10
- react.useLayoutEffect(() => {
11
- let timeoutID = void 0;
9
+ const lastTimeStamp = React.useRef(0);
10
+ React.useLayoutEffect(() => {
11
+ let timeoutID;
12
12
  function debouncedHandler(event) {
13
13
  clearTimeout(timeoutID);
14
14
  const delta = event.timeStamp - lastTimeStamp.current;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnWindowResize.cjs","sources":["../../../../../packages/react-utils/src/hooks/useOnWindowResize.ts"],"sourcesContent":["import { useLayoutEffect, useRef } from 'react'\nimport { useScopedConsoleRef } from '../debug-context'\n\nexport function useOnWindowResize(\n\tcallback: (event: Event) => void,\n\tinterval: number = 300,\n) {\n\tconst scopedConsoleRef = useScopedConsoleRef('useOnWindowResize')\n\n\tconst callbackRef = useRef(callback); callbackRef.current = callback\n\tconst lastTimeStamp = useRef<number>(0)\n\n\tuseLayoutEffect(() => {\n\t\tlet timeoutID: ReturnType<typeof setTimeout>\n\n\t\tfunction debouncedHandler(event: Event) {\n\t\t\tclearTimeout(timeoutID)\n\n\t\t\tconst delta = event.timeStamp - lastTimeStamp.current\n\t\t\tscopedConsoleRef.current.logged('window.resize:delta', delta)\n\n\t\t\tif (delta > interval) {\n\t\t\t\tscopedConsoleRef.current.warned('event:window.resize:immediately', null)\n\t\t\t\tcallbackRef.current(event)\n\t\t\t\tlastTimeStamp.current = event.timeStamp\n\t\t\t} else {\n\t\t\t\ttimeoutID = setTimeout(() => {\n\t\t\t\t\tscopedConsoleRef.current.warned('event:window.resize:debounced', null)\n\t\t\t\t\tlastTimeStamp.current = event.timeStamp\n\t\t\t\t\tcallbackRef.current(event)\n\t\t\t\t}, interval)\n\t\t\t}\n\t\t}\n\n\t\twindow.addEventListener('resize', debouncedHandler)\n\n\t\treturn () => {\n\t\t\tclearTimeout(timeoutID)\n\t\t\twindow.removeEventListener('resize', debouncedHandler)\n\t\t}\n\t}, [callbackRef, interval, scopedConsoleRef])\n}\n"],"names":["useScopedConsoleRef","useRef","useLayoutEffect"],"mappings":";;;;AAGgB,SAAA,kBACf,UACA,WAAmB,KAClB;AACK,QAAA,mBAAmBA,4BAAoB,mBAAmB;AAE1D,QAAA,cAAcC,aAAO,QAAQ;AAAG,cAAY,UAAU;AACtD,QAAA,gBAAgBA,aAAe,CAAC;AAEtCC,QAAAA,gBAAgB,MAAM;AACjB,QAAA;AAEJ,aAAS,iBAAiB,OAAc;AACvC,mBAAa,SAAS;AAEhB,YAAA,QAAQ,MAAM,YAAY,cAAc;AAC7B,uBAAA,QAAQ,OAAO,uBAAuB,KAAK;AAE5D,UAAI,QAAQ,UAAU;AACJ,yBAAA,QAAQ,OAAO,mCAAmC,IAAI;AACvE,oBAAY,QAAQ,KAAK;AACzB,sBAAc,UAAU,MAAM;AAAA,MAAA,OACxB;AACN,oBAAY,WAAW,MAAM;AACX,2BAAA,QAAQ,OAAO,iCAAiC,IAAI;AACrE,wBAAc,UAAU,MAAM;AAC9B,sBAAY,QAAQ,KAAK;AAAA,WACvB,QAAQ;AAAA,MACZ;AAAA,IACD;AAEO,WAAA,iBAAiB,UAAU,gBAAgB;AAElD,WAAO,MAAM;AACZ,mBAAa,SAAS;AACf,aAAA,oBAAoB,UAAU,gBAAgB;AAAA,IAAA;AAAA,EAEpD,GAAA,CAAC,aAAa,UAAU,gBAAgB,CAAC;AAC7C;;"}
@@ -6,7 +6,7 @@ function useOnWindowResize(callback, interval = 300) {
6
6
  callbackRef.current = callback;
7
7
  const lastTimeStamp = useRef(0);
8
8
  useLayoutEffect(() => {
9
- let timeoutID = void 0;
9
+ let timeoutID;
10
10
  function debouncedHandler(event) {
11
11
  clearTimeout(timeoutID);
12
12
  const delta = event.timeStamp - lastTimeStamp.current;