@semcore/core 2.39.1 → 16.0.0-prerelease.11

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 (538) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +2 -2
  3. package/lib/LastInteractionType.cjs +57 -0
  4. package/lib/LastInteractionType.cjs.map +1 -0
  5. package/lib/LastInteractionType.d.ts +11 -0
  6. package/lib/LastInteractionType.mjs +51 -0
  7. package/lib/LastInteractionType.mjs.map +1 -0
  8. package/lib/core-types/Component.cjs +59 -0
  9. package/lib/core-types/Component.cjs.map +1 -0
  10. package/lib/core-types/Component.d.ts +189 -0
  11. package/lib/core-types/Component.mjs +51 -0
  12. package/lib/core-types/Component.mjs.map +1 -0
  13. package/lib/core-types/UnknownProperties.cjs +2 -0
  14. package/lib/core-types/UnknownProperties.cjs.map +1 -0
  15. package/lib/core-types/UnknownProperties.d.ts +3 -0
  16. package/lib/core-types/UnknownProperties.mjs +2 -0
  17. package/lib/core-types/UnknownProperties.mjs.map +1 -0
  18. package/lib/core-types/reshadow.d.cjs +2 -0
  19. package/lib/core-types/reshadow.d.cjs.map +1 -0
  20. package/lib/core-types/reshadow.d.mjs +2 -0
  21. package/lib/core-types/reshadow.d.mjs.map +1 -0
  22. package/lib/core-types/symbols.cjs +25 -0
  23. package/lib/core-types/symbols.cjs.map +1 -0
  24. package/lib/core-types/symbols.d.ts +9 -0
  25. package/lib/core-types/symbols.mjs +20 -0
  26. package/lib/core-types/symbols.mjs.map +1 -0
  27. package/lib/coreFactory.cjs +352 -0
  28. package/lib/coreFactory.cjs.map +1 -0
  29. package/lib/coreFactory.d.ts +27 -0
  30. package/lib/coreFactory.mjs +324 -0
  31. package/lib/coreFactory.mjs.map +1 -0
  32. package/lib/enhancement/Children.cjs +119 -0
  33. package/lib/enhancement/Children.cjs.map +1 -0
  34. package/lib/enhancement/Children.d.ts +5 -0
  35. package/lib/enhancement/Children.mjs +96 -0
  36. package/lib/enhancement/Children.mjs.map +1 -0
  37. package/lib/enhancement/Root.cjs +78 -0
  38. package/lib/enhancement/Root.cjs.map +1 -0
  39. package/lib/enhancement/Root.d.ts +6 -0
  40. package/lib/enhancement/Root.mjs +56 -0
  41. package/lib/enhancement/Root.mjs.map +1 -0
  42. package/lib/enhancement/bindHandler.cjs +54 -0
  43. package/lib/enhancement/bindHandler.cjs.map +1 -0
  44. package/lib/enhancement/bindHandler.d.ts +5 -0
  45. package/lib/enhancement/bindHandler.mjs +48 -0
  46. package/lib/enhancement/bindHandler.mjs.map +1 -0
  47. package/lib/enhancement/dataName.cjs +20 -0
  48. package/lib/enhancement/dataName.cjs.map +1 -0
  49. package/lib/enhancement/dataName.d.ts +4 -0
  50. package/lib/enhancement/dataName.mjs +13 -0
  51. package/lib/enhancement/dataName.mjs.map +1 -0
  52. package/lib/enhancement/enhance.cjs +22 -0
  53. package/lib/enhancement/enhance.cjs.map +1 -0
  54. package/lib/enhancement/enhance.d.ts +5 -0
  55. package/lib/enhancement/enhance.mjs +16 -0
  56. package/lib/enhancement/enhance.mjs.map +1 -0
  57. package/lib/enhancement/functionDefaultProps.cjs +36 -0
  58. package/lib/enhancement/functionDefaultProps.cjs.map +1 -0
  59. package/lib/enhancement/functionDefaultProps.d.ts +8 -0
  60. package/lib/enhancement/functionDefaultProps.mjs +29 -0
  61. package/lib/enhancement/functionDefaultProps.mjs.map +1 -0
  62. package/lib/enhancement/hoistProps.cjs +97 -0
  63. package/lib/enhancement/hoistProps.cjs.map +1 -0
  64. package/lib/enhancement/hoistProps.d.ts +10 -0
  65. package/lib/enhancement/hoistProps.mjs +78 -0
  66. package/lib/enhancement/hoistProps.mjs.map +1 -0
  67. package/lib/enhancement/i18n.cjs +28 -0
  68. package/lib/enhancement/i18n.cjs.map +1 -0
  69. package/lib/enhancement/i18n.d.ts +4 -0
  70. package/lib/enhancement/i18n.mjs +20 -0
  71. package/lib/enhancement/i18n.mjs.map +1 -0
  72. package/lib/enhancement/inheritedName.cjs +23 -0
  73. package/lib/enhancement/inheritedName.cjs.map +1 -0
  74. package/lib/enhancement/inheritedName.d.ts +8 -0
  75. package/lib/enhancement/inheritedName.mjs +16 -0
  76. package/lib/enhancement/inheritedName.mjs.map +1 -0
  77. package/lib/enhancement/staticChildren.cjs +135 -0
  78. package/lib/enhancement/staticChildren.cjs.map +1 -0
  79. package/lib/enhancement/staticChildren.d.ts +13 -0
  80. package/lib/enhancement/staticChildren.mjs +120 -0
  81. package/lib/enhancement/staticChildren.mjs.map +1 -0
  82. package/lib/enhancement/style.cjs +60 -0
  83. package/lib/enhancement/style.cjs.map +1 -0
  84. package/lib/enhancement/style.d.ts +9 -0
  85. package/lib/enhancement/style.mjs +49 -0
  86. package/lib/enhancement/style.mjs.map +1 -0
  87. package/lib/enhancement/uncontrolledProps.cjs +131 -0
  88. package/lib/enhancement/uncontrolledProps.cjs.map +1 -0
  89. package/lib/enhancement/uncontrolledProps.d.ts +7 -0
  90. package/lib/enhancement/uncontrolledProps.mjs +107 -0
  91. package/lib/enhancement/uncontrolledProps.mjs.map +1 -0
  92. package/lib/esm/LastInteractionType.mjs +51 -0
  93. package/lib/esm/core-types/Component.mjs +51 -0
  94. package/lib/esm/core-types/symbols.mjs +20 -0
  95. package/lib/esm/coreFactory.mjs +324 -0
  96. package/lib/esm/enhancement/Children.mjs +96 -0
  97. package/lib/esm/enhancement/Root.mjs +56 -0
  98. package/lib/esm/enhancement/bindHandler.mjs +48 -0
  99. package/lib/esm/enhancement/dataName.mjs +13 -0
  100. package/lib/esm/enhancement/enhance.mjs +16 -0
  101. package/lib/esm/enhancement/functionDefaultProps.mjs +29 -0
  102. package/lib/esm/enhancement/hoistProps.mjs +78 -0
  103. package/lib/esm/enhancement/i18n.mjs +20 -0
  104. package/lib/esm/enhancement/inheritedName.mjs +16 -0
  105. package/lib/esm/enhancement/staticChildren.mjs +120 -0
  106. package/lib/esm/enhancement/style.mjs +49 -0
  107. package/lib/esm/enhancement/uncontrolledProps.mjs +107 -0
  108. package/lib/esm/index.mjs +22 -4
  109. package/lib/esm/register.mjs +31 -0
  110. package/lib/esm/styled/index.mjs +8 -0
  111. package/lib/esm/styled/reshadow-core.mjs +234 -0
  112. package/lib/esm/styled/sstyled.mjs +121 -0
  113. package/lib/esm/utils/assignProps.mjs +86 -0
  114. package/lib/esm/utils/canUseDOM.mjs +6 -0
  115. package/lib/esm/utils/capitalizeFirstLetter.mjs +6 -0
  116. package/lib/esm/utils/createHoc.mjs +44 -0
  117. package/lib/esm/utils/enhances/WithI18n.mjs +78 -0
  118. package/lib/esm/utils/enhances/i18nEnhance.mjs +91 -0
  119. package/lib/esm/utils/getDisplayName.mjs +6 -0
  120. package/lib/esm/utils/logger.mjs +35 -0
  121. package/lib/esm/utils/pick.mjs +15 -0
  122. package/lib/esm/utils/ref.mjs +86 -0
  123. package/lib/esm/utils/use/useEnhancedEffect.mjs +6 -0
  124. package/lib/index.cjs +103 -0
  125. package/lib/index.cjs.map +1 -0
  126. package/lib/index.d.ts +11 -0
  127. package/lib/index.mjs +24 -0
  128. package/lib/index.mjs.map +1 -0
  129. package/lib/register.cjs +37 -0
  130. package/lib/register.cjs.map +1 -0
  131. package/lib/register.d.ts +8 -0
  132. package/lib/register.mjs +31 -0
  133. package/lib/register.mjs.map +1 -0
  134. package/lib/styled/index.cjs +32 -0
  135. package/lib/styled/index.cjs.map +1 -0
  136. package/lib/styled/index.d.ts +11 -0
  137. package/lib/styled/index.mjs +8 -0
  138. package/lib/styled/index.mjs.map +1 -0
  139. package/lib/styled/reshadow-core.cjs +256 -0
  140. package/lib/styled/reshadow-core.cjs.map +1 -0
  141. package/lib/styled/reshadow-core.d.ts +37 -0
  142. package/lib/styled/reshadow-core.mjs +234 -0
  143. package/lib/styled/reshadow-core.mjs.map +1 -0
  144. package/lib/styled/sstyled.cjs +149 -0
  145. package/lib/styled/sstyled.cjs.map +1 -0
  146. package/lib/styled/sstyled.d.ts +17 -0
  147. package/lib/styled/sstyled.mjs +121 -0
  148. package/lib/styled/sstyled.mjs.map +1 -0
  149. package/lib/theme/dark.json +2506 -0
  150. package/lib/theme/exclude-tokens.json +10 -0
  151. package/lib/theme/light.json +2584 -0
  152. package/lib/theme/processor.cjs +315 -0
  153. package/lib/theme/processor.cjs.map +1 -0
  154. package/lib/theme/processor.d.ts +1 -0
  155. package/lib/theme/processor.mjs +307 -0
  156. package/lib/theme/processor.mjs.map +1 -0
  157. package/lib/theme/themes/auto.css +1465 -0
  158. package/lib/theme/themes/dark.cjs +385 -0
  159. package/lib/theme/themes/dark.cjs.map +1 -0
  160. package/lib/theme/themes/dark.css +723 -0
  161. package/lib/theme/themes/dark.d.ts +378 -0
  162. package/lib/theme/themes/dark.mjs +378 -0
  163. package/lib/theme/themes/dark.mjs.map +1 -0
  164. package/lib/theme/themes/default.cjs +394 -0
  165. package/lib/theme/themes/default.cjs.map +1 -0
  166. package/lib/theme/themes/default.css +742 -0
  167. package/lib/theme/themes/default.d.ts +387 -0
  168. package/lib/theme/themes/default.mjs +387 -0
  169. package/lib/theme/themes/default.mjs.map +1 -0
  170. package/lib/theme/themes/light.cjs +394 -0
  171. package/lib/theme/themes/light.cjs.map +1 -0
  172. package/lib/theme/themes/light.css +742 -0
  173. package/lib/theme/themes/light.d.ts +387 -0
  174. package/lib/theme/themes/light.mjs +387 -0
  175. package/lib/theme/themes/light.mjs.map +1 -0
  176. package/lib/theme/utils.cjs +297 -0
  177. package/lib/theme/utils.cjs.map +1 -0
  178. package/lib/theme/utils.d.ts +52 -0
  179. package/lib/theme/utils.mjs +286 -0
  180. package/lib/theme/utils.mjs.map +1 -0
  181. package/lib/utils/CSSinJS.cjs +36 -0
  182. package/lib/utils/CSSinJS.cjs.map +1 -0
  183. package/lib/utils/CSSinJS.d.ts +5 -0
  184. package/lib/utils/CSSinJS.mjs +28 -0
  185. package/lib/utils/CSSinJS.mjs.map +1 -0
  186. package/lib/utils/ScreenReaderOnly.cjs +31 -0
  187. package/lib/utils/ScreenReaderOnly.cjs.map +1 -0
  188. package/lib/utils/ScreenReaderOnly.d.ts +8 -0
  189. package/lib/utils/ScreenReaderOnly.mjs +24 -0
  190. package/lib/utils/ScreenReaderOnly.mjs.map +1 -0
  191. package/lib/utils/ThemeProvider.cjs +82 -0
  192. package/lib/utils/ThemeProvider.cjs.map +1 -0
  193. package/lib/utils/ThemeProvider.d.ts +15 -0
  194. package/lib/utils/ThemeProvider.mjs +71 -0
  195. package/lib/utils/ThemeProvider.mjs.map +1 -0
  196. package/lib/utils/addonText.cjs +18 -0
  197. package/lib/utils/addonText.cjs.map +1 -0
  198. package/lib/utils/addonText.d.ts +2 -0
  199. package/lib/utils/addonText.mjs +11 -0
  200. package/lib/utils/addonText.mjs.map +1 -0
  201. package/lib/utils/addonTextChildren.cjs +45 -0
  202. package/lib/utils/addonTextChildren.cjs.map +1 -0
  203. package/lib/utils/addonTextChildren.d.ts +3 -0
  204. package/lib/utils/addonTextChildren.mjs +37 -0
  205. package/lib/utils/addonTextChildren.mjs.map +1 -0
  206. package/lib/utils/ariaProps.cjs +22 -0
  207. package/lib/utils/ariaProps.cjs.map +1 -0
  208. package/lib/utils/ariaProps.d.ts +12 -0
  209. package/lib/utils/ariaProps.mjs +16 -0
  210. package/lib/utils/ariaProps.mjs.map +1 -0
  211. package/lib/utils/assignProps.cjs +93 -0
  212. package/lib/utils/assignProps.cjs.map +1 -0
  213. package/lib/utils/assignProps.d.ts +11 -0
  214. package/lib/utils/assignProps.mjs +86 -0
  215. package/lib/utils/assignProps.mjs.map +1 -0
  216. package/lib/utils/canUseDOM.cjs +10 -0
  217. package/lib/utils/canUseDOM.cjs.map +1 -0
  218. package/lib/utils/canUseDOM.d.ts +1 -0
  219. package/lib/utils/canUseDOM.mjs +6 -0
  220. package/lib/utils/canUseDOM.mjs.map +1 -0
  221. package/lib/utils/capitalizeFirstLetter.cjs +10 -0
  222. package/lib/utils/capitalizeFirstLetter.cjs.map +1 -0
  223. package/lib/utils/capitalizeFirstLetter.d.ts +1 -0
  224. package/lib/utils/capitalizeFirstLetter.mjs +6 -0
  225. package/lib/utils/capitalizeFirstLetter.mjs.map +1 -0
  226. package/lib/utils/color.cjs +208 -0
  227. package/lib/utils/color.cjs.map +1 -0
  228. package/lib/utils/color.d.ts +5 -0
  229. package/lib/utils/color.mjs +196 -0
  230. package/lib/utils/color.mjs.map +1 -0
  231. package/lib/utils/compose.cjs +21 -0
  232. package/lib/utils/compose.cjs.map +1 -0
  233. package/lib/utils/compose.d.ts +1 -0
  234. package/lib/utils/compose.mjs +15 -0
  235. package/lib/utils/compose.mjs.map +1 -0
  236. package/lib/utils/createHoc.cjs +55 -0
  237. package/lib/utils/createHoc.cjs.map +1 -0
  238. package/lib/utils/createHoc.d.ts +3 -0
  239. package/lib/utils/createHoc.mjs +44 -0
  240. package/lib/utils/createHoc.mjs.map +1 -0
  241. package/lib/utils/createUUID.cjs +15 -0
  242. package/lib/utils/createUUID.cjs.map +1 -0
  243. package/lib/utils/createUUID.d.ts +1 -0
  244. package/lib/utils/createUUID.mjs +9 -0
  245. package/lib/utils/createUUID.mjs.map +1 -0
  246. package/lib/utils/cssToIntDefault.cjs +22 -0
  247. package/lib/utils/cssToIntDefault.cjs.map +1 -0
  248. package/lib/utils/cssToIntDefault.d.ts +8 -0
  249. package/lib/utils/cssToIntDefault.mjs +16 -0
  250. package/lib/utils/cssToIntDefault.mjs.map +1 -0
  251. package/lib/utils/enhances/WithAutoFocus.cjs +75 -0
  252. package/lib/utils/enhances/WithAutoFocus.cjs.map +1 -0
  253. package/lib/utils/enhances/WithAutoFocus.d.ts +14 -0
  254. package/lib/utils/enhances/WithAutoFocus.mjs +67 -0
  255. package/lib/utils/enhances/WithAutoFocus.mjs.map +1 -0
  256. package/lib/utils/enhances/WithCSS.cjs +93 -0
  257. package/lib/utils/enhances/WithCSS.cjs.map +1 -0
  258. package/lib/utils/enhances/WithCSS.d.ts +41 -0
  259. package/lib/utils/enhances/WithCSS.mjs +79 -0
  260. package/lib/utils/enhances/WithCSS.mjs.map +1 -0
  261. package/lib/utils/enhances/WithI18n.cjs +95 -0
  262. package/lib/utils/enhances/WithI18n.cjs.map +1 -0
  263. package/lib/utils/enhances/WithI18n.d.ts +43 -0
  264. package/lib/utils/enhances/WithI18n.mjs +78 -0
  265. package/lib/utils/enhances/WithI18n.mjs.map +1 -0
  266. package/lib/utils/enhances/WithKeyboardFocus.cjs +93 -0
  267. package/lib/utils/enhances/WithKeyboardFocus.cjs.map +1 -0
  268. package/lib/utils/enhances/WithKeyboardFocus.d.ts +45 -0
  269. package/lib/utils/enhances/WithKeyboardFocus.mjs +84 -0
  270. package/lib/utils/enhances/WithKeyboardFocus.mjs.map +1 -0
  271. package/lib/utils/enhances/WithRef.cjs +26 -0
  272. package/lib/utils/enhances/WithRef.cjs.map +1 -0
  273. package/lib/utils/enhances/WithRef.d.ts +3 -0
  274. package/lib/utils/enhances/WithRef.mjs +18 -0
  275. package/lib/utils/enhances/WithRef.mjs.map +1 -0
  276. package/lib/utils/enhances/a11yEnhance.cjs +74 -0
  277. package/lib/utils/enhances/a11yEnhance.cjs.map +1 -0
  278. package/lib/utils/enhances/a11yEnhance.d.ts +10 -0
  279. package/lib/utils/enhances/a11yEnhance.mjs +66 -0
  280. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -0
  281. package/lib/utils/enhances/animatedSizeEnhance.cjs +98 -0
  282. package/lib/utils/enhances/animatedSizeEnhance.cjs.map +1 -0
  283. package/lib/utils/enhances/animatedSizeEnhance.d.ts +12 -0
  284. package/lib/utils/enhances/animatedSizeEnhance.mjs +90 -0
  285. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -0
  286. package/lib/utils/enhances/autoFocusEnhance.cjs +46 -0
  287. package/lib/utils/enhances/autoFocusEnhance.cjs.map +1 -0
  288. package/lib/utils/enhances/autoFocusEnhance.d.ts +10 -0
  289. package/lib/utils/enhances/autoFocusEnhance.mjs +38 -0
  290. package/lib/utils/enhances/autoFocusEnhance.mjs.map +1 -0
  291. package/lib/utils/enhances/contextEnhance.cjs +22 -0
  292. package/lib/utils/enhances/contextEnhance.cjs.map +1 -0
  293. package/lib/utils/enhances/contextEnhance.d.ts +3 -0
  294. package/lib/utils/enhances/contextEnhance.mjs +14 -0
  295. package/lib/utils/enhances/contextEnhance.mjs.map +1 -0
  296. package/lib/utils/enhances/i18nEnhance.cjs +101 -0
  297. package/lib/utils/enhances/i18nEnhance.cjs.map +1 -0
  298. package/lib/utils/enhances/i18nEnhance.d.ts +25 -0
  299. package/lib/utils/enhances/i18nEnhance.mjs +91 -0
  300. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -0
  301. package/lib/utils/enhances/keyboardFocusEnhance.cjs +63 -0
  302. package/lib/utils/enhances/keyboardFocusEnhance.cjs.map +1 -0
  303. package/lib/utils/enhances/keyboardFocusEnhance.d.ts +27 -0
  304. package/lib/utils/enhances/keyboardFocusEnhance.mjs +57 -0
  305. package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +1 -0
  306. package/lib/utils/enhances/resolveColorEnhance.cjs +25 -0
  307. package/lib/utils/enhances/resolveColorEnhance.cjs.map +1 -0
  308. package/lib/utils/enhances/resolveColorEnhance.d.ts +2 -0
  309. package/lib/utils/enhances/resolveColorEnhance.mjs +17 -0
  310. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -0
  311. package/lib/utils/eventEmitter.cjs +41 -0
  312. package/lib/utils/eventEmitter.cjs.map +1 -0
  313. package/lib/utils/eventEmitter.d.ts +9 -0
  314. package/lib/utils/eventEmitter.mjs +34 -0
  315. package/lib/utils/eventEmitter.mjs.map +1 -0
  316. package/lib/utils/findComponent.cjs +106 -0
  317. package/lib/utils/findComponent.cjs.map +1 -0
  318. package/lib/utils/findComponent.d.ts +12 -0
  319. package/lib/utils/findComponent.mjs +95 -0
  320. package/lib/utils/findComponent.mjs.map +1 -0
  321. package/lib/utils/fire.cjs +23 -0
  322. package/lib/utils/fire.cjs.map +1 -0
  323. package/lib/utils/fire.d.ts +2 -0
  324. package/lib/utils/fire.mjs +15 -0
  325. package/lib/utils/fire.mjs.map +1 -0
  326. package/lib/utils/focus-lock/focusBorders.cjs +72 -0
  327. package/lib/utils/focus-lock/focusBorders.cjs.map +1 -0
  328. package/lib/utils/focus-lock/focusBorders.d.ts +4 -0
  329. package/lib/utils/focus-lock/focusBorders.mjs +62 -0
  330. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -0
  331. package/lib/utils/focus-lock/getFocusableIn.cjs +26 -0
  332. package/lib/utils/focus-lock/getFocusableIn.cjs.map +1 -0
  333. package/lib/utils/focus-lock/getFocusableIn.d.ts +1 -0
  334. package/lib/utils/focus-lock/getFocusableIn.mjs +19 -0
  335. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -0
  336. package/lib/utils/focus-lock/isFocusInside.cjs +16 -0
  337. package/lib/utils/focus-lock/isFocusInside.cjs.map +1 -0
  338. package/lib/utils/focus-lock/isFocusInside.d.ts +1 -0
  339. package/lib/utils/focus-lock/isFocusInside.mjs +9 -0
  340. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -0
  341. package/lib/utils/focus-lock/isFocusable.cjs +51 -0
  342. package/lib/utils/focus-lock/isFocusable.cjs.map +1 -0
  343. package/lib/utils/focus-lock/isFocusable.d.ts +1 -0
  344. package/lib/utils/focus-lock/isFocusable.mjs +43 -0
  345. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -0
  346. package/lib/utils/focus-lock/setFocus.cjs +63 -0
  347. package/lib/utils/focus-lock/setFocus.cjs.map +1 -0
  348. package/lib/utils/focus-lock/setFocus.d.ts +1 -0
  349. package/lib/utils/focus-lock/setFocus.mjs +55 -0
  350. package/lib/utils/focus-lock/setFocus.mjs.map +1 -0
  351. package/lib/utils/getAccessibleName.cjs +56 -0
  352. package/lib/utils/getAccessibleName.cjs.map +1 -0
  353. package/lib/utils/getAccessibleName.d.ts +1 -0
  354. package/lib/utils/getAccessibleName.mjs +49 -0
  355. package/lib/utils/getAccessibleName.mjs.map +1 -0
  356. package/lib/utils/getDisplayName.cjs +10 -0
  357. package/lib/utils/getDisplayName.cjs.map +1 -0
  358. package/lib/utils/getDisplayName.d.ts +2 -0
  359. package/lib/utils/getDisplayName.mjs +6 -0
  360. package/lib/utils/getDisplayName.mjs.map +1 -0
  361. package/lib/utils/getEventTarget.cjs +53 -0
  362. package/lib/utils/getEventTarget.cjs.map +1 -0
  363. package/lib/utils/getEventTarget.d.ts +1 -0
  364. package/lib/utils/getEventTarget.mjs +45 -0
  365. package/lib/utils/getEventTarget.mjs.map +1 -0
  366. package/lib/utils/getOriginChildren.cjs +18 -0
  367. package/lib/utils/getOriginChildren.cjs.map +1 -0
  368. package/lib/utils/getOriginChildren.d.ts +2 -0
  369. package/lib/utils/getOriginChildren.mjs +10 -0
  370. package/lib/utils/getOriginChildren.mjs.map +1 -0
  371. package/lib/utils/getRandomInt.cjs +11 -0
  372. package/lib/utils/getRandomInt.cjs.map +1 -0
  373. package/lib/utils/getRandomInt.d.ts +1 -0
  374. package/lib/utils/getRandomInt.mjs +5 -0
  375. package/lib/utils/getRandomInt.mjs.map +1 -0
  376. package/lib/utils/getValue.cjs +16 -0
  377. package/lib/utils/getValue.cjs.map +1 -0
  378. package/lib/utils/getValue.d.ts +1 -0
  379. package/lib/utils/getValue.mjs +10 -0
  380. package/lib/utils/getValue.mjs.map +1 -0
  381. package/lib/utils/hasLabels.cjs +47 -0
  382. package/lib/utils/hasLabels.cjs.map +1 -0
  383. package/lib/utils/hasLabels.d.ts +7 -0
  384. package/lib/utils/hasLabels.mjs +39 -0
  385. package/lib/utils/hasLabels.mjs.map +1 -0
  386. package/lib/utils/hasParent.cjs +14 -0
  387. package/lib/utils/hasParent.cjs.map +1 -0
  388. package/lib/utils/hasParent.d.ts +1 -0
  389. package/lib/utils/hasParent.mjs +7 -0
  390. package/lib/utils/hasParent.mjs.map +1 -0
  391. package/lib/utils/if.cjs +16 -0
  392. package/lib/utils/if.cjs.map +1 -0
  393. package/lib/utils/if.d.ts +11 -0
  394. package/lib/utils/if.mjs +9 -0
  395. package/lib/utils/if.mjs.map +1 -0
  396. package/lib/utils/ifChildren.cjs +17 -0
  397. package/lib/utils/ifChildren.cjs.map +1 -0
  398. package/lib/utils/ifChildren.d.ts +8 -0
  399. package/lib/utils/ifChildren.mjs +10 -0
  400. package/lib/utils/ifChildren.mjs.map +1 -0
  401. package/lib/utils/injectStyle.cjs +49 -0
  402. package/lib/utils/injectStyle.cjs.map +1 -0
  403. package/lib/utils/injectStyle.d.ts +2 -0
  404. package/lib/utils/injectStyle.mjs +41 -0
  405. package/lib/utils/injectStyle.mjs.map +1 -0
  406. package/lib/utils/inputProps.cjs +22 -0
  407. package/lib/utils/inputProps.cjs.map +1 -0
  408. package/lib/utils/inputProps.d.ts +2 -0
  409. package/lib/utils/inputProps.mjs +14 -0
  410. package/lib/utils/inputProps.mjs.map +1 -0
  411. package/lib/utils/isNode.cjs +28 -0
  412. package/lib/utils/isNode.cjs.map +1 -0
  413. package/lib/utils/isNode.d.ts +1 -0
  414. package/lib/utils/isNode.mjs +21 -0
  415. package/lib/utils/isNode.mjs.map +1 -0
  416. package/lib/utils/isPromise.cjs +10 -0
  417. package/lib/utils/isPromise.cjs.map +1 -0
  418. package/lib/utils/isPromise.d.ts +1 -0
  419. package/lib/utils/isPromise.mjs +4 -0
  420. package/lib/utils/isPromise.mjs.map +1 -0
  421. package/lib/utils/isRetina.cjs +15 -0
  422. package/lib/utils/isRetina.cjs.map +1 -0
  423. package/lib/utils/isRetina.d.ts +1 -0
  424. package/lib/utils/isRetina.mjs +9 -0
  425. package/lib/utils/isRetina.mjs.map +1 -0
  426. package/lib/utils/logger.cjs +40 -0
  427. package/lib/utils/logger.cjs.map +1 -0
  428. package/lib/utils/logger.d.ts +9 -0
  429. package/lib/utils/logger.mjs +35 -0
  430. package/lib/utils/logger.mjs.map +1 -0
  431. package/lib/utils/numericChecker.cjs +33 -0
  432. package/lib/utils/numericChecker.cjs.map +1 -0
  433. package/lib/utils/numericChecker.d.ts +5 -0
  434. package/lib/utils/numericChecker.mjs +27 -0
  435. package/lib/utils/numericChecker.mjs.map +1 -0
  436. package/lib/utils/ownerDocument.cjs +10 -0
  437. package/lib/utils/ownerDocument.cjs.map +1 -0
  438. package/lib/utils/ownerDocument.d.ts +1 -0
  439. package/lib/utils/ownerDocument.mjs +4 -0
  440. package/lib/utils/ownerDocument.mjs.map +1 -0
  441. package/lib/utils/pick.cjs +19 -0
  442. package/lib/utils/pick.cjs.map +1 -0
  443. package/lib/utils/pick.d.ts +1 -0
  444. package/lib/utils/pick.mjs +15 -0
  445. package/lib/utils/pick.mjs.map +1 -0
  446. package/lib/utils/propsForElement.cjs +59 -0
  447. package/lib/utils/propsForElement.cjs.map +1 -0
  448. package/lib/utils/propsForElement.d.ts +3 -0
  449. package/lib/utils/propsForElement.mjs +50 -0
  450. package/lib/utils/propsForElement.mjs.map +1 -0
  451. package/lib/utils/rafTrottle.cjs +33 -0
  452. package/lib/utils/rafTrottle.cjs.map +1 -0
  453. package/lib/utils/rafTrottle.d.ts +2 -0
  454. package/lib/utils/rafTrottle.mjs +26 -0
  455. package/lib/utils/rafTrottle.mjs.map +1 -0
  456. package/lib/utils/reactToText.cjs +33 -0
  457. package/lib/utils/reactToText.cjs.map +1 -0
  458. package/lib/utils/reactToText.d.ts +3 -0
  459. package/lib/utils/reactToText.mjs +26 -0
  460. package/lib/utils/reactToText.mjs.map +1 -0
  461. package/lib/utils/ref.cjs +95 -0
  462. package/lib/utils/ref.cjs.map +1 -0
  463. package/lib/utils/ref.d.ts +8 -0
  464. package/lib/utils/ref.mjs +86 -0
  465. package/lib/utils/ref.mjs.map +1 -0
  466. package/lib/utils/setRef.cjs +10 -0
  467. package/lib/utils/setRef.cjs.map +1 -0
  468. package/lib/utils/setRef.d.ts +2 -0
  469. package/lib/utils/setRef.mjs +3 -0
  470. package/lib/utils/setRef.mjs.map +1 -0
  471. package/lib/utils/syncScroll.cjs +61 -0
  472. package/lib/utils/syncScroll.cjs.map +1 -0
  473. package/lib/utils/syncScroll.d.ts +1 -0
  474. package/lib/utils/syncScroll.mjs +54 -0
  475. package/lib/utils/syncScroll.mjs.map +1 -0
  476. package/lib/utils/uncontroll.cjs +47 -0
  477. package/lib/utils/uncontroll.cjs.map +1 -0
  478. package/lib/utils/uncontroll.d.ts +4 -0
  479. package/lib/utils/uncontroll.mjs +38 -0
  480. package/lib/utils/uncontroll.mjs.map +1 -0
  481. package/lib/utils/uniqueID.cjs +42 -0
  482. package/lib/utils/uniqueID.cjs.map +1 -0
  483. package/lib/utils/uniqueID.d.ts +12 -0
  484. package/lib/utils/uniqueID.mjs +33 -0
  485. package/lib/utils/uniqueID.mjs.map +1 -0
  486. package/lib/utils/use/useColorResolver.cjs +208 -0
  487. package/lib/utils/use/useColorResolver.cjs.map +1 -0
  488. package/lib/utils/use/useColorResolver.d.ts +1 -0
  489. package/lib/utils/use/useColorResolver.mjs +200 -0
  490. package/lib/utils/use/useColorResolver.mjs.map +1 -0
  491. package/lib/utils/use/useCss.cjs +20 -0
  492. package/lib/utils/use/useCss.cjs.map +1 -0
  493. package/lib/utils/use/useCss.d.ts +4 -0
  494. package/lib/utils/use/useCss.mjs +12 -0
  495. package/lib/utils/use/useCss.mjs.map +1 -0
  496. package/lib/utils/use/useEnhancedEffect.cjs +13 -0
  497. package/lib/utils/use/useEnhancedEffect.cjs.map +1 -0
  498. package/lib/utils/use/useEnhancedEffect.d.ts +3 -0
  499. package/lib/utils/use/useEnhancedEffect.mjs +6 -0
  500. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -0
  501. package/lib/utils/use/useEventCallback.cjs +25 -0
  502. package/lib/utils/use/useEventCallback.cjs.map +1 -0
  503. package/lib/utils/use/useEventCallback.d.ts +4 -0
  504. package/lib/utils/use/useEventCallback.mjs +19 -0
  505. package/lib/utils/use/useEventCallback.mjs.map +1 -0
  506. package/lib/utils/use/useEventListener.cjs +33 -0
  507. package/lib/utils/use/useEventListener.cjs.map +1 -0
  508. package/lib/utils/use/useEventListener.d.ts +2 -0
  509. package/lib/utils/use/useEventListener.mjs +25 -0
  510. package/lib/utils/use/useEventListener.mjs.map +1 -0
  511. package/lib/utils/use/useFocusLock.cjs +289 -0
  512. package/lib/utils/use/useFocusLock.cjs.map +1 -0
  513. package/lib/utils/use/useFocusLock.d.ts +10 -0
  514. package/lib/utils/use/useFocusLock.mjs +266 -0
  515. package/lib/utils/use/useFocusLock.mjs.map +1 -0
  516. package/lib/utils/use/usePreventScroll.cjs +78 -0
  517. package/lib/utils/use/usePreventScroll.cjs.map +1 -0
  518. package/lib/utils/use/usePreventScroll.d.ts +2 -0
  519. package/lib/utils/use/usePreventScroll.mjs +70 -0
  520. package/lib/utils/use/usePreventScroll.mjs.map +1 -0
  521. package/lib/utils/useCssVariable.cjs +55 -0
  522. package/lib/utils/useCssVariable.cjs.map +1 -0
  523. package/lib/utils/useCssVariable.d.ts +8 -0
  524. package/lib/utils/useCssVariable.mjs +46 -0
  525. package/lib/utils/useCssVariable.mjs.map +1 -0
  526. package/lib/utils/zIndexStacking.cjs +48 -0
  527. package/lib/utils/zIndexStacking.cjs.map +1 -0
  528. package/lib/utils/zIndexStacking.d.ts +8 -0
  529. package/lib/utils/zIndexStacking.mjs +38 -0
  530. package/lib/utils/zIndexStacking.mjs.map +1 -0
  531. package/package.json +272 -10
  532. package/tsconfig-utils.json +4 -0
  533. package/vite.config.ts +24 -0
  534. package/lib/cjs/index.js +0 -23
  535. package/lib/cjs/index.js.map +0 -1
  536. package/lib/es6/index.js +0 -4
  537. package/lib/es6/index.js.map +0 -1
  538. package/lib/types/index.d.ts +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18nEnhance.cjs","names":["_react","_interopRequireDefault","require","_WithI18n","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","React","useMemo","_loop","_locale","_asyncToGenerator2","_regeneratorRuntime2","mark","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","wrap","_callee$","_context","prev","next","Promise","all","sent","_slicedToArray2","abrupt","_objectSpread3","stop","_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","console","error","exports","_default","props","i18n","getI18nText","useI18n"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleKeys, useI18n } from './WithI18n';\nimport { UnknownProperties } from '../../core-types/UnknownProperties';\n\n/** @deprecated */\nexport interface IWithI18nEnhanceProps extends WithI18nEnhanceProps, UnknownProperties {}\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(console.error);\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;AACA,IAAAC,SAAA,GAAAD,OAAA;AAqBO,IAAME,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAC/BC,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,IAAIF,gBAAgB,KAAKE,iBAAiB,EAAE,OAAOF,gBAAgB;IACnE,IAAMI,SAA4B,GAAG,CAAC,CAAC;IAAC,IAAAG,KAAA,YAAAA,MAAAC,OAAA,EACD;MACrC,IACE,OAAOR,gBAAgB,CAACC,OAAM,CAAC,KAAK,UAAU,IAC9C,OAAOC,iBAAiB,CAACD,OAAM,CAAC,KAAK,UAAU,EAC/C;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,IAAIgD,QAAQ,GAAGD,MAAM;QACrB,IAAI,SAAS,IAAIA,MAAM,IAAI,IAAAf,QAAA,aAAOe,MAAM,WAAQ,MAAK,QAAQ,EAAEC,QAAQ,GAAGD,MAAM,WAAQ;QACxFX,QAAQ,CAAC,UAACL,KAAK;UAAA,WAAAL,cAAA,iBAAAA,cAAA,iBACVK,KAAK,WAAAkB,gBAAA,iBACPjD,MAAM,EAAGgD,QAAQ;QAAA,CAClB,CAAC;MACL,CAAC,CAAC,SAEI,CAACE,OAAO,CAACC,KAAK,CAAC;IACzB;EACF,CAAC,EAAE,CAAChD,SAAS,EAAEH,MAAM,CAAC,CAAC;EAEvB,QAAAE,aAAA,GAAO6B,KAAK,CAAC/B,MAAM,CAAC,cAAAE,aAAA,cAAAA,aAAA,GAAIsC,gBAAgB;AAC1C,CAAC;AAACY,OAAA,CAAAtD,oBAAA,GAAAA,oBAAA;AAAA,IAAAuD,QAAA,GACa,SAAAA,SAAClD,SAA6B,EAAK;EAChD,OAAO,UAACmD,KAAU,EAAkD;IAClE,IAAQC,IAAI,GAAaD,KAAK,CAAtBC,IAAI;MAAEvD,MAAM,GAAKsD,KAAK,CAAhBtD,MAAM;IACpB,IAAMwD,WAAW,GAAG,IAAAC,iBAAO,EAACF,IAAI,EAAEvD,MAAM,EAAEG,SAAS,CAAC;IAEpD,WAAAuB,cAAA,iBAAAA,cAAA,iBAAY4B,KAAK;MAAEE,WAAW,EAAXA;IAAW;EAChC,CAAC;AACH,CAAC;AAAAJ,OAAA,cAAAC,QAAA"}
