@semcore/core 17.0.0-prerelease.20 → 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 (354) hide show
  1. package/lib/LastInteractionType.js +36 -22
  2. package/lib/LastInteractionType.js.map +1 -1
  3. package/lib/LastInteractionType.mjs +33 -19
  4. package/lib/LastInteractionType.mjs.map +1 -1
  5. package/lib/core-types/Component.js +41 -25
  6. package/lib/core-types/Component.js.map +1 -1
  7. package/lib/core-types/Component.mjs +38 -18
  8. package/lib/core-types/Component.mjs.map +1 -1
  9. package/lib/core-types/symbols.js +9 -9
  10. package/lib/core-types/symbols.js.map +1 -1
  11. package/lib/core-types/symbols.mjs +9 -9
  12. package/lib/core-types/symbols.mjs.map +1 -1
  13. package/lib/coreFactory.js +205 -143
  14. package/lib/coreFactory.js.map +1 -1
  15. package/lib/coreFactory.mjs +164 -118
  16. package/lib/coreFactory.mjs.map +1 -1
  17. package/lib/decorators/propsObserver.js +64 -36
  18. package/lib/decorators/propsObserver.js.map +1 -1
  19. package/lib/decorators/propsObserver.mjs +61 -33
  20. package/lib/decorators/propsObserver.mjs.map +1 -1
  21. package/lib/decorators/reactive.js +17 -17
  22. package/lib/decorators/reactive.js.map +1 -1
  23. package/lib/decorators/reactive.mjs +15 -15
  24. package/lib/decorators/reactive.mjs.map +1 -1
  25. package/lib/enhancement/Children.js +59 -51
  26. package/lib/enhancement/Children.js.map +1 -1
  27. package/lib/enhancement/Children.mjs +41 -47
  28. package/lib/enhancement/Children.mjs.map +1 -1
  29. package/lib/enhancement/Root.js +37 -36
  30. package/lib/enhancement/Root.js.map +1 -1
  31. package/lib/enhancement/Root.mjs +18 -28
  32. package/lib/enhancement/Root.mjs.map +1 -1
  33. package/lib/enhancement/dataName.js +8 -7
  34. package/lib/enhancement/dataName.js.map +1 -1
  35. package/lib/enhancement/dataName.mjs +5 -5
  36. package/lib/enhancement/dataName.mjs.map +1 -1
  37. package/lib/enhancement/enhance.js +9 -6
  38. package/lib/enhancement/enhance.js.map +1 -1
  39. package/lib/enhancement/enhance.mjs +7 -5
  40. package/lib/enhancement/enhance.mjs.map +1 -1
  41. package/lib/enhancement/functionDefaultProps.js +6 -6
  42. package/lib/enhancement/functionDefaultProps.js.map +1 -1
  43. package/lib/enhancement/functionDefaultProps.mjs +4 -4
  44. package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
  45. package/lib/enhancement/i18n.js +13 -13
  46. package/lib/enhancement/i18n.js.map +1 -1
  47. package/lib/enhancement/i18n.mjs +9 -10
  48. package/lib/enhancement/i18n.mjs.map +1 -1
  49. package/lib/enhancement/inheritedName.js +8 -7
  50. package/lib/enhancement/inheritedName.js.map +1 -1
  51. package/lib/enhancement/inheritedName.mjs +5 -5
  52. package/lib/enhancement/inheritedName.mjs.map +1 -1
  53. package/lib/enhancement/staticChildren.js +56 -47
  54. package/lib/enhancement/staticChildren.js.map +1 -1
  55. package/lib/enhancement/staticChildren.mjs +48 -43
  56. package/lib/enhancement/staticChildren.mjs.map +1 -1
  57. package/lib/enhancement/style.js +27 -29
  58. package/lib/enhancement/style.js.map +1 -1
  59. package/lib/enhancement/style.mjs +20 -26
  60. package/lib/enhancement/style.mjs.map +1 -1
  61. package/lib/enhancement/uncontrolledProps.js +65 -46
  62. package/lib/enhancement/uncontrolledProps.js.map +1 -1
  63. package/lib/enhancement/uncontrolledProps.mjs +52 -43
  64. package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
  65. package/lib/esm/LastInteractionType.mjs +33 -19
  66. package/lib/esm/core-types/Component.mjs +38 -18
  67. package/lib/esm/core-types/symbols.mjs +9 -9
  68. package/lib/esm/coreFactory.mjs +164 -118
  69. package/lib/esm/enhancement/Children.mjs +41 -47
  70. package/lib/esm/enhancement/Root.mjs +18 -28
  71. package/lib/esm/enhancement/dataName.mjs +5 -5
  72. package/lib/esm/enhancement/enhance.mjs +7 -5
  73. package/lib/esm/enhancement/functionDefaultProps.mjs +4 -4
  74. package/lib/esm/enhancement/i18n.mjs +9 -10
  75. package/lib/esm/enhancement/inheritedName.mjs +5 -5
  76. package/lib/esm/enhancement/staticChildren.mjs +48 -43
  77. package/lib/esm/enhancement/style.mjs +20 -26
  78. package/lib/esm/enhancement/uncontrolledProps.mjs +52 -43
  79. package/lib/esm/register.mjs +20 -12
  80. package/lib/esm/styled/reshadow-core.mjs +111 -98
  81. package/lib/esm/styled/sstyled.mjs +41 -31
  82. package/lib/esm/utils/assignProps.mjs +36 -32
  83. package/lib/esm/utils/enhances/WithI18n.mjs +17 -15
  84. package/lib/esm/utils/enhances/i18nEnhance.mjs +61 -47
  85. package/lib/esm/utils/logger.mjs +21 -13
  86. package/lib/esm/utils/pick.mjs +4 -4
  87. package/lib/esm/utils/ref.mjs +43 -27
  88. package/lib/esm/utils/use/useEnhancedEffect.mjs +1 -1
  89. package/lib/index.js +17 -17
  90. package/lib/register.js +24 -17
  91. package/lib/register.js.map +1 -1
  92. package/lib/register.mjs +20 -12
  93. package/lib/register.mjs.map +1 -1
  94. package/lib/styled/index.js +4 -4
  95. package/lib/styled/reshadow-core.js +104 -102
  96. package/lib/styled/reshadow-core.js.map +1 -1
  97. package/lib/styled/reshadow-core.mjs +111 -98
  98. package/lib/styled/reshadow-core.mjs.map +1 -1
  99. package/lib/styled/sstyled.js +53 -31
  100. package/lib/styled/sstyled.js.map +1 -1
  101. package/lib/styled/sstyled.mjs +41 -31
  102. package/lib/styled/sstyled.mjs.map +1 -1
  103. package/lib/theme/processor.js +222 -150
  104. package/lib/theme/processor.js.map +1 -1
  105. package/lib/theme/processor.mjs +221 -148
  106. package/lib/theme/processor.mjs.map +1 -1
  107. package/lib/theme/themes/dark.js +2 -2
  108. package/lib/theme/themes/dark.js.map +1 -1
  109. package/lib/theme/themes/default.js +2 -2
  110. package/lib/theme/themes/default.js.map +1 -1
  111. package/lib/theme/themes/highlights-dark.js +2 -2
  112. package/lib/theme/themes/highlights-dark.js.map +1 -1
  113. package/lib/theme/themes/highlights-light.js +2 -2
  114. package/lib/theme/themes/highlights-light.js.map +1 -1
  115. package/lib/theme/themes/light.js +2 -2
  116. package/lib/theme/themes/light.js.map +1 -1
  117. package/lib/theme/utils.js +215 -140
  118. package/lib/theme/utils.js.map +1 -1
  119. package/lib/theme/utils.mjs +214 -135
  120. package/lib/theme/utils.mjs.map +1 -1
  121. package/lib/utils/CSSinJS.js +10 -8
  122. package/lib/utils/CSSinJS.js.map +1 -1
  123. package/lib/utils/CSSinJS.mjs +7 -6
  124. package/lib/utils/CSSinJS.mjs.map +1 -1
  125. package/lib/utils/ThemeProvider.js +51 -44
  126. package/lib/utils/ThemeProvider.js.map +1 -1
  127. package/lib/utils/ThemeProvider.mjs +47 -36
  128. package/lib/utils/ThemeProvider.mjs.map +1 -1
  129. package/lib/utils/addonText.js +7 -4
  130. package/lib/utils/addonText.js.map +1 -1
  131. package/lib/utils/addonText.mjs +5 -2
  132. package/lib/utils/addonText.mjs.map +1 -1
  133. package/lib/utils/addonTextChildren.js +21 -15
  134. package/lib/utils/addonTextChildren.js.map +1 -1
  135. package/lib/utils/addonTextChildren.mjs +13 -7
  136. package/lib/utils/addonTextChildren.mjs.map +1 -1
  137. package/lib/utils/ariaProps.js +5 -7
  138. package/lib/utils/ariaProps.js.map +1 -1
  139. package/lib/utils/ariaProps.mjs +5 -7
  140. package/lib/utils/ariaProps.mjs.map +1 -1
  141. package/lib/utils/assignProps.js +37 -33
  142. package/lib/utils/assignProps.js.map +1 -1
  143. package/lib/utils/assignProps.mjs +36 -32
  144. package/lib/utils/assignProps.mjs.map +1 -1
  145. package/lib/utils/canUseDOM.js +1 -1
  146. package/lib/utils/capitalizeFirstLetter.js +1 -1
  147. package/lib/utils/color.js +95 -72
  148. package/lib/utils/color.js.map +1 -1
  149. package/lib/utils/color.mjs +94 -71
  150. package/lib/utils/color.mjs.map +1 -1
  151. package/lib/utils/compose.js +12 -3
  152. package/lib/utils/compose.js.map +1 -1
  153. package/lib/utils/compose.mjs +11 -2
  154. package/lib/utils/compose.mjs.map +1 -1
  155. package/lib/utils/createUUID.js +5 -5
  156. package/lib/utils/createUUID.js.map +1 -1
  157. package/lib/utils/createUUID.mjs +4 -4
  158. package/lib/utils/createUUID.mjs.map +1 -1
  159. package/lib/utils/cssToIntDefault.js +4 -3
  160. package/lib/utils/cssToIntDefault.js.map +1 -1
  161. package/lib/utils/cssToIntDefault.mjs +3 -2
  162. package/lib/utils/cssToIntDefault.mjs.map +1 -1
  163. package/lib/utils/enhances/WithCSS.js +8 -10
  164. package/lib/utils/enhances/WithCSS.js.map +1 -1
  165. package/lib/utils/enhances/WithCSS.mjs +6 -7
  166. package/lib/utils/enhances/WithCSS.mjs.map +1 -1
  167. package/lib/utils/enhances/WithI18n.js +19 -19
  168. package/lib/utils/enhances/WithI18n.js.map +1 -1
  169. package/lib/utils/enhances/WithI18n.mjs +17 -15
  170. package/lib/utils/enhances/WithI18n.mjs.map +1 -1
  171. package/lib/utils/enhances/a11yEnhance.js +39 -34
  172. package/lib/utils/enhances/a11yEnhance.js.map +1 -1
  173. package/lib/utils/enhances/a11yEnhance.mjs +36 -32
  174. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
  175. package/lib/utils/enhances/animatedSizeEnhance.js +63 -55
  176. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -1
  177. package/lib/utils/enhances/animatedSizeEnhance.mjs +58 -50
  178. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
  179. package/lib/utils/enhances/contextEnhance.js +11 -12
  180. package/lib/utils/enhances/contextEnhance.js.map +1 -1
  181. package/lib/utils/enhances/contextEnhance.mjs +8 -9
  182. package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
  183. package/lib/utils/enhances/i18nEnhance.js +67 -51
  184. package/lib/utils/enhances/i18nEnhance.js.map +1 -1
  185. package/lib/utils/enhances/i18nEnhance.mjs +61 -47
  186. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
  187. package/lib/utils/enhances/resolveColorEnhance.js +10 -12
  188. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -1
  189. package/lib/utils/enhances/resolveColorEnhance.mjs +6 -8
  190. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
  191. package/lib/utils/eventEmitter.js +57 -30
  192. package/lib/utils/eventEmitter.js.map +1 -1
  193. package/lib/utils/eventEmitter.mjs +55 -26
  194. package/lib/utils/eventEmitter.mjs.map +1 -1
  195. package/lib/utils/findComponent.js +42 -35
  196. package/lib/utils/findComponent.js.map +1 -1
  197. package/lib/utils/findComponent.mjs +33 -26
  198. package/lib/utils/findComponent.mjs.map +1 -1
  199. package/lib/utils/fire.js +13 -7
  200. package/lib/utils/fire.js.map +1 -1
  201. package/lib/utils/fire.mjs +11 -5
  202. package/lib/utils/fire.mjs.map +1 -1
  203. package/lib/utils/focus-lock/focusBorders.js +32 -28
  204. package/lib/utils/focus-lock/focusBorders.js.map +1 -1
  205. package/lib/utils/focus-lock/focusBorders.mjs +32 -26
  206. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
  207. package/lib/utils/focus-lock/getFocusableIn.js +6 -4
  208. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -1
  209. package/lib/utils/focus-lock/getFocusableIn.mjs +6 -3
  210. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
  211. package/lib/utils/focus-lock/isFocusInside.js +6 -5
  212. package/lib/utils/focus-lock/isFocusInside.js.map +1 -1
  213. package/lib/utils/focus-lock/isFocusInside.mjs +6 -4
  214. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
  215. package/lib/utils/focus-lock/isFocusable.js +12 -9
  216. package/lib/utils/focus-lock/isFocusable.js.map +1 -1
  217. package/lib/utils/focus-lock/isFocusable.mjs +11 -8
  218. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
  219. package/lib/utils/focus-lock/setFocus.js +27 -21
  220. package/lib/utils/focus-lock/setFocus.js.map +1 -1
  221. package/lib/utils/focus-lock/setFocus.mjs +25 -19
  222. package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
  223. package/lib/utils/getAccessibleName.js +22 -10
  224. package/lib/utils/getAccessibleName.js.map +1 -1
  225. package/lib/utils/getAccessibleName.mjs +21 -10
  226. package/lib/utils/getAccessibleName.mjs.map +1 -1
  227. package/lib/utils/getDisplayName.js +1 -1
  228. package/lib/utils/getEventTarget.js +32 -13
  229. package/lib/utils/getEventTarget.js.map +1 -1
  230. package/lib/utils/getEventTarget.mjs +31 -12
  231. package/lib/utils/getEventTarget.mjs.map +1 -1
  232. package/lib/utils/getOriginChildren.js +4 -4
  233. package/lib/utils/getOriginChildren.js.map +1 -1
  234. package/lib/utils/getRandomInt.js +1 -1
  235. package/lib/utils/getValue.js +6 -4
  236. package/lib/utils/getValue.js.map +1 -1
  237. package/lib/utils/getValue.mjs +5 -3
  238. package/lib/utils/getValue.mjs.map +1 -1
  239. package/lib/utils/hasLabels.js +27 -16
  240. package/lib/utils/hasLabels.js.map +1 -1
  241. package/lib/utils/hasLabels.mjs +24 -14
  242. package/lib/utils/hasLabels.mjs.map +1 -1
  243. package/lib/utils/hasParent.js +2 -3
  244. package/lib/utils/hasParent.js.map +1 -1
  245. package/lib/utils/hasParent.mjs +3 -2
  246. package/lib/utils/hasParent.mjs.map +1 -1
  247. package/lib/utils/ifChildren.js +4 -6
  248. package/lib/utils/ifChildren.js.map +1 -1
  249. package/lib/utils/ifChildren.mjs +2 -4
  250. package/lib/utils/ifChildren.mjs.map +1 -1
  251. package/lib/utils/injectStyle.js +13 -11
  252. package/lib/utils/injectStyle.js.map +1 -1
  253. package/lib/utils/injectStyle.mjs +10 -9
  254. package/lib/utils/injectStyle.mjs.map +1 -1
  255. package/lib/utils/inputProps.js +5 -5
  256. package/lib/utils/inputProps.js.map +1 -1
  257. package/lib/utils/inputProps.mjs +4 -4
  258. package/lib/utils/inputProps.mjs.map +1 -1
  259. package/lib/utils/isInteractiveElement.js +9 -7
  260. package/lib/utils/isInteractiveElement.js.map +1 -1
  261. package/lib/utils/isInteractiveElement.mjs +9 -7
  262. package/lib/utils/isInteractiveElement.mjs.map +1 -1
  263. package/lib/utils/isNode.js +5 -4
  264. package/lib/utils/isNode.js.map +1 -1
  265. package/lib/utils/isNode.mjs +2 -1
  266. package/lib/utils/isNode.mjs.map +1 -1
  267. package/lib/utils/isPromise.js +1 -1
  268. package/lib/utils/isRetina.js +2 -7
  269. package/lib/utils/isRetina.js.map +1 -1
  270. package/lib/utils/isRetina.mjs +1 -6
  271. package/lib/utils/isRetina.mjs.map +1 -1
  272. package/lib/utils/logger.js +25 -18
  273. package/lib/utils/logger.js.map +1 -1
  274. package/lib/utils/logger.mjs +21 -13
  275. package/lib/utils/logger.mjs.map +1 -1
  276. package/lib/utils/numericChecker.js +18 -11
  277. package/lib/utils/numericChecker.js.map +1 -1
  278. package/lib/utils/numericChecker.mjs +17 -10
  279. package/lib/utils/numericChecker.mjs.map +1 -1
  280. package/lib/utils/ownerDocument.js +2 -2
  281. package/lib/utils/ownerDocument.js.map +1 -1
  282. package/lib/utils/ownerDocument.mjs +1 -1
  283. package/lib/utils/ownerDocument.mjs.map +1 -1
  284. package/lib/utils/pick.js +5 -5
  285. package/lib/utils/pick.js.map +1 -1
  286. package/lib/utils/pick.mjs +4 -4
  287. package/lib/utils/pick.mjs.map +1 -1
  288. package/lib/utils/propsForElement.js +12 -10
  289. package/lib/utils/propsForElement.js.map +1 -1
  290. package/lib/utils/propsForElement.mjs +10 -8
  291. package/lib/utils/propsForElement.mjs.map +1 -1
  292. package/lib/utils/rafTrottle.js +14 -9
  293. package/lib/utils/rafTrottle.js.map +1 -1
  294. package/lib/utils/rafTrottle.mjs +12 -7
  295. package/lib/utils/rafTrottle.mjs.map +1 -1
  296. package/lib/utils/reactToText.js +8 -5
  297. package/lib/utils/reactToText.js.map +1 -1
  298. package/lib/utils/reactToText.mjs +6 -3
  299. package/lib/utils/reactToText.mjs.map +1 -1
  300. package/lib/utils/ref.js +47 -29
  301. package/lib/utils/ref.js.map +1 -1
  302. package/lib/utils/ref.mjs +43 -27
  303. package/lib/utils/ref.mjs.map +1 -1
  304. package/lib/utils/setRef.js +2 -2
  305. package/lib/utils/setRef.js.map +1 -1
  306. package/lib/utils/syncScroll.js +24 -24
  307. package/lib/utils/syncScroll.js.map +1 -1
  308. package/lib/utils/syncScroll.mjs +21 -21
  309. package/lib/utils/syncScroll.mjs.map +1 -1
  310. package/lib/utils/uncontroll.js +18 -8
  311. package/lib/utils/uncontroll.js.map +1 -1
  312. package/lib/utils/uncontroll.mjs +17 -8
  313. package/lib/utils/uncontroll.mjs.map +1 -1
  314. package/lib/utils/uniqueID.js +27 -22
  315. package/lib/utils/uniqueID.js.map +1 -1
  316. package/lib/utils/uniqueID.mjs +25 -18
  317. package/lib/utils/uniqueID.mjs.map +1 -1
  318. package/lib/utils/use/useColorResolver.js +21 -20
  319. package/lib/utils/use/useColorResolver.js.map +1 -1
  320. package/lib/utils/use/useColorResolver.mjs +18 -16
  321. package/lib/utils/use/useColorResolver.mjs.map +1 -1
  322. package/lib/utils/use/useEnhancedEffect.js +4 -4
  323. package/lib/utils/use/useEnhancedEffect.js.map +1 -1
  324. package/lib/utils/use/useEnhancedEffect.mjs +1 -1
  325. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
  326. package/lib/utils/use/useEventCallback.js +10 -5
  327. package/lib/utils/use/useEventCallback.js.map +1 -1
  328. package/lib/utils/use/useEventCallback.mjs +8 -3
  329. package/lib/utils/use/useEventCallback.mjs.map +1 -1
  330. package/lib/utils/use/useEventListener.js +15 -11
  331. package/lib/utils/use/useEventListener.js.map +1 -1
  332. package/lib/utils/use/useEventListener.mjs +11 -7
  333. package/lib/utils/use/useEventListener.mjs.map +1 -1
  334. package/lib/utils/use/useFocusLock.js +94 -80
  335. package/lib/utils/use/useFocusLock.js.map +1 -1
  336. package/lib/utils/use/useFocusLock.mjs +88 -71
  337. package/lib/utils/use/useFocusLock.mjs.map +1 -1
  338. package/lib/utils/use/usePreventScroll.js +28 -26
  339. package/lib/utils/use/usePreventScroll.js.map +1 -1
  340. package/lib/utils/use/usePreventScroll.mjs +23 -21
  341. package/lib/utils/use/usePreventScroll.mjs.map +1 -1
  342. package/lib/utils/use/useScrollBarWidth.js +14 -8
  343. package/lib/utils/use/useScrollBarWidth.js.map +1 -1
  344. package/lib/utils/use/useScrollBarWidth.mjs +13 -8
  345. package/lib/utils/use/useScrollBarWidth.mjs.map +1 -1
  346. package/lib/utils/useCssVariable.js +37 -32
  347. package/lib/utils/useCssVariable.js.map +1 -1
  348. package/lib/utils/useCssVariable.mjs +34 -27
  349. package/lib/utils/useCssVariable.mjs.map +1 -1
  350. package/lib/utils/zIndexStacking.js +24 -28
  351. package/lib/utils/zIndexStacking.js.map +1 -1
  352. package/lib/utils/zIndexStacking.mjs +22 -23
  353. package/lib/utils/zIndexStacking.mjs.map +1 -1
  354. package/package.json +1 -1
