@semcore/core 17.0.0-prerelease.19 → 17.0.0-prerelease.20-prerelease.20

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 (355) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/lib/LastInteractionType.js +36 -22
  3. package/lib/LastInteractionType.js.map +1 -1
  4. package/lib/LastInteractionType.mjs +33 -19
  5. package/lib/LastInteractionType.mjs.map +1 -1
  6. package/lib/core-types/Component.js +41 -25
  7. package/lib/core-types/Component.js.map +1 -1
  8. package/lib/core-types/Component.mjs +38 -18
  9. package/lib/core-types/Component.mjs.map +1 -1
  10. package/lib/core-types/symbols.js +9 -9
  11. package/lib/core-types/symbols.js.map +1 -1
  12. package/lib/core-types/symbols.mjs +9 -9
  13. package/lib/core-types/symbols.mjs.map +1 -1
  14. package/lib/coreFactory.js +205 -143
  15. package/lib/coreFactory.js.map +1 -1
  16. package/lib/coreFactory.mjs +164 -118
  17. package/lib/coreFactory.mjs.map +1 -1
  18. package/lib/decorators/propsObserver.js +64 -36
  19. package/lib/decorators/propsObserver.js.map +1 -1
  20. package/lib/decorators/propsObserver.mjs +61 -33
  21. package/lib/decorators/propsObserver.mjs.map +1 -1
  22. package/lib/decorators/reactive.js +17 -17
  23. package/lib/decorators/reactive.js.map +1 -1
  24. package/lib/decorators/reactive.mjs +15 -15
  25. package/lib/decorators/reactive.mjs.map +1 -1
  26. package/lib/enhancement/Children.js +59 -51
  27. package/lib/enhancement/Children.js.map +1 -1
  28. package/lib/enhancement/Children.mjs +41 -47
  29. package/lib/enhancement/Children.mjs.map +1 -1
  30. package/lib/enhancement/Root.js +37 -36
  31. package/lib/enhancement/Root.js.map +1 -1
  32. package/lib/enhancement/Root.mjs +18 -28
  33. package/lib/enhancement/Root.mjs.map +1 -1
  34. package/lib/enhancement/dataName.js +8 -7
  35. package/lib/enhancement/dataName.js.map +1 -1
  36. package/lib/enhancement/dataName.mjs +5 -5
  37. package/lib/enhancement/dataName.mjs.map +1 -1
  38. package/lib/enhancement/enhance.js +9 -6
  39. package/lib/enhancement/enhance.js.map +1 -1
  40. package/lib/enhancement/enhance.mjs +7 -5
  41. package/lib/enhancement/enhance.mjs.map +1 -1
  42. package/lib/enhancement/functionDefaultProps.js +6 -6
  43. package/lib/enhancement/functionDefaultProps.js.map +1 -1
  44. package/lib/enhancement/functionDefaultProps.mjs +4 -4
  45. package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
  46. package/lib/enhancement/i18n.js +13 -13
  47. package/lib/enhancement/i18n.js.map +1 -1
  48. package/lib/enhancement/i18n.mjs +9 -10
  49. package/lib/enhancement/i18n.mjs.map +1 -1
  50. package/lib/enhancement/inheritedName.js +8 -7
  51. package/lib/enhancement/inheritedName.js.map +1 -1
  52. package/lib/enhancement/inheritedName.mjs +5 -5
  53. package/lib/enhancement/inheritedName.mjs.map +1 -1
  54. package/lib/enhancement/staticChildren.js +56 -47
  55. package/lib/enhancement/staticChildren.js.map +1 -1
  56. package/lib/enhancement/staticChildren.mjs +48 -43
  57. package/lib/enhancement/staticChildren.mjs.map +1 -1
  58. package/lib/enhancement/style.js +27 -29
  59. package/lib/enhancement/style.js.map +1 -1
  60. package/lib/enhancement/style.mjs +20 -26
  61. package/lib/enhancement/style.mjs.map +1 -1
  62. package/lib/enhancement/uncontrolledProps.js +65 -46
  63. package/lib/enhancement/uncontrolledProps.js.map +1 -1
  64. package/lib/enhancement/uncontrolledProps.mjs +52 -43
  65. package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
  66. package/lib/esm/LastInteractionType.mjs +33 -19
  67. package/lib/esm/core-types/Component.mjs +38 -18
  68. package/lib/esm/core-types/symbols.mjs +9 -9
  69. package/lib/esm/coreFactory.mjs +164 -118
  70. package/lib/esm/enhancement/Children.mjs +41 -47
  71. package/lib/esm/enhancement/Root.mjs +18 -28
  72. package/lib/esm/enhancement/dataName.mjs +5 -5
  73. package/lib/esm/enhancement/enhance.mjs +7 -5
  74. package/lib/esm/enhancement/functionDefaultProps.mjs +4 -4
  75. package/lib/esm/enhancement/i18n.mjs +9 -10
  76. package/lib/esm/enhancement/inheritedName.mjs +5 -5
  77. package/lib/esm/enhancement/staticChildren.mjs +48 -43
  78. package/lib/esm/enhancement/style.mjs +20 -26
  79. package/lib/esm/enhancement/uncontrolledProps.mjs +52 -43
  80. package/lib/esm/register.mjs +20 -12
  81. package/lib/esm/styled/reshadow-core.mjs +111 -98
  82. package/lib/esm/styled/sstyled.mjs +41 -31
  83. package/lib/esm/utils/assignProps.mjs +36 -32
  84. package/lib/esm/utils/enhances/WithI18n.mjs +17 -15
  85. package/lib/esm/utils/enhances/i18nEnhance.mjs +61 -47
  86. package/lib/esm/utils/logger.mjs +21 -13
  87. package/lib/esm/utils/pick.mjs +4 -4
  88. package/lib/esm/utils/ref.mjs +43 -27
  89. package/lib/esm/utils/use/useEnhancedEffect.mjs +1 -1
  90. package/lib/index.js +17 -17
  91. package/lib/register.js +24 -17
  92. package/lib/register.js.map +1 -1
  93. package/lib/register.mjs +20 -12
  94. package/lib/register.mjs.map +1 -1
  95. package/lib/styled/index.js +4 -4
  96. package/lib/styled/reshadow-core.js +104 -102
  97. package/lib/styled/reshadow-core.js.map +1 -1
  98. package/lib/styled/reshadow-core.mjs +111 -98
  99. package/lib/styled/reshadow-core.mjs.map +1 -1
  100. package/lib/styled/sstyled.js +53 -31
  101. package/lib/styled/sstyled.js.map +1 -1
  102. package/lib/styled/sstyled.mjs +41 -31
  103. package/lib/styled/sstyled.mjs.map +1 -1
  104. package/lib/theme/processor.js +222 -150
  105. package/lib/theme/processor.js.map +1 -1
  106. package/lib/theme/processor.mjs +221 -148
  107. package/lib/theme/processor.mjs.map +1 -1
  108. package/lib/theme/themes/dark.js +2 -2
  109. package/lib/theme/themes/dark.js.map +1 -1
  110. package/lib/theme/themes/default.js +2 -2
  111. package/lib/theme/themes/default.js.map +1 -1
  112. package/lib/theme/themes/highlights-dark.js +2 -2
  113. package/lib/theme/themes/highlights-dark.js.map +1 -1
  114. package/lib/theme/themes/highlights-light.js +2 -2
  115. package/lib/theme/themes/highlights-light.js.map +1 -1
  116. package/lib/theme/themes/light.js +2 -2
  117. package/lib/theme/themes/light.js.map +1 -1
  118. package/lib/theme/utils.js +215 -140
  119. package/lib/theme/utils.js.map +1 -1
  120. package/lib/theme/utils.mjs +214 -135
  121. package/lib/theme/utils.mjs.map +1 -1
  122. package/lib/utils/CSSinJS.js +10 -8
  123. package/lib/utils/CSSinJS.js.map +1 -1
  124. package/lib/utils/CSSinJS.mjs +7 -6
  125. package/lib/utils/CSSinJS.mjs.map +1 -1
  126. package/lib/utils/ThemeProvider.js +51 -44
  127. package/lib/utils/ThemeProvider.js.map +1 -1
  128. package/lib/utils/ThemeProvider.mjs +47 -36
  129. package/lib/utils/ThemeProvider.mjs.map +1 -1
  130. package/lib/utils/addonText.js +7 -4
  131. package/lib/utils/addonText.js.map +1 -1
  132. package/lib/utils/addonText.mjs +5 -2
  133. package/lib/utils/addonText.mjs.map +1 -1
  134. package/lib/utils/addonTextChildren.js +21 -15
  135. package/lib/utils/addonTextChildren.js.map +1 -1
  136. package/lib/utils/addonTextChildren.mjs +13 -7
  137. package/lib/utils/addonTextChildren.mjs.map +1 -1
  138. package/lib/utils/ariaProps.js +5 -7
  139. package/lib/utils/ariaProps.js.map +1 -1
  140. package/lib/utils/ariaProps.mjs +5 -7
  141. package/lib/utils/ariaProps.mjs.map +1 -1
  142. package/lib/utils/assignProps.js +37 -33
  143. package/lib/utils/assignProps.js.map +1 -1
  144. package/lib/utils/assignProps.mjs +36 -32
  145. package/lib/utils/assignProps.mjs.map +1 -1
  146. package/lib/utils/canUseDOM.js +1 -1
  147. package/lib/utils/capitalizeFirstLetter.js +1 -1
  148. package/lib/utils/color.js +95 -72
  149. package/lib/utils/color.js.map +1 -1
  150. package/lib/utils/color.mjs +94 -71
  151. package/lib/utils/color.mjs.map +1 -1
  152. package/lib/utils/compose.js +12 -3
  153. package/lib/utils/compose.js.map +1 -1
  154. package/lib/utils/compose.mjs +11 -2
  155. package/lib/utils/compose.mjs.map +1 -1
  156. package/lib/utils/createUUID.js +5 -5
  157. package/lib/utils/createUUID.js.map +1 -1
  158. package/lib/utils/createUUID.mjs +4 -4
  159. package/lib/utils/createUUID.mjs.map +1 -1
  160. package/lib/utils/cssToIntDefault.js +4 -3
  161. package/lib/utils/cssToIntDefault.js.map +1 -1
  162. package/lib/utils/cssToIntDefault.mjs +3 -2
  163. package/lib/utils/cssToIntDefault.mjs.map +1 -1
  164. package/lib/utils/enhances/WithCSS.js +8 -10
  165. package/lib/utils/enhances/WithCSS.js.map +1 -1
  166. package/lib/utils/enhances/WithCSS.mjs +6 -7
  167. package/lib/utils/enhances/WithCSS.mjs.map +1 -1
  168. package/lib/utils/enhances/WithI18n.js +19 -19
  169. package/lib/utils/enhances/WithI18n.js.map +1 -1
  170. package/lib/utils/enhances/WithI18n.mjs +17 -15
  171. package/lib/utils/enhances/WithI18n.mjs.map +1 -1
  172. package/lib/utils/enhances/a11yEnhance.js +39 -34
  173. package/lib/utils/enhances/a11yEnhance.js.map +1 -1
  174. package/lib/utils/enhances/a11yEnhance.mjs +36 -32
  175. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
  176. package/lib/utils/enhances/animatedSizeEnhance.js +63 -55
  177. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
  178. package/lib/utils/enhances/animatedSizeEnhance.mjs +58 -50
  179. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
  180. package/lib/utils/enhances/contextEnhance.js +11 -12
  181. package/lib/utils/enhances/contextEnhance.js.map +1 -1
  182. package/lib/utils/enhances/contextEnhance.mjs +8 -9
  183. package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
  184. package/lib/utils/enhances/i18nEnhance.js +67 -51
  185. package/lib/utils/enhances/i18nEnhance.js.map +1 -1
  186. package/lib/utils/enhances/i18nEnhance.mjs +61 -47
  187. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
  188. package/lib/utils/enhances/resolveColorEnhance.js +10 -12
  189. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -1
  190. package/lib/utils/enhances/resolveColorEnhance.mjs +6 -8
  191. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
  192. package/lib/utils/eventEmitter.js +57 -30
  193. package/lib/utils/eventEmitter.js.map +1 -1
  194. package/lib/utils/eventEmitter.mjs +55 -26
  195. package/lib/utils/eventEmitter.mjs.map +1 -1
  196. package/lib/utils/findComponent.js +42 -35
  197. package/lib/utils/findComponent.js.map +1 -1
  198. package/lib/utils/findComponent.mjs +33 -26
  199. package/lib/utils/findComponent.mjs.map +1 -1
  200. package/lib/utils/fire.js +13 -7
  201. package/lib/utils/fire.js.map +1 -1
  202. package/lib/utils/fire.mjs +11 -5
  203. package/lib/utils/fire.mjs.map +1 -1
  204. package/lib/utils/focus-lock/focusBorders.js +32 -28
  205. package/lib/utils/focus-lock/focusBorders.js.map +1 -1
  206. package/lib/utils/focus-lock/focusBorders.mjs +32 -26
  207. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
  208. package/lib/utils/focus-lock/getFocusableIn.js +6 -4
  209. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -1
  210. package/lib/utils/focus-lock/getFocusableIn.mjs +6 -3
  211. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
  212. package/lib/utils/focus-lock/isFocusInside.js +6 -5
  213. package/lib/utils/focus-lock/isFocusInside.js.map +1 -1
  214. package/lib/utils/focus-lock/isFocusInside.mjs +6 -4
  215. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
  216. package/lib/utils/focus-lock/isFocusable.js +12 -9
  217. package/lib/utils/focus-lock/isFocusable.js.map +1 -1
  218. package/lib/utils/focus-lock/isFocusable.mjs +11 -8
  219. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
  220. package/lib/utils/focus-lock/setFocus.js +27 -21
  221. package/lib/utils/focus-lock/setFocus.js.map +1 -1
  222. package/lib/utils/focus-lock/setFocus.mjs +25 -19
  223. package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
  224. package/lib/utils/getAccessibleName.js +22 -10
  225. package/lib/utils/getAccessibleName.js.map +1 -1
  226. package/lib/utils/getAccessibleName.mjs +21 -10
  227. package/lib/utils/getAccessibleName.mjs.map +1 -1
  228. package/lib/utils/getDisplayName.js +1 -1
  229. package/lib/utils/getEventTarget.js +32 -13
  230. package/lib/utils/getEventTarget.js.map +1 -1
  231. package/lib/utils/getEventTarget.mjs +31 -12
  232. package/lib/utils/getEventTarget.mjs.map +1 -1
  233. package/lib/utils/getOriginChildren.js +4 -4
  234. package/lib/utils/getOriginChildren.js.map +1 -1
  235. package/lib/utils/getRandomInt.js +1 -1
  236. package/lib/utils/getValue.js +6 -4
  237. package/lib/utils/getValue.js.map +1 -1
  238. package/lib/utils/getValue.mjs +5 -3
  239. package/lib/utils/getValue.mjs.map +1 -1
  240. package/lib/utils/hasLabels.js +27 -16
  241. package/lib/utils/hasLabels.js.map +1 -1
  242. package/lib/utils/hasLabels.mjs +24 -14
  243. package/lib/utils/hasLabels.mjs.map +1 -1
  244. package/lib/utils/hasParent.js +2 -3
  245. package/lib/utils/hasParent.js.map +1 -1
  246. package/lib/utils/hasParent.mjs +3 -2
  247. package/lib/utils/hasParent.mjs.map +1 -1
  248. package/lib/utils/ifChildren.js +4 -6
  249. package/lib/utils/ifChildren.js.map +1 -1
  250. package/lib/utils/ifChildren.mjs +2 -4
  251. package/lib/utils/ifChildren.mjs.map +1 -1
  252. package/lib/utils/injectStyle.js +13 -11
  253. package/lib/utils/injectStyle.js.map +1 -1
  254. package/lib/utils/injectStyle.mjs +10 -9
  255. package/lib/utils/injectStyle.mjs.map +1 -1
  256. package/lib/utils/inputProps.js +5 -5
  257. package/lib/utils/inputProps.js.map +1 -1
  258. package/lib/utils/inputProps.mjs +4 -4
  259. package/lib/utils/inputProps.mjs.map +1 -1
  260. package/lib/utils/isInteractiveElement.js +9 -7
  261. package/lib/utils/isInteractiveElement.js.map +1 -1
  262. package/lib/utils/isInteractiveElement.mjs +9 -7
  263. package/lib/utils/isInteractiveElement.mjs.map +1 -1
  264. package/lib/utils/isNode.js +5 -4
  265. package/lib/utils/isNode.js.map +1 -1
  266. package/lib/utils/isNode.mjs +2 -1
  267. package/lib/utils/isNode.mjs.map +1 -1
  268. package/lib/utils/isPromise.js +1 -1
  269. package/lib/utils/isRetina.js +2 -7
  270. package/lib/utils/isRetina.js.map +1 -1
  271. package/lib/utils/isRetina.mjs +1 -6
  272. package/lib/utils/isRetina.mjs.map +1 -1
  273. package/lib/utils/logger.js +25 -18
  274. package/lib/utils/logger.js.map +1 -1
  275. package/lib/utils/logger.mjs +21 -13
  276. package/lib/utils/logger.mjs.map +1 -1
  277. package/lib/utils/numericChecker.js +18 -11
  278. package/lib/utils/numericChecker.js.map +1 -1
  279. package/lib/utils/numericChecker.mjs +17 -10
  280. package/lib/utils/numericChecker.mjs.map +1 -1
  281. package/lib/utils/ownerDocument.js +2 -2
  282. package/lib/utils/ownerDocument.js.map +1 -1
  283. package/lib/utils/ownerDocument.mjs +1 -1
  284. package/lib/utils/ownerDocument.mjs.map +1 -1
  285. package/lib/utils/pick.js +5 -5
  286. package/lib/utils/pick.js.map +1 -1
  287. package/lib/utils/pick.mjs +4 -4
  288. package/lib/utils/pick.mjs.map +1 -1
  289. package/lib/utils/propsForElement.js +12 -10
  290. package/lib/utils/propsForElement.js.map +1 -1
  291. package/lib/utils/propsForElement.mjs +10 -8
  292. package/lib/utils/propsForElement.mjs.map +1 -1
  293. package/lib/utils/rafTrottle.js +14 -9
  294. package/lib/utils/rafTrottle.js.map +1 -1
  295. package/lib/utils/rafTrottle.mjs +12 -7
  296. package/lib/utils/rafTrottle.mjs.map +1 -1
  297. package/lib/utils/reactToText.js +8 -5
  298. package/lib/utils/reactToText.js.map +1 -1
  299. package/lib/utils/reactToText.mjs +6 -3
  300. package/lib/utils/reactToText.mjs.map +1 -1
  301. package/lib/utils/ref.js +47 -29
  302. package/lib/utils/ref.js.map +1 -1
  303. package/lib/utils/ref.mjs +43 -27
  304. package/lib/utils/ref.mjs.map +1 -1
  305. package/lib/utils/setRef.js +2 -2
  306. package/lib/utils/setRef.js.map +1 -1
  307. package/lib/utils/syncScroll.js +24 -24
  308. package/lib/utils/syncScroll.js.map +1 -1
  309. package/lib/utils/syncScroll.mjs +21 -21
  310. package/lib/utils/syncScroll.mjs.map +1 -1
  311. package/lib/utils/uncontroll.js +18 -8
  312. package/lib/utils/uncontroll.js.map +1 -1
  313. package/lib/utils/uncontroll.mjs +17 -8
  314. package/lib/utils/uncontroll.mjs.map +1 -1
  315. package/lib/utils/uniqueID.js +27 -22
  316. package/lib/utils/uniqueID.js.map +1 -1
  317. package/lib/utils/uniqueID.mjs +25 -18
  318. package/lib/utils/uniqueID.mjs.map +1 -1
  319. package/lib/utils/use/useColorResolver.js +21 -20
  320. package/lib/utils/use/useColorResolver.js.map +1 -1
  321. package/lib/utils/use/useColorResolver.mjs +18 -16
  322. package/lib/utils/use/useColorResolver.mjs.map +1 -1
  323. package/lib/utils/use/useEnhancedEffect.js +4 -4
  324. package/lib/utils/use/useEnhancedEffect.js.map +1 -1
  325. package/lib/utils/use/useEnhancedEffect.mjs +1 -1
  326. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
  327. package/lib/utils/use/useEventCallback.js +10 -5
  328. package/lib/utils/use/useEventCallback.js.map +1 -1
  329. package/lib/utils/use/useEventCallback.mjs +8 -3
  330. package/lib/utils/use/useEventCallback.mjs.map +1 -1
  331. package/lib/utils/use/useEventListener.js +15 -11
  332. package/lib/utils/use/useEventListener.js.map +1 -1
  333. package/lib/utils/use/useEventListener.mjs +11 -7
  334. package/lib/utils/use/useEventListener.mjs.map +1 -1
  335. package/lib/utils/use/useFocusLock.js +94 -80
  336. package/lib/utils/use/useFocusLock.js.map +1 -1
  337. package/lib/utils/use/useFocusLock.mjs +88 -71
  338. package/lib/utils/use/useFocusLock.mjs.map +1 -1
  339. package/lib/utils/use/usePreventScroll.js +28 -26
  340. package/lib/utils/use/usePreventScroll.js.map +1 -1
  341. package/lib/utils/use/usePreventScroll.mjs +23 -21
  342. package/lib/utils/use/usePreventScroll.mjs.map +1 -1
  343. package/lib/utils/use/useScrollBarWidth.js +14 -8
  344. package/lib/utils/use/useScrollBarWidth.js.map +1 -1
  345. package/lib/utils/use/useScrollBarWidth.mjs +13 -8
  346. package/lib/utils/use/useScrollBarWidth.mjs.map +1 -1
  347. package/lib/utils/useCssVariable.js +37 -32
  348. package/lib/utils/useCssVariable.js.map +1 -1
  349. package/lib/utils/useCssVariable.mjs +34 -27
  350. package/lib/utils/useCssVariable.mjs.map +1 -1
  351. package/lib/utils/zIndexStacking.js +24 -28
  352. package/lib/utils/zIndexStacking.js.map +1 -1
  353. package/lib/utils/zIndexStacking.mjs +22 -23
  354. package/lib/utils/zIndexStacking.mjs.map +1 -1
  355. package/package.json +1 -1
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports["default"] = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
11
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
12
  var _react = _interopRequireDefault(require("react"));