@@ -0,0 +1,25 @@
1
+ import { LocaleKeys, useI18n } from './WithI18n';
2
+ import { UnknownProperties } from '../../core-types/UnknownProperties';
3
+ /** @deprecated */
4
+ export interface IWithI18nEnhanceProps extends WithI18nEnhanceProps, UnknownProperties {
5
+ }
6
+ export type WithI18nEnhanceProps = {
7
+ getI18nText?: (key?: string, variables?: {}) => any;
8
+ i18n?: {
9
+ [locale: string]: {
10
+ [key: string]: string;
11
+ };
12
+ };
13
+ locale?: LocaleKeys;
14
+ };
15
+ type Messages = {
16
+ [messageId: string]: string;
17
+ };
18
+ type MessagesContainer = {
19
+ [locale: string]: Messages | (() => Promise<Messages>);
20
+ };
21
+ export declare const useAsyncI18nMessages: (primaryContainer: MessagesContainer, locale: string, fallbackContainer?: MessagesContainer) => Messages;
22
+ declare const _default: (container?: MessagesContainer) => (props: any) => {
23
+ getI18nText: ReturnType<typeof useI18n>;
24
+ };
25
+ export default _default;
@@ -0,0 +1,91 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _typeof from "@babel/runtime/helpers/esm/typeof";
3
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
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";
7
+ import React from "react";
8
+ import { useI18n } from "./WithI18n.mjs";
9
+ var useAsyncI18nMessages = function useAsyncI18nMessages2(primaryContainer, locale, fallbackContainer) {
10
+ var _store$locale;
11
+ var container = React.useMemo(function() {
12
+ if (!fallbackContainer) return primaryContainer;
13
+ if (!primaryContainer) return fallbackContainer;
14
+ if (primaryContainer === fallbackContainer) return primaryContainer;
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__ */ _regeneratorRuntime().mark(function _callee() {
19
+ var _yield$Promise$all, _yield$Promise$all2, primary, fallback;
20
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
21
+ while (1) switch (_context.prev = _context.next) {
22
+ case 0:
23
+ _context.next = 2;
24
+ return Promise.all([primaryContainer[_locale2], fallbackContainer[_locale2]]);
25
+ case 2:
26
+ _yield$Promise$all = _context.sent;
27
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
28
+ primary = _yield$Promise$all2[0];
29
+ fallback = _yield$Promise$all2[1];
30
+ return _context.abrupt("return", _objectSpread(_objectSpread({}, primary), fallback));
31
+ case 7:
32
+ case "end":
33
+ return _context.stop();
34
+ }
35
+ }, _callee);
36
+ }));
37
+ } else {
38
+ var _primaryContainer$_lo, _fallbackContainer$_l;
39
+ 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 : {});
40
+ }
41
+ };
42
+ for (var _locale in primaryContainer) {
43
+ _loop(_locale);
44
+ }
45
+ return container2;
46
+ }, [primaryContainer, fallbackContainer]);
47
+ var initStore = React.useMemo(function() {
48
+ var store2 = {};
49
+ for (var _locale2 in container) {
50
+ if (_typeof(container[_locale2]) === "object") {
51
+ store2[_locale2] = container[_locale2];
52
+ }
53
+ }
54
+ return store2;
55
+ }, [container]);
56
+ var _React$useState = React.useState(initStore), _React$useState2 = _slicedToArray(_React$useState, 2), store = _React$useState2[0], setStore = _React$useState2[1];
57
+ var lastLoadedLocaleRef = React.useRef(null);
58
+ if (store[locale]) lastLoadedLocaleRef.current = locale;
59
+ var fallbackMessages = React.useMemo(function() {
60
+ return Object.values(store)[0];
61
+ }, [store]);
62
+ var loadingLocaleRef = React.useRef(null);
63
+ React.useEffect(function() {
64
+ loadingLocaleRef.current = locale;
65
+ var asyncMessages = container[locale];
66
+ if (typeof asyncMessages === "function") {
67
+ asyncMessages().then(function(module) {
68
+ if (loadingLocaleRef.current !== locale) return;
69
+ var messages = module;
70
+ if ("default" in module && _typeof(module["default"]) === "object") messages = module["default"];
71
+ setStore(function(store2) {
72
+ return _objectSpread(_objectSpread({}, store2), {}, _defineProperty({}, locale, messages));
73
+ });
74
+ })["catch"](console.error);
75
+ }
76
+ }, [container, locale]);
77
+ return (_store$locale = store[locale]) !== null && _store$locale !== void 0 ? _store$locale : fallbackMessages;
78
+ };
79
+ const i18nEnhance = function(container) {
80
+ return function(props) {
81
+ var i18n = props.i18n, locale = props.locale;
82
+ var getI18nText = useI18n(i18n, locale, container);
83
+ return _objectSpread(_objectSpread({}, props), {}, {
84
+ getI18nText
85
+ });
86
+ };
87
+ };
88
+ export {
89
+ i18nEnhance as default,
90
+ useAsyncI18nMessages
91
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18nEnhance.mjs","names":["React","useI18n","useAsyncI18nMessages","primaryContainer","locale","fallbackContainer","_store$locale","container","useMemo","_loop","_locale","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_yield$Promise$all","_yield$Promise$all2","primary","fallback","wrap","_callee$","_context","prev","next","Promise","all","sent","_slicedToArray","abrupt","_objectSpread","stop","_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","console","error","props","i18n","getI18nText"],"sources":["../../../src/utils/enhances/i18nEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleKeys, useI18n } from './WithI18n';\nimport { UnknownProperties } from '../../core-types/UnknownProperties';\n\n/** @deprecated */\nexport interface IWithI18nEnhanceProps extends WithI18nEnhanceProps, UnknownProperties {}\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(console.error);\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;AACzB,SAAqBC,OAAO,QAAQ,gBAAY;AAqBhD,OAAO,IAAMC,oBAAoB,GAAG,SAAvBA,oBA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,aAAA,CAAAA,aAAA,KAAY0B,KAAK;MAAEE,WAAW,EAAXA;IAAW;EAChC,CAAC;AACH,CAAC"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.enforcedKeyboardFocusEnhanceContext = exports["default"] = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _assignProps = _interopRequireDefault(require("../assignProps"));
11
+ var _LastInteractionType = require("../../LastInteractionType");
12
+ var enforcedKeyboardFocusEnhanceContext = /*#__PURE__*/_react["default"].createContext(false);
13
+ exports.enforcedKeyboardFocusEnhanceContext = enforcedKeyboardFocusEnhanceContext;
14
+ var keyboardFocusEnhance = function keyboardFocusEnhance() {
15
+ var makeFocusable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
16
+ return function (props) {
17
+ var _props$tabIndex;
18
+ var autoFocus = props.autoFocus;
19
+ var disabled = props.disabled || props.loading;
20
+ var tabIndex = (_props$tabIndex = props.tabIndex) !== null && _props$tabIndex !== void 0 ? _props$tabIndex : makeFocusable ? 0 : undefined;
21
+ var _React$useState = _react["default"].useState(false),
22
+ _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
23
+ keyboardFocused = _React$useState2[0],
24
+ setKeyboardFocused = _React$useState2[1];
25
+ var ref = _react["default"].useRef(null);
26
+ var handleFocus = _react["default"].useCallback(function (event) {
27
+ if (event.isTrusted === true) {
28
+ if (!_LastInteractionType.lastInteraction.isKeyboard()) return;
29
+ }
30
+ setKeyboardFocused(true);
31
+ }, []);
32
+ var handlerBlur = _react["default"].useCallback(function () {
33
+ return setKeyboardFocused(false);
34
+ }, []);
35
+ _react["default"].useEffect(function () {
36
+ if (typeof autoFocus !== 'number' && !autoFocus) return;
37
+ var timer = setTimeout(function () {
38
+ var _ref$current;
39
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
40
+ setKeyboardFocused(true);
41
+ }, 0);
42
+ return function () {
43
+ clearTimeout(timer);
44
+ };
45
+ }, [autoFocus]);
46
+ _react["default"].useEffect(function () {
47
+ if (disabled) {
48
+ setKeyboardFocused(false);
49
+ }
50
+ }, [disabled]);
51
+ var enforcedKeyboardFocus = _react["default"].useContext(enforcedKeyboardFocusEnhanceContext);
52
+ return (0, _assignProps["default"])(props, {
53
+ tabIndex: disabled ? -1 : tabIndex,
54
+ keyboardFocused: (keyboardFocused || enforcedKeyboardFocus) && !disabled,
55
+ onFocus: handleFocus,
56
+ onBlur: handlerBlur,
57
+ ref: ref
58
+ });
59
+ };
60
+ };
61
+ var _default = keyboardFocusEnhance;
62
+ exports["default"] = _default;
63
+ //# sourceMappingURL=keyboardFocusEnhance.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardFocusEnhance.cjs","names":["_react","_interopRequireDefault","require","_assignProps","_LastInteractionType","enforcedKeyboardFocusEnhanceContext","React","createContext","exports","keyboardFocusEnhance","makeFocusable","arguments","length","undefined","props","_props$tabIndex","autoFocus","disabled","loading","tabIndex","_React$useState","useState","_React$useState2","_slicedToArray2","keyboardFocused","setKeyboardFocused","ref","useRef","handleFocus","useCallback","event","isTrusted","lastInteraction","isKeyboard","handlerBlur","useEffect","timer","setTimeout","_ref$current","current","focus","clearTimeout","enforcedKeyboardFocus","useContext","assignProps","onFocus","onBlur","_default"],"sources":["../../../src/utils/enhances/keyboardFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../assignProps';\nimport { UnknownProperties } from '../../core-types/UnknownProperties';\nimport { lastInteraction } from '../../LastInteractionType';\n\n/** @deprecated */\nexport interface IKeyboardFocusProps extends KeyboardFocusProps, UnknownProperties {}\nexport type KeyboardFocusProps = {\n /* Property responsible for displaying \"keyboard\" focus */\n keyboardFocused?: boolean;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n};\n\nexport const enforcedKeyboardFocusEnhanceContext = React.createContext(false);\n\nexport type KeyboardFocusEnhanceHook = (props: {\n tabIndex?: number;\n disabled?: boolean;\n loading?: boolean;\n autoFocus?: boolean;\n}) => {\n tabIndex: number;\n keyboardFocused: boolean;\n onFocus: (e: React.FocusEvent) => void;\n onBlur: () => void;\n};\n\nconst keyboardFocusEnhance = (makeFocusable = true): KeyboardFocusEnhanceHook => {\n return (props) => {\n const { autoFocus } = props;\n const disabled = props.disabled || props.loading;\n const tabIndex = props.tabIndex ?? (makeFocusable ? 0 : undefined);\n const [keyboardFocused, setKeyboardFocused] = React.useState(false);\n const ref = React.useRef<HTMLElement>(null);\n\n const handleFocus = React.useCallback((event: React.FocusEvent) => {\n if (event.isTrusted === true) {\n if (!lastInteraction.isKeyboard()) return;\n }\n setKeyboardFocused(true);\n }, []);\n const handlerBlur = React.useCallback(() => setKeyboardFocused(false), []);\n React.useEffect(() => {\n if (typeof autoFocus !== 'number' && !autoFocus) return;\n const timer = setTimeout(() => {\n ref.current?.focus();\n setKeyboardFocused(true);\n }, 0);\n return () => {\n clearTimeout(timer);\n };\n }, [autoFocus]);\n React.useEffect(() => {\n if (disabled) {\n setKeyboardFocused(false);\n }\n }, [disabled]);\n\n const enforcedKeyboardFocus = React.useContext(enforcedKeyboardFocusEnhanceContext);\n\n return assignProps(props, {\n tabIndex: disabled ? -1 : tabIndex,\n keyboardFocused: (keyboardFocused || enforcedKeyboardFocus) && !disabled,\n onFocus: handleFocus,\n onBlur: handlerBlur,\n ref,\n });\n };\n};\n\nexport default keyboardFocusEnhance;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,oBAAA,GAAAF,OAAA;AAcO,IAAMG,mCAAmC,gBAAGC,iBAAK,CAACC,aAAa,CAAC,KAA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GC,UAAU,CAAC,YAAM;QAAA,IAAAC,YAAA;QAC7B,CAAAA,YAAA,GAAAZ,GAAG,CAACa,OAAO,cAAAD,YAAA,uBAAXA,YAAA,CAAaE,KAAK,EAAE;QACpBf,kBAAkB,CAAC,IAAI,CAAC;MAC1B,CAAC,EAAE,CAAC,CAAC;MACL,OAAO,YAAM;QACXgB,YAAY,CAACL,KAAK,CAAC;MACrB,CAAC;IACH,CAAC,EAAE,CAACpB,SAAS,CAAC,CAAC;IACfV,iBAAK,CAAC6B,SAAS,CAAC,YAAM;MACpB,IAAIlB,QAAQ,EAAE;QACZQ,kBAAkB,CAAC,KAAK,CAAC;MAC3B;IACF,CAAC,EAAE,CAACR,QAAQ,CAAC,CAAC;IAEd,IAAMyB,qBAAqB,GAAGpC,iBAAK,CAACqC,UAAU,CAACtC,mCAAmC,CAAC;IAEnF,OAAO,IAAAuC,uBAAW,EAAC9B,KAAK,EAAE;MACxBK,QAAQ,EAAEF,QAAQ,GAAG,CAAC,CAAC,GAAGE,QAAQ;MAClCK,eAAe,EAAE,CAACA,eAAe,IAAIkB,qBAAqB,KAAK,CAACzB,QAAQ;MACxE4B,OAAO,EAAEjB,WAAW;MACpBkB,MAAM,EAAEZ,WAAW;MACnBR,GAAG,EAAHA;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAAC,IAAAqB,QAAA,GAEatC,oBAAoB;AAAAD,OAAA,cAAAuC,QAAA"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { UnknownProperties } from '../../core-types/UnknownProperties';
3
+ /** @deprecated */
4
+ export interface IKeyboardFocusProps extends KeyboardFocusProps, UnknownProperties {
5
+ }
6
+ export type KeyboardFocusProps = {
7
+ keyboardFocused?: boolean;
8
+ /**
9
+ * Makes component to catch browser focus on component mount
10
+ * @default false
11
+ */
12
+ autoFocus?: boolean;
13
+ };
14
+ export declare const enforcedKeyboardFocusEnhanceContext: React.Context<boolean>;
15
+ export type KeyboardFocusEnhanceHook = (props: {
16
+ tabIndex?: number;
17
+ disabled?: boolean;
18
+ loading?: boolean;
19
+ autoFocus?: boolean;
20
+ }) => {
21
+ tabIndex: number;
22
+ keyboardFocused: boolean;
23
+ onFocus: (e: React.FocusEvent) => void;
24
+ onBlur: () => void;
25
+ };
26
+ declare const keyboardFocusEnhance: (makeFocusable?: boolean) => KeyboardFocusEnhanceHook;
27
+ export default keyboardFocusEnhance;
@@ -0,0 +1,57 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React from 'react';
3
+ import assignProps from "../assignProps.mjs";
4
+ import { lastInteraction } from "../../LastInteractionType.mjs";
5
+
6
+ /** @deprecated */
7
+
8
+ export var enforcedKeyboardFocusEnhanceContext = /*#__PURE__*/React.createContext(false);
9
+ var keyboardFocusEnhance = function keyboardFocusEnhance() {
10
+ var makeFocusable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
11
+ return function (props) {
12
+ var _props$tabIndex;
13
+ var autoFocus = props.autoFocus;
14
+ var disabled = props.disabled || props.loading;
15
+ var tabIndex = (_props$tabIndex = props.tabIndex) !== null && _props$tabIndex !== void 0 ? _props$tabIndex : makeFocusable ? 0 : undefined;
16
+ var _React$useState = React.useState(false),
17
+ _React$useState2 = _slicedToArray(_React$useState, 2),
18
+ keyboardFocused = _React$useState2[0],
19
+ setKeyboardFocused = _React$useState2[1];
20
+ var ref = React.useRef(null);
21
+ var handleFocus = React.useCallback(function (event) {
22
+ if (event.isTrusted === true) {
23
+ if (!lastInteraction.isKeyboard()) return;
24
+ }
25
+ setKeyboardFocused(true);
26
+ }, []);
27
+ var handlerBlur = React.useCallback(function () {
28
+ return setKeyboardFocused(false);
29
+ }, []);
30
+ React.useEffect(function () {
31
+ if (typeof autoFocus !== 'number' && !autoFocus) return;
32
+ var timer = setTimeout(function () {
33
+ var _ref$current;
34
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
35
+ setKeyboardFocused(true);
36
+ }, 0);
37
+ return function () {
38
+ clearTimeout(timer);
39
+ };
40
+ }, [autoFocus]);
41
+ React.useEffect(function () {
42
+ if (disabled) {
43
+ setKeyboardFocused(false);
44
+ }
45
+ }, [disabled]);
46
+ var enforcedKeyboardFocus = React.useContext(enforcedKeyboardFocusEnhanceContext);
47
+ return assignProps(props, {
48
+ tabIndex: disabled ? -1 : tabIndex,
49
+ keyboardFocused: (keyboardFocused || enforcedKeyboardFocus) && !disabled,
50
+ onFocus: handleFocus,
51
+ onBlur: handlerBlur,
52
+ ref: ref
53
+ });
54
+ };
55
+ };
56
+ export default keyboardFocusEnhance;
57
+ //# sourceMappingURL=keyboardFocusEnhance.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardFocusEnhance.mjs","names":["React","assignProps","lastInteraction","enforcedKeyboardFocusEnhanceContext","createContext","keyboardFocusEnhance","makeFocusable","arguments","length","undefined","props","_props$tabIndex","autoFocus","disabled","loading","tabIndex","_React$useState","useState","_React$useState2","_slicedToArray","keyboardFocused","setKeyboardFocused","ref","useRef","handleFocus","useCallback","event","isTrusted","isKeyboard","handlerBlur","useEffect","timer","setTimeout","_ref$current","current","focus","clearTimeout","enforcedKeyboardFocus","useContext","onFocus","onBlur"],"sources":["../../../src/utils/enhances/keyboardFocusEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../assignProps';\nimport { UnknownProperties } from '../../core-types/UnknownProperties';\nimport { lastInteraction } from '../../LastInteractionType';\n\n/** @deprecated */\nexport interface IKeyboardFocusProps extends KeyboardFocusProps, UnknownProperties {}\nexport type KeyboardFocusProps = {\n /* Property responsible for displaying \"keyboard\" focus */\n keyboardFocused?: boolean;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n};\n\nexport const enforcedKeyboardFocusEnhanceContext = React.createContext(false);\n\nexport type KeyboardFocusEnhanceHook = (props: {\n tabIndex?: number;\n disabled?: boolean;\n loading?: boolean;\n autoFocus?: boolean;\n}) => {\n tabIndex: number;\n keyboardFocused: boolean;\n onFocus: (e: React.FocusEvent) => void;\n onBlur: () => void;\n};\n\nconst keyboardFocusEnhance = (makeFocusable = true): KeyboardFocusEnhanceHook => {\n return (props) => {\n const { autoFocus } = props;\n const disabled = props.disabled || props.loading;\n const tabIndex = props.tabIndex ?? (makeFocusable ? 0 : undefined);\n const [keyboardFocused, setKeyboardFocused] = React.useState(false);\n const ref = React.useRef<HTMLElement>(null);\n\n const handleFocus = React.useCallback((event: React.FocusEvent) => {\n if (event.isTrusted === true) {\n if (!lastInteraction.isKeyboard()) return;\n }\n setKeyboardFocused(true);\n }, []);\n const handlerBlur = React.useCallback(() => setKeyboardFocused(false), []);\n React.useEffect(() => {\n if (typeof autoFocus !== 'number' && !autoFocus) return;\n const timer = setTimeout(() => {\n ref.current?.focus();\n setKeyboardFocused(true);\n }, 0);\n return () => {\n clearTimeout(timer);\n };\n }, [autoFocus]);\n React.useEffect(() => {\n if (disabled) {\n setKeyboardFocused(false);\n }\n }, [disabled]);\n\n const enforcedKeyboardFocus = React.useContext(enforcedKeyboardFocusEnhanceContext);\n\n return assignProps(props, {\n tabIndex: disabled ? -1 : tabIndex,\n keyboardFocused: (keyboardFocused || enforcedKeyboardFocus) && !disabled,\n onFocus: handleFocus,\n onBlur: handlerBlur,\n ref,\n });\n };\n};\n\nexport default keyboardFocusEnhance;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,WAAW,MAAM,oBAAgB;AAExC,SAASC,eAAe,QAAQ,+BAA2B;;AAE3D;;AAYA,OAAO,IAAMC,mCAAmC,gBAAGH,KAAK,CAACI,aAAa,CAAC,KAAK,CAAC;AAc7E,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAA,EAAuD;EAAA,IAAnDC,aAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAChD,OAAO,UAACG,KAAK,EAAK;IAAA,IAAAC,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AAC;IACH,CAAC,EAAE,CAACnB,SAAS,CAAC,CAAC;IACfZ,KAAK,CAAC8B,SAAS,CAAC,YAAM;MACpB,IAAIjB,QAAQ,EAAE;QACZQ,kBAAkB,CAAC,KAAK,CAAC;MAC3B;IACF,CAAC,EAAE,CAACR,QAAQ,CAAC,CAAC;IAEd,IAAMwB,qBAAqB,GAAGrC,KAAK,CAACsC,UAAU,CAACnC,mCAAmC,CAAC;IAEnF,OAAOF,WAAW,CAACS,KAAK,EAAE;MACxBK,QAAQ,EAAEF,QAAQ,GAAG,CAAC,CAAC,GAAGE,QAAQ;MAClCK,eAAe,EAAE,CAACA,eAAe,IAAIiB,qBAAqB,KAAK,CAACxB,QAAQ;MACxE0B,OAAO,EAAEf,WAAW;MACpBgB,MAAM,EAAEX,WAAW;MACnBP,GAAG,EAAHA;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAED,eAAejB,oBAAoB"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _useColorResolver = require("../use/useColorResolver");
10
+ var _ref = require("../ref");
11
+ var _assignProps = _interopRequireDefault(require("../assignProps"));
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, {
18
+ ref: (0, _ref.useForkRef)(ref, internalRef),
19
+ resolveColor: resolveColor
20
+ });
21
+ };
22
+ };
23
+ var _default = resolveColorEnhance;
24
+ exports["default"] = _default;
25
+ //# sourceMappingURL=resolveColorEnhance.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveColorEnhance.cjs","names":["_react","_interopRequireDefault","require","_useColorResolver","_ref","_assignProps","resolveColorEnhance","props","ref","internalRef","React","useRef","resolveColor","useColorResolver","assignProps","useForkRef","_default","exports"],"sources":["../../../src/utils/enhances/resolveColorEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useColorResolver } from '../use/useColorResolver';\nimport { useForkRef } from '../ref';\nimport assignProps from '../assignProps';\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;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,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,EAAe;IAC/C,IAAMC,YAAY,GAAG,IAAAC,kCAAgB,GAAE;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,GAEaV,mBAAmB;AAAAW,OAAA,cAAAD,QAAA"}
@@ -0,0 +1,2 @@
1
+ declare const resolveColorEnhance: () => (props: any) => any;
2
+ export default resolveColorEnhance;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { useColorResolver } from "../use/useColorResolver.mjs";
3
+ import { useForkRef } from "../ref.mjs";
4
+ import assignProps from "../assignProps.mjs";
5
+ var resolveColorEnhance = function resolveColorEnhance() {
6
+ return function (props) {
7
+ var ref = props.ref;
8
+ var internalRef = React.useRef();
9
+ var resolveColor = useColorResolver();
10
+ return assignProps(props, {
11
+ ref: useForkRef(ref, internalRef),
12
+ resolveColor: resolveColor
13
+ });
14
+ };
15
+ };
16
+ export default resolveColorEnhance;
17
+ //# sourceMappingURL=resolveColorEnhance.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveColorEnhance.mjs","names":["React","useColorResolver","useForkRef","assignProps","resolveColorEnhance","props","ref","internalRef","useRef","resolveColor"],"sources":["../../../src/utils/enhances/resolveColorEnhance.tsx"],"sourcesContent":["import React from 'react';\nimport { useColorResolver } from '../use/useColorResolver';\nimport { useForkRef } from '../ref';\nimport assignProps from '../assignProps';\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;AACzB,SAASC,gBAAgB,QAAQ,6BAAyB;AAC1D,SAASC,UAAU,QAAQ,YAAQ;AACnC,OAAOC,WAAW,MAAM,oBAAgB;AAExC,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,EAAe;IAC/C,IAAMC,YAAY,GAAGR,gBAAgB,EAAE;IAEvC,OAAOE,WAAW,CAACE,KAAK,EAAE;MACxBC,GAAG,EAAEJ,UAAU,CAACI,GAAG,EAAEC,WAAW,CAAC;MACjCE,YAAY,EAAZA;IACF,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAED,eAAeL,mBAAmB"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
9
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var EventEmitter = /*#__PURE__*/(0, _createClass2["default"])(function EventEmitter() {
12
+ var _this = this;
13
+ (0, _classCallCheck2["default"])(this, EventEmitter);
14
+ (0, _defineProperty2["default"])(this, "events", {});
15
+ (0, _defineProperty2["default"])(this, "emit", void 0);
16
+ (0, _defineProperty2["default"])(this, "subscribe", void 0);
17
+ this.emit = function (eventName) {
18
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
19
+ args[_key - 1] = arguments[_key];
20
+ }
21
+ var event = _this.events[eventName];
22
+ if (event) {
23
+ event.forEach(function (fn) {
24
+ fn.call.apply(fn, [null].concat(args));
25
+ });
26
+ }
27
+ };
28
+ this.subscribe = function (eventName, fn) {
29
+ if (!_this.events[eventName]) {
30
+ _this.events[eventName] = [];
31
+ }
32
+ _this.events[eventName].push(fn);
33
+ return function () {
34
+ _this.events[eventName] = _this.events[eventName].filter(function (eventFn) {
35
+ return fn !== eventFn;
36
+ });
37
+ };
38
+ };
39
+ });
40
+ exports["default"] = EventEmitter;
41
+ //# sourceMappingURL=eventEmitter.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventEmitter.cjs","names":["EventEmitter","_createClass2","_this","_classCallCheck2","_defineProperty2","emit","eventName","_len","arguments","length","args","Array","_key","event","events","forEach","fn","call","apply","concat","subscribe","push","filter","eventFn","exports"],"sources":["../../src/utils/eventEmitter.ts"],"sourcesContent":["type DefaultEmit = (eventName: string, ...args: any[]) => void;\ntype DefaultSubscribe = (eventName: string, fn: any) => () => void;\n\nexport default class EventEmitter<Emit = DefaultEmit, Subscribe = DefaultSubscribe> {\n private events: any = {};\n constructor() {\n this.emit = ((eventName: string, ...args: any[]) => {\n const event = this.events[eventName];\n if (event) {\n event.forEach((fn: any) => {\n fn.call(null, ...args);\n });\n }\n }) as any;\n this.subscribe = ((eventName: string, fn: any) => {\n if (!this.events[eventName]) {\n this.events[eventName] = [];\n }\n\n this.events[eventName].push(fn);\n return () => {\n this.events[eventName] = this.events[eventName].filter((eventFn: any) => fn !== eventFn);\n };\n }) as any;\n }\n\n emit: Emit;\n\n subscribe: Subscribe;\n}\n"],"mappings":";;;;;;;;;;IAGqBA,YAAY,oBAAAC,aAAA,aAE/B,SAAAD,aAAA,EAAc;EAAA,IAAAE,KAAA;EAAA,IAAAC,gBAAA,mBAAAH,YAAA;EAAA,IAAAI,gBAAA,6BADQ,CAAC,CAAC;EAAA,IAAAA,gBAAA;EAAA,IAAAA,gBAAA;EAEtB,IAAI,CAACC,IAAI,GAAI,UAACC,SAAiB,EAAqB;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAhBC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAJF,IAAI,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;IAAA;IACtC,IAAMC,KAAK,GAAGX,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC;IACpC,IAAIO,KAAK,EAAE;MACTA,KAAK,CAACE,OAAO,CAAC,UAACC,EAAO,EAAK;QACzBA,EAAE,CAACC,IAAI,CAAAC,KAAA,CAAPF,EAAE,GAAM,IAAI,EAAAG,MAAA,CAAKT,IAAI,EAAC;MACxB,CAAC,CAAC;IACJ;EACF,CAAS;EACT,IAAI,CAACU,SAAS,GAAI,UAACd,SAAiB,EAAEU,EAAO,EAAK;IAChD,IAAI,CAACd,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,EAAE;MAC3BJ,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,GAAG,EAAE;IAC7B;IAEAJ,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,CAACe,IAAI,CAACL,EAAE,CAAC;IAC/B,OAAO,YAAM;MACXd,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,GAAGJ,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,CAACgB,MAAM,CAAC,UAACC,OAAY;QAAA,OAAKP,EAAE,KAAKO,OAAO;MAAA,EAAC;IAC1F,CAAC;EACH,CAAS;AACX,CAAC;AAAAC,OAAA,cAAAxB,YAAA"}
@@ -0,0 +1,9 @@
1
+ type DefaultEmit = (eventName: string, ...args: any[]) => void;
2
+ type DefaultSubscribe = (eventName: string, fn: any) => () => void;
3
+ export default class EventEmitter<Emit = DefaultEmit, Subscribe = DefaultSubscribe> {
4
+ private events;
5
+ constructor();
6
+ emit: Emit;
7
+ subscribe: Subscribe;
8
+ }
9
+ export {};
@@ -0,0 +1,34 @@
1
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ var EventEmitter = /*#__PURE__*/_createClass(function EventEmitter() {
5
+ var _this = this;
6
+ _classCallCheck(this, EventEmitter);
7
+ _defineProperty(this, "events", {});
8
+ _defineProperty(this, "emit", void 0);
9
+ _defineProperty(this, "subscribe", void 0);
10
+ this.emit = function (eventName) {
11
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12
+ args[_key - 1] = arguments[_key];
13
+ }
14
+ var event = _this.events[eventName];
15
+ if (event) {
16
+ event.forEach(function (fn) {
17
+ fn.call.apply(fn, [null].concat(args));
18
+ });
19
+ }
20
+ };
21
+ this.subscribe = function (eventName, fn) {
22
+ if (!_this.events[eventName]) {
23
+ _this.events[eventName] = [];
24
+ }
25
+ _this.events[eventName].push(fn);
26
+ return function () {
27
+ _this.events[eventName] = _this.events[eventName].filter(function (eventFn) {
28
+ return fn !== eventFn;
29
+ });
30
+ };
31
+ };
32
+ });
33
+ export { EventEmitter as default };
34
+ //# sourceMappingURL=eventEmitter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventEmitter.mjs","names":["EventEmitter","_createClass","_this","_classCallCheck","_defineProperty","emit","eventName","_len","arguments","length","args","Array","_key","event","events","forEach","fn","call","apply","concat","subscribe","push","filter","eventFn","default"],"sources":["../../src/utils/eventEmitter.ts"],"sourcesContent":["type DefaultEmit = (eventName: string, ...args: any[]) => void;\ntype DefaultSubscribe = (eventName: string, fn: any) => () => void;\n\nexport default class EventEmitter<Emit = DefaultEmit, Subscribe = DefaultSubscribe> {\n private events: any = {};\n constructor() {\n this.emit = ((eventName: string, ...args: any[]) => {\n const event = this.events[eventName];\n if (event) {\n event.forEach((fn: any) => {\n fn.call(null, ...args);\n });\n }\n }) as any;\n this.subscribe = ((eventName: string, fn: any) => {\n if (!this.events[eventName]) {\n this.events[eventName] = [];\n }\n\n this.events[eventName].push(fn);\n return () => {\n this.events[eventName] = this.events[eventName].filter((eventFn: any) => fn !== eventFn);\n };\n }) as any;\n }\n\n emit: Emit;\n\n subscribe: Subscribe;\n}\n"],"mappings":";;;IAGqBA,YAAY,gBAAAC,YAAA,CAE/B,SAAAD,aAAA,EAAc;EAAA,IAAAE,KAAA;EAAAC,eAAA,OAAAH,YAAA;EAAAI,eAAA,iBADQ,CAAC,CAAC;EAAAA,eAAA;EAAAA,eAAA;EAEtB,IAAI,CAACC,IAAI,GAAI,UAACC,SAAiB,EAAqB;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAhBC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAJF,IAAI,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;IAAA;IACtC,IAAMC,KAAK,GAAGX,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC;IACpC,IAAIO,KAAK,EAAE;MACTA,KAAK,CAACE,OAAO,CAAC,UAACC,EAAO,EAAK;QACzBA,EAAE,CAACC,IAAI,CAAAC,KAAA,CAAPF,EAAE,GAAM,IAAI,EAAAG,MAAA,CAAKT,IAAI,EAAC;MACxB,CAAC,CAAC;IACJ;EACF,CAAS;EACT,IAAI,CAACU,SAAS,GAAI,UAACd,SAAiB,EAAEU,EAAO,EAAK;IAChD,IAAI,CAACd,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,EAAE;MAC3BJ,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,GAAG,EAAE;IAC7B;IAEAJ,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,CAACe,IAAI,CAACL,EAAE,CAAC;IAC/B,OAAO,YAAM;MACXd,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,GAAGJ,KAAI,CAACY,MAAM,CAACR,SAAS,CAAC,CAACgB,MAAM,CAAC,UAACC,OAAY;QAAA,OAAKP,EAAE,KAAKO,OAAO;MAAA,EAAC;IAC1F,CAAC;EACH,CAAS;AACX,CAAC;AAAA,SArBkBvB,YAAY,IAAAwB,OAAA"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ exports.extractFrom = extractFrom;
9
+ exports.findAllComponents = findAllComponents;
10
+ exports.isAdvanceMode = isAdvanceMode;
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var _getOriginChildren = _interopRequireDefault(require("./getOriginChildren"));
13
+ var _symbols = require("../core-types/symbols");
14
+ function findComponent(Children, names, recursively) {
15
+ var limit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100;
16
+ var children = Children[_symbols.CHILDREN_COMPONENT] ? (0, _getOriginChildren["default"])(Children) : Children;
17
+ return _react["default"].Children.toArray(children).find(function (child) {
18
+ if ( /*#__PURE__*/_react["default"].isValidElement(child)) {
19
+ if (child.type === _react["default"].Fragment) {
20
+ return findComponent(child.props.children, names, recursively, limit);
21
+ }
22
+ // @ts-ignore
23
+ var inheritedNames = child.type[_symbols.INHERITED_NAME] || [child.type.displayName];
24
+ var result = !!inheritedNames.find(function (name) {
25
+ return names.includes(name);
26
+ });
27
+ if (!result && child.props.children && recursively && limit > 0) {
28
+ return findComponent(child.props.children, names, recursively, limit - 1);
29
+ }
30
+ return result;
31
+ }
32
+ });
33
+ }
34
+ function isAdvanceMode(Children, name, recursively) {
35
+ var children = Children[_symbols.CHILDREN_COMPONENT] ? (0, _getOriginChildren["default"])(Children) : Children;
36
+ if (!children) return false;
37
+ if (typeof children === 'function') {
38
+ return true;
39
+ }
40
+ return !!findComponent(children, name, recursively);
41
+ }
42
+ function findAllComponents(Children, names) {
43
+ var result = [];
44
+ var findAllAndAdd = function findAllAndAdd(Children) {
45
+ var children = Children[_symbols.CHILDREN_COMPONENT] ? (0, _getOriginChildren["default"])(Children) : Children;
46
+ _react["default"].Children.toArray(children).forEach(function (child) {
47
+ if ( /*#__PURE__*/_react["default"].isValidElement(child)) {
48
+ if (child.type === _react["default"].Fragment) {
49
+ findAllAndAdd(child.props.children);
50
+ } else if (typeof child.type === 'function' && _symbols.CHILDREN_COMPONENT in child.type && child.type[_symbols.CHILDREN_COMPONENT]) {
51
+ findAllAndAdd(child.type);
52
+ } else {
53
+ // @ts-ignore
54
+ var inheritedNames = child.type[_symbols.INHERITED_NAME] || [child.type.displayName];
55
+ var component = !!inheritedNames.find(function (name) {
56
+ return names.includes(name);
57
+ });
58
+ if (component) {
59
+ result.push(child);
60
+ }
61
+ if (child.props.children) {
62
+ return findAllAndAdd(child.props.children);
63
+ }
64
+ }
65
+ }
66
+ });
67
+ };
68
+ findAllAndAdd(Children);
69
+ return result;
70
+ }
71
+
72
+ /**
73
+ * Extract some components from Children and return them and rest of components as tuple.
74
+ */
75
+ function extractFrom(Children, names) {
76
+ var extracted = [];
77
+ var rest = [];
78
+ var extractor = function extractor(Children) {
79
+ var children = Children[_symbols.CHILDREN_COMPONENT] ? (0, _getOriginChildren["default"])(Children) : Children;
80
+ _react["default"].Children.toArray(children).forEach(function (child) {
81
+ if ( /*#__PURE__*/_react["default"].isValidElement(child)) {
82
+ if (child.type === _react["default"].Fragment) {
83
+ extractor(child.props.children);
84
+ } else if (typeof child.type === 'function' && _symbols.CHILDREN_COMPONENT in child.type && child.type[_symbols.CHILDREN_COMPONENT]) {
85
+ extractor(child.type);
86
+ } else {
87
+ // @ts-ignore
88
+ var inheritedNames = child.type[_symbols.INHERITED_NAME] || [child.type.displayName];
89
+ var component = !!inheritedNames.find(function (name) {
90
+ return names.includes(name);
91
+ });
92
+ if (component) {
93
+ extracted.push(child);
94
+ } else {
95
+ rest.push(child);
96
+ }
97
+ }
98
+ }
99
+ });
100
+ };
101
+ extractor(Children);
102
+ return [extracted, rest];
103
+ }
104
+ var _default = findComponent;
105
+ exports["default"] = _default;
106
+ //# sourceMappingURL=findComponent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findComponent.cjs","names":["_react","_interopRequireDefault","require","_getOriginChildren","_symbols","findComponent","Children","names","recursively","limit","arguments","length","undefined","children","CHILDREN_COMPONENT","getOriginChildren","React","toArray","find","child","isValidElement","type","Fragment","props","inheritedNames","INHERITED_NAME","displayName","result","name","includes","isAdvanceMode","findAllComponents","findAllAndAdd","forEach","component","push","extractFrom","extracted","rest","extractor","_default","exports"],"sources":["../../src/utils/findComponent.ts"],"sourcesContent":["import React, { ReactElement, ReactNode, MutableRefObject } from 'react';\nimport getOriginChildren from './getOriginChildren';\nimport { CHILDREN_COMPONENT, INHERITED_NAME } from '../core-types/symbols';\n\nfunction findComponent(\n Children: any,\n names: string[],\n recursively?: boolean,\n limit = 100,\n): Exclude<ReactNode, boolean | null | undefined> | undefined {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n return React.Children.toArray(children).find((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return findComponent(child.props.children, names, recursively, limit);\n }\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const result = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (!result && child.props.children && recursively && limit > 0) {\n return findComponent(child.props.children, names, recursively, limit - 1);\n }\n\n return result;\n }\n });\n}\n\nexport function isAdvanceMode(Children: any, name: string[], recursively?: boolean) {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n if (!children) return false;\n if (typeof children === 'function') {\n return true;\n }\n return !!findComponent(children, name, recursively);\n}\n\ntype IntergalacticComponent = ReactElement & {\n ref?: MutableRefObject<HTMLElement>;\n};\n\nexport function findAllComponents(Children: any, names: string[]): IntergalacticComponent[] {\n const result: IntergalacticComponent[] = [];\n\n const findAllAndAdd = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n findAllAndAdd(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n findAllAndAdd(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n result.push(child);\n }\n\n if (child.props.children) {\n return findAllAndAdd(child.props.children);\n }\n }\n }\n });\n };\n\n findAllAndAdd(Children);\n\n return result;\n}\n\n/**\n * Extract some components from Children and return them and rest of components as tuple.\n */\nexport function extractFrom(Children: any, names: string[]): IntergalacticComponent[][] {\n const extracted: IntergalacticComponent[] = [];\n const rest: IntergalacticComponent[] = [];\n\n const extractor = (Children: any) => {\n const children = Children[CHILDREN_COMPONENT] ? getOriginChildren(Children) : Children;\n React.Children.toArray(children).forEach((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n extractor(child.props.children);\n } else if (\n typeof child.type === 'function' &&\n CHILDREN_COMPONENT in child.type &&\n child.type[CHILDREN_COMPONENT]\n ) {\n extractor(child.type);\n } else {\n // @ts-ignore\n const inheritedNames = child.type[INHERITED_NAME] || [child.type.displayName];\n const component = !!inheritedNames.find((name: string) => names.includes(name));\n\n if (component) {\n extracted.push(child);\n } else {\n rest.push(child);\n }\n }\n }\n });\n };\n\n extractor(Children);\n\n return [extracted, rest];\n}\n\nexport default findComponent;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,SAASG,aAAaA,CACpBC,QAAa,EACbC,KAAe,EACfC,WAAqB,EAEuC;EAAA,IAD5DC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EAEX,IAAMG,QAAQ,GAAGP,QAAQ,CAACQ,2BAAkB,CAAC,GAAG,IAAAC,6BAAiB,EAACT,QAAQ,CAAC,GAAGA,QAAQ;EACtF,OAAOU,iBAAK,CAACV,QAAQ,CAACW,OAAO,CAACJ,QAAQ,CAAC,CAACK,IAAI,CAAC,UAACC,KAAK,EAAK;IACtD,kBAAIH,iBAAK,CAACI,cAAc,CAACD,KAAK,CAAC,EAAE;MAC/B,IAAIA,KAAK,CAACE,IAAI,KAAKL,iBAAK,CAACM,QAAQ,EAAE;QACjC,OAAOjB,aAAa,CAACc,KAAK,CAACI,KAAK,CAACV,QAAQ,EAAEN,KAAK,EAAEC,WAAW,EAAEC,KAAK,CAAC;MACvE;MACA;MACA,IAAMe,cAAc,GAAGL,KAAK,CAACE,IAAI,CAACI,uBAAc,CAAC,IAAI,C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