@semcore/core 2.40.0-prerelease.4 → 2.40.0-prerelease.5

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 (499) hide show
  1. package/lib/LastInteractionType.d.ts +11 -0
  2. package/lib/LastInteractionType.js +55 -0
  3. package/lib/LastInteractionType.js.map +1 -0
  4. package/lib/LastInteractionType.mjs +50 -0
  5. package/lib/LastInteractionType.mjs.map +1 -0
  6. package/lib/core-types/Component.d.ts +142 -0
  7. package/lib/core-types/Component.js +53 -0
  8. package/lib/core-types/Component.js.map +1 -0
  9. package/lib/core-types/Component.mjs +47 -0
  10. package/lib/core-types/Component.mjs.map +1 -0
  11. package/lib/core-types/UnknownProperties.d.ts +3 -0
  12. package/lib/core-types/UnknownProperties.js +2 -0
  13. package/lib/core-types/UnknownProperties.js.map +1 -0
  14. package/lib/core-types/UnknownProperties.mjs +2 -0
  15. package/lib/core-types/UnknownProperties.mjs.map +1 -0
  16. package/lib/core-types/reshadow.d.js +2 -0
  17. package/lib/core-types/reshadow.d.js.map +1 -0
  18. package/lib/core-types/reshadow.d.mjs +2 -0
  19. package/lib/core-types/reshadow.d.mjs.map +1 -0
  20. package/lib/core-types/symbols.d.ts +9 -0
  21. package/lib/core-types/symbols.js +16 -0
  22. package/lib/core-types/symbols.js.map +1 -0
  23. package/lib/core-types/symbols.mjs +20 -0
  24. package/lib/core-types/symbols.mjs.map +1 -0
  25. package/lib/coreFactory.d.ts +10 -0
  26. package/lib/coreFactory.js +384 -0
  27. package/lib/coreFactory.js.map +1 -0
  28. package/lib/coreFactory.mjs +343 -0
  29. package/lib/coreFactory.mjs.map +1 -0
  30. package/lib/decorators/propsObserver.d.ts +11 -0
  31. package/lib/decorators/propsObserver.js +77 -0
  32. package/lib/decorators/propsObserver.js.map +1 -0
  33. package/lib/decorators/propsObserver.mjs +70 -0
  34. package/lib/decorators/propsObserver.mjs.map +1 -0
  35. package/lib/decorators/reactive.d.ts +11 -0
  36. package/lib/decorators/reactive.js +51 -0
  37. package/lib/decorators/reactive.js.map +1 -0
  38. package/lib/decorators/reactive.mjs +45 -0
  39. package/lib/decorators/reactive.mjs.map +1 -0
  40. package/lib/enhancement/Children.d.ts +5 -0
  41. package/lib/enhancement/Children.js +118 -0
  42. package/lib/enhancement/Children.js.map +1 -0
  43. package/lib/enhancement/Children.mjs +96 -0
  44. package/lib/enhancement/Children.mjs.map +1 -0
  45. package/lib/enhancement/Root.d.ts +6 -0
  46. package/lib/enhancement/Root.js +77 -0
  47. package/lib/enhancement/Root.js.map +1 -0
  48. package/lib/enhancement/Root.mjs +56 -0
  49. package/lib/enhancement/Root.mjs.map +1 -0
  50. package/lib/enhancement/dataName.d.ts +4 -0
  51. package/lib/enhancement/dataName.js +19 -0
  52. package/lib/enhancement/dataName.js.map +1 -0
  53. package/lib/enhancement/dataName.mjs +13 -0
  54. package/lib/enhancement/dataName.mjs.map +1 -0
  55. package/lib/enhancement/enhance.d.ts +5 -0
  56. package/lib/enhancement/enhance.js +21 -0
  57. package/lib/enhancement/enhance.js.map +1 -0
  58. package/lib/enhancement/enhance.mjs +16 -0
  59. package/lib/enhancement/enhance.mjs.map +1 -0
  60. package/lib/enhancement/functionDefaultProps.d.ts +8 -0
  61. package/lib/enhancement/functionDefaultProps.js +35 -0
  62. package/lib/enhancement/functionDefaultProps.js.map +1 -0
  63. package/lib/enhancement/functionDefaultProps.mjs +29 -0
  64. package/lib/enhancement/functionDefaultProps.mjs.map +1 -0
  65. package/lib/enhancement/i18n.d.ts +4 -0
  66. package/lib/enhancement/i18n.js +27 -0
  67. package/lib/enhancement/i18n.js.map +1 -0
  68. package/lib/enhancement/i18n.mjs +20 -0
  69. package/lib/enhancement/i18n.mjs.map +1 -0
  70. package/lib/enhancement/inheritedName.d.ts +8 -0
  71. package/lib/enhancement/inheritedName.js +22 -0
  72. package/lib/enhancement/inheritedName.js.map +1 -0
  73. package/lib/enhancement/inheritedName.mjs +16 -0
  74. package/lib/enhancement/inheritedName.mjs.map +1 -0
  75. package/lib/enhancement/staticChildren.d.ts +13 -0
  76. package/lib/enhancement/staticChildren.js +132 -0
  77. package/lib/enhancement/staticChildren.js.map +1 -0
  78. package/lib/enhancement/staticChildren.mjs +120 -0
  79. package/lib/enhancement/staticChildren.mjs.map +1 -0
  80. package/lib/enhancement/style.d.ts +9 -0
  81. package/lib/enhancement/style.js +58 -0
  82. package/lib/enhancement/style.js.map +1 -0
  83. package/lib/enhancement/style.mjs +49 -0
  84. package/lib/enhancement/style.mjs.map +1 -0
  85. package/lib/enhancement/uncontrolledProps.d.ts +7 -0
  86. package/lib/enhancement/uncontrolledProps.js +131 -0
  87. package/lib/enhancement/uncontrolledProps.js.map +1 -0
  88. package/lib/enhancement/uncontrolledProps.mjs +107 -0
  89. package/lib/enhancement/uncontrolledProps.mjs.map +1 -0
  90. package/lib/esm/LastInteractionType.mjs +50 -0
  91. package/lib/esm/core-types/Component.mjs +47 -0
  92. package/lib/esm/core-types/symbols.mjs +20 -0
  93. package/lib/esm/coreFactory.mjs +343 -0
  94. package/lib/esm/enhancement/Children.mjs +96 -0
  95. package/lib/esm/enhancement/Root.mjs +56 -0
  96. package/lib/esm/enhancement/dataName.mjs +13 -0
  97. package/lib/esm/enhancement/enhance.mjs +16 -0
  98. package/lib/esm/enhancement/functionDefaultProps.mjs +29 -0
  99. package/lib/esm/enhancement/i18n.mjs +20 -0
  100. package/lib/esm/enhancement/inheritedName.mjs +16 -0
  101. package/lib/esm/enhancement/staticChildren.mjs +120 -0
  102. package/lib/esm/enhancement/style.mjs +49 -0
  103. package/lib/esm/enhancement/uncontrolledProps.mjs +107 -0
  104. package/lib/esm/index.mjs +22 -4
  105. package/lib/esm/register.mjs +30 -0
  106. package/lib/esm/styled/index.mjs +8 -0
  107. package/lib/esm/styled/reshadow-core.mjs +234 -0
  108. package/lib/esm/styled/sstyled.mjs +125 -0
  109. package/lib/esm/utils/assignProps.mjs +86 -0
  110. package/lib/esm/utils/canUseDOM.mjs +6 -0
  111. package/lib/esm/utils/capitalizeFirstLetter.mjs +6 -0
  112. package/lib/esm/utils/enhances/WithI18n.mjs +30 -0
  113. package/lib/esm/utils/enhances/i18nEnhance.mjs +90 -0
  114. package/lib/esm/utils/logger.mjs +34 -0
  115. package/lib/esm/utils/pick.mjs +15 -0
  116. package/lib/esm/utils/ref.mjs +73 -0
  117. package/lib/esm/utils/use/useEnhancedEffect.mjs +6 -0
  118. package/lib/index.d.ts +11 -0
  119. package/lib/index.js +103 -0
  120. package/lib/index.js.map +1 -0
  121. package/lib/index.mjs +24 -0
  122. package/lib/index.mjs.map +1 -0
  123. package/lib/register.d.ts +8 -0
  124. package/lib/register.js +34 -0
  125. package/lib/register.js.map +1 -0
  126. package/lib/register.mjs +30 -0
  127. package/lib/register.mjs.map +1 -0
  128. package/lib/styled/index.d.ts +6 -0
  129. package/lib/styled/index.js +32 -0
  130. package/lib/styled/index.js.map +1 -0
  131. package/lib/styled/index.mjs +8 -0
  132. package/lib/styled/index.mjs.map +1 -0
  133. package/lib/styled/reshadow-core.d.ts +37 -0
  134. package/lib/styled/reshadow-core.js +233 -0
  135. package/lib/styled/reshadow-core.js.map +1 -0
  136. package/lib/styled/reshadow-core.mjs +234 -0
  137. package/lib/styled/reshadow-core.mjs.map +1 -0
  138. package/lib/styled/sstyled.d.ts +17 -0
  139. package/lib/styled/sstyled.js +151 -0
  140. package/lib/styled/sstyled.js.map +1 -0
  141. package/lib/styled/sstyled.mjs +125 -0
  142. package/lib/styled/sstyled.mjs.map +1 -0
  143. package/lib/theme/themes/auto.css +1748 -0
  144. package/lib/theme/themes/dark.css +871 -0
  145. package/lib/theme/themes/dark.d.ts +487 -0
  146. package/lib/theme/themes/dark.js +493 -0
  147. package/lib/theme/themes/dark.js.map +1 -0
  148. package/lib/theme/themes/dark.mjs +487 -0
  149. package/lib/theme/themes/dark.mjs.map +1 -0
  150. package/lib/theme/themes/default.css +877 -0
  151. package/lib/theme/themes/default.d.ts +490 -0
  152. package/lib/theme/themes/default.js +496 -0
  153. package/lib/theme/themes/default.js.map +1 -0
  154. package/lib/theme/themes/default.mjs +490 -0
  155. package/lib/theme/themes/default.mjs.map +1 -0
  156. package/lib/theme/themes/highlights-dark.css +36 -0
  157. package/lib/theme/themes/highlights-dark.d.ts +20 -0
  158. package/lib/theme/themes/highlights-dark.js +26 -0
  159. package/lib/theme/themes/highlights-dark.js.map +1 -0
  160. package/lib/theme/themes/highlights-dark.mjs +20 -0
  161. package/lib/theme/themes/highlights-dark.mjs.map +1 -0
  162. package/lib/theme/themes/highlights-light.css +36 -0
  163. package/lib/theme/themes/highlights-light.d.ts +20 -0
  164. package/lib/theme/themes/highlights-light.js +26 -0
  165. package/lib/theme/themes/highlights-light.js.map +1 -0
  166. package/lib/theme/themes/highlights-light.mjs +20 -0
  167. package/lib/theme/themes/highlights-light.mjs.map +1 -0
  168. package/lib/theme/themes/light.css +877 -0
  169. package/lib/theme/themes/light.d.ts +490 -0
  170. package/lib/theme/themes/light.js +496 -0
  171. package/lib/theme/themes/light.js.map +1 -0
  172. package/lib/theme/themes/light.mjs +490 -0
  173. package/lib/theme/themes/light.mjs.map +1 -0
  174. package/lib/utils/CSSinJS.d.ts +5 -0
  175. package/lib/utils/CSSinJS.js +35 -0
  176. package/lib/utils/CSSinJS.js.map +1 -0
  177. package/lib/utils/CSSinJS.mjs +28 -0
  178. package/lib/utils/CSSinJS.mjs.map +1 -0
  179. package/lib/utils/ThemeProvider.d.ts +15 -0
  180. package/lib/utils/ThemeProvider.js +78 -0
  181. package/lib/utils/ThemeProvider.js.map +1 -0
  182. package/lib/utils/ThemeProvider.mjs +71 -0
  183. package/lib/utils/ThemeProvider.mjs.map +1 -0
  184. package/lib/utils/addonText.d.ts +2 -0
  185. package/lib/utils/addonText.js +18 -0
  186. package/lib/utils/addonText.js.map +1 -0
  187. package/lib/utils/addonText.mjs +11 -0
  188. package/lib/utils/addonText.mjs.map +1 -0
  189. package/lib/utils/addonTextChildren.d.ts +3 -0
  190. package/lib/utils/addonTextChildren.js +44 -0
  191. package/lib/utils/addonTextChildren.js.map +1 -0
  192. package/lib/utils/addonTextChildren.mjs +37 -0
  193. package/lib/utils/addonTextChildren.mjs.map +1 -0
  194. package/lib/utils/ariaProps.d.ts +12 -0
  195. package/lib/utils/ariaProps.js +22 -0
  196. package/lib/utils/ariaProps.js.map +1 -0
  197. package/lib/utils/ariaProps.mjs +16 -0
  198. package/lib/utils/ariaProps.mjs.map +1 -0
  199. package/lib/utils/assignProps.d.ts +11 -0
  200. package/lib/utils/assignProps.js +93 -0
  201. package/lib/utils/assignProps.js.map +1 -0
  202. package/lib/utils/assignProps.mjs +86 -0
  203. package/lib/utils/assignProps.mjs.map +1 -0
  204. package/lib/utils/canUseDOM.d.ts +1 -0
  205. package/lib/utils/canUseDOM.js +10 -0
  206. package/lib/utils/canUseDOM.js.map +1 -0
  207. package/lib/utils/canUseDOM.mjs +6 -0
  208. package/lib/utils/canUseDOM.mjs.map +1 -0
  209. package/lib/utils/capitalizeFirstLetter.d.ts +1 -0
  210. package/lib/utils/capitalizeFirstLetter.js +10 -0
  211. package/lib/utils/capitalizeFirstLetter.js.map +1 -0
  212. package/lib/utils/capitalizeFirstLetter.mjs +6 -0
  213. package/lib/utils/capitalizeFirstLetter.mjs.map +1 -0
  214. package/lib/utils/color.d.ts +5 -0
  215. package/lib/utils/color.js +208 -0
  216. package/lib/utils/color.js.map +1 -0
  217. package/lib/utils/color.mjs +197 -0
  218. package/lib/utils/color.mjs.map +1 -0
  219. package/lib/utils/compose.d.ts +1 -0
  220. package/lib/utils/compose.js +21 -0
  221. package/lib/utils/compose.js.map +1 -0
  222. package/lib/utils/compose.mjs +15 -0
  223. package/lib/utils/compose.mjs.map +1 -0
  224. package/lib/utils/createUUID.d.ts +1 -0
  225. package/lib/utils/createUUID.js +15 -0
  226. package/lib/utils/createUUID.js.map +1 -0
  227. package/lib/utils/createUUID.mjs +9 -0
  228. package/lib/utils/createUUID.mjs.map +1 -0
  229. package/lib/utils/cssToIntDefault.d.ts +8 -0
  230. package/lib/utils/cssToIntDefault.js +22 -0
  231. package/lib/utils/cssToIntDefault.js.map +1 -0
  232. package/lib/utils/cssToIntDefault.mjs +16 -0
  233. package/lib/utils/cssToIntDefault.mjs.map +1 -0
  234. package/lib/utils/enhances/WithCSS.d.ts +13 -0
  235. package/lib/utils/enhances/WithCSS.js +32 -0
  236. package/lib/utils/enhances/WithCSS.js.map +1 -0
  237. package/lib/utils/enhances/WithCSS.mjs +25 -0
  238. package/lib/utils/enhances/WithCSS.mjs.map +1 -0
  239. package/lib/utils/enhances/WithI18n.d.ts +14 -0
  240. package/lib/utils/enhances/WithI18n.js +33 -0
  241. package/lib/utils/enhances/WithI18n.js.map +1 -0
  242. package/lib/utils/enhances/WithI18n.mjs +30 -0
  243. package/lib/utils/enhances/WithI18n.mjs.map +1 -0
  244. package/lib/utils/enhances/a11yEnhance.d.ts +10 -0
  245. package/lib/utils/enhances/a11yEnhance.js +73 -0
  246. package/lib/utils/enhances/a11yEnhance.js.map +1 -0
  247. package/lib/utils/enhances/a11yEnhance.mjs +66 -0
  248. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -0
  249. package/lib/utils/enhances/animatedSizeEnhance.d.ts +8 -0
  250. package/lib/utils/enhances/animatedSizeEnhance.js +98 -0
  251. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -0
  252. package/lib/utils/enhances/animatedSizeEnhance.mjs +91 -0
  253. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -0
  254. package/lib/utils/enhances/contextEnhance.d.ts +3 -0
  255. package/lib/utils/enhances/contextEnhance.js +21 -0
  256. package/lib/utils/enhances/contextEnhance.js.map +1 -0
  257. package/lib/utils/enhances/contextEnhance.mjs +14 -0
  258. package/lib/utils/enhances/contextEnhance.mjs.map +1 -0
  259. package/lib/utils/enhances/i18nEnhance.d.ts +21 -0
  260. package/lib/utils/enhances/i18nEnhance.js +99 -0
  261. package/lib/utils/enhances/i18nEnhance.js.map +1 -0
  262. package/lib/utils/enhances/i18nEnhance.mjs +90 -0
  263. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -0
  264. package/lib/utils/enhances/resolveColorEnhance.d.ts +2 -0
  265. package/lib/utils/enhances/resolveColorEnhance.js +24 -0
  266. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -0
  267. package/lib/utils/enhances/resolveColorEnhance.mjs +17 -0
  268. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -0
  269. package/lib/utils/eventEmitter.d.ts +13 -0
  270. package/lib/utils/eventEmitter.js +68 -0
  271. package/lib/utils/eventEmitter.js.map +1 -0
  272. package/lib/utils/eventEmitter.mjs +62 -0
  273. package/lib/utils/eventEmitter.mjs.map +1 -0
  274. package/lib/utils/findComponent.d.ts +12 -0
  275. package/lib/utils/findComponent.js +105 -0
  276. package/lib/utils/findComponent.js.map +1 -0
  277. package/lib/utils/findComponent.mjs +95 -0
  278. package/lib/utils/findComponent.mjs.map +1 -0
  279. package/lib/utils/fire.d.ts +2 -0
  280. package/lib/utils/fire.js +23 -0
  281. package/lib/utils/fire.js.map +1 -0
  282. package/lib/utils/fire.mjs +15 -0
  283. package/lib/utils/fire.mjs.map +1 -0
  284. package/lib/utils/focus-lock/focusBorders.d.ts +4 -0
  285. package/lib/utils/focus-lock/focusBorders.js +68 -0
  286. package/lib/utils/focus-lock/focusBorders.js.map +1 -0
  287. package/lib/utils/focus-lock/focusBorders.mjs +62 -0
  288. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -0
  289. package/lib/utils/focus-lock/getFocusableIn.d.ts +1 -0
  290. package/lib/utils/focus-lock/getFocusableIn.js +25 -0
  291. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -0
  292. package/lib/utils/focus-lock/getFocusableIn.mjs +19 -0
  293. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -0
  294. package/lib/utils/focus-lock/isFocusInside.d.ts +1 -0
  295. package/lib/utils/focus-lock/isFocusInside.js +15 -0
  296. package/lib/utils/focus-lock/isFocusInside.js.map +1 -0
  297. package/lib/utils/focus-lock/isFocusInside.mjs +9 -0
  298. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -0
  299. package/lib/utils/focus-lock/isFocusable.d.ts +1 -0
  300. package/lib/utils/focus-lock/isFocusable.js +50 -0
  301. package/lib/utils/focus-lock/isFocusable.js.map +1 -0
  302. package/lib/utils/focus-lock/isFocusable.mjs +43 -0
  303. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -0
  304. package/lib/utils/focus-lock/setFocus.d.ts +1 -0
  305. package/lib/utils/focus-lock/setFocus.js +70 -0
  306. package/lib/utils/focus-lock/setFocus.js.map +1 -0
  307. package/lib/utils/focus-lock/setFocus.mjs +63 -0
  308. package/lib/utils/focus-lock/setFocus.mjs.map +1 -0
  309. package/lib/utils/getAccessibleName.d.ts +1 -0
  310. package/lib/utils/getAccessibleName.js +56 -0
  311. package/lib/utils/getAccessibleName.js.map +1 -0
  312. package/lib/utils/getAccessibleName.mjs +49 -0
  313. package/lib/utils/getAccessibleName.mjs.map +1 -0
  314. package/lib/utils/getDisplayName.d.ts +2 -0
  315. package/lib/utils/getDisplayName.js +10 -0
  316. package/lib/utils/getDisplayName.js.map +1 -0
  317. package/lib/utils/getDisplayName.mjs +4 -0
  318. package/lib/utils/getDisplayName.mjs.map +1 -0
  319. package/lib/utils/getEventTarget.d.ts +1 -0
  320. package/lib/utils/getEventTarget.js +52 -0
  321. package/lib/utils/getEventTarget.js.map +1 -0
  322. package/lib/utils/getEventTarget.mjs +45 -0
  323. package/lib/utils/getEventTarget.mjs.map +1 -0
  324. package/lib/utils/getOriginChildren.d.ts +2 -0
  325. package/lib/utils/getOriginChildren.js +17 -0
  326. package/lib/utils/getOriginChildren.js.map +1 -0
  327. package/lib/utils/getOriginChildren.mjs +10 -0
  328. package/lib/utils/getOriginChildren.mjs.map +1 -0
  329. package/lib/utils/getRandomInt.d.ts +1 -0
  330. package/lib/utils/getRandomInt.js +11 -0
  331. package/lib/utils/getRandomInt.js.map +1 -0
  332. package/lib/utils/getRandomInt.mjs +5 -0
  333. package/lib/utils/getRandomInt.mjs.map +1 -0
  334. package/lib/utils/getValue.d.ts +1 -0
  335. package/lib/utils/getValue.js +14 -0
  336. package/lib/utils/getValue.js.map +1 -0
  337. package/lib/utils/getValue.mjs +8 -0
  338. package/lib/utils/getValue.mjs.map +1 -0
  339. package/lib/utils/hasLabels.d.ts +7 -0
  340. package/lib/utils/hasLabels.js +46 -0
  341. package/lib/utils/hasLabels.js.map +1 -0
  342. package/lib/utils/hasLabels.mjs +39 -0
  343. package/lib/utils/hasLabels.mjs.map +1 -0
  344. package/lib/utils/hasParent.d.ts +1 -0
  345. package/lib/utils/hasParent.js +13 -0
  346. package/lib/utils/hasParent.js.map +1 -0
  347. package/lib/utils/hasParent.mjs +8 -0
  348. package/lib/utils/hasParent.mjs.map +1 -0
  349. package/lib/utils/ifChildren.d.ts +8 -0
  350. package/lib/utils/ifChildren.js +16 -0
  351. package/lib/utils/ifChildren.js.map +1 -0
  352. package/lib/utils/ifChildren.mjs +10 -0
  353. package/lib/utils/ifChildren.mjs.map +1 -0
  354. package/lib/utils/indentStyles.d.ts +3 -0
  355. package/lib/utils/indentStyles.js +45 -0
  356. package/lib/utils/indentStyles.js.map +1 -0
  357. package/lib/utils/indentStyles.mjs +36 -0
  358. package/lib/utils/indentStyles.mjs.map +1 -0
  359. package/lib/utils/injectStyle.d.ts +2 -0
  360. package/lib/utils/injectStyle.js +47 -0
  361. package/lib/utils/injectStyle.js.map +1 -0
  362. package/lib/utils/injectStyle.mjs +40 -0
  363. package/lib/utils/injectStyle.mjs.map +1 -0
  364. package/lib/utils/inputProps.d.ts +2 -0
  365. package/lib/utils/inputProps.js +21 -0
  366. package/lib/utils/inputProps.js.map +1 -0
  367. package/lib/utils/inputProps.mjs +14 -0
  368. package/lib/utils/inputProps.mjs.map +1 -0
  369. package/lib/utils/isInteractiveElement.d.ts +1 -0
  370. package/lib/utils/isInteractiveElement.js +34 -0
  371. package/lib/utils/isInteractiveElement.js.map +1 -0
  372. package/lib/utils/isInteractiveElement.mjs +28 -0
  373. package/lib/utils/isInteractiveElement.mjs.map +1 -0
  374. package/lib/utils/isNode.d.ts +1 -0
  375. package/lib/utils/isNode.js +28 -0
  376. package/lib/utils/isNode.js.map +1 -0
  377. package/lib/utils/isNode.mjs +21 -0
  378. package/lib/utils/isNode.mjs.map +1 -0
  379. package/lib/utils/isPromise.d.ts +1 -0
  380. package/lib/utils/isPromise.js +10 -0
  381. package/lib/utils/isPromise.js.map +1 -0
  382. package/lib/utils/isPromise.mjs +4 -0
  383. package/lib/utils/isPromise.mjs.map +1 -0
  384. package/lib/utils/isRetina.d.ts +1 -0
  385. package/lib/utils/isRetina.js +15 -0
  386. package/lib/utils/isRetina.js.map +1 -0
  387. package/lib/utils/isRetina.mjs +9 -0
  388. package/lib/utils/isRetina.mjs.map +1 -0
  389. package/lib/utils/logger.d.ts +9 -0
  390. package/lib/utils/logger.js +37 -0
  391. package/lib/utils/logger.js.map +1 -0
  392. package/lib/utils/logger.mjs +34 -0
  393. package/lib/utils/logger.mjs.map +1 -0
  394. package/lib/utils/numericChecker.d.ts +5 -0
  395. package/lib/utils/numericChecker.js +33 -0
  396. package/lib/utils/numericChecker.js.map +1 -0
  397. package/lib/utils/numericChecker.mjs +27 -0
  398. package/lib/utils/numericChecker.mjs.map +1 -0
  399. package/lib/utils/ownerDocument.d.ts +1 -0
  400. package/lib/utils/ownerDocument.js +10 -0
  401. package/lib/utils/ownerDocument.js.map +1 -0
  402. package/lib/utils/ownerDocument.mjs +4 -0
  403. package/lib/utils/ownerDocument.mjs.map +1 -0
  404. package/lib/utils/pick.d.ts +1 -0
  405. package/lib/utils/pick.js +19 -0
  406. package/lib/utils/pick.js.map +1 -0
  407. package/lib/utils/pick.mjs +15 -0
  408. package/lib/utils/pick.mjs.map +1 -0
  409. package/lib/utils/propsForElement.d.ts +3 -0
  410. package/lib/utils/propsForElement.js +58 -0
  411. package/lib/utils/propsForElement.js.map +1 -0
  412. package/lib/utils/propsForElement.mjs +50 -0
  413. package/lib/utils/propsForElement.mjs.map +1 -0
  414. package/lib/utils/rafTrottle.d.ts +2 -0
  415. package/lib/utils/rafTrottle.js +32 -0
  416. package/lib/utils/rafTrottle.js.map +1 -0
  417. package/lib/utils/rafTrottle.mjs +26 -0
  418. package/lib/utils/rafTrottle.mjs.map +1 -0
  419. package/lib/utils/reactToText.d.ts +3 -0
  420. package/lib/utils/reactToText.js +32 -0
  421. package/lib/utils/reactToText.js.map +1 -0
  422. package/lib/utils/reactToText.mjs +26 -0
  423. package/lib/utils/reactToText.mjs.map +1 -0
  424. package/lib/utils/ref.d.ts +8 -0
  425. package/lib/utils/ref.js +82 -0
  426. package/lib/utils/ref.js.map +1 -0
  427. package/lib/utils/ref.mjs +73 -0
  428. package/lib/utils/ref.mjs.map +1 -0
  429. package/lib/utils/setRef.d.ts +2 -0
  430. package/lib/utils/setRef.js +9 -0
  431. package/lib/utils/setRef.js.map +1 -0
  432. package/lib/utils/setRef.mjs +3 -0
  433. package/lib/utils/setRef.mjs.map +1 -0
  434. package/lib/utils/syncScroll.d.ts +1 -0
  435. package/lib/utils/syncScroll.js +61 -0
  436. package/lib/utils/syncScroll.js.map +1 -0
  437. package/lib/utils/syncScroll.mjs +54 -0
  438. package/lib/utils/syncScroll.mjs.map +1 -0
  439. package/lib/utils/uncontroll.d.ts +4 -0
  440. package/lib/utils/uncontroll.js +47 -0
  441. package/lib/utils/uncontroll.js.map +1 -0
  442. package/lib/utils/uncontroll.mjs +38 -0
  443. package/lib/utils/uncontroll.mjs.map +1 -0
  444. package/lib/utils/uniqueID.d.ts +8 -0
  445. package/lib/utils/uniqueID.js +40 -0
  446. package/lib/utils/uniqueID.js.map +1 -0
  447. package/lib/utils/uniqueID.mjs +33 -0
  448. package/lib/utils/uniqueID.mjs.map +1 -0
  449. package/lib/utils/use/useColorResolver.d.ts +1 -0
  450. package/lib/utils/use/useColorResolver.js +109 -0
  451. package/lib/utils/use/useColorResolver.js.map +1 -0
  452. package/lib/utils/use/useColorResolver.mjs +102 -0
  453. package/lib/utils/use/useColorResolver.mjs.map +1 -0
  454. package/lib/utils/use/useEnhancedEffect.d.ts +3 -0
  455. package/lib/utils/use/useEnhancedEffect.js +12 -0
  456. package/lib/utils/use/useEnhancedEffect.js.map +1 -0
  457. package/lib/utils/use/useEnhancedEffect.mjs +6 -0
  458. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -0
  459. package/lib/utils/use/useEventCallback.d.ts +4 -0
  460. package/lib/utils/use/useEventCallback.js +25 -0
  461. package/lib/utils/use/useEventCallback.js.map +1 -0
  462. package/lib/utils/use/useEventCallback.mjs +19 -0
  463. package/lib/utils/use/useEventCallback.mjs.map +1 -0
  464. package/lib/utils/use/useEventListener.d.ts +2 -0
  465. package/lib/utils/use/useEventListener.js +32 -0
  466. package/lib/utils/use/useEventListener.js.map +1 -0
  467. package/lib/utils/use/useEventListener.mjs +25 -0
  468. package/lib/utils/use/useEventListener.mjs.map +1 -0
  469. package/lib/utils/use/useFocusLock.d.ts +10 -0
  470. package/lib/utils/use/useFocusLock.js +292 -0
  471. package/lib/utils/use/useFocusLock.js.map +1 -0
  472. package/lib/utils/use/useFocusLock.mjs +272 -0
  473. package/lib/utils/use/useFocusLock.mjs.map +1 -0
  474. package/lib/utils/use/usePreventScroll.d.ts +2 -0
  475. package/lib/utils/use/usePreventScroll.js +76 -0
  476. package/lib/utils/use/usePreventScroll.js.map +1 -0
  477. package/lib/utils/use/usePreventScroll.mjs +68 -0
  478. package/lib/utils/use/usePreventScroll.mjs.map +1 -0
  479. package/lib/utils/use/useScrollBarWidth.d.ts +1 -0
  480. package/lib/utils/use/useScrollBarWidth.js +43 -0
  481. package/lib/utils/use/useScrollBarWidth.js.map +1 -0
  482. package/lib/utils/use/useScrollBarWidth.mjs +36 -0
  483. package/lib/utils/use/useScrollBarWidth.mjs.map +1 -0
  484. package/lib/utils/useCssVariable.d.ts +8 -0
  485. package/lib/utils/useCssVariable.js +53 -0
  486. package/lib/utils/useCssVariable.js.map +1 -0
  487. package/lib/utils/useCssVariable.mjs +46 -0
  488. package/lib/utils/useCssVariable.mjs.map +1 -0
  489. package/lib/utils/zIndexStacking.d.ts +10 -0
  490. package/lib/utils/zIndexStacking.js +45 -0
  491. package/lib/utils/zIndexStacking.js.map +1 -0
  492. package/lib/utils/zIndexStacking.mjs +38 -0
  493. package/lib/utils/zIndexStacking.mjs.map +1 -0
  494. package/package.json +2 -2
  495. package/lib/cjs/index.js +0 -23
  496. package/lib/cjs/index.js.map +0 -1
  497. package/lib/es6/index.js +0 -4
  498. package/lib/es6/index.js.map +0 -1
  499. package/lib/types/index.d.ts +0 -3
