@semcore/core 16.0.0-prerelease.9 → 16.0.0

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 (353) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/lib/{LastInteractionType.cjs → LastInteractionType.js} +1 -1
  3. package/lib/LastInteractionType.js.map +1 -0
  4. package/lib/core-types/Component.d.ts +2 -2
  5. package/lib/core-types/{Component.cjs → Component.js} +1 -1
  6. package/lib/core-types/Component.js.map +1 -0
  7. package/lib/core-types/Component.mjs.map +1 -1
  8. package/lib/core-types/UnknownProperties.js +2 -0
  9. package/lib/core-types/UnknownProperties.js.map +1 -0
  10. package/lib/core-types/reshadow.d.js +2 -0
  11. package/lib/core-types/reshadow.d.js.map +1 -0
  12. package/lib/core-types/{symbols.cjs → symbols.js} +1 -1
  13. package/lib/core-types/symbols.js.map +1 -0
  14. package/lib/{coreFactory.cjs → coreFactory.js} +1 -1
  15. package/lib/coreFactory.js.map +1 -0
  16. package/lib/coreFactory.mjs +1 -1
  17. package/lib/enhancement/{Children.cjs → Children.js} +1 -1
  18. package/lib/enhancement/Children.js.map +1 -0
  19. package/lib/enhancement/Children.mjs +1 -1
  20. package/lib/enhancement/{Root.cjs → Root.js} +1 -1
  21. package/lib/enhancement/Root.js.map +1 -0
  22. package/lib/enhancement/Root.mjs +1 -5
  23. package/lib/enhancement/{bindHandler.cjs → bindHandler.js} +1 -1
  24. package/lib/enhancement/bindHandler.js.map +1 -0
  25. package/lib/enhancement/{dataName.cjs → dataName.js} +1 -1
  26. package/lib/enhancement/dataName.js.map +1 -0
  27. package/lib/enhancement/{enhance.cjs → enhance.js} +1 -1
  28. package/lib/enhancement/enhance.js.map +1 -0
  29. package/lib/enhancement/{functionDefaultProps.cjs → functionDefaultProps.js} +1 -1
  30. package/lib/enhancement/functionDefaultProps.js.map +1 -0
  31. package/lib/enhancement/{hoistProps.cjs → hoistProps.js} +1 -1
  32. package/lib/enhancement/hoistProps.js.map +1 -0
  33. package/lib/enhancement/{i18n.cjs → i18n.js} +1 -1
  34. package/lib/enhancement/i18n.js.map +1 -0
  35. package/lib/enhancement/{inheritedName.cjs → inheritedName.js} +1 -1
  36. package/lib/enhancement/inheritedName.js.map +1 -0
  37. package/lib/enhancement/{staticChildren.cjs → staticChildren.js} +1 -1
  38. package/lib/enhancement/staticChildren.js.map +1 -0
  39. package/lib/enhancement/{style.cjs → style.js} +1 -1
  40. package/lib/enhancement/style.js.map +1 -0
  41. package/lib/enhancement/style.mjs +2 -3
  42. package/lib/enhancement/{uncontrolledProps.cjs → uncontrolledProps.js} +1 -1
  43. package/lib/enhancement/uncontrolledProps.js.map +1 -0
  44. package/lib/esm/coreFactory.mjs +1 -1
  45. package/lib/esm/enhancement/Children.mjs +1 -1
  46. package/lib/esm/enhancement/Root.mjs +1 -5
  47. package/lib/esm/enhancement/style.mjs +2 -3
  48. package/lib/esm/index.mjs +1 -0
  49. package/lib/esm/styled/index.mjs +8 -0
  50. package/lib/esm/styled/reshadow-core.mjs +219 -3
  51. package/lib/esm/utils/assignProps.mjs +10 -0
  52. package/lib/esm/utils/createHoc.mjs +44 -0
  53. package/lib/esm/utils/enhances/WithI18n.mjs +30 -6
  54. package/lib/esm/utils/enhances/i18nEnhance.mjs +91 -0
  55. package/lib/esm/utils/getDisplayName.mjs +6 -0
  56. package/lib/esm/utils/ref.mjs +46 -2
  57. package/lib/{index.cjs → index.js} +1 -1
  58. package/lib/index.js.map +1 -0
  59. package/lib/index.mjs +1 -0
  60. package/lib/{register.cjs → register.js} +1 -1
  61. package/lib/register.js.map +1 -0
  62. package/lib/styled/{index.cjs → index.js} +1 -1
  63. package/lib/styled/index.js.map +1 -0
  64. package/lib/styled/index.mjs +8 -6
  65. package/lib/styled/{reshadow-core.cjs → reshadow-core.js} +1 -1
  66. package/lib/styled/reshadow-core.js.map +1 -0
  67. package/lib/styled/reshadow-core.mjs +219 -3
  68. package/lib/styled/{sstyled.cjs → sstyled.js} +1 -1
  69. package/lib/styled/sstyled.js.map +1 -0
  70. package/lib/theme/dark.json +2 -2
  71. package/lib/theme/light.json +2 -2
  72. package/lib/theme/{processor.cjs → processor.js} +1 -1
  73. package/lib/theme/processor.js.map +1 -0
  74. package/lib/theme/themes/auto.css +4 -4
  75. package/lib/theme/themes/dark.css +2 -2
  76. package/lib/theme/themes/dark.d.ts +1 -1
  77. package/lib/theme/themes/{dark.cjs → dark.js} +2 -2
  78. package/lib/theme/themes/dark.js.map +1 -0
  79. package/lib/theme/themes/dark.mjs +1 -1
  80. package/lib/theme/themes/dark.mjs.map +1 -1
  81. package/lib/theme/themes/default.css +2 -2
  82. package/lib/theme/themes/default.d.ts +1 -1
  83. package/lib/theme/themes/{light.cjs → default.js} +2 -2
  84. package/lib/theme/themes/default.js.map +1 -0
  85. package/lib/theme/themes/default.mjs +1 -1
  86. package/lib/theme/themes/default.mjs.map +1 -1
  87. package/lib/theme/themes/light.css +2 -2
  88. package/lib/theme/themes/light.d.ts +1 -1
  89. package/lib/theme/themes/{default.cjs → light.js} +2 -2
  90. package/lib/theme/themes/light.js.map +1 -0
  91. package/lib/theme/themes/light.mjs +1 -1
  92. package/lib/theme/themes/light.mjs.map +1 -1
  93. package/lib/theme/{utils.cjs → utils.js} +1 -1
  94. package/lib/theme/utils.js.map +1 -0
  95. package/lib/utils/{CSSinJS.cjs → CSSinJS.js} +1 -1
  96. package/lib/utils/CSSinJS.js.map +1 -0
  97. package/lib/utils/{ScreenReaderOnly.cjs → ScreenReaderOnly.js} +1 -1
  98. package/lib/utils/ScreenReaderOnly.js.map +1 -0
  99. package/lib/utils/{ThemeProvider.cjs → ThemeProvider.js} +1 -1
  100. package/lib/utils/ThemeProvider.js.map +1 -0
  101. package/lib/utils/{addonText.cjs → addonText.js} +1 -1
  102. package/lib/utils/addonText.js.map +1 -0
  103. package/lib/utils/{addonTextChildren.cjs → addonTextChildren.js} +1 -1
  104. package/lib/utils/addonTextChildren.js.map +1 -0
  105. package/lib/utils/{ariaProps.cjs → ariaProps.js} +1 -1
  106. package/lib/utils/ariaProps.js.map +1 -0
  107. package/lib/utils/{assignProps.cjs → assignProps.js} +1 -1
  108. package/lib/utils/assignProps.js.map +1 -0
  109. package/lib/utils/assignProps.mjs +10 -0
  110. package/lib/utils/{canUseDOM.cjs → canUseDOM.js} +1 -1
  111. package/lib/utils/canUseDOM.js.map +1 -0
  112. package/lib/utils/{capitalizeFirstLetter.cjs → capitalizeFirstLetter.js} +1 -1
  113. package/lib/utils/capitalizeFirstLetter.js.map +1 -0
  114. package/lib/utils/{color.cjs → color.js} +1 -1
  115. package/lib/utils/color.js.map +1 -0
  116. package/lib/utils/{compose.cjs → compose.js} +1 -1
  117. package/lib/utils/compose.js.map +1 -0
  118. package/lib/utils/{createHoc.cjs → createHoc.js} +1 -1
  119. package/lib/utils/createHoc.js.map +1 -0
  120. package/lib/utils/createHoc.mjs +19 -21
  121. package/lib/utils/{createUUID.cjs → createUUID.js} +1 -1
  122. package/lib/utils/createUUID.js.map +1 -0
  123. package/lib/utils/{cssToIntDefault.cjs → cssToIntDefault.js} +1 -1
  124. package/lib/utils/cssToIntDefault.js.map +1 -0
  125. package/lib/utils/enhances/{WithAutoFocus.cjs → WithAutoFocus.js} +1 -1
  126. package/lib/utils/enhances/WithAutoFocus.js.map +1 -0
  127. package/lib/utils/enhances/{WithCSS.cjs → WithCSS.js} +1 -1
  128. package/lib/utils/enhances/WithCSS.js.map +1 -0
  129. package/lib/utils/enhances/{WithI18n.cjs → WithI18n.js} +1 -1
  130. package/lib/utils/enhances/WithI18n.js.map +1 -0
  131. package/lib/utils/enhances/WithI18n.mjs +30 -6
  132. package/lib/utils/enhances/{WithKeyboardFocus.cjs → WithKeyboardFocus.js} +1 -1
  133. package/lib/utils/enhances/WithKeyboardFocus.js.map +1 -0
  134. package/lib/utils/enhances/{WithRef.cjs → WithRef.js} +1 -1
  135. package/lib/utils/enhances/WithRef.js.map +1 -0
  136. package/lib/utils/enhances/{a11yEnhance.cjs → a11yEnhance.js} +1 -1
  137. package/lib/utils/enhances/a11yEnhance.js.map +1 -0
  138. package/lib/utils/enhances/{animatedSizeEnhance.cjs → animatedSizeEnhance.js} +1 -1
  139. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -0
  140. package/lib/utils/enhances/{autoFocusEnhance.cjs → autoFocusEnhance.js} +1 -1
  141. package/lib/utils/enhances/autoFocusEnhance.js.map +1 -0
  142. package/lib/utils/enhances/{contextEnhance.cjs → contextEnhance.js} +1 -1
  143. package/lib/utils/enhances/contextEnhance.js.map +1 -0
  144. package/lib/utils/enhances/{i18nEnhance.cjs → i18nEnhance.js} +1 -1
  145. package/lib/utils/enhances/i18nEnhance.js.map +1 -0
  146. package/lib/utils/enhances/i18nEnhance.mjs +32 -33
  147. package/lib/utils/enhances/{keyboardFocusEnhance.cjs → keyboardFocusEnhance.js} +1 -1
  148. package/lib/utils/enhances/keyboardFocusEnhance.js.map +1 -0
  149. package/lib/utils/enhances/{resolveColorEnhance.cjs → resolveColorEnhance.js} +1 -1
  150. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -0
  151. package/lib/utils/{eventEmitter.cjs → eventEmitter.js} +1 -1
  152. package/lib/utils/eventEmitter.js.map +1 -0
  153. package/lib/utils/findComponent.d.ts +2 -2
  154. package/lib/utils/{findComponent.cjs → findComponent.js} +1 -1
  155. package/lib/utils/findComponent.js.map +1 -0
  156. package/lib/utils/findComponent.mjs.map +1 -1
  157. package/lib/utils/{fire.cjs → fire.js} +1 -1
  158. package/lib/utils/fire.js.map +1 -0
  159. package/lib/utils/focus-lock/{focusBorders.cjs → focusBorders.js} +1 -1
  160. package/lib/utils/focus-lock/focusBorders.js.map +1 -0
  161. package/lib/utils/focus-lock/{getFocusableIn.cjs → getFocusableIn.js} +1 -1
  162. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -0
  163. package/lib/utils/focus-lock/{isFocusInside.cjs → isFocusInside.js} +1 -1
  164. package/lib/utils/focus-lock/isFocusInside.js.map +1 -0
  165. package/lib/utils/focus-lock/{isFocusable.cjs → isFocusable.js} +1 -1
  166. package/lib/utils/focus-lock/isFocusable.js.map +1 -0
  167. package/lib/utils/focus-lock/{setFocus.cjs → setFocus.js} +1 -1
  168. package/lib/utils/focus-lock/setFocus.js.map +1 -0
  169. package/lib/utils/{getAccessibleName.cjs → getAccessibleName.js} +1 -1
  170. package/lib/utils/getAccessibleName.js.map +1 -0
  171. package/lib/utils/{getDisplayName.cjs → getDisplayName.js} +1 -1
  172. package/lib/utils/getDisplayName.js.map +1 -0
  173. package/lib/utils/getDisplayName.mjs +5 -3
  174. package/lib/utils/{getEventTarget.cjs → getEventTarget.js} +1 -1
  175. package/lib/utils/getEventTarget.js.map +1 -0
  176. package/lib/utils/{getOriginChildren.cjs → getOriginChildren.js} +1 -1
  177. package/lib/utils/getOriginChildren.js.map +1 -0
  178. package/lib/utils/{getRandomInt.cjs → getRandomInt.js} +1 -1
  179. package/lib/utils/getRandomInt.js.map +1 -0
  180. package/lib/utils/{getValue.cjs → getValue.js} +1 -1
  181. package/lib/utils/getValue.js.map +1 -0
  182. package/lib/utils/{hasLabels.cjs → hasLabels.js} +1 -1
  183. package/lib/utils/hasLabels.js.map +1 -0
  184. package/lib/utils/{hasParent.cjs → hasParent.js} +1 -1
  185. package/lib/utils/hasParent.js.map +1 -0
  186. package/lib/utils/{if.cjs → if.js} +1 -1
  187. package/lib/utils/if.js.map +1 -0
  188. package/lib/utils/{ifChildren.cjs → ifChildren.js} +1 -1
  189. package/lib/utils/ifChildren.js.map +1 -0
  190. package/lib/utils/{injectStyle.cjs → injectStyle.js} +1 -1
  191. package/lib/utils/injectStyle.js.map +1 -0
  192. package/lib/utils/{inputProps.cjs → inputProps.js} +1 -1
  193. package/lib/utils/inputProps.js.map +1 -0
  194. package/lib/utils/isInteractiveElement.d.ts +1 -0
  195. package/lib/utils/isInteractiveElement.js +34 -0
  196. package/lib/utils/isInteractiveElement.js.map +1 -0
  197. package/lib/utils/isInteractiveElement.mjs +28 -0
  198. package/lib/utils/isInteractiveElement.mjs.map +1 -0
  199. package/lib/utils/{isNode.cjs → isNode.js} +1 -1
  200. package/lib/utils/isNode.js.map +1 -0
  201. package/lib/utils/{isPromise.cjs → isPromise.js} +1 -1
  202. package/lib/utils/isPromise.js.map +1 -0
  203. package/lib/utils/{isRetina.cjs → isRetina.js} +1 -1
  204. package/lib/utils/isRetina.js.map +1 -0
  205. package/lib/utils/{logger.cjs → logger.js} +1 -1
  206. package/lib/utils/logger.js.map +1 -0
  207. package/lib/utils/{numericChecker.cjs → numericChecker.js} +1 -1
  208. package/lib/utils/numericChecker.js.map +1 -0
  209. package/lib/utils/{ownerDocument.cjs → ownerDocument.js} +1 -1
  210. package/lib/utils/ownerDocument.js.map +1 -0
  211. package/lib/utils/{pick.cjs → pick.js} +1 -1
  212. package/lib/utils/pick.js.map +1 -0
  213. package/lib/utils/{propsForElement.cjs → propsForElement.js} +1 -1
  214. package/lib/utils/propsForElement.js.map +1 -0
  215. package/lib/utils/{rafTrottle.cjs → rafTrottle.js} +1 -1
  216. package/lib/utils/rafTrottle.js.map +1 -0
  217. package/lib/utils/{reactToText.cjs → reactToText.js} +1 -1
  218. package/lib/utils/reactToText.js.map +1 -0
  219. package/lib/utils/ref.d.ts +4 -2
  220. package/lib/utils/{ref.cjs → ref.js} +3 -2
  221. package/lib/utils/ref.js.map +1 -0
  222. package/lib/utils/ref.mjs +46 -2
  223. package/lib/utils/ref.mjs.map +1 -1
  224. package/lib/utils/{setRef.cjs → setRef.js} +1 -1
  225. package/lib/utils/setRef.js.map +1 -0
  226. package/lib/utils/{syncScroll.cjs → syncScroll.js} +1 -1
  227. package/lib/utils/syncScroll.js.map +1 -0
  228. package/lib/utils/{uncontroll.cjs → uncontroll.js} +1 -1
  229. package/lib/utils/uncontroll.js.map +1 -0
  230. package/lib/utils/{uniqueID.cjs → uniqueID.js} +1 -1
  231. package/lib/utils/uniqueID.js.map +1 -0
  232. package/lib/utils/use/{useColorResolver.cjs → useColorResolver.js} +1 -1
  233. package/lib/utils/use/useColorResolver.js.map +1 -0
  234. package/lib/utils/use/{useCss.cjs → useCss.js} +1 -1
  235. package/lib/utils/use/useCss.js.map +1 -0
  236. package/lib/utils/use/{useEnhancedEffect.cjs → useEnhancedEffect.js} +1 -1
  237. package/lib/utils/use/useEnhancedEffect.js.map +1 -0
  238. package/lib/utils/use/{useEventCallback.cjs → useEventCallback.js} +1 -1
  239. package/lib/utils/use/useEventCallback.js.map +1 -0
  240. package/lib/utils/use/{useEventListener.cjs → useEventListener.js} +2 -2
  241. package/lib/utils/use/useEventListener.js.map +1 -0
  242. package/lib/utils/use/useEventListener.mjs +1 -1
  243. package/lib/utils/use/useEventListener.mjs.map +1 -1
  244. package/lib/utils/use/{useFocusLock.cjs → useFocusLock.js} +1 -1
  245. package/lib/utils/use/useFocusLock.js.map +1 -0
  246. package/lib/utils/use/{usePreventScroll.cjs → usePreventScroll.js} +1 -1
  247. package/lib/utils/use/usePreventScroll.js.map +1 -0
  248. package/lib/utils/{useCssVariable.cjs → useCssVariable.js} +1 -1
  249. package/lib/utils/useCssVariable.js.map +1 -0
  250. package/lib/utils/{zIndexStacking.cjs → zIndexStacking.js} +1 -1
  251. package/lib/utils/zIndexStacking.js.map +1 -0
  252. package/package.json +40 -15
  253. package/vite.config.ts +1 -0
  254. package/lib/LastInteractionType.cjs.map +0 -1
  255. package/lib/core-types/Component.cjs.map +0 -1
  256. package/lib/core-types/UnknownProperties.cjs +0 -2
  257. package/lib/core-types/UnknownProperties.cjs.map +0 -1
  258. package/lib/core-types/reshadow.d.cjs +0 -2
  259. package/lib/core-types/reshadow.d.cjs.map +0 -1
  260. package/lib/core-types/symbols.cjs.map +0 -1
  261. package/lib/coreFactory.cjs.map +0 -1
  262. package/lib/enhancement/Children.cjs.map +0 -1
  263. package/lib/enhancement/Root.cjs.map +0 -1
  264. package/lib/enhancement/bindHandler.cjs.map +0 -1
  265. package/lib/enhancement/dataName.cjs.map +0 -1
  266. package/lib/enhancement/enhance.cjs.map +0 -1
  267. package/lib/enhancement/functionDefaultProps.cjs.map +0 -1
  268. package/lib/enhancement/hoistProps.cjs.map +0 -1
  269. package/lib/enhancement/i18n.cjs.map +0 -1
  270. package/lib/enhancement/inheritedName.cjs.map +0 -1
  271. package/lib/enhancement/staticChildren.cjs.map +0 -1
  272. package/lib/enhancement/style.cjs.map +0 -1
  273. package/lib/enhancement/uncontrolledProps.cjs.map +0 -1
  274. package/lib/index.cjs.map +0 -1
  275. package/lib/register.cjs.map +0 -1
  276. package/lib/styled/index.cjs.map +0 -1
  277. package/lib/styled/reshadow-core.cjs.map +0 -1
  278. package/lib/styled/sstyled.cjs.map +0 -1
  279. package/lib/theme/processor.cjs.map +0 -1
  280. package/lib/theme/themes/dark.cjs.map +0 -1
  281. package/lib/theme/themes/default.cjs.map +0 -1
  282. package/lib/theme/themes/light.cjs.map +0 -1
  283. package/lib/theme/utils.cjs.map +0 -1
  284. package/lib/utils/CSSinJS.cjs.map +0 -1
  285. package/lib/utils/ScreenReaderOnly.cjs.map +0 -1
  286. package/lib/utils/ThemeProvider.cjs.map +0 -1
  287. package/lib/utils/addonText.cjs.map +0 -1
  288. package/lib/utils/addonTextChildren.cjs.map +0 -1
  289. package/lib/utils/ariaProps.cjs.map +0 -1
  290. package/lib/utils/assignProps.cjs.map +0 -1
  291. package/lib/utils/canUseDOM.cjs.map +0 -1
  292. package/lib/utils/capitalizeFirstLetter.cjs.map +0 -1
  293. package/lib/utils/color.cjs.map +0 -1
  294. package/lib/utils/compose.cjs.map +0 -1
  295. package/lib/utils/createHoc.cjs.map +0 -1
  296. package/lib/utils/createUUID.cjs.map +0 -1
  297. package/lib/utils/cssToIntDefault.cjs.map +0 -1
  298. package/lib/utils/enhances/WithAutoFocus.cjs.map +0 -1
  299. package/lib/utils/enhances/WithCSS.cjs.map +0 -1
  300. package/lib/utils/enhances/WithI18n.cjs.map +0 -1
  301. package/lib/utils/enhances/WithKeyboardFocus.cjs.map +0 -1
  302. package/lib/utils/enhances/WithRef.cjs.map +0 -1
  303. package/lib/utils/enhances/a11yEnhance.cjs.map +0 -1
  304. package/lib/utils/enhances/animatedSizeEnhance.cjs.map +0 -1
  305. package/lib/utils/enhances/autoFocusEnhance.cjs.map +0 -1
  306. package/lib/utils/enhances/contextEnhance.cjs.map +0 -1
  307. package/lib/utils/enhances/i18nEnhance.cjs.map +0 -1
  308. package/lib/utils/enhances/keyboardFocusEnhance.cjs.map +0 -1
  309. package/lib/utils/enhances/resolveColorEnhance.cjs.map +0 -1
  310. package/lib/utils/eventEmitter.cjs.map +0 -1
  311. package/lib/utils/findComponent.cjs.map +0 -1
  312. package/lib/utils/fire.cjs.map +0 -1
  313. package/lib/utils/focus-lock/focusBorders.cjs.map +0 -1
  314. package/lib/utils/focus-lock/getFocusableIn.cjs.map +0 -1
  315. package/lib/utils/focus-lock/isFocusInside.cjs.map +0 -1
  316. package/lib/utils/focus-lock/isFocusable.cjs.map +0 -1
  317. package/lib/utils/focus-lock/setFocus.cjs.map +0 -1
  318. package/lib/utils/getAccessibleName.cjs.map +0 -1
  319. package/lib/utils/getDisplayName.cjs.map +0 -1
  320. package/lib/utils/getEventTarget.cjs.map +0 -1
  321. package/lib/utils/getOriginChildren.cjs.map +0 -1
  322. package/lib/utils/getRandomInt.cjs.map +0 -1
  323. package/lib/utils/getValue.cjs.map +0 -1
  324. package/lib/utils/hasLabels.cjs.map +0 -1
  325. package/lib/utils/hasParent.cjs.map +0 -1
  326. package/lib/utils/if.cjs.map +0 -1
  327. package/lib/utils/ifChildren.cjs.map +0 -1
  328. package/lib/utils/injectStyle.cjs.map +0 -1
  329. package/lib/utils/inputProps.cjs.map +0 -1
  330. package/lib/utils/isNode.cjs.map +0 -1
  331. package/lib/utils/isPromise.cjs.map +0 -1
  332. package/lib/utils/isRetina.cjs.map +0 -1
  333. package/lib/utils/logger.cjs.map +0 -1
  334. package/lib/utils/numericChecker.cjs.map +0 -1
  335. package/lib/utils/ownerDocument.cjs.map +0 -1
  336. package/lib/utils/pick.cjs.map +0 -1
  337. package/lib/utils/propsForElement.cjs.map +0 -1
  338. package/lib/utils/rafTrottle.cjs.map +0 -1
  339. package/lib/utils/reactToText.cjs.map +0 -1
  340. package/lib/utils/ref.cjs.map +0 -1
  341. package/lib/utils/setRef.cjs.map +0 -1
  342. package/lib/utils/syncScroll.cjs.map +0 -1
  343. package/lib/utils/uncontroll.cjs.map +0 -1
  344. package/lib/utils/uniqueID.cjs.map +0 -1
  345. package/lib/utils/use/useColorResolver.cjs.map +0 -1
  346. package/lib/utils/use/useCss.cjs.map +0 -1
  347. package/lib/utils/use/useEnhancedEffect.cjs.map +0 -1
  348. package/lib/utils/use/useEventCallback.cjs.map +0 -1
  349. package/lib/utils/use/useEventListener.cjs.map +0 -1
  350. package/lib/utils/use/useFocusLock.cjs.map +0 -1
  351. package/lib/utils/use/usePreventScroll.cjs.map +0 -1
  352. package/lib/utils/useCssVariable.cjs.map +0 -1
  353. package/lib/utils/zIndexStacking.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,13 +2,35 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [16.0.0] - 2025-02-14
