@contember/react-utils 2.1.0-alpha.37 → 2.1.0-alpha.39

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 (378) hide show
  1. package/dist/development/index.cjs +86 -0
  2. package/dist/development/index.cjs.map +1 -0
  3. package/dist/development/index.js +86 -0
  4. package/dist/development/index.js.map +1 -0
  5. package/dist/development/src/context/createContext.cjs +10 -0
  6. package/dist/development/src/context/createContext.cjs.map +1 -0
  7. package/dist/development/src/context/createContext.js +10 -0
  8. package/dist/development/src/context/createContext.js.map +1 -0
  9. package/dist/development/src/context/createRequiredContext.cjs +18 -0
  10. package/dist/development/src/context/createRequiredContext.cjs.map +1 -0
  11. package/dist/development/src/context/createRequiredContext.js +18 -0
  12. package/dist/development/src/context/createRequiredContext.js.map +1 -0
  13. package/dist/development/src/debug-context/Constants.cjs +25 -0
  14. package/dist/development/src/debug-context/Constants.cjs.map +1 -0
  15. package/dist/development/src/debug-context/Constants.js +25 -0
  16. package/dist/development/src/debug-context/Constants.js.map +1 -0
  17. package/dist/development/src/debug-context/Context.cjs +72 -0
  18. package/dist/development/src/debug-context/Context.cjs.map +1 -0
  19. package/dist/development/src/debug-context/Context.js +72 -0
  20. package/dist/development/src/debug-context/Context.js.map +1 -0
  21. package/dist/development/src/hooks/unwrapRefValue.cjs +11 -0
  22. package/dist/development/src/hooks/unwrapRefValue.cjs.map +1 -0
  23. package/dist/development/src/hooks/unwrapRefValue.js +11 -0
  24. package/dist/development/src/hooks/unwrapRefValue.js.map +1 -0
  25. package/dist/development/src/hooks/useAbortController.cjs +17 -0
  26. package/dist/development/src/hooks/useAbortController.cjs.map +1 -0
  27. package/dist/development/src/hooks/useAbortController.js +17 -0
  28. package/dist/development/src/hooks/useAbortController.js.map +1 -0
  29. package/dist/development/src/hooks/useArrayMapMemo.cjs +11 -0
  30. package/dist/development/src/hooks/useArrayMapMemo.cjs.map +1 -0
  31. package/dist/development/src/hooks/useArrayMapMemo.js +11 -0
  32. package/dist/development/src/hooks/useArrayMapMemo.js.map +1 -0
  33. package/dist/development/src/hooks/useAutoHeightTextArea.cjs +43 -0
  34. package/dist/development/src/hooks/useAutoHeightTextArea.cjs.map +1 -0
  35. package/dist/development/src/hooks/useAutoHeightTextArea.js +43 -0
  36. package/dist/development/src/hooks/useAutoHeightTextArea.js.map +1 -0
  37. package/dist/development/src/hooks/useChildrenAsLabel.cjs +53 -0
  38. package/dist/development/src/hooks/useChildrenAsLabel.cjs.map +1 -0
  39. package/dist/development/src/hooks/useChildrenAsLabel.js +53 -0
  40. package/dist/development/src/hooks/useChildrenAsLabel.js.map +1 -0
  41. package/dist/development/src/hooks/useComposeRef.cjs +31 -0
  42. package/dist/development/src/hooks/useComposeRef.cjs.map +1 -0
  43. package/dist/development/src/hooks/useComposeRef.js +31 -0
  44. package/dist/development/src/hooks/useComposeRef.js.map +1 -0
  45. package/dist/development/src/hooks/useConstantLengthInvariant.cjs +15 -0
  46. package/dist/development/src/hooks/useConstantLengthInvariant.cjs.map +1 -0
  47. package/dist/development/src/hooks/useConstantLengthInvariant.js +15 -0
  48. package/dist/development/src/hooks/useConstantLengthInvariant.js.map +1 -0
  49. package/dist/development/src/hooks/useConstantValueInvariant.cjs +15 -0
  50. package/dist/development/src/hooks/useConstantValueInvariant.cjs.map +1 -0
  51. package/dist/development/src/hooks/useConstantValueInvariant.js +15 -0
  52. package/dist/development/src/hooks/useConstantValueInvariant.js.map +1 -0
  53. package/dist/development/src/hooks/useDebounce.cjs +15 -0
  54. package/dist/development/src/hooks/useDebounce.cjs.map +1 -0
  55. package/dist/development/src/hooks/useDebounce.js +15 -0
  56. package/dist/development/src/hooks/useDebounce.js.map +1 -0
  57. package/dist/development/src/hooks/useDebounceCallback.cjs +19 -0
  58. package/dist/development/src/hooks/useDebounceCallback.cjs.map +1 -0
  59. package/dist/development/src/hooks/useDebounceCallback.js +19 -0
  60. package/dist/development/src/hooks/useDebounceCallback.js.map +1 -0
  61. package/dist/development/src/hooks/useDocumentTitle.cjs +22 -0
  62. package/dist/development/src/hooks/useDocumentTitle.cjs.map +1 -0
  63. package/dist/development/src/hooks/useDocumentTitle.js +22 -0
  64. package/dist/development/src/hooks/useDocumentTitle.js.map +1 -0
  65. package/dist/development/src/hooks/useExpectSameValueReference.cjs +24 -0
  66. package/dist/development/src/hooks/useExpectSameValueReference.cjs.map +1 -0
  67. package/dist/development/src/hooks/useExpectSameValueReference.js +24 -0
  68. package/dist/development/src/hooks/useExpectSameValueReference.js.map +1 -0
  69. package/dist/development/src/hooks/useForceRender.cjs +9 -0
  70. package/dist/development/src/hooks/useForceRender.cjs.map +1 -0
  71. package/dist/development/src/hooks/useForceRender.js +9 -0
  72. package/dist/development/src/hooks/useForceRender.js.map +1 -0
  73. package/dist/development/src/hooks/useId.cjs +13 -0
  74. package/dist/development/src/hooks/useId.cjs.map +1 -0
  75. package/dist/development/src/hooks/useId.js +13 -0
  76. package/dist/development/src/hooks/useId.js.map +1 -0
  77. package/dist/development/src/hooks/useIsMounted.cjs +18 -0
  78. package/dist/development/src/hooks/useIsMounted.cjs.map +1 -0
  79. package/dist/development/src/hooks/useIsMounted.js +18 -0
  80. package/dist/development/src/hooks/useIsMounted.js.map +1 -0
  81. package/dist/development/src/hooks/useObjectMemo.cjs +27 -0
  82. package/dist/development/src/hooks/useObjectMemo.cjs.map +1 -0
  83. package/dist/development/src/hooks/useObjectMemo.js +27 -0
  84. package/dist/development/src/hooks/useObjectMemo.js.map +1 -0
  85. package/dist/development/src/hooks/useOnElementClickOutsideCallback.cjs +20 -0
  86. package/dist/development/src/hooks/useOnElementClickOutsideCallback.cjs.map +1 -0
  87. package/dist/development/src/hooks/useOnElementClickOutsideCallback.js +20 -0
  88. package/dist/development/src/hooks/useOnElementClickOutsideCallback.js.map +1 -0
  89. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.cjs +33 -0
  90. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +1 -0
  91. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.js +33 -0
  92. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +1 -0
  93. package/dist/development/src/hooks/useOnElementResize.cjs +42 -0
  94. package/dist/development/src/hooks/useOnElementResize.cjs.map +1 -0
  95. package/dist/development/src/hooks/useOnElementResize.js +42 -0
  96. package/dist/development/src/hooks/useOnElementResize.js.map +1 -0
  97. package/dist/development/src/hooks/useOnWindowResize.cjs +36 -0
  98. package/dist/development/src/hooks/useOnWindowResize.cjs.map +1 -0
  99. package/dist/development/src/hooks/useOnWindowResize.js +36 -0
  100. package/dist/development/src/hooks/useOnWindowResize.js.map +1 -0
  101. package/dist/development/src/hooks/usePreviousValue.cjs +12 -0
  102. package/dist/development/src/hooks/usePreviousValue.cjs.map +1 -0
  103. package/dist/development/src/hooks/usePreviousValue.js +12 -0
  104. package/dist/development/src/hooks/usePreviousValue.js.map +1 -0
  105. package/dist/development/src/hooks/useStoredState.cjs +100 -0
  106. package/dist/development/src/hooks/useStoredState.cjs.map +1 -0
  107. package/dist/development/src/hooks/useStoredState.js +100 -0
  108. package/dist/development/src/hooks/useStoredState.js.map +1 -0
  109. package/dist/development/src/hooks/useUpdatedRef.cjs +10 -0
  110. package/dist/development/src/hooks/useUpdatedRef.cjs.map +1 -0
  111. package/dist/development/src/hooks/useUpdatedRef.js +10 -0
  112. package/dist/development/src/hooks/useUpdatedRef.js.map +1 -0
  113. package/dist/development/src/hooks/useWindowSize.cjs +20 -0
  114. package/dist/development/src/hooks/useWindowSize.cjs.map +1 -0
  115. package/dist/development/src/hooks/useWindowSize.js +20 -0
  116. package/dist/development/src/hooks/useWindowSize.js.map +1 -0
  117. package/dist/development/src/referentiallyStable/emptyArray.cjs +5 -0
  118. package/dist/development/src/referentiallyStable/emptyArray.cjs.map +1 -0
  119. package/dist/development/src/referentiallyStable/emptyArray.js +5 -0
  120. package/dist/development/src/referentiallyStable/emptyArray.js.map +1 -0
  121. package/dist/development/src/referentiallyStable/emptyObject.cjs +5 -0
  122. package/dist/development/src/referentiallyStable/emptyObject.cjs.map +1 -0
  123. package/dist/development/src/referentiallyStable/emptyObject.js +5 -0
  124. package/dist/development/src/referentiallyStable/emptyObject.js.map +1 -0
  125. package/dist/development/src/referentiallyStable/identityFunction.cjs +5 -0
  126. package/dist/development/src/referentiallyStable/identityFunction.cjs.map +1 -0
  127. package/dist/development/src/referentiallyStable/identityFunction.js +5 -0
  128. package/dist/development/src/referentiallyStable/identityFunction.js.map +1 -0
  129. package/dist/development/src/referentiallyStable/noop.cjs +5 -0
  130. package/dist/development/src/referentiallyStable/noop.cjs.map +1 -0
  131. package/dist/development/src/referentiallyStable/noop.js +5 -0
  132. package/dist/development/src/referentiallyStable/noop.js.map +1 -0
  133. package/dist/development/src/referentiallyStable/returnFalse.cjs +5 -0
  134. package/dist/development/src/referentiallyStable/returnFalse.cjs.map +1 -0
  135. package/dist/development/src/referentiallyStable/returnFalse.js +5 -0
  136. package/dist/development/src/referentiallyStable/returnFalse.js.map +1 -0
  137. package/dist/development/src/referentiallyStable/returnTrue.cjs +5 -0
  138. package/dist/development/src/referentiallyStable/returnTrue.cjs.map +1 -0
  139. package/dist/development/src/referentiallyStable/returnTrue.js +5 -0
  140. package/dist/development/src/referentiallyStable/returnTrue.js.map +1 -0
  141. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.cjs +15 -0
  142. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +1 -0
  143. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.js +15 -0
  144. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.js.map +1 -0
  145. package/dist/production/index.cjs +86 -0
  146. package/dist/production/index.cjs.map +1 -0
  147. package/dist/production/index.js +86 -0
  148. package/dist/production/index.js.map +1 -0
  149. package/dist/production/src/context/createContext.cjs +10 -0
  150. package/dist/production/src/context/createContext.cjs.map +1 -0
  151. package/dist/production/src/context/createContext.js +10 -0
  152. package/dist/production/src/context/createContext.js.map +1 -0
  153. package/dist/production/src/context/createRequiredContext.cjs +18 -0
  154. package/dist/production/src/context/createRequiredContext.cjs.map +1 -0
  155. package/dist/production/src/context/createRequiredContext.js +18 -0
  156. package/dist/production/src/context/createRequiredContext.js.map +1 -0
  157. package/dist/production/src/debug-context/Constants.cjs +25 -0
  158. package/dist/production/src/debug-context/Constants.cjs.map +1 -0
  159. package/dist/production/src/debug-context/Constants.js +25 -0
  160. package/dist/production/src/debug-context/Constants.js.map +1 -0
  161. package/dist/production/src/debug-context/Context.cjs +68 -0
  162. package/dist/production/src/debug-context/Context.cjs.map +1 -0
  163. package/dist/production/src/debug-context/Context.js +68 -0
  164. package/dist/production/src/debug-context/Context.js.map +1 -0
  165. package/dist/production/src/hooks/unwrapRefValue.cjs +11 -0
  166. package/dist/production/src/hooks/unwrapRefValue.cjs.map +1 -0
  167. package/dist/production/src/hooks/unwrapRefValue.js +11 -0
  168. package/dist/production/src/hooks/unwrapRefValue.js.map +1 -0
  169. package/dist/production/src/hooks/useAbortController.cjs +17 -0
  170. package/dist/production/src/hooks/useAbortController.cjs.map +1 -0
  171. package/dist/production/src/hooks/useAbortController.js +17 -0
  172. package/dist/production/src/hooks/useAbortController.js.map +1 -0
  173. package/dist/production/src/hooks/useArrayMapMemo.cjs +9 -0
  174. package/dist/production/src/hooks/useArrayMapMemo.cjs.map +1 -0
  175. package/dist/production/src/hooks/useArrayMapMemo.js +9 -0
  176. package/dist/production/src/hooks/useArrayMapMemo.js.map +1 -0
  177. package/dist/production/src/hooks/useAutoHeightTextArea.cjs +43 -0
  178. package/dist/production/src/hooks/useAutoHeightTextArea.cjs.map +1 -0
  179. package/dist/production/src/hooks/useAutoHeightTextArea.js +43 -0
  180. package/dist/production/src/hooks/useAutoHeightTextArea.js.map +1 -0
  181. package/dist/production/src/hooks/useChildrenAsLabel.cjs +51 -0
  182. package/dist/production/src/hooks/useChildrenAsLabel.cjs.map +1 -0
  183. package/dist/production/src/hooks/useChildrenAsLabel.js +51 -0
  184. package/dist/production/src/hooks/useChildrenAsLabel.js.map +1 -0
  185. package/dist/production/src/hooks/useComposeRef.cjs +31 -0
  186. package/dist/production/src/hooks/useComposeRef.cjs.map +1 -0
  187. package/dist/production/src/hooks/useComposeRef.js +31 -0
  188. package/dist/production/src/hooks/useComposeRef.js.map +1 -0
  189. package/dist/production/src/hooks/useConstantLengthInvariant.cjs +6 -0
  190. package/dist/production/src/hooks/useConstantLengthInvariant.cjs.map +1 -0
  191. package/dist/production/src/hooks/useConstantLengthInvariant.js +6 -0
  192. package/dist/production/src/hooks/useConstantLengthInvariant.js.map +1 -0
  193. package/dist/production/src/hooks/useConstantValueInvariant.cjs +6 -0
  194. package/dist/production/src/hooks/useConstantValueInvariant.cjs.map +1 -0
  195. package/dist/production/src/hooks/useConstantValueInvariant.js +6 -0
  196. package/dist/production/src/hooks/useConstantValueInvariant.js.map +1 -0
  197. package/dist/production/src/hooks/useDebounce.cjs +15 -0
  198. package/dist/production/src/hooks/useDebounce.cjs.map +1 -0
  199. package/dist/production/src/hooks/useDebounce.js +15 -0
  200. package/dist/production/src/hooks/useDebounce.js.map +1 -0
  201. package/dist/production/src/hooks/useDebounceCallback.cjs +19 -0
  202. package/dist/production/src/hooks/useDebounceCallback.cjs.map +1 -0
  203. package/dist/production/src/hooks/useDebounceCallback.js +19 -0
  204. package/dist/production/src/hooks/useDebounceCallback.js.map +1 -0
  205. package/dist/production/src/hooks/useDocumentTitle.cjs +22 -0
  206. package/dist/production/src/hooks/useDocumentTitle.cjs.map +1 -0
  207. package/dist/production/src/hooks/useDocumentTitle.js +22 -0
  208. package/dist/production/src/hooks/useDocumentTitle.js.map +1 -0
  209. package/dist/production/src/hooks/useExpectSameValueReference.cjs +15 -0
  210. package/dist/production/src/hooks/useExpectSameValueReference.cjs.map +1 -0
  211. package/dist/production/src/hooks/useExpectSameValueReference.js +15 -0
  212. package/dist/production/src/hooks/useExpectSameValueReference.js.map +1 -0
  213. package/dist/production/src/hooks/useForceRender.cjs +9 -0
  214. package/dist/production/src/hooks/useForceRender.cjs.map +1 -0
  215. package/dist/production/src/hooks/useForceRender.js +9 -0
  216. package/dist/production/src/hooks/useForceRender.js.map +1 -0
  217. package/dist/production/src/hooks/useId.cjs +13 -0
  218. package/dist/production/src/hooks/useId.cjs.map +1 -0
  219. package/dist/production/src/hooks/useId.js +13 -0
  220. package/dist/production/src/hooks/useId.js.map +1 -0
  221. package/dist/production/src/hooks/useIsMounted.cjs +18 -0
  222. package/dist/production/src/hooks/useIsMounted.cjs.map +1 -0
  223. package/dist/production/src/hooks/useIsMounted.js +18 -0
  224. package/dist/production/src/hooks/useIsMounted.js.map +1 -0
  225. package/dist/production/src/hooks/useObjectMemo.cjs +27 -0
  226. package/dist/production/src/hooks/useObjectMemo.cjs.map +1 -0
  227. package/dist/production/src/hooks/useObjectMemo.js +27 -0
  228. package/dist/production/src/hooks/useObjectMemo.js.map +1 -0
  229. package/dist/production/src/hooks/useOnElementClickOutsideCallback.cjs +20 -0
  230. package/dist/production/src/hooks/useOnElementClickOutsideCallback.cjs.map +1 -0
  231. package/dist/production/src/hooks/useOnElementClickOutsideCallback.js +20 -0
  232. package/dist/production/src/hooks/useOnElementClickOutsideCallback.js.map +1 -0
  233. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.cjs +33 -0
  234. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +1 -0
  235. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.js +33 -0
  236. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +1 -0
  237. package/dist/production/src/hooks/useOnElementResize.cjs +42 -0
  238. package/dist/production/src/hooks/useOnElementResize.cjs.map +1 -0
  239. package/dist/production/src/hooks/useOnElementResize.js +42 -0
  240. package/dist/production/src/hooks/useOnElementResize.js.map +1 -0
  241. package/dist/production/src/hooks/useOnWindowResize.cjs +36 -0
  242. package/dist/production/src/hooks/useOnWindowResize.cjs.map +1 -0
  243. package/dist/production/src/hooks/useOnWindowResize.js +36 -0
  244. package/dist/production/src/hooks/useOnWindowResize.js.map +1 -0
  245. package/dist/production/src/hooks/usePreviousValue.cjs +12 -0
  246. package/dist/production/src/hooks/usePreviousValue.cjs.map +1 -0
  247. package/dist/production/src/hooks/usePreviousValue.js +12 -0
  248. package/dist/production/src/hooks/usePreviousValue.js.map +1 -0
  249. package/dist/production/src/hooks/useStoredState.cjs +100 -0
  250. package/dist/production/src/hooks/useStoredState.cjs.map +1 -0
  251. package/dist/production/src/hooks/useStoredState.js +100 -0
  252. package/dist/production/src/hooks/useStoredState.js.map +1 -0
  253. package/dist/production/src/hooks/useUpdatedRef.cjs +10 -0
  254. package/dist/production/src/hooks/useUpdatedRef.cjs.map +1 -0
  255. package/dist/production/src/hooks/useUpdatedRef.js +10 -0
  256. package/dist/production/src/hooks/useUpdatedRef.js.map +1 -0
  257. package/dist/production/src/hooks/useWindowSize.cjs +20 -0
  258. package/dist/production/src/hooks/useWindowSize.cjs.map +1 -0
  259. package/dist/production/src/hooks/useWindowSize.js +20 -0
  260. package/dist/production/src/hooks/useWindowSize.js.map +1 -0
  261. package/dist/production/src/referentiallyStable/emptyArray.cjs +5 -0
  262. package/dist/production/src/referentiallyStable/emptyArray.cjs.map +1 -0
  263. package/dist/production/src/referentiallyStable/emptyArray.js +5 -0
  264. package/dist/production/src/referentiallyStable/emptyArray.js.map +1 -0
  265. package/dist/production/src/referentiallyStable/emptyObject.cjs +5 -0
  266. package/dist/production/src/referentiallyStable/emptyObject.cjs.map +1 -0
  267. package/dist/production/src/referentiallyStable/emptyObject.js +5 -0
  268. package/dist/production/src/referentiallyStable/emptyObject.js.map +1 -0
  269. package/dist/production/src/referentiallyStable/identityFunction.cjs +5 -0
  270. package/dist/production/src/referentiallyStable/identityFunction.cjs.map +1 -0
  271. package/dist/production/src/referentiallyStable/identityFunction.js +5 -0
  272. package/dist/production/src/referentiallyStable/identityFunction.js.map +1 -0
  273. package/dist/production/src/referentiallyStable/noop.cjs +5 -0
  274. package/dist/production/src/referentiallyStable/noop.cjs.map +1 -0
  275. package/dist/production/src/referentiallyStable/noop.js +5 -0
  276. package/dist/production/src/referentiallyStable/noop.js.map +1 -0
  277. package/dist/production/src/referentiallyStable/returnFalse.cjs +5 -0
  278. package/dist/production/src/referentiallyStable/returnFalse.cjs.map +1 -0
  279. package/dist/production/src/referentiallyStable/returnFalse.js +5 -0
  280. package/dist/production/src/referentiallyStable/returnFalse.js.map +1 -0
  281. package/dist/production/src/referentiallyStable/returnTrue.cjs +5 -0
  282. package/dist/production/src/referentiallyStable/returnTrue.cjs.map +1 -0
  283. package/dist/production/src/referentiallyStable/returnTrue.js +5 -0
  284. package/dist/production/src/referentiallyStable/returnTrue.js.map +1 -0
  285. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.cjs +15 -0
  286. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +1 -0
  287. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.js +15 -0
  288. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.js.map +1 -0
  289. package/dist/types/context/createContext.d.ts +3 -0
  290. package/dist/types/context/createContext.d.ts.map +1 -0
  291. package/dist/types/context/createRequiredContext.d.ts +3 -0
  292. package/dist/types/context/createRequiredContext.d.ts.map +1 -0
  293. package/dist/types/context/index.d.ts +3 -0
  294. package/dist/types/context/index.d.ts.map +1 -0
  295. package/dist/types/debug-context/Constants.d.ts +6 -0
  296. package/dist/types/debug-context/Constants.d.ts.map +1 -0
  297. package/dist/types/debug-context/Context.d.ts +15 -0
  298. package/dist/types/debug-context/Context.d.ts.map +1 -0
  299. package/dist/types/debug-context/Types.d.ts +13 -0
  300. package/dist/types/debug-context/Types.d.ts.map +1 -0
  301. package/dist/types/debug-context/index.d.ts +4 -0
  302. package/dist/types/debug-context/index.d.ts.map +1 -0
  303. package/dist/types/hooks/index.d.ts +25 -0
  304. package/dist/types/hooks/index.d.ts.map +1 -0
  305. package/dist/types/hooks/unwrapRefValue.d.ts +9 -0
  306. package/dist/types/hooks/unwrapRefValue.d.ts.map +1 -0
  307. package/dist/types/hooks/useAbortController.d.ts +2 -0
  308. package/dist/types/hooks/useAbortController.d.ts.map +1 -0
  309. package/dist/types/hooks/useArrayMapMemo.d.ts +10 -0
  310. package/dist/types/hooks/useArrayMapMemo.d.ts.map +1 -0
  311. package/dist/types/hooks/useAutoHeightTextArea.d.ts +3 -0
  312. package/dist/types/hooks/useAutoHeightTextArea.d.ts.map +1 -0
  313. package/dist/types/hooks/useChildrenAsLabel.d.ts +16 -0
  314. package/dist/types/hooks/useChildrenAsLabel.d.ts.map +1 -0
  315. package/dist/types/hooks/useComposeRef.d.ts +16 -0
  316. package/dist/types/hooks/useComposeRef.d.ts.map +1 -0
  317. package/dist/types/hooks/useConstantLengthInvariant.d.ts +2 -0
  318. package/dist/types/hooks/useConstantLengthInvariant.d.ts.map +1 -0
  319. package/dist/types/hooks/useConstantValueInvariant.d.ts +2 -0
  320. package/dist/types/hooks/useConstantValueInvariant.d.ts.map +1 -0
  321. package/dist/types/hooks/useDebounce.d.ts +2 -0
  322. package/dist/types/hooks/useDebounce.d.ts.map +1 -0
  323. package/dist/types/hooks/useDebounceCallback.d.ts +2 -0
  324. package/dist/types/hooks/useDebounceCallback.d.ts.map +1 -0
  325. package/dist/types/hooks/useDocumentTitle.d.ts +2 -0
  326. package/dist/types/hooks/useDocumentTitle.d.ts.map +1 -0
  327. package/dist/types/hooks/useExpectSameValueReference.d.ts +24 -0
  328. package/dist/types/hooks/useExpectSameValueReference.d.ts.map +1 -0
  329. package/dist/types/hooks/useForceRender.d.ts +2 -0
  330. package/dist/types/hooks/useForceRender.d.ts.map +1 -0
  331. package/dist/types/hooks/useId.d.ts +10 -0
  332. package/dist/types/hooks/useId.d.ts.map +1 -0
  333. package/dist/types/hooks/useIsMounted.d.ts +2 -0
  334. package/dist/types/hooks/useIsMounted.d.ts.map +1 -0
  335. package/dist/types/hooks/useObjectMemo.d.ts +2 -0
  336. package/dist/types/hooks/useObjectMemo.d.ts.map +1 -0
  337. package/dist/types/hooks/useOnElementClickOutsideCallback.d.ts +3 -0
  338. package/dist/types/hooks/useOnElementClickOutsideCallback.d.ts.map +1 -0
  339. package/dist/types/hooks/useOnElementMouseEnterDelayedCallback.d.ts +14 -0
  340. package/dist/types/hooks/useOnElementMouseEnterDelayedCallback.d.ts.map +1 -0
  341. package/dist/types/hooks/useOnElementResize.d.ts +3 -0
  342. package/dist/types/hooks/useOnElementResize.d.ts.map +1 -0
  343. package/dist/types/hooks/useOnWindowResize.d.ts +2 -0
  344. package/dist/types/hooks/useOnWindowResize.d.ts.map +1 -0
  345. package/dist/types/hooks/usePreviousValue.d.ts +2 -0
  346. package/dist/types/hooks/usePreviousValue.d.ts.map +1 -0
  347. package/dist/types/hooks/useStoredState.d.ts +18 -0
  348. package/dist/types/hooks/useStoredState.d.ts.map +1 -0
  349. package/dist/types/hooks/useUpdatedRef.d.ts +8 -0
  350. package/dist/types/hooks/useUpdatedRef.d.ts.map +1 -0
  351. package/dist/types/hooks/useWindowSize.d.ts +5 -0
  352. package/dist/types/hooks/useWindowSize.d.ts.map +1 -0
  353. package/dist/types/index.d.ts +6 -0
  354. package/dist/types/index.d.ts.map +1 -0
  355. package/dist/types/referentiallyStable/emptyArray.d.ts +2 -0
  356. package/dist/types/referentiallyStable/emptyArray.d.ts.map +1 -0
  357. package/dist/types/referentiallyStable/emptyObject.d.ts +2 -0
  358. package/dist/types/referentiallyStable/emptyObject.d.ts.map +1 -0
  359. package/dist/types/referentiallyStable/identityFunction.d.ts +2 -0
  360. package/dist/types/referentiallyStable/identityFunction.d.ts.map +1 -0
  361. package/dist/types/referentiallyStable/index.d.ts +8 -0
  362. package/dist/types/referentiallyStable/index.d.ts.map +1 -0
  363. package/dist/types/referentiallyStable/noop.d.ts +2 -0
  364. package/dist/types/referentiallyStable/noop.d.ts.map +1 -0
  365. package/dist/types/referentiallyStable/returnFalse.d.ts +2 -0
  366. package/dist/types/referentiallyStable/returnFalse.d.ts.map +1 -0
  367. package/dist/types/referentiallyStable/returnTrue.d.ts +2 -0
  368. package/dist/types/referentiallyStable/returnTrue.d.ts.map +1 -0
  369. package/dist/types/referentiallyStable/useReferentiallyStableCallback.d.ts +3 -0
  370. package/dist/types/referentiallyStable/useReferentiallyStableCallback.d.ts.map +1 -0
  371. package/dist/types/tsconfig.tsbuildinfo +1 -0
  372. package/dist/types/types/PropsWithRequiredChildren.d.ts +5 -0
  373. package/dist/types/types/PropsWithRequiredChildren.d.ts.map +1 -0
  374. package/dist/types/types/Serializable.d.ts +4 -0
  375. package/dist/types/types/Serializable.d.ts.map +1 -0
  376. package/dist/types/types/index.d.ts +3 -0
  377. package/dist/types/types/index.d.ts.map +1 -0
  378. package/package.json +4 -4