@@ -0,0 +1,343 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
+ import _superPropGet from "@babel/runtime/helpers/esm/superPropGet";
6
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
7
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
8
+ import _callSuper from "@babel/runtime/helpers/esm/callSuper";
9
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
10
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
11
+ import _extends from "@babel/runtime/helpers/esm/extends";
12
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
+ import hoistNonReactStatics from "hoist-non-react-statics";
14
+ import React from "react";
15
+ import { Component } from "./core-types/Component.mjs";
16
+ import { CORE_AS_PROPS, CORE_INSTANCE, CORE_INIT, CORE_COMPONENT, PARENT_COMPONENTS, CONTEXT_COMPONENT, CREATE_COMPONENT } from "./core-types/symbols.mjs";
17
+ import Enhancement from "./enhancement/Children.mjs";
18
+ import Enhancement$6 from "./enhancement/dataName.mjs";
19
+ import Enhancement$7 from "./enhancement/enhance.mjs";
20
+ import Enhancement$4 from "./enhancement/functionDefaultProps.mjs";
21
+ import i18nAppLocaleEnhance from "./enhancement/i18n.mjs";
22
+ import Enhancement$5 from "./enhancement/inheritedName.mjs";
23
+ import Enhancement$1 from "./enhancement/Root.mjs";
24
+ import Enhancement$3, { ROOT_COMPONENT, getterMethodNameByDisplayName, STATIC_COMPONENT } from "./enhancement/staticChildren.mjs";
25
+ import Enhancement$8 from "./enhancement/style.mjs";
26
+ import Enhancement$2 from "./enhancement/uncontrolledProps.mjs";
27
+ import assignProps$1 from "./utils/assignProps.mjs";
28
+ import { useForkRef } from "./utils/ref.mjs";
29
+ import useEnhancedEffect from "./utils/use/useEnhancedEffect.mjs";
30
+ var _excluded = ["forwardRef"], _excluded2 = ["forwardRef", "__WRAPPER_PROPS_BIND__"], _excluded3 = ["ref"];
31
+ function isEmptyObject(obj) {
32
+ return Object.getOwnPropertyNames(obj).length === 0 && Object.getOwnPropertySymbols && // For IE 11
33
+ Object.getOwnPropertySymbols(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
34
+ }
35
+ function createGetField(enhancements, Component2, isFunction) {
36
+ return function getField(key) {
37
+ return enhancements.filter(function(enhancement) {
38
+ if (!enhancement.condition) {
39
+ return true;
40
+ }
41
+ return enhancement.condition(Component2, isFunction);
42
+ }).reduce(function(acc, item) {
43
+ if (item[key]) {
44
+ acc.push(item[key]);
45
+ }
46
+ return acc;
47
+ }, []);
48
+ };
49
+ }
50
+ function createForwardWrapper(Component2, wrapperProps, statics, isFunction) {
51
+ var RootComponent = Component2[ROOT_COMPONENT];
52
+ var getterMethodName = getterMethodNameByDisplayName(Component2 === null || Component2 === void 0 ? void 0 : Component2.displayName);
53
+ var getterMethod = RootComponent !== null && RootComponent !== void 0 && RootComponent.prototype ? RootComponent.prototype[getterMethodName] : void 0;
54
+ var useGetterIndex = (getterMethod === null || getterMethod === void 0 ? void 0 : getterMethod.length) >= 2;
55
+ function WrapperForwardRefWithBind(_ref, ref) {
56
+ var _ref$forwardRef = _ref.forwardRef, forwardRef = _ref$forwardRef === void 0 ? null : _ref$forwardRef, other = _objectWithoutProperties(_ref, _excluded);
57
+ return /* @__PURE__ */ React.createElement(BindingWrapper, _extends({}, other, {
58
+ forwardRef: useForkRef(ref, forwardRef)
59
+ }));
60
+ }
61
+ function WrapperForwardRef(_ref2, ref) {
62
+ var _ref2$forwardRef = _ref2.forwardRef, forwardRef = _ref2$forwardRef === void 0 ? null : _ref2$forwardRef, __WRAPPER_PROPS_BIND__ = _ref2.__WRAPPER_PROPS_BIND__, other = _objectWithoutProperties(_ref2, _excluded2);
63
+ var _reduce = (__WRAPPER_PROPS_BIND__ || wrapperProps).reduce(function(acc, enhancement) {
64
+ return enhancement(acc, WrapperComponent, isFunction);
65
+ }, other), _reduce$ref = _reduce.ref, enhancementRef = _reduce$ref === void 0 ? null : _reduce$ref, props = _objectWithoutProperties(_reduce, _excluded3);
66
+ return /* @__PURE__ */ React.createElement(Component2, _extends({}, props, {
67
+ forwardRef: useForkRef(enhancementRef, ref, forwardRef)
68
+ }));
69
+ }
70
+ var BindingWrapper = /* @__PURE__ */ (function(_React$Component) {
71
+ function BindingWrapper2() {
72
+ var _this;
73
+ _classCallCheck(this, BindingWrapper2);
74
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
75
+ args[_key] = arguments[_key];
76
+ }
77
+ _this = _callSuper(this, BindingWrapper2, [].concat(args));
78
+ _defineProperty(_this, "index", -1);
79
+ return _this;
80
+ }
81
+ _inherits(BindingWrapper2, _React$Component);
82
+ return _createClass(BindingWrapper2, [{
83
+ key: "render",
84
+ value: function render() {
85
+ var _this2 = this;
86
+ return /* @__PURE__ */ React.createElement(WrapperForwardRef, _extends({}, this.props, {
87
+ __WRAPPER_PROPS_BIND__: wrapperProps.map(function(fn) {
88
+ return fn.bind(_this2);
89
+ })
90
+ }));
91
+ }
92
+ }]);
93
+ })(React.Component);
94
+ var WrapperComponent = /* @__PURE__ */ React.forwardRef(useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef);
95
+ hoistNonReactStatics(WrapperComponent, Component2);
96
+ WrapperComponent.displayName = Component2.displayName;
97
+ WrapperComponent.defaultProps = Component2.defaultProps;
98
+ statics.forEach(function(enhancement) {
99
+ return Object.assign(WrapperComponent, enhancement(WrapperComponent, Component2, isFunction));
100
+ });
101
+ return WrapperComponent;
102
+ }
103
+ function wrapClass(OriginComponent, enhancements, Context) {
104
+ var getField = createGetField(enhancements, OriginComponent, false);
105
+ var inits = getField("init");
106
+ var props = getField("asProps");
107
+ var renders = getField("render");
108
+ var statics = getField("static");
109
+ var wrapperProps = getField("wrapperProps");
110
+ var contexts = getField("context");
111
+ var Component2 = /* @__PURE__ */ (function(_OriginComponent2) {
112
+ function Component3(props2, context) {
113
+ var _this3;
114
+ _classCallCheck(this, Component3);
115
+ _this3 = _callSuper(this, Component3, [props2, context]);
116
+ _defineProperty(_this3, CORE_AS_PROPS, null);
117
+ _defineProperty(_this3, CORE_INSTANCE, WrapperComponent);
118
+ _defineProperty(_this3, CORE_INIT, false);
119
+ inits.forEach(function(enhancement) {
120
+ return enhancement.call(_this3, props2, WrapperComponent, false);
121
+ });
122
+ _this3[CORE_INIT] = true;
123
+ return _this3;
124
+ }
125
+ _inherits(Component3, _OriginComponent2);
126
+ return _createClass(Component3, [{
127
+ key: "asProps",
128
+ get: function get() {
129
+ var _this4 = this;
130
+ if (!this[CORE_INIT]) {
131
+ throw new Error("Can not call asProps in constructor");
132
+ }
133
+ if (!this[CORE_AS_PROPS]) {
134
+ this[CORE_AS_PROPS] = props.reduce(function(acc, enhancement) {
135
+ return enhancement.call(_this4, acc, WrapperComponent, false);
136
+ }, this.props);
137
+ if (this[CORE_AS_PROPS] !== null) {
138
+ var prefixesMap = /* @__PURE__ */ new Map();
139
+ Object.entries(this[CORE_AS_PROPS]).forEach(function(_ref3) {
140
+ var _ref4 = _slicedToArray(_ref3, 2), key2 = _ref4[0], value2 = _ref4[1];
141
+ var _key$split = key2.split(":"), _key$split2 = _slicedToArray(_key$split, 2), prefix = _key$split2[0], propertyKey = _key$split2[1];
142
+ if (prefix !== "use" && propertyKey) {
143
+ var _prefixesMap$get;
144
+ var obj = (_prefixesMap$get = prefixesMap.get(prefix)) !== null && _prefixesMap$get !== void 0 ? _prefixesMap$get : {};
145
+ obj[propertyKey] = value2;
146
+ prefixesMap.set(prefix, obj);
147
+ }
148
+ });
149
+ var _iterator = _createForOfIteratorHelper(prefixesMap.entries()), _step;
150
+ try {
151
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
152
+ var _step$value = _slicedToArray(_step.value, 2), key = _step$value[0], value = _step$value[1];
153
+ Object.defineProperty(this[CORE_AS_PROPS], "".concat(key, "Props"), {
154
+ value
155
+ });
156
+ }
157
+ } catch (err) {
158
+ _iterator.e(err);
159
+ } finally {
160
+ _iterator.f();
161
+ }
162
+ }
163
+ }
164
+ return this[CORE_AS_PROPS];
165
+ }
166
+ }, {
167
+ key: "setContext",
168
+ value: function setContext() {
169
+ var _this5 = this;
170
+ var contextProps = _superPropGet(Component3, "setContext", this, 1) ? _superPropGet(Component3, "setContext", this, 3)([]) : {};
171
+ return contexts.reduce(function(acc, enhancement) {
172
+ return enhancement.call(_this5, acc, WrapperComponent, false);
173
+ }, contextProps);
174
+ }
175
+ }, {
176
+ key: "render",
177
+ value: function render() {
178
+ var _this6 = this;
179
+ this[CORE_AS_PROPS] = null;
180
+ if (!_superPropGet(Component3, "render", this, 1)) {
181
+ throw new Error("Component `render` method is not defined");
182
+ }
183
+ var asProps = this.asProps;
184
+ var ctx = this.setContext();
185
+ var render2 = renders.reduce(function(acc, enhancement) {
186
+ return enhancement.call(_this6, acc, asProps, WrapperComponent, false);
187
+ }, _superPropGet(Component3, "render", this, 3)([]));
188
+ if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
189
+ return /* @__PURE__ */ React.createElement(Context.Provider, {
190
+ value: _objectSpread(_objectSpread({}, asProps), ctx)
191
+ }, render2);
192
+ } else {
193
+ return render2;
194
+ }
195
+ }
196
+ }]);
197
+ })(OriginComponent);
198
+ var WrapperComponent = createForwardWrapper(Component2, wrapperProps, statics, false);
199
+ return WrapperComponent;
200
+ }
201
+ function wrapFunction(OriginComponent, enhancements, Context) {
202
+ var getField = createGetField(enhancements, OriginComponent, true);
203
+ var inits = getField("init");
204
+ var props = getField("asProps");
205
+ var renders = getField("render");
206
+ var statics = getField("static");
207
+ var wrapperProps = getField("wrapperProps");
208
+ var contexts = getField("context");
209
+ var Component2 = /* @__PURE__ */ React.memo(function FunctionMemoComponent(other) {
210
+ var selfRef = React.useRef({});
211
+ var firstRender = React.useRef(true);
212
+ useEnhancedEffect(function() {
213
+ firstRender.current = false;
214
+ }, []);
215
+ if (firstRender.current) {
216
+ inits.forEach(function(enhancement) {
217
+ return enhancement.call(selfRef.current, other, WrapperComponent, true);
218
+ });
219
+ }
220
+ var asProps = props.reduce(function(acc, enhancement) {
221
+ return enhancement.call(selfRef.current, acc, WrapperComponent, true);
222
+ }, other);
223
+ var ctx = contexts.reduce(function(acc, enhancement) {
224
+ return enhancement.call(selfRef.current, acc, WrapperComponent, true);
225
+ }, {});
226
+ var render = renders.reduce(function(acc, enhancement) {
227
+ return enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true);
228
+ }, /* @__PURE__ */ React.createElement(OriginComponent, asProps));
229
+ if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
230
+ return /* @__PURE__ */ React.createElement(Context.Provider, {
231
+ value: _objectSpread(_objectSpread({}, asProps), ctx)
232
+ }, render);
233
+ } else {
234
+ return render;
235
+ }
236
+ });
237
+ Object.assign(Component2, OriginComponent);
238
+ var WrapperComponent = createForwardWrapper(Component2, wrapperProps, statics, true);
239
+ return WrapperComponent;
240
+ }
241
+ function wrapCore(OriginComponent, enhancements, Context) {
242
+ var Component2 = function Component3(_ref5) {
243
+ var Root = _ref5.Root;
244
+ var defaultProps = OriginComponent.defaultProps || {};
245
+ return /* @__PURE__ */ React.createElement(Root, _extends({}, defaultProps, {
246
+ render: OriginComponent
247
+ }));
248
+ };
249
+ hoistNonReactStatics(Component2, OriginComponent);
250
+ Component2.displayName = OriginComponent.displayName;
251
+ return wrapFunction(Component2, enhancements, Context);
252
+ }
253
+ function createComposeComponent(OriginComponent, Context, enhancements) {
254
+ if (React.PureComponent.isPrototypeOf(OriginComponent) || React.Component.isPrototypeOf(OriginComponent)) {
255
+ if (OriginComponent.prototype instanceof Component) {
256
+ return wrapClass(OriginComponent, enhancements, Context);
257
+ } else {
258
+ throw new Error("Must inherit from our component");
259
+ }
260
+ } else if (typeof OriginComponent === "function") {
261
+ return wrapFunction(OriginComponent, enhancements, Context);
262
+ } else if (OriginComponent[CORE_COMPONENT]) {
263
+ return wrapCore(OriginComponent, enhancements, Context);
264
+ } else {
265
+ throw new Error("Must be a React component");
266
+ }
267
+ }
268
+ function assignProps(p1, p2) {
269
+ return assignProps$1(p2, p1);
270
+ }
271
+ function createComponent(OriginComponent) {
272
+ var childComponents = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
273
+ var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
274
+ var _options$context = options.context, context = _options$context === void 0 ? /* @__PURE__ */ React.createContext({}) : _options$context, _options$parent = options.parent, parent = _options$parent === void 0 ? [] : _options$parent, _options$enhancements = options.enhancements, enhancements = _options$enhancements === void 0 ? [] : _options$enhancements;
275
+ var parents = Array.isArray(parent) ? parent : [parent];
276
+ if (parents.length) {
277
+ var wholeFamily = parents.reduce(function(acc, parent2) {
278
+ if (parent2[PARENT_COMPONENTS]) {
279
+ acc = [].concat(_toConsumableArray(parent2[PARENT_COMPONENTS]), _toConsumableArray(acc));
280
+ }
281
+ return acc;
282
+ }, parents);
283
+ OriginComponent[PARENT_COMPONENTS] = wholeFamily;
284
+ parents = wholeFamily;
285
+ }
286
+ if (OriginComponent[CORE_COMPONENT]) {
287
+ parents.push(OriginComponent);
288
+ }
289
+ var Component2 = createComposeComponent(OriginComponent, context, [].concat(_toConsumableArray(enhancements.map(function(f) {
290
+ return f(context, parents, createComponent, childComponents);
291
+ })), [
292
+ i18nAppLocaleEnhance(),
293
+ Enhancement(context, parents),
294
+ // root must be under the children
295
+ Enhancement$1(),
296
+ Enhancement$2(),
297
+ Enhancement$3(childComponents, createComponent, {
298
+ context,
299
+ parent,
300
+ enhancements
301
+ }),
302
+ // functionDefaultProps must be under the staticChild
303
+ Enhancement$4(),
304
+ // inheritedName must be under the staticChild
305
+ Enhancement$5(),
306
+ // dataName must be under the staticChild
307
+ Enhancement$6(),
308
+ // enhanceEnhancement must be under the functionDefaultPropsEnhancement
309
+ Enhancement$7(),
310
+ Enhancement$8(childComponents, context)
311
+ ]));
312
+ Component2[CONTEXT_COMPONENT] = context;
313
+ Component2._______childrenComponents = childComponents;
314
+ Component2[CREATE_COMPONENT] = function() {
315
+ var _OriginComponent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : OriginComponent;
316
+ var _childComponents = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : childComponents;
317
+ var _options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : options;
318
+ return createComponent(_OriginComponent, _childComponents, _options);
319
+ };
320
+ Component2.newInstance = function() {
321
+ var _OriginComponent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : OriginComponent;
322
+ var _childComponents = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : childComponents;
323
+ var _options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : options;
324
+ return createComponent(_OriginComponent, _childComponents, _options);
325
+ };
326
+ Component2[CORE_COMPONENT] = true;
327
+ return Component2;
328
+ }
329
+ function createBaseComponent(OriginComponent) {
330
+ var _OriginComponent$disp;
331
+ var Component2 = /* @__PURE__ */ React.forwardRef(OriginComponent);
332
+ Component2.displayName = (_OriginComponent$disp = OriginComponent.displayName) !== null && _OriginComponent$disp !== void 0 ? _OriginComponent$disp : "";
333
+ Component2.defaultProps = {
334
+ "data-ui-name": OriginComponent.displayName
335
+ };
336
+ Component2[CORE_COMPONENT] = true;
337
+ return Component2;
338
+ }
339
+ export {
340
+ assignProps,
341
+ createBaseComponent,
342
+ createComponent
343
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coreFactory.mjs","names":["hoistNonReactStatics","React","Component","CONTEXT_COMPONENT","CORE_AS_PROPS","CORE_COMPONENT","CORE_INIT","CORE_INSTANCE","CREATE_COMPONENT","PARENT_COMPONENTS","childrenEnhancement","dataNameEnhancement","enhanceEnhancement","functionDefaultPropsEnhancement","i18nAppLocaleEnhance","inheritedNameEnhancement","rootEnhancement","staticChildrenEnhancement","getterMethodNameByDisplayName","ROOT_COMPONENT","STATIC_COMPONENT","styleEnhancement","uncontrolledPropsEnhancement","_assignProps","useForkRef","useEnhancedEffect","isEmptyObject","obj","Object","getOwnPropertyNames","length","getOwnPropertySymbols","getPrototypeOf","prototype","createGetField","enhancements","isFunction","getField","key","filter","enhancement","condition","reduce","acc","item","push","createForwardWrapper","wrapperProps","statics","RootComponent","getterMethodName","displayName","getterMethod","undefined","useGetterIndex","WrapperForwardRefWithBind","_ref","ref","_ref$forwardRef","forwardRef","other","_objectWithoutProperties","_excluded","createElement","BindingWrapper","_extends","WrapperForwardRef","_ref2","_ref2$forwardRef","__WRAPPER_PROPS_BIND__","_excluded2","_reduce","WrapperComponent","_reduce$ref","enhancementRef","props","_excluded3","_React$Component","_this","_classCallCheck","_len","arguments","args","Array","_key","_callSuper","concat","_defineProperty","_inherits","_createClass","value","render","_this2","map","fn","bind","defaultProps","forEach","assign","wrapClass","OriginComponent","Context","inits","renders","contexts","_OriginComponent2","context","_this3","call","get","_this4","Error","prefixesMap","Map","entries","_ref3","_ref4","_slicedToArray","_key$split","split","_key$split2","prefix","propertyKey","_prefixesMap$get","set","_iterator","_createForOfIteratorHelper","_step","s","n","done","_step$value","defineProperty","err","e","f","setContext","_this5","contextProps","_superPropGet","_this6","asProps","ctx","Provider","_objectSpread","wrapFunction","memo","FunctionMemoComponent","selfRef","useRef","firstRender","current","wrapCore","_ref5","Root","createComposeComponent","PureComponent","isPrototypeOf","assignProps","p1","p2","createComponent","childComponents","options","_options$context","createContext","_options$parent","parent","_options$enhancements","parents","isArray","wholeFamily","_toConsumableArray","_______childrenComponents","_OriginComponent","_childComponents","_options","newInstance","createBaseComponent","_OriginComponent$disp"],"sources":["../src/coreFactory.tsx"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport React from 'react';\n\nimport { type Intergalactic, Component } from './core-types/Component';\nimport {\n CONTEXT_COMPONENT,\n CORE_AS_PROPS,\n CORE_COMPONENT,\n CORE_INIT,\n CORE_INSTANCE,\n CREATE_COMPONENT,\n PARENT_COMPONENTS,\n} from './core-types/symbols';\nimport childrenEnhancement from './enhancement/Children';\nimport dataNameEnhancement from './enhancement/dataName';\nimport enhanceEnhancement from './enhancement/enhance';\nimport functionDefaultPropsEnhancement from './enhancement/functionDefaultProps';\nimport i18nAppLocaleEnhance from './enhancement/i18n';\nimport inheritedNameEnhancement from './enhancement/inheritedName';\nimport rootEnhancement from './enhancement/Root';\nimport staticChildrenEnhancement, {\n getterMethodNameByDisplayName,\n ROOT_COMPONENT,\n STATIC_COMPONENT,\n} from './enhancement/staticChildren';\nimport styleEnhancement from './enhancement/style';\nimport uncontrolledPropsEnhancement from './enhancement/uncontrolledProps';\nimport _assignProps from './utils/assignProps';\nimport { useForkRef } from './utils/ref';\nimport useEnhancedEffect from './utils/use/useEnhancedEffect';\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((acc: any, enhancement: any) => {\n return enhancement.call(this, acc, WrapperComponent, false);\n }, this.props);\n\n if (this[CORE_AS_PROPS] !== null) {\n const prefixesMap = new Map<string, Record<string, unknown>>();\n Object.entries(this[CORE_AS_PROPS]).forEach(([key, value]) => {\n const [prefix, propertyKey] = key.split(':');\n if (prefix !== 'use' && propertyKey) {\n const obj = prefixesMap.get(prefix) ?? {};\n obj[propertyKey] = value;\n\n prefixesMap.set(prefix, obj);\n }\n });\n\n for (const [key, value] of prefixesMap.entries()) {\n Object.defineProperty(this[CORE_AS_PROPS], `${key}Props`, { value });\n }\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 function assignProps(p1: any, p2: any) {\n return _assignProps(p2, p1);\n}\n\nfunction createComponent<T extends Intergalactic.InternalTypings.ComponentTag = 'div', ComponentProps = {}, ContextType = {}, E extends Readonly<any[]> = never[]>(\n OriginComponent: any,\n childComponents: any = {},\n options: {\n context?: React.Context<ContextType>;\n parent?: Intergalactic.Component<any, any, any, any> | Intergalactic.Component<any, any, any, any>[];\n enhancements?: [any];\n } = {},\n): Intergalactic.Component<T, ComponentProps, ContextType, E> {\n const {\n context = React.createContext<ContextType>({} as ContextType),\n parent = [],\n enhancements = [],\n } = options;\n let parents: any[] = 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 // @ts-ignore\n OriginComponent[PARENT_COMPONENTS] = wholeFamily;\n parents = wholeFamily;\n }\n // @ts-ignore\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 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 ]);\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.newInstance = 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<T extends keyof React.JSX.IntrinsicElements, P>(OriginComponent: React.ForwardRefRenderFunction<React.ElementRef<T>, P>) {\n const Component = React.forwardRef<React.ElementRef<T>, P>(OriginComponent) as unknown as Intergalactic.Component<T, P>;\n Component.displayName = OriginComponent.displayName ?? '';\n // @ts-ignore\n Component.defaultProps = {\n 'data-ui-name': OriginComponent.displayName,\n };\n Component[CORE_COMPONENT] = true;\n\n return Component;\n}\n\nexport { createComponent, createBaseComponent };\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAOA,oBAAoB,MAAM,yBAAyB;AAC1D,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAA6BC,SAAS,QAAQ,4BAAwB;AACtE,SACEC,iBAAiB,EACjBC,aAAa,EACbC,cAAc,EACdC,SAAS,EACTC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,QACZ,0BAAsB;AAC7B,OAAOC,mBAAmB,MAAM,4BAAwB;AACxD,OAAOC,mBAAmB,MAAM,4BAAwB;AACxD,OAAOC,kBAAkB,MAAM,2BAAuB;AACtD,OAAOC,+BAA+B,MAAM,wCAAoC;AAChF,OAAOC,oBAAoB,MAAM,wBAAoB;AACrD,OAAOC,wBAAwB,MAAM,iCAA6B;AAClE,OAAOC,eAAe,MAAM,wBAAoB;AAChD,OAAOC,yBAAyB,IAC9BC,6BAA6B,EAC7BC,cAAc,EACdC,gBAAgB,QACX,kCAA8B;AACrC,OAAOC,gBAAgB,MAAM,yB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,CAAAnD,MAAA,QAAAmD,SAAA,QAAA5B,SAAA,GAAA4B,SAAA,MAAGiF,eAAe;IAAA,IAClCc,QAAQ,GAAA/F,SAAA,CAAAnD,MAAA,QAAAmD,SAAA,QAAA5B,SAAA,GAAA4B,SAAA,MAAGkF,OAAO;IAExB,OAAOF,eAAe,CAACa,gBAAgB,EAAEC,gBAAgB,EAAEC,QAAQ,CAAC;EACtE,CAAC;EACD9K,SAAS,CAACG,cAAc,CAAC,GAAG,IAAI;EAChC,OAAOH,SAAS;AAClB;AAEA,SAASgL,mBAAmBA,CAAiD9E,eAAuE,EAAE;EAAA,IAAA+E,qBAAA;EACpJ,IAAMjL,SAAS,gBAAGD,KAAK,CAAC0D,UAAU,CAAyByC,eAAe,CAA6C;EACvHlG,SAAS,CAACiD,WAAW,IAAAgI,qBAAA,GAAG/E,eAAe,CAACjD,WAAW,cAAAgI,qBAAA,cAAAA,qBAAA,GAAI,EAAE;EACzD;EACAjL,SAAS,CAAC8F,YAAY,GAAG;IACvB,cAAc,EAAEI,eAAe,CAACjD;EAClC,CAAC;EACDjD,SAAS,CAACG,cAAc,CAAC,GAAG,IAAI;EAEhC,OAAOH,SAAS;AAClB;AAEA,SAAS+J,eAAe,EAAEiB,mBAAmB","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ type WatchedProps<Props> = {
2
+ [key in keyof Props]?: unknown;
3
+ };
4
+ type Constructor<Props> = new (...args: any[]) => {
5
+ props: Props;
6
+ onPropsChange(changedProps: WatchedProps<Props>): void;
7
+ render(): React.ReactNode;
8
+ componentWillUnmount?(): void;
9
+ };
10
+ declare function propsObserver<P extends Record<string, any>, C extends Constructor<P>>(propsToWatch: Array<keyof P>): (Class: C) => C & Constructor<P>;
11
+ export default propsObserver;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
+ var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
14
+ var _superPropGet3 = _interopRequireDefault(require("@babel/runtime/helpers/superPropGet"));
15
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
+ function propsObserver(propsToWatch) {
18
+ return function (Class) {
19
+ return /*#__PURE__*/function (_Class2) {
20
+ function _class() {
21
+ var _this;
22
+ (0, _classCallCheck2["default"])(this, _class);
23
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24
+ args[_key] = arguments[_key];
25
+ }
26
+ _this = (0, _callSuper2["default"])(this, _class, [].concat(args));
27
+ (0, _defineProperty2["default"])(_this, "__observableProps", {});
28
+ if (!_this.props) return (0, _possibleConstructorReturn2["default"])(_this);
29
+ var observablePropKeys = propsToWatch.length === 0 ? Object.keys(_this.props) : (0, _toConsumableArray2["default"])(propsToWatch);
30
+ observablePropKeys.forEach(function (key) {
31
+ _this.__observableProps[key] = _this.props[key];
32
+ });
33
+ return _this;
34
+ }
35
+ (0, _inherits2["default"])(_class, _Class2);
36
+ return (0, _createClass2["default"])(_class, [{
37
+ key: "onPropsChange",
38
+ value: function onPropsChange(_) {
39
+ var _this2 = this;
40
+ var shouldEmitChanges = false;
41
+ var changedProps = {};
42
+ Object.entries(this.__observableProps).forEach(function (_ref) {
43
+ var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
44
+ key = _ref2[0],
45
+ value = _ref2[1];
46
+ var arePropsEqual = Object.is(value, _this2.props[key]);
47
+ if (!arePropsEqual) {
48
+ _this2.__observableProps[key] = _this2.props[key];
49
+ changedProps[key] = _this2.props[key];
50
+ shouldEmitChanges = true;
51
+ }
52
+ });
53
+ if (!shouldEmitChanges) return;
54
+ (0, _superPropGet3["default"])(_class, "onPropsChange", this, 3)([changedProps]);
55
+ }
56
+ }, {
57
+ key: "componentWillUnmount",
58
+ value: function componentWillUnmount() {
59
+ var _superPropGet2,
60
+ _this3 = this;
61
+ (_superPropGet2 = (0, _superPropGet3["default"])(_class, "componentWillUnmount", this, 3)) === null || _superPropGet2 === void 0 || _superPropGet2([]);
62
+ Object.keys(this.__observableProps).forEach(function (key) {
63
+ _this3.__observableProps[key] = undefined;
64
+ });
65
+ }
66
+ }, {
67
+ key: "render",
68
+ value: function render() {
69
+ this.onPropsChange();
70
+ return (0, _superPropGet3["default"])(_class, "render", this, 3)([]);
71
+ }
72
+ }]);
73
+ }(Class);
74
+ };
75
+ }
76
+ var _default = exports["default"] = propsObserver;
77
+ //# sourceMappingURL=propsObserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propsObserver.js","names":["propsObserver","propsToWatch","Class","_Class2","_class","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","props","_possibleConstructorReturn2","observablePropKeys","Object","keys","_toConsumableArray2","forEach","key","__observableProps","_inherits2","_createClass2","value","onPropsChange","_","_this2","shouldEmitChanges","changedProps","entries","_ref","_ref2","_slicedToArray2","arePropsEqual","is","_superPropGet3","componentWillUnmount","_superPropGet2","_this3","undefined","render","_default","exports"],"sources":["../../src/decorators/propsObserver.ts"],"sourcesContent":["type WatchedProps<Props> = { [key in keyof Props]?: unknown };\n\ntype Constructor<Props> = new (...args: any[]) => {\n props: Props;\n onPropsChange(changedProps: WatchedProps<Props>): void;\n render(): React.ReactNode;\n componentWillUnmount?(): void;\n};\n\nfunction propsObserver<\n P extends Record<string, any>,\n C extends Constructor<P>,\n>(propsToWatch: Array<keyof P>) {\n return function (Class: C): C & Constructor<P> {\n return class extends Class {\n __observableProps: WatchedProps<P> = {};\n\n constructor(...args: any[]) {\n super(...args);\n\n if (!this.props) return;\n\n const observablePropKeys = propsToWatch.length === 0 ? Object.keys(this.props) : [...propsToWatch];\n\n observablePropKeys.forEach((key) => {\n this.__observableProps[key] = this.props[key];\n });\n }\n\n onPropsChange(_?: WatchedProps<P>) {\n let shouldEmitChanges = false;\n const changedProps: WatchedProps<P> = {};\n\n Object.entries(this.__observableProps).forEach(([key, value]: [key: keyof P, value: unknown]) => {\n const arePropsEqual = Object.is(value, this.props[key]);\n\n if (!arePropsEqual) {\n this.__observableProps[key] = this.props[key];\n changedProps[key] = this.props[key];\n\n shouldEmitChanges = true;\n }\n });\n\n if (!shouldEmitChanges) return;\n\n super.onPropsChange(changedProps);\n }\n\n componentWillUnmount() {\n super.componentWillUnmount?.();\n\n Object.keys(this.__observableProps).forEach((key: keyof P) => {\n this.__observableProps[key] = undefined;\n });\n }\n\n render() {\n this.onPropsChange();\n\n return super.render();\n }\n };\n };\n}\n\nexport default propsObserver;\n"],"mappings":";;;;;;;;;;;;;;;;AASA,SAASA,aAAaA,CAGpBC,YAA4B,EAAE;EAC9B,OAAO,UAAUC,KAAQ,EAAsB;IAC7C,8BAAAC,OAAA;MAGE,SAAAC,OAAA,EAA4B;QAAA,IAAAC,KAAA;QAAA,IAAAC,gBAAA,mBAAAF,MAAA;QAAA,SAAAG,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAbC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;UAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;QAAA;QACjBP,KAAA,OAAAQ,WAAA,mBAAAT,MAAA,KAAAU,MAAA,CAASJ,IAAI;QAAE,IAAAK,gBAAA,aAAAV,KA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AAC;UAEF,IAAI,CAACA,iBAAiB,EAAE;UAExB,IAAAQ,cAAA,aAAAnC,MAAA,6BAAoB4B,YAAY;QAClC;MAAC;QAAAT,GAAA;QAAAI,KAAA,EAED,SAAAa,oBAAoBA,CAAA,EAAG;UAAA,IAAAC,cAAA;YAAAC,MAAA;UACrB,CAAAD,cAAA,OAAAF,cAAA,aAAAnC,MAAA,gDAAAqC,cAAA,eAAAA,cAAA;UAEAtB,MAAM,CAACC,IAAI,CAAC,IAAI,CAACI,iBAAiB,CAAC,CAACF,OAAO,CAAC,UAACC,GAAY,EAAK;YAC5DmB,MAAI,CAAClB,iBAAiB,CAACD,GAAG,CAAC,GAAGoB,SAAS;UACzC,CAAC,CAAC;QACJ;MAAC;QAAApB,GAAA;QAAAI,KAAA,EAED,SAAAiB,MAAMA,CAAA,EAAG;UACP,IAAI,CAAChB,aAAa,CAAC,CAAC;UAEpB,WAAAW,cAAA,aAAAnC,MAAA;QACF;MAAC;IAAA,EA/CkBF,KAAK;EAiD5B,CAAC;AACH;AAAC,IAAA2C,QAAA,GAAAC,OAAA,cAEc9C,aAAa","ignoreList":[]}
@@ -0,0 +1,70 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
6
+ import _callSuper from "@babel/runtime/helpers/esm/callSuper";
7
+ import _superPropGet from "@babel/runtime/helpers/esm/superPropGet";
8
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
9
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
+ function propsObserver(propsToWatch) {
11
+ return function (Class) {
12
+ return /*#__PURE__*/function (_Class2) {
13
+ function _class() {
14
+ var _this;
15
+ _classCallCheck(this, _class);
16
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
17
+ args[_key] = arguments[_key];
18
+ }
19
+ _this = _callSuper(this, _class, [].concat(args));
20
+ _defineProperty(_this, "__observableProps", {});
21
+ if (!_this.props) return _possibleConstructorReturn(_this);
22
+ var observablePropKeys = propsToWatch.length === 0 ? Object.keys(_this.props) : _toConsumableArray(propsToWatch);
23
+ observablePropKeys.forEach(function (key) {
24
+ _this.__observableProps[key] = _this.props[key];
25
+ });
26
+ return _this;
27
+ }
28
+ _inherits(_class, _Class2);
29
+ return _createClass(_class, [{
30
+ key: "onPropsChange",
31
+ value: function onPropsChange(_) {
32
+ var _this2 = this;
33
+ var shouldEmitChanges = false;
34
+ var changedProps = {};
35
+ Object.entries(this.__observableProps).forEach(function (_ref) {
36
+ var _ref2 = _slicedToArray(_ref, 2),
37
+ key = _ref2[0],
38
+ value = _ref2[1];
39
+ var arePropsEqual = Object.is(value, _this2.props[key]);
40
+ if (!arePropsEqual) {
41
+ _this2.__observableProps[key] = _this2.props[key];
42
+ changedProps[key] = _this2.props[key];
43
+ shouldEmitChanges = true;
44
+ }
45
+ });
46
+ if (!shouldEmitChanges) return;
47
+ _superPropGet(_class, "onPropsChange", this, 3)([changedProps]);
48
+ }
49
+ }, {
50
+ key: "componentWillUnmount",
51
+ value: function componentWillUnmount() {
52
+ var _superPropGet2,
53
+ _this3 = this;
54
+ (_superPropGet2 = _superPropGet(_class, "componentWillUnmount", this, 3)) === null || _superPropGet2 === void 0 || _superPropGet2([]);
55
+ Object.keys(this.__observableProps).forEach(function (key) {
56
+ _this3.__observableProps[key] = undefined;
57
+ });
58
+ }
59
+ }, {
60
+ key: "render",
61
+ value: function render() {
62
+ this.onPropsChange();
63
+ return _superPropGet(_class, "render", this, 3)([]);
64
+ }
65
+ }]);
66
+ }(Class);
67
+ };
68
+ }
69
+ export default propsObserver;
70
+ //# sourceMappingURL=propsObserver.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propsObserver.mjs","names":["propsObserver","propsToWatch","Class","_Class2","_class","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","props","_possibleConstructorReturn","observablePropKeys","Object","keys","_toConsumableArray","forEach","key","__observableProps","_inherits","_createClass","value","onPropsChange","_","_this2","shouldEmitChanges","changedProps","entries","_ref","_ref2","_slicedToArray","arePropsEqual","is","_superPropGet","componentWillUnmount","_superPropGet2","_this3","undefined","render"],"sources":["../../src/decorators/propsObserver.ts"],"sourcesContent":["type WatchedProps<Props> = { [key in keyof Props]?: unknown };\n\ntype Constructor<Props> = new (...args: any[]) => {\n props: Props;\n onPropsChange(changedProps: WatchedProps<Props>): void;\n render(): React.ReactNode;\n componentWillUnmount?(): void;\n};\n\nfunction propsObserver<\n P extends Record<string, any>,\n C extends Constructor<P>,\n>(propsToWatch: Array<keyof P>) {\n return function (Class: C): C & Constructor<P> {\n return class extends Class {\n __observableProps: WatchedProps<P> = {};\n\n constructor(...args: any[]) {\n super(...args);\n\n if (!this.props) return;\n\n const observablePropKeys = propsToWatch.length === 0 ? Object.keys(this.props) : [...propsToWatch];\n\n observablePropKeys.forEach((key) => {\n this.__observableProps[key] = this.props[key];\n });\n }\n\n onPropsChange(_?: WatchedProps<P>) {\n let shouldEmitChanges = false;\n const changedProps: WatchedProps<P> = {};\n\n Object.entries(this.__observableProps).forEach(([key, value]: [key: keyof P, value: unknown]) => {\n const arePropsEqual = Object.is(value, this.props[key]);\n\n if (!arePropsEqual) {\n this.__observableProps[key] = this.props[key];\n changedProps[key] = this.props[key];\n\n shouldEmitChanges = true;\n }\n });\n\n if (!shouldEmitChanges) return;\n\n super.onPropsChange(changedProps);\n }\n\n componentWillUnmount() {\n super.componentWillUnmount?.();\n\n Object.keys(this.__observableProps).forEach((key: keyof P) => {\n this.__observableProps[key] = undefined;\n });\n }\n\n render() {\n this.onPropsChange();\n\n return super.render();\n }\n };\n };\n}\n\nexport default propsObserver;\n"],"mappings":";;;;;;;;;AASA,SAASA,aAAaA,CA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AAC,cAAA,CAAAF,IAAA;cAAhDX,GAAG,GAAAY,KAAA;cAAER,KAAK,GAAAQ,KAAA;YACzD,IAAME,aAAa,GAAGlB,MAAM,CAACmB,EAAE,CAACX,KAAK,EAAEG,MAAI,CAACd,KAAK,CAACO,GAAG,CAAC,CAAC;YAEvD,IAAI,CAACc,aAAa,EAAE;cAClBP,MAAI,CAACN,iBAAiB,CAACD,GAAG,CAAC,GAAGO,MAAI,CAACd,KAAK,CAACO,GAAG,CAAC;cAC7CS,YAAY,CAACT,GAAG,CAAC,GAAGO,MAAI,CAACd,KAAK,CAACO,GAAG,CAAC;cAEnCQ,iBAAiB,GAAG,IAAI;YAC1B;UACF,CAAC,CAAC;UAEF,IAAI,CAACA,iBAAiB,EAAE;UAExBQ,aAAA,CAAAnC,MAAA,6BAAoB4B,YAAY;QAClC;MAAC;QAAAT,GAAA;QAAAI,KAAA,EAED,SAAAa,oBAAoBA,CAAA,EAAG;UAAA,IAAAC,cAAA;YAAAC,MAAA;UACrB,CAAAD,cAAA,GAAAF,aAAA,CAAAnC,MAAA,gDAAAqC,cAAA,eAAAA,cAAA;UAEAtB,MAAM,CAACC,IAAI,CAAC,IAAI,CAACI,iBAAiB,CAAC,CAACF,OAAO,CAAC,UAACC,GAAY,EAAK;YAC5DmB,MAAI,CAAClB,iBAAiB,CAACD,GAAG,CAAC,GAAGoB,SAAS;UACzC,CAAC,CAAC;QACJ;MAAC;QAAApB,GAAA;QAAAI,KAAA,EAED,SAAAiB,MAAMA,CAAA,EAAG;UACP,IAAI,CAAChB,aAAa,CAAC,CAAC;UAEpB,OAAAW,aAAA,CAAAnC,MAAA;QACF;MAAC;IAAA,EA/CkBF,KAAK;EAiD5B,CAAC;AACH;AAEA,eAAeF,aAAa","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ type Primitive = string | number | boolean | symbol | bigint | null | undefined;
2
+ type IsReadonly<This, Property extends keyof This> = (<F>() => F extends {
3
+ [P in Property]: This[Property];
4
+ } ? 1 : 2) extends (<F>() => F extends {
5
+ -readonly [P in Property]: This[Property];
6
+ } ? 1 : 2) ? false : true;
7
+ type Callback<This> = (this: This, field: string | symbol, newValue: unknown) => void;
8
+ type ReturnType<This, Property extends keyof This = keyof This> = IsReadonly<This, Property> extends true ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void : This[Property] extends Primitive ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void : never;
9
+ declare function reactive<This, Property extends keyof This, Value = This[Property]>(cb: Value extends Primitive ? Callback<This> : never): ReturnType<This>;
10
+ declare function reactive<This, Property extends keyof This, Value = This[Property]>(watchedFields: Value extends Primitive ? never : Array<keyof Value>, cb: Callback<This>): ReturnType<This>;
11
+ export default reactive;