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

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/cjs/index.js +23 -0
  2. package/lib/cjs/index.js.map +1 -0
  3. package/lib/es6/index.js +4 -0
  4. package/lib/es6/index.js.map +1 -0
  5. package/lib/esm/index.mjs +4 -22
  6. package/lib/types/index.d.ts +3 -0
  7. package/package.json +2 -2
  8. package/lib/LastInteractionType.d.ts +0 -11
  9. package/lib/LastInteractionType.js +0 -55
  10. package/lib/LastInteractionType.js.map +0 -1
  11. package/lib/LastInteractionType.mjs +0 -50
  12. package/lib/LastInteractionType.mjs.map +0 -1
  13. package/lib/core-types/Component.d.ts +0 -142
  14. package/lib/core-types/Component.js +0 -53
  15. package/lib/core-types/Component.js.map +0 -1
  16. package/lib/core-types/Component.mjs +0 -47
  17. package/lib/core-types/Component.mjs.map +0 -1
  18. package/lib/core-types/UnknownProperties.d.ts +0 -3
  19. package/lib/core-types/UnknownProperties.js +0 -2
  20. package/lib/core-types/UnknownProperties.js.map +0 -1
  21. package/lib/core-types/UnknownProperties.mjs +0 -2
  22. package/lib/core-types/UnknownProperties.mjs.map +0 -1
  23. package/lib/core-types/reshadow.d.js +0 -2
  24. package/lib/core-types/reshadow.d.js.map +0 -1
  25. package/lib/core-types/reshadow.d.mjs +0 -2
  26. package/lib/core-types/reshadow.d.mjs.map +0 -1
  27. package/lib/core-types/symbols.d.ts +0 -9
  28. package/lib/core-types/symbols.js +0 -16
  29. package/lib/core-types/symbols.js.map +0 -1
  30. package/lib/core-types/symbols.mjs +0 -20
  31. package/lib/core-types/symbols.mjs.map +0 -1
  32. package/lib/coreFactory.d.ts +0 -10
  33. package/lib/coreFactory.js +0 -384
  34. package/lib/coreFactory.js.map +0 -1
  35. package/lib/coreFactory.mjs +0 -343
  36. package/lib/coreFactory.mjs.map +0 -1
  37. package/lib/decorators/propsObserver.d.ts +0 -11
  38. package/lib/decorators/propsObserver.js +0 -77
  39. package/lib/decorators/propsObserver.js.map +0 -1
  40. package/lib/decorators/propsObserver.mjs +0 -70
  41. package/lib/decorators/propsObserver.mjs.map +0 -1
  42. package/lib/decorators/reactive.d.ts +0 -11
  43. package/lib/decorators/reactive.js +0 -51
  44. package/lib/decorators/reactive.js.map +0 -1
  45. package/lib/decorators/reactive.mjs +0 -45
  46. package/lib/decorators/reactive.mjs.map +0 -1
  47. package/lib/enhancement/Children.d.ts +0 -5
  48. package/lib/enhancement/Children.js +0 -118
  49. package/lib/enhancement/Children.js.map +0 -1
  50. package/lib/enhancement/Children.mjs +0 -96
  51. package/lib/enhancement/Children.mjs.map +0 -1
  52. package/lib/enhancement/Root.d.ts +0 -6
  53. package/lib/enhancement/Root.js +0 -77
  54. package/lib/enhancement/Root.js.map +0 -1
  55. package/lib/enhancement/Root.mjs +0 -56
  56. package/lib/enhancement/Root.mjs.map +0 -1
  57. package/lib/enhancement/dataName.d.ts +0 -4
  58. package/lib/enhancement/dataName.js +0 -19
  59. package/lib/enhancement/dataName.js.map +0 -1
  60. package/lib/enhancement/dataName.mjs +0 -13
  61. package/lib/enhancement/dataName.mjs.map +0 -1
  62. package/lib/enhancement/enhance.d.ts +0 -5
  63. package/lib/enhancement/enhance.js +0 -21
  64. package/lib/enhancement/enhance.js.map +0 -1
  65. package/lib/enhancement/enhance.mjs +0 -16
  66. package/lib/enhancement/enhance.mjs.map +0 -1
  67. package/lib/enhancement/functionDefaultProps.d.ts +0 -8
  68. package/lib/enhancement/functionDefaultProps.js +0 -35
  69. package/lib/enhancement/functionDefaultProps.js.map +0 -1
  70. package/lib/enhancement/functionDefaultProps.mjs +0 -29
  71. package/lib/enhancement/functionDefaultProps.mjs.map +0 -1
  72. package/lib/enhancement/i18n.d.ts +0 -4
  73. package/lib/enhancement/i18n.js +0 -27
  74. package/lib/enhancement/i18n.js.map +0 -1
  75. package/lib/enhancement/i18n.mjs +0 -20
  76. package/lib/enhancement/i18n.mjs.map +0 -1
  77. package/lib/enhancement/inheritedName.d.ts +0 -8
  78. package/lib/enhancement/inheritedName.js +0 -22
  79. package/lib/enhancement/inheritedName.js.map +0 -1
  80. package/lib/enhancement/inheritedName.mjs +0 -16
  81. package/lib/enhancement/inheritedName.mjs.map +0 -1
  82. package/lib/enhancement/staticChildren.d.ts +0 -13
  83. package/lib/enhancement/staticChildren.js +0 -132
  84. package/lib/enhancement/staticChildren.js.map +0 -1
  85. package/lib/enhancement/staticChildren.mjs +0 -120
  86. package/lib/enhancement/staticChildren.mjs.map +0 -1
  87. package/lib/enhancement/style.d.ts +0 -9
  88. package/lib/enhancement/style.js +0 -58
  89. package/lib/enhancement/style.js.map +0 -1
  90. package/lib/enhancement/style.mjs +0 -49
  91. package/lib/enhancement/style.mjs.map +0 -1
  92. package/lib/enhancement/uncontrolledProps.d.ts +0 -7
  93. package/lib/enhancement/uncontrolledProps.js +0 -131
  94. package/lib/enhancement/uncontrolledProps.js.map +0 -1
  95. package/lib/enhancement/uncontrolledProps.mjs +0 -107
  96. package/lib/enhancement/uncontrolledProps.mjs.map +0 -1
  97. package/lib/esm/LastInteractionType.mjs +0 -50
  98. package/lib/esm/core-types/Component.mjs +0 -47
  99. package/lib/esm/core-types/symbols.mjs +0 -20
  100. package/lib/esm/coreFactory.mjs +0 -343
  101. package/lib/esm/enhancement/Children.mjs +0 -96
  102. package/lib/esm/enhancement/Root.mjs +0 -56
  103. package/lib/esm/enhancement/dataName.mjs +0 -13
  104. package/lib/esm/enhancement/enhance.mjs +0 -16
  105. package/lib/esm/enhancement/functionDefaultProps.mjs +0 -29
  106. package/lib/esm/enhancement/i18n.mjs +0 -20
  107. package/lib/esm/enhancement/inheritedName.mjs +0 -16
  108. package/lib/esm/enhancement/staticChildren.mjs +0 -120
  109. package/lib/esm/enhancement/style.mjs +0 -49
  110. package/lib/esm/enhancement/uncontrolledProps.mjs +0 -107
  111. package/lib/esm/register.mjs +0 -30
  112. package/lib/esm/styled/index.mjs +0 -8
  113. package/lib/esm/styled/reshadow-core.mjs +0 -234
  114. package/lib/esm/styled/sstyled.mjs +0 -125
  115. package/lib/esm/utils/assignProps.mjs +0 -86
  116. package/lib/esm/utils/canUseDOM.mjs +0 -6
  117. package/lib/esm/utils/capitalizeFirstLetter.mjs +0 -6
  118. package/lib/esm/utils/enhances/WithI18n.mjs +0 -30
  119. package/lib/esm/utils/enhances/i18nEnhance.mjs +0 -90
  120. package/lib/esm/utils/logger.mjs +0 -34
  121. package/lib/esm/utils/pick.mjs +0 -15
  122. package/lib/esm/utils/ref.mjs +0 -73
  123. package/lib/esm/utils/use/useEnhancedEffect.mjs +0 -6
  124. package/lib/index.d.ts +0 -11
  125. package/lib/index.js +0 -103
  126. package/lib/index.js.map +0 -1
  127. package/lib/index.mjs +0 -24
  128. package/lib/index.mjs.map +0 -1
  129. package/lib/register.d.ts +0 -8
  130. package/lib/register.js +0 -34
  131. package/lib/register.js.map +0 -1
  132. package/lib/register.mjs +0 -30
  133. package/lib/register.mjs.map +0 -1
  134. package/lib/styled/index.d.ts +0 -6
  135. package/lib/styled/index.js +0 -32
  136. package/lib/styled/index.js.map +0 -1
  137. package/lib/styled/index.mjs +0 -8
  138. package/lib/styled/index.mjs.map +0 -1
  139. package/lib/styled/reshadow-core.d.ts +0 -37
  140. package/lib/styled/reshadow-core.js +0 -233
  141. package/lib/styled/reshadow-core.js.map +0 -1
  142. package/lib/styled/reshadow-core.mjs +0 -234
  143. package/lib/styled/reshadow-core.mjs.map +0 -1
  144. package/lib/styled/sstyled.d.ts +0 -17
  145. package/lib/styled/sstyled.js +0 -151
  146. package/lib/styled/sstyled.js.map +0 -1
  147. package/lib/styled/sstyled.mjs +0 -125
  148. package/lib/styled/sstyled.mjs.map +0 -1
  149. package/lib/theme/themes/auto.css +0 -1748
  150. package/lib/theme/themes/dark.css +0 -871
  151. package/lib/theme/themes/dark.d.ts +0 -487
  152. package/lib/theme/themes/dark.js +0 -493
  153. package/lib/theme/themes/dark.js.map +0 -1
  154. package/lib/theme/themes/dark.mjs +0 -487
  155. package/lib/theme/themes/dark.mjs.map +0 -1
  156. package/lib/theme/themes/default.css +0 -877
  157. package/lib/theme/themes/default.d.ts +0 -490
  158. package/lib/theme/themes/default.js +0 -496
  159. package/lib/theme/themes/default.js.map +0 -1
  160. package/lib/theme/themes/default.mjs +0 -490
  161. package/lib/theme/themes/default.mjs.map +0 -1
  162. package/lib/theme/themes/highlights-dark.css +0 -36
  163. package/lib/theme/themes/highlights-dark.d.ts +0 -20
  164. package/lib/theme/themes/highlights-dark.js +0 -26
  165. package/lib/theme/themes/highlights-dark.js.map +0 -1
  166. package/lib/theme/themes/highlights-dark.mjs +0 -20
  167. package/lib/theme/themes/highlights-dark.mjs.map +0 -1
  168. package/lib/theme/themes/highlights-light.css +0 -36
  169. package/lib/theme/themes/highlights-light.d.ts +0 -20
  170. package/lib/theme/themes/highlights-light.js +0 -26
  171. package/lib/theme/themes/highlights-light.js.map +0 -1
  172. package/lib/theme/themes/highlights-light.mjs +0 -20
  173. package/lib/theme/themes/highlights-light.mjs.map +0 -1
  174. package/lib/theme/themes/light.css +0 -877
  175. package/lib/theme/themes/light.d.ts +0 -490
  176. package/lib/theme/themes/light.js +0 -496
  177. package/lib/theme/themes/light.js.map +0 -1
  178. package/lib/theme/themes/light.mjs +0 -490
  179. package/lib/theme/themes/light.mjs.map +0 -1
  180. package/lib/utils/CSSinJS.d.ts +0 -5
  181. package/lib/utils/CSSinJS.js +0 -35
  182. package/lib/utils/CSSinJS.js.map +0 -1
  183. package/lib/utils/CSSinJS.mjs +0 -28
  184. package/lib/utils/CSSinJS.mjs.map +0 -1
  185. package/lib/utils/ThemeProvider.d.ts +0 -15
  186. package/lib/utils/ThemeProvider.js +0 -78
  187. package/lib/utils/ThemeProvider.js.map +0 -1
  188. package/lib/utils/ThemeProvider.mjs +0 -71
  189. package/lib/utils/ThemeProvider.mjs.map +0 -1
  190. package/lib/utils/addonText.d.ts +0 -2
  191. package/lib/utils/addonText.js +0 -18
  192. package/lib/utils/addonText.js.map +0 -1
  193. package/lib/utils/addonText.mjs +0 -11
  194. package/lib/utils/addonText.mjs.map +0 -1
  195. package/lib/utils/addonTextChildren.d.ts +0 -3
  196. package/lib/utils/addonTextChildren.js +0 -44
  197. package/lib/utils/addonTextChildren.js.map +0 -1
  198. package/lib/utils/addonTextChildren.mjs +0 -37
  199. package/lib/utils/addonTextChildren.mjs.map +0 -1
  200. package/lib/utils/ariaProps.d.ts +0 -12
  201. package/lib/utils/ariaProps.js +0 -22
  202. package/lib/utils/ariaProps.js.map +0 -1
  203. package/lib/utils/ariaProps.mjs +0 -16
  204. package/lib/utils/ariaProps.mjs.map +0 -1
  205. package/lib/utils/assignProps.d.ts +0 -11
  206. package/lib/utils/assignProps.js +0 -93
  207. package/lib/utils/assignProps.js.map +0 -1
  208. package/lib/utils/assignProps.mjs +0 -86
  209. package/lib/utils/assignProps.mjs.map +0 -1
  210. package/lib/utils/canUseDOM.d.ts +0 -1
  211. package/lib/utils/canUseDOM.js +0 -10
  212. package/lib/utils/canUseDOM.js.map +0 -1
  213. package/lib/utils/canUseDOM.mjs +0 -6
  214. package/lib/utils/canUseDOM.mjs.map +0 -1
  215. package/lib/utils/capitalizeFirstLetter.d.ts +0 -1
  216. package/lib/utils/capitalizeFirstLetter.js +0 -10
  217. package/lib/utils/capitalizeFirstLetter.js.map +0 -1
  218. package/lib/utils/capitalizeFirstLetter.mjs +0 -6
  219. package/lib/utils/capitalizeFirstLetter.mjs.map +0 -1
  220. package/lib/utils/color.d.ts +0 -5
  221. package/lib/utils/color.js +0 -208
  222. package/lib/utils/color.js.map +0 -1
  223. package/lib/utils/color.mjs +0 -197
  224. package/lib/utils/color.mjs.map +0 -1
  225. package/lib/utils/compose.d.ts +0 -1
  226. package/lib/utils/compose.js +0 -21
  227. package/lib/utils/compose.js.map +0 -1
  228. package/lib/utils/compose.mjs +0 -15
  229. package/lib/utils/compose.mjs.map +0 -1
  230. package/lib/utils/createUUID.d.ts +0 -1
  231. package/lib/utils/createUUID.js +0 -15
  232. package/lib/utils/createUUID.js.map +0 -1
  233. package/lib/utils/createUUID.mjs +0 -9
  234. package/lib/utils/createUUID.mjs.map +0 -1
  235. package/lib/utils/cssToIntDefault.d.ts +0 -8
  236. package/lib/utils/cssToIntDefault.js +0 -22
  237. package/lib/utils/cssToIntDefault.js.map +0 -1
  238. package/lib/utils/cssToIntDefault.mjs +0 -16
  239. package/lib/utils/cssToIntDefault.mjs.map +0 -1
  240. package/lib/utils/enhances/WithCSS.d.ts +0 -13
  241. package/lib/utils/enhances/WithCSS.js +0 -32
  242. package/lib/utils/enhances/WithCSS.js.map +0 -1
  243. package/lib/utils/enhances/WithCSS.mjs +0 -25
  244. package/lib/utils/enhances/WithCSS.mjs.map +0 -1
  245. package/lib/utils/enhances/WithI18n.d.ts +0 -14
  246. package/lib/utils/enhances/WithI18n.js +0 -33
  247. package/lib/utils/enhances/WithI18n.js.map +0 -1
  248. package/lib/utils/enhances/WithI18n.mjs +0 -30
  249. package/lib/utils/enhances/WithI18n.mjs.map +0 -1
  250. package/lib/utils/enhances/a11yEnhance.d.ts +0 -10
  251. package/lib/utils/enhances/a11yEnhance.js +0 -73
  252. package/lib/utils/enhances/a11yEnhance.js.map +0 -1
  253. package/lib/utils/enhances/a11yEnhance.mjs +0 -66
  254. package/lib/utils/enhances/a11yEnhance.mjs.map +0 -1
  255. package/lib/utils/enhances/animatedSizeEnhance.d.ts +0 -8
  256. package/lib/utils/enhances/animatedSizeEnhance.js +0 -98
  257. package/lib/utils/enhances/animatedSizeEnhance.js.map +0 -1
  258. package/lib/utils/enhances/animatedSizeEnhance.mjs +0 -91
  259. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +0 -1
  260. package/lib/utils/enhances/contextEnhance.d.ts +0 -3
  261. package/lib/utils/enhances/contextEnhance.js +0 -21
  262. package/lib/utils/enhances/contextEnhance.js.map +0 -1
  263. package/lib/utils/enhances/contextEnhance.mjs +0 -14
  264. package/lib/utils/enhances/contextEnhance.mjs.map +0 -1
  265. package/lib/utils/enhances/i18nEnhance.d.ts +0 -21
  266. package/lib/utils/enhances/i18nEnhance.js +0 -99
  267. package/lib/utils/enhances/i18nEnhance.js.map +0 -1
  268. package/lib/utils/enhances/i18nEnhance.mjs +0 -90
  269. package/lib/utils/enhances/i18nEnhance.mjs.map +0 -1
  270. package/lib/utils/enhances/resolveColorEnhance.d.ts +0 -2
  271. package/lib/utils/enhances/resolveColorEnhance.js +0 -24
  272. package/lib/utils/enhances/resolveColorEnhance.js.map +0 -1
  273. package/lib/utils/enhances/resolveColorEnhance.mjs +0 -17
  274. package/lib/utils/enhances/resolveColorEnhance.mjs.map +0 -1
  275. package/lib/utils/eventEmitter.d.ts +0 -13
  276. package/lib/utils/eventEmitter.js +0 -68
  277. package/lib/utils/eventEmitter.js.map +0 -1
  278. package/lib/utils/eventEmitter.mjs +0 -62
  279. package/lib/utils/eventEmitter.mjs.map +0 -1
  280. package/lib/utils/findComponent.d.ts +0 -12
  281. package/lib/utils/findComponent.js +0 -105
  282. package/lib/utils/findComponent.js.map +0 -1
  283. package/lib/utils/findComponent.mjs +0 -95
  284. package/lib/utils/findComponent.mjs.map +0 -1
  285. package/lib/utils/fire.d.ts +0 -2
  286. package/lib/utils/fire.js +0 -23
  287. package/lib/utils/fire.js.map +0 -1
  288. package/lib/utils/fire.mjs +0 -15
  289. package/lib/utils/fire.mjs.map +0 -1
  290. package/lib/utils/focus-lock/focusBorders.d.ts +0 -4
  291. package/lib/utils/focus-lock/focusBorders.js +0 -68
  292. package/lib/utils/focus-lock/focusBorders.js.map +0 -1
  293. package/lib/utils/focus-lock/focusBorders.mjs +0 -62
  294. package/lib/utils/focus-lock/focusBorders.mjs.map +0 -1
  295. package/lib/utils/focus-lock/getFocusableIn.d.ts +0 -1
  296. package/lib/utils/focus-lock/getFocusableIn.js +0 -25
  297. package/lib/utils/focus-lock/getFocusableIn.js.map +0 -1
  298. package/lib/utils/focus-lock/getFocusableIn.mjs +0 -19
  299. package/lib/utils/focus-lock/getFocusableIn.mjs.map +0 -1
  300. package/lib/utils/focus-lock/isFocusInside.d.ts +0 -1
  301. package/lib/utils/focus-lock/isFocusInside.js +0 -15
  302. package/lib/utils/focus-lock/isFocusInside.js.map +0 -1
  303. package/lib/utils/focus-lock/isFocusInside.mjs +0 -9
  304. package/lib/utils/focus-lock/isFocusInside.mjs.map +0 -1
  305. package/lib/utils/focus-lock/isFocusable.d.ts +0 -1
  306. package/lib/utils/focus-lock/isFocusable.js +0 -50
  307. package/lib/utils/focus-lock/isFocusable.js.map +0 -1
  308. package/lib/utils/focus-lock/isFocusable.mjs +0 -43
  309. package/lib/utils/focus-lock/isFocusable.mjs.map +0 -1
  310. package/lib/utils/focus-lock/setFocus.d.ts +0 -1
  311. package/lib/utils/focus-lock/setFocus.js +0 -70
  312. package/lib/utils/focus-lock/setFocus.js.map +0 -1
  313. package/lib/utils/focus-lock/setFocus.mjs +0 -63
  314. package/lib/utils/focus-lock/setFocus.mjs.map +0 -1
  315. package/lib/utils/getAccessibleName.d.ts +0 -1
  316. package/lib/utils/getAccessibleName.js +0 -56
  317. package/lib/utils/getAccessibleName.js.map +0 -1
  318. package/lib/utils/getAccessibleName.mjs +0 -49
  319. package/lib/utils/getAccessibleName.mjs.map +0 -1
  320. package/lib/utils/getDisplayName.d.ts +0 -2
  321. package/lib/utils/getDisplayName.js +0 -10
  322. package/lib/utils/getDisplayName.js.map +0 -1
  323. package/lib/utils/getDisplayName.mjs +0 -4
  324. package/lib/utils/getDisplayName.mjs.map +0 -1
  325. package/lib/utils/getEventTarget.d.ts +0 -1
  326. package/lib/utils/getEventTarget.js +0 -52
  327. package/lib/utils/getEventTarget.js.map +0 -1
  328. package/lib/utils/getEventTarget.mjs +0 -45
  329. package/lib/utils/getEventTarget.mjs.map +0 -1
  330. package/lib/utils/getOriginChildren.d.ts +0 -2
  331. package/lib/utils/getOriginChildren.js +0 -17
  332. package/lib/utils/getOriginChildren.js.map +0 -1
  333. package/lib/utils/getOriginChildren.mjs +0 -10
  334. package/lib/utils/getOriginChildren.mjs.map +0 -1
  335. package/lib/utils/getRandomInt.d.ts +0 -1
  336. package/lib/utils/getRandomInt.js +0 -11
  337. package/lib/utils/getRandomInt.js.map +0 -1
  338. package/lib/utils/getRandomInt.mjs +0 -5
  339. package/lib/utils/getRandomInt.mjs.map +0 -1
  340. package/lib/utils/getValue.d.ts +0 -1
  341. package/lib/utils/getValue.js +0 -14
  342. package/lib/utils/getValue.js.map +0 -1
  343. package/lib/utils/getValue.mjs +0 -8
  344. package/lib/utils/getValue.mjs.map +0 -1
  345. package/lib/utils/hasLabels.d.ts +0 -7
  346. package/lib/utils/hasLabels.js +0 -46
  347. package/lib/utils/hasLabels.js.map +0 -1
  348. package/lib/utils/hasLabels.mjs +0 -39
  349. package/lib/utils/hasLabels.mjs.map +0 -1
  350. package/lib/utils/hasParent.d.ts +0 -1
  351. package/lib/utils/hasParent.js +0 -13
  352. package/lib/utils/hasParent.js.map +0 -1
  353. package/lib/utils/hasParent.mjs +0 -8
  354. package/lib/utils/hasParent.mjs.map +0 -1
  355. package/lib/utils/ifChildren.d.ts +0 -8
  356. package/lib/utils/ifChildren.js +0 -16
  357. package/lib/utils/ifChildren.js.map +0 -1
  358. package/lib/utils/ifChildren.mjs +0 -10
  359. package/lib/utils/ifChildren.mjs.map +0 -1
  360. package/lib/utils/indentStyles.d.ts +0 -3
  361. package/lib/utils/indentStyles.js +0 -45
  362. package/lib/utils/indentStyles.js.map +0 -1
  363. package/lib/utils/indentStyles.mjs +0 -36
  364. package/lib/utils/indentStyles.mjs.map +0 -1
  365. package/lib/utils/injectStyle.d.ts +0 -2
  366. package/lib/utils/injectStyle.js +0 -47
  367. package/lib/utils/injectStyle.js.map +0 -1
  368. package/lib/utils/injectStyle.mjs +0 -40
  369. package/lib/utils/injectStyle.mjs.map +0 -1
  370. package/lib/utils/inputProps.d.ts +0 -2
  371. package/lib/utils/inputProps.js +0 -21
  372. package/lib/utils/inputProps.js.map +0 -1
  373. package/lib/utils/inputProps.mjs +0 -14
  374. package/lib/utils/inputProps.mjs.map +0 -1
  375. package/lib/utils/isInteractiveElement.d.ts +0 -1
  376. package/lib/utils/isInteractiveElement.js +0 -34
  377. package/lib/utils/isInteractiveElement.js.map +0 -1
  378. package/lib/utils/isInteractiveElement.mjs +0 -28
  379. package/lib/utils/isInteractiveElement.mjs.map +0 -1
  380. package/lib/utils/isNode.d.ts +0 -1
  381. package/lib/utils/isNode.js +0 -28
  382. package/lib/utils/isNode.js.map +0 -1
  383. package/lib/utils/isNode.mjs +0 -21
  384. package/lib/utils/isNode.mjs.map +0 -1
  385. package/lib/utils/isPromise.d.ts +0 -1
  386. package/lib/utils/isPromise.js +0 -10
  387. package/lib/utils/isPromise.js.map +0 -1
  388. package/lib/utils/isPromise.mjs +0 -4
  389. package/lib/utils/isPromise.mjs.map +0 -1
  390. package/lib/utils/isRetina.d.ts +0 -1
  391. package/lib/utils/isRetina.js +0 -15
  392. package/lib/utils/isRetina.js.map +0 -1
  393. package/lib/utils/isRetina.mjs +0 -9
  394. package/lib/utils/isRetina.mjs.map +0 -1
  395. package/lib/utils/logger.d.ts +0 -9
  396. package/lib/utils/logger.js +0 -37
  397. package/lib/utils/logger.js.map +0 -1
  398. package/lib/utils/logger.mjs +0 -34
  399. package/lib/utils/logger.mjs.map +0 -1
  400. package/lib/utils/numericChecker.d.ts +0 -5
  401. package/lib/utils/numericChecker.js +0 -33
  402. package/lib/utils/numericChecker.js.map +0 -1
  403. package/lib/utils/numericChecker.mjs +0 -27
  404. package/lib/utils/numericChecker.mjs.map +0 -1
  405. package/lib/utils/ownerDocument.d.ts +0 -1
  406. package/lib/utils/ownerDocument.js +0 -10
  407. package/lib/utils/ownerDocument.js.map +0 -1
  408. package/lib/utils/ownerDocument.mjs +0 -4
  409. package/lib/utils/ownerDocument.mjs.map +0 -1
  410. package/lib/utils/pick.d.ts +0 -1
  411. package/lib/utils/pick.js +0 -19
  412. package/lib/utils/pick.js.map +0 -1
  413. package/lib/utils/pick.mjs +0 -15
  414. package/lib/utils/pick.mjs.map +0 -1
  415. package/lib/utils/propsForElement.d.ts +0 -3
  416. package/lib/utils/propsForElement.js +0 -58
  417. package/lib/utils/propsForElement.js.map +0 -1
  418. package/lib/utils/propsForElement.mjs +0 -50
  419. package/lib/utils/propsForElement.mjs.map +0 -1
  420. package/lib/utils/rafTrottle.d.ts +0 -2
  421. package/lib/utils/rafTrottle.js +0 -32
  422. package/lib/utils/rafTrottle.js.map +0 -1
  423. package/lib/utils/rafTrottle.mjs +0 -26
  424. package/lib/utils/rafTrottle.mjs.map +0 -1
  425. package/lib/utils/reactToText.d.ts +0 -3
  426. package/lib/utils/reactToText.js +0 -32
  427. package/lib/utils/reactToText.js.map +0 -1
  428. package/lib/utils/reactToText.mjs +0 -26
  429. package/lib/utils/reactToText.mjs.map +0 -1
  430. package/lib/utils/ref.d.ts +0 -8
  431. package/lib/utils/ref.js +0 -82
  432. package/lib/utils/ref.js.map +0 -1
  433. package/lib/utils/ref.mjs +0 -73
  434. package/lib/utils/ref.mjs.map +0 -1
  435. package/lib/utils/setRef.d.ts +0 -2
  436. package/lib/utils/setRef.js +0 -9
  437. package/lib/utils/setRef.js.map +0 -1
  438. package/lib/utils/setRef.mjs +0 -3
  439. package/lib/utils/setRef.mjs.map +0 -1
  440. package/lib/utils/syncScroll.d.ts +0 -1
  441. package/lib/utils/syncScroll.js +0 -61
  442. package/lib/utils/syncScroll.js.map +0 -1
  443. package/lib/utils/syncScroll.mjs +0 -54
  444. package/lib/utils/syncScroll.mjs.map +0 -1
  445. package/lib/utils/uncontroll.d.ts +0 -4
  446. package/lib/utils/uncontroll.js +0 -47
  447. package/lib/utils/uncontroll.js.map +0 -1
  448. package/lib/utils/uncontroll.mjs +0 -38
  449. package/lib/utils/uncontroll.mjs.map +0 -1
  450. package/lib/utils/uniqueID.d.ts +0 -8
  451. package/lib/utils/uniqueID.js +0 -40
  452. package/lib/utils/uniqueID.js.map +0 -1
  453. package/lib/utils/uniqueID.mjs +0 -33
  454. package/lib/utils/uniqueID.mjs.map +0 -1
  455. package/lib/utils/use/useColorResolver.d.ts +0 -1
  456. package/lib/utils/use/useColorResolver.js +0 -109
  457. package/lib/utils/use/useColorResolver.js.map +0 -1
  458. package/lib/utils/use/useColorResolver.mjs +0 -102
  459. package/lib/utils/use/useColorResolver.mjs.map +0 -1
  460. package/lib/utils/use/useEnhancedEffect.d.ts +0 -3
  461. package/lib/utils/use/useEnhancedEffect.js +0 -12
  462. package/lib/utils/use/useEnhancedEffect.js.map +0 -1
  463. package/lib/utils/use/useEnhancedEffect.mjs +0 -6
  464. package/lib/utils/use/useEnhancedEffect.mjs.map +0 -1
  465. package/lib/utils/use/useEventCallback.d.ts +0 -4
  466. package/lib/utils/use/useEventCallback.js +0 -25
  467. package/lib/utils/use/useEventCallback.js.map +0 -1
  468. package/lib/utils/use/useEventCallback.mjs +0 -19
  469. package/lib/utils/use/useEventCallback.mjs.map +0 -1
  470. package/lib/utils/use/useEventListener.d.ts +0 -2
  471. package/lib/utils/use/useEventListener.js +0 -32
  472. package/lib/utils/use/useEventListener.js.map +0 -1
  473. package/lib/utils/use/useEventListener.mjs +0 -25
  474. package/lib/utils/use/useEventListener.mjs.map +0 -1
  475. package/lib/utils/use/useFocusLock.d.ts +0 -10
  476. package/lib/utils/use/useFocusLock.js +0 -292
  477. package/lib/utils/use/useFocusLock.js.map +0 -1
  478. package/lib/utils/use/useFocusLock.mjs +0 -272
  479. package/lib/utils/use/useFocusLock.mjs.map +0 -1
  480. package/lib/utils/use/usePreventScroll.d.ts +0 -2
  481. package/lib/utils/use/usePreventScroll.js +0 -76
  482. package/lib/utils/use/usePreventScroll.js.map +0 -1
  483. package/lib/utils/use/usePreventScroll.mjs +0 -68
  484. package/lib/utils/use/usePreventScroll.mjs.map +0 -1
  485. package/lib/utils/use/useScrollBarWidth.d.ts +0 -1
  486. package/lib/utils/use/useScrollBarWidth.js +0 -43
  487. package/lib/utils/use/useScrollBarWidth.js.map +0 -1
  488. package/lib/utils/use/useScrollBarWidth.mjs +0 -36
  489. package/lib/utils/use/useScrollBarWidth.mjs.map +0 -1
  490. package/lib/utils/useCssVariable.d.ts +0 -8
  491. package/lib/utils/useCssVariable.js +0 -53
  492. package/lib/utils/useCssVariable.js.map +0 -1
  493. package/lib/utils/useCssVariable.mjs +0 -46
  494. package/lib/utils/useCssVariable.mjs.map +0 -1
  495. package/lib/utils/zIndexStacking.d.ts +0 -10
  496. package/lib/utils/zIndexStacking.js +0 -45
  497. package/lib/utils/zIndexStacking.js.map +0 -1
  498. package/lib/utils/zIndexStacking.mjs +0 -38
  499. package/lib/utils/zIndexStacking.mjs.map +0 -1
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var isPrimitiveValue = function isPrimitiveValue(value) {
8
- return value !== Object(value);
9
- };
10
- function reactive(watchedFieldsOrCb, cb) {
11
- return function (_, ctx) {
12
- var addInitializer = ctx.addInitializer,
13
- name = ctx.name;
14
- addInitializer(function () {
15
- var thisRoot = this;
16
- var isPrimitive = isPrimitiveValue(this[name]);
17
- var callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb;
18
- var fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;
19
- if (isPrimitive) {
20
- var value = this[name];
21
- Object.defineProperty(this, name, {
22
- get: function get() {
23
- return value;
24
- },
25
- set: function set(newValue) {
26
- var oldValue = value;
27
- value = newValue;
28
- if (oldValue !== newValue) {
29
- callback.call(thisRoot, name, newValue);
30
- }
31
- },
32
- enumerable: true,
33
- configurable: true
34
- });
35
- } else {
36
- // @ts-ignore
37
- this[name] = new Proxy(this[name], {
38
- set: function set(target, p, newValue) {
39
- target[p] = newValue;
40
- if ((fields === null || fields === void 0 ? void 0 : fields.length) === 0 || fields !== null && fields !== void 0 && fields.includes(p)) {
41
- callback.call(thisRoot, p, newValue);
42
- }
43
- return true;
44
- }
45
- });
46
- }
47
- });
48
- };
49
- }
50
- var _default = exports["default"] = reactive;
51
- //# sourceMappingURL=reactive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactive.js","names":["isPrimitiveValue","value","Object","reactive","watchedFieldsOrCb","cb","_","ctx","addInitializer","name","thisRoot","isPrimitive","callback","fields","Array","isArray","defineProperty","get","set","newValue","oldValue","call","enumerable","configurable","Proxy","target","p","length","includes","_default","exports"],"sources":["../../src/decorators/reactive.ts"],"sourcesContent":["type Primitive = string | number | boolean | symbol | bigint | null | undefined;\ntype IsReadonly<This, Property extends keyof This> =\n (<F>() => F extends { [P in Property]: This[Property] } ? 1 : 2) extends\n (<F>() => F extends { -readonly [P in Property]: This[Property] } ? 1 : 2)\n ? false\n : true;\ntype Callback<This> = (this: This, field: string | symbol, newValue: unknown) => void;\ntype ReturnType<\n This,\n Property extends keyof This = keyof This,\n> = IsReadonly<This, Property> extends true\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : This[Property] extends Primitive\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : never;\n\nconst isPrimitiveValue = (value: unknown) => value !== Object(value);\n\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(cb: Value extends Primitive ? Callback<This> : never): ReturnType<This>;\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(watchedFields: Value extends Primitive ? never : Array<keyof Value>, cb: Callback<This>): ReturnType<This>;\n\nfunction reactive<\n This,\n Property extends keyof This,\n>(watchedFieldsOrCb: Array<keyof This[Property]> | Callback<This>, cb?: Callback<This>) {\n return function (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) {\n const { addInitializer, name } = ctx;\n\n addInitializer(function (this: This) {\n const thisRoot = this;\n\n const isPrimitive = isPrimitiveValue(this[name as Property]);\n\n const callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb!;\n const fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;\n\n if (isPrimitive) {\n let value = this[name as Property];\n\n Object.defineProperty(this, name, {\n get() {\n return value;\n },\n set(newValue) {\n const oldValue = value;\n\n value = newValue;\n\n if (oldValue !== newValue) {\n callback.call(thisRoot, name, newValue);\n }\n },\n enumerable: true,\n configurable: true,\n });\n } else {\n // @ts-ignore\n this[name] = new Proxy(this[name], {\n set(target, p, newValue) {\n target[p] = newValue;\n\n if (fields?.length === 0 || fields?.includes(p as keyof This[Property])) {\n callback.call(thisRoot, p, newValue);\n }\n\n return true;\n },\n });\n }\n });\n };\n}\n\nexport default reactive;\n"],"mappings":";;;;;;AAgBA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,KAAc;EAAA,OAAKA,KAAK,KAAKC,MAAM,CAACD,KAAK,CAAC;AAAA;AAapE,SAASE,QAAQA,CAGfC,iBAA+D,EAAEC,EAAmB,EAAE;EACtF,OAAO,UAAUC,CAAY,EAAEC,GAAqD,EAAE;IACpF,IAAQC,cAAc,GAAWD,GAAG,CAA5BC,cAAc;MAAEC,IAAI,GAAKF,GAAG,CAAZE,IAAI;IAE5BD,cAAc,CAAC,YAAsB;MACnC,IAAME,QAAQ,GAAG,IAAI;MAErB,IAAMC,WAAW,GAAGX,gBAAgB,CAAC,IAAI,CAACS,IAAI,CAAa,CAAC;MAE5D,IAAMG,QAAQ,GAAG,OAAOR,iBAAiB,KAAK,UAAU,GAAGA,iBAAiB,GAAGC,EAAG;MAClF,IAAMQ,MAAM,GAAGC,KAAK,CAACC,OAAO,CAACX,iBAAiB,CAAC,GAAGA,iBAAiB,GAAG,IAAI;MAE1E,IAAIO,WAAW,EAAE;QACf,IAAIV,KAAK,GAAG,IAAI,CAACQ,IAAI,CAAa;QAElCP,MAAM,CAACc,cAAc,CAAC,IAAI,EAAEP,IAAI,EAAE;UAChCQ,GAAG,WAAHA,GAAGA,CAAA,EAAG;YACJ,OAAOhB,KAAK;UACd,CAAC;UACDiB,GAAG,WAAHA,GAAGA,CAACC,QAAQ,EAAE;YACZ,IAAMC,QAAQ,GAAGnB,KAAK;YAEtBA,KAAK,GAAGkB,QAAQ;YAEhB,IAAIC,QAAQ,KAAKD,QAAQ,EAAE;cACzBP,QAAQ,CAACS,IAAI,CAACX,QAAQ,EAAED,IAAI,EAAEU,QAAQ,CAAC;YACzC;UACF,CAAC;UACDG,UAAU,EAAE,IAAI;UAChBC,YAAY,EAAE;QAChB,CAAC,CAAC;MACJ,CAAC,MAAM;QACL;QACA,IAAI,CAACd,IAAI,CAAC,GAAG,IAAIe,KAAK,CAAC,IAAI,CAACf,IAAI,CAAC,EAAE;UACjCS,GAAG,WAAHA,GAAGA,CAACO,MAAM,EAAEC,CAAC,EAAEP,QAAQ,EAAE;YACvBM,MAAM,CAACC,CAAC,CAAC,GAAGP,QAAQ;YAEpB,IAAI,CAAAN,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEc,MAAM,MAAK,CAAC,IAAId,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEe,QAAQ,CAACF,CAAyB,CAAC,EAAE;cACvEd,QAAQ,CAACS,IAAI,CAACX,QAAQ,EAAEgB,CAAC,EAAEP,QAAQ,CAAC;YACtC;YAEA,OAAO,IAAI;UACb;QACF,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;EACJ,CAAC;AACH;AAAC,IAAAU,QAAA,GAAAC,OAAA,cAEc3B,QAAQ","ignoreList":[]}
@@ -1,45 +0,0 @@
1
- var isPrimitiveValue = function isPrimitiveValue(value) {
2
- return value !== Object(value);
3
- };
4
- function reactive(watchedFieldsOrCb, cb) {
5
- return function (_, ctx) {
6
- var addInitializer = ctx.addInitializer,
7
- name = ctx.name;
8
- addInitializer(function () {
9
- var thisRoot = this;
10
- var isPrimitive = isPrimitiveValue(this[name]);
11
- var callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb;
12
- var fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;
13
- if (isPrimitive) {
14
- var value = this[name];
15
- Object.defineProperty(this, name, {
16
- get: function get() {
17
- return value;
18
- },
19
- set: function set(newValue) {
20
- var oldValue = value;
21
- value = newValue;
22
- if (oldValue !== newValue) {
23
- callback.call(thisRoot, name, newValue);
24
- }
25
- },
26
- enumerable: true,
27
- configurable: true
28
- });
29
- } else {
30
- // @ts-ignore
31
- this[name] = new Proxy(this[name], {
32
- set: function set(target, p, newValue) {
33
- target[p] = newValue;
34
- if ((fields === null || fields === void 0 ? void 0 : fields.length) === 0 || fields !== null && fields !== void 0 && fields.includes(p)) {
35
- callback.call(thisRoot, p, newValue);
36
- }
37
- return true;
38
- }
39
- });
40
- }
41
- });
42
- };
43
- }
44
- export default reactive;
45
- //# sourceMappingURL=reactive.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactive.mjs","names":["isPrimitiveValue","value","Object","reactive","watchedFieldsOrCb","cb","_","ctx","addInitializer","name","thisRoot","isPrimitive","callback","fields","Array","isArray","defineProperty","get","set","newValue","oldValue","call","enumerable","configurable","Proxy","target","p","length","includes"],"sources":["../../src/decorators/reactive.ts"],"sourcesContent":["type Primitive = string | number | boolean | symbol | bigint | null | undefined;\ntype IsReadonly<This, Property extends keyof This> =\n (<F>() => F extends { [P in Property]: This[Property] } ? 1 : 2) extends\n (<F>() => F extends { -readonly [P in Property]: This[Property] } ? 1 : 2)\n ? false\n : true;\ntype Callback<This> = (this: This, field: string | symbol, newValue: unknown) => void;\ntype ReturnType<\n This,\n Property extends keyof This = keyof This,\n> = IsReadonly<This, Property> extends true\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : This[Property] extends Primitive\n ? (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) => void\n : never;\n\nconst isPrimitiveValue = (value: unknown) => value !== Object(value);\n\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(cb: Value extends Primitive ? Callback<This> : never): ReturnType<This>;\nfunction reactive<\n This,\n Property extends keyof This,\n Value = This[Property],\n>(watchedFields: Value extends Primitive ? never : Array<keyof Value>, cb: Callback<This>): ReturnType<This>;\n\nfunction reactive<\n This,\n Property extends keyof This,\n>(watchedFieldsOrCb: Array<keyof This[Property]> | Callback<This>, cb?: Callback<This>) {\n return function (_: undefined, ctx: ClassFieldDecoratorContext<This, This[Property]>) {\n const { addInitializer, name } = ctx;\n\n addInitializer(function (this: This) {\n const thisRoot = this;\n\n const isPrimitive = isPrimitiveValue(this[name as Property]);\n\n const callback = typeof watchedFieldsOrCb === 'function' ? watchedFieldsOrCb : cb!;\n const fields = Array.isArray(watchedFieldsOrCb) ? watchedFieldsOrCb : null;\n\n if (isPrimitive) {\n let value = this[name as Property];\n\n Object.defineProperty(this, name, {\n get() {\n return value;\n },\n set(newValue) {\n const oldValue = value;\n\n value = newValue;\n\n if (oldValue !== newValue) {\n callback.call(thisRoot, name, newValue);\n }\n },\n enumerable: true,\n configurable: true,\n });\n } else {\n // @ts-ignore\n this[name] = new Proxy(this[name], {\n set(target, p, newValue) {\n target[p] = newValue;\n\n if (fields?.length === 0 || fields?.includes(p as keyof This[Property])) {\n callback.call(thisRoot, p, newValue);\n }\n\n return true;\n },\n });\n }\n });\n };\n}\n\nexport default reactive;\n"],"mappings":"AAgBA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,KAAc;EAAA,OAAKA,KAAK,KAAKC,MAAM,CAACD,KAAK,CAAC;AAAA;AAapE,SAASE,QAAQA,CAGfC,iBAA+D,EAAEC,EAAmB,EAAE;EACtF,OAAO,UAAUC,CAAY,EAAEC,GAAqD,EAAE;IACpF,IAAQC,cAAc,GAAWD,GAAG,CAA5BC,cAAc;MAAEC,IAAI,GAAKF,GAAG,CAAZE,IAAI;IAE5BD,cAAc,CAAC,YAAsB;MACnC,IAAME,QAAQ,GAAG,IAAI;MAErB,IAAMC,WAAW,GAAGX,gBAAgB,CAAC,IAAI,CAACS,IAAI,CAAa,CAAC;MA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AehB,QAAQ","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- declare function Enhancement(this: any, Context: any, parent: any): {
2
- init: (this: any) => void;
3
- asProps: (this: any, props: any) => any;
4
- };
5
- export default Enhancement;
@@ -1,118 +0,0 @@
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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
- var _react = _interopRequireDefault(require("react"));
13
- var _symbols = require("../core-types/symbols");
14
- var _excluded = ["handlers", "getters"],
15
- _excluded2 = ["handlers"];
16
- var CHILDREN_SELF = Symbol('CHILDREN_SELF');
17
- var GETTER_REG = /^get[\w]+Props$/;
18
- function splitPropsAndGetters(props) {
19
- return Object.entries(props).reduce(function (acc, _ref) {
20
- var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
21
- key = _ref2[0],
22
- value = _ref2[1];
23
- if (GETTER_REG.exec(key) === null) {
24
- acc.props[key] = value;
25
- } else {
26
- acc.getters[key] = value;
27
- }
28
- return acc;
29
- }, {
30
- props: {},
31
- getters: {}
32
- });
33
- }
34
- function getterToArray(getter) {
35
- if (!Array.isArray(getter)) {
36
- return typeof getter === 'function' ? [getter] : [];
37
- }
38
- return getter;
39
- }
40
- function mergeObjects() {
41
- var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
42
- var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
43
- var core = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, a), b);
44
- return Object.keys(core).reduce(function (acc, key) {
45
- a[key] = getterToArray(a[key]);
46
- b[key] = getterToArray(b[key]);
47
- acc[key] = [].concat((0, _toConsumableArray2["default"])(a[key]), (0, _toConsumableArray2["default"])(b[key]));
48
- return acc;
49
- }, {});
50
- }
51
- function assignGettersChain(getters) {
52
- return function () {
53
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
54
- return getters.reduce(function (acc, getter) {
55
- return getter(acc);
56
- }, props);
57
- };
58
- }
59
- function createChildren(Context, contexts) {
60
- var _Children = function Children() {
61
- var children = _Children.origin;
62
- if (typeof children === 'function') {
63
- var _reduce = [].concat((0, _toConsumableArray2["default"])(contexts), [Context]).reduce(function (acc, ctx) {
64
- var _ref3 = _react["default"].useContext(ctx),
65
- handlers = _ref3.handlers,
66
- propsAndGetters = (0, _objectWithoutProperties2["default"])(_ref3, _excluded2);
67
- var _splitPropsAndGetters = splitPropsAndGetters(propsAndGetters),
68
- props = _splitPropsAndGetters.props,
69
- getters = _splitPropsAndGetters.getters;
70
- return Object.assign({}, acc, (0, _objectSpread2["default"])({
71
- handlers: Object.assign({}, acc.handlers, handlers),
72
- getters: mergeObjects(acc.getters, getters)
73
- }, props));
74
- }, _Children.props),
75
- _reduce$handlers = _reduce.handlers,
76
- handlers = _reduce$handlers === void 0 ? {} : _reduce$handlers,
77
- _reduce$getters = _reduce.getters,
78
- getters = _reduce$getters === void 0 ? {} : _reduce$getters,
79
- props = (0, _objectWithoutProperties2["default"])(_reduce, _excluded);
80
- var mergedGetters = Object.entries(getters).reduce(function (acc, _ref4) {
81
- var _ref5 = (0, _slicedToArray2["default"])(_ref4, 2),
82
- key = _ref5[0],
83
- value = _ref5[1];
84
- acc[key] = assignGettersChain(value);
85
- return acc;
86
- }, {});
87
- return children((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), mergedGetters), handlers);
88
- } else if (children === undefined) {
89
- return null;
90
- }
91
- return children;
92
- };
93
- _Children.origin = null;
94
- _Children.props = {};
95
- _Children[_symbols.CHILDREN_COMPONENT] = true;
96
- return _Children;
97
- }
98
- function Enhancement(Context, parent) {
99
- return {
100
- init: function init() {
101
- var contexts = (Array.isArray(parent) ? parent : [parent]).map(function (component) {
102
- return component[_symbols.CONTEXT_COMPONENT];
103
- }).filter(Boolean);
104
- this[CHILDREN_SELF] = createChildren(Context, contexts);
105
- },
106
- asProps: function asProps(props) {
107
- // TODO: learn the reason what it was used for (by lsroman)
108
- // this[CHILDREN_SELF].origin = _Children ? _Children.origin : children;
109
- this[CHILDREN_SELF].origin = props.children;
110
- this[CHILDREN_SELF].props = props;
111
- return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
112
- Children: this[CHILDREN_SELF]
113
- });
114
- }
115
- };
116
- }
117
- var _default = exports["default"] = Enhancement;
118
- //# sourceMappingURL=Children.js.map
@@ -1 +0,0 @@
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';\n\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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,96 +0,0 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
- import React from "react";
6
- import { CHILDREN_COMPONENT, CONTEXT_COMPONENT } from "../core-types/symbols.mjs";
7
- var _excluded = ["handlers", "getters"], _excluded2 = ["handlers"];
8
- var CHILDREN_SELF = /* @__PURE__ */ Symbol("CHILDREN_SELF");
9
- var GETTER_REG = /^get[\w]+Props$/;
10
- function splitPropsAndGetters(props) {
11
- return Object.entries(props).reduce(function(acc, _ref) {
12
- var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
13
- if (GETTER_REG.exec(key) === null) {
14
- acc.props[key] = value;
15
- } else {
16
- acc.getters[key] = value;
17
- }
18
- return acc;
19
- }, {
20
- props: {},
21
- getters: {}
22
- });
23
- }
24
- function getterToArray(getter) {
25
- if (!Array.isArray(getter)) {
26
- return typeof getter === "function" ? [getter] : [];
27
- }
28
- return getter;
29
- }
30
- function mergeObjects() {
31
- var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
32
- var b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
33
- var core = _objectSpread(_objectSpread({}, a), b);
34
- return Object.keys(core).reduce(function(acc, key) {
35
- a[key] = getterToArray(a[key]);
36
- b[key] = getterToArray(b[key]);
37
- acc[key] = [].concat(_toConsumableArray(a[key]), _toConsumableArray(b[key]));
38
- return acc;
39
- }, {});
40
- }
41
- function assignGettersChain(getters) {
42
- return function() {
43
- var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
44
- return getters.reduce(function(acc, getter) {
45
- return getter(acc);
46
- }, props);
47
- };
48
- }
49
- function createChildren(Context, contexts) {
50
- var _Children = function Children() {
51
- var children = _Children.origin;
52
- if (typeof children === "function") {
53
- var _reduce = [].concat(_toConsumableArray(contexts), [Context]).reduce(function(acc, ctx) {
54
- var _ref3 = React.useContext(ctx), handlers2 = _ref3.handlers, propsAndGetters = _objectWithoutProperties(_ref3, _excluded2);
55
- var _splitPropsAndGetters = splitPropsAndGetters(propsAndGetters), props2 = _splitPropsAndGetters.props, getters2 = _splitPropsAndGetters.getters;
56
- return Object.assign({}, acc, _objectSpread({
57
- handlers: Object.assign({}, acc.handlers, handlers2),
58
- getters: mergeObjects(acc.getters, getters2)
59
- }, props2));
60
- }, _Children.props), _reduce$handlers = _reduce.handlers, handlers = _reduce$handlers === void 0 ? {} : _reduce$handlers, _reduce$getters = _reduce.getters, getters = _reduce$getters === void 0 ? {} : _reduce$getters, props = _objectWithoutProperties(_reduce, _excluded);
61
- var mergedGetters = Object.entries(getters).reduce(function(acc, _ref4) {
62
- var _ref5 = _slicedToArray(_ref4, 2), key = _ref5[0], value = _ref5[1];
63
- acc[key] = assignGettersChain(value);
64
- return acc;
65
- }, {});
66
- return children(_objectSpread(_objectSpread({}, props), mergedGetters), handlers);
67
- } else if (children === void 0) {
68
- return null;
69
- }
70
- return children;
71
- };
72
- _Children.origin = null;
73
- _Children.props = {};
74
- _Children[CHILDREN_COMPONENT] = true;
75
- return _Children;
76
- }
77
- function Enhancement(Context, parent) {
78
- return {
79
- init: function init() {
80
- var contexts = (Array.isArray(parent) ? parent : [parent]).map(function(component) {
81
- return component[CONTEXT_COMPONENT];
82
- }).filter(Boolean);
83
- this[CHILDREN_SELF] = createChildren(Context, contexts);
84
- },
85
- asProps: function asProps(props) {
86
- this[CHILDREN_SELF].origin = props.children;
87
- this[CHILDREN_SELF].props = props;
88
- return _objectSpread(_objectSpread({}, props), {}, {
89
- Children: this[CHILDREN_SELF]
90
- });
91
- }
92
- };
93
- }
94
- export {
95
- Enhancement as default
96
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"Children.mjs","names":["React","CONTEXT_COMPONENT","CHILDREN_COMPONENT","CHILDREN_SELF","Symbol","GETTER_REG","splitPropsAndGetters","props","Object","entries","reduce","acc","_ref","_ref2","_slicedToArray","key","value","exec","getters","getterToArray","getter","Array","isArray","mergeObjects","a","arguments","length","undefined","b","core","_objectSpread","keys","concat","_toConsumableArray","assignGettersChain","createChildren","Context","contexts","Children","children","origin","_reduce","ctx","_ref3","useContext","handlers","propsAndGetters","_objectWithoutProperties","_excluded2","_splitPropsAndGetters","assign","_reduce$handlers","_reduce$getters","_excluded","mergedGetters","_ref4","_ref5","Enhancement","parent","init","map","component","filter","Boolean","asProps"],"sources":["../../src/enhancement/Children.tsx"],"sourcesContent":["import React from 'react';\n\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,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,2BAAuB;AAE7E,IAAMC,aAAa,GAAGC,MAAM,CAAC,eAAe,CAAC;AAE7C,IAAMC,UAAU,GAAG,iBAAiB;AAEpC,SAASC,oBAAoBA,CAACC,KAAU,EAAE;EACxC,OAAOC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAACG,MAAM,CACjC,UAACC,GAAQ,EAAAC,IAAA,EAAmB;IAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,IAAA;MAAhBG,GAAG,GAAAF,KAAA;MAAEG,KAAK,GAAAH,KAAA;IACpB,IAAIR,UAAU,CAACY,IAAI,CAACF,GAAG,CAAC,KAAK,IAAI,EAAE;MACjCJ,GAAG,CAACJ,KAAK,CAACQ,GAAG,CAAC,GAAGC,KAAK;IACxB,CA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UAACC,SAAS;QAAA,OAAKA,SAAS,CAAC5D,iBAAiB,CAAC;MAAA,EAAC,CAChD6D,MAAM,CAACC,OAAO,CAAC;MAClB,IAAI,CAAC5D,aAAa,CAAC,GAAGgC,cAAc,CAACC,OAAO,EAAEC,QAAQ,CAAC;IACzD,CAAC;IACD2B,OAAO,EAAE,SAATA,OAAOA,CAAuBzD,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,OAAAuB,aAAA,CAAAA,aAAA,KACKvB,KAAK;QACR+B,QAAQ,EAAE,IAAI,CAACnC,aAAa;MAAC;IAEjC;EACF,CAAC;AACH;AAEA,eAAesD,WAAW","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- declare function Enhancement(): {
2
- init: (this: any) => void;
3
- asProps: (this: any, props: any, _WrapperComponent: any, isFunction: boolean) => any;
4
- render: (this: any, render: any, props: any) => any;
5
- };
6
- export default Enhancement;
@@ -1,77 +0,0 @@
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _react = _interopRequireDefault(require("react"));
12
- var _assignProps = _interopRequireDefault(require("../utils/assignProps"));
13
- var _ref4 = require("../utils/ref");
14
- var _excluded = ["render"],
15
- _excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
16
- function createRootRender() {
17
- // @ts-ignore
18
- var Root = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
19
- var Tag = _ref.render,
20
- source = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
21
- var _Root$props = Root.props,
22
- _Root = _Root$props.Root,
23
- _styles = _Root$props.styles,
24
- _children = _Root$props.children,
25
- Children = _Root$props.Children,
26
- _Root$props$forwardRe = _Root$props.forwardRef,
27
- forwardRef = _Root$props$forwardRe === void 0 ? null : _Root$props$forwardRe,
28
- props = (0, _objectWithoutProperties2["default"])(_Root$props, _excluded2);
29
- var clearProps = Object.entries(props).reduce(function (props, _ref2) {
30
- var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
31
- name = _ref3[0],
32
- value = _ref3[1];
33
- if (value !== undefined) {
34
- props[name] = value;
35
- }
36
- return props;
37
- }, {});
38
- var child = {};
39
- // TODO: need to find better check solution (by lsroman)
40
- if (typeof Children.origin !== 'undefined') {
41
- // @ts-ignore
42
- child.children = /*#__PURE__*/_react["default"].createElement(Children, null);
43
- }
44
- var other = (0, _assignProps["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, clearProps), {}, {
45
- ref: (0, _ref4.useForkRef)(forwardRef, ref)
46
- }), (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, child), source));
47
- if (!Tag) {
48
- throw new Error('`render` prop of Root is not provided');
49
- }
50
- if (Tag === _react["default"].Fragment) return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, other.children);
51
- return /*#__PURE__*/_react["default"].createElement(Tag, other);
52
- });
53
- // @ts-ignore
54
- Root.props = {};
55
- return Root;
56
- }
57
- function Enhancement() {
58
- return {
59
- init: function init() {
60
- this.Root = createRootRender();
61
- },
62
- asProps: function asProps(props, _WrapperComponent, isFunction) {
63
- if (isFunction) {
64
- return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
65
- Root: this.Root
66
- });
67
- }
68
- return props;
69
- },
70
- render: function render(_render, props) {
71
- this.Root.props = props;
72
- return _render;
73
- }
74
- };
75
- }
76
- var _default = exports["default"] = Enhancement;
77
- //# sourceMappingURL=Root.js.map
@@ -1 +0,0 @@
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","styles","_children","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';\n\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: _styles,\n\n children: _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":";;;;;;;;;;A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QAAA,GAAAC,OAAA,cAEcN,WAAW","ignoreList":[]}
@@ -1,56 +0,0 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- import React from "react";
5
- import assignProps from "../utils/assignProps.mjs";
6
- import { useForkRef } from "../utils/ref.mjs";
7
- var _excluded = ["render"], _excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
8
- function createRootRender() {
9
- var Root = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
10
- var Tag = _ref.render, source = _objectWithoutProperties(_ref, _excluded);
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);
12
- var clearProps = Object.entries(props).reduce(function(props2, _ref2) {
13
- var _ref3 = _slicedToArray(_ref2, 2), name = _ref3[0], value = _ref3[1];
14
- if (value !== void 0) {
15
- props2[name] = value;
16
- }
17
- return props2;
18
- }, {});
19
- var child = {};
20
- if (typeof Children.origin !== "undefined") {
21
- child.children = /* @__PURE__ */ React.createElement(Children, null);
22
- }
23
- var other = assignProps(_objectSpread(_objectSpread({}, clearProps), {}, {
24
- ref: useForkRef(forwardRef, ref)
25
- }), _objectSpread(_objectSpread({}, child), source));
26
- if (!Tag) {
27
- throw new Error("`render` prop of Root is not provided");
28
- }
29
- if (Tag === React.Fragment) return /* @__PURE__ */ React.createElement(React.Fragment, null, other.children);
30
- return /* @__PURE__ */ React.createElement(Tag, other);
31
- });
32
- Root.props = {};
33
- return Root;
34
- }
35
- function Enhancement() {
36
- return {
37
- init: function init() {
38
- this.Root = createRootRender();
39
- },
40
- asProps: function asProps(props, _WrapperComponent, isFunction) {
41
- if (isFunction) {
42
- return _objectSpread(_objectSpread({}, props), {}, {
43
- Root: this.Root
44
- });
45
- }
46
- return props;
47
- },
48
- render: function render(_render, props) {
49
- this.Root.props = props;
50
- return _render;
51
- }
52
- };
53
- }
54
- export {
55
- Enhancement as default
56
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"Root.mjs","names":["React","assignProps","useForkRef","createRootRender","Root","forwardRef","_ref","ref","Tag","render","source","_objectWithoutProperties","_excluded","_Root$props","props","_Root","_styles","styles","_children","children","Children","_Root$props$forwardRe","_excluded2","clearProps","Object","entries","reduce","_ref2","_ref3","_slicedToArray","name","value","undefined","child","origin","createElement","other","_objectSpread","Error","Fragment","Enhancement","init","asProps","_WrapperComponent","isFunction"],"sources":["../../src/enhancement/Root.tsx"],"sourcesContent":["import React from 'react';\n\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: _styles,\n\n children: _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,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,WAAW,MAAM,0BAAsB;AAC9C,SAASC,UAAU,QAAQ,kBAAc;AAEzC,SAASC,gBAAgBA,CAAA,EAAG;EAC1B;EACA,IAAMC,IAAI,gBAAGJ,KAAK,CAACK,UAAU,CAAC,UAAAC,IAAA,EAAsCC,GAAG,EAAE;IAAA,IAAvBC,GAAG,GAAAF,IAAA,CAAXG,MAAM;MAAUC,MAAM,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;IAC9D,IAAAC,WAAA,GAUIT,IAAI,CAACU,KAAK;MATNC,KAAK,GAAAF,WAAA,CAAXT,IAAI;MAEIY,OAAO,GAAAH,WAAA,CAAfI,MAAM;MAEIC,SAAS,GAAAL,WAAA,CAAnBM,QAAQ;MACRC,QAAQ,GAAAP,WAAA,CAARO,QAAQ;MAAAC,qBAAA,GAAAR,WAAA,CACRR,UAAU;MAAVA,UAAU,GAAAgB,qBAAA,cAAG,IAAI,GAAAA,qBAAA;MACdP,KAAK,GAAAH,wBAAA,CAAAE,WAAA,EAAAS,UAAA;IAIV,IAAMC,UAAU,GAAGC,MAAM,CAACC,OAAO,CAACX,KAAK,CAAC,CAACY,MAAM,CAAC,UAACZ,KAAU,EAAAa,KAAA,EAAoB;MAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,KAAA;QAAjBG,IAAI,GAAAF,KAAA;QAAEG,KAAK,GAAAH,KAAA;MACvE,IAAIG,KAAK,KAAKC,SAAS,EAAE;QACvBlB,KAAK,CAACgB,IAAI,CAAC,GAAGC,KAAK;MACrB;MACA,OAAOjB,KAAK;IACd,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAMmB,KAAK,GAAG,CAAC,CAAC;IAChB;IACA,IAAI,OAAOb,QAAQ,CAACc,MAAM,KAAK,WAAW,EAAE;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e+B,WAAW","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- declare function Enhancement(): {
2
- wrapperProps: (props: any, WrapperComponent: any) => any;
3
- };
4
- export default Enhancement;
@@ -1,19 +0,0 @@
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- function Enhancement() {
10
- return {
11
- wrapperProps: function wrapperProps(props, WrapperComponent) {
12
- return (0, _objectSpread2["default"])({
13
- 'data-ui-name': WrapperComponent.displayName
14
- }, props);
15
- }
16
- };
17
- }
18
- var _default = exports["default"] = Enhancement;
19
- //# sourceMappingURL=dataName.js.map
@@ -1 +0,0 @@
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,SAAdA,YAAYA,CAAYC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,WAAAC,cAAA;QACE,cAAc,EAAED,gBAAgB,CAACE;MAAW,GACzCH,KAAK;IAEZ;EACF,CAAC;AACH;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEcP,WAAW","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- function Enhancement() {
3
- return {
4
- wrapperProps: function wrapperProps(props, WrapperComponent) {
5
- return _objectSpread({
6
- "data-ui-name": WrapperComponent.displayName
7
- }, props);
8
- }
9
- };
10
- }
11
- export {
12
- Enhancement as default
13
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataName.mjs","names":["Enhancement","wrapperProps","props","WrapperComponent","_objectSpread","displayName"],"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,SAAdA,YAAYA,CAAYC,KAAU,EAAEC,gBAAqB,EAAE;MACzD,OAAAC,aAAA;QACE,cAAc,EAAED,gBAAgB,CAACE;MAAW,GACzCH,KAAK;IAEZ;EACF,CAAC;AACH;AAEA,eAAeF,WAAW","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- declare function Enhancement(): {
2
- condition: (Component: any) => boolean;
3
- wrapperProps: (props: any, WrapperComponent: any) => any;
4
- };
5
- export default Enhancement;
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- function Enhancement() {
8
- return {
9
- condition: function condition(Component) {
10
- var _Component$enhance;
11
- return Boolean((_Component$enhance = Component.enhance) === null || _Component$enhance === void 0 ? void 0 : _Component$enhance.length);
12
- },
13
- wrapperProps: function wrapperProps(props, WrapperComponent) {
14
- return WrapperComponent.enhance.reduce(function (acc, enhance) {
15
- return enhance(acc);
16
- }, props);
17
- }
18
- };
19
- }
20
- var _default = exports["default"] = Enhancement;
21
- //# sourceMappingURL=enhance.js.map
@@ -1 +0,0 @@
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,SAAXA,SAASA,CAAYC,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,SAAdA,YAAYA,CAAYC,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,GAAAC,OAAA,cAEcb,WAAW","ignoreList":[]}