@contember/react-utils 2.1.0-alpha.30 → 2.1.0-alpha.36

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 (395) hide show
  1. package/package.json +11 -3
  2. package/src/debug-context/Constants.ts +1 -1
  3. package/src/debug-context/Context.tsx +13 -13
  4. package/src/hooks/unwrapRefValue.ts +1 -1
  5. package/src/hooks/useArrayMapMemo.ts +2 -2
  6. package/src/hooks/useAutoHeightTextArea.ts +1 -0
  7. package/src/hooks/useChildrenAsLabel.ts +7 -8
  8. package/src/hooks/useConstantLengthInvariant.ts +1 -3
  9. package/src/hooks/useConstantValueInvariant.ts +0 -1
  10. package/src/hooks/useDebounceCallback.ts +1 -1
  11. package/src/hooks/useExpectSameValueReference.ts +9 -6
  12. package/src/hooks/useOnElementMouseEnterDelayedCallback.ts +1 -1
  13. package/src/hooks/useOnElementResize.ts +2 -1
  14. package/src/hooks/useOnWindowResize.ts +3 -1
  15. package/src/hooks/useStoredState.ts +5 -3
  16. package/src/referentiallyStable/useReferentiallyStableCallback.ts +8 -8
  17. package/tests/hooks/useChildrenAsLabel.test.tsx +1 -0
  18. package/tests/hooks/useId.test.ts +1 -1
  19. package/dist/development/index.cjs +0 -86
  20. package/dist/development/index.cjs.map +0 -1
  21. package/dist/development/index.js +0 -86
  22. package/dist/development/index.js.map +0 -1
  23. package/dist/development/src/context/createContext.cjs +0 -10
  24. package/dist/development/src/context/createContext.cjs.map +0 -1
  25. package/dist/development/src/context/createContext.js +0 -10
  26. package/dist/development/src/context/createContext.js.map +0 -1
  27. package/dist/development/src/context/createRequiredContext.cjs +0 -18
  28. package/dist/development/src/context/createRequiredContext.cjs.map +0 -1
  29. package/dist/development/src/context/createRequiredContext.js +0 -18
  30. package/dist/development/src/context/createRequiredContext.js.map +0 -1
  31. package/dist/development/src/debug-context/Constants.cjs +0 -25
  32. package/dist/development/src/debug-context/Constants.cjs.map +0 -1
  33. package/dist/development/src/debug-context/Constants.js +0 -25
  34. package/dist/development/src/debug-context/Constants.js.map +0 -1
  35. package/dist/development/src/debug-context/Context.cjs +0 -72
  36. package/dist/development/src/debug-context/Context.cjs.map +0 -1
  37. package/dist/development/src/debug-context/Context.js +0 -72
  38. package/dist/development/src/debug-context/Context.js.map +0 -1
  39. package/dist/development/src/hooks/unwrapRefValue.cjs +0 -11
  40. package/dist/development/src/hooks/unwrapRefValue.cjs.map +0 -1
  41. package/dist/development/src/hooks/unwrapRefValue.js +0 -11
  42. package/dist/development/src/hooks/unwrapRefValue.js.map +0 -1
  43. package/dist/development/src/hooks/useAbortController.cjs +0 -17
  44. package/dist/development/src/hooks/useAbortController.cjs.map +0 -1
  45. package/dist/development/src/hooks/useAbortController.js +0 -17
  46. package/dist/development/src/hooks/useAbortController.js.map +0 -1
  47. package/dist/development/src/hooks/useArrayMapMemo.cjs +0 -11
  48. package/dist/development/src/hooks/useArrayMapMemo.cjs.map +0 -1
  49. package/dist/development/src/hooks/useArrayMapMemo.js +0 -11
  50. package/dist/development/src/hooks/useArrayMapMemo.js.map +0 -1
  51. package/dist/development/src/hooks/useAutoHeightTextArea.cjs +0 -43
  52. package/dist/development/src/hooks/useAutoHeightTextArea.cjs.map +0 -1
  53. package/dist/development/src/hooks/useAutoHeightTextArea.js +0 -43
  54. package/dist/development/src/hooks/useAutoHeightTextArea.js.map +0 -1
  55. package/dist/development/src/hooks/useChildrenAsLabel.cjs +0 -52
  56. package/dist/development/src/hooks/useChildrenAsLabel.cjs.map +0 -1
  57. package/dist/development/src/hooks/useChildrenAsLabel.js +0 -52
  58. package/dist/development/src/hooks/useChildrenAsLabel.js.map +0 -1
  59. package/dist/development/src/hooks/useComposeRef.cjs +0 -31
  60. package/dist/development/src/hooks/useComposeRef.cjs.map +0 -1
  61. package/dist/development/src/hooks/useComposeRef.js +0 -31
  62. package/dist/development/src/hooks/useComposeRef.js.map +0 -1
  63. package/dist/development/src/hooks/useConstantLengthInvariant.cjs +0 -15
  64. package/dist/development/src/hooks/useConstantLengthInvariant.cjs.map +0 -1
  65. package/dist/development/src/hooks/useConstantLengthInvariant.js +0 -15
  66. package/dist/development/src/hooks/useConstantLengthInvariant.js.map +0 -1
  67. package/dist/development/src/hooks/useConstantValueInvariant.cjs +0 -15
  68. package/dist/development/src/hooks/useConstantValueInvariant.cjs.map +0 -1
  69. package/dist/development/src/hooks/useConstantValueInvariant.js +0 -15
  70. package/dist/development/src/hooks/useConstantValueInvariant.js.map +0 -1
  71. package/dist/development/src/hooks/useDebounce.cjs +0 -15
  72. package/dist/development/src/hooks/useDebounce.cjs.map +0 -1
  73. package/dist/development/src/hooks/useDebounce.js +0 -15
  74. package/dist/development/src/hooks/useDebounce.js.map +0 -1
  75. package/dist/development/src/hooks/useDebounceCallback.cjs +0 -19
  76. package/dist/development/src/hooks/useDebounceCallback.cjs.map +0 -1
  77. package/dist/development/src/hooks/useDebounceCallback.js +0 -19
  78. package/dist/development/src/hooks/useDebounceCallback.js.map +0 -1
  79. package/dist/development/src/hooks/useDocumentTitle.cjs +0 -22
  80. package/dist/development/src/hooks/useDocumentTitle.cjs.map +0 -1
  81. package/dist/development/src/hooks/useDocumentTitle.js +0 -22
  82. package/dist/development/src/hooks/useDocumentTitle.js.map +0 -1
  83. package/dist/development/src/hooks/useExpectSameValueReference.cjs +0 -24
  84. package/dist/development/src/hooks/useExpectSameValueReference.cjs.map +0 -1
  85. package/dist/development/src/hooks/useExpectSameValueReference.js +0 -24
  86. package/dist/development/src/hooks/useExpectSameValueReference.js.map +0 -1
  87. package/dist/development/src/hooks/useForceRender.cjs +0 -9
  88. package/dist/development/src/hooks/useForceRender.cjs.map +0 -1
  89. package/dist/development/src/hooks/useForceRender.js +0 -9
  90. package/dist/development/src/hooks/useForceRender.js.map +0 -1
  91. package/dist/development/src/hooks/useId.cjs +0 -13
  92. package/dist/development/src/hooks/useId.cjs.map +0 -1
  93. package/dist/development/src/hooks/useId.js +0 -13
  94. package/dist/development/src/hooks/useId.js.map +0 -1
  95. package/dist/development/src/hooks/useIsMounted.cjs +0 -18
  96. package/dist/development/src/hooks/useIsMounted.cjs.map +0 -1
  97. package/dist/development/src/hooks/useIsMounted.js +0 -18
  98. package/dist/development/src/hooks/useIsMounted.js.map +0 -1
  99. package/dist/development/src/hooks/useObjectMemo.cjs +0 -27
  100. package/dist/development/src/hooks/useObjectMemo.cjs.map +0 -1
  101. package/dist/development/src/hooks/useObjectMemo.js +0 -27
  102. package/dist/development/src/hooks/useObjectMemo.js.map +0 -1
  103. package/dist/development/src/hooks/useOnElementClickOutsideCallback.cjs +0 -20
  104. package/dist/development/src/hooks/useOnElementClickOutsideCallback.cjs.map +0 -1
  105. package/dist/development/src/hooks/useOnElementClickOutsideCallback.js +0 -20
  106. package/dist/development/src/hooks/useOnElementClickOutsideCallback.js.map +0 -1
  107. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.cjs +0 -33
  108. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +0 -1
  109. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.js +0 -33
  110. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +0 -1
  111. package/dist/development/src/hooks/useOnElementResize.cjs +0 -42
  112. package/dist/development/src/hooks/useOnElementResize.cjs.map +0 -1
  113. package/dist/development/src/hooks/useOnElementResize.js +0 -42
  114. package/dist/development/src/hooks/useOnElementResize.js.map +0 -1
  115. package/dist/development/src/hooks/useOnWindowResize.cjs +0 -36
  116. package/dist/development/src/hooks/useOnWindowResize.cjs.map +0 -1
  117. package/dist/development/src/hooks/useOnWindowResize.js +0 -36
  118. package/dist/development/src/hooks/useOnWindowResize.js.map +0 -1
  119. package/dist/development/src/hooks/usePreviousValue.cjs +0 -12
  120. package/dist/development/src/hooks/usePreviousValue.cjs.map +0 -1
  121. package/dist/development/src/hooks/usePreviousValue.js +0 -12
  122. package/dist/development/src/hooks/usePreviousValue.js.map +0 -1
  123. package/dist/development/src/hooks/useStoredState.cjs +0 -100
  124. package/dist/development/src/hooks/useStoredState.cjs.map +0 -1
  125. package/dist/development/src/hooks/useStoredState.js +0 -100
  126. package/dist/development/src/hooks/useStoredState.js.map +0 -1
  127. package/dist/development/src/hooks/useUpdatedRef.cjs +0 -10
  128. package/dist/development/src/hooks/useUpdatedRef.cjs.map +0 -1
  129. package/dist/development/src/hooks/useUpdatedRef.js +0 -10
  130. package/dist/development/src/hooks/useUpdatedRef.js.map +0 -1
  131. package/dist/development/src/hooks/useWindowSize.cjs +0 -20
  132. package/dist/development/src/hooks/useWindowSize.cjs.map +0 -1
  133. package/dist/development/src/hooks/useWindowSize.js +0 -20
  134. package/dist/development/src/hooks/useWindowSize.js.map +0 -1
  135. package/dist/development/src/referentiallyStable/emptyArray.cjs +0 -5
  136. package/dist/development/src/referentiallyStable/emptyArray.cjs.map +0 -1
  137. package/dist/development/src/referentiallyStable/emptyArray.js +0 -5
  138. package/dist/development/src/referentiallyStable/emptyArray.js.map +0 -1
  139. package/dist/development/src/referentiallyStable/emptyObject.cjs +0 -5
  140. package/dist/development/src/referentiallyStable/emptyObject.cjs.map +0 -1
  141. package/dist/development/src/referentiallyStable/emptyObject.js +0 -5
  142. package/dist/development/src/referentiallyStable/emptyObject.js.map +0 -1
  143. package/dist/development/src/referentiallyStable/identityFunction.cjs +0 -5
  144. package/dist/development/src/referentiallyStable/identityFunction.cjs.map +0 -1
  145. package/dist/development/src/referentiallyStable/identityFunction.js +0 -5
  146. package/dist/development/src/referentiallyStable/identityFunction.js.map +0 -1
  147. package/dist/development/src/referentiallyStable/noop.cjs +0 -5
  148. package/dist/development/src/referentiallyStable/noop.cjs.map +0 -1
  149. package/dist/development/src/referentiallyStable/noop.js +0 -5
  150. package/dist/development/src/referentiallyStable/noop.js.map +0 -1
  151. package/dist/development/src/referentiallyStable/returnFalse.cjs +0 -5
  152. package/dist/development/src/referentiallyStable/returnFalse.cjs.map +0 -1
  153. package/dist/development/src/referentiallyStable/returnFalse.js +0 -5
  154. package/dist/development/src/referentiallyStable/returnFalse.js.map +0 -1
  155. package/dist/development/src/referentiallyStable/returnTrue.cjs +0 -5
  156. package/dist/development/src/referentiallyStable/returnTrue.cjs.map +0 -1
  157. package/dist/development/src/referentiallyStable/returnTrue.js +0 -5
  158. package/dist/development/src/referentiallyStable/returnTrue.js.map +0 -1
  159. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.cjs +0 -12
  160. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +0 -1
  161. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.js +0 -12
  162. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.js.map +0 -1
  163. package/dist/production/index.cjs +0 -86
  164. package/dist/production/index.cjs.map +0 -1
  165. package/dist/production/index.js +0 -86
  166. package/dist/production/index.js.map +0 -1
  167. package/dist/production/src/context/createContext.cjs +0 -10
  168. package/dist/production/src/context/createContext.cjs.map +0 -1
  169. package/dist/production/src/context/createContext.js +0 -10
  170. package/dist/production/src/context/createContext.js.map +0 -1
  171. package/dist/production/src/context/createRequiredContext.cjs +0 -18
  172. package/dist/production/src/context/createRequiredContext.cjs.map +0 -1
  173. package/dist/production/src/context/createRequiredContext.js +0 -18
  174. package/dist/production/src/context/createRequiredContext.js.map +0 -1
  175. package/dist/production/src/debug-context/Constants.cjs +0 -25
  176. package/dist/production/src/debug-context/Constants.cjs.map +0 -1
  177. package/dist/production/src/debug-context/Constants.js +0 -25
  178. package/dist/production/src/debug-context/Constants.js.map +0 -1
  179. package/dist/production/src/debug-context/Context.cjs +0 -68
  180. package/dist/production/src/debug-context/Context.cjs.map +0 -1
  181. package/dist/production/src/debug-context/Context.js +0 -68
  182. package/dist/production/src/debug-context/Context.js.map +0 -1
  183. package/dist/production/src/hooks/unwrapRefValue.cjs +0 -11
  184. package/dist/production/src/hooks/unwrapRefValue.cjs.map +0 -1
  185. package/dist/production/src/hooks/unwrapRefValue.js +0 -11
  186. package/dist/production/src/hooks/unwrapRefValue.js.map +0 -1
  187. package/dist/production/src/hooks/useAbortController.cjs +0 -17
  188. package/dist/production/src/hooks/useAbortController.cjs.map +0 -1
  189. package/dist/production/src/hooks/useAbortController.js +0 -17
  190. package/dist/production/src/hooks/useAbortController.js.map +0 -1
  191. package/dist/production/src/hooks/useArrayMapMemo.cjs +0 -9
  192. package/dist/production/src/hooks/useArrayMapMemo.cjs.map +0 -1
  193. package/dist/production/src/hooks/useArrayMapMemo.js +0 -9
  194. package/dist/production/src/hooks/useArrayMapMemo.js.map +0 -1
  195. package/dist/production/src/hooks/useAutoHeightTextArea.cjs +0 -43
  196. package/dist/production/src/hooks/useAutoHeightTextArea.cjs.map +0 -1
  197. package/dist/production/src/hooks/useAutoHeightTextArea.js +0 -43
  198. package/dist/production/src/hooks/useAutoHeightTextArea.js.map +0 -1
  199. package/dist/production/src/hooks/useChildrenAsLabel.cjs +0 -50
  200. package/dist/production/src/hooks/useChildrenAsLabel.cjs.map +0 -1
  201. package/dist/production/src/hooks/useChildrenAsLabel.js +0 -50
  202. package/dist/production/src/hooks/useChildrenAsLabel.js.map +0 -1
  203. package/dist/production/src/hooks/useComposeRef.cjs +0 -31
  204. package/dist/production/src/hooks/useComposeRef.cjs.map +0 -1
  205. package/dist/production/src/hooks/useComposeRef.js +0 -31
  206. package/dist/production/src/hooks/useComposeRef.js.map +0 -1
  207. package/dist/production/src/hooks/useConstantLengthInvariant.cjs +0 -6
  208. package/dist/production/src/hooks/useConstantLengthInvariant.cjs.map +0 -1
  209. package/dist/production/src/hooks/useConstantLengthInvariant.js +0 -6
  210. package/dist/production/src/hooks/useConstantLengthInvariant.js.map +0 -1
  211. package/dist/production/src/hooks/useConstantValueInvariant.cjs +0 -6
  212. package/dist/production/src/hooks/useConstantValueInvariant.cjs.map +0 -1
  213. package/dist/production/src/hooks/useConstantValueInvariant.js +0 -6
  214. package/dist/production/src/hooks/useConstantValueInvariant.js.map +0 -1
  215. package/dist/production/src/hooks/useDebounce.cjs +0 -15
  216. package/dist/production/src/hooks/useDebounce.cjs.map +0 -1
  217. package/dist/production/src/hooks/useDebounce.js +0 -15
  218. package/dist/production/src/hooks/useDebounce.js.map +0 -1
  219. package/dist/production/src/hooks/useDebounceCallback.cjs +0 -19
  220. package/dist/production/src/hooks/useDebounceCallback.cjs.map +0 -1
  221. package/dist/production/src/hooks/useDebounceCallback.js +0 -19
  222. package/dist/production/src/hooks/useDebounceCallback.js.map +0 -1
  223. package/dist/production/src/hooks/useDocumentTitle.cjs +0 -22
  224. package/dist/production/src/hooks/useDocumentTitle.cjs.map +0 -1
  225. package/dist/production/src/hooks/useDocumentTitle.js +0 -22
  226. package/dist/production/src/hooks/useDocumentTitle.js.map +0 -1
  227. package/dist/production/src/hooks/useExpectSameValueReference.cjs +0 -15
  228. package/dist/production/src/hooks/useExpectSameValueReference.cjs.map +0 -1
  229. package/dist/production/src/hooks/useExpectSameValueReference.js +0 -15
  230. package/dist/production/src/hooks/useExpectSameValueReference.js.map +0 -1
  231. package/dist/production/src/hooks/useForceRender.cjs +0 -9
  232. package/dist/production/src/hooks/useForceRender.cjs.map +0 -1
  233. package/dist/production/src/hooks/useForceRender.js +0 -9
  234. package/dist/production/src/hooks/useForceRender.js.map +0 -1
  235. package/dist/production/src/hooks/useId.cjs +0 -13
  236. package/dist/production/src/hooks/useId.cjs.map +0 -1
  237. package/dist/production/src/hooks/useId.js +0 -13
  238. package/dist/production/src/hooks/useId.js.map +0 -1
  239. package/dist/production/src/hooks/useIsMounted.cjs +0 -18
  240. package/dist/production/src/hooks/useIsMounted.cjs.map +0 -1
  241. package/dist/production/src/hooks/useIsMounted.js +0 -18
  242. package/dist/production/src/hooks/useIsMounted.js.map +0 -1
  243. package/dist/production/src/hooks/useObjectMemo.cjs +0 -27
  244. package/dist/production/src/hooks/useObjectMemo.cjs.map +0 -1
  245. package/dist/production/src/hooks/useObjectMemo.js +0 -27
  246. package/dist/production/src/hooks/useObjectMemo.js.map +0 -1
  247. package/dist/production/src/hooks/useOnElementClickOutsideCallback.cjs +0 -20
  248. package/dist/production/src/hooks/useOnElementClickOutsideCallback.cjs.map +0 -1
  249. package/dist/production/src/hooks/useOnElementClickOutsideCallback.js +0 -20
  250. package/dist/production/src/hooks/useOnElementClickOutsideCallback.js.map +0 -1
  251. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.cjs +0 -33
  252. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +0 -1
  253. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.js +0 -33
  254. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +0 -1
  255. package/dist/production/src/hooks/useOnElementResize.cjs +0 -42
  256. package/dist/production/src/hooks/useOnElementResize.cjs.map +0 -1
  257. package/dist/production/src/hooks/useOnElementResize.js +0 -42
  258. package/dist/production/src/hooks/useOnElementResize.js.map +0 -1
  259. package/dist/production/src/hooks/useOnWindowResize.cjs +0 -36
  260. package/dist/production/src/hooks/useOnWindowResize.cjs.map +0 -1
  261. package/dist/production/src/hooks/useOnWindowResize.js +0 -36
  262. package/dist/production/src/hooks/useOnWindowResize.js.map +0 -1
  263. package/dist/production/src/hooks/usePreviousValue.cjs +0 -12
  264. package/dist/production/src/hooks/usePreviousValue.cjs.map +0 -1
  265. package/dist/production/src/hooks/usePreviousValue.js +0 -12
  266. package/dist/production/src/hooks/usePreviousValue.js.map +0 -1
  267. package/dist/production/src/hooks/useStoredState.cjs +0 -100
  268. package/dist/production/src/hooks/useStoredState.cjs.map +0 -1
  269. package/dist/production/src/hooks/useStoredState.js +0 -100
  270. package/dist/production/src/hooks/useStoredState.js.map +0 -1
  271. package/dist/production/src/hooks/useUpdatedRef.cjs +0 -10
  272. package/dist/production/src/hooks/useUpdatedRef.cjs.map +0 -1
  273. package/dist/production/src/hooks/useUpdatedRef.js +0 -10
  274. package/dist/production/src/hooks/useUpdatedRef.js.map +0 -1
  275. package/dist/production/src/hooks/useWindowSize.cjs +0 -20
  276. package/dist/production/src/hooks/useWindowSize.cjs.map +0 -1
  277. package/dist/production/src/hooks/useWindowSize.js +0 -20
  278. package/dist/production/src/hooks/useWindowSize.js.map +0 -1
  279. package/dist/production/src/referentiallyStable/emptyArray.cjs +0 -5
  280. package/dist/production/src/referentiallyStable/emptyArray.cjs.map +0 -1
  281. package/dist/production/src/referentiallyStable/emptyArray.js +0 -5
  282. package/dist/production/src/referentiallyStable/emptyArray.js.map +0 -1
  283. package/dist/production/src/referentiallyStable/emptyObject.cjs +0 -5
  284. package/dist/production/src/referentiallyStable/emptyObject.cjs.map +0 -1
  285. package/dist/production/src/referentiallyStable/emptyObject.js +0 -5
  286. package/dist/production/src/referentiallyStable/emptyObject.js.map +0 -1
  287. package/dist/production/src/referentiallyStable/identityFunction.cjs +0 -5
  288. package/dist/production/src/referentiallyStable/identityFunction.cjs.map +0 -1
  289. package/dist/production/src/referentiallyStable/identityFunction.js +0 -5
  290. package/dist/production/src/referentiallyStable/identityFunction.js.map +0 -1
  291. package/dist/production/src/referentiallyStable/noop.cjs +0 -5
  292. package/dist/production/src/referentiallyStable/noop.cjs.map +0 -1
  293. package/dist/production/src/referentiallyStable/noop.js +0 -5
  294. package/dist/production/src/referentiallyStable/noop.js.map +0 -1
  295. package/dist/production/src/referentiallyStable/returnFalse.cjs +0 -5
  296. package/dist/production/src/referentiallyStable/returnFalse.cjs.map +0 -1
  297. package/dist/production/src/referentiallyStable/returnFalse.js +0 -5
  298. package/dist/production/src/referentiallyStable/returnFalse.js.map +0 -1
  299. package/dist/production/src/referentiallyStable/returnTrue.cjs +0 -5
  300. package/dist/production/src/referentiallyStable/returnTrue.cjs.map +0 -1
  301. package/dist/production/src/referentiallyStable/returnTrue.js +0 -5
  302. package/dist/production/src/referentiallyStable/returnTrue.js.map +0 -1
  303. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.cjs +0 -12
  304. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +0 -1
  305. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.js +0 -12
  306. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.js.map +0 -1
  307. package/dist/types/context/createContext.d.ts +0 -3
  308. package/dist/types/context/createContext.d.ts.map +0 -1
  309. package/dist/types/context/createRequiredContext.d.ts +0 -3
  310. package/dist/types/context/createRequiredContext.d.ts.map +0 -1
  311. package/dist/types/context/index.d.ts +0 -3
  312. package/dist/types/context/index.d.ts.map +0 -1
  313. package/dist/types/debug-context/Constants.d.ts +0 -6
  314. package/dist/types/debug-context/Constants.d.ts.map +0 -1
  315. package/dist/types/debug-context/Context.d.ts +0 -15
  316. package/dist/types/debug-context/Context.d.ts.map +0 -1
  317. package/dist/types/debug-context/Types.d.ts +0 -13
  318. package/dist/types/debug-context/Types.d.ts.map +0 -1
  319. package/dist/types/debug-context/index.d.ts +0 -4
  320. package/dist/types/debug-context/index.d.ts.map +0 -1
  321. package/dist/types/hooks/index.d.ts +0 -25
  322. package/dist/types/hooks/index.d.ts.map +0 -1
  323. package/dist/types/hooks/unwrapRefValue.d.ts +0 -9
  324. package/dist/types/hooks/unwrapRefValue.d.ts.map +0 -1
  325. package/dist/types/hooks/useAbortController.d.ts +0 -2
  326. package/dist/types/hooks/useAbortController.d.ts.map +0 -1
  327. package/dist/types/hooks/useArrayMapMemo.d.ts +0 -10
  328. package/dist/types/hooks/useArrayMapMemo.d.ts.map +0 -1
  329. package/dist/types/hooks/useAutoHeightTextArea.d.ts +0 -3
  330. package/dist/types/hooks/useAutoHeightTextArea.d.ts.map +0 -1
  331. package/dist/types/hooks/useChildrenAsLabel.d.ts +0 -18
  332. package/dist/types/hooks/useChildrenAsLabel.d.ts.map +0 -1
  333. package/dist/types/hooks/useComposeRef.d.ts +0 -16
  334. package/dist/types/hooks/useComposeRef.d.ts.map +0 -1
  335. package/dist/types/hooks/useConstantLengthInvariant.d.ts +0 -2
  336. package/dist/types/hooks/useConstantLengthInvariant.d.ts.map +0 -1
  337. package/dist/types/hooks/useConstantValueInvariant.d.ts +0 -2
  338. package/dist/types/hooks/useConstantValueInvariant.d.ts.map +0 -1
  339. package/dist/types/hooks/useDebounce.d.ts +0 -2
  340. package/dist/types/hooks/useDebounce.d.ts.map +0 -1
  341. package/dist/types/hooks/useDebounceCallback.d.ts +0 -2
  342. package/dist/types/hooks/useDebounceCallback.d.ts.map +0 -1
  343. package/dist/types/hooks/useDocumentTitle.d.ts +0 -2
  344. package/dist/types/hooks/useDocumentTitle.d.ts.map +0 -1
  345. package/dist/types/hooks/useExpectSameValueReference.d.ts +0 -24
  346. package/dist/types/hooks/useExpectSameValueReference.d.ts.map +0 -1
  347. package/dist/types/hooks/useForceRender.d.ts +0 -2
  348. package/dist/types/hooks/useForceRender.d.ts.map +0 -1
  349. package/dist/types/hooks/useId.d.ts +0 -10
  350. package/dist/types/hooks/useId.d.ts.map +0 -1
  351. package/dist/types/hooks/useIsMounted.d.ts +0 -2
  352. package/dist/types/hooks/useIsMounted.d.ts.map +0 -1
  353. package/dist/types/hooks/useObjectMemo.d.ts +0 -2
  354. package/dist/types/hooks/useObjectMemo.d.ts.map +0 -1
  355. package/dist/types/hooks/useOnElementClickOutsideCallback.d.ts +0 -3
  356. package/dist/types/hooks/useOnElementClickOutsideCallback.d.ts.map +0 -1
  357. package/dist/types/hooks/useOnElementMouseEnterDelayedCallback.d.ts +0 -14
  358. package/dist/types/hooks/useOnElementMouseEnterDelayedCallback.d.ts.map +0 -1
  359. package/dist/types/hooks/useOnElementResize.d.ts +0 -3
  360. package/dist/types/hooks/useOnElementResize.d.ts.map +0 -1
  361. package/dist/types/hooks/useOnWindowResize.d.ts +0 -2
  362. package/dist/types/hooks/useOnWindowResize.d.ts.map +0 -1
  363. package/dist/types/hooks/usePreviousValue.d.ts +0 -2
  364. package/dist/types/hooks/usePreviousValue.d.ts.map +0 -1
  365. package/dist/types/hooks/useStoredState.d.ts +0 -18
  366. package/dist/types/hooks/useStoredState.d.ts.map +0 -1
  367. package/dist/types/hooks/useUpdatedRef.d.ts +0 -8
  368. package/dist/types/hooks/useUpdatedRef.d.ts.map +0 -1
  369. package/dist/types/hooks/useWindowSize.d.ts +0 -5
  370. package/dist/types/hooks/useWindowSize.d.ts.map +0 -1
  371. package/dist/types/index.d.ts +0 -6
  372. package/dist/types/index.d.ts.map +0 -1
  373. package/dist/types/referentiallyStable/emptyArray.d.ts +0 -2
  374. package/dist/types/referentiallyStable/emptyArray.d.ts.map +0 -1
  375. package/dist/types/referentiallyStable/emptyObject.d.ts +0 -2
  376. package/dist/types/referentiallyStable/emptyObject.d.ts.map +0 -1
  377. package/dist/types/referentiallyStable/identityFunction.d.ts +0 -2
  378. package/dist/types/referentiallyStable/identityFunction.d.ts.map +0 -1
  379. package/dist/types/referentiallyStable/index.d.ts +0 -8
  380. package/dist/types/referentiallyStable/index.d.ts.map +0 -1
  381. package/dist/types/referentiallyStable/noop.d.ts +0 -2
  382. package/dist/types/referentiallyStable/noop.d.ts.map +0 -1
  383. package/dist/types/referentiallyStable/returnFalse.d.ts +0 -2
  384. package/dist/types/referentiallyStable/returnFalse.d.ts.map +0 -1
  385. package/dist/types/referentiallyStable/returnTrue.d.ts +0 -2
  386. package/dist/types/referentiallyStable/returnTrue.d.ts.map +0 -1
  387. package/dist/types/referentiallyStable/useReferentiallyStableCallback.d.ts +0 -3
  388. package/dist/types/referentiallyStable/useReferentiallyStableCallback.d.ts.map +0 -1
  389. package/dist/types/tsconfig.tsbuildinfo +0 -1
  390. package/dist/types/types/PropsWithRequiredChildren.d.ts +0 -5
  391. package/dist/types/types/PropsWithRequiredChildren.d.ts.map +0 -1
  392. package/dist/types/types/Serializable.d.ts +0 -4
  393. package/dist/types/types/Serializable.d.ts.map +0 -1
  394. package/dist/types/types/index.d.ts +0 -3
  395. package/dist/types/types/index.d.ts.map +0 -1
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const React = require("react");
4
- const urlStateStorage = {
5
- getItem(key) {
6
- const searchParams = new URLSearchParams(window.location.search);
7
- const value = searchParams.get(key[1]);
8
- return value !== null && value !== void 0 ? JSON.parse(value) : null;
9
- },
10
- setItem(key, value) {
11
- const searchParams = new URLSearchParams(window.location.search);
12
- searchParams.set(key[1], JSON.stringify(value));
13
- const newUrl = `${window.location.pathname}?${searchParams.toString()}`;
14
- window.history.replaceState({}, "", newUrl);
15
- }
16
- };
17
- const createStateStorageFromNativeStorage = (getStorage) => {
18
- return {
19
- getItem(key) {
20
- const value = getStorage().getItem(key.join("-"));
21
- return value !== null ? JSON.parse(value) : null;
22
- },
23
- setItem(key, value) {
24
- getStorage().setItem(key.join("-"), JSON.stringify(value));
25
- }
26
- };
27
- };
28
- const sessionStateStorage = createStateStorageFromNativeStorage(() => sessionStorage);
29
- const localStateStorage = createStateStorageFromNativeStorage(() => localStorage);
30
- const nullStorage = {
31
- getItem() {
32
- return null;
33
- },
34
- setItem() {
35
- }
36
- };
37
- const builtInStorages = {
38
- url: urlStateStorage,
39
- session: sessionStateStorage,
40
- local: localStateStorage,
41
- null: nullStorage
42
- };
43
- const useStoredState = (storageOrName, key, initializeValue) => {
44
- const storage = React.useMemo(() => {
45
- return getStateStorage(storageOrName);
46
- }, [storageOrName]);
47
- const [value, setValue] = React.useState(() => {
48
- const value2 = storage.getItem(key);
49
- return initializeValue(value2);
50
- });
51
- return [
52
- value,
53
- React.useCallback((value2) => {
54
- setValue((current) => {
55
- const newValue = typeof value2 === "function" ? value2(current) : value2;
56
- storage.setItem(key, newValue);
57
- return newValue;
58
- });
59
- }, [key, storage])
60
- ];
61
- };
62
- const useSessionStorageState = (key, initializeValue) => {
63
- return useStoredState(sessionStateStorage, key, initializeValue);
64
- };
65
- const useLocalStorageState = (key, initializeValue) => {
66
- return useStoredState(localStateStorage, key, initializeValue);
67
- };
68
- const getStateStorage = (storageOrName) => {
69
- if (Array.isArray(storageOrName)) {
70
- return createFallbackStorage(storageOrName.map((it) => typeof it === "string" ? builtInStorages[it] : it));
71
- }
72
- return typeof storageOrName === "string" ? builtInStorages[storageOrName] : storageOrName;
73
- };
74
- const createFallbackStorage = (storageTypes) => {
75
- return {
76
- getItem(key) {
77
- for (const storage of storageTypes) {
78
- const value = storage.getItem(key);
79
- if (value !== null) {
80
- return value;
81
- }
82
- }
83
- return null;
84
- },
85
- setItem(key, value) {
86
- for (const storage of storageTypes) {
87
- storage.setItem(key, value);
88
- }
89
- }
90
- };
91
- };
92
- exports.getStateStorage = getStateStorage;
93
- exports.localStateStorage = localStateStorage;
94
- exports.nullStorage = nullStorage;
95
- exports.sessionStateStorage = sessionStateStorage;
96
- exports.urlStateStorage = urlStateStorage;
97
- exports.useLocalStorageState = useLocalStorageState;
98
- exports.useSessionStorageState = useSessionStorageState;
99
- exports.useStoredState = useStoredState;
100
- //# sourceMappingURL=useStoredState.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useStoredState.cjs","sources":["../../../../../packages/react-utils/src/hooks/useStoredState.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { Serializable } from '../types'\n\nexport type SetState<V extends Serializable> = (value: V | ((current: V) => V)) => void\nexport type StateStorageKey = [uniquePrefix: string, key: string]\n\nexport type ValueInitializer<V extends Serializable> = (storedValue: V | undefined) => V\n\nexport interface StateStorage {\n\tgetItem(key: StateStorageKey): Serializable\n\n\tsetItem(key: StateStorageKey, value: Serializable): void\n}\n\n\nexport const urlStateStorage: StateStorage = {\n\tgetItem(key) {\n\t\tconst searchParams = new URLSearchParams(window.location.search)\n\t\tconst value = searchParams.get(key[1])\n\t\treturn value !== null && value !== undefined ? JSON.parse(value) : null\n\t},\n\tsetItem(key, value) {\n\t\tconst searchParams = new URLSearchParams(window.location.search)\n\t\tsearchParams.set(key[1], JSON.stringify(value))\n\t\tconst newUrl = `${window.location.pathname}?${searchParams.toString()}`\n\t\twindow.history.replaceState({}, '', newUrl)\n\t},\n}\n\nconst createStateStorageFromNativeStorage = (getStorage: () => Storage): StateStorage => {\n\treturn {\n\t\tgetItem(key) {\n\t\t\tconst value = getStorage().getItem(key.join('-'))\n\t\t\treturn value !== null ? JSON.parse(value) : null\n\t\t},\n\t\tsetItem(key, value) {\n\t\t\tgetStorage().setItem(key.join('-'), JSON.stringify(value))\n\t\t},\n\t}\n}\n\nexport const sessionStateStorage = createStateStorageFromNativeStorage(() => sessionStorage)\nexport const localStateStorage = createStateStorageFromNativeStorage(() => localStorage)\nexport const nullStorage: StateStorage = {\n\tgetItem() {\n\t\treturn null\n\t},\n\tsetItem() {\n\t},\n}\n\nconst builtInStorages = {\n\turl: urlStateStorage,\n\tsession: sessionStateStorage,\n\tlocal: localStateStorage,\n\tnull: nullStorage,\n}\n\nexport type StateStorageOrName = StateStorage | 'url' | 'session' | 'local' | 'null'\n\nexport const useStoredState = <V extends Serializable>(storageOrName: StateStorageOrName | StateStorageOrName[], key: StateStorageKey, initializeValue: ValueInitializer<V>): [V, SetState<V>] => {\n\tconst storage = useMemo(() => {\n\t\treturn getStateStorage(storageOrName)\n\t}, [storageOrName])\n\n\tconst [value, setValue] = useState<V>(() => {\n\t\tconst value = storage.getItem(key)\n\t\treturn initializeValue(value as V)\n\t})\n\treturn [\n\t\tvalue,\n\t\tuseCallback(value => {\n\t\t\tsetValue(current => {\n\t\t\t\tconst newValue = typeof value === 'function' ? (value as (current: V) => V)(current) : value\n\t\t\t\tstorage.setItem(key, newValue)\n\t\t\t\treturn newValue\n\t\t\t})\n\t\t}, [key, storage]),\n\t]\n}\n\nexport const useSessionStorageState = <V extends Serializable>(key: StateStorageKey, initializeValue: ValueInitializer<V>): [V, SetState<V>] => {\n\treturn useStoredState<V>(sessionStateStorage, key, initializeValue)\n}\n\nexport const useLocalStorageState = <V extends Serializable>(key: StateStorageKey, initializeValue: ValueInitializer<V>): [V, SetState<V>] => {\n\treturn useStoredState<V>(localStateStorage, key, initializeValue)\n}\n\nexport const getStateStorage = (storageOrName: StateStorageOrName | StateStorageOrName[]) => {\n\tif (Array.isArray(storageOrName)) {\n\t\treturn createFallbackStorage(storageOrName.map(it => typeof it === 'string' ? builtInStorages[it] : it))\n\t}\n\treturn typeof storageOrName === 'string' ? builtInStorages[storageOrName] : storageOrName\n}\n\n\nconst createFallbackStorage = (storageTypes: StateStorage[]): StateStorage => {\n\treturn {\n\t\tgetItem(key) {\n\t\t\tfor (const storage of storageTypes) {\n\t\t\t\tconst value = storage.getItem(key)\n\t\t\t\tif (value !== null) {\n\t\t\t\t\treturn value\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\t\tsetItem(key, value) {\n\t\t\tfor (const storage of storageTypes) {\n\t\t\t\tstorage.setItem(key, value)\n\t\t\t}\n\t\t},\n\t}\n}\n"],"names":["useMemo","useState","value","useCallback"],"mappings":"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"}
@@ -1,100 +0,0 @@
1
- import { useMemo, useState, useCallback } from "react";
2
- const urlStateStorage = {
3
- getItem(key) {
4
- const searchParams = new URLSearchParams(window.location.search);
5
- const value = searchParams.get(key[1]);
6
- return value !== null && value !== void 0 ? JSON.parse(value) : null;
7
- },
8
- setItem(key, value) {
9
- const searchParams = new URLSearchParams(window.location.search);
10
- searchParams.set(key[1], JSON.stringify(value));
11
- const newUrl = `${window.location.pathname}?${searchParams.toString()}`;
12
- window.history.replaceState({}, "", newUrl);
13
- }
14
- };
15
- const createStateStorageFromNativeStorage = (getStorage) => {
16
- return {
17
- getItem(key) {
18
- const value = getStorage().getItem(key.join("-"));
19
- return value !== null ? JSON.parse(value) : null;
20
- },
21
- setItem(key, value) {
22
- getStorage().setItem(key.join("-"), JSON.stringify(value));
23
- }
24
- };
25
- };
26
- const sessionStateStorage = createStateStorageFromNativeStorage(() => sessionStorage);
27
- const localStateStorage = createStateStorageFromNativeStorage(() => localStorage);
28
- const nullStorage = {
29
- getItem() {
30
- return null;
31
- },
32
- setItem() {
33
- }
34
- };
35
- const builtInStorages = {
36
- url: urlStateStorage,
37
- session: sessionStateStorage,
38
- local: localStateStorage,
39
- null: nullStorage
40
- };
41
- const useStoredState = (storageOrName, key, initializeValue) => {
42
- const storage = useMemo(() => {
43
- return getStateStorage(storageOrName);
44
- }, [storageOrName]);
45
- const [value, setValue] = useState(() => {
46
- const value2 = storage.getItem(key);
47
- return initializeValue(value2);
48
- });
49
- return [
50
- value,
51
- useCallback((value2) => {
52
- setValue((current) => {
53
- const newValue = typeof value2 === "function" ? value2(current) : value2;
54
- storage.setItem(key, newValue);
55
- return newValue;
56
- });
57
- }, [key, storage])
58
- ];
59
- };
60
- const useSessionStorageState = (key, initializeValue) => {
61
- return useStoredState(sessionStateStorage, key, initializeValue);
62
- };
63
- const useLocalStorageState = (key, initializeValue) => {
64
- return useStoredState(localStateStorage, key, initializeValue);
65
- };
66
- const getStateStorage = (storageOrName) => {
67
- if (Array.isArray(storageOrName)) {
68
- return createFallbackStorage(storageOrName.map((it) => typeof it === "string" ? builtInStorages[it] : it));
69
- }
70
- return typeof storageOrName === "string" ? builtInStorages[storageOrName] : storageOrName;
71
- };
72
- const createFallbackStorage = (storageTypes) => {
73
- return {
74
- getItem(key) {
75
- for (const storage of storageTypes) {
76
- const value = storage.getItem(key);
77
- if (value !== null) {
78
- return value;
79
- }
80
- }
81
- return null;
82
- },
83
- setItem(key, value) {
84
- for (const storage of storageTypes) {
85
- storage.setItem(key, value);
86
- }
87
- }
88
- };
89
- };
90
- export {
91
- getStateStorage,
92
- localStateStorage,
93
- nullStorage,
94
- sessionStateStorage,
95
- urlStateStorage,
96
- useLocalStorageState,
97
- useSessionStorageState,
98
- useStoredState
99
- };
100
- //# sourceMappingURL=useStoredState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useStoredState.js","sources":["../../../../../packages/react-utils/src/hooks/useStoredState.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { Serializable } from '../types'\n\nexport type SetState<V extends Serializable> = (value: V | ((current: V) => V)) => void\nexport type StateStorageKey = [uniquePrefix: string, key: string]\n\nexport type ValueInitializer<V extends Serializable> = (storedValue: V | undefined) => V\n\nexport interface StateStorage {\n\tgetItem(key: StateStorageKey): Serializable\n\n\tsetItem(key: StateStorageKey, value: Serializable): void\n}\n\n\nexport const urlStateStorage: StateStorage = {\n\tgetItem(key) {\n\t\tconst searchParams = new URLSearchParams(window.location.search)\n\t\tconst value = searchParams.get(key[1])\n\t\treturn value !== null && value !== undefined ? JSON.parse(value) : null\n\t},\n\tsetItem(key, value) {\n\t\tconst searchParams = new URLSearchParams(window.location.search)\n\t\tsearchParams.set(key[1], JSON.stringify(value))\n\t\tconst newUrl = `${window.location.pathname}?${searchParams.toString()}`\n\t\twindow.history.replaceState({}, '', newUrl)\n\t},\n}\n\nconst createStateStorageFromNativeStorage = (getStorage: () => Storage): StateStorage => {\n\treturn {\n\t\tgetItem(key) {\n\t\t\tconst value = getStorage().getItem(key.join('-'))\n\t\t\treturn value !== null ? JSON.parse(value) : null\n\t\t},\n\t\tsetItem(key, value) {\n\t\t\tgetStorage().setItem(key.join('-'), JSON.stringify(value))\n\t\t},\n\t}\n}\n\nexport const sessionStateStorage = createStateStorageFromNativeStorage(() => sessionStorage)\nexport const localStateStorage = createStateStorageFromNativeStorage(() => localStorage)\nexport const nullStorage: StateStorage = {\n\tgetItem() {\n\t\treturn null\n\t},\n\tsetItem() {\n\t},\n}\n\nconst builtInStorages = {\n\turl: urlStateStorage,\n\tsession: sessionStateStorage,\n\tlocal: localStateStorage,\n\tnull: nullStorage,\n}\n\nexport type StateStorageOrName = StateStorage | 'url' | 'session' | 'local' | 'null'\n\nexport const useStoredState = <V extends Serializable>(storageOrName: StateStorageOrName | StateStorageOrName[], key: StateStorageKey, initializeValue: ValueInitializer<V>): [V, SetState<V>] => {\n\tconst storage = useMemo(() => {\n\t\treturn getStateStorage(storageOrName)\n\t}, [storageOrName])\n\n\tconst [value, setValue] = useState<V>(() => {\n\t\tconst value = storage.getItem(key)\n\t\treturn initializeValue(value as V)\n\t})\n\treturn [\n\t\tvalue,\n\t\tuseCallback(value => {\n\t\t\tsetValue(current => {\n\t\t\t\tconst newValue = typeof value === 'function' ? (value as (current: V) => V)(current) : value\n\t\t\t\tstorage.setItem(key, newValue)\n\t\t\t\treturn newValue\n\t\t\t})\n\t\t}, [key, storage]),\n\t]\n}\n\nexport const useSessionStorageState = <V extends Serializable>(key: StateStorageKey, initializeValue: ValueInitializer<V>): [V, SetState<V>] => {\n\treturn useStoredState<V>(sessionStateStorage, key, initializeValue)\n}\n\nexport const useLocalStorageState = <V extends Serializable>(key: StateStorageKey, initializeValue: ValueInitializer<V>): [V, SetState<V>] => {\n\treturn useStoredState<V>(localStateStorage, key, initializeValue)\n}\n\nexport const getStateStorage = (storageOrName: StateStorageOrName | StateStorageOrName[]) => {\n\tif (Array.isArray(storageOrName)) {\n\t\treturn createFallbackStorage(storageOrName.map(it => typeof it === 'string' ? builtInStorages[it] : it))\n\t}\n\treturn typeof storageOrName === 'string' ? builtInStorages[storageOrName] : storageOrName\n}\n\n\nconst createFallbackStorage = (storageTypes: StateStorage[]): StateStorage => {\n\treturn {\n\t\tgetItem(key) {\n\t\t\tfor (const storage of storageTypes) {\n\t\t\t\tconst value = storage.getItem(key)\n\t\t\t\tif (value !== null) {\n\t\t\t\t\treturn value\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\t\tsetItem(key, value) {\n\t\t\tfor (const storage of storageTypes) {\n\t\t\t\tstorage.setItem(key, value)\n\t\t\t}\n\t\t},\n\t}\n}\n"],"names":["value"],"mappings":"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"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const React = require("react");
4
- function useUpdatedRef(value) {
5
- const ref = React.useRef(value);
6
- ref.current = value;
7
- return ref;
8
- }
9
- exports.useUpdatedRef = useUpdatedRef;
10
- //# sourceMappingURL=useUpdatedRef.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUpdatedRef.cjs","sources":["../../../../../packages/react-utils/src/hooks/useUpdatedRef.ts"],"sourcesContent":["import { useRef } from 'react'\n\n/**\n * Returns a stable mutable object with value that is updated upon each call\n *\n * @param value - Value that could update after initial call\n * @returns Mutable ref object with updated value\n */\nexport function useUpdatedRef<T>(value: T) {\n\tconst ref = useRef(value)\n\tref.current = value\n\n\treturn ref\n}\n"],"names":["useRef"],"mappings":";;;AAQO,SAAS,cAAiB,OAAU;AACpC,QAAA,MAAMA,aAAO,KAAK;AACxB,MAAI,UAAU;AAEP,SAAA;AACR;;"}
@@ -1,10 +0,0 @@
1
- import { useRef } from "react";
2
- function useUpdatedRef(value) {
3
- const ref = useRef(value);
4
- ref.current = value;
5
- return ref;
6
- }
7
- export {
8
- useUpdatedRef
9
- };
10
- //# sourceMappingURL=useUpdatedRef.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUpdatedRef.js","sources":["../../../../../packages/react-utils/src/hooks/useUpdatedRef.ts"],"sourcesContent":["import { useRef } from 'react'\n\n/**\n * Returns a stable mutable object with value that is updated upon each call\n *\n * @param value - Value that could update after initial call\n * @returns Mutable ref object with updated value\n */\nexport function useUpdatedRef<T>(value: T) {\n\tconst ref = useRef(value)\n\tref.current = value\n\n\treturn ref\n}\n"],"names":[],"mappings":";AAQO,SAAS,cAAiB,OAAU;AACpC,QAAA,MAAM,OAAO,KAAK;AACxB,MAAI,UAAU;AAEP,SAAA;AACR;"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const React = require("react");
4
- const useOnWindowResize = require("./useOnWindowResize.cjs");
5
- function useWindowSize() {
6
- const [width, setWidth] = React.useState(window.innerWidth);
7
- const [height, setHeight] = React.useState(window.innerHeight);
8
- useOnWindowResize.useOnWindowResize(() => {
9
- const { innerHeight, innerWidth } = window;
10
- if (innerHeight !== height) {
11
- setHeight(innerHeight);
12
- }
13
- if (innerWidth !== width) {
14
- setWidth(innerWidth);
15
- }
16
- });
17
- return React.useMemo(() => ({ height, width }), [height, width]);
18
- }
19
- exports.useWindowSize = useWindowSize;
20
- //# sourceMappingURL=useWindowSize.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useWindowSize.cjs","sources":["../../../../../packages/react-utils/src/hooks/useWindowSize.ts"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useOnWindowResize } from './useOnWindowResize'\n\nexport function useWindowSize() {\n\tconst [width, setWidth] = useState(window.innerWidth)\n\tconst [height, setHeight] = useState(window.innerHeight)\n\n\tuseOnWindowResize(() => {\n\t\tconst { innerHeight, innerWidth } = window\n\t\tif (innerHeight !== height) {\n\t\t\tsetHeight(innerHeight)\n\t\t}\n\n\t\tif (innerWidth !== width) {\n\t\t\tsetWidth(innerWidth)\n\t\t}\n\t})\n\n\treturn useMemo(() => ({ height, width }), [height, width])\n}\n"],"names":["useState","useOnWindowResize","useMemo"],"mappings":";;;;AAGO,SAAS,gBAAgB;AAC/B,QAAM,CAAC,OAAO,QAAQ,IAAIA,MAAAA,SAAS,OAAO,UAAU;AACpD,QAAM,CAAC,QAAQ,SAAS,IAAIA,MAAAA,SAAS,OAAO,WAAW;AAEvDC,oBAAAA,kBAAkB,MAAM;AACjB,UAAA,EAAE,aAAa,WAAA,IAAe;AACpC,QAAI,gBAAgB,QAAQ;AAC3B,gBAAU,WAAW;AAAA,IAAA;AAGtB,QAAI,eAAe,OAAO;AACzB,eAAS,UAAU;AAAA,IAAA;AAAA,EACpB,CACA;AAEM,SAAAC,MAAA,QAAQ,OAAO,EAAE,QAAQ,MAAU,IAAA,CAAC,QAAQ,KAAK,CAAC;AAC1D;;"}
@@ -1,20 +0,0 @@
1
- import { useState, useMemo } from "react";
2
- import { useOnWindowResize } from "./useOnWindowResize.js";
3
- function useWindowSize() {
4
- const [width, setWidth] = useState(window.innerWidth);
5
- const [height, setHeight] = useState(window.innerHeight);
6
- useOnWindowResize(() => {
7
- const { innerHeight, innerWidth } = window;
8
- if (innerHeight !== height) {
9
- setHeight(innerHeight);
10
- }
11
- if (innerWidth !== width) {
12
- setWidth(innerWidth);
13
- }
14
- });
15
- return useMemo(() => ({ height, width }), [height, width]);
16
- }
17
- export {
18
- useWindowSize
19
- };
20
- //# sourceMappingURL=useWindowSize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useWindowSize.js","sources":["../../../../../packages/react-utils/src/hooks/useWindowSize.ts"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useOnWindowResize } from './useOnWindowResize'\n\nexport function useWindowSize() {\n\tconst [width, setWidth] = useState(window.innerWidth)\n\tconst [height, setHeight] = useState(window.innerHeight)\n\n\tuseOnWindowResize(() => {\n\t\tconst { innerHeight, innerWidth } = window\n\t\tif (innerHeight !== height) {\n\t\t\tsetHeight(innerHeight)\n\t\t}\n\n\t\tif (innerWidth !== width) {\n\t\t\tsetWidth(innerWidth)\n\t\t}\n\t})\n\n\treturn useMemo(() => ({ height, width }), [height, width])\n}\n"],"names":[],"mappings":";;AAGO,SAAS,gBAAgB;AAC/B,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,OAAO,UAAU;AACpD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,OAAO,WAAW;AAEvD,oBAAkB,MAAM;AACjB,UAAA,EAAE,aAAa,WAAA,IAAe;AACpC,QAAI,gBAAgB,QAAQ;AAC3B,gBAAU,WAAW;AAAA,IAAA;AAGtB,QAAI,eAAe,OAAO;AACzB,eAAS,UAAU;AAAA,IAAA;AAAA,EACpB,CACA;AAEM,SAAA,QAAQ,OAAO,EAAE,QAAQ,MAAU,IAAA,CAAC,QAAQ,KAAK,CAAC;AAC1D;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const emptyArray = Object.freeze([]);
4
- exports.emptyArray = emptyArray;
5
- //# sourceMappingURL=emptyArray.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emptyArray.cjs","sources":["../../../../../packages/react-utils/src/referentiallyStable/emptyArray.ts"],"sourcesContent":["export const emptyArray = Object.freeze<any>([]) as any[]\n"],"names":[],"mappings":";;AAAO,MAAM,aAAa,OAAO,OAAY,CAAE,CAAA;;"}
@@ -1,5 +0,0 @@
1
- const emptyArray = Object.freeze([]);
2
- export {
3
- emptyArray
4
- };
5
- //# sourceMappingURL=emptyArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emptyArray.js","sources":["../../../../../packages/react-utils/src/referentiallyStable/emptyArray.ts"],"sourcesContent":["export const emptyArray = Object.freeze<any>([]) as any[]\n"],"names":[],"mappings":"AAAO,MAAM,aAAa,OAAO,OAAY,CAAE,CAAA;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const emptyObject = Object.freeze({});
4
- exports.emptyObject = emptyObject;
5
- //# sourceMappingURL=emptyObject.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emptyObject.cjs","sources":["../../../../../packages/react-utils/src/referentiallyStable/emptyObject.ts"],"sourcesContent":["export const emptyObject = Object.freeze({})\n"],"names":[],"mappings":";;AAAO,MAAM,cAAc,OAAO,OAAO,CAAE,CAAA;;"}
@@ -1,5 +0,0 @@
1
- const emptyObject = Object.freeze({});
2
- export {
3
- emptyObject
4
- };
5
- //# sourceMappingURL=emptyObject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emptyObject.js","sources":["../../../../../packages/react-utils/src/referentiallyStable/emptyObject.ts"],"sourcesContent":["export const emptyObject = Object.freeze({})\n"],"names":[],"mappings":"AAAO,MAAM,cAAc,OAAO,OAAO,CAAE,CAAA;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const identityFunction = (value) => value;
4
- exports.identityFunction = identityFunction;
5
- //# sourceMappingURL=identityFunction.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identityFunction.cjs","sources":["../../../../../packages/react-utils/src/referentiallyStable/identityFunction.ts"],"sourcesContent":["export const identityFunction = <Value>(value: Value) => value\n"],"names":[],"mappings":";;AAAa,MAAA,mBAAmB,CAAQ,UAAiB;;"}
@@ -1,5 +0,0 @@
1
- const identityFunction = (value) => value;
2
- export {
3
- identityFunction
4
- };
5
- //# sourceMappingURL=identityFunction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identityFunction.js","sources":["../../../../../packages/react-utils/src/referentiallyStable/identityFunction.ts"],"sourcesContent":["export const identityFunction = <Value>(value: Value) => value\n"],"names":[],"mappings":"AAAa,MAAA,mBAAmB,CAAQ,UAAiB;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const noop = () => void 0;
4
- exports.noop = noop;
5
- //# sourceMappingURL=noop.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"noop.cjs","sources":["../../../../../packages/react-utils/src/referentiallyStable/noop.ts"],"sourcesContent":["export const noop = () => undefined\n"],"names":[],"mappings":";;AAAO,MAAM,OAAO,MAAM;;"}
@@ -1,5 +0,0 @@
1
- const noop = () => void 0;
2
- export {
3
- noop
4
- };
5
- //# sourceMappingURL=noop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"noop.js","sources":["../../../../../packages/react-utils/src/referentiallyStable/noop.ts"],"sourcesContent":["export const noop = () => undefined\n"],"names":[],"mappings":"AAAO,MAAM,OAAO,MAAM;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const returnFalse = () => false;
4
- exports.returnFalse = returnFalse;
5
- //# sourceMappingURL=returnFalse.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"returnFalse.cjs","sources":["../../../../../packages/react-utils/src/referentiallyStable/returnFalse.ts"],"sourcesContent":["export const returnFalse = () => false\n"],"names":[],"mappings":";;AAAO,MAAM,cAAc,MAAM;;"}
@@ -1,5 +0,0 @@
1
- const returnFalse = () => false;
2
- export {
3
- returnFalse
4
- };
5
- //# sourceMappingURL=returnFalse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"returnFalse.js","sources":["../../../../../packages/react-utils/src/referentiallyStable/returnFalse.ts"],"sourcesContent":["export const returnFalse = () => false\n"],"names":[],"mappings":"AAAO,MAAM,cAAc,MAAM;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const returnTrue = () => true;
4
- exports.returnTrue = returnTrue;
5
- //# sourceMappingURL=returnTrue.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"returnTrue.cjs","sources":["../../../../../packages/react-utils/src/referentiallyStable/returnTrue.ts"],"sourcesContent":["export const returnTrue = () => true\n"],"names":[],"mappings":";;AAAO,MAAM,aAAa,MAAM;;"}
@@ -1,5 +0,0 @@
1
- const returnTrue = () => true;
2
- export {
3
- returnTrue
4
- };
5
- //# sourceMappingURL=returnTrue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"returnTrue.js","sources":["../../../../../packages/react-utils/src/referentiallyStable/returnTrue.ts"],"sourcesContent":["export const returnTrue = () => true\n"],"names":[],"mappings":"AAAO,MAAM,aAAa,MAAM;"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const React = require("react");
4
- const useReferentiallyStableCallback = (callback) => {
5
- const ref = React.useRef(callback);
6
- ref.current = callback;
7
- return React.useCallback((...args) => {
8
- return ref.current(...args);
9
- }, []);
10
- };
11
- exports.useReferentiallyStableCallback = useReferentiallyStableCallback;
12
- //# sourceMappingURL=useReferentiallyStableCallback.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useReferentiallyStableCallback.cjs","sources":["../../../../../packages/react-utils/src/referentiallyStable/useReferentiallyStableCallback.ts"],"sourcesContent":["import { useCallback, useRef } from 'react'\n\nexport type NoConstructor<T extends Function> =\n\tT extends new (...args: unknown[]) => unknown\n\t\t? never\n\t\t: T\n// TODO: Should be possible to remove when React.useEvent() lands\nexport const useReferentiallyStableCallback = <T extends Function>(callback: NoConstructor<T>): T => {\n\tconst ref = useRef(callback)\n\tref.current = callback\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\treturn useCallback<T>(((...args: any[]) => {\n\t\treturn ref.current(...args)\n\t}) as unknown as T, [])\n}\n"],"names":["useRef","useCallback"],"mappings":";;;AAOa,MAAA,iCAAiC,CAAqB,aAAkC;AAC9F,QAAA,MAAMA,aAAO,QAAQ;AAC3B,MAAI,UAAU;AAEP,SAAAC,MAAA,YAAgB,IAAI,SAAgB;AACnC,WAAA,IAAI,QAAQ,GAAG,IAAI;AAAA,EAC3B,GAAoB,EAAE;AACvB;;"}
@@ -1,12 +0,0 @@
1
- import { useRef, useCallback } from "react";
2
- const useReferentiallyStableCallback = (callback) => {
3
- const ref = useRef(callback);
4
- ref.current = callback;
5
- return useCallback((...args) => {
6
- return ref.current(...args);
7
- }, []);
8
- };
9
- export {
10
- useReferentiallyStableCallback
11
- };
12
- //# sourceMappingURL=useReferentiallyStableCallback.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useReferentiallyStableCallback.js","sources":["../../../../../packages/react-utils/src/referentiallyStable/useReferentiallyStableCallback.ts"],"sourcesContent":["import { useCallback, useRef } from 'react'\n\nexport type NoConstructor<T extends Function> =\n\tT extends new (...args: unknown[]) => unknown\n\t\t? never\n\t\t: T\n// TODO: Should be possible to remove when React.useEvent() lands\nexport const useReferentiallyStableCallback = <T extends Function>(callback: NoConstructor<T>): T => {\n\tconst ref = useRef(callback)\n\tref.current = callback\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\treturn useCallback<T>(((...args: any[]) => {\n\t\treturn ref.current(...args)\n\t}) as unknown as T, [])\n}\n"],"names":[],"mappings":";AAOa,MAAA,iCAAiC,CAAqB,aAAkC;AAC9F,QAAA,MAAM,OAAO,QAAQ;AAC3B,MAAI,UAAU;AAEP,SAAA,YAAgB,IAAI,SAAgB;AACnC,WAAA,IAAI,QAAQ,GAAG,IAAI;AAAA,EAC3B,GAAoB,EAAE;AACvB;"}
@@ -1,3 +0,0 @@
1
- import type { Context, Provider } from 'react';
2
- export declare function createContext<T>(name: string, initialValue: T): [Context<T>, () => T, Provider<T>];
3
- //# sourceMappingURL=createContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createContext.d.ts","sourceRoot":"","sources":["../../../src/context/createContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG9C,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAKlG"}
@@ -1,3 +0,0 @@
1
- import type { Context, Provider } from 'react';
2
- export declare function createRequiredContext<T>(displayName: string): [Context<T>, () => T, Provider<T>];
3
- //# sourceMappingURL=createRequiredContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createRequiredContext.d.ts","sourceRoot":"","sources":["../../../src/context/createRequiredContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAK9C,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAehG"}
@@ -1,3 +0,0 @@
1
- export * from './createRequiredContext';
2
- export * from './createContext';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { ScopedConsoleContextType } from './Types';
2
- export declare function noopLog(...parameters: any[]): void;
3
- export declare function noopLogged<T>(message: string, value: T): T;
4
- export declare const noopScopedConsole: ScopedConsoleContextType;
5
- export declare function isNoopScopedConsole(value: unknown): boolean;
6
- //# sourceMappingURL=Constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/debug-context/Constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAEvD,wBAAgB,OAAO,CAAC,GAAG,UAAU,EAAE,GAAG,EAAE,QAAK;AAEjD,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAE1D;AAED,eAAO,MAAM,iBAAiB,EAAE,wBAS9B,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE3D"}
@@ -1,15 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { ScopedConsoleContextType } from './Types';
3
- export declare const ScopedConsoleContext: import("react").Context<ScopedConsoleContextType>;
4
- export declare const useScopedConsoleRef: (prefix: string, override?: boolean) => import("react").MutableRefObject<ScopedConsoleContextType>;
5
- export type DebugChildrenProps = {
6
- active?: true;
7
- children: ReactNode;
8
- id: string;
9
- } | {
10
- active?: false;
11
- children: ReactNode;
12
- id?: string;
13
- };
14
- export declare const DebugChildren: import("react").NamedExoticComponent<DebugChildrenProps>;
15
- //# sourceMappingURL=Context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/debug-context/Context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoD,MAAM,OAAO,CAAA;AAEnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAmClD,eAAO,MAAM,oBAAoB,mDAAiD,CAAA;AAOlF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,EAAE,WAAW,OAAO,+DAkBrE,CAAA;AAED,MAAM,MAAM,kBAAkB,GAC3B;IAAE,MAAM,CAAC,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvD,eAAO,MAAM,aAAa,0DAYxB,CAAA"}
@@ -1,13 +0,0 @@
1
- export type DebugMethod = (...parameters: any[]) => void;
2
- export type ResultDebuggedMethod = <T>(message: string, value: T) => T;
3
- export type ScopedConsoleContextType = {
4
- log: DebugMethod;
5
- logged: ResultDebuggedMethod;
6
- warn: DebugMethod;
7
- warned: ResultDebuggedMethod;
8
- error: DebugMethod;
9
- errored: ResultDebuggedMethod;
10
- trace: DebugMethod;
11
- traced: ResultDebuggedMethod;
12
- };
13
- //# sourceMappingURL=Types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../src/debug-context/Types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;AACxD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,CAAA;AAEtE,MAAM,MAAM,wBAAwB,GAAG;IACtC,GAAG,EAAE,WAAW,CAAA;IAChB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,KAAK,EAAE,WAAW,CAAA;IAClB,OAAO,EAAE,oBAAoB,CAAA;IAC7B,KAAK,EAAE,WAAW,CAAA;IAClB,MAAM,EAAE,oBAAoB,CAAA;CAC5B,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './Constants';
2
- export * from './Context';
3
- export * from './Types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/debug-context/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
@@ -1,25 +0,0 @@
1
- export * from './unwrapRefValue';
2
- export * from './useAbortController';
3
- export * from './useArrayMapMemo';
4
- export * from './useAutoHeightTextArea';
5
- export * from './useChildrenAsLabel';
6
- export * from './useComposeRef';
7
- export * from './useConstantLengthInvariant';
8
- export * from './useConstantValueInvariant';
9
- export * from './useDebounce';
10
- export * from './useDebounceCallback';
11
- export * from './useDocumentTitle';
12
- export * from './useExpectSameValueReference';
13
- export * from './useForceRender';
14
- export * from './useId';
15
- export * from './useIsMounted';
16
- export * from './useObjectMemo';
17
- export * from './useOnElementClickOutsideCallback';
18
- export * from './useOnElementMouseEnterDelayedCallback';
19
- export * from './useOnElementResize';
20
- export * from './useOnWindowResize';
21
- export * from './usePreviousValue';
22
- export * from './useStoredState';
23
- export * from './useUpdatedRef';
24
- export * from './useWindowSize';
25
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oCAAoC,CAAA;AAClD,cAAc,yCAAyC,CAAA;AACvD,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA"}
@@ -1,9 +0,0 @@
1
- import { RefObject } from 'react';
2
- export type RefObjectOrElement<T> = T | RefObject<T>;
3
- /**
4
- * Unwraps a ref object or returns the value if it is not a ref object.
5
- * @param value - Value to unwrap
6
- * @returns Unwrapped value
7
- */
8
- export declare function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null;
9
- //# sourceMappingURL=unwrapRefValue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unwrapRefValue.d.ts","sourceRoot":"","sources":["../../../src/hooks/unwrapRefValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;AAEpD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAMxE"}