5
+ ## [16.0.0] - 2025-05-19
6
6
 
7
7
  ### Added
8
8
 
9
9
  - `utils` functions as part of Core.
10
10
  - `LastInteractionType` class to check last interaction was from keyboard or mouse.
11
11
 
12
+ ### Fixed
13
+
14
+ - Return type for `fincComponent` util. It could be only `ReactElement` or `undefined`.
15
+
16
+ ## [2.39.4] - 2025-05-13
17
+
18
+ ### Changed
19
+
20
+ - Version patch update due to children dependencies update (`@semcore/utils` [4.48.4 ~> 4.48.5]).
21
+
22
+ ## [2.39.3] - 2025-05-09
23
+
24
+ ### Changed
25
+
26
+ - Version patch update due to children dependencies update (`@semcore/utils` [4.48.2 ~> 4.48.4]).
27
+
28
+ ## [2.39.2] - 2025-04-04
29
+
30
+ ### Changed
31
+
32
+ - Version patch update due to children dependencies update (`@semcore/utils` [4.48.1 ~> 4.48.2]).
33
+
12
34
  ## [2.39.1] - 2025-03-20
13
35
 
14
36
  ### Changed
@@ -54,4 +54,4 @@ var LastInteractionType = /*#__PURE__*/function () {
54
54
  }();
55
55
  var lastInteraction = new LastInteractionType();
56
56
  exports.lastInteraction = lastInteraction;
57
- //# sourceMappingURL=LastInteractionType.cjs.map
57
+ //# sourceMappingURL=LastInteractionType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LastInteractionType.js","names":["_canUseDOM","_interopRequireDefault","require","LastInteractionType","_classCallCheck2","_defineProperty2","handleKeyDown","bind","handleMouseDown","canUseDOM","document","addEventListener","capture","_createClass2","key","get","lastFocusSource","value","isKeyboard","isMouse","lastInteraction","exports"],"sources":["../src/LastInteractionType.ts"],"sourcesContent":["import canUseDOM from './utils/canUseDOM';\n\nclass LastInteractionType {\n private lastFocusSource: 'mouse' | 'keyboard' | 'none' = 'none';\n\n constructor() {\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleMouseDown = this.handleMouseDown.bind(this);\n\n if (canUseDOM()) {\n document.addEventListener('mousedown', this.handleMouseDown, { capture: true });\n document.addEventListener('keydown', this.handleKeyDown, { capture: true });\n }\n }\n\n public get type() {\n return this.lastFocusSource;\n }\n\n public isKeyboard() {\n return this.lastFocusSource === 'keyboard';\n }\n\n public isMouse() {\n return this.lastFocusSource === 'mouse';\n }\n\n private handleMouseDown() {\n this.lastFocusSource = 'mouse';\n }\n\n private handleKeyDown() {\n this.lastFocusSource = 'keyboard';\n }\n}\n\nexport const lastInteraction = new LastInteractionType();\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,IAEpCC,mBAAmB;EAGvB,SAAAA,oBAAA,EAAc;IAAA,IAAAC,gBAAA,mBAAAD,mBAAA;IAAA,IAAAE,gBAAA,sCAF2C,MAAM;IAG7D,IAAI,CAACC,aAAa,GAAG,IAAI,CAACA,aAAa,CAACC,IAAI,CAAC,IAAI,CAAC;IAClD,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACD,IAAI,CAAC,IAAI,CAAC;IAEtD,IAAI,IAAAE,qBAAS,GAAE,EAAE;MACfC,QAAQ,CAACC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAACH,eAAe,EAAE;QAAEI,OAAO,EAAE;MAAK,CAAC,CAAC;MAC/EF,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAACL,aAAa,EAAE;QAAEM,OAAO,EAAE;MAAK,CAAC,CAAC;IAC7E;EACF;EAAC,IAAAC,aAAA,aAAAV,mBAAA;IAAAW,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAkB;MAChB,OAAO,IAAI,CAACC,eAAe;IAC7B;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAC,WAAA,EAAoB;MAClB,OAAO,IAAI,CAACF,eAAe,KAAK,UAAU;IAC5C;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAE,QAAA,EAAiB;MACf,OAAO,IAAI,CAACH,eAAe,KAAK,OAAO;IACzC;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAT,gBAAA,EAA0B;MACxB,IAAI,CAACQ,eAAe,GAAG,OAAO;IAChC;EAAC;IAAAF,GAAA;IAAAG,KAAA,EAED,SAAAX,cAAA,EAAwB;MACtB,IAAI,CAACU,eAAe,GAAG,UAAU;IACnC;EAAC;EAAA,OAAAb,mBAAA;AAAA;AAGI,IAAMiB,eAAe,GAAG,IAAIjB,mBAAmB,EAAE;AAACkB,OAAA,CAAAD,eAAA,GAAAA,eAAA"}
@@ -70,9 +70,9 @@ export type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args:
70
70
  declare const Root: Root;
71
71
  export { Root };
72
72
  /** @deprecated */