@@ -1,5 +1,9 @@
1
- const _Symbol = (key) => typeof Symbol !== "undefined" ? Symbol(key) : key;
2
- const KEYS = {
1
+ import _typeof from "@babel/runtime/helpers/esm/typeof";
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ var _Symbol = function _Symbol2(key) {
4
+ return typeof Symbol !== "undefined" ? Symbol(key) : key;
5
+ };
6
+ var KEYS = {
3
7
  __id__: _Symbol("__id__"),
4
8
  __store__: _Symbol("__store__"),
5
9
  __prev__: _Symbol("__prev__"),
@@ -14,48 +18,44 @@ const KEYS = {
14
18
  */
15
19
  __classProp__: "className"
16
20
  };
17
- let index = 0;
18
- const use = (obj) => {
19
- const result = {};
21
+ var index = 0;
22
+ var use = function use2(obj) {
23
+ var result = {};
20
24
  result[KEYS.__use__] = obj;
21
25
  return result;
22
26
  };
23
- const create = (args) => {
24
- const len = args.length;
25
- let newStyle = {};
26
- let id = "";
27
- let vars = null;
28
- let uses = null;
29
- for (let i = 0; i < len; i++) {
30
- const style2 = args[i];
31
- if (!style2) continue;
32
- if (!style2[KEYS.__id__]) {
33
- style2[KEYS.__id__] = ++index;
34
- style2[KEYS.__store__] = {
35
- ["_" + style2[KEYS.__id__]]: style2
36
- };
27
+ var create = function create2(args) {
28
+ var len = args.length;
29
+ var newStyle = {};
30
+ var id = "";
31
+ var vars = null;
32
+ var uses = null;
33
+ for (var i = 0; i < len; i++) {
34
+ var _style = args[i];
35
+ if (!_style) continue;
36
+ if (!_style[KEYS.__id__]) {
37
+ _style[KEYS.__id__] = ++index;
38
+ _style[KEYS.__store__] = _defineProperty({}, "_" + _style[KEYS.__id__], _style);
37
39
  }
38
- id += "_" + style2[KEYS.__id__];
39
- if (style2[KEYS.__style__]) {
40
- vars = Object.assign(vars || {}, style2[KEYS.__style__]);
40
+ id += "_" + _style[KEYS.__id__];
41
+ if (_style[KEYS.__style__]) {
42
+ vars = Object.assign(vars || {}, _style[KEYS.__style__]);
41
43
  }
42
- if (style2[KEYS.__use__]) {
43
- uses = Object.assign(uses || {}, style2[KEYS.__use__]);
44
+ if (_style[KEYS.__use__]) {
45
+ uses = Object.assign(uses || {}, _style[KEYS.__use__]);
44
46
  }
45
- if (style2[KEYS.__store__][id]) {
46
- newStyle = style2[KEYS.__store__][id];
47
+ if (_style[KEYS.__store__][id]) {
48
+ newStyle = _style[KEYS.__store__][id];
47
49
  continue;
48
50
  }
49
51
  newStyle = Object.create(newStyle);
50
- for (const key in style2) {
52
+ for (var key in _style) {
51
53
  if (key in KEYS) continue;
52
- newStyle[key] = appendClassName(style2[key], newStyle[key]);
54
+ newStyle[key] = appendClassName(_style[key], newStyle[key]);
53
55
  }
54
- style2[KEYS.__store__][id] = newStyle;
56
+ _style[KEYS.__store__][id] = newStyle;
55
57
  newStyle[KEYS.__id__] = index;
56
- newStyle[KEYS.__store__] = {
57
- ["_" + style2[KEYS.__id__]]: newStyle
58
- };
58
+ newStyle[KEYS.__store__] = _defineProperty({}, "_" + _style[KEYS.__id__], newStyle);
59
59
  }
60
60
  if (vars || use) {
61
61
  newStyle = Object.create(newStyle);
@@ -64,117 +64,130 @@ const create = (args) => {
64
64
  }
65
65
  return newStyle;
66
66
  };
67
- const isSSR = !(typeof window !== "undefined" && window.document && window.document.createElement);
68
- const serverMap = {};
69
- const getStyles = () => ({
70
- map: serverMap,
71
- get css() {
72
- let serverStyles2 = "";
73
- for (const id in serverMap) {
74
- serverStyles2 += `<style type="text/css" id="${id}">${serverMap[id]}</style>`;
67
+ var isSSR = !(typeof window !== "undefined" && window.document && window.document.createElement);
68
+ var serverMap = {};
69
+ var getStyles = function getStyles2() {
70
+ return {
71
+ map: serverMap,
72
+ get css() {
73
+ var serverStyles2 = "";
74
+ for (var id in serverMap) {
75
+ serverStyles2 += '<style type="text/css" id="'.concat(id, '">').concat(serverMap[id], "</style>");
76
+ }
77
+ return serverStyles2;
75
78
  }
76
- return serverStyles2;
77
- }
78
- });
79
- const clearStyles = () => {
79
+ };
80
+ };
81
+ var clearStyles = function clearStyles2() {
80
82
  serverStyles = "";
81
83
  };
82
- const RESHADOW_ID = "__reshadow__";
83
- const appendChildToDocumentHead = (element) => document.head.appendChild(element);
84
- const css = (code, hash) => {
85
- const id = `reshadow-${hash}`;
84
+ var RESHADOW_ID = "__reshadow__";
85
+ var appendChildToDocumentHead = function appendChildToDocumentHead2(element) {
86
+ return document.head.appendChild(element);
87
+ };
88
+ var css = function css2(code, hash) {
89
+ var id = "reshadow-".concat(hash);
86
90
  if (isSSR) {
87
91
  serverMap[id] = code;
88
92
  return;
89
93
  }
90
- let container = document.getElementById(RESHADOW_ID);
94
+ var container = document.getElementById(RESHADOW_ID);
91
95
  if (!container) {
92
96
  container = document.createElement("object");
93
97
  container.id = RESHADOW_ID;
94
98
  if (document.head) {
95
99
  appendChildToDocumentHead(container);
96
100
  } else {
97
- document.addEventListener("DOMContentLoaded", () => {
101
+ document.addEventListener("DOMContentLoaded", function() {
98
102
  appendChildToDocumentHead(container);
99
103
  });
100
104
  }
101
105
  }
102
- let css2 = document.getElementById(id);
103
- if (!css2) {
104
- css2 = document.createElement("style");
105
- css2.id = id;
106
- css2.type = "text/css";
107
- container.appendChild(css2);
106
+ var css3 = document.getElementById(id);
107
+ if (!css3) {
108
+ css3 = document.createElement("style");
109
+ css3.id = id;
110
+ css3.type = "text/css";
111
+ container.appendChild(css3);
108
112
  }
109
- css2.innerHTML = code;
113
+ css3.innerHTML = code;
110
114
  };
111
- let styles = {};
112
- let style;
113
- const stack = [];
114
- const styled = (elem) => {
115
- const curr = stack.pop() || [];
115
+ var styles = {};
116
+ var style;
117
+ var stack = [];
118
+ var _styled = function styled(elem) {
119
+ var curr = stack.pop() || [];
116
120
  styles = curr[0] || styles;
117
121
  style = curr[1] || style;
118
- styled[KEYS.__styles__] = styles;
119
- styled[KEYS.__style__] = style;
122
+ _styled[KEYS.__styles__] = styles;
123
+ _styled[KEYS.__style__] = style;
120
124
  return elem;
121
125
  };
122
- styled[KEYS.__styles__] = styles;
123
- const set = (args, newStyle) => {
124
- const newStyles = create(args);
126
+ _styled[KEYS.__styles__] = styles;
127
+ var set = function set2(args, newStyle) {
128
+ var newStyles = create(args);
125
129
  stack.push([styles, style]);
126
130
  styles = newStyles;
127
131
  style = newStyle;
128
132
  if (styles[KEYS.__style__]) {
129
133
  style = style ? Object.assign({}, style, styles[KEYS.__style__]) : styles[KEYS.__style__];
130
134
  }
131
- styled[KEYS.__styles__] = styles;
132
- styled[KEYS.__style__] = style;
133
- };
134
- const USE_PREFIX = "use--";
135
- const ELEMENT_PREFIX = "__";
136
- const MOD_PREFIX = "_";
137
- const MOD_SEPARATOR = "_";
138
- const parseElement = (name) => name.replace(ELEMENT_PREFIX, "");
139
- const parseAttribute = (name) => name.replace(MOD_PREFIX, "").split(MOD_SEPARATOR);
140
- const appendClassName = (className, cn = "") => {
135
+ _styled[KEYS.__styles__] = styles;
136
+ _styled[KEYS.__style__] = style;
137
+ };
138
+ var USE_PREFIX = "use--";
139
+ var ELEMENT_PREFIX = "__";
140
+ var MOD_PREFIX = "_";
141
+ var MOD_SEPARATOR = "_";
142
+ var parseElement = function parseElement2(name) {
143
+ return name.replace(ELEMENT_PREFIX, "");
144
+ };
145
+ var parseAttribute = function parseAttribute2(name) {
146
+ return name.replace(MOD_PREFIX, "").split(MOD_SEPARATOR);
147
+ };
148
+ var appendClassName = function appendClassName2(className) {
149
+ var cn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
141
150
  if (className) {
142
151
  cn += (cn ? " " : "") + className;
143
152
  }
144
153
  return cn;
145
154
  };
146
- const appendElement = (styles2, key, cn = "") => appendClassName(styles2[ELEMENT_PREFIX + key], cn);
147
- const appendModifier = (styles2, key, value, cn = "") => {
155
+ var appendElement = function appendElement2(styles2, key) {
156
+ var cn = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
157
+ return appendClassName(styles2[ELEMENT_PREFIX + key], cn);
158
+ };
159
+ var appendModifier = function appendModifier2(styles2, key, value) {
160
+ var cn = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
148
161
  if (value === void 0 || value === null || value === false || value === "") return cn;
149
162
  cn = appendClassName(styles2[MOD_PREFIX + key], cn);
150
- if (typeof value === "boolean" || typeof value === "object" || typeof value === "function") return cn;
163
+ if (typeof value === "boolean" || _typeof(value) === "object" || typeof value === "function") return cn;
151
164
  cn = appendClassName(styles2[MOD_SEPARATOR + key + MOD_SEPARATOR + value], cn);
152
165
  return cn;
153
166
  };
154
167
  function map(element) {
155
- const currStyles = styled[KEYS.__styles__];
156
- const nextProps = {};
157
- let cn = appendElement(currStyles, element);
158
- let vars = null;
159
- const uses = currStyles[KEYS.__use__] || {};
160
- const len = arguments.length;
161
- let useProps;
162
- for (let i = len - 1; i > 0; i--) {
163
- const currProps = arguments[i];
168
+ var currStyles = _styled[KEYS.__styles__];
169
+ var nextProps = {};
170
+ var cn = appendElement(currStyles, element);
171
+ var vars = null;
172
+ var uses = currStyles[KEYS.__use__] || {};
173
+ var len = arguments.length;
174
+ var useProps;
175
+ for (var i = len - 1; i > 0; i--) {
176
+ var currProps = arguments[i];
164
177
  if (!currProps) continue;
165
178
  useProps = useProps || currProps[KEYS.__use__];
166
179
  if (!vars && KEYS.__style__ in currProps) {
167
- vars = styled[KEYS.__style__];
180
+ vars = _styled[KEYS.__style__];
168
181
  }
169
- for (const key in currProps) {
182
+ for (var key in currProps) {
170
183
  if (key === KEYS.__use__ || key === KEYS.__style__ || key in nextProps) {
171
184
  continue;
172
185
  }
173
- const value = currProps[key];
186
+ var value = currProps[key];
174
187
  cn = appendModifier(currStyles, key, value, cn);
175
- const valueType = typeof value;
188
+ var valueType = _typeof(value);
176
189
  if (valueType === "string" || valueType === "boolean" || valueType === "number") {
177
- const useKey = key + "_" + value;
190
+ var useKey = key + "_" + value;
178
191
  if (key + "_true" in uses || useKey in uses) {
179
192
  cn = appendModifier(currStyles, USE_PREFIX + key, value, cn);
180
193
  if (uses[useKey]) {
@@ -186,9 +199,9 @@ function map(element) {
186
199
  }
187
200
  }
188
201
  if (useProps) {
189
- for (const key in useProps) {
190
- const value = useProps[key];
191
- cn = appendModifier(currStyles, USE_PREFIX + key, value, cn);
202
+ for (var _key in useProps) {
203
+ var _value = useProps[_key];
204
+ cn = appendModifier(currStyles, USE_PREFIX + _key, _value, cn);
192
205
  }
193
206
  }
194
207
  cn = appendClassName(nextProps[KEYS.__classProp__], cn);
@@ -216,6 +229,6 @@ export {
216
229
  parseAttribute,
217
230
  parseElement,
218
231
  set,
219
- styled,
232
+ _styled as styled,
220
233
  use
221
234
  };
@@ -1,25 +1,28 @@
1
- import cn from "classnames";
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import _cn from "classnames";
2
3
  import { getStyles as getStyles$1 } from "./reshadow-core.mjs";
3
- const RESHADOW_ID = "__reshadow__";
4
- const isSSR = !(typeof window !== "undefined" && window.document && window.document.createElement);
5
- const serverMap = getStyles$1().map;
6
- const getStyles = () => ({
7
- map: serverMap,
8
- get css() {
9
- let serverStyles = "";
10
- for (const id in serverMap) {
11
- serverStyles += `<style type='text/css' id='${id}'>${serverMap[id]}</style>`;
4
+ var RESHADOW_ID = "__reshadow__";
5
+ var isSSR = !(typeof window !== "undefined" && window.document && window.document.createElement);
6
+ var serverMap = getStyles$1().map;
7
+ var getStyles = function getStyles2() {
8
+ return {
9
+ map: serverMap,
10
+ get css() {
11
+ var serverStyles = "";
12
+ for (var id in serverMap) {
13
+ serverStyles += "<style type='text/css' id='".concat(id, "'>").concat(serverMap[id], "</style>");
14
+ }
15
+ return serverStyles;
12
16
  }
13
- return serverStyles;
14
- }
15
- });
17
+ };
18
+ };
16
19
  function insert(code, hash) {
17
- const id = "reshadow-".concat(hash);
20
+ var id = "reshadow-".concat(hash);
18
21
  if (isSSR) {
19
22
  serverMap[id] = code;
20
23
  return;
21
24
  }
22
- let container = document.getElementById(RESHADOW_ID);
25
+ var container = document.getElementById(RESHADOW_ID);
23
26
  if (!container) {
24
27
  container = document.createElement("object");
25
28
  container.id = RESHADOW_ID;
@@ -31,7 +34,7 @@ function insert(code, hash) {
31
34
  });
32
35
  }
33
36
  }
34
- let css = document.getElementById(id);
37
+ var css = document.getElementById(id);
35
38
  if (!css) {
36
39
  css = document.createElement("style");
37
40
  css.id = id;
@@ -40,30 +43,35 @@ function insert(code, hash) {
40
43
  }
41
44
  css.innerHTML = code;
42
45
  }
43
- function merge(s1 = {}, s2 = {}) {
44
- return Object.entries(s2).reduce((acc, [key, value]) => {
46
+ function merge() {
47
+ var s1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
48
+ var s2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
49
+ return Object.entries(s2).reduce(function(acc, _ref) {
50
+ var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
45
51
  if (key.startsWith("@") || key.startsWith("--")) {
46
52
  acc[key] = value;
47
53
  } else {
48
- acc[key] = cn(acc[key], value);
54
+ acc[key] = _cn(acc[key], value);
49
55
  }
50
56
  return acc;
51
57
  }, Object.assign({}, s1));
52
58
  }
53
59
  function getClassAndVars(styles, name, props) {
54
60
  function getPropValue(key, props2) {
55
- return props2[`use:${key}`] ?? props2[key];
61
+ var _props;
62
+ return (_props = props2["use:".concat(key)]) !== null && _props !== void 0 ? _props : props2[key];
56
63
  }
57
- return Object.entries(styles).reduce((acc, [key, value]) => {
64
+ return Object.entries(styles).reduce(function(acc, _ref3) {
65
+ var _ref4 = _slicedToArray(_ref3, 2), key = _ref4[0], value = _ref4[1];
58
66
  if (key.startsWith("--")) {
59
67
  acc[1][value] = getPropValue(key.substring(2), props);
60
68
  } else if (name === key) {
61
69
  acc[0][value] = true;
62
70
  } else {
63
- const [mod, modValue] = key.split("=");
64
- const propValue = getPropValue(mod, props);
71
+ var _key$split = key.split("="), _key$split2 = _slicedToArray(_key$split, 2), mod = _key$split2[0], modValue = _key$split2[1];
72
+ var propValue = getPropValue(mod, props);
65
73
  if (modValue === void 0) {
66
- acc[0][value] = Boolean(propValue ?? false);
74
+ acc[0][value] = Boolean(propValue !== null && propValue !== void 0 ? propValue : false);
67
75
  } else {
68
76
  acc[0][value] = propValue == modValue;
69
77
  }
@@ -71,13 +79,14 @@ function getClassAndVars(styles, name, props) {
71
79
  return acc;
72
80
  }, [{}, {}]);
73
81
  }
74
- const reshadowMap = /* @__PURE__ */ new WeakMap();
82
+ var reshadowMap = /* @__PURE__ */ new WeakMap();
75
83
  function reshadowToShadow(obj) {
76
84
  if (reshadowMap.has(obj)) {
77
85
  return reshadowMap.get(obj);
78
86
  }
79
- const shadowStyle = Object.entries(obj).reduce((style, [name, value]) => {
80
- let n = name;
87
+ var shadowStyle = Object.entries(obj).reduce(function(style, _ref5) {
88
+ var _ref6 = _slicedToArray(_ref5, 2), name = _ref6[0], value = _ref6[1];
89
+ var n = name;
81
90
  if (name.startsWith("__")) {
82
91
  n = name.replace(/^__/, "");
83
92
  } else if (name.startsWith("_")) {
@@ -89,12 +98,13 @@ function reshadowToShadow(obj) {
89
98
  reshadowMap.set(obj, shadowStyle);
90
99
  return shadowStyle;
91
100
  }
92
- function sstyled(styles = {}) {
101
+ function sstyled() {
102
+ var styles = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
93
103
  return {
94
- cn(name, props) {
95
- const [classes, style] = getClassAndVars(reshadowToShadow(styles), name, props);
104
+ cn: function cn(name, props) {
105
+ var _getClassAndVars = getClassAndVars(reshadowToShadow(styles), name, props), _getClassAndVars2 = _slicedToArray(_getClassAndVars, 2), classes = _getClassAndVars2[0], style = _getClassAndVars2[1];
96
106
  if (Object.keys(classes).length) {
97
- props.className = cn(props.className, classes);
107
+ props.className = _cn(props.className, classes);
98
108
  }
99
109
  if (Object.keys(style).length) {
100
110
  props.style = Object.assign(style, props.style);
@@ -1,18 +1,27 @@
1
- import cn from "classnames";
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _cn from "classnames";
2
3
  import { forkRef } from "./ref.mjs";
3
4
  import "../styled/index.mjs";
4
5
  import { sstyled } from "../styled/sstyled.mjs";
5
- function callAllEventHandlers(...fns) {
6
- return (...args) => !fns.some((fn) => {
7
- let result;
8
- if (fn) {
9
- result = fn(...args);
6
+ function callAllEventHandlers() {
7
+ for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
8
+ fns[_key] = arguments[_key];
9
+ }
10
+ return function() {
11
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
12
+ args[_key2] = arguments[_key2];
10
13
  }
11
- return typeof result === "boolean" && !result;
12
- });
14
+ return !fns.some(function(fn) {
15
+ var result;
16
+ if (fn) {
17
+ result = fn.apply(void 0, args);
18
+ }
19
+ return typeof result === "boolean" && !result;
20
+ });
21
+ };
13
22
  }
14
23
  function assignHandlers(props, source) {
15
- return Object.keys(source).reduce((proxySource, propName) => {
24
+ return Object.keys(source).reduce(function(proxySource, propName) {
16
25
  if (typeof source[propName] === "function" && propName.startsWith("on")) {
17
26
  proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);
18
27
  }
@@ -20,7 +29,7 @@ function assignHandlers(props, source) {
20
29
  }, {});
21
30
  }
22
31
  function assignHandlersInner(props, source) {
23
- return Object.keys(source).reduce((proxySource, propName) => {
32
+ return Object.keys(source).reduce(function(proxySource, propName) {
24
33
  if (propName !== "ref" && propName.startsWith("on")) {
25
34
  if (typeof source[propName] === "function" && typeof props[propName] === "function") {
26
35
  proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);
@@ -33,28 +42,26 @@ function assignHandlersInner(props, source) {
33
42
  return proxySource;
34
43
  }, {});
35
44
  }
36
- function assignProps(props = {}, source = {}) {
45
+ function assignProps() {
46
+ var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
47
+ var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
37
48
  if (props === source) return props;
38
- const newProps = {
39
- ...source,
40
- ...props,
41
- ...assignHandlersInner(props, source)
42
- };
43
- for (const key in source) {
44
- if (key.startsWith("use:")) {
45
- const originalKey = key.slice("use:".length);
46
- newProps[originalKey] = source[key];
49
+ var newProps = _objectSpread(_objectSpread(_objectSpread({}, source), props), assignHandlersInner(props, source));
50
+ for (var _key3 in source) {
51
+ if (_key3.startsWith("use:")) {
52
+ var originalKey = _key3.slice("use:".length);
53
+ newProps[originalKey] = source[_key3];
47
54
  }
48
55
  }
49
- for (const key in props) {
50
- if (key.startsWith("use:")) {
51
- const originalKey = key.slice("use:".length);
52
- newProps[originalKey] = props[key];
56
+ for (var _key4 in props) {
57
+ if (_key4.startsWith("use:")) {
58
+ var _originalKey = _key4.slice("use:".length);
59
+ newProps[_originalKey] = props[_key4];
53
60
  }
54
61
  }
55
- const sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, "ref");
56
- const propsDescriptorRef = Object.getOwnPropertyDescriptor(props, "ref");
57
- if ((sourceDescriptorRef == null ? void 0 : sourceDescriptorRef.configurable) && (propsDescriptorRef == null ? void 0 : propsDescriptorRef.configurable)) {
62
+ var sourceDescriptorRef = Object.getOwnPropertyDescriptor(source, "ref");
63
+ var propsDescriptorRef = Object.getOwnPropertyDescriptor(props, "ref");
64
+ if (sourceDescriptorRef !== null && sourceDescriptorRef !== void 0 && sourceDescriptorRef.configurable && propsDescriptorRef !== null && propsDescriptorRef !== void 0 && propsDescriptorRef.configurable) {
58
65
  newProps.ref = forkRef(source.ref, props.ref);
59
66
  }
60
67
  if (props.forwardRef) {
@@ -62,13 +69,10 @@ function assignProps(props = {}, source = {}) {
62
69
  newProps.forwardRef = newProps.ref;
63
70
  }
64
71
  if (source.style && props.style) {
65
- newProps.style = {
66
- ...source.style,
67
- ...props.style
68
- };
72
+ newProps.style = _objectSpread(_objectSpread({}, source.style), props.style);
69
73
  }
70
74
  if (source.className) {
71
- newProps.className = cn(props.className, source.className);
75
+ newProps.className = _cn(props.className, source.className);
72
76
  }
73
77
  if (source.styles && props.styles) {
74
78
  newProps.styles = sstyled.merge(source.styles, props.styles);
@@ -1,22 +1,24 @@
1
1
  import { createIntlCache, createIntl } from "@formatjs/intl";
2
2
  import React, { createContext } from "react";
3
3
  import { useAsyncI18nMessages } from "./i18nEnhance.mjs";
4
- const Context = /* @__PURE__ */ createContext(void 0);
5
- const {
6
- Provider: I18nProvider,
7
- Consumer: I18nConsumer
8
- } = Context;
9
- const messagesCache = createIntlCache();
10
- const useI18n = (dictionary, locale = "en", fallbackDictionary) => {
11
- const lang = React.useContext(Context) ?? locale;
12
- const resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);
13
- const intl = React.useMemo(() => createIntl({
14
- locale: lang,
15
- messages: resolvedDictionary
16
- }, messagesCache), [resolvedDictionary, lang]);
17
- return React.useCallback((messageId, variables) => {
4
+ var Context = /* @__PURE__ */ createContext(void 0);
5
+ var I18nProvider = Context.Provider, I18nConsumer = Context.Consumer;
6
+ var messagesCache = createIntlCache();
7
+ var useI18n = function useI18n2(dictionary) {
8
+ var _React$useContext;
9
+ var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en";
10
+ var fallbackDictionary = arguments.length > 2 ? arguments[2] : void 0;
11
+ var lang = (_React$useContext = React.useContext(Context)) !== null && _React$useContext !== void 0 ? _React$useContext : locale;
12
+ var resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);
13
+ var intl = React.useMemo(function() {
14
+ return createIntl({
15
+ locale: lang,
16
+ messages: resolvedDictionary
17
+ }, messagesCache);
18
+ }, [resolvedDictionary, lang]);
19
+ return React.useCallback(function(messageId, variables) {
18
20
  return intl.formatMessage({
19
- id: messageId ?? ""
21
+ id: messageId !== null && messageId !== void 0 ? messageId : ""
20
22
  }, variables);
21
23
  }, [intl]);
22
24
  };