9
13
  function contextEnhance(context, setOnProp) {
10
- return props => {
11
- const {
12
- ...other
13
- } = props;
14
- const value = _react.default.useContext(context);
15
- return {
16
- ...other,
17
- [setOnProp]: value
18
- };
14
+ return function (props) {
15
+ var other = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(props), props));
16
+ var value = _react["default"].useContext(context);
17
+ return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, other), {}, (0, _defineProperty2["default"])({}, setOnProp, value));
19
18
  };
20
19
  }
21
- var _default = exports.default = contextEnhance;
20
+ var _default = exports["default"] = contextEnhance;
22
21
  //# sourceMappingURL=contextEnhance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contextEnhance.js","names":["_react","_interopRequireDefault","require","contextEnhance","context","setOnProp","props","other","value","React","useContext","_default","exports","default"],"sources":["../../../src/utils/enhances/contextEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nfunction contextEnhance(context: React.Context<any>, setOnProp: string) {\n return (props: any) => {\n const { ...other } = props;\n const value = React.useContext(context);\n return {\n ...other,\n [setOnProp]: value,\n };\n };\n}\n\nexport default contextEnhance;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,SAASC,cAAcA,CAACC,OAA2B,EAAEC,SAAiB,EAAE;EACtE,OAAQC,KAAU,IAAK;IACrB,MAAM;MAAE,GAAGC;IAAM,CAAC,GAAGD,KAAK;IAC1B,MAAME,KAAK,GAAGC,cAAK,CAACC,UAAU,CAACN,OAAO,CAAC;IACvC,OAAO;MACL,GAAGG,KAAK;MACR,CAACF,SAAS,GAAGG;IACf,CAAC;EACH,CAAC;AACH;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcV,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"contextEnhance.js","names":["_react","_interopRequireDefault","require","contextEnhance","context","setOnProp","props","other","_extends2","_objectDestructuringEmpty2","value","React","useContext","_objectSpread3","_defineProperty2","_default","exports"],"sources":["../../../src/utils/enhances/contextEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nfunction contextEnhance(context: React.Context<any>, setOnProp: string) {\n return (props: any) => {\n const { ...other } = props;\n const value = React.useContext(context);\n return {\n ...other,\n [setOnProp]: value,\n };\n };\n}\n\nexport default contextEnhance;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,SAASC,cAAcA,CAACC,OAA2B,EAAEC,SAAiB,EAAE;EACtE,OAAO,UAACC,KAAU,EAAK;IACrB,IAAWC,KAAK,OAAAC,SAAA,sBAAAC,0BAAA,aAAKH,KAAK,GAALA,KAAK;IAC1B,IAAMI,KAAK,GAAGC,iBAAK,CAACC,UAAU,CAACR,OAAO,CAAC;IACvC,WAAAS,cAAA,iBAAAA,cAAA,iBACKN,KAAK,WAAAO,gBAAA,iBACPT,SAAS,EAAGK,KAAK;EAEtB,CAAC;AACH;AAAC,IAAAK,QAAA,GAAAC,OAAA,cAEcb,cAAc","ignoreList":[]}