@@ -0,0 +1,86 @@
1
+ import { DebugChildren, ScopedConsoleContext, useScopedConsoleRef } from "./src/debug-context/Context.js";
2
+ import { createContext } from "./src/context/createContext.js";
3
+ import { createRequiredContext } from "./src/context/createRequiredContext.js";
4
+ import { emptyArray } from "./src/referentiallyStable/emptyArray.js";
5
+ import { emptyObject } from "./src/referentiallyStable/emptyObject.js";
6
+ import { getChildrenAsLabel, useChildrenAsLabel } from "./src/hooks/useChildrenAsLabel.js";
7
+ import { getStateStorage, localStateStorage, nullStorage, sessionStateStorage, urlStateStorage, useLocalStorageState, useSessionStorageState, useStoredState } from "./src/hooks/useStoredState.js";
8
+ import { identityFunction } from "./src/referentiallyStable/identityFunction.js";
9
+ import { isNoopScopedConsole, noopLog, noopLogged, noopScopedConsole } from "./src/debug-context/Constants.js";
10
+ import { noop } from "./src/referentiallyStable/noop.js";
11
+ import { returnFalse } from "./src/referentiallyStable/returnFalse.js";
12
+ import { returnTrue } from "./src/referentiallyStable/returnTrue.js";
13
+ import { unwrapRefValue } from "./src/hooks/unwrapRefValue.js";
14
+ import { useAbortController } from "./src/hooks/useAbortController.js";
15
+ import { useArrayMapMemo } from "./src/hooks/useArrayMapMemo.js";
16
+ import { useAutoHeightTextArea } from "./src/hooks/useAutoHeightTextArea.js";
17
+ import { useComposeRef } from "./src/hooks/useComposeRef.js";
18
+ import { useConstantLengthInvariant } from "./src/hooks/useConstantLengthInvariant.js";
19
+ import { useConstantValueInvariant } from "./src/hooks/useConstantValueInvariant.js";
20
+ import { useDebounce } from "./src/hooks/useDebounce.js";
21
+ import { useDebounceCallback } from "./src/hooks/useDebounceCallback.js";
22
+ import { useDocumentTitle } from "./src/hooks/useDocumentTitle.js";
23
+ import { useExpectSameValueReference } from "./src/hooks/useExpectSameValueReference.js";
24
+ import { useForceRender } from "./src/hooks/useForceRender.js";
25
+ import { useId } from "./src/hooks/useId.js";
26
+ import { useIsMounted } from "./src/hooks/useIsMounted.js";
27
+ import { useObjectMemo } from "./src/hooks/useObjectMemo.js";
28
+ import { useOnElementClickOutsideCallback } from "./src/hooks/useOnElementClickOutsideCallback.js";
29
+ import { useOnElementMouseEnterDelayedCallback } from "./src/hooks/useOnElementMouseEnterDelayedCallback.js";
30
+ import { useOnElementResize } from "./src/hooks/useOnElementResize.js";
31
+ import { useOnWindowResize } from "./src/hooks/useOnWindowResize.js";
32
+ import { usePreviousValue } from "./src/hooks/usePreviousValue.js";
33
+ import { useReferentiallyStableCallback } from "./src/referentiallyStable/useReferentiallyStableCallback.js";
34
+ import { useUpdatedRef } from "./src/hooks/useUpdatedRef.js";
35
+ import { useWindowSize } from "./src/hooks/useWindowSize.js";
36
+ export {
37
+ DebugChildren,
38
+ ScopedConsoleContext,
39
+ createContext,
40
+ createRequiredContext,
41
+ emptyArray,
42
+ emptyObject,
43
+ getChildrenAsLabel,
44
+ getStateStorage,
45
+ identityFunction,
46
+ isNoopScopedConsole,
47
+ localStateStorage,
48
+ noop,
49
+ noopLog,
50
+ noopLogged,
51
+ noopScopedConsole,
52
+ nullStorage,
53
+ returnFalse,
54
+ returnTrue,
55
+ sessionStateStorage,
56
+ unwrapRefValue,
57
+ urlStateStorage,
58
+ useAbortController,
59
+ useArrayMapMemo,
60
+ useAutoHeightTextArea,
61
+ useChildrenAsLabel,
62
+ useComposeRef,
63
+ useConstantLengthInvariant,
64
+ useConstantValueInvariant,
65
+ useDebounce,
66
+ useDebounceCallback,
67
+ useDocumentTitle,
68
+ useExpectSameValueReference,
69
+ useForceRender,
70
+ useId,
71
+ useIsMounted,
72
+ useLocalStorageState,
73
+ useObjectMemo,
74
+ useOnElementClickOutsideCallback,
75
+ useOnElementMouseEnterDelayedCallback,
76
+ useOnElementResize,
77
+ useOnWindowResize,
78
+ usePreviousValue,
79
+ useReferentiallyStableCallback,
80
+ useScopedConsoleRef,
81
+ useSessionStorageState,
82
+ useStoredState,
83
+ useUpdatedRef,
84
+ useWindowSize
85
+ };
86
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ function createContext(name, initialValue) {
5
+ const OptionalContext = React.createContext(initialValue);
6
+ OptionalContext.displayName = name;
7
+ return [OptionalContext, () => React.useContext(OptionalContext), OptionalContext.Provider];
8
+ }
9
+ exports.createContext = createContext;
10
+ //# sourceMappingURL=createContext.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createContext.cjs","sources":["../../../../../packages/react-utils/src/context/createContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext as baseCreateContext, useContext } from 'react'\n\nexport function createContext<T>(name: string, initialValue: T): [Context<T>, () => T, Provider<T>] {\n\tconst OptionalContext = baseCreateContext<T>(initialValue)\n\tOptionalContext.displayName = name\n\n\treturn [OptionalContext, () => useContext(OptionalContext), OptionalContext.Provider]\n}\n"],"names":["baseCreateContext","useContext"],"mappings":";;;AAGO,SAAS,cAAiB,MAAc,cAAqD;AACnG,QAAM,kBAAkBA,MAAAA,cAAqB,YAAY;AACzD,kBAAgB,cAAc;AAE9B,SAAO,CAAC,iBAAiB,MAAMC,MAAAA,WAAW,eAAe,GAAG,gBAAgB,QAAQ;AACrF;;"}
@@ -0,0 +1,10 @@
1
+ import { createContext as createContext$1, useContext } from "react";
2
+ function createContext(name, initialValue) {
3
+ const OptionalContext = createContext$1(initialValue);
4
+ OptionalContext.displayName = name;
5
+ return [OptionalContext, () => useContext(OptionalContext), OptionalContext.Provider];
6
+ }
7
+ export {
8
+ createContext
9
+ };
10
+ //# sourceMappingURL=createContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createContext.js","sources":["../../../../../packages/react-utils/src/context/createContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext as baseCreateContext, useContext } from 'react'\n\nexport function createContext<T>(name: string, initialValue: T): [Context<T>, () => T, Provider<T>] {\n\tconst OptionalContext = baseCreateContext<T>(initialValue)\n\tOptionalContext.displayName = name\n\n\treturn [OptionalContext, () => useContext(OptionalContext), OptionalContext.Provider]\n}\n"],"names":["baseCreateContext"],"mappings":";AAGO,SAAS,cAAiB,MAAc,cAAqD;AACnG,QAAM,kBAAkBA,gBAAqB,YAAY;AACzD,kBAAgB,cAAc;AAE9B,SAAO,CAAC,iBAAiB,MAAM,WAAW,eAAe,GAAG,gBAAgB,QAAQ;AACrF;"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ const EmptyContextSymbol = /* @__PURE__ */ Symbol("EmptyContextSymbol");
5
+ function createRequiredContext(displayName) {
6
+ const RequiredContext = React.createContext(EmptyContextSymbol);
7
+ RequiredContext.displayName = displayName;
8
+ const useRequiredContext = () => {
9
+ const context = React.useContext(RequiredContext);
10
+ if (context === EmptyContextSymbol) {
11
+ throw new Error(`use${displayName} must be used within a ${displayName} provider`);
12
+ }
13
+ return context;
14
+ };
15
+ return [RequiredContext, useRequiredContext, RequiredContext.Provider];
16
+ }
17
+ exports.createRequiredContext = createRequiredContext;
18
+ //# sourceMappingURL=createRequiredContext.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRequiredContext.cjs","sources":["../../../../../packages/react-utils/src/context/createRequiredContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext, useContext } from 'react'\n\nconst EmptyContextSymbol = Symbol('EmptyContextSymbol')\n\nexport function createRequiredContext<T>(displayName: string): [Context<T>, () => T, Provider<T>] {\n\tconst RequiredContext = createContext<T>(EmptyContextSymbol as T)\n\tRequiredContext.displayName = displayName\n\n\tconst useRequiredContext = (): T => {\n\t\tconst context = useContext(RequiredContext)\n\n\t\tif (context === EmptyContextSymbol) {\n\t\t\tthrow new Error(`use${displayName} must be used within a ${displayName} provider`)\n\t\t}\n\n\t\treturn context\n\t}\n\n\treturn [RequiredContext, useRequiredContext, RequiredContext.Provider]\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAGA,MAAM,4CAA4B,oBAAoB;AAE/C,SAAS,sBAAyB,aAAyD;AACjG,QAAM,kBAAkBA,MAAAA,cAAiB,kBAAuB;AAChE,kBAAgB,cAAc;AAE9B,QAAM,qBAAqB,MAAS;AACnC,UAAM,UAAUC,MAAAA,WAAW,eAAe;AAE1C,QAAI,YAAY,oBAAoB;AACnC,YAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B,WAAW,WAAW;AAAA,IAClF;AAEA,WAAO;AAAA,EACR;AAEA,SAAO,CAAC,iBAAiB,oBAAoB,gBAAgB,QAAQ;AACtE;;"}
@@ -0,0 +1,18 @@
1
+ import { createContext, useContext } from "react";
2
+ const EmptyContextSymbol = /* @__PURE__ */ Symbol("EmptyContextSymbol");
3
+ function createRequiredContext(displayName) {
4
+ const RequiredContext = createContext(EmptyContextSymbol);
5
+ RequiredContext.displayName = displayName;
6
+ const useRequiredContext = () => {
7
+ const context = useContext(RequiredContext);
8
+ if (context === EmptyContextSymbol) {
9
+ throw new Error(`use${displayName} must be used within a ${displayName} provider`);
10
+ }
11
+ return context;
12
+ };
13
+ return [RequiredContext, useRequiredContext, RequiredContext.Provider];
14
+ }
15
+ export {
16
+ createRequiredContext
17
+ };
18
+ //# sourceMappingURL=createRequiredContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRequiredContext.js","sources":["../../../../../packages/react-utils/src/context/createRequiredContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext, useContext } from 'react'\n\nconst EmptyContextSymbol = Symbol('EmptyContextSymbol')\n\nexport function createRequiredContext<T>(displayName: string): [Context<T>, () => T, Provider<T>] {\n\tconst RequiredContext = createContext<T>(EmptyContextSymbol as T)\n\tRequiredContext.displayName = displayName\n\n\tconst useRequiredContext = (): T => {\n\t\tconst context = useContext(RequiredContext)\n\n\t\tif (context === EmptyContextSymbol) {\n\t\t\tthrow new Error(`use${displayName} must be used within a ${displayName} provider`)\n\t\t}\n\n\t\treturn context\n\t}\n\n\treturn [RequiredContext, useRequiredContext, RequiredContext.Provider]\n}\n"],"names":[],"mappings":";AAGA,MAAM,4CAA4B,oBAAoB;AAE/C,SAAS,sBAAyB,aAAyD;AACjG,QAAM,kBAAkB,cAAiB,kBAAuB;AAChE,kBAAgB,cAAc;AAE9B,QAAM,qBAAqB,MAAS;AACnC,UAAM,UAAU,WAAW,eAAe;AAE1C,QAAI,YAAY,oBAAoB;AACnC,YAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B,WAAW,WAAW;AAAA,IAClF;AAEA,WAAO;AAAA,EACR;AAEA,SAAO,CAAC,iBAAiB,oBAAoB,gBAAgB,QAAQ;AACtE;"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function noopLog(...parameters) {
4
+ }
5
+ function noopLogged(message, value) {
6
+ return value;
7
+ }
8
+ const noopScopedConsole = Object.freeze({
9
+ log: noopLog,
10
+ logged: noopLogged,
11
+ warn: noopLog,
12
+ warned: noopLogged,
13
+ error: noopLog,
14
+ errored: noopLogged,
15
+ trace: noopLog,
16
+ traced: noopLogged
17
+ });
18
+ function isNoopScopedConsole(value) {
19
+ return value === noopScopedConsole;
20
+ }
21
+ exports.isNoopScopedConsole = isNoopScopedConsole;
22
+ exports.noopLog = noopLog;
23
+ exports.noopLogged = noopLogged;
24
+ exports.noopScopedConsole = noopScopedConsole;
25
+ //# sourceMappingURL=Constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constants.cjs","sources":["../../../../../packages/react-utils/src/debug-context/Constants.ts"],"sourcesContent":["import type { ScopedConsoleContextType } from './Types'\n\nexport function noopLog(...parameters: any[]) {}\n\nexport function noopLogged<T>(message: string, value: T): T {\n\treturn value\n}\n\nexport const noopScopedConsole: ScopedConsoleContextType = Object.freeze({\n\tlog: noopLog,\n\tlogged: noopLogged,\n\twarn: noopLog,\n\twarned: noopLogged,\n\terror: noopLog,\n\terrored: noopLogged,\n\ttrace: noopLog,\n\ttraced: noopLogged,\n})\n\nexport function isNoopScopedConsole(value: unknown): boolean {\n\treturn value === noopScopedConsole\n}\n"],"names":[],"mappings":";;AAEO,SAAS,WAAW,YAAmB;AAAC;AAExC,SAAS,WAAc,SAAiB,OAAa;AAC3D,SAAO;AACR;AAEO,MAAM,oBAA8C,OAAO,OAAO;AAAA,EACxE,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACT,CAAC;AAEM,SAAS,oBAAoB,OAAyB;AAC5D,SAAO,UAAU;AAClB;;;;;"}
@@ -0,0 +1,25 @@
1
+ function noopLog(...parameters) {
2
+ }
3
+ function noopLogged(message, value) {
4
+ return value;
5
+ }
6
+ const noopScopedConsole = Object.freeze({
7
+ log: noopLog,
8
+ logged: noopLogged,
9
+ warn: noopLog,
10
+ warned: noopLogged,
11
+ error: noopLog,
12
+ errored: noopLogged,
13
+ trace: noopLog,
14
+ traced: noopLogged
15
+ });
16
+ function isNoopScopedConsole(value) {
17
+ return value === noopScopedConsole;
18
+ }
19
+ export {
20
+ isNoopScopedConsole,
21
+ noopLog,
22
+ noopLogged,
23
+ noopScopedConsole
24
+ };
25
+ //# sourceMappingURL=Constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constants.js","sources":["../../../../../packages/react-utils/src/debug-context/Constants.ts"],"sourcesContent":["import type { ScopedConsoleContextType } from './Types'\n\nexport function noopLog(...parameters: any[]) {}\n\nexport function noopLogged<T>(message: string, value: T): T {\n\treturn value\n}\n\nexport const noopScopedConsole: ScopedConsoleContextType = Object.freeze({\n\tlog: noopLog,\n\tlogged: noopLogged,\n\twarn: noopLog,\n\twarned: noopLogged,\n\terror: noopLog,\n\terrored: noopLogged,\n\ttrace: noopLog,\n\ttraced: noopLogged,\n})\n\nexport function isNoopScopedConsole(value: unknown): boolean {\n\treturn value === noopScopedConsole\n}\n"],"names":[],"mappings":"AAEO,SAAS,WAAW,YAAmB;AAAC;AAExC,SAAS,WAAc,SAAiB,OAAa;AAC3D,SAAO;AACR;AAEO,MAAM,oBAA8C,OAAO,OAAO;AAAA,EACxE,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACT,CAAC;AAEM,SAAS,oBAAoB,OAAyB;AAC5D,SAAO,UAAU;AAClB;"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const Constants = require("./Constants.cjs");
6
+ function createPrefixedConsole(message, prefixedConsole) {
7
+ return {
8
+ error: function error(...parameters) {
9
+ (prefixedConsole ?? console).error(message, ...parameters);
10
+ },
11
+ errored: function errored(message2, value) {
12
+ (prefixedConsole ?? console).error(message2, value);
13
+ return value;
14
+ },
15
+ log: function log(...parameters) {
16
+ (prefixedConsole ?? console).log(message, ...parameters);
17
+ },
18
+ logged: function logged(message2, value) {
19
+ (prefixedConsole ?? console).log(message2, value);
20
+ return value;
21
+ },
22
+ trace: function trace(...parameters) {
23
+ (prefixedConsole ?? console).trace(message, ...parameters);
24
+ },
25
+ traced: function traced(message2, value) {
26
+ (prefixedConsole ?? console).trace(message2, value);
27
+ return value;
28
+ },
29
+ warn: function warn(...parameters) {
30
+ (prefixedConsole ?? console).warn(message, ...parameters);
31
+ },
32
+ warned: function warned(message2, value) {
33
+ (prefixedConsole ?? console).warn(message2, value);
34
+ return value;
35
+ }
36
+ };
37
+ }
38
+ const ScopedConsoleContext = React.createContext(null);
39
+ ScopedConsoleContext.displayName = "ScopedConsoleContext";
40
+ function parentScopedConsoleOrNone(parentConsole) {
41
+ return Constants.isNoopScopedConsole(parentConsole) ? void 0 : parentConsole;
42
+ }
43
+ const useScopedConsoleRef = (prefix, override) => {
44
+ if (prefix.length === 0) {
45
+ throw new Error("Prefix must be non-empty string");
46
+ }
47
+ const parentConsole = parentScopedConsoleOrNone(React.useContext(ScopedConsoleContext));
48
+ const scopedConsole = React.useMemo(() => {
49
+ if (override !== false && (parentConsole || override)) {
50
+ return createPrefixedConsole(prefix, parentConsole);
51
+ } else {
52
+ return Constants.noopScopedConsole;
53
+ }
54
+ }, [override, parentConsole, prefix]);
55
+ const ref = React.useRef(scopedConsole);
56
+ ref.current = scopedConsole;
57
+ return ref;
58
+ };
59
+ const DebugChildren = React.memo(({ active = true, children, id }) => {
60
+ const parentScopedConsole = parentScopedConsoleOrNone(React.useContext(ScopedConsoleContext));
61
+ const console2 = active && id ? createPrefixedConsole(id, parentScopedConsole) : Constants.noopScopedConsole;
62
+ return /* @__PURE__ */ jsxRuntime.jsx(ScopedConsoleContext.Provider, { value: active ? console2 : Constants.noopScopedConsole, children });
63
+ });
64
+ DebugChildren.displayName = "DebugChildren";
65
+ exports.DebugChildren = DebugChildren;
66
+ exports.ScopedConsoleContext = ScopedConsoleContext;
67
+ exports.useScopedConsoleRef = useScopedConsoleRef;
68
+ //# sourceMappingURL=Context.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.cjs","sources":["../../../../../packages/react-utils/src/debug-context/Context.tsx"],"sourcesContent":["import { createContext, memo, ReactNode, useContext, useMemo, useRef } from 'react'\nimport { isNoopScopedConsole, noopScopedConsole } from './Constants'\nimport { ScopedConsoleContextType } from './Types'\n\nfunction createPrefixedConsole(message: string, prefixedConsole?: ScopedConsoleContextType): ScopedConsoleContextType {\n\treturn {\n\t\terror: function error(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).error(message, ...parameters)\n\t\t},\n\t\terrored: function errored<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).error(message, value)\n\t\t\treturn value\n\t\t},\n\t\tlog: function log(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).log(message, ...parameters)\n\t\t},\n\t\tlogged: function logged<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).log(message, value)\n\t\t\treturn value\n\t\t},\n\t\ttrace: function trace(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).trace(message, ...parameters)\n\t\t},\n\t\ttraced: function traced<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).trace(message, value)\n\t\t\treturn value\n\t\t},\n\t\twarn: function warn(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).warn(message, ...parameters)\n\t\t},\n\t\twarned: function warned<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).warn(message, value)\n\t\t\treturn value\n\t\t},\n\t}\n}\n\nexport const ScopedConsoleContext = createContext<ScopedConsoleContextType>(null!)\nScopedConsoleContext.displayName = 'ScopedConsoleContext'\n\nfunction parentScopedConsoleOrNone(parentConsole: ScopedConsoleContextType): ScopedConsoleContextType | undefined {\n\treturn isNoopScopedConsole(parentConsole) ? undefined : parentConsole\n}\n\nexport const useScopedConsoleRef = (prefix: string, override?: boolean) => {\n\tif (prefix.length === 0) {\n\t\tthrow new Error('Prefix must be non-empty string')\n\t}\n\tconst parentConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst scopedConsole = useMemo(() => {\n\t\tif (override !== false && (parentConsole || override)) {\n\t\t\treturn createPrefixedConsole(prefix, parentConsole)\n\t\t} else {\n\t\t\treturn noopScopedConsole\n\t\t}\n\t}, [override, parentConsole, prefix])\n\n\tconst ref = useRef(scopedConsole)\n\tref.current = scopedConsole\n\n\treturn ref\n}\n\nexport type DebugChildrenProps =\n\t| { active?: true; children: ReactNode; id: string }\n\t| { active?: false; children: ReactNode; id?: string }\n\nexport const DebugChildren = memo<DebugChildrenProps>(({ active = true, children, id }) => {\n\tconst parentScopedConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst console = active && id\n\t\t? createPrefixedConsole(id, parentScopedConsole)\n\t\t: noopScopedConsole\n\n\treturn (\n\t\t<ScopedConsoleContext.Provider value={active ? console : noopScopedConsole}>\n\t\t\t{children}\n\t\t</ScopedConsoleContext.Provider>\n\t)\n})\nDebugChildren.displayName = 'DebugChildren'\n"],"names":["message","createContext","isNoopScopedConsole","useContext","useMemo","noopScopedConsole","useRef","memo","console","jsx"],"mappings":";;;;;AAIA,SAAS,sBAAsB,SAAiB,iBAAsE;AACrH,SAAO;AAAA,IACN,OAAO,SAAS,SAAS,YAAmB;AAC1C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC3D;AAAA,IACA,SAAS,SAAS,QAAYA,UAAiB,OAAa;AAC1D,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAClD,aAAO;AAAA,IACR;AAAA,IACA,KAAK,SAAS,OAAO,YAAmB;AACtC,OAAC,mBAAmB,SAAS,IAAI,SAAS,GAAG,UAAU;AAAA,IACzD;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,IAAIA,UAAS,KAAK;AAChD,aAAO;AAAA,IACR;AAAA,IACA,OAAO,SAAS,SAAS,YAAmB;AAC1C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC3D;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAClD,aAAO;AAAA,IACR;AAAA,IACA,MAAM,SAAS,QAAQ,YAAmB;AACxC,OAAC,mBAAmB,SAAS,KAAK,SAAS,GAAG,UAAU;AAAA,IAC1D;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,KAAKA,UAAS,KAAK;AACjD,aAAO;AAAA,IACR;AAAA,EAAA;AAEF;AAEO,MAAM,uBAAuBC,MAAAA,cAAwC,IAAK;AACjF,qBAAqB,cAAc;AAEnC,SAAS,0BAA0B,eAA+E;AACjH,SAAOC,8BAAoB,aAAa,IAAI,SAAY;AACzD;AAEO,MAAM,sBAAsB,CAAC,QAAgB,aAAuB;AAC1E,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,IAAI,MAAM,iCAAiC;AAAA,EAClD;AACA,QAAM,gBAAgB,0BAA0BC,MAAAA,WAAW,oBAAoB,CAAC;AAEhF,QAAM,gBAAgBC,MAAAA,QAAQ,MAAM;AACnC,QAAI,aAAa,UAAU,iBAAiB,WAAW;AACtD,aAAO,sBAAsB,QAAQ,aAAa;AAAA,IACnD,OAAO;AACN,aAAOC,UAAAA;AAAAA,IACR;AAAA,EACD,GAAG,CAAC,UAAU,eAAe,MAAM,CAAC;AAEpC,QAAM,MAAMC,MAAAA,OAAO,aAAa;AAChC,MAAI,UAAU;AAEd,SAAO;AACR;AAMO,MAAM,gBAAgBC,MAAAA,KAAyB,CAAC,EAAE,SAAS,MAAM,UAAU,SAAS;AAC1F,QAAM,sBAAsB,0BAA0BJ,MAAAA,WAAW,oBAAoB,CAAC;AAEtF,QAAMK,WAAU,UAAU,KACvB,sBAAsB,IAAI,mBAAmB,IAC7CH,UAAAA;AAEH,SACCI,2BAAAA,IAAC,qBAAqB,UAArB,EAA8B,OAAO,SAASD,WAAUH,6BACvD,UACF;AAEF,CAAC;AACD,cAAc,cAAc;;;;"}
@@ -0,0 +1,68 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { memo, useContext, createContext, useMemo, useRef } from "react";
3
+ import { noopScopedConsole, isNoopScopedConsole } from "./Constants.js";
4
+ function createPrefixedConsole(message, prefixedConsole) {
5
+ return {
6
+ error: function error(...parameters) {
7
+ (prefixedConsole ?? console).error(message, ...parameters);
8
+ },
9
+ errored: function errored(message2, value) {
10
+ (prefixedConsole ?? console).error(message2, value);
11
+ return value;
12
+ },
13
+ log: function log(...parameters) {
14
+ (prefixedConsole ?? console).log(message, ...parameters);
15
+ },
16
+ logged: function logged(message2, value) {
17
+ (prefixedConsole ?? console).log(message2, value);
18
+ return value;
19
+ },
20
+ trace: function trace(...parameters) {
21
+ (prefixedConsole ?? console).trace(message, ...parameters);
22
+ },
23
+ traced: function traced(message2, value) {
24
+ (prefixedConsole ?? console).trace(message2, value);
25
+ return value;
26
+ },
27
+ warn: function warn(...parameters) {
28
+ (prefixedConsole ?? console).warn(message, ...parameters);
29
+ },
30
+ warned: function warned(message2, value) {
31
+ (prefixedConsole ?? console).warn(message2, value);
32
+ return value;
33
+ }
34
+ };
35
+ }
36
+ const ScopedConsoleContext = createContext(null);
37
+ ScopedConsoleContext.displayName = "ScopedConsoleContext";
38
+ function parentScopedConsoleOrNone(parentConsole) {
39
+ return isNoopScopedConsole(parentConsole) ? void 0 : parentConsole;
40
+ }
41
+ const useScopedConsoleRef = (prefix, override) => {
42
+ if (prefix.length === 0) {
43
+ throw new Error("Prefix must be non-empty string");
44
+ }
45
+ const parentConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext));
46
+ const scopedConsole = useMemo(() => {
47
+ if (override !== false && (parentConsole || override)) {
48
+ return createPrefixedConsole(prefix, parentConsole);
49
+ } else {
50
+ return noopScopedConsole;
51
+ }
52
+ }, [override, parentConsole, prefix]);
53
+ const ref = useRef(scopedConsole);
54
+ ref.current = scopedConsole;
55
+ return ref;
56
+ };
57
+ const DebugChildren = memo(({ active = true, children, id }) => {
58
+ const parentScopedConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext));
59
+ const console2 = active && id ? createPrefixedConsole(id, parentScopedConsole) : noopScopedConsole;
60
+ return /* @__PURE__ */ jsx(ScopedConsoleContext.Provider, { value: active ? console2 : noopScopedConsole, children });
61
+ });
62
+ DebugChildren.displayName = "DebugChildren";
63
+ export {
64
+ DebugChildren,
65
+ ScopedConsoleContext,
66
+ useScopedConsoleRef
67
+ };
68
+ //# sourceMappingURL=Context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.js","sources":["../../../../../packages/react-utils/src/debug-context/Context.tsx"],"sourcesContent":["import { createContext, memo, ReactNode, useContext, useMemo, useRef } from 'react'\nimport { isNoopScopedConsole, noopScopedConsole } from './Constants'\nimport { ScopedConsoleContextType } from './Types'\n\nfunction createPrefixedConsole(message: string, prefixedConsole?: ScopedConsoleContextType): ScopedConsoleContextType {\n\treturn {\n\t\terror: function error(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).error(message, ...parameters)\n\t\t},\n\t\terrored: function errored<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).error(message, value)\n\t\t\treturn value\n\t\t},\n\t\tlog: function log(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).log(message, ...parameters)\n\t\t},\n\t\tlogged: function logged<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).log(message, value)\n\t\t\treturn value\n\t\t},\n\t\ttrace: function trace(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).trace(message, ...parameters)\n\t\t},\n\t\ttraced: function traced<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).trace(message, value)\n\t\t\treturn value\n\t\t},\n\t\twarn: function warn(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).warn(message, ...parameters)\n\t\t},\n\t\twarned: function warned<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).warn(message, value)\n\t\t\treturn value\n\t\t},\n\t}\n}\n\nexport const ScopedConsoleContext = createContext<ScopedConsoleContextType>(null!)\nScopedConsoleContext.displayName = 'ScopedConsoleContext'\n\nfunction parentScopedConsoleOrNone(parentConsole: ScopedConsoleContextType): ScopedConsoleContextType | undefined {\n\treturn isNoopScopedConsole(parentConsole) ? undefined : parentConsole\n}\n\nexport const useScopedConsoleRef = (prefix: string, override?: boolean) => {\n\tif (prefix.length === 0) {\n\t\tthrow new Error('Prefix must be non-empty string')\n\t}\n\tconst parentConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst scopedConsole = useMemo(() => {\n\t\tif (override !== false && (parentConsole || override)) {\n\t\t\treturn createPrefixedConsole(prefix, parentConsole)\n\t\t} else {\n\t\t\treturn noopScopedConsole\n\t\t}\n\t}, [override, parentConsole, prefix])\n\n\tconst ref = useRef(scopedConsole)\n\tref.current = scopedConsole\n\n\treturn ref\n}\n\nexport type DebugChildrenProps =\n\t| { active?: true; children: ReactNode; id: string }\n\t| { active?: false; children: ReactNode; id?: string }\n\nexport const DebugChildren = memo<DebugChildrenProps>(({ active = true, children, id }) => {\n\tconst parentScopedConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst console = active && id\n\t\t? createPrefixedConsole(id, parentScopedConsole)\n\t\t: noopScopedConsole\n\n\treturn (\n\t\t<ScopedConsoleContext.Provider value={active ? console : noopScopedConsole}>\n\t\t\t{children}\n\t\t</ScopedConsoleContext.Provider>\n\t)\n})\nDebugChildren.displayName = 'DebugChildren'\n"],"names":["message","console"],"mappings":";;;AAIA,SAAS,sBAAsB,SAAiB,iBAAsE;AACrH,SAAO;AAAA,IACN,OAAO,SAAS,SAAS,YAAmB;AAC1C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC3D;AAAA,IACA,SAAS,SAAS,QAAYA,UAAiB,OAAa;AAC1D,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAClD,aAAO;AAAA,IACR;AAAA,IACA,KAAK,SAAS,OAAO,YAAmB;AACtC,OAAC,mBAAmB,SAAS,IAAI,SAAS,GAAG,UAAU;AAAA,IACzD;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,IAAIA,UAAS,KAAK;AAChD,aAAO;AAAA,IACR;AAAA,IACA,OAAO,SAAS,SAAS,YAAmB;AAC1C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC3D;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAClD,aAAO;AAAA,IACR;AAAA,IACA,MAAM,SAAS,QAAQ,YAAmB;AACxC,OAAC,mBAAmB,SAAS,KAAK,SAAS,GAAG,UAAU;AAAA,IAC1D;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,KAAKA,UAAS,KAAK;AACjD,aAAO;AAAA,IACR;AAAA,EAAA;AAEF;AAEO,MAAM,uBAAuB,cAAwC,IAAK;AACjF,qBAAqB,cAAc;AAEnC,SAAS,0BAA0B,eAA+E;AACjH,SAAO,oBAAoB,aAAa,IAAI,SAAY;AACzD;AAEO,MAAM,sBAAsB,CAAC,QAAgB,aAAuB;AAC1E,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,IAAI,MAAM,iCAAiC;AAAA,EAClD;AACA,QAAM,gBAAgB,0BAA0B,WAAW,oBAAoB,CAAC;AAEhF,QAAM,gBAAgB,QAAQ,MAAM;AACnC,QAAI,aAAa,UAAU,iBAAiB,WAAW;AACtD,aAAO,sBAAsB,QAAQ,aAAa;AAAA,IACnD,OAAO;AACN,aAAO;AAAA,IACR;AAAA,EACD,GAAG,CAAC,UAAU,eAAe,MAAM,CAAC;AAEpC,QAAM,MAAM,OAAO,aAAa;AAChC,MAAI,UAAU;AAEd,SAAO;AACR;AAMO,MAAM,gBAAgB,KAAyB,CAAC,EAAE,SAAS,MAAM,UAAU,SAAS;AAC1F,QAAM,sBAAsB,0BAA0B,WAAW,oBAAoB,CAAC;AAEtF,QAAMC,WAAU,UAAU,KACvB,sBAAsB,IAAI,mBAAmB,IAC7C;AAEH,SACC,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,SAASA,WAAU,mBACvD,UACF;AAEF,CAAC;AACD,cAAc,cAAc;"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function unwrapRefValue(value) {
4
+ if (value && typeof value === "object" && "current" in value) {
5
+ return value.current;
6
+ } else {
7
+ return value;
8
+ }
9
+ }
10
+ exports.unwrapRefValue = unwrapRefValue;
11
+ //# sourceMappingURL=unwrapRefValue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unwrapRefValue.cjs","sources":["../../../../../packages/react-utils/src/hooks/unwrapRefValue.ts"],"sourcesContent":["import { RefObject } from 'react'\n\nexport type RefObjectOrElement<T> = T | RefObject<T | null>\n\n/**\n * Unwraps a ref object or returns the value if it is not a ref object.\n * @param value - Value to unwrap\n * @returns Unwrapped value\n */\nexport function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null {\n\tif (value && typeof value === 'object' && 'current' in value) {\n\t\treturn value.current\n\t} else {\n\t\treturn value\n\t}\n}\n"],"names":[],"mappings":";;AASO,SAAS,eAAkB,OAAwC;AACzE,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;AAC7D,WAAO,MAAM;AAAA,EACd,OAAO;AACN,WAAO;AAAA,EACR;AACD;;"}
@@ -0,0 +1,11 @@
1
+ function unwrapRefValue(value) {
2
+ if (value && typeof value === "object" && "current" in value) {
3
+ return value.current;
4
+ } else {
5
+ return value;
6
+ }
7
+ }
8
+ export {
9
+ unwrapRefValue
10
+ };
11
+ //# sourceMappingURL=unwrapRefValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unwrapRefValue.js","sources":["../../../../../packages/react-utils/src/hooks/unwrapRefValue.ts"],"sourcesContent":["import { RefObject } from 'react'\n\nexport type RefObjectOrElement<T> = T | RefObject<T | null>\n\n/**\n * Unwraps a ref object or returns the value if it is not a ref object.\n * @param value - Value to unwrap\n * @returns Unwrapped value\n */\nexport function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null {\n\tif (value && typeof value === 'object' && 'current' in value) {\n\t\treturn value.current\n\t} else {\n\t\treturn value\n\t}\n}\n"],"names":[],"mappings":"AASO,SAAS,eAAkB,OAAwC;AACzE,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;AAC7D,WAAO,MAAM;AAAA,EACd,OAAO;AACN,WAAO;AAAA,EACR;AACD;"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ const useAbortController = () => {
5
+ const lastAbortControllerRef = React.useRef(void 0);
6
+ React.useEffect(() => () => {
7
+ lastAbortControllerRef.current?.abort();
8
+ }, []);
9
+ return React.useCallback(() => {
10
+ lastAbortControllerRef.current?.abort();
11
+ const newController = new AbortController();
12
+ lastAbortControllerRef.current = newController;
13
+ return newController.signal;
14
+ }, []);
15
+ };
16
+ exports.useAbortController = useAbortController;
17
+ //# sourceMappingURL=useAbortController.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAbortController.cjs","sources":["../../../../../packages/react-utils/src/hooks/useAbortController.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useAbortController = () => {\n\tconst lastAbortControllerRef = useRef<AbortController | undefined>(undefined)\n\tuseEffect(() => () => {\n\t\tlastAbortControllerRef.current?.abort()\n\t}, [])\n\treturn useCallback((): AbortSignal => {\n\t\tlastAbortControllerRef.current?.abort()\n\n\t\tconst newController = new AbortController()\n\t\tlastAbortControllerRef.current = newController\n\t\treturn newController.signal\n\t}, [])\n}\n"],"names":["useRef","useEffect","useCallback"],"mappings":";;;AAEO,MAAM,qBAAqB,MAAM;AACvC,QAAM,yBAAyBA,MAAAA,OAAoC,MAAS;AAC5EC,QAAAA,UAAU,MAAM,MAAM;AACrB,2BAAuB,SAAS,MAAA;AAAA,EACjC,GAAG,CAAA,CAAE;AACL,SAAOC,MAAAA,YAAY,MAAmB;AACrC,2BAAuB,SAAS,MAAA;AAEhC,UAAM,gBAAgB,IAAI,gBAAA;AAC1B,2BAAuB,UAAU;AACjC,WAAO,cAAc;AAAA,EACtB,GAAG,CAAA,CAAE;AACN;;"}
@@ -0,0 +1,17 @@
1
+ import { useRef, useEffect, useCallback } from "react";
2
+ const useAbortController = () => {
3
+ const lastAbortControllerRef = useRef(void 0);
4
+ useEffect(() => () => {
5
+ lastAbortControllerRef.current?.abort();
6
+ }, []);
7
+ return useCallback(() => {
8
+ lastAbortControllerRef.current?.abort();
9
+ const newController = new AbortController();
10
+ lastAbortControllerRef.current = newController;
11
+ return newController.signal;
12
+ }, []);
13
+ };
14
+ export {
15
+ useAbortController
16
+ };
17
+ //# sourceMappingURL=useAbortController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAbortController.js","sources":["../../../../../packages/react-utils/src/hooks/useAbortController.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useAbortController = () => {\n\tconst lastAbortControllerRef = useRef<AbortController | undefined>(undefined)\n\tuseEffect(() => () => {\n\t\tlastAbortControllerRef.current?.abort()\n\t}, [])\n\treturn useCallback((): AbortSignal => {\n\t\tlastAbortControllerRef.current?.abort()\n\n\t\tconst newController = new AbortController()\n\t\tlastAbortControllerRef.current = newController\n\t\treturn newController.signal\n\t}, [])\n}\n"],"names":[],"mappings":";AAEO,MAAM,qBAAqB,MAAM;AACvC,QAAM,yBAAyB,OAAoC,MAAS;AAC5E,YAAU,MAAM,MAAM;AACrB,2BAAuB,SAAS,MAAA;AAAA,EACjC,GAAG,CAAA,CAAE;AACL,SAAO,YAAY,MAAmB;AACrC,2BAAuB,SAAS,MAAA;AAEhC,UAAM,gBAAgB,IAAI,gBAAA;AAC1B,2BAAuB,UAAU;AACjC,WAAO,cAAc;AAAA,EACtB,GAAG,CAAA,CAAE;AACN;"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ const useArrayMapMemo = (items, map) => {
5
+ const mapped = React.useMemo(() => items.map(map), [map, ...items]);
6
+ return React.useMemo(() => mapped, mapped);
7
+ };
8
+ exports.useArrayMapMemo = useArrayMapMemo;
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// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\tconst mapped = useMemo(() => items.map(map), [map, ...items])\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\treturn useMemo(() => mapped, mapped) // This is deliberately not `[mapped]`\n}\n"],"names":["useMemo"],"mappings":";;;AAWO,MAAM,kBAAkB,CAC9B,OACA,QACkB;AASlB,QAAM,SAASA,cAAQ,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAG5D,SAAOA,MAAAA,QAAQ,MAAM,QAAQ,MAAM;AACpC;;"}
@@ -0,0 +1,9 @@
1
+ import { useMemo } from "react";
2
+ const useArrayMapMemo = (items, map) => {
3
+ const mapped = useMemo(() => items.map(map), [map, ...items]);
4
+ return useMemo(() => mapped, mapped);
5
+ };
6
+ export {
7
+ useArrayMapMemo
8
+ };
9
+ //# sourceMappingURL=useArrayMapMemo.js.map
@@ -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// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\tconst mapped = useMemo(() => items.map(map), [map, ...items])\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\treturn useMemo(() => mapped, mapped) // This is deliberately not `[mapped]`\n}\n"],"names":[],"mappings":";AAWO,MAAM,kBAAkB,CAC9B,OACA,QACkB;AASlB,QAAM,SAAS,QAAQ,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAG5D,SAAO,QAAQ,MAAM,QAAQ,MAAM;AACpC;"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ const unwrapRefValue = require("./unwrapRefValue.cjs");
5
+ const useOnElementResize = require("./useOnElementResize.cjs");
6
+ function px(value) {
7
+ return typeof value === "number" && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + "px" : "";
8
+ }
9
+ const useAutoHeightTextArea = (textAreaRef, value, minRows, maxRows) => {
10
+ const measure = React.useCallback(async (ref, minRows2, maxRows2) => {
11
+ if (ref) {
12
+ const rowsAttribute = ref.rows;
13
+ ref.style.height = "";
14
+ ref.style.minHeight = "";
15
+ ref.style.maxHeight = "";
16
+ if (minRows2 !== maxRows2) {
17
+ const height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight;
18
+ let minHeight;
19
+ let maxHeight;
20
+ ref.rows = minRows2;
21
+ minHeight = await ref.getBoundingClientRect().height;
22
+ if (maxRows2 === Infinity) {
23
+ maxHeight = Infinity;
24
+ } else {
25
+ ref.rows = maxRows2;
26
+ maxHeight = await ref.getBoundingClientRect().height;
27
+ }
28
+ ref.style.height = px(height);
29
+ ref.style.minHeight = px(minHeight);
30
+ ref.style.maxHeight = px(maxHeight);
31
+ }
32
+ ref.rows = rowsAttribute;
33
+ }
34
+ }, []);
35
+ useOnElementResize.useOnElementResize(textAreaRef, () => {
36
+ measure(unwrapRefValue.unwrapRefValue(textAreaRef), minRows, maxRows);
37
+ });
38
+ React.useLayoutEffect(() => {
39
+ measure(unwrapRefValue.unwrapRefValue(textAreaRef), minRows, maxRows);
40
+ }, [maxRows, measure, minRows, textAreaRef, value]);
41
+ };
42
+ exports.useAutoHeightTextArea = useAutoHeightTextArea;
43
+ //# sourceMappingURL=useAutoHeightTextArea.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoHeightTextArea.cjs","sources":["../../../../../packages/react-utils/src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nfunction px<V extends number | false | null | undefined>(value?: V): string {\n\treturn typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''\n}\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\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["useCallback","minRows","maxRows","useOnElementResize","unwrapRefValue","useLayoutEffect"],"mappings":";;;;;AAIA,SAAS,GAAgD,OAAmB;AAC3E,SAAO,OAAO,UAAU,YAAY,EAAE,MAAM,KAAK,KAAK,UAAU,YAAY,UAAU,aAAa,QAAQ,OAAO;AACnH;AAEO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAUA,MAAAA,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;AACzD,YAAI;AACJ,YAAI;AAEJ,YAAI,OAAOD;AACX,oBAAY,MAAM,IAAI,sBAAA,EAAwB;AAE9C,YAAIC,aAAY,UAAU;AACzB,sBAAY;AAAA,QACb,OAAO;AACN,cAAI,OAAOA;AACX,sBAAY,MAAM,IAAI,sBAAA,EAAwB;AAAA,QAC/C;AAEA,YAAI,MAAM,SAAS,GAAG,MAAM;AAC5B,YAAI,MAAM,YAAY,GAAG,SAAS;AAClC,YAAI,MAAM,YAAY,GAAG,SAAS;AAAA,MACnC;AAEA,UAAI,OAAO;AAAA,IACZ;AAAA,EACD,GAAG,CAAA,CAAE;AAELC,qBAAAA,mBAAmB,aAAa,MAAM;AACrC,YAAQC,eAAAA,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EACtD,CAAC;AAGDC,QAAAA,gBAAgB,MAAM;AACrB,YAAQD,eAAAA,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EACtD,GAAG,CAAC,SAAS,SAAS,SAAS,aAAa,KAAK,CAAC;AACnD;;"}
@@ -0,0 +1,43 @@
1
+ import { useCallback, useLayoutEffect } from "react";
2
+ import { unwrapRefValue } from "./unwrapRefValue.js";
3
+ import { useOnElementResize } from "./useOnElementResize.js";
4
+ function px(value) {
5
+ return typeof value === "number" && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + "px" : "";
6
+ }
7
+ const useAutoHeightTextArea = (textAreaRef, value, minRows, maxRows) => {
8
+ const measure = useCallback(async (ref, minRows2, maxRows2) => {
9
+ if (ref) {
10
+ const rowsAttribute = ref.rows;
11
+ ref.style.height = "";
12
+ ref.style.minHeight = "";
13
+ ref.style.maxHeight = "";
14
+ if (minRows2 !== maxRows2) {
15
+ const height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight;
16
+ let minHeight;
17
+ let maxHeight;
18
+ ref.rows = minRows2;
19
+ minHeight = await ref.getBoundingClientRect().height;
20
+ if (maxRows2 === Infinity) {
21
+ maxHeight = Infinity;
22
+ } else {
23
+ ref.rows = maxRows2;
24
+ maxHeight = await ref.getBoundingClientRect().height;
25
+ }
26
+ ref.style.height = px(height);
27
+ ref.style.minHeight = px(minHeight);
28
+ ref.style.maxHeight = px(maxHeight);
29
+ }
30
+ ref.rows = rowsAttribute;
31
+ }
32
+ }, []);
33
+ useOnElementResize(textAreaRef, () => {
34
+ measure(unwrapRefValue(textAreaRef), minRows, maxRows);
35
+ });
36
+ useLayoutEffect(() => {
37
+ measure(unwrapRefValue(textAreaRef), minRows, maxRows);
38
+ }, [maxRows, measure, minRows, textAreaRef, value]);
39
+ };
40
+ export {
41
+ useAutoHeightTextArea
42
+ };
43
+ //# sourceMappingURL=useAutoHeightTextArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoHeightTextArea.js","sources":["../../../../../packages/react-utils/src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nfunction px<V extends number | false | null | undefined>(value?: V): string {\n\treturn typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''\n}\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\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["minRows","maxRows"],"mappings":";;;AAIA,SAAS,GAAgD,OAAmB;AAC3E,SAAO,OAAO,UAAU,YAAY,EAAE,MAAM,KAAK,KAAK,UAAU,YAAY,UAAU,aAAa,QAAQ,OAAO;AACnH;AAEO,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;AACzD,YAAI;AACJ,YAAI;AAEJ,YAAI,OAAOD;AACX,oBAAY,MAAM,IAAI,sBAAA,EAAwB;AAE9C,YAAIC,aAAY,UAAU;AACzB,sBAAY;AAAA,QACb,OAAO;AACN,cAAI,OAAOA;AACX,sBAAY,MAAM,IAAI,sBAAA,EAAwB;AAAA,QAC/C;AAEA,YAAI,MAAM,SAAS,GAAG,MAAM;AAC5B,YAAI,MAAM,YAAY,GAAG,SAAS;AAClC,YAAI,MAAM,YAAY,GAAG,SAAS;AAAA,MACnC;AAEA,UAAI,OAAO;AAAA,IACZ;AAAA,EACD,GAAG,CAAA,CAAE;AAEL,qBAAmB,aAAa,MAAM;AACrC,YAAQ,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EACtD,CAAC;AAGD,kBAAgB,MAAM;AACrB,YAAQ,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EACtD,GAAG,CAAC,SAAS,SAAS,SAAS,aAAa,KAAK,CAAC;AACnD;"}