73
- declare abstract class RootComponent<Props = {}, Context = {}, State = {}, Enhance extends readonly ((...args: any[]) => any)[] = []> extends PureComponent<Props, State> {
73
+ declare abstract class RootComponent<Props = {}, Context = {}, State = {}, Enhance extends readonly ((...args: any[]) => any)[] = [], InnerProps = {}> extends PureComponent<Props, State> {
74
74
  get handlers(): Readonly<IRootComponentHandlers>;
75
- get asProps(): Readonly<Merge<Props & IRootComponentProps<Props, Context> & Intergalactic.InternalTypings.ExtractEnhanceType<Enhance>, React.AllHTMLAttributes<any>>>;
75
+ get asProps(): Readonly<Merge<Props & IRootComponentProps<Props, Context> & Intergalactic.InternalTypings.ExtractEnhanceType<Enhance> & InnerProps, React.AllHTMLAttributes<any>>>;
76
76
  Root: Root;
77
77
  isControlled: boolean;
78
78
  }
@@ -56,4 +56,4 @@ var wrapIntergalacticComponent = function wrapIntergalacticComponent(wrapper) {
56
56
  return wrapper;
57
57
  };
58
58
  exports.wrapIntergalacticComponent = wrapIntergalacticComponent;
59
- //# sourceMappingURL=Component.cjs.map
59
+ //# sourceMappingURL=Component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Component.js","names":["_react","require","_symbols","Root","undefined","exports","RootComponent","_PureComponent","_inherits2","_super","_createSuper2","_this","_len","arguments","length","args","Array","_key","_classCallCheck2","call","apply","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","get","PureComponent","Component","Intergalactic","_Intergalactic","InternalTypings","_InternalTypings","wrapIntergalacticComponent","wrapper"],"sources":["../../src/core-types/Component.ts"],"sourcesContent":["import React, {\n AllHTMLAttributes,\n ForwardRefExoticComponent,\n PureComponent,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react';\nimport { IStyledProps } from '../styled/index';\nimport { CORE_COMPONENT, CREATE_COMPONENT } from './symbols';\n\n/** @deprecated */\ntype KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : K;\n} extends { [_ in keyof T]: infer U }\n ? U\n : never;\n\n/** @deprecated */\nexport type HandlersType<UCProps> = { [K in keyof UCProps]?: <T = unknown>(arg: T) => void };\n/** @deprecated */\nexport type ChildrenType<Props = {}, Ctx = {}, UCProps = {}> =\n | ((props: Props & Ctx, handlers: HandlersType<UCProps>) => ReactNode)\n | ReactNode;\n\n/** @deprecated */\nexport type RootComponentHandler = (...args: any[]) => void | false;\n\n/** @deprecated */\nexport interface IRootComponentHandlers {\n [key: string]: RootComponentHandler;\n}\n\n/** @deprecated */\nexport interface IRootComponentProps<Props = {}, Ctx = {}> {\n forwardRef?: RefObject<any>;\n Children?: any;\n children?: ChildrenType<Props, Ctx>;\n styles?: IStyledProps['styles'];\n 'data-ui-name'?: string;\n}\n\n/** @deprecated */\nexport type IComponentProps<Props = {}, Ctx = {}> = Props & IRootComponentProps<Props, Ctx>;\n\n/** @deprecated */\nexport type IFunctionProps<Props = {}, Ctx = {}> = IComponentProps<Props, Ctx> &\n Omit<AllHTMLAttributes<any>, keyof IComponentProps<Props, Ctx>> & { Root?: Root };\n\n/** @deprecated */\nexport type PropsWithRenderFnChildren<Props = {}, Ctx = {}, UCProps = {}> = Omit<\n Pick<Props, KnownKeys<Props>>,\n 'children'\n> & {\n children?: ChildrenType<Props, Ctx, UCProps>;\n [key: string]: unknown;\n};\n\n/** @deprecated */\nexport type CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\n/** @deprecated */\nexport type ReturnEl = React.ReactElement | null;\n\nexport interface IRootNodeProps {\n render: React.ElementType | string;\n tag?: React.ElementType | string;\n\n [key: string]: any;\n}\n\ntype Root = ForwardRefExoticComponent<IRootNodeProps>;\n\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetter<T extends (...args: any) => any> = <P>(props?: P) => ReturnType<T> & P;\n/**\n * @deprecated since version ^1.8.0\n */\n/** @deprecated */\nexport type PropGetterReturn<T extends (...args: any) => any> = Partial<ReturnType<T>>;\n/** @deprecated */\nexport type PropGetterFn = <T extends {}>(props?: T) => T & { [key: string]: unknown };\n/** @deprecated */\nexport type Merge<Props, HTMLProps> = Props & Omit<HTMLProps, keyof Props>;\n/** @deprecated */\nexport type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args: any) => any> = <P>(\n props?: P,\n) => Merge<ReturnType<G1>, ReturnType<G2>> & P;\n\nconst Root: Root = undefined as any;\n\nexport { Root };\n\n/** @deprecated */\nabstract class RootComponent<\n Props = {},\n Context = {},\n State = {},\n Enhance extends readonly ((...args: any[]) => any)[] = [],\n InnerProps = {},\n> extends PureComponent<Props, State> {\n get handlers(): Readonly<IRootComponentHandlers> {\n return {};\n }\n\n get asProps() {\n return {} as Readonly<\n Merge<\n Props &\n IRootComponentProps<Props, Context> &\n Intergalactic.InternalTypings.ExtractEnhanceType<Enhance> &\n InnerProps,\n AllHTMLAttributes<any>\n >\n >;\n }\n\n Root: Root = undefined as any;\n\n isControlled = false;\n}\n\nexport const Component = RootComponent;\n/** @deprecated */\nexport type Component<\n Props = {},\n Context = {},\n State = {},\n Handlers extends IRootComponentHandlers = IRootComponentHandlers,\n> = React.ComponentClass<Props, State> & {\n isControlled: boolean;\n\n handlers: Readonly<Handlers>;\n\n asProps: Readonly<Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>>;\n\n Root: Root;\n};\n\nexport namespace Intergalactic {\n type ReactFCProps<C extends React.FC> = C extends React.FC<infer Props> ? Omit<Props, 'tag'> : {};\n type ReactComponentProps<C extends React.ComponentClass> = C extends React.ComponentClass<\n infer Props\n >\n ? Omit<Props, 'tag'>\n : never;\n type ReactFCLike = (props: any) => any;\n type ReactFCLikeProps<C extends ReactFCLike> = C extends (props: infer Props) => any ? Props : {};\n type ComponentChildren<\n Props,\n Context,\n RenderingResult = InternalTypings.ReturnResult,\n AdditionalContext extends any[] = never[],\n > =\n | ((props: MergeProps<Context, Props>, ...args: AdditionalContext) => RenderingResult)\n | InternalTypings.ReturnResult;\n type ComponentBasicProps<Tag extends InternalTypings.ComponentTag> = {\n ref?: React.Ref<InternalTypings.ComponentHtmlElement<Tag> | null>;\n /** @private DO NOT USE IT. Low-level api that prevents specified props from being applied as DOM attribute. */\n __excludeProps?: string[];\n };\n type MergeProps<HighPriorityProps, LowPriorityProps> = {\n [K in keyof LowPriorityProps]: K extends keyof HighPriorityProps\n ? HighPriorityProps[K]\n : LowPriorityProps[K];\n } & HighPriorityProps;\n /** @private */\n export namespace InternalTypings {\n export type EfficientOmit<Type, Keys> = {\n [Property in keyof Type as Exclude<Property, Keys>]: Type[Property];\n };\n export type ExtractEnhanceType<F extends readonly ((...args: any[]) => any)[]> =\n F['length'] extends 0\n ? {}\n : F['length'] extends 1\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n }\n : F['length'] extends 2\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n }\n : F['length'] extends 3\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n } & {\n [K in keyof ReturnType<F[2]>]: ReturnType<F[2]>[K];\n }\n : F['length'] extends 4\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n } & {\n [K in keyof ReturnType<F[2]>]: ReturnType<F[2]>[K];\n } & {\n [K in keyof ReturnType<F[3]>]: ReturnType<F[3]>[K];\n }\n : {};\n export type ComponentPropsNesting<Tag extends InternalTypings.ComponentTag> = Omit<\n MergeProps<\n Tag extends React.FC\n ? ReactFCProps<Tag>\n : Tag extends React.ComponentClass\n ? ReactComponentProps<Tag>\n : Tag extends ReactFCLike\n ? ReactFCLikeProps<Tag>\n : Tag extends keyof JSX.IntrinsicElements\n ? JSX.IntrinsicElements[Tag]\n : {},\n Tag extends { __nestedProps: infer NestedProps } ? NestedProps : {}\n >,\n 'children' | 'tag'\n >;\n export type ReturnResult =\n | React.ReactElement\n | React.ReactNode\n | React.ReactNode[]\n | string\n | null;\n export type ComponentTag =\n | keyof JSX.IntrinsicElements\n | React.ComponentClass\n | React.FC\n | ReactFCLike;\n export type ComponentProps<\n Tag extends ComponentTag,\n BaseTag extends ComponentTag | never,\n Props,\n Context = never,\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n ReturnResult,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<\n EfficientOmit<Props, 'tag' | 'children'>,\n MergeProps<ComponentPropsNesting<Tag>, ComponentPropsNesting<BaseTag>>\n >;\n export type PropsRenderingResultComponentProps<\n Tag extends ComponentTag,\n Props,\n Context = {},\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n Partial<\n EfficientOmit<\n MergeProps<Props, ComponentPropsNesting<Tag>>,\n 'children' | 'tag' | 'ref'\n > & {\n children?: React.ReactNode;\n }\n >,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<EfficientOmit<Props, 'tag' | 'children'>, ComponentPropsNesting<Tag>>;\n export type ComponentRenderingResults = React.ReactElement;\n export type ComponentAdditive<\n BaseTag extends ComponentTag,\n Tag extends ComponentTag,\n Props = {},\n Context = {},\n AdditionalContext = {},\n > = {\n __nestedProps: ComponentPropsNesting<BaseTag>;\n __tag: Tag;\n __props: Props;\n __context: Context;\n __additionalContext: AdditionalContext;\n displayName: string;\n };\n export type InferJsxIntrinsicElement<T extends React.DetailedHTMLProps<any, any>> =\n T extends React.DetailedHTMLProps<infer _, infer Element> ? Element : HTMLElement;\n type InferElementFromRef<T> = T extends React.Ref<infer Element> ? Element : never;\n type InferRefElementFromProps<T> = 'ref' extends keyof T\n ? InferElementFromRef<T['ref']>\n : HTMLElement;\n export type ComponentHtmlElement<Tag extends ComponentTag> =\n Tag extends keyof JSX.IntrinsicElements\n ? InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>\n : Tag extends { __nestedProps: infer NestedProps }\n ? InferRefElementFromProps<NestedProps>\n : HTMLElement;\n export type UntypeRefAndTag<Props> = Intergalactic.InternalTypings.EfficientOmit<\n Props,\n 'ref' | 'tag'\n > & {\n ref: React.Ref<any>;\n tag: Intergalactic.InternalTypings.ComponentTag;\n };\n }\n export type Component<\n BaseTag extends InternalTypings.ComponentTag = never,\n BaseProps = {},\n Context = {},\n AdditionalContext extends any[] = never[],\n > = (<Tag extends InternalTypings.ComponentTag = BaseTag, Props extends BaseProps = BaseProps>(\n props: InternalTypings.ComponentProps<Tag, BaseTag, Props, Context, AdditionalContext>,\n ) => InternalTypings.ComponentRenderingResults) &\n InternalTypings.ComponentAdditive<BaseTag, Tag, BaseProps, Context, AdditionalContext>;\n export type Tag = InternalTypings.ComponentTag;\n export type DomProps<Tag extends keyof JSX.IntrinsicElements> =\n InternalTypings.InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>;\n export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n > &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n}\n\nexport const wrapIntergalacticComponent = <\n Component extends Intergalactic.Component<any, any, any, any>,\n PropsExtending = {},\n>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<Component>\n > &\n PropsExtending,\n ) => React.ReactNode,\n): Intergalactic.Component<\n Component['__tag'],\n Component['__props'] & Component['__nestedProps'] & PropsExtending,\n Component['__context'],\n Component['__additionalContext']\n> => wrapper as any;\n\nexport type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> &\n RefAttributes<unknown>;\nexport type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<\n PropsAndRef<T, Ctx, UCProps>\n>;\ntype ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps]\n ? ComponentType<ParentProps, ChildProps, Context, UCProps>\n : ForwardRefComponent<T, Context, UCProps>;\n\nexport type ComponentType<\n ComponentProps,\n ChildComponentProps = {},\n ContextType = {},\n UCProps = {},\n FNType = null,\n> = (FNType extends null\n ? ForwardRefComponent<ComponentProps, ContextType, UCProps>\n : FNType & { displayName: string }) & {\n [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;\n} & {\n [CORE_COMPONENT]: boolean;\n [CREATE_COMPONENT]: () => ComponentType<\n ComponentProps,\n ChildComponentProps,\n ContextType,\n UCProps\n >;\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,QAAA,GAAAD,OAAA;AAmFA,IAAME,IAAU,GAAGC,SAAgB;AAACC,OAAA,CAAAF,IAAA,GAAAA,IAAA;AAIpC;AAAA,IACeG,aAAa,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,aAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,aAAA;EAAA,SAAAA,cAAA;IAAA,IAAAK,KAAA;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAA,IAAAC,gBAAA,mBAAAZ,aAAA;IAAAK,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAN,IAAA;IAAA,IAAAO,gBAAA,iBAAAC,uBAAA,aAAAZ,KAAA,WAuBbP,SAAS;IAAA,IAAAkB,gBAAA,iBAAAC,uBAAA,aAAAZ,KAAA,mBAEP,KAAK;IAAA,OAAAA,KAAA;EAAA;EAAA,IAAAa,aAAA,aAAAlB,aAAA;IAAAmB,GAAA;IAAAC,GAAA,EAlBpB,SAAAA,IAAA,EAAiD;MAC/C,OAAO,CAAC,CAAC;IACX;EAAC;IAAAD,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAc;MACZ,OAAO,CAAC,CAAC;IASX;EAAC;EAAA,OAAApB,aAAA;AAAA,EAfOqB,oBAAa;AAsBhB,IAAMC,SAAS,GAAGtB,aAAa;AACtC;AAAAD,OAAA,CAAAuB,SAAA,GAAAA,SAAA;AAAA,IAAAC,aAAA;AAAAxB,OAAA,CAAAwB,aAAA,GAAAA,aAAA;AAAA,WAAAC,cAAA;EAAA,IAAAC,eAAA;EAAA,WAAAC,gBAAA,MA4CmBD,eAAe,KAAfA,eAAe,GAAAD,cAAA,CAAfC,eAAe,KAAAD,cAAA,CAAfC,eAAe;AAAA,GA5BjBF,aAAa,KAAAxB,OAAA,CAAAwB,aAAA,GAAbA,aAAa;AA2LvB,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAIrCC,OAKoB;EAAA,OAMjBA,OAAO;AAAA,CAAO;AAAC7B,OAAA,CAAA4B,0BAAA,GAAAA,0BAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Component.mjs","names":["PureComponent","CORE_COMPONENT","CREATE_COMPONENT","Root","undefined","RootComponent","_PureComponent","_inherits","_super","_createSuper","_this","_len","arguments","length","args","Array","_key","_classCallCheck","call","apply","concat","_defineProperty","_assertThisInitialized","_createClass","key","get","Component","Intergalactic","_Intergalactic","InternalTypings","_InternalTypings","wrapIntergalacticComponent","wrapper"],"sources":["../../src/core-types/Component.ts"],"sourcesContent":["import React, {\n AllHTMLAttributes,\n ForwardRefExoticComponent,\n PureComponent,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react';\nimport { IStyledProps } from '../styled/index';\nimport { CORE_COMPONENT, CREATE_COMPONENT } from './symbols';\n\n/** @deprecated */\ntype KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : K;\n} extends { [_ in keyof T]: infer U }\n ? U\n : never;\n\n/** @deprecated */\nexport type HandlersType<UCProps> = { [K in keyof UCProps]?: <T = unknown>(arg: T) => void };\n/** @deprecated */\nexport type ChildrenType<Props = {}, Ctx = {}, UCProps = {}> =\n | ((props: Props & Ctx, handlers: HandlersType<UCProps>) => ReactNode)\n | ReactNode;\n\n/** @deprecated */\nexport type RootComponentHandler = (...args: any[]) => void | false;\n\n/** @deprecated */\nexport interface IRootComponentHandlers {\n [key: string]: RootComponentHandler;\n}\n\n/** @deprecated */\nexport interface IRootComponentProps<Props = {}, Ctx = {}> {\n forwardRef?: RefObject<any>;\n Children?: any;\n children?: ChildrenType<Props, Ctx>;\n styles?: IStyledProps['styles'];\n 'data-ui-name'?: string;\n}\n\n/** @deprecated */\nexport type IComponentProps<Props = {}, Ctx = {}> = Props & IRootComponentProps<Props, Ctx>;\n\n/** @deprecated */\nexport type IFunctionProps<Props = {}, Ctx = {}> = IComponentProps<Props, Ctx> &\n Omit<AllHTMLAttributes<any>, keyof IComponentProps<Props, Ctx>> & { Root?: Root };\n\n/** @deprecated */\nexport type PropsWithRenderFnChildren<Props = {}, Ctx = {}, UCProps = {}> = Omit<\n Pick<Props, KnownKeys<Props>>,\n 'children'\n> & {\n children?: ChildrenType<Props, Ctx, UCProps>;\n [key: string]: unknown;\n};\n\n/** @deprecated */\nexport type CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\n/** @deprecated */\nexport type ReturnEl = React.ReactElement | null;\n\nexport interface IRootNodeProps {\n render: React.ElementType | string;\n tag?: React.ElementType | string;\n\n [key: string]: any;\n}\n\ntype Root = ForwardRefExoticComponent<IRootNodeProps>;\n\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetter<T extends (...args: any) => any> = <P>(props?: P) => ReturnType<T> & P;\n/**\n * @deprecated since version ^1.8.0\n */\n/** @deprecated */\nexport type PropGetterReturn<T extends (...args: any) => any> = Partial<ReturnType<T>>;\n/** @deprecated */\nexport type PropGetterFn = <T extends {}>(props?: T) => T & { [key: string]: unknown };\n/** @deprecated */\nexport type Merge<Props, HTMLProps> = Props & Omit<HTMLProps, keyof Props>;\n/** @deprecated */\nexport type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args: any) => any> = <P>(\n props?: P,\n) => Merge<ReturnType<G1>, ReturnType<G2>> & P;\n\nconst Root: Root = undefined as any;\n\nexport { Root };\n\n/** @deprecated */\nabstract class RootComponent<\n Props = {},\n Context = {},\n State = {},\n Enhance extends readonly ((...args: any[]) => any)[] = [],\n> extends PureComponent<Props, State> {\n get handlers(): Readonly<IRootComponentHandlers> {\n return {};\n }\n\n get asProps() {\n return {} as Readonly<\n Merge<\n Props &\n IRootComponentProps<Props, Context> &\n Intergalactic.InternalTypings.ExtractEnhanceType<Enhance>,\n AllHTMLAttributes<any>\n >\n >;\n }\n\n Root: Root = undefined as any;\n\n isControlled = false;\n}\n\nexport const Component = RootComponent;\n/** @deprecated */\nexport type Component<\n Props = {},\n Context = {},\n State = {},\n Handlers extends IRootComponentHandlers = IRootComponentHandlers,\n> = React.ComponentClass<Props, State> & {\n isControlled: boolean;\n\n handlers: Readonly<Handlers>;\n\n asProps: Readonly<Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>>;\n\n Root: Root;\n};\n\nexport namespace Intergalactic {\n type ReactFCProps<C extends React.FC> = C extends React.FC<infer Props> ? Omit<Props, 'tag'> : {};\n type ReactComponentProps<C extends React.ComponentClass> = C extends React.ComponentClass<\n infer Props\n >\n ? Omit<Props, 'tag'>\n : never;\n type ReactFCLike = (props: any) => any;\n type ReactFCLikeProps<C extends ReactFCLike> = C extends (props: infer Props) => any ? Props : {};\n type ComponentChildren<\n Props,\n Context,\n RenderingResult = InternalTypings.ReturnResult,\n AdditionalContext extends any[] = never[],\n > =\n | ((props: MergeProps<Context, Props>, ...args: AdditionalContext) => RenderingResult)\n | InternalTypings.ReturnResult;\n type ComponentBasicProps<Tag extends InternalTypings.ComponentTag> = {\n ref?: React.Ref<InternalTypings.ComponentHtmlElement<Tag> | null>;\n /** @private DO NOT USE IT. Low-level api that prevents specified props from being applied as DOM attribute. */\n __excludeProps?: string[];\n };\n type MergeProps<HighPriorityProps, LowPriorityProps> = {\n [K in keyof LowPriorityProps]: K extends keyof HighPriorityProps\n ? HighPriorityProps[K]\n : LowPriorityProps[K];\n } & HighPriorityProps;\n /** @private */\n export namespace InternalTypings {\n export type EfficientOmit<Type, Keys> = {\n [Property in keyof Type as Exclude<Property, Keys>]: Type[Property];\n };\n export type ExtractEnhanceType<F extends readonly ((...args: any[]) => any)[]> =\n F['length'] extends 0\n ? {}\n : F['length'] extends 1\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n }\n : F['length'] extends 2\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n }\n : F['length'] extends 3\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n } & {\n [K in keyof ReturnType<F[2]>]: ReturnType<F[2]>[K];\n }\n : F['length'] extends 4\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n } & {\n [K in keyof ReturnType<F[2]>]: ReturnType<F[2]>[K];\n } & {\n [K in keyof ReturnType<F[3]>]: ReturnType<F[3]>[K];\n }\n : {};\n export type ComponentPropsNesting<Tag extends InternalTypings.ComponentTag> = Omit<\n MergeProps<\n Tag extends React.FC\n ? ReactFCProps<Tag>\n : Tag extends React.ComponentClass\n ? ReactComponentProps<Tag>\n : Tag extends ReactFCLike\n ? ReactFCLikeProps<Tag>\n : Tag extends keyof JSX.IntrinsicElements\n ? JSX.IntrinsicElements[Tag]\n : {},\n Tag extends { __nestedProps: infer NestedProps } ? NestedProps : {}\n >,\n 'children' | 'tag'\n >;\n export type ReturnResult =\n | React.ReactElement\n | React.ReactNode\n | React.ReactNode[]\n | string\n | null;\n export type ComponentTag =\n | keyof JSX.IntrinsicElements\n | React.ComponentClass\n | React.FC\n | ReactFCLike;\n export type ComponentProps<\n Tag extends ComponentTag,\n BaseTag extends ComponentTag | never,\n Props,\n Context = never,\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n ReturnResult,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<\n EfficientOmit<Props, 'tag' | 'children'>,\n MergeProps<ComponentPropsNesting<Tag>, ComponentPropsNesting<BaseTag>>\n >;\n export type PropsRenderingResultComponentProps<\n Tag extends ComponentTag,\n Props,\n Context = {},\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n Partial<\n EfficientOmit<\n MergeProps<Props, ComponentPropsNesting<Tag>>,\n 'children' | 'tag' | 'ref'\n > & {\n children?: React.ReactNode;\n }\n >,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<EfficientOmit<Props, 'tag' | 'children'>, ComponentPropsNesting<Tag>>;\n export type ComponentRenderingResults = React.ReactElement;\n export type ComponentAdditive<\n BaseTag extends ComponentTag,\n Tag extends ComponentTag,\n Props = {},\n Context = {},\n AdditionalContext = {},\n > = {\n __nestedProps: ComponentPropsNesting<BaseTag>;\n __tag: Tag;\n __props: Props;\n __context: Context;\n __additionalContext: AdditionalContext;\n displayName: string;\n };\n export type InferJsxIntrinsicElement<T extends React.DetailedHTMLProps<any, any>> =\n T extends React.DetailedHTMLProps<infer _, infer Element> ? Element : HTMLElement;\n type InferElementFromRef<T> = T extends React.Ref<infer Element> ? Element : never;\n type InferRefElementFromProps<T> = 'ref' extends keyof T\n ? InferElementFromRef<T['ref']>\n : HTMLElement;\n export type ComponentHtmlElement<Tag extends ComponentTag> =\n Tag extends keyof JSX.IntrinsicElements\n ? InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>\n : Tag extends { __nestedProps: infer NestedProps }\n ? InferRefElementFromProps<NestedProps>\n : HTMLElement;\n export type UntypeRefAndTag<Props> = Intergalactic.InternalTypings.EfficientOmit<\n Props,\n 'ref' | 'tag'\n > & {\n ref: React.Ref<any>;\n tag: Intergalactic.InternalTypings.ComponentTag;\n };\n }\n export type Component<\n BaseTag extends InternalTypings.ComponentTag = never,\n BaseProps = {},\n Context = {},\n AdditionalContext extends any[] = never[],\n > = (<Tag extends InternalTypings.ComponentTag = BaseTag, Props extends BaseProps = BaseProps>(\n props: InternalTypings.ComponentProps<Tag, BaseTag, Props, Context, AdditionalContext>,\n ) => InternalTypings.ComponentRenderingResults) &\n InternalTypings.ComponentAdditive<BaseTag, Tag, BaseProps, Context, AdditionalContext>;\n export type Tag = InternalTypings.ComponentTag;\n export type DomProps<Tag extends keyof JSX.IntrinsicElements> =\n InternalTypings.InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>;\n export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n > &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n}\n\nexport const wrapIntergalacticComponent = <\n Component extends Intergalactic.Component<any, any, any, any>,\n PropsExtending = {},\n>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<Component>\n > &\n PropsExtending,\n ) => React.ReactNode,\n): Intergalactic.Component<\n Component['__tag'],\n Component['__props'] & Component['__nestedProps'] & PropsExtending,\n Component['__context'],\n Component['__additionalContext']\n> => wrapper as any;\n\nexport type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> &\n RefAttributes<unknown>;\nexport type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<\n PropsAndRef<T, Ctx, UCProps>\n>;\ntype ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps]\n ? ComponentType<ParentProps, ChildProps, Context, UCProps>\n : ForwardRefComponent<T, Context, UCProps>;\n\nexport type ComponentType<\n ComponentProps,\n ChildComponentProps = {},\n ContextType = {},\n UCProps = {},\n FNType = null,\n> = (FNType extends null\n ? ForwardRefComponent<ComponentProps, ContextType, UCProps>\n : FNType & { displayName: string }) & {\n [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;\n} & {\n [CORE_COMPONENT]: boolean;\n [CREATE_COMPONENT]: () => ComponentType<\n ComponentProps,\n ChildComponentProps,\n ContextType,\n UCProps\n >;\n};\n"],"mappings":";;;;;;AAAA,SAGEA,aAAa,QAIR,OAAO;AAEd,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,eAAW;;AAE5D;;AAiFA,IAAMC,IAAU,GAAGC,SAAgB;AAEnC,SAASD,IAAI;;AAEb;AAAA,IACeE,aAAa,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EAAA,SAAAA,cAAA;IAAA,IAAAK,KAAA;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAC,eAAA,OAAAZ,aAAA;IAAAK,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAN,IAAA;IAAAO,eAAA,CAAAC,sBAAA,CAAAZ,KAAA,WAqBbN,SAAS;IAAAiB,eAAA,CAAAC,sBAAA,CAAAZ,KAAA,mBAEP,KAAK;IAAA,OAAAA,KAAA;EAAA;EAAAa,YAAA,CAAAlB,aAAA;IAAAmB,GAAA;IAAAC,GAAA,EAjBpB,SAAAA,IAAA,EAAiD;MAC/C,OAAO,CAAC,CAAC;IACX;EAAC;IAAAD,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAc;MACZ,OAAO,CAAC,CAAC;IAQX;EAAC;EAAA,OAAApB,aAAA;AAAA,EAdOL,aAAa;AAqBvB,OAAO,IAAM0B,SAAS,GAAGrB,aAAa;AACtC;;AAgBA,WAAAsB,aAAA;AAyLC,WAAAC,cAAA;EAAA,IAAAC,eAAA;EAAA,WAAAC,gBAAA,MA7JkBD,eAAe,KAAfA,eAAe,GAAAD,cAAA,CAAfC,eAAe,KAAAD,cAAA,CAAfC,eAAe;AAAA,GA5BjBF,aAAa,KAAbA,aAAa;AA2L9B,OAAO,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAIrCC,OAKoB;EAAA,OAMjBA,OAAO;AAAA,CAAO"}
1
+ {"version":3,"file":"Component.mjs","names":["PureComponent","CORE_COMPONENT","CREATE_COMPONENT","Root","undefined","RootComponent","_PureComponent","_inherits","_super","_createSuper","_this","_len","arguments","length","args","Array","_key","_classCallCheck","call","apply","concat","_defineProperty","_assertThisInitialized","_createClass","key","get","Component","Intergalactic","_Intergalactic","InternalTypings","_InternalTypings","wrapIntergalacticComponent","wrapper"],"sources":["../../src/core-types/Component.ts"],"sourcesContent":["import React, {\n AllHTMLAttributes,\n ForwardRefExoticComponent,\n PureComponent,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react';\nimport { IStyledProps } from '../styled/index';\nimport { CORE_COMPONENT, CREATE_COMPONENT } from './symbols';\n\n/** @deprecated */\ntype KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : K;\n} extends { [_ in keyof T]: infer U }\n ? U\n : never;\n\n/** @deprecated */\nexport type HandlersType<UCProps> = { [K in keyof UCProps]?: <T = unknown>(arg: T) => void };\n/** @deprecated */\nexport type ChildrenType<Props = {}, Ctx = {}, UCProps = {}> =\n | ((props: Props & Ctx, handlers: HandlersType<UCProps>) => ReactNode)\n | ReactNode;\n\n/** @deprecated */\nexport type RootComponentHandler = (...args: any[]) => void | false;\n\n/** @deprecated */\nexport interface IRootComponentHandlers {\n [key: string]: RootComponentHandler;\n}\n\n/** @deprecated */\nexport interface IRootComponentProps<Props = {}, Ctx = {}> {\n forwardRef?: RefObject<any>;\n Children?: any;\n children?: ChildrenType<Props, Ctx>;\n styles?: IStyledProps['styles'];\n 'data-ui-name'?: string;\n}\n\n/** @deprecated */\nexport type IComponentProps<Props = {}, Ctx = {}> = Props & IRootComponentProps<Props, Ctx>;\n\n/** @deprecated */\nexport type IFunctionProps<Props = {}, Ctx = {}> = IComponentProps<Props, Ctx> &\n Omit<AllHTMLAttributes<any>, keyof IComponentProps<Props, Ctx>> & { Root?: Root };\n\n/** @deprecated */\nexport type PropsWithRenderFnChildren<Props = {}, Ctx = {}, UCProps = {}> = Omit<\n Pick<Props, KnownKeys<Props>>,\n 'children'\n> & {\n children?: ChildrenType<Props, Ctx, UCProps>;\n [key: string]: unknown;\n};\n\n/** @deprecated */\nexport type CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?: ((props: Props & Ctx, handlers: UCProps) => React.ReactNode) | React.ReactNode;\n};\n/** @deprecated */\nexport type ReturnEl = React.ReactElement | null;\n\nexport interface IRootNodeProps {\n render: React.ElementType | string;\n tag?: React.ElementType | string;\n\n [key: string]: any;\n}\n\ntype Root = ForwardRefExoticComponent<IRootNodeProps>;\n\n/**\n * @deprecated since version ^1.8.0\n */\nexport type PropGetter<T extends (...args: any) => any> = <P>(props?: P) => ReturnType<T> & P;\n/**\n * @deprecated since version ^1.8.0\n */\n/** @deprecated */\nexport type PropGetterReturn<T extends (...args: any) => any> = Partial<ReturnType<T>>;\n/** @deprecated */\nexport type PropGetterFn = <T extends {}>(props?: T) => T & { [key: string]: unknown };\n/** @deprecated */\nexport type Merge<Props, HTMLProps> = Props & Omit<HTMLProps, keyof Props>;\n/** @deprecated */\nexport type MergeGetters<G1 extends (...args: any) => any, G2 extends (...args: any) => any> = <P>(\n props?: P,\n) => Merge<ReturnType<G1>, ReturnType<G2>> & P;\n\nconst Root: Root = undefined as any;\n\nexport { Root };\n\n/** @deprecated */\nabstract class RootComponent<\n Props = {},\n Context = {},\n State = {},\n Enhance extends readonly ((...args: any[]) => any)[] = [],\n InnerProps = {},\n> extends PureComponent<Props, State> {\n get handlers(): Readonly<IRootComponentHandlers> {\n return {};\n }\n\n get asProps() {\n return {} as Readonly<\n Merge<\n Props &\n IRootComponentProps<Props, Context> &\n Intergalactic.InternalTypings.ExtractEnhanceType<Enhance> &\n InnerProps,\n AllHTMLAttributes<any>\n >\n >;\n }\n\n Root: Root = undefined as any;\n\n isControlled = false;\n}\n\nexport const Component = RootComponent;\n/** @deprecated */\nexport type Component<\n Props = {},\n Context = {},\n State = {},\n Handlers extends IRootComponentHandlers = IRootComponentHandlers,\n> = React.ComponentClass<Props, State> & {\n isControlled: boolean;\n\n handlers: Readonly<Handlers>;\n\n asProps: Readonly<Merge<Props & IRootComponentProps<Props, Context>, AllHTMLAttributes<any>>>;\n\n Root: Root;\n};\n\nexport namespace Intergalactic {\n type ReactFCProps<C extends React.FC> = C extends React.FC<infer Props> ? Omit<Props, 'tag'> : {};\n type ReactComponentProps<C extends React.ComponentClass> = C extends React.ComponentClass<\n infer Props\n >\n ? Omit<Props, 'tag'>\n : never;\n type ReactFCLike = (props: any) => any;\n type ReactFCLikeProps<C extends ReactFCLike> = C extends (props: infer Props) => any ? Props : {};\n type ComponentChildren<\n Props,\n Context,\n RenderingResult = InternalTypings.ReturnResult,\n AdditionalContext extends any[] = never[],\n > =\n | ((props: MergeProps<Context, Props>, ...args: AdditionalContext) => RenderingResult)\n | InternalTypings.ReturnResult;\n type ComponentBasicProps<Tag extends InternalTypings.ComponentTag> = {\n ref?: React.Ref<InternalTypings.ComponentHtmlElement<Tag> | null>;\n /** @private DO NOT USE IT. Low-level api that prevents specified props from being applied as DOM attribute. */\n __excludeProps?: string[];\n };\n type MergeProps<HighPriorityProps, LowPriorityProps> = {\n [K in keyof LowPriorityProps]: K extends keyof HighPriorityProps\n ? HighPriorityProps[K]\n : LowPriorityProps[K];\n } & HighPriorityProps;\n /** @private */\n export namespace InternalTypings {\n export type EfficientOmit<Type, Keys> = {\n [Property in keyof Type as Exclude<Property, Keys>]: Type[Property];\n };\n export type ExtractEnhanceType<F extends readonly ((...args: any[]) => any)[]> =\n F['length'] extends 0\n ? {}\n : F['length'] extends 1\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n }\n : F['length'] extends 2\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n }\n : F['length'] extends 3\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n } & {\n [K in keyof ReturnType<F[2]>]: ReturnType<F[2]>[K];\n }\n : F['length'] extends 4\n ? {\n [K in keyof ReturnType<F[0]>]: ReturnType<F[0]>[K];\n } & {\n [K in keyof ReturnType<F[1]>]: ReturnType<F[1]>[K];\n } & {\n [K in keyof ReturnType<F[2]>]: ReturnType<F[2]>[K];\n } & {\n [K in keyof ReturnType<F[3]>]: ReturnType<F[3]>[K];\n }\n : {};\n export type ComponentPropsNesting<Tag extends InternalTypings.ComponentTag> = Omit<\n MergeProps<\n Tag extends React.FC\n ? ReactFCProps<Tag>\n : Tag extends React.ComponentClass\n ? ReactComponentProps<Tag>\n : Tag extends ReactFCLike\n ? ReactFCLikeProps<Tag>\n : Tag extends keyof JSX.IntrinsicElements\n ? JSX.IntrinsicElements[Tag]\n : {},\n Tag extends { __nestedProps: infer NestedProps } ? NestedProps : {}\n >,\n 'children' | 'tag'\n >;\n export type ReturnResult =\n | React.ReactElement\n | React.ReactNode\n | React.ReactNode[]\n | string\n | null;\n export type ComponentTag =\n | keyof JSX.IntrinsicElements\n | React.ComponentClass\n | React.FC\n | ReactFCLike;\n export type ComponentProps<\n Tag extends ComponentTag,\n BaseTag extends ComponentTag | never,\n Props,\n Context = never,\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n ReturnResult,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<\n EfficientOmit<Props, 'tag' | 'children'>,\n MergeProps<ComponentPropsNesting<Tag>, ComponentPropsNesting<BaseTag>>\n >;\n export type PropsRenderingResultComponentProps<\n Tag extends ComponentTag,\n Props,\n Context = {},\n AdditionalContext extends any[] = never[],\n > = {\n tag?: Tag;\n children?: ComponentChildren<\n EfficientOmit<Props, 'children'> & { children: React.ReactNode },\n Context,\n Partial<\n EfficientOmit<\n MergeProps<Props, ComponentPropsNesting<Tag>>,\n 'children' | 'tag' | 'ref'\n > & {\n children?: React.ReactNode;\n }\n >,\n AdditionalContext\n >;\n } & ComponentBasicProps<Tag> &\n MergeProps<EfficientOmit<Props, 'tag' | 'children'>, ComponentPropsNesting<Tag>>;\n export type ComponentRenderingResults = React.ReactElement;\n export type ComponentAdditive<\n BaseTag extends ComponentTag,\n Tag extends ComponentTag,\n Props = {},\n Context = {},\n AdditionalContext = {},\n > = {\n __nestedProps: ComponentPropsNesting<BaseTag>;\n __tag: Tag;\n __props: Props;\n __context: Context;\n __additionalContext: AdditionalContext;\n displayName: string;\n };\n export type InferJsxIntrinsicElement<T extends React.DetailedHTMLProps<any, any>> =\n T extends React.DetailedHTMLProps<infer _, infer Element> ? Element : HTMLElement;\n type InferElementFromRef<T> = T extends React.Ref<infer Element> ? Element : never;\n type InferRefElementFromProps<T> = 'ref' extends keyof T\n ? InferElementFromRef<T['ref']>\n : HTMLElement;\n export type ComponentHtmlElement<Tag extends ComponentTag> =\n Tag extends keyof JSX.IntrinsicElements\n ? InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>\n : Tag extends { __nestedProps: infer NestedProps }\n ? InferRefElementFromProps<NestedProps>\n : HTMLElement;\n export type UntypeRefAndTag<Props> = Intergalactic.InternalTypings.EfficientOmit<\n Props,\n 'ref' | 'tag'\n > & {\n ref: React.Ref<any>;\n tag: Intergalactic.InternalTypings.ComponentTag;\n };\n }\n export type Component<\n BaseTag extends InternalTypings.ComponentTag = never,\n BaseProps = {},\n Context = {},\n AdditionalContext extends any[] = never[],\n > = (<Tag extends InternalTypings.ComponentTag = BaseTag, Props extends BaseProps = BaseProps>(\n props: InternalTypings.ComponentProps<Tag, BaseTag, Props, Context, AdditionalContext>,\n ) => InternalTypings.ComponentRenderingResults) &\n InternalTypings.ComponentAdditive<BaseTag, Tag, BaseProps, Context, AdditionalContext>;\n export type Tag = InternalTypings.ComponentTag;\n export type DomProps<Tag extends keyof JSX.IntrinsicElements> =\n InternalTypings.InferJsxIntrinsicElement<JSX.IntrinsicElements[Tag]>;\n export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n > &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n}\n\nexport const wrapIntergalacticComponent = <\n Component extends Intergalactic.Component<any, any, any, any>,\n PropsExtending = {},\n>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<Component>\n > &\n PropsExtending,\n ) => React.ReactNode,\n): Intergalactic.Component<\n Component['__tag'],\n Component['__props'] & Component['__nestedProps'] & PropsExtending,\n Component['__context'],\n Component['__additionalContext']\n> => wrapper as any;\n\nexport type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> &\n RefAttributes<unknown>;\nexport type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<\n PropsAndRef<T, Ctx, UCProps>\n>;\ntype ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps]\n ? ComponentType<ParentProps, ChildProps, Context, UCProps>\n : ForwardRefComponent<T, Context, UCProps>;\n\nexport type ComponentType<\n ComponentProps,\n ChildComponentProps = {},\n ContextType = {},\n UCProps = {},\n FNType = null,\n> = (FNType extends null\n ? ForwardRefComponent<ComponentProps, ContextType, UCProps>\n : FNType & { displayName: string }) & {\n [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;\n} & {\n [CORE_COMPONENT]: boolean;\n [CREATE_COMPONENT]: () => ComponentType<\n ComponentProps,\n ChildComponentProps,\n ContextType,\n UCProps\n >;\n};\n"],"mappings":";;;;;;AAAA,SAGEA,aAAa,QAIR,OAAO;AAEd,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,eAAW;;AAE5D;;AAiFA,IAAMC,IAAU,GAAGC,SAAgB;AAEnC,SAASD,IAAI;;AAEb;AAAA,IACeE,aAAa,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EAAA,SAAAA,cAAA;IAAA,IAAAK,KAAA;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAC,eAAA,OAAAZ,aAAA;IAAAK,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAN,IAAA;IAAAO,eAAA,CAAAC,sBAAA,CAAAZ,KAAA,WAuBbN,SAAS;IAAAiB,eAAA,CAAAC,sBAAA,CAAAZ,KAAA,mBAEP,KAAK;IAAA,OAAAA,KAAA;EAAA;EAAAa,YAAA,CAAAlB,aAAA;IAAAmB,GAAA;IAAAC,GAAA,EAlBpB,SAAAA,IAAA,EAAiD;MAC/C,OAAO,CAAC,CAAC;IACX;EAAC;IAAAD,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAc;MACZ,OAAO,CAAC,CAAC;IASX;EAAC;EAAA,OAAApB,aAAA;AAAA,EAfOL,aAAa;AAsBvB,OAAO,IAAM0B,SAAS,GAAGrB,aAAa;AACtC;;AAgBA,WAAAsB,aAAA;AAyLC,WAAAC,cAAA;EAAA,IAAAC,eAAA;EAAA,WAAAC,gBAAA,MA7JkBD,eAAe,KAAfA,eAAe,GAAAD,cAAA,CAAfC,eAAe,KAAAD,cAAA,CAAfC,eAAe;AAAA,GA5BjBF,aAAa,KAAbA,aAAa;AA2L9B,OAAO,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAIrCC,OAKoB;EAAA,OAMjBA,OAAO;AAAA,CAAO"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=UnknownProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnknownProperties.js","names":[],"sources":["../../src/core-types/UnknownProperties.ts"],"sourcesContent":["export type UnknownProperties = {\n [key: string]: unknown;\n};\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=reshadow.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reshadow.d.js","names":[],"sources":["../../src/core-types/reshadow.d.ts"],"sourcesContent":["declare module 'hoist-non-react-statics' {\n const hoistNonReactStatics: any;\n export default hoistNonReactStatics;\n}\n"],"mappings":""}
@@ -22,4 +22,4 @@ var CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');
22
22
  exports.CHILDREN_COMPONENT = CHILDREN_COMPONENT;
23
23
  var INHERITED_NAME = Symbol('INHERITED_NAME');
24
24
  exports.INHERITED_NAME = INHERITED_NAME;
25
- //# sourceMappingURL=symbols.cjs.map
25
+ //# sourceMappingURL=symbols.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbols.js","names":["CORE_COMPONENT","Symbol","exports","CORE_INSTANCE","CORE_AS_PROPS","CORE_INIT","CONTEXT_COMPONENT","CREATE_COMPONENT","PARENT_COMPONENTS","CHILDREN_COMPONENT","INHERITED_NAME"],"sources":["../../src/core-types/symbols.ts"],"sourcesContent":["export const CORE_COMPONENT = Symbol('CORE_COMPONENT');\nexport const CORE_INSTANCE = Symbol('CORE_INSTANCE');\nexport const CORE_AS_PROPS = Symbol('CORE_AS_PROPS');\nexport const CORE_INIT = Symbol('CORE_INIT');\nexport const CONTEXT_COMPONENT = Symbol('CONTEXT_COMPONENT');\nexport const CREATE_COMPONENT = Symbol('CREATE_COMPONENT');\nexport const PARENT_COMPONENTS = Symbol('PARENT_COMPONENTS');\nexport const CHILDREN_COMPONENT = Symbol('CHILDREN_COMPONENT');\nexport const INHERITED_NAME = Symbol('INHERITED_NAME');\n"],"mappings":";;;;;;AAAO,IAAMA,cAAc,GAAGC,MAAM,CAAC,gBAAgB,CAAC;AAACC,OAAA,CAAAF,cAAA,GAAAA,cAAA;AAChD,IAAMG,aAAa,GAAGF,MAAM,CAAC,eAAe,CAAC;AAACC,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAC9C,IAAMC,aAAa,GAAGH,MAAM,CAAC,eAAe,CAAC;AAACC,OAAA,CAAAE,aAAA,GAAAA,aAAA;AAC9C,IAAMC,SAAS,GAAGJ,MAAM,CAAC,WAAW,CAAC;AAACC,OAAA,CAAAG,SAAA,GAAAA,SAAA;AACtC,IAAMC,iBAAiB,GAAGL,MAAM,CAAC,mBAAmB,CAAC;AAACC,OAAA,CAAAI,iBAAA,GAAAA,iBAAA;AACtD,IAAMC,gBAAgB,GAAGN,MAAM,CAAC,kBAAkB,CAAC;AAACC,OAAA,CAAAK,gBAAA,GAAAA,gBAAA;AACpD,IAAMC,iBAAiB,GAAGP,MAAM,CAAC,mBAAmB,CAAC;AAACC,OAAA,CAAAM,iBAAA,GAAAA,iBAAA;AACtD,IAAMC,kBAAkB,GAAGR,MAAM,CAAC,oBAAoB,CAAC;AAACC,OAAA,CAAAO,kBAAA,GAAAA,kBAAA;AACxD,IAAMC,cAAc,GAAGT,MAAM,CAAC,gBAAgB,CAAC;AAACC,OAAA,CAAAQ,cAAA,GAAAA,cAAA"}
@@ -349,4 +349,4 @@ function createBaseComponent(OriginComponent) {
349
349
  }
350
350
  return Component;
351
351
  }
352
- //# sourceMappingURL=coreFactory.cjs.map
352
+ //# sourceMappingURL=coreFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coreFactory.js","names":["_react","_interopRequireDefault","require","_hoistNonReactStatics","_ref4","_useEnhancedEffect","_assignProps2","_Component","_Children","_Root","_uncontrolledProps","_functionDefaultProps","_staticChildren","_interopRequireWildcard","_inheritedName","_hoistProps","_dataName","_enhance","_style","_bindHandler","_i18n","_symbols","_excluded","_excluded2","_excluded3","isEmptyObject","obj","Object","getOwnPropertyNames","length","getOwnPropertySymbols","getPrototypeOf","prototype","createGetField","enhancements","Component","isFunction","getField","key","filter","enhancement","condition","reduce","acc","item","push","createForwardWrapper","wrapperProps","statics","RootComponent","ROOT_COMPONENT","getterMethodName","getterMethodNameByDisplayName","displayName","getterMethod","undefined","useGetterIndex","WrapperForwardRefWithBind","_ref","ref","_ref$forwardRef","forwardRef","other","_objectWithoutProperties2","createElement","BindingWrapper","_extends2","useForkRef","WrapperForwardRef","_ref2","_ref2$forwardRef","__WRAPPER_PROPS_BIND__","_reduce","WrapperComponent","_reduce$ref","enhancementRef","props","_React$Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","_createClass2","value","render","_this2","map","fn","bind","React","hoistNonReactStatics","defaultProps","forEach","assign","wrapClass","OriginComponent","Context","inits","renders","contexts","_OriginComponent2","_super2","context","_this3","CORE_AS_PROPS","CORE_INSTANCE","CORE_INIT","get","_this4","Error","setContext","_this5","contextProps","_get2","_getPrototypeOf2","_this6","asProps","ctx","STATIC_COMPONENT","Provider","_objectSpread2","wrapFunction","memo","FunctionMemoComponent","selfRef","useRef","firstRender","useEnhancedEffect","current","wrapCore","_ref3","Root","createComposeComponent","PureComponent","isPrototypeOf","CORE_COMPONENT","assignProps","p1","p2","_assignProps","createComponent","childComponents","options","_options$context","createContext","_options$parent","parent","_options$enhancements","parents","isArray","wholeFamily","PARENT_COMPONENTS","_toConsumableArray2","f","i18nAppLocaleEnhance","bindHandlerEnhancement","childrenEnhancement","rootEnhancement","uncontrolledPropsEnhancement","staticChildrenEnhancement","functionDefaultPropsEnhancement","inheritedNameEnhancement","dataNameEnhancement","enhanceEnhancement","styleEnhancement","hoistPropsEnhancement","CONTEXT_COMPONENT","_______childrenComponents","CREATE_COMPONENT","_OriginComponent","_childComponents","_options","createBaseComponent"],"sources":["../src/coreFactory.tsx"],"sourcesContent":["import React, { ForwardRefExoticComponent, RefAttributes } from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { useForkRef } from './utils/ref';\nimport useEnhancedEffect from './utils/use/useEnhancedEffect';\nimport _assignProps from './utils/assignProps';\n\nimport { Component, PropsWithRenderFnChildren } from './core-types/Component';\n\nimport childrenEnhancement from './enhancement/Children';\nimport rootEnhancement from './enhancement/Root';\nimport uncontrolledPropsEnhancement from './enhancement/uncontrolledProps';\nimport functionDefaultPropsEnhancement from './enhancement/functionDefaultProps';\nimport staticChildrenEnhancement, {\n STATIC_COMPONENT,\n ROOT_COMPONENT,\n getterMethodNameByDisplayName,\n} from './enhancement/staticChildren';\nimport inheritedNameEnhancement from './enhancement/inheritedName';\nimport hoistPropsEnhancement from './enhancement/hoistProps';\nimport dataNameEnhancement from './enhancement/dataName';\nimport enhanceEnhancement from './enhancement/enhance';\nimport styleEnhancement from './enhancement/style';\nimport bindHandlerEnhancement from './enhancement/bindHandler';\nimport i18nAppLocaleEnhance from './enhancement/i18n';\nimport {\n CORE_AS_PROPS,\n CORE_INIT,\n PARENT_COMPONENTS,\n CORE_INSTANCE,\n CORE_COMPONENT,\n CREATE_COMPONENT,\n CONTEXT_COMPONENT,\n CHILDREN_COMPONENT,\n INHERITED_NAME,\n} from './core-types/symbols';\n\nfunction isEmptyObject(obj: any) {\n return (\n Object.getOwnPropertyNames(obj).length === 0 &&\n Object.getOwnPropertySymbols && // For IE 11\n Object.getOwnPropertySymbols(obj).length === 0 &&\n Object.getPrototypeOf(obj) === Object.prototype\n );\n}\n\nfunction createGetField(enhancements: any, Component: any, isFunction: boolean) {\n return function getField(key: string) {\n return enhancements\n .filter((enhancement: any) => {\n if (!enhancement.condition) {\n return true;\n }\n return enhancement.condition(Component, isFunction);\n })\n .reduce((acc: any, item: any) => {\n if (item[key]) {\n acc.push(item[key]);\n }\n return acc;\n }, []);\n };\n}\n\nfunction createForwardWrapper(Component: any, wrapperProps: any, statics: any, isFunction: any) {\n const RootComponent = Component[ROOT_COMPONENT];\n const getterMethodName = getterMethodNameByDisplayName(Component?.displayName);\n const getterMethod = RootComponent?.prototype\n ? RootComponent.prototype[getterMethodName]\n : undefined;\n const useGetterIndex = getterMethod?.length >= 2;\n\n function WrapperForwardRefWithBind({ forwardRef = null, ...other }, ref: any) {\n return <BindingWrapper {...other} forwardRef={useForkRef(ref, forwardRef)} />;\n }\n\n function WrapperForwardRef(\n { forwardRef = null, __WRAPPER_PROPS_BIND__, ...other }: any,\n ref: any,\n ) {\n const { ref: enhancementRef = null, ...props } = (\n __WRAPPER_PROPS_BIND__ || wrapperProps\n ).reduce((acc: any, enhancement: any) => enhancement(acc, WrapperComponent, isFunction), other);\n return <Component {...props} forwardRef={useForkRef(enhancementRef, ref, forwardRef)} />;\n }\n\n class BindingWrapper extends React.Component<any> {\n index = -1;\n render() {\n return (\n <WrapperForwardRef\n {...this.props}\n __WRAPPER_PROPS_BIND__={wrapperProps.map((fn: any) => fn.bind(this))}\n />\n );\n }\n }\n\n const WrapperComponent = React.forwardRef(\n useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef,\n );\n\n hoistNonReactStatics(WrapperComponent, Component);\n\n WrapperComponent.displayName = Component.displayName;\n // TODO: defaultProps is only empty\n WrapperComponent.defaultProps = Component.defaultProps;\n // STATIC\n statics.forEach((enhancement: any) =>\n Object.assign(WrapperComponent, enhancement(WrapperComponent, Component, isFunction)),\n );\n\n return WrapperComponent;\n}\n\nfunction wrapClass(OriginComponent: any, enhancements: any, Context: any) {\n const getField = createGetField(enhancements, OriginComponent, false);\n\n const inits = getField('init');\n const props = getField('asProps');\n const renders = getField('render');\n const statics = getField('static');\n const wrapperProps = getField('wrapperProps');\n const contexts = getField('context');\n\n class Component extends OriginComponent {\n [CORE_AS_PROPS] = null;\n [CORE_INSTANCE] = WrapperComponent;\n [CORE_INIT] = false;\n\n constructor(props: any, context: any) {\n super(props, context);\n // INITS\n inits.forEach((enhancement: any) => enhancement.call(this, props, WrapperComponent, false));\n this[CORE_INIT] = true;\n }\n\n get asProps() {\n // TODO if not production\n if (!this[CORE_INIT]) {\n throw new Error('Can not call asProps in constructor');\n }\n if (!this[CORE_AS_PROPS]) {\n // PROPS\n this[CORE_AS_PROPS] = props.reduce(\n (acc: any, enhancement: any) => enhancement.call(this, acc, WrapperComponent, false),\n this.props,\n );\n }\n return this[CORE_AS_PROPS];\n }\n\n setContext() {\n const contextProps = super.setContext ? super.setContext() : {};\n // CONTEXT\n return contexts.reduce(\n (acc: any, enhancement: any) => enhancement.call(this, acc, WrapperComponent, false),\n contextProps,\n );\n }\n\n render() {\n this[CORE_AS_PROPS] = null;\n // TODO if not production\n if (!super.render) {\n throw new Error('Component `render` method is not defined');\n }\n const asProps: any = this.asProps;\n const ctx = this.setContext();\n // RENDER\n const render = renders.reduce(\n (acc: any, enhancement: any) =>\n enhancement.call(this, acc, asProps, WrapperComponent, false),\n super.render(),\n );\n if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {\n return <Context.Provider value={{ ...asProps, ...ctx }}>{render}</Context.Provider>;\n } else {\n return render;\n }\n }\n }\n\n const WrapperComponent: any = createForwardWrapper(Component, wrapperProps, statics, false);\n return WrapperComponent;\n}\n\nfunction wrapFunction(OriginComponent: any, enhancements: any, Context: any) {\n const getField = createGetField(enhancements, OriginComponent, true);\n\n const inits = getField('init');\n const props = getField('asProps');\n const renders = getField('render');\n const statics = getField('static');\n const wrapperProps = getField('wrapperProps');\n const contexts = getField('context');\n\n const Component = React.memo(function FunctionMemoComponent(other) {\n const selfRef = React.useRef({});\n const firstRender = React.useRef(true);\n useEnhancedEffect(() => {\n firstRender.current = false;\n }, []);\n if (firstRender.current) {\n // INITS\n inits.forEach((enhancement: any) =>\n enhancement.call(selfRef.current, other, WrapperComponent, true),\n );\n }\n // PROPS\n const asProps = props.reduce(\n (acc: any, enhancement: any) =>\n enhancement.call(selfRef.current, acc, WrapperComponent, true),\n other,\n );\n // CONTEXT\n const ctx = contexts.reduce(\n (acc: any, enhancement: any) =>\n enhancement.call(selfRef.current, acc, WrapperComponent, true),\n {},\n );\n\n // RENDER\n const render = renders.reduce(\n (acc: any, enhancement: any) =>\n enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true),\n <OriginComponent {...asProps} />,\n );\n\n if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {\n return <Context.Provider value={{ ...asProps, ...ctx }}>{render}</Context.Provider>;\n } else {\n return render;\n }\n });\n Object.assign(Component, OriginComponent);\n const WrapperComponent: any = createForwardWrapper(Component, wrapperProps, statics, true);\n return WrapperComponent;\n}\n\nfunction wrapCore(OriginComponent: any, enhancements: any, Context: any) {\n const Component = function ({ Root }: any) {\n const defaultProps = OriginComponent.defaultProps || {};\n return <Root {...defaultProps} render={OriginComponent} />;\n };\n hoistNonReactStatics(Component, OriginComponent);\n Component.displayName = OriginComponent.displayName;\n return wrapFunction(Component, enhancements, Context);\n}\n\nfunction createComposeComponent(OriginComponent: any, Context: any, enhancements: any): any {\n if (\n React.PureComponent.isPrototypeOf(OriginComponent) ||\n React.Component.isPrototypeOf(OriginComponent)\n ) {\n if (OriginComponent.prototype instanceof Component) {\n return wrapClass(OriginComponent, enhancements, Context);\n } else {\n throw new Error('Must inherit from our component');\n }\n } else if (typeof OriginComponent === 'function') {\n return wrapFunction(OriginComponent, enhancements, Context);\n } else if (OriginComponent[CORE_COMPONENT]) {\n return wrapCore(OriginComponent, enhancements, Context);\n } else {\n throw new Error('Must be a React component');\n }\n}\n\nexport type PropsAndRef<T, Ctx, UCProps> = PropsWithRenderFnChildren<T, Ctx, UCProps> &\n RefAttributes<unknown>;\nexport type ForwardRefComponent<T, Ctx, UCProps> = ForwardRefExoticComponent<\n PropsAndRef<T, Ctx, UCProps>\n>;\ntype ComponentOrProps<T, Context, UCProps> = T extends [infer ParentProps, infer ChildProps]\n ? ComponentType<ParentProps, ChildProps, Context, UCProps>\n : ForwardRefComponent<T, Context, UCProps>;\n\nexport type ComponentType<\n ComponentProps,\n ChildComponentProps = {},\n ContextType = {},\n UCProps = {},\n FNType = null,\n> = (FNType extends null\n ? ForwardRefComponent<ComponentProps, ContextType, UCProps>\n : FNType & { displayName: string }) & {\n [K in keyof ChildComponentProps]: ComponentOrProps<ChildComponentProps[K], ContextType, UCProps>;\n} & {\n [CORE_COMPONENT]: boolean;\n [CREATE_COMPONENT]: () => ComponentType<\n ComponentProps,\n ChildComponentProps,\n ContextType,\n UCProps\n >;\n};\n\ninterface ClassWithUncontrolledProps<Props> {\n uncontrolledProps(): unknown;\n}\n\nexport function assignProps(p1: any, p2: any) {\n return _assignProps(p2, p1);\n}\n\nfunction createComponent<ComponentProps, ChildComponentProps = {}, ContextType = {}, FNType = null>(\n OriginComponent: any,\n childComponents: any = {},\n options: {\n context?: React.Context<ContextType>;\n parent?: ComponentType<unknown> | ComponentType<unknown>[];\n enhancements?: [any];\n } = {},\n): ComponentType<\n ComponentProps extends Component<infer Props> ? Props : ComponentProps,\n ChildComponentProps,\n ContextType,\n ComponentProps extends ClassWithUncontrolledProps<any>\n ? ReturnType<ComponentProps['uncontrolledProps']>\n : { [key: string]: (arg: unknown) => void },\n FNType\n> {\n const {\n context = React.createContext<ContextType>({} as ContextType),\n parent = [],\n enhancements = [],\n } = options;\n let parents = Array.isArray(parent) ? parent : [parent];\n if (parents.length) {\n const wholeFamily = parents.reduce((acc: any, parent: any) => {\n if (parent[PARENT_COMPONENTS]) {\n acc = [...parent[PARENT_COMPONENTS], ...acc];\n }\n return acc;\n }, parents);\n OriginComponent[PARENT_COMPONENTS] = wholeFamily;\n parents = wholeFamily;\n }\n if (OriginComponent[CORE_COMPONENT]) {\n parents.push(OriginComponent);\n }\n const Component = createComposeComponent(OriginComponent, context, [\n // @ts-ignore\n ...enhancements.map((f) => f(context, parents, createComponent, childComponents)),\n i18nAppLocaleEnhance(),\n bindHandlerEnhancement(),\n childrenEnhancement(context, parents),\n // root must be under the children\n rootEnhancement(),\n uncontrolledPropsEnhancement(),\n staticChildrenEnhancement(childComponents, createComponent, {\n context,\n parent,\n enhancements,\n }),\n // functionDefaultProps must be under the staticChild\n functionDefaultPropsEnhancement(),\n // inheritedName must be under the staticChild\n inheritedNameEnhancement(),\n // dataName must be under the staticChild\n dataNameEnhancement(),\n // enhanceEnhancement must be under the functionDefaultPropsEnhancement\n enhanceEnhancement(),\n styleEnhancement(childComponents, context),\n // must be the last one so any properties can be raised\n hoistPropsEnhancement(childComponents, context),\n ]);\n Component[CONTEXT_COMPONENT] = context;\n Component._______childrenComponents = childComponents;\n Component[CREATE_COMPONENT] = function (\n _OriginComponent = OriginComponent,\n _childComponents = childComponents,\n _options = options,\n ) {\n return createComponent(_OriginComponent, _childComponents, _options);\n };\n Component[CORE_COMPONENT] = true;\n return Component;\n}\n\nfunction createBaseComponent<ComponentProps>(OriginComponent: any): ComponentType<ComponentProps> {\n let Component = null;\n if (\n !React.PureComponent.isPrototypeOf(OriginComponent) &&\n !React.Component.isPrototypeOf(OriginComponent) &&\n typeof OriginComponent === 'function'\n ) {\n Component = React.forwardRef(OriginComponent);\n Component.displayName = OriginComponent.displayName;\n Component.defaultProps = {\n 'data-ui-name': OriginComponent.displayName,\n ...OriginComponent.defaultProps,\n };\n (Component as any)[CORE_COMPONENT] = true;\n } else {\n throw new Error('createBaseComponent accepts only functional component');\n }\n return Component as any;\n}\n\nexport { createComponent, createBaseComponent };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AAEA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,kBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,qBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,eAAA,GAAAC,uBAAA,CAAAX,OAAA;AAKA,IAAAY,cAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,WAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,SAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,QAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,MAAA,GAAAjB,sBAAA,CAAAC,OAAA;AACA,IAAAiB,YAAA,GAAAlB,sBAAA,CAAAC,OAAA;AACA,IAAAkB,KAAA,GAAAnB,sBAAA,CAAAC,OAAA;AACA,IAAAmB,QAAA,GAAAnB,OAAA;AAU8B,IAAAoB,SAAA;EAAAC,UAAA;EAAAC,UAAA;AAE9B,SAASC,aAAaA,CAACC,GA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GAAG,IAAI;EAChC,OAAO/G,SAAS;AAClB;AAEA,SAASoJ,mBAAmBA,CAAiB7E,eAAoB,EAAiC;EAChG,IAAIvE,SAAS,GAAG,IAAI;EACpB,IACE,CAACiE,iBAAK,CAAC4C,aAAa,CAACC,aAAa,CAACvC,eAAe,CAAC,IACnD,CAACN,iBAAK,CAACjE,SAAS,CAAC8G,aAAa,CAACvC,eAAe,CAAC,IAC/C,OAAOA,eAAe,KAAK,UAAU,EACrC;IACAvE,SAAS,gBAAGiE,iBAAK,CAACvC,UAAU,CAAC6C,eAAe,CAAC;IAC7CvE,SAAS,CAACkB,WAAW,GAAGqD,eAAe,CAACrD,WAAW;IACnDlB,SAAS,CAACmE,YAAY,OAAA6B,cAAA;MACpB,cAAc,EAAEzB,eAAe,CAACrD;IAAW,GACxCqD,eAAe,CAACJ,YAAY,CAChC;IACAnE,SAAS,CAAS+G,uBAAc,CAAC,GAAG,IAAI;EAC3C,CAAC,MAAM;IACL,MAAM,IAAI1B,KAAK,CAAC,uDAAuD,CAAC;EAC1E;EACA,OAAOrF,SAAS;AAClB"}
@@ -28,7 +28,7 @@ import Enhancement$8 from "./enhancement/enhance.mjs";
28
28
  import Enhancement$9 from "./enhancement/style.mjs";
29
29
  import Enhancement from "./enhancement/bindHandler.mjs";
30
30
  import i18nAppLocaleEnhance from "./enhancement/i18n.mjs";
31
- import { PARENT_COMPONENTS, CORE_COMPONENT, CONTEXT_COMPONENT, CREATE_COMPONENT, CORE_AS_PROPS, CORE_INSTANCE, CORE_INIT } from "./core-types/symbols.mjs";
31
+ import { CORE_AS_PROPS, CORE_INSTANCE, CORE_INIT, CORE_COMPONENT, PARENT_COMPONENTS, CONTEXT_COMPONENT, CREATE_COMPONENT } from "./core-types/symbols.mjs";
32
32
  var _excluded = ["forwardRef"], _excluded2 = ["forwardRef", "__WRAPPER_PROPS_BIND__"], _excluded3 = ["ref"];
33
33
  function isEmptyObject(obj) {
34
34
  return Object.getOwnPropertyNames(obj).length === 0 && Object.getOwnPropertySymbols && // For IE 11
@@ -116,4 +116,4 @@ function Enhancement(Context, parent) {
116
116
  }
117
117
  var _default = Enhancement;
118
118
  exports["default"] = _default;
119
- //# sourceMappingURL=Children.cjs.map
119
+ //# sourceMappingURL=Children.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Children.js","names":["_react","_interopRequireDefault","require","_symbols","_excluded","_excluded2","CHILDREN_SELF","Symbol","GETTER_REG","splitPropsAndGetters","props","Object","entries","reduce","acc","_ref","_ref2","_slicedToArray2","key","value","exec","getters","getterToArray","getter","Array","isArray","mergeObjects","a","arguments","length","undefined","b","core","_objectSpread2","keys","concat","_toConsumableArray2","assignGettersChain","createChildren","Context","contexts","Children","children","origin","_reduce","ctx","_ref3","React","useContext","handlers","propsAndGetters","_objectWithoutProperties2","_splitPropsAndGetters","assign","_reduce$handlers","_reduce$getters","mergedGetters","_ref4","_ref5","CHILDREN_COMPONENT","Enhancement","parent","init","map","component","CONTEXT_COMPONENT","filter","Boolean","asProps","_default","exports"],"sources":["../../src/enhancement/Children.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTEXT_COMPONENT, CHILDREN_COMPONENT } from '../core-types/symbols';\n\nconst CHILDREN_SELF = Symbol('CHILDREN_SELF');\n\nconst GETTER_REG = /^get[\\w]+Props$/;\n\nfunction splitPropsAndGetters(props: any) {\n return Object.entries(props).reduce(\n (acc: any, [key, value]) => {\n if (GETTER_REG.exec(key) === null) {\n acc.props[key] = value;\n } else {\n acc.getters[key] = value;\n }\n return acc;\n },\n { props: {}, getters: {} },\n );\n}\n\nfunction getterToArray(getter: any) {\n if (!Array.isArray(getter)) {\n return typeof getter === 'function' ? [getter] : [];\n }\n return getter;\n}\n\nfunction mergeObjects(a: any = {}, b: any = {}) {\n const core = { ...a, ...b };\n return Object.keys(core).reduce((acc: any, key) => {\n a[key] = getterToArray(a[key]);\n b[key] = getterToArray(b[key]);\n acc[key] = [...a[key], ...b[key]];\n return acc;\n }, {});\n}\n\nfunction assignGettersChain(getters: Array<Function>) {\n return function (props = {}) {\n return getters.reduce((acc, getter) => {\n return getter(acc);\n }, props);\n };\n}\n\nfunction createChildren(Context: any, contexts: any) {\n const Children: any = function () {\n const children = Children.origin;\n if (typeof children === 'function') {\n const {\n handlers = {},\n getters = {},\n ...props\n } = [...contexts, Context].reduce((acc, ctx) => {\n const { handlers, ...propsAndGetters } = React.useContext(ctx) as any;\n const { props, getters } = splitPropsAndGetters(propsAndGetters);\n return Object.assign({}, acc, {\n handlers: Object.assign({}, acc.handlers, handlers),\n getters: mergeObjects(acc.getters, getters),\n ...props,\n });\n }, Children.props);\n\n const mergedGetters = Object.entries(getters).reduce((acc: any, [key, value]) => {\n acc[key] = assignGettersChain(value as []);\n return acc;\n }, {});\n\n return children({ ...props, ...mergedGetters }, handlers);\n } else if (children === undefined) {\n return null;\n }\n return children;\n };\n Children.origin = null;\n Children.props = {};\n Children[CHILDREN_COMPONENT] = true;\n return Children;\n}\n\nfunction Enhancement(this: any, Context: any, parent: any) {\n return {\n init: function (this: any) {\n const contexts = (Array.isArray(parent) ? parent : [parent])\n .map((component) => component[CONTEXT_COMPONENT])\n .filter(Boolean);\n this[CHILDREN_SELF] = createChildren(Context, contexts);\n },\n asProps: function (this: any, props: any) {\n // TODO: learn the reason what it was used for (by lsroman)\n // this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;\n this[CHILDREN_SELF].origin = props.children;\n this[CHILDREN_SELF].props = props;\n return {\n ...props,\n Children: this[CHILDREN_SELF],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAA8E,IAAAE,SAAA;EAAAC,UAAA;AAE9E,IAAMC,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AAE7C,IAAMC,UAAU,GAAG,iBAAiB;AAEpC,SAASC,oBAAoBA,CAACC,KAAU,EAAE;EACxC,OAAO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CAAC,CAAC;EACnB+B,QAAQ,CAACkB,2BAAkB,CAAC,GAAG,IAAI;EACnC,OAAOlB,QAAQ;AACjB;AAEA,SAASmB,WAAWA,CAAYrB,OAAY,EAAEsB,MAAW,EAAE;EACzD,OAAO;IACLC,IAAI,EAAE,SAAAA,KAAA,EAAqB;MACzB,IAAMtB,QAAQ,GAAG,CAAChB,KAAK,CAACC,OAAO,CAACoC,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC,EACxDE,GAAG,CAAC,UAACC,SAAS;QAAA,OAAKA,SAAS,CAACC,0BAAiB,CAAC;MAAA,EAAC,CAChDC,MAAM,CAACC,OAAO,CAAC;MAClB,IAAI,CAAC7D,aAAa,CAAC,GAAGgC,cAAc,CAACC,OAAO,EAAEC,QAAQ,CAAC;IACzD,CAAC;IACD4B,OAAO,EAAE,SAAAA,QAAqB1D,KAAU,EAAE;MACxC;MACA;MACA,IAAI,CAACJ,aAAa,CAAC,CAACqC,MAAM,GAAGjC,KAAK,CAACgC,QAAQ;MAC3C,IAAI,CAACpC,aAAa,CAAC,CAACI,KAAK,GAAGA,KAAK;MACjC,WAAAuB,cAAA,iBAAAA,cAAA,iBACKvB,KAAK;QACR+B,QAAQ,EAAE,IAAI,CAACnC,aAAa;MAAC;IAEjC;EACF,CAAC;AACH;AAAC,IAAA+D,QAAA,GAEcT,WAAW;AAAAU,OAAA,cAAAD,QAAA"}
@@ -3,7 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  import React from "react";
6
- import { CONTEXT_COMPONENT, CHILDREN_COMPONENT } from "../core-types/symbols.mjs";
6
+ import { CHILDREN_COMPONENT, CONTEXT_COMPONENT } from "../core-types/symbols.mjs";
7
7
  var _excluded = ["handlers", "getters"], _excluded2 = ["handlers"];
8
8
  var CHILDREN_SELF = Symbol("CHILDREN_SELF");
9
9
  var GETTER_REG = /^get[\w]+Props$/;
@@ -75,4 +75,4 @@ function Enhancement() {
75
75
  }
76
76
  var _default = Enhancement;
77
77
  exports["default"] = _default;
78
- //# sourceMappingURL=Root.cjs.map
78
+ //# sourceMappingURL=Root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Root.js","names":["_react","_interopRequireDefault","require","_assignProps","_ref4","_excluded","_excluded2","createRootRender","Root","React","forwardRef","_ref","ref","Tag","render","source","_objectWithoutProperties2","_Root$props","props","_Root","styles","children","Children","_Root$props$forwardRe","clearProps","Object","entries","reduce","_ref2","_ref3","_slicedToArray2","name","value","undefined","child","origin","createElement","other","assignProps","_objectSpread2","useForkRef","Error","Fragment","Enhancement","init","asProps","WrapperComponent","isFunction","_default","exports"],"sources":["../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../utils/assignProps';\nimport { useForkRef } from '../utils/ref';\n\nfunction createRootRender() {\n // @ts-ignore\n const Root = React.forwardRef(function ({ render: Tag, ...source }, ref) {\n const {\n Root: _Root,\n\n styles,\n\n children,\n Children,\n forwardRef = null,\n ...props\n // @ts-ignore\n } = Root.props;\n\n const clearProps = Object.entries(props).reduce((props: any, [name, value]) => {\n if (value !== undefined) {\n props[name] = value;\n }\n return props;\n }, {});\n\n const child = {};\n // TODO: need to find better check solution (by lsroman)\n if (typeof Children.origin !== 'undefined') {\n // @ts-ignore\n child.children = <Children />;\n }\n\n const other = assignProps(\n {\n ...clearProps,\n ref: useForkRef(forwardRef, ref),\n },\n {\n ...child,\n ...source,\n },\n );\n if (!Tag) {\n throw new Error('`render` prop of Root is not provided');\n }\n if (Tag === React.Fragment) return <React.Fragment>{other.children}</React.Fragment>;\n\n return <Tag {...other} />;\n });\n // @ts-ignore\n Root.props = {};\n return Root;\n}\n\nfunction Enhancement() {\n return {\n init: function (this: any) {\n this.Root = createRootRender();\n },\n asProps: function (this: any, props: any, WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n return {\n ...props,\n Root: this.Root,\n };\n }\n return props;\n },\n render: function (this: any, render: any, props: any) {\n this.Root.props = props;\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAA0C,IAAAG,SAAA;EAAAC,UAAA;AAE1C,SAASC,gBAAgBA,CAAA,EAAG;EAC1B;EACA,IAAMC,IAAI,gBAAGC,iBAAK,CAACC,UAAU,CAAC,UAAAC,IAAA,EAAsCC,GAAG,EAAE;IAAA,IAAvBC,GAAG,GAAAF,IAAA,CAAXG,MAAM;MAAUC,MAAM,OAAAC,yBAAA,aAAAL,IAAA,EAAAN,SAAA;IAC9D,IAAAY,WAAA,GAUIT,IAAI,CAACU,KAAK;MATNC,KAAK,GAAAF,WAAA,CAAXT,IAAI;MAEJY,MAAM,GAAAH,WAAA,CAANG,MAAM;MAENC,QAAQ,GAAAJ,WAAA,CAARI,QAAQ;MACRC,QAAQ,GAAAL,WAAA,CAARK,QAAQ;MAAAC,qBAAA,GAAAN,WAAA,CACRP,UAAU;MAAVA,UAAU,GAAAa,qBAAA,cAAG,IAAI,GAAAA,qBAAA;MACdL,KAAK,OAAAF,yBAAA,aAAAC,WAAA,EAAAX,UAAA;IAIV,IAAMkB,UAAU,GAAGC,MAAM,CAACC,OAAO,CAACR,KAAK,CAAC,CAACS,MAAM,CAAC,UAACT,KAAU,EAAAU,KAAA,EAAoB;MAAA,IAAAC,KAAA,OAAAC,eAAA,aAAAF,KAAA;QAAjBG,IAAI,GAAAF,KAAA;QAAEG,KAAK,GAAAH,KAAA;MACvE,IAAIG,KAAK,KAAKC,SAAS,EAAE;QACvBf,KAAK,CAACa,IAAI,CAAC,GAAGC,KAAK;MACrB;MACA,OAAOd,KAAK;IACd,CAAC,EAAE,CAAC,CAAC,CA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;MACpD,IAAI,CAACV,IAAI,CAACU,KAAK,GAAGA,KAAK;MACvB,OAAOJ,OAAM;IACf;EACF,CAAC;AACH;AAAC,IAAAkC,QAAA,GAEcL,WAAW;AAAAM,OAAA,cAAAD,QAAA"}
@@ -8,11 +8,7 @@ var _excluded = ["render"], _excluded2 = ["Root", "styles", "children", "Childre
8
8
  function createRootRender() {
9
9
  var Root = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
10
10
  var Tag = _ref.render, source = _objectWithoutProperties(_ref, _excluded);
11
- var _Root$props = Root.props;
12
- _Root$props.Root;
13
- _Root$props.styles;
14
- _Root$props.children;
15
- var Children = _Root$props.Children, _Root$props$forwardRe = _Root$props.forwardRef, forwardRef = _Root$props$forwardRe === void 0 ? null : _Root$props$forwardRe, props = _objectWithoutProperties(_Root$props, _excluded2);
11
+ var _Root$props = Root.props, _Root = _Root$props.Root, styles = _Root$props.styles, children = _Root$props.children, Children = _Root$props.Children, _Root$props$forwardRe = _Root$props.forwardRef, forwardRef = _Root$props$forwardRe === void 0 ? null : _Root$props$forwardRe, props = _objectWithoutProperties(_Root$props, _excluded2);
16
12
  var clearProps = Object.entries(props).reduce(function(props2, _ref2) {
17
13
  var _ref3 = _slicedToArray(_ref2, 2), name = _ref3[0], value = _ref3[1];
18
14
  if (value !== void 0) {
@@ -51,4 +51,4 @@ function Enhancement() {
51
51
  }
52
52
  var _default = Enhancement;
53
53
  exports["default"] = _default;
54
- //# sourceMappingURL=bindHandler.cjs.map
54
+ //# sourceMappingURL=bindHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindHandler.js","names":["arraysEqual","a","b","length","i","handlerBinder","fn","_len","arguments","depsArgs","Array","_key","memoizeds","hasher","has","get","memoized","find","deps","bindFn","apply","bind","push","set","WeakMap","Enhancement","condition","Component","isFunction","init","_this","Object","keys","filter","field","startsWith","forEach","name","_default","exports"],"sources":["../../src/enhancement/bindHandler.tsx"],"sourcesContent":["function arraysEqual(a: any, b: any) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\nfunction handlerBinder(fn: any) {\n return function (...depsArgs: any[]) {\n let memoizeds = [];\n if (handlerBinder.hasher.has(fn)) {\n memoizeds = handlerBinder.hasher.get(fn);\n const memoized = memoizeds.find((memoized: any) => arraysEqual(memoized.deps, depsArgs));\n if (memoized) return memoized.fn;\n }\n\n const bindFn = fn(...depsArgs).bind(fn);\n memoizeds.push({\n deps: depsArgs,\n fn: bindFn,\n });\n handlerBinder.hasher.set(fn, memoizeds);\n return bindFn;\n };\n}\n\nhandlerBinder.hasher = new WeakMap();\n\nfunction Enhancement() {\n return {\n condition: function (Component: any, isFunction: boolean) {\n return !isFunction;\n },\n init: function (this: any) {\n Object.keys(this)\n .filter((field) => field.startsWith('bindHandler'))\n .forEach((name) => {\n this[name] = handlerBinder(this[name].bind(this));\n });\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAACC,CAAM,EAAEC,CAAM,EAAE;EACnC,IAAID,CAAC,CAACE,MAAM,KAAKD,CAAC,CAACC,MAAM,EAAE,OAAO,KAAK;EACvC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,CAAC,CAACE,MAAM,EAAEC,CAAC,EAAE,EAAE;IACjC,IAAIH,CAAC,CAACG,CAAC,CAAC,KAAKF,CAAC,CAACE,CAAC,CAAC,EAAE,OAAO,KAAK;EACjC;EACA,OAAO,IAAI;AACb;AAEA,SAASC,aAAaA,CAACC,EAAO,EAAE;EAC9B,OAAO,YAA8B;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAL,MAAA,EAAjBM,QAAQ,OAAAC,KAAA,CAAAH,IAAA,GAAAI,IAAA,MAAAA,IAAA,GAAAJ,IAAA,EAAAI,IAAA;MAARF,QAAQ,CAAAE,IAAA,IAAAH,SAAA,CAAAG,IAAA;IAAA;IAC1B,IAAIC,SAAS,G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,QAAA,GAEcb,WAAW;AAAAc,OAAA,cAAAD,QAAA"}
@@ -17,4 +17,4 @@ function Enhancement() {
17
17
  }
18
18
  var _default = Enhancement;
19
19
  exports["default"] = _default;
20
- //# sourceMappingURL=dataName.cjs.map
20
+ //# sourceMappingURL=dataName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataName.js","names":["Enhancement","wrapperProps","props","WrapperComponent","_objectSpread2","displayName","_default","exports"],"sources":["../../src/enhancement/dataName.tsx"],"sourcesContent":["function Enhancement() {\n return {\n wrapperProps: function (props: any, WrapperComponent: any) {\n return {\n 'data-ui-name': WrapperComponent.displayName,\n ...props,\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,YAAY,EAAE,SAAAA,aAAUC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,WAAAC,cAAA;QACE,cAAc,EAAED,gBAAgB,CAACE;MAAW,GACzCH,KAAK;IAEZ;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAEcN,WAAW;AAAAO,OAAA,cAAAD,QAAA"}
@@ -19,4 +19,4 @@ function Enhancement() {
19
19
  }
20
20
  var _default = Enhancement;
21
21
  exports["default"] = _default;
22
- //# sourceMappingURL=enhance.cjs.map
22
+ //# sourceMappingURL=enhance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enhance.js","names":["Enhancement","condition","Component","_Component$enhance","Boolean","enhance","length","wrapperProps","props","WrapperComponent","reduce","acc","_default","exports"],"sources":["../../src/enhancement/enhance.tsx"],"sourcesContent":["function Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.enhance?.length);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n return WrapperComponent.enhance.reduce((acc: any, enhance: any) => enhance(acc), props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MAAA,IAAAC,kBAAA;MACnC,OAAOC,OAAO,EAAAD,kBAAA,GAACD,SAAS,CAACG,OAAO,cAAAF,kBAAA,uBAAjBA,kBAAA,CAAmBG,MAAM,CAAC;IAC3C,CAAC;IACDC,YAAY,EAAE,SAAAA,aAAUC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAOA,gBAAgB,CAACJ,OAAO,CAACK,MAAM,CAAC,UAACC,GAAQ,EAAEN,OAAY;QAAA,OAAKA,OAAO,CAACM,GAAG,CAAC;MAAA,GAAEH,KAAK,CAAC;IACzF;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAEcZ,WAAW;AAAAa,OAAA,cAAAD,QAAA"}
@@ -33,4 +33,4 @@ function Enhancement() {
33
33
  }
34
34
  var _default = Enhancement;
35
35
  exports["default"] = _default;
36
- //# sourceMappingURL=functionDefaultProps.cjs.map
36
+ //# sourceMappingURL=functionDefaultProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functionDefaultProps.js","names":["Enhancement","defaultProps","condition","Component","Boolean","Object","keys","length","_static","WrapperComponent","wrapperProps","props","assign","_default","exports"],"sources":["../../src/enhancement/functionDefaultProps.tsx"],"sourcesContent":["function Enhancement() {\n let defaultProps = {};\n return {\n condition: function (Component: any) {\n if (!Component.defaultProps) {\n return false;\n }\n if (typeof Component.defaultProps === 'function') {\n return true;\n }\n return Boolean(Object.keys(Component.defaultProps).length);\n },\n static: function (WrapperComponent: any) {\n defaultProps = WrapperComponent.defaultProps;\n return {\n defaultProps: {},\n };\n },\n wrapperProps: function (props: any) {\n if (typeof defaultProps === 'function') {\n // TODO: optimization\n return Object.assign({}, defaultProps(props), props);\n }\n return Object.assign({}, defaultProps, props);\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;AAAA,SAASA,WAAWA,CAAA,EAAG;EACrB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MACnC,IAAI,CAACA,SAAS,CAACF,YAAY,EAAE;QAC3B,OAAO,KAAK;MACd;MACA,IAAI,OAAOE,SAAS,CAACF,YAAY,KAAK,UAAU,EAAE;QAChD,OAAO,IAAI;MACb;MACA,OAAOG,OAAO,CAACC,MAAM,CAACC,IAAI,CAACH,SAAS,CAACF,YAAY,CAAC,CAACM,MAAM,CAAC;IAC5D,CAAC;IACD,UAAQ,SAAAC,QAAUC,gBAAqB,EAAE;MACvCR,YAAY,GAAGQ,gBAAgB,CAACR,YAAY;MAC5C,OAAO;QACLA,YAAY,EAAE,CAAC;MACjB,CAAC;IACH,CAAC;IACDS,YAAY,EAAE,SAAAA,aAAUC,KAAU,EAAE;MAClC,IAAI,OAAOV,YAAY,KAAK,UAAU,EAAE;QACtC;QACA,OAAOI,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,CAACU,KAAK,CAAC,EAAEA,KAAK,CAAC;MACtD;MACA,OAAON,MAAM,CAACO,MAAM,CAAC,CAAC,CAAC,EAAEX,YAAY,EAAEU,KAAK,CAAC;IAC/C;EACF,CAAC;AACH;AAAC,IAAAE,QAAA,GAEcb,WAAW;AAAAc,OAAA,cAAAD,QAAA"}
@@ -94,4 +94,4 @@ function Enhancement(childComponents, Context) {
94
94
  }
95
95
  var _default = Enhancement;
96
96
  exports["default"] = _default;
97
- //# sourceMappingURL=hoistProps.cjs.map
97
+ //# sourceMappingURL=hoistProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hoistProps.js","names":["_react","_interopRequireDefault","require","_assignProps","_useEnhancedEffect","_pick","HOIST_CONTEXT","Symbol","exports","HOIST_SELF","HOIST_SET","flatChildComponent","childComponents","Object","values","reduce","acc","Component","Array","isArray","push","apply","_toConsumableArray2","Enhancement","Context","condition","concat","some","_Component$hoistProps","Boolean","hoistProps","length","init","props","WrapperComponent","isFunction","_this","React","useState","obj","forceUpdate","context","_objectSpread3","_defineProperty2","asProps","assignProps","wrapperProps","_WrapperComponent$hoi","useContext","renameProps","propName","_propName$split","split","_propName$split2","_slicedToArray2","name","rename","entries","pick","keys","_ref","_ref2","value","useEnhancedEffect","_default"],"sources":["../../src/enhancement/hoistProps.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../utils/assignProps';\nimport useEnhancedEffect from '../utils/use/useEnhancedEffect';\nimport pick from '../utils/pick';\n\nexport const HOIST_CONTEXT = Symbol('HOIST_CONTEXT');\nconst HOIST_SELF = Symbol('HOIST_SELF');\nconst HOIST_SET = Symbol('HOIST_SET');\n\nfunction flatChildComponent(childComponents: any) {\n return Object.values(childComponents).reduce<unknown[]>((acc, Component) => {\n if (Array.isArray(Component)) {\n acc.push(Component[0]);\n acc.push(...flatChildComponent(Component[1]));\n } else {\n acc.push(Component);\n }\n return acc;\n }, []);\n}\n\n/** @deprecated Doesn't work in ssr and sometimes breakes rulles of hooks. We should never use it. */\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return [Component, ...flatChildComponent(childComponents)].some((Component) =>\n Boolean(Component.hoistProps?.length),\n );\n },\n init: function (this: any, props: any, WrapperComponent: any, isFunction: boolean) {\n if (isFunction) {\n // TODO: might breake rules of hooks (by lsroman)\n this[HOIST_SELF] = React.useState({});\n } else {\n this[HOIST_SELF] = [\n {},\n (obj: any) => {\n this[HOIST_SELF][0] = obj;\n this.forceUpdate();\n },\n ];\n }\n // For optimization render\n this[HOIST_SET] = (obj: any) => {\n this[HOIST_SELF][1](obj);\n };\n },\n context: function (this: any, context: any) {\n // TODO: need to optimizte container initialization (by lsroman)\n // WrapperComponent.hoistProps\n return {\n ...context,\n [HOIST_CONTEXT]: this[HOIST_SET],\n };\n },\n asProps: function (this: any, props: any) {\n // TODO: need to check for no props overwriting (by lsroman)\n return assignProps(this[HOIST_SELF][0], props);\n },\n wrapperProps: function (props: any, WrapperComponent: any) {\n if (WrapperComponent.hoistProps?.length) {\n const context: any = React.useContext(Context);\n const renameProps: any = WrapperComponent.hoistProps.reduce((acc: any, propName: any) => {\n const [name, rename] = propName.split(':');\n acc[name] = rename || name;\n return acc;\n }, {});\n const hoistProps = Object.entries(pick(props, Object.keys(renameProps))).reduce(\n (acc: any, [name, value]) => {\n acc[renameProps[name]] = value;\n return acc;\n },\n {},\n );\n\n useEnhancedEffect(() => {\n if (context[HOIST_CONTEXT]) {\n context[HOIST_CONTEXT](hoistProps);\n }\n }, Object.values(hoistProps));\n }\n return props;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEO,IAAMI,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AAACC,OAAA,CAAAF,aAAA,GAAAA,aAAA;AACrD,IAAMG,UAAU,GAAGF,MAAM,CAAC,YAAY,CAAC;AACvC,IAAMG,SAAS,GAAGH,MAAM,CAAC,WAAW,CAAC;AAErC,SAASI,kBAAkBA,CAACC,eAAoB,EAAE;EAChD,OAAOC,MAAM,CAACC,MAAM,CAACF,eAAe,CAAC,CAACG,MAAM,CAAY,UAACC,GAAG,EAAEC,SAAS,EAAK;IAC1E,IAAIC,KAAK,CAACC,OAAO,CAACF,SAAS,CAAC,EAAE;MAC5BD,GAAG,CAACI,IAAI,CAACH,SAAS,CAAC,CAAC,CAAC,CAAC;MACtBD,GAAG,CAACI,IAAI,CAAAC,KAAA,CAARL,GAAG,MAAAM,mBAAA,aAASX,kBAAkB,CAACM,SAAS,CAAC,CAAC,CAAC,CAAC,EAAC;IAC/C,CAAC,MAAM;MACLD,GAAG,CAACI,IAAI,CAACH,SAAS,CAAC;IACrB;IACA,OAAOD,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;AACR;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C,CAACwB,UAAU,CAAC;UACpC;QACF,CAAC,EAAEjB,MAAM,CAACC,MAAM,CAACgB,UAAU,CAAC,CAAC;MAC/B;MACA,OAAOG,KAAK;IACd;EACF,CAAC;AACH;AAAC,IAAA+B,QAAA,GAEczC,WAAW;AAAAf,OAAA,cAAAwD,QAAA"}
@@ -25,4 +25,4 @@ function i18nAppLocaleEnhance() {
25
25
  }
26
26
  var _default = i18nAppLocaleEnhance;
27
27
  exports["default"] = _default;
28
- //# sourceMappingURL=i18n.cjs.map
28
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","names":["_react","_interopRequireDefault","require","_WithI18n","_excluded","i18nAppLocaleEnhance","wrapperProps","props","locale","other","_objectWithoutProperties2","contextLocale","React","useContext","Context","_objectSpread2","_default","exports"],"sources":["../../src/enhancement/i18n.tsx"],"sourcesContent":["import React from 'react';\nimport { Context } from '../utils/enhances/WithI18n';\n\nfunction i18nAppLocaleEnhance() {\n return {\n wrapperProps: (props: any) => {\n const { locale, ...other } = props;\n const contextLocale = React.useContext(Context);\n if (!locale && !contextLocale) return props;\n return {\n ...other,\n locale: locale ?? contextLocale,\n };\n },\n };\n}\n\nexport default i18nAppLocaleEnhance;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAAqD,IAAAE,SAAA;AAErD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,OAAO;IACLC,YAAY,EAAE,SAAAA,aAACC,KAAU,EAAK;MAC5B,IAAQC,MAAM,GAAeD,KAAK,CAA1BC,MAAM;QAAKC,KAAK,OAAAC,yBAAA,aAAKH,KAAK,EAAAH,SAAA;MAClC,IAAMO,aAAa,GAAGC,iBAAK,CAACC,UAAU,CAACC,iBAAO,CAAC;MAC/C,IAAI,CAACN,MAAM,IAAI,CAACG,aAAa,EAAE,OAAOJ,KAAK;MAC3C,WAAAQ,cAAA,iBAAAA,cAAA,iBACKN,KAAK;QACRD,MAAM,EAAEA,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIG;MAAa;IAEnC;EACF,CAAC;AACH;AAAC,IAAAK,QAAA,GAEcX,oBAAoB;AAAAY,OAAA,cAAAD,QAAA"}
@@ -20,4 +20,4 @@ function Enhancement() {
20
20
  }
21
21
  var _default = Enhancement;
22
22
  exports["default"] = _default;
23
- //# sourceMappingURL=inheritedName.cjs.map
23
+ //# sourceMappingURL=inheritedName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inheritedName.js","names":["_symbols","require","Enhancement","condition","Component","Boolean","displayName","_static","WrapperComponent","_defineProperty2","INHERITED_NAME","_toConsumableArray2","Set","concat","_default","exports"],"sources":["../../src/enhancement/inheritedName.tsx"],"sourcesContent":["import { INHERITED_NAME } from '../core-types/symbols';\n\nfunction Enhancement() {\n return {\n condition: function (Component: any) {\n return Boolean(Component.displayName);\n },\n static: function (WrapperComponent: any) {\n return {\n [INHERITED_NAME]: [\n ...new Set([...(WrapperComponent[INHERITED_NAME] || []), WrapperComponent.displayName]),\n ],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,SAASC,WAAWA,CAAA,EAAG;EACrB,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,WAAW,CAAC;IACvC,CAAC;IACD,UAAQ,SAAAC,QAAUC,gBAAqB,EAAE;MACvC,WAAAC,gBAAA,iBACGC,uBAAc,MAAAC,mBAAA,aACV,IAAIC,GAAG,IAAAC,MAAA,KAAAF,mBAAA,aAAMH,gBAAgB,CAACE,uBAAc,CAAC,IAAI,EAAE,IAAGF,gBAAgB,CAACF,WAAW,GAAE;IAG7F;EACF,CAAC;AACH;AAAC,IAAAQ,QAAA,GAEcZ,WAAW;AAAAa,OAAA,cAAAD,QAAA"}
@@ -132,4 +132,4 @@ function Enhancement(childComponents, createComponent, options) {
132
132
  }
133
133
  var _default = Enhancement;
134
134
  exports["default"] = _default;
135
- //# sourceMappingURL=staticChildren.cjs.map
135
+ //# sourceMappingURL=staticChildren.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staticChildren.js","names":["_react","_interopRequireDefault","require","_assignProps","_pick","_logger","assign","target","source","Object","defineProperties","keys","reduce","descriptors","key","getOwnPropertyDescriptor","getterMethodName","name","concat","getterMethodNameByDisplayName","displayName","arguments","length","undefined","displayNames","split","slice","join","flatGetterMethodNames","childComponents","parentName","entries","acc","_ref","_ref2","_slicedToArray2","value","Array","isArray","push","apply","_toConsumableArray2","STATIC_COMPONENT","Symbol","exports","ROOT_COMPONENT","SELF_GETTER_METHOD","Enhancement","createComponent","options","getterMethodNames","condition","Component","Boolean","init","props","WrapperComponent","_this","getterMethods","pick","selfGetterMethod","logger","warn","getterMethod","childrenProps","getterProps","call","index","assignProps","cache","Set","_static","Error","_ref3","_ref4","prevStaticComponent","prevDisplayName","context","_objectSpread2","wrapperProps","React","useContext","has","add","render","_this2","forEach","clear","_default"],"sources":["../../src/enhancement/staticChildren.tsx"],"sourcesContent":["import React from 'react';\nimport assignProps from '../utils/assignProps';\nimport pick from '../utils/pick';\nimport logger from '../utils/logger';\n\nfunction assign(target: any, source: any) {\n return Object.defineProperties(\n target,\n Object.keys(source).reduce((descriptors: any, key) => {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}),\n );\n}\n\nexport function getterMethodName(name: string) {\n return `get${name}Props`;\n}\n\nexport function getterMethodNameByDisplayName(displayName = '') {\n const displayNames = displayName.split('.');\n const name = displayNames.slice(-(displayNames.length - 1)).join('');\n return getterMethodName(name);\n}\n\nfunction flatGetterMethodNames(childComponents: any, parentName?: string) {\n return Object.entries(childComponents).reduce<string[]>((acc, [name, value]) => {\n if (Array.isArray(value)) {\n acc.push(...flatGetterMethodNames(value[1], name));\n }\n name = parentName ? `${parentName}${name}` : name;\n acc.push(getterMethodName(name));\n return acc;\n }, []);\n}\n\nexport const STATIC_COMPONENT = Symbol('STATIC_COMPONENT');\nexport const ROOT_COMPONENT = Symbol('ROOT_COMPONENT');\nconst SELF_GETTER_METHOD = Symbol('SELF_GETTER_METHOD');\n\nfunction Enhancement(childComponents: any, createComponent: any, options: any) {\n const getterMethodNames = flatGetterMethodNames(childComponents);\n return {\n condition: function (Component: any) {\n return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n const getterMethods: any = pick(this, getterMethodNames);\n this[SELF_GETTER_METHOD] = () => {\n const selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);\n logger.warn(\n true,\n `Getter \\`${selfGetterMethod}\\` can't be fired as it is a getter of static component`,\n props['data-ui-name'] || WrapperComponent.displayName,\n );\n };\n assign(\n this,\n getterMethodNames.reduce((acc: any, name) => {\n const getterMethod = getterMethods[name];\n if (!getterMethod) return acc;\n acc[name] = (childrenProps = {}) => {\n const getterProps = getterMethod.call(this, childrenProps, acc[name].index);\n return assignProps(childrenProps, getterProps);\n };\n acc[name].index = -1;\n acc[name].cache = new Set();\n return acc;\n }, {}),\n );\n },\n static: function (WrapperComponent: any, Component: any) {\n if (Object.keys(childComponents).length && !WrapperComponent.displayName) {\n throw new Error('\"displayName\" is not defined');\n }\n return Object.entries(childComponents).reduce((acc: any, [name, value]: any) => {\n let childComponents = {};\n\n if (Array.isArray(value)) {\n childComponents = value[1];\n value = value[0];\n }\n\n const prevStaticComponent = value[STATIC_COMPONENT];\n // @ts-ignore\n const prevDisplayName = value.displayName;\n // @ts-ignore\n value.displayName = `${WrapperComponent.displayName}.${name}`;\n value[STATIC_COMPONENT] = true;\n value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;\n acc[name] = createComponent(value, childComponents, options);\n // @ts-ignore\n value.displayName = prevDisplayName;\n value[STATIC_COMPONENT] = prevStaticComponent;\n return acc;\n }, {});\n },\n context: function (context: any /*, WrapperComponent*/) {\n // const getterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);\n return {\n ...context,\n // [getterMethod]: this[SELF_GETTER_METHOD],\n ...pick(this, getterMethodNames as any),\n };\n },\n wrapperProps: function (this: any, props: any, WrapperComponent: any) {\n if (!WrapperComponent[STATIC_COMPONENT]) return props;\n const context: any = React.useContext(options.context);\n const getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];\n if (getterMethod) {\n if (!getterMethod.cache.has(this)) {\n getterMethod.cache.add(this);\n getterMethod.index++;\n if (this) this.index = getterMethod.index;\n }\n if (this) getterMethod.index = this.index;\n return getterMethod(props);\n }\n return props;\n },\n render: function (this: any, render: any) {\n getterMethodNames.forEach((name) => {\n if (this[name] === undefined) return;\n this[name].index = -1;\n this[name].cache.clear();\n });\n return render;\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,SAASI,MAAMA,CAACC,MAAW,EAAEC,MAAW,EAAE;EACxC,OAAOC,MAAM,CAACC,gBAAgB,CAC5BH,MAAM,EACNE,MAAM,CAACE,IAAI,CAACH,MAAM,CAAC,CAACI,MAAM,CAAC,UAACC,WAAgB,EAAEC,GAAG,EAAK;IACpDD,WAAW,CAACC,GAAG,CAAC,GAAGL,MAAM,CAACM,wBAAwB,CAACP,MAAM,EAAEM,GAAG,CAAC;IAC/D,OAAOD,WAAW;EACpB,CAAC,EAAE,CAAC,CAAC,CAAC,CACP;AACH;AAEO,SAASG,gBAAgBA,CAACC,IAAY,EAAE;EAC7C,aAAAC,MAAA,CAAaD,IAAI;AACnB;AAEO,SAASE,6BAA6BA,CAAA,EAAmB;EA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CAACoC,OAAO,CAAC,UAACrE,IAAI,EAAK;QAClC,IAAIoE,MAAI,CAACpE,IAAI,CAAC,KAAKM,SAAS,EAAE;QAC9B8D,MAAI,CAACpE,IAAI,CAAC,CAACkD,KAAK,GAAG,CAAC,CAAC;QACrBkB,MAAI,CAACpE,IAAI,CAAC,CAACoD,KAAK,CAACkB,KAAK,EAAE;MAC1B,CAAC,CAAC;MACF,OAAOH,OAAM;IACf;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAEczC,WAAW;AAAAH,OAAA,cAAA4C,QAAA"}
@@ -57,4 +57,4 @@ function Enhancement(childComponents, Context) {
57
57
  }
58
58
  var _default = Enhancement;
59
59
  exports["default"] = _default;
60
- //# sourceMappingURL=style.cjs.map
60
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","names":["_react","_interopRequireDefault","require","_index","_staticChildren","_excluded","_excluded2","STYLES_CONTEXT","Symbol","exports","STYLES_SELF","Enhancement","childComponents","Context","condition","Component","Boolean","style","STATIC_COMPONENT","init","props","WrapperComponent","styles","sstyled","merge","_styles","context","Object","keys","length","_objectSpread3","_defineProperty2","asProps","_ref","_objectWithoutProperties2","wrapperProps","_ref2","React","useContext","_default"],"sources":["../../src/enhancement/style.tsx"],"sourcesContent":["import React from 'react';\nimport { sstyled } from '../styled/index';\nimport { STATIC_COMPONENT } from './staticChildren';\n\nexport const STYLES_CONTEXT = Symbol('STYLES_CONTEXT');\nconst STYLES_SELF = Symbol('STYLES_SELF');\n\nfunction Enhancement(childComponents: any, Context: any) {\n return {\n condition: function (Component: any) {\n return Boolean(Component.style || Component[STATIC_COMPONENT]);\n },\n init: function (this: any, props: any, WrapperComponent: any) {\n if (props.styles) {\n this[STYLES_SELF] = props.styles;\n }\n if (WrapperComponent.style) {\n this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);\n }\n },\n context: function (this: any, context: any): any {\n // Optimization: if has no children there is no need to create new context (by lsroman)\n if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {\n return context;\n }\n return {\n ...context,\n [STYLES_CONTEXT]: this[STYLES_SELF],\n };\n },\n\n asProps: function (this: any, { _styles, styles, ...props }: any) {\n return {\n ...props,\n styles: this[STYLES_SELF],\n };\n },\n wrapperProps: function (this: any, { styles, ...props }: any) {\n const context: any = React.useContext(Context);\n return {\n ...props,\n _styles: styles,\n styles: context[STYLES_CONTEXT],\n };\n },\n };\n}\n\nexport default Enhancement;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAAoD,IAAAG,SAAA;EAAAC,UAAA;AAE7C,IAAMC,cAAc,GAAGC,MAAM,CAAC,gBAAgB,CAAC;AAACC,OAAA,CAAAF,cAAA,GAAAA,cAAA;AACvD,IAAMG,WAAW,GAAGF,MAAM,CAAC,aAAa,CAAC;AAEzC,SAASG,WAAWA,CAACC,eAAoB,EAAEC,OAAY,EAAE;EACvD,OAAO;IACLC,SAAS,EAAE,SAAAA,UAAUC,SAAc,EAAE;MACnC,OAAOC,OAAO,CAACD,SAAS,CAACE,KAAK,IAAIF,SAAS,CAACG,gCAAgB,CAAC,CAAC;IAChE,CAAC;IACDC,IAAI,EAAE,SAAAA,KAAqBC,KAAU,EAAEC,gBAAqB,EAAE;MAC5D,IAAID,KAAK,CAACE,MAAM,EAAE;QAChB,IAAI,CAACZ,WAAW,CAAC,GAAGU,KAAK,CAACE,MAAM;MAClC;MACA,IAAID,gBAAgB,CAACJ,KAAK,EAAE;QAC1B,IAAI,CAACP,WAAW,CAAC,GAAGa,cAAO,CAACC,KAAK,CAACH,gBAAgB,CAACJ,KAAK,EAAEG,KAAK,CAACK,OAAO,CAAC;MAC1E;IACF,CAAC;IACDC,OAAO,EAAE,SAAAA,QAAqBA,QAAY,EAAO;MAC/C;MACA,IAAI,CAAC,IAAI,CAAChB,WAAW,CAAC,IAAI,CAACiB,MAAM,CAACC,IAAI,CAAChB,eAAe,CAAC,CAACiB,MAAM,EAAE;QAC9D,OAAOH,QAAO;MAChB;MACA,WAAAI,cAAA,iBAAAA,cAAA,iBACKJ,QAAO,WAAAK,gBAAA,iBACTxB,cAAc,EAAG,IAAI,CAACG,WAAW,CAAC;IAEvC,CAAC;IAEDsB,OAAO,EAAE,SAAAA,QAAAC,IAAA,EAAyD;MAAA,IAAlCR,OAAO,GAAAQ,IAAA,CAAPR,OAAO;QAAEH,MAAM,GAAAW,IAAA,CAANX,MAAM;QAAKF,KAAK,OAAAc,yBAAA,aAAAD,IAAA,EAAA5B,SAAA;MACvD,WAAAyB,cAAA,iBAAAA,cAAA,iBACKV,KAAK;QACRE,MAAM,EAAE,IAAI,CAACZ,WAAW;MAAC;IAE7B,CAAC;IACDyB,YAAY,EAAE,SAAAA,aAAAC,KAAA,EAAgD;MAAA,IAAzBd,MAAM,GAAAc,KAAA,CAANd,MAAM;QAAKF,KAAK,OAAAc,yBAAA,aAAAE,KAAA,EAAA9B,UAAA;MACnD,IAAMoB,OAAY,GAAGW,iBAAK,CAACC,UAAU,CAACzB,OAAO,CAAC;MAC9C,WAAAiB,cAAA,iBAAAA,cAAA,iBACKV,KAAK;QACRK,OAAO,EAAEH,MAAM;QACfA,MAAM,EAAEI,OAAO,CAACnB,cAAc;MAAC;IAEnC;EACF,CAAC;AACH;AAAC,IAAAgC,QAAA,GAEc5B,WAAW;AAAAF,OAAA,cAAA8B,QAAA"}
@@ -2,6 +2,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import React from "react";
5
+ import "../styled/index.mjs";
5
6
  import { STATIC_COMPONENT } from "./staticChildren.mjs";
6
7
  import { sstyled } from "../styled/sstyled.mjs";
7
8
  var _excluded = ["_styles", "styles"], _excluded2 = ["styles"];
@@ -27,9 +28,7 @@ function Enhancement(childComponents, Context) {
27
28
  return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, STYLES_CONTEXT, this[STYLES_SELF]));
28
29
  },
29
30
  asProps: function asProps(_ref) {
30
- _ref._styles;
31
- _ref.styles;
32
- var props = _objectWithoutProperties(_ref, _excluded);
31
+ var _styles = _ref._styles, styles = _ref.styles, props = _objectWithoutProperties(_ref, _excluded);
33
32
  return _objectSpread(_objectSpread({}, props), {}, {
34
33
  styles: this[STYLES_SELF]
35
34
  });