@@ -1,14 +1,13 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
4
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
5
  import React from 'react';
2
6
  function contextEnhance(context, setOnProp) {
3
- return props => {
4
- const {
5
- ...other
6
- } = props;
7
- const value = React.useContext(context);
8
- return {
9
- ...other,
10
- [setOnProp]: value
11
- };
7
+ return function (props) {
8
+ var other = _extends({}, (_objectDestructuringEmpty(props), props));
9
+ var value = React.useContext(context);
10
+ return _objectSpread(_objectSpread({}, other), {}, _defineProperty({}, setOnProp, value));
12
11
  };
13
12
  }
14
13
  export default contextEnhance;
@@ -1 +1 @@
1
- {"version":3,"file":"contextEnhance.mjs","names":["React","contextEnhance","context","setOnProp","props","other","value","useContext"],"sources":["../../../src/utils/enhances/contextEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nfunction contextEnhance(context: React.Context<any>, setOnProp: string) {\n return (props: any) => {\n const { ...other } = props;\n const value = React.useContext(context);\n return {\n ...other,\n [setOnProp]: value,\n };\n };\n}\n\nexport default contextEnhance;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAcA,CAACC,OAA2B,EAAEC,SAAiB,EAAE;EACtE,OAAQC,KAAU,IAAK;IACrB,MAAM;MAAE,GAAGC;IAAM,CAAC,GAAGD,KAAK;IAC1B,MAAME,KAAK,GAAGN,KAAK,CAACO,UAAU,CAACL,OAAO,CAAC;IACvC,OAAO;MACL,GAAGG,KAAK;MACR,CAACF,SAAS,GAAGG;IACf,CAAC;EACH,CAAC;AACH;AAEA,eAAeL,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"contextEnhance.mjs","names":["React","contextEnhance","context","setOnProp","props","other","_extends","_objectDestructuringEmpty","value","useContext","_objectSpread","_defineProperty"],"sources":["../../../src/utils/enhances/contextEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nfunction contextEnhance(context: React.Context<any>, setOnProp: string) {\n return (props: any) => {\n const { ...other } = props;\n const value = React.useContext(context);\n return {\n ...other,\n [setOnProp]: value,\n };\n };\n}\n\nexport default contextEnhance;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAcA,CAACC,OAA2B,EAAEC,SAAiB,EAAE;EACtE,OAAO,UAACC,KAAU,EAAK;IACrB,IAAWC,KAAK,GAAAC,QAAA,MAAAC,yBAAA,CAAKH,KAAK,GAALA,KAAK;IAC1B,IAAMI,KAAK,GAAGR,KAAK,CAACS,UAAU,CAACP,OAAO,CAAC;IACvC,OAAAQ,aAAA,CAAAA,aAAA,KACKL,KAAK,OAAAM,eAAA,KACPR,SAAS,EAAGK,KAAK;EAEtB,CAAC;AACH;AAEA,eAAeP,cAAc","ignoreList":[]}
@@ -1,83 +1,99 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.useAsyncI18nMessages = exports.default = void 0;
7
+ exports.useAsyncI18nMessages = exports["default"] = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
+ var _regenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/regenerator"));
11
+ var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
14
  var _react = _interopRequireDefault(require("react"));
9
15
  var _WithI18n = require("./WithI18n");
10
- const useAsyncI18nMessages = (primaryContainer, locale, fallbackContainer) => {
11
- const container = _react.default.useMemo(() => {
16
+ var useAsyncI18nMessages = exports.useAsyncI18nMessages = function useAsyncI18nMessages(primaryContainer, locale, fallbackContainer) {
17
+ var _store$locale;
18
+ var container = _react["default"].useMemo(function () {
12
19
  if (!fallbackContainer) return primaryContainer;
13
20
  if (!primaryContainer) return fallbackContainer;
14
21
  if (primaryContainer === fallbackContainer) return primaryContainer;
15
- const container = {};
16
- for (const locale in primaryContainer) {
17
- if (typeof primaryContainer[locale] === 'function' || typeof fallbackContainer[locale] === 'function') {
18
- container[locale] = async () => {
19
- const [primary, fallback] = await Promise.all([primaryContainer[locale], fallbackContainer[locale]]);
20
- return {
21
- ...primary,
22
- ...fallback
23
- };
24
- };
22
+ var container = {};
23
+ var _loop = function _loop(_locale) {
24
+ if (typeof primaryContainer[_locale] === 'function' || typeof fallbackContainer[_locale] === 'function') {
25
+ container[_locale] = /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee() {
26
+ var _yield$Promise$all, _yield$Promise$all2, primary, fallback;
27
+ return (0, _regenerator2["default"])().w(function (_context) {
28
+ while (1) switch (_context.n) {
29
+ case 0:
30
+ _context.n = 1;
31
+ return Promise.all([primaryContainer[_locale], fallbackContainer[_locale]]);
32
+ case 1:
33
+ _yield$Promise$all = _context.v;
34
+ _yield$Promise$all2 = (0, _slicedToArray2["default"])(_yield$Promise$all, 2);
35
+ primary = _yield$Promise$all2[0];
36
+ fallback = _yield$Promise$all2[1];
37
+ return _context.a(2, (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, primary), fallback));
38
+ }
39
+ }, _callee);
40
+ }));
25
41
  } else {
26
- container[locale] = {
27
- ...(primaryContainer[locale] ?? {}),
28
- ...(fallbackContainer[locale] ?? {})
29
- };
42
+ var _primaryContainer$_lo, _fallbackContainer$_l;
43
+ container[_locale] = (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, (_primaryContainer$_lo = primaryContainer[_locale]) !== null && _primaryContainer$_lo !== void 0 ? _primaryContainer$_lo : {}), (_fallbackContainer$_l = fallbackContainer[_locale]) !== null && _fallbackContainer$_l !== void 0 ? _fallbackContainer$_l : {});
30
44
  }
45
+ };
46
+ for (var _locale in primaryContainer) {
47
+ _loop(_locale);
31
48
  }
32
49
  return container;
33
50
  }, [primaryContainer, fallbackContainer]);
34
- const initStore = _react.default.useMemo(() => {
35
- const store = {};
36
- for (const locale in container) {
37
- if (typeof container[locale] === 'object') {
38
- store[locale] = container[locale];
51
+ var initStore = _react["default"].useMemo(function () {
52
+ var store = {};
53
+ for (var _locale2 in container) {
54
+ if ((0, _typeof2["default"])(container[_locale2]) === 'object') {
55
+ store[_locale2] = container[_locale2];
39
56
  }
40
57
  }
41
58
  return store;
42
59
  }, [container]);
43
- const [store, setStore] = _react.default.useState(initStore);
44
- const lastLoadedLocaleRef = _react.default.useRef(null);
60
+ var _React$useState = _react["default"].useState(initStore),
61
+ _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
62
+ store = _React$useState2[0],
63
+ setStore = _React$useState2[1];
64
+ var lastLoadedLocaleRef = _react["default"].useRef(null);
45
65
  if (store[locale]) lastLoadedLocaleRef.current = locale;
46
- const fallbackMessages = _react.default.useMemo(() => Object.values(store)[0], [store]);
47
- const loadingLocaleRef = _react.default.useRef(null);
48
- _react.default.useEffect(() => {
66
+ var fallbackMessages = _react["default"].useMemo(function () {
67
+ return Object.values(store)[0];
68
+ }, [store]);
69
+ var loadingLocaleRef = _react["default"].useRef(null);
70
+ _react["default"].useEffect(function () {
49
71
  loadingLocaleRef.current = locale;
50
- const asyncMessages = container[locale];
72
+ var asyncMessages = container[locale];
51
73
  if (typeof asyncMessages === 'function') {
52
- asyncMessages().then(module => {
74
+ asyncMessages().then(function (module) {
53
75
  if (loadingLocaleRef.current !== locale) return;
54
- let messages = module;
55
- if ('default' in module && typeof module.default === 'object') messages = module.default;
56
- setStore(store => ({
57
- ...store,
58
- [locale]: messages
59
- }));
60
- }).catch(err => {
76
+ var messages = module;
77
+ if ('default' in module && (0, _typeof2["default"])(module["default"]) === 'object') messages = module["default"];
78
+ setStore(function (store) {
79
+ return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, store), {}, (0, _defineProperty2["default"])({}, locale, messages));
80
+ });
81
+ })["catch"](function (err) {
61
82
  // eslint-disable-next-line no-console
62
83
  console.error(err);
63
84
  });
64
85
  }
65
86
  }, [container, locale]);
66
- return store[locale] ?? fallbackMessages;
87
+ return (_store$locale = store[locale]) !== null && _store$locale !== void 0 ? _store$locale : fallbackMessages;
67
88
  };
68
- exports.useAsyncI18nMessages = useAsyncI18nMessages;
69
- var _default = container => {
70
- return props => {
71
- const {
72
- i18n,
73
- locale
74
- } = props;
75
- const getI18nText = (0, _WithI18n.useI18n)(i18n, locale, container);
76
- return {
77
- ...props,
78
- getI18nText
79
- };
89
+ var _default = exports["default"] = function _default(container) {
90
+ return function (props) {
91
+ var i18n = props.i18n,
92
+ locale = props.locale;
93
+ var getI18nText = (0, _WithI18n.useI18n)(i18n, locale, container);
94
+ return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, props), {}, {
95
+ getI18nText: getI18nText
96
+ });
80
97
  };
81
98
  };
82
- exports.default = _default;
83
99
  //# sourceMappingURL=i18nEnhance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18nEnhance.js","names":["_react","_interopRequireDefault","require","_WithI18n","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","container","React","useMemo","primary","fallback","Promise","all","initStore","store","setStore","useState","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","default","catch","err","console","error","exports","_default","props","i18n","getI18nText","useI18n"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type LocaleKeys, useI18n } from './WithI18n';\n\nexport type WithI18nEnhanceProps = {\n /* Function for getting the required field from the translation dictionary */\n getI18nText?: (key?: string, variables?: {}) => any;\n /* Object with translations */\n i18n?: {\n [locale: string]: {\n [key: string]: string;\n };\n };\n /* Locale for translations */\n locale?: LocaleKeys;\n};\n\ntype Messages = { [messageId: string]: string };\ntype MessagesContainer = { [locale: string]: Messages | (() => Promise<Messages>) };\ntype MessagesStore = { [locale: string]: Messages };\nexport const useAsyncI18nMessages = (\n primaryContainer: MessagesContainer,\n locale: string,\n fallbackContainer?: MessagesContainer,\n) => {\n const container = React.useMemo(() => {\n if (!fallbackContainer) return primaryContainer;\n if (!primaryContainer) return fallbackContainer;\n if (primaryContainer === fallbackContainer) return primaryContainer;\n const container: MessagesContainer = {};\n for (const locale in primaryContainer) {\n if (\n typeof primaryContainer[locale] === 'function' ||\n typeof fallbackContainer[locale] === 'function'\n ) {\n container[locale] = async () => {\n const [primary, fallback] = await Promise.all([\n primaryContainer[locale],\n fallbackContainer[locale],\n ]);\n return { ...primary, ...fallback };\n };\n } else {\n container[locale] = {\n ...(primaryContainer[locale] ?? {}),\n ...(fallbackContainer[locale] ?? {}),\n };\n }\n }\n return container;\n }, [primaryContainer, fallbackContainer]);\n const initStore = React.useMemo(() => {\n const store: MessagesStore = {};\n for (const locale in container) {\n if (typeof container[locale] === 'object') {\n store[locale] = container[locale] as Messages;\n }\n }\n return store;\n }, [container]);\n const [store, setStore] = React.useState(initStore);\n const lastLoadedLocaleRef = React.useRef<string | null>(null);\n if (store[locale]) lastLoadedLocaleRef.current = locale;\n const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);\n\n const loadingLocaleRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n loadingLocaleRef.current = locale;\n const asyncMessages = container[locale];\n if (typeof asyncMessages === 'function') {\n asyncMessages()\n .then((module) => {\n if (loadingLocaleRef.current !== locale) return;\n let messages = module;\n if ('default' in module && typeof module.default === 'object') messages = module.default;\n setStore((store) => ({\n ...store,\n [locale]: messages,\n }));\n })\n\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [container, locale]);\n\n return store[locale] ?? fallbackMessages;\n};\nexport default (container?: MessagesContainer) => {\n return (props: any): { getI18nText: ReturnType<typeof useI18n> } => {\n const { i18n, locale } = props;\n const getI18nText = useI18n(i18n, locale, container);\n\n return { ...props, getI18nText };\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAkBO,MAAME,oBAAoB,GAAGA,CAClCC,gBAAmC,EACnCC,MAAc,EACdC,iBAAqC,KAClC;EACH,MAAMC,SAAS,GAAGC,cAAK,CAACC,OAAO,CAAC,MAAM;IACpC,IAAI,CAACH,iBAAiB,EAAE,OAAOF,gBAAgB;IAC/C,IAAI,CAACA,gBAAgB,EAAE,OAAOE,iBAAiB;IAC/C,IAAIF,gBAAgB,KAAKE,iBAAiB,EAAE,OAAOF,gBAAgB;IACnE,MAAMG,SAA4B,GAAG,CAAC,CAAC;IACvC,KAAK,MAAMF,MAAM,IAAID,gBAAgB,EAAE;MACrC,IACE,OAAOA,gBAAgB,CAACC,MAAM,CAAC,KAAK,UAAU,IAC9C,OAAOC,iBAAiB,CAACD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;EAClC,CAAC;AACH,CAAC;AAAAJ,OAAA,CAAAL,OAAA,GAAAM,QAAA","ignoreList":[]}
1
+ {"version":3,"file":"i18nEnhance.js","names":["_react","_interopRequireDefault","require","_WithI18n","useAsyncI18nMessages","exports","primaryContainer","locale","fallbackContainer","_store$locale","container","React","useMemo","_loop","_locale","_asyncToGenerator2","_regenerator2","m","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","w","_context","n","Promise","all","v","_slicedToArray2","a","_objectSpread3","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof2","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty2","err","console","error","_default","props","i18n","getI18nText","useI18n"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type LocaleKeys, useI18n } from './WithI18n';\n\nexport type WithI18nEnhanceProps = {\n /* Function for getting the required field from the translation dictionary */\n getI18nText?: (key?: string, variables?: {}) => any;\n /* Object with translations */\n i18n?: {\n [locale: string]: {\n [key: string]: string;\n };\n };\n /* Locale for translations */\n locale?: LocaleKeys;\n};\n\ntype Messages = { [messageId: string]: string };\ntype MessagesContainer = { [locale: string]: Messages | (() => Promise<Messages>) };\ntype MessagesStore = { [locale: string]: Messages };\nexport const useAsyncI18nMessages = (\n primaryContainer: MessagesContainer,\n locale: string,\n fallbackContainer?: MessagesContainer,\n) => {\n const container = React.useMemo(() => {\n if (!fallbackContainer) return primaryContainer;\n if (!primaryContainer) return fallbackContainer;\n if (primaryContainer === fallbackContainer) return primaryContainer;\n const container: MessagesContainer = {};\n for (const locale in primaryContainer) {\n if (\n typeof primaryContainer[locale] === 'function' ||\n typeof fallbackContainer[locale] === 'function'\n ) {\n container[locale] = async () => {\n const [primary, fallback] = await Promise.all([\n primaryContainer[locale],\n fallbackContainer[locale],\n ]);\n return { ...primary, ...fallback };\n };\n } else {\n container[locale] = {\n ...(primaryContainer[locale] ?? {}),\n ...(fallbackContainer[locale] ?? {}),\n };\n }\n }\n return container;\n }, [primaryContainer, fallbackContainer]);\n const initStore = React.useMemo(() => {\n const store: MessagesStore = {};\n for (const locale in container) {\n if (typeof container[locale] === 'object') {\n store[locale] = container[locale] as Messages;\n }\n }\n return store;\n }, [container]);\n const [store, setStore] = React.useState(initStore);\n const lastLoadedLocaleRef = React.useRef<string | null>(null);\n if (store[locale]) lastLoadedLocaleRef.current = locale;\n const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);\n\n const loadingLocaleRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n loadingLocaleRef.current = locale;\n const asyncMessages = container[locale];\n if (typeof asyncMessages === 'function') {\n asyncMessages()\n .then((module) => {\n if (loadingLocaleRef.current !== locale) return;\n let messages = module;\n if ('default' in module && typeof module.default === 'object') messages = module.default;\n setStore((store) => ({\n ...store,\n [locale]: messages,\n }));\n })\n\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [container, locale]);\n\n return store[locale] ?? fallbackMessages;\n};\nexport default (container?: MessagesContainer) => {\n return (props: any): { getI18nText: ReturnType<typeof useI18n> } => {\n const { i18n, locale } = props;\n const getI18nText = useI18n(i18n, locale, container);\n\n return { ...props, getI18nText };\n };\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAkBO,IAAME,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,SAAvBA,oBAAoBA,CAC/BE,gBAAmC,EACnCC,MAAc,EACdC,iBAAqC,EAClC;EAAA,IAAAC,aAAA;EACH,IAAMC,SAAS,GAAGC,iBAAK,CAACC,OAAO,CAAC,YAAM;IACpC,IAAI,CAACJ,iBAAiB,EAAE,OAAOF,gBAAgB;IAC/C,IAAI,CAACA,gBAAgB,EAAE,OAAOE,iBAAiB;IAC/C,IAAI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typeof";
3
+ import _regenerator from "@babel/runtime/helpers/esm/regenerator";
4
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
5
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
1
7
  import React from "react";
2
8
  import { useI18n } from "./WithI18n.mjs";
3
- const useAsyncI18nMessages = (primaryContainer, locale, fallbackContainer) => {
4
- const container = React.useMemo(() => {
9
+ var useAsyncI18nMessages = function useAsyncI18nMessages2(primaryContainer, locale, fallbackContainer) {
10
+ var _store$locale;
11
+ var container = React.useMemo(function() {
5
12
  if (!fallbackContainer) return primaryContainer;
6
13
  if (!primaryContainer) return fallbackContainer;
7
14
  if (primaryContainer === fallbackContainer) return primaryContainer;
8
- const container2 = {};
9
- for (const locale2 in primaryContainer) {
10
- if (typeof primaryContainer[locale2] === "function" || typeof fallbackContainer[locale2] === "function") {
11
- container2[locale2] = async () => {
12
- const [primary, fallback] = await Promise.all([primaryContainer[locale2], fallbackContainer[locale2]]);
13
- return {
14
- ...primary,
15
- ...fallback
16
- };
17
- };
15
+ var container2 = {};
16
+ var _loop = function _loop2(_locale2) {
17
+ if (typeof primaryContainer[_locale2] === "function" || typeof fallbackContainer[_locale2] === "function") {
18
+ container2[_locale2] = /* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee() {
19
+ var _yield$Promise$all, _yield$Promise$all2, primary, fallback;
20
+ return _regenerator().w(function(_context) {
21
+ while (1) switch (_context.n) {
22
+ case 0:
23
+ _context.n = 1;
24
+ return Promise.all([primaryContainer[_locale2], fallbackContainer[_locale2]]);
25
+ case 1:
26
+ _yield$Promise$all = _context.v;
27
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
28
+ primary = _yield$Promise$all2[0];
29
+ fallback = _yield$Promise$all2[1];
30
+ return _context.a(2, _objectSpread(_objectSpread({}, primary), fallback));
31
+ }
32
+ }, _callee);
33
+ }));
18
34
  } else {
19
- container2[locale2] = {
20
- ...primaryContainer[locale2] ?? {},
21
- ...fallbackContainer[locale2] ?? {}
22
- };
35
+ var _primaryContainer$_lo, _fallbackContainer$_l;
36
+ container2[_locale2] = _objectSpread(_objectSpread({}, (_primaryContainer$_lo = primaryContainer[_locale2]) !== null && _primaryContainer$_lo !== void 0 ? _primaryContainer$_lo : {}), (_fallbackContainer$_l = fallbackContainer[_locale2]) !== null && _fallbackContainer$_l !== void 0 ? _fallbackContainer$_l : {});
23
37
  }
38
+ };
39
+ for (var _locale in primaryContainer) {
40
+ _loop(_locale);
24
41
  }
25
42
  return container2;
26
43
  }, [primaryContainer, fallbackContainer]);
27
- const initStore = React.useMemo(() => {
28
- const store2 = {};
29
- for (const locale2 in container) {
30
- if (typeof container[locale2] === "object") {
31
- store2[locale2] = container[locale2];
44
+ var initStore = React.useMemo(function() {
45
+ var store2 = {};
46
+ for (var _locale2 in container) {
47
+ if (_typeof(container[_locale2]) === "object") {
48
+ store2[_locale2] = container[_locale2];
32
49
  }
33
50
  }
34
51
  return store2;
35
52
  }, [container]);
36
- const [store, setStore] = React.useState(initStore);
37
- const lastLoadedLocaleRef = React.useRef(null);
53
+ var _React$useState = React.useState(initStore), _React$useState2 = _slicedToArray(_React$useState, 2), store = _React$useState2[0], setStore = _React$useState2[1];
54
+ var lastLoadedLocaleRef = React.useRef(null);
38
55
  if (store[locale]) lastLoadedLocaleRef.current = locale;
39
- const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);
40
- const loadingLocaleRef = React.useRef(null);
41
- React.useEffect(() => {
56
+ var fallbackMessages = React.useMemo(function() {
57
+ return Object.values(store)[0];
58
+ }, [store]);
59
+ var loadingLocaleRef = React.useRef(null);
60
+ React.useEffect(function() {
42
61
  loadingLocaleRef.current = locale;
43
- const asyncMessages = container[locale];
62
+ var asyncMessages = container[locale];
44
63
  if (typeof asyncMessages === "function") {
45
- asyncMessages().then((module) => {
64
+ asyncMessages().then(function(module) {
46
65
  if (loadingLocaleRef.current !== locale) return;
47
- let messages = module;
48
- if ("default" in module && typeof module.default === "object") messages = module.default;
49
- setStore((store2) => ({
50
- ...store2,
51
- [locale]: messages
52
- }));
53
- }).catch((err) => {
66
+ var messages = module;
67
+ if ("default" in module && _typeof(module["default"]) === "object") messages = module["default"];
68
+ setStore(function(store2) {
69
+ return _objectSpread(_objectSpread({}, store2), {}, _defineProperty({}, locale, messages));
70
+ });
71
+ })["catch"](function(err) {
54
72
  console.error(err);
55
73
  });
56
74
  }
57
75
  }, [container, locale]);
58
- return store[locale] ?? fallbackMessages;
76
+ return (_store$locale = store[locale]) !== null && _store$locale !== void 0 ? _store$locale : fallbackMessages;
59
77
  };
60
- const i18nEnhance = (container) => {
61
- return (props) => {
62
- const {
63
- i18n,
64
- locale
65
- } = props;
66
- const getI18nText = useI18n(i18n, locale, container);
67
- return {
68
- ...props,
78
+ const i18nEnhance = (function(container) {
79
+ return function(props) {
80
+ var i18n = props.i18n, locale = props.locale;
81
+ var getI18nText = useI18n(i18n, locale, container);
82
+ return _objectSpread(_objectSpread({}, props), {}, {
69
83
  getI18nText
70
- };
84
+ });
71
85
  };
72
- };
86
+ });
73
87
  export {
74
88
  i18nEnhance as default,
75
89
  useAsyncI18nMessages
@@ -1 +1 @@
1
- {"version":3,"file":"i18nEnhance.mjs","names":["React","useI18n","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","container","useMemo","primary","fallback","Promise","all","initStore","store","setStore","useState","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","default","catch","err","console","error","props","i18n","getI18nText"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type LocaleKeys, useI18n } from './WithI18n';\n\nexport type WithI18nEnhanceProps = {\n /* Function for getting the required field from the translation dictionary */\n getI18nText?: (key?: string, variables?: {}) => any;\n /* Object with translations */\n i18n?: {\n [locale: string]: {\n [key: string]: string;\n };\n };\n /* Locale for translations */\n locale?: LocaleKeys;\n};\n\ntype Messages = { [messageId: string]: string };\ntype MessagesContainer = { [locale: string]: Messages | (() => Promise<Messages>) };\ntype MessagesStore = { [locale: string]: Messages };\nexport const useAsyncI18nMessages = (\n primaryContainer: MessagesContainer,\n locale: string,\n fallbackContainer?: MessagesContainer,\n) => {\n const container = React.useMemo(() => {\n if (!fallbackContainer) return primaryContainer;\n if (!primaryContainer) return fallbackContainer;\n if (primaryContainer === fallbackContainer) return primaryContainer;\n const container: MessagesContainer = {};\n for (const locale in primaryContainer) {\n if (\n typeof primaryContainer[locale] === 'function' ||\n typeof fallbackContainer[locale] === 'function'\n ) {\n container[locale] = async () => {\n const [primary, fallback] = await Promise.all([\n primaryContainer[locale],\n fallbackContainer[locale],\n ]);\n return { ...primary, ...fallback };\n };\n } else {\n container[locale] = {\n ...(primaryContainer[locale] ?? {}),\n ...(fallbackContainer[locale] ?? {}),\n };\n }\n }\n return container;\n }, [primaryContainer, fallbackContainer]);\n const initStore = React.useMemo(() => {\n const store: MessagesStore = {};\n for (const locale in container) {\n if (typeof container[locale] === 'object') {\n store[locale] = container[locale] as Messages;\n }\n }\n return store;\n }, [container]);\n const [store, setStore] = React.useState(initStore);\n const lastLoadedLocaleRef = React.useRef<string | null>(null);\n if (store[locale]) lastLoadedLocaleRef.current = locale;\n const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);\n\n const loadingLocaleRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n loadingLocaleRef.current = locale;\n const asyncMessages = container[locale];\n if (typeof asyncMessages === 'function') {\n asyncMessages()\n .then((module) => {\n if (loadingLocaleRef.current !== locale) return;\n let messages = module;\n if ('default' in module && typeof module.default === 'object') messages = module.default;\n setStore((store) => ({\n ...store,\n [locale]: messages,\n }));\n })\n\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [container, locale]);\n\n return store[locale] ?? fallbackMessages;\n};\nexport default (container?: MessagesContainer) => {\n return (props: any): { getI18nText: ReturnType<typeof useI18n> } => {\n const { i18n, locale } = props;\n const getI18nText = useI18n(i18n, locale, container);\n\n return { ...props, getI18nText };\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAA0BC,OAAO,QAAQ,gBAAY;AAkBrD,OAAO,MAAMC,oBAAoB,GAAGA,CAClCC,gBAAmC,EACnCC,MAAc,EACdC,iBAAqC,KAClC;EACH,MAAMC,SAAS,GAAGN,KAAK,CAACO,OAAO,CAAC,MAAM;IACpC,IAAI,CAACF,iBAAiB,EAAE,OAAOF,gBAAgB;IAC/C,IAAI,CAACA,gBAAgB,EAAE,OAAOE,iBAAiB;IAC/C,IAAIF,gBAAgB,KAAKE,iBAAiB,EAAE,OAAOF,gBAAgB;IACnE,MAAMG,SAA4B,GAAG,CAAC,CAAC;IACvC,KAAK,MAAMF,MAAM,IAAID,gBAAgB,EAAE;MACrC,IACE,OAAOA,gBAAgB,CAACC,MAAM,CAAC,KAAK,UAAU,IAC9C,OAAOC,iBAAiB,CAACD,MAAM,CAAC,KAAK,UAAU,EAC/C;QACAE,SAAS,CAACF,MAAM,CAAC,GAAG,YAAY;UAC9B,MAAM,CAACI,OAAO,EAAEC,QAAQ,CAAC,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC,CAC5CR,gBAAgB,CAACC,MAAM,CAAC,EACxBC,iBAAiB,CAACD,MAAM,CAAC,CAC1B,CAAC;UACF,OAAO;YAAE,GAAGI,OAAO;YAAE,GAAGC;UAAS,CAAC;QACpC,CAAC;MACH,CAAC,MAAM;QACLH,SAAS,CAACF,MAAM,CAAC,GAAG;UAClB,IAAID,gBAAgB,CAACC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;UACnC,IAAIC,iBAAiB,CAACD,MAAM,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;MACH;IACF;IACA,OAAOE,SAAS;EAClB,CAAC,EAAE,CAACH,gBAAgB,EAAEE,iBAAiB,CAAC,CAAC;EACzC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Fd,QAAQ,CAAED,KAAK,KAAM;UACnB,GAAGA,KAAK;UACR,CAACT,MAAM,GAAGuB;QACZ,CAAC,CAAC,CAAC;MACL,CAAC,CAAC,CAEDE,KAAK,CAAEC,GAAG,IAAK;QACd;QACAC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;MACpB,CAAC,CAAC;IACN;EACF,CAAC,EAAE,CAACxB,SAAS,EAAEF,MAAM,CAAC,CAAC;EAEvB,OAAOS,KAAK,CAACT,MAAM,CAAC,IAAIe,gBAAgB;AAC1C,CAAC;AACD,eAAgBb,SAA6B,IAAK;EAChD,OAAQ2B,KAAU,IAAkD;IAClE,MAAM;MAAEC,IAAI;MAAE9B;IAAO,CAAC,GAAG6B,KAAK;IAC9B,MAAME,WAAW,GAAGlC,OAAO,CAACiC,IAAI,EAAE9B,MAAM,EAAEE,SAAS,CAAC;IAEpD,OAAO;MAAE,GAAG2B,KAAK;MAAEE;IAAY,CAAC;EAClC,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"i18nEnhance.mjs","names":["React","useI18n","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","useMemo","_loop","_locale","_asyncToGenerator","_regenerator","m","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","w","_context","n","Promise","all","v","_slicedToArray","a","_objectSpread","_primaryContainer$_lo","_fallbackContainer$_l","initStore","store","_typeof","_React$useState","useState","_React$useState2","setStore","lastLoadedLocaleRef","useRef","current","fallbackMessages","Object","values","loadingLocaleRef","useEffect","asyncMessages","then","module","messages","_defineProperty","err","console","error","props","i18n","getI18nText"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type LocaleKeys, useI18n } from './WithI18n';\n\nexport type WithI18nEnhanceProps = {\n /* Function for getting the required field from the translation dictionary */\n getI18nText?: (key?: string, variables?: {}) => any;\n /* Object with translations */\n i18n?: {\n [locale: string]: {\n [key: string]: string;\n };\n };\n /* Locale for translations */\n locale?: LocaleKeys;\n};\n\ntype Messages = { [messageId: string]: string };\ntype MessagesContainer = { [locale: string]: Messages | (() => Promise<Messages>) };\ntype MessagesStore = { [locale: string]: Messages };\nexport const useAsyncI18nMessages = (\n primaryContainer: MessagesContainer,\n locale: string,\n fallbackContainer?: MessagesContainer,\n) => {\n const container = React.useMemo(() => {\n if (!fallbackContainer) return primaryContainer;\n if (!primaryContainer) return fallbackContainer;\n if (primaryContainer === fallbackContainer) return primaryContainer;\n const container: MessagesContainer = {};\n for (const locale in primaryContainer) {\n if (\n typeof primaryContainer[locale] === 'function' ||\n typeof fallbackContainer[locale] === 'function'\n ) {\n container[locale] = async () => {\n const [primary, fallback] = await Promise.all([\n primaryContainer[locale],\n fallbackContainer[locale],\n ]);\n return { ...primary, ...fallback };\n };\n } else {\n container[locale] = {\n ...(primaryContainer[locale] ?? {}),\n ...(fallbackContainer[locale] ?? {}),\n };\n }\n }\n return container;\n }, [primaryContainer, fallbackContainer]);\n const initStore = React.useMemo(() => {\n const store: MessagesStore = {};\n for (const locale in container) {\n if (typeof container[locale] === 'object') {\n store[locale] = container[locale] as Messages;\n }\n }\n return store;\n }, [container]);\n const [store, setStore] = React.useState(initStore);\n const lastLoadedLocaleRef = React.useRef<string | null>(null);\n if (store[locale]) lastLoadedLocaleRef.current = locale;\n const fallbackMessages = React.useMemo(() => Object.values(store)[0], [store]);\n\n const loadingLocaleRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n loadingLocaleRef.current = locale;\n const asyncMessages = container[locale];\n if (typeof asyncMessages === 'function') {\n asyncMessages()\n .then((module) => {\n if (loadingLocaleRef.current !== locale) return;\n let messages = module;\n if ('default' in module && typeof module.default === 'object') messages = module.default;\n setStore((store) => ({\n ...store,\n [locale]: messages,\n }));\n })\n\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [container, locale]);\n\n return store[locale] ?? fallbackMessages;\n};\nexport default (container?: MessagesContainer) => {\n return (props: any): { getI18nText: ReturnType<typeof useI18n> } => {\n const { i18n, locale } = props;\n const getI18nText = useI18n(i18n, locale, container);\n\n return { ...props, getI18nText };\n };\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAA0BC,OAAO,QAAQ,gBAAY;AAkBrD,OAAO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAC/BC,gBAAmC,EACnCC,MAAc,EACdC,iBAAqC,EAClC;EAAA,IAAAC,aAAA;EACH,IAAMC,SAAS,GAAGP,KAAK,CAACQ,OAAO,CAAC,YAAM;IACpC,IAAI,CAACH,iBAAiB,EAAE,OAAOF,gBAAgB;IAC/C,IAAI,CAACA,gBAAgB,EAAE,OAAOE,iBAAiB;IAC/C,IAAIF,gBAAgB,KAAKE,iBAAiB,EAAE,OAAOF,gBAAgB;IACnE,IAAMI,SAA4B,GAAG,CAAC,CAAC;IAAC,IAAAE,KAAA,YAAAA,MAAAC,OAAA,EACD;MACrC,IACE,OAAOP,gBAAgB,CAACC,OAAM,CAAC,KAAK,UAAU,IAC9C,OAAOC,iBAAiB,CAACD,OAAM,CAAC,KAAK,UAAU,EAC/C;QACAG,SAAS,CAACH,OAAM,CAAC,gBAAAO,iBAAA,cAAAC,YAAA,GAAAC,CAAA,CAAG,SAAAC,QAAA;UAAA,IAAAC,kBAAA,EAAAC,mBAAA,EAAAC,OAAA,EAAAC,QAAA;UAAA,OAAAN,YAAA,GAAAO,CAAA,WAAAC,QAAA;YAAA,kBAAAA,QAAA,CAAAC,CAAA;cAAA;gBAAAD,QAAA,CAAAC,CAAA;gBAAA,OACgBC,OAAO,CAACC,GAAG,CAAC,CAC5CpB,gBAAgB,CAACC,OAAM,CAAC,EACxBC,iBAAiB,CAACD,OAAM,CAAC,CAC1B,CAAC;cAAA;gBAAAW,kBAAA,GAAAK,QAAA,CAAAI,CAAA;gBAAAR,mBAAA,GAAAS,cAAA,CAAAV,kBAAA;gBAHKE,OAAO,GAAAD,mBAAA;gBAAEE,Q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C8C,KAAU,EAAkD;IAClE,IAAQC,IAAI,GAAaD,KAAK,CAAtBC,IAAI;MAAElD,MAAM,GAAKiD,KAAK,CAAhBjD,MAAM;IACpB,IAAMmD,WAAW,GAAGtD,OAAO,CAACqD,IAAI,EAAElD,MAAM,EAAEG,SAAS,CAAC;IAEpD,OAAAoB,aAAA,CAAAA,aAAA,KAAY0B,KAAK;MAAEE,WAAW,EAAXA;IAAW;EAChC,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,26 +1,24 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports["default"] = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _assignProps = _interopRequireDefault(require("../assignProps"));
10
10
  var _ref = require("../ref");
11
11
  var _useColorResolver = require("../use/useColorResolver");
12
- const resolveColorEnhance = () => {
13
- return props => {
14
- const {
15
- ref
16
- } = props;
17
- const internalRef = _react.default.useRef();
18
- const resolveColor = (0, _useColorResolver.useColorResolver)();
19
- return (0, _assignProps.default)(props, {
12
+ var resolveColorEnhance = function resolveColorEnhance() {
13
+ return function (props) {
14
+ var ref = props.ref;
15
+ var internalRef = _react["default"].useRef();
16
+ var resolveColor = (0, _useColorResolver.useColorResolver)();
17
+ return (0, _assignProps["default"])(props, {
20
18
  ref: (0, _ref.useForkRef)(ref, internalRef),
21
- resolveColor
19
+ resolveColor: resolveColor
22
20
  });
23
21
  };
24
22
  };
25
- var _default = exports.default = resolveColorEnhance;
23
+ var _default = exports["default"] = resolveColorEnhance;
26
24
  //# sourceMappingURL=resolveColorEnhance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveColorEnhance.js","names":["_react","_interopRequireDefault","require","_assignProps","_ref","_useColorResolver","resolveColorEnhance","props","ref","internalRef","React","useRef","resolveColor","useColorResolver","assignProps","useForkRef","_default","exports","default"],"sources":["../../../src/utils/enhances/resolveColorEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../assignProps';\nimport { useForkRef } from '../ref';\nimport { useColorResolver } from '../use/useColorResolver';\n\nconst resolveColorEnhance = () => {\n return (props: any) => {\n const { ref } = props;\n const internalRef = React.useRef<HTMLElement>();\n const resolveColor = useColorResolver();\n\n return assignProps(props, {\n ref: useForkRef(ref, internalRef),\n resolveColor,\n });\n };\n};\n\nexport default resolveColorEnhance;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,MAAMI,mBAAmB,GAAGA,CAAA,KAAM;EAChC,OAAQC,KAAU,IAAK;IACrB,MAAM;MAAEC;IAAI,CAAC,GAAGD,KAAK;IACrB,MAAME,WAAW,GAAGC,cAAK,CAACC,MAAM,CAAc,CAAC;IAC/C,MAAMC,YAAY,GAAG,IAAAC,kCAAgB,EAAC,CAAC;IAEvC,OAAO,IAAAC,oBAAW,EAACP,KAAK,EAAE;MACxBC,GAAG,EAAE,IAAAO,eAAU,EAACP,GAAG,EAAEC,WAAW,CAAC;MACjCG;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaZ,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"resolveColorEnhance.js","names":["_react","_interopRequireDefault","require","_assignProps","_ref","_useColorResolver","resolveColorEnhance","props","ref","internalRef","React","useRef","resolveColor","useColorResolver","assignProps","useForkRef","_default","exports"],"sources":["../../../src/utils/enhances/resolveColorEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../assignProps';\nimport { useForkRef } from '../ref';\nimport { useColorResolver } from '../use/useColorResolver';\n\nconst resolveColorEnhance = () => {\n return (props: any) => {\n const { ref } = props;\n const internalRef = React.useRef<HTMLElement>();\n const resolveColor = useColorResolver();\n\n return assignProps(props, {\n ref: useForkRef(ref, internalRef),\n resolveColor,\n });\n };\n};\n\nexport default resolveColorEnhance;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,IAAMI,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAA,EAAS;EAChC,OAAO,UAACC,KAAU,EAAK;IACrB,IAAQC,GAAG,GAAKD,KAAK,CAAbC,GAAG;IACX,IAAMC,WAAW,GAAGC,iBAAK,CAACC,MAAM,CAAc,CAAC;IAC/C,IAAMC,YAAY,GAAG,IAAAC,kCAAgB,EAAC,CAAC;IAEvC,OAAO,IAAAC,uBAAW,EAACP,KAAK,EAAE;MACxBC,GAAG,EAAE,IAAAO,eAAU,EAACP,GAAG,EAAEC,WAAW,CAAC;MACjCG,YAAY,EAAZA;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEaX,mBAAmB","ignoreList":[]}
@@ -2,16 +2,14 @@ import React from 'react';
2
2
  import assignProps from "../assignProps.mjs";
3
3
  import { useForkRef } from "../ref.mjs";
4
4
  import { useColorResolver } from "../use/useColorResolver.mjs";
5
- const resolveColorEnhance = () => {
6
- return props => {
7
- const {
8
- ref
9
- } = props;
10
- const internalRef = React.useRef();
11
- const resolveColor = useColorResolver();
5
+ var resolveColorEnhance = function resolveColorEnhance() {
6
+ return function (props) {
7
+ var ref = props.ref;
8
+ var internalRef = React.useRef();
9
+ var resolveColor = useColorResolver();
12
10
  return assignProps(props, {
13
11
  ref: useForkRef(ref, internalRef),
14
- resolveColor
12
+ resolveColor: resolveColor
15
13
  });
16
14
  };
17
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"resolveColorEnhance.mjs","names":["React","assignProps","useForkRef","useColorResolver","resolveColorEnhance","props","ref","internalRef","useRef","resolveColor"],"sources":["../../../src/utils/enhances/resolveColorEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../assignProps';\nimport { useForkRef } from '../ref';\nimport { useColorResolver } from '../use/useColorResolver';\n\nconst resolveColorEnhance = () => {\n return (props: any) => {\n const { ref } = props;\n const internalRef = React.useRef<HTMLElement>();\n const resolveColor = useColorResolver();\n\n return assignProps(props, {\n ref: useForkRef(ref, internalRef),\n resolveColor,\n });\n };\n};\n\nexport default resolveColorEnhance;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,WAAW,MAAM,oBAAgB;AACxC,SAASC,UAAU,QAAQ,YAAQ;AACnC,SAASC,gBAAgB,QAAQ,6BAAyB;AAE1D,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EAChC,OAAQC,KAAU,IAAK;IACrB,MAAM;MAAEC;IAAI,CAAC,GAAGD,KAAK;IACrB,MAAME,WAAW,GAAGP,KAAK,CAACQ,MAAM,CAAc,CAAC;IAC/C,MAAMC,YAAY,GAAGN,gBAAgB,CAAC,CAAC;IAEvC,OAAOF,WAAW,CAACI,KAAK,EAAE;MACxBC,GAAG,EAAEJ,UAAU,CAACI,GAAG,EAAEC,WAAW,CAAC;MACjCE;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAED,eAAeL,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"resolveColorEnhance.mjs","names":["React","assignProps","useForkRef","useColorResolver","resolveColorEnhance","props","ref","internalRef","useRef","resolveColor"],"sources":["../../../src/utils/enhances/resolveColorEnhance.tsx"],"sourcesContent":["import React from 'react';\n\nimport assignProps from '../assignProps';\nimport { useForkRef } from '../ref';\nimport { useColorResolver } from '../use/useColorResolver';\n\nconst resolveColorEnhance = () => {\n return (props: any) => {\n const { ref } = props;\n const internalRef = React.useRef<HTMLElement>();\n const resolveColor = useColorResolver();\n\n return assignProps(props, {\n ref: useForkRef(ref, internalRef),\n resolveColor,\n });\n };\n};\n\nexport default resolveColorEnhance;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,WAAW,MAAM,oBAAgB;AACxC,SAASC,UAAU,QAAQ,YAAQ;AACnC,SAASC,gBAAgB,QAAQ,6BAAyB;AAE1D,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAA,EAAS;EAChC,OAAO,UAACC,KAAU,EAAK;IACrB,IAAQC,GAAG,GAAKD,KAAK,CAAbC,GAAG;IACX,IAAMC,WAAW,GAAGP,KAAK,CAACQ,MAAM,CAAc,CAAC;IAC/C,IAAMC,YAAY,GAAGN,gBAAgB,CAAC,CAAC;IAEvC,OAAOF,WAAW,CAACI,KAAK,EAAE;MACxBC,GAAG,EAAEJ,UAAU,CAACI,GAAG,EAAEC,WAAW,CAAC;MACjCE,YAAY,EAAZA;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAED,eAAeL,mBAAmB","ignoreList":[]}