@mpxjs/webpack-plugin 2.10.15 → 2.10.16-beta.10

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 (274) hide show
  1. package/lib/config.js +60 -0
  2. package/lib/dependencies/AppEntryDependency.js +2 -2
  3. package/lib/dependencies/DynamicEntryDependency.js +1 -1
  4. package/lib/dependencies/ImportDependency.js +102 -0
  5. package/lib/dependencies/RecordModuleIdMapDependency.js +49 -0
  6. package/lib/dependencies/ResolveDependency.js +1 -1
  7. package/lib/{retry-runtime-module.js → dependencies/RetryRuntimeModule.js} +1 -1
  8. package/lib/file-loader.js +13 -3
  9. package/lib/helpers.js +2 -0
  10. package/lib/index.js +51 -25
  11. package/lib/json-compiler/helper.js +72 -2
  12. package/lib/json-compiler/index.js +16 -56
  13. package/lib/json-compiler/plugin.js +2 -2
  14. package/lib/loader.js +10 -4
  15. package/lib/native-loader.js +6 -3
  16. package/lib/platform/json/wx/index.js +30 -29
  17. package/lib/platform/style/wx/index.js +8 -1
  18. package/lib/platform/template/wx/component-config/ad.js +5 -0
  19. package/lib/platform/template/wx/component-config/button.js +21 -5
  20. package/lib/platform/template/wx/component-config/camera.js +25 -3
  21. package/lib/platform/template/wx/component-config/canvas.js +8 -1
  22. package/lib/platform/template/wx/component-config/component.js +31 -33
  23. package/lib/platform/template/wx/component-config/cover-image.js +7 -2
  24. package/lib/platform/template/wx/component-config/cover-view.js +3 -1
  25. package/lib/platform/template/wx/component-config/fix-component-name.js +2 -2
  26. package/lib/platform/template/wx/component-config/form.js +27 -2
  27. package/lib/platform/template/wx/component-config/image.js +5 -0
  28. package/lib/platform/template/wx/component-config/input.js +10 -0
  29. package/lib/platform/template/wx/component-config/label.js +10 -2
  30. package/lib/platform/template/wx/component-config/map.js +11 -0
  31. package/lib/platform/template/wx/component-config/movable-area.js +4 -1
  32. package/lib/platform/template/wx/component-config/movable-view.js +17 -2
  33. package/lib/platform/template/wx/component-config/navigator.js +26 -0
  34. package/lib/platform/template/wx/component-config/picker-view.js +12 -0
  35. package/lib/platform/template/wx/component-config/picker.js +3 -1
  36. package/lib/platform/template/wx/component-config/progress.js +11 -1
  37. package/lib/platform/template/wx/component-config/rich-text.js +5 -0
  38. package/lib/platform/template/wx/component-config/scroll-view.js +12 -1
  39. package/lib/platform/template/wx/component-config/slider.js +20 -0
  40. package/lib/platform/template/wx/component-config/swiper-item.js +5 -2
  41. package/lib/platform/template/wx/component-config/swiper.js +10 -0
  42. package/lib/platform/template/wx/component-config/text.js +5 -0
  43. package/lib/platform/template/wx/component-config/textarea.js +19 -2
  44. package/lib/platform/template/wx/component-config/unsupported.js +10 -1
  45. package/lib/platform/template/wx/component-config/video.js +10 -0
  46. package/lib/platform/template/wx/index.js +21 -1
  47. package/lib/react/index.js +2 -0
  48. package/lib/react/processJSON.js +39 -71
  49. package/lib/react/processStyles.js +3 -2
  50. package/lib/react/processTemplate.js +8 -6
  51. package/lib/react/script-helper.js +6 -16
  52. package/lib/react/style-helper.js +10 -2
  53. package/lib/resolver/AddEnvPlugin.js +13 -0
  54. package/lib/resolver/AddModePlugin.js +18 -0
  55. package/lib/runtime/components/react/context.ts +13 -6
  56. package/lib/runtime/components/react/dist/context.d.ts +76 -0
  57. package/lib/runtime/components/react/dist/context.d.ts.map +1 -0
  58. package/lib/runtime/components/react/dist/context.js +1 -0
  59. package/lib/runtime/components/react/dist/event.config.d.ts +8 -0
  60. package/lib/runtime/components/react/dist/event.config.d.ts.map +1 -0
  61. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +8 -0
  62. package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +1 -0
  63. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +13 -0
  64. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +1 -0
  65. package/lib/runtime/components/react/dist/mpx-button.d.ts +69 -0
  66. package/lib/runtime/components/react/dist/mpx-button.d.ts.map +1 -0
  67. package/lib/runtime/components/react/dist/mpx-camera.d.ts +27 -0
  68. package/lib/runtime/components/react/dist/mpx-camera.d.ts.map +1 -0
  69. package/lib/runtime/components/react/dist/mpx-camera.jsx +197 -0
  70. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +24 -0
  71. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +1 -0
  72. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +8 -0
  73. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +1 -0
  74. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +7 -0
  75. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +1 -0
  76. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +21 -0
  77. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +1 -0
  78. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +9 -0
  79. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +1 -0
  80. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +11 -0
  81. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +1 -0
  82. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +3 -0
  83. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +1 -0
  84. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +33 -0
  85. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +1 -0
  86. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +53 -0
  87. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +1 -0
  88. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +21 -0
  89. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +1 -0
  90. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +33 -0
  91. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +1 -0
  92. package/lib/runtime/components/react/dist/mpx-form.d.ts +28 -0
  93. package/lib/runtime/components/react/dist/mpx-form.d.ts.map +1 -0
  94. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +19 -0
  95. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +1 -0
  96. package/lib/runtime/components/react/dist/mpx-image.d.ts +22 -0
  97. package/lib/runtime/components/react/dist/mpx-image.d.ts.map +1 -0
  98. package/lib/runtime/components/react/dist/mpx-image.jsx +81 -37
  99. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +8 -0
  100. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +1 -0
  101. package/lib/runtime/components/react/dist/mpx-input.d.ts +51 -0
  102. package/lib/runtime/components/react/dist/mpx-input.d.ts.map +1 -0
  103. package/lib/runtime/components/react/dist/mpx-input.jsx +37 -11
  104. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +13 -0
  105. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +1 -0
  106. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +61 -50
  107. package/lib/runtime/components/react/dist/mpx-label.d.ts +21 -0
  108. package/lib/runtime/components/react/dist/mpx-label.d.ts.map +1 -0
  109. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +21 -0
  110. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +1 -0
  111. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +66 -0
  112. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +1 -0
  113. package/lib/runtime/components/react/dist/mpx-nav.d.ts +9 -0
  114. package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +1 -0
  115. package/lib/runtime/components/react/dist/mpx-nav.jsx +132 -0
  116. package/lib/runtime/components/react/dist/mpx-navigator.d.ts +10 -0
  117. package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +1 -0
  118. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +7 -0
  119. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +1 -0
  120. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +8 -0
  121. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +1 -0
  122. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +7 -0
  123. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +1 -0
  124. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +7 -0
  125. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +1 -0
  126. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +7 -0
  127. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +1 -0
  128. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +3 -0
  129. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +1 -0
  130. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +7 -0
  131. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +1 -0
  132. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +7 -0
  133. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +1 -0
  134. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +107 -0
  135. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +1 -0
  136. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +33 -0
  137. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +1 -0
  138. package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +4 -3
  139. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +9 -0
  140. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +1 -0
  141. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +24 -0
  142. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +1 -0
  143. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +12 -18
  144. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +15 -0
  145. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +1 -0
  146. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.jsx +8 -11
  147. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +14 -0
  148. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +1 -0
  149. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.jsx +20 -0
  150. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +17 -0
  151. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +1 -0
  152. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +13 -0
  153. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +1 -0
  154. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +12 -0
  155. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +1 -0
  156. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +23 -0
  157. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +1 -0
  158. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +17 -0
  159. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +1 -0
  160. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +16 -0
  161. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +1 -0
  162. package/lib/runtime/components/react/dist/mpx-portal/index.jsx +5 -1
  163. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +30 -0
  164. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +1 -0
  165. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +10 -0
  166. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +1 -0
  167. package/lib/runtime/components/react/dist/mpx-progress.d.ts +24 -0
  168. package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +1 -0
  169. package/lib/runtime/components/react/dist/mpx-progress.jsx +26 -22
  170. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +21 -0
  171. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +1 -0
  172. package/lib/runtime/components/react/dist/mpx-radio.d.ts +27 -0
  173. package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +1 -0
  174. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +2 -0
  175. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +1 -0
  176. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +25 -0
  177. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +1 -0
  178. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +15 -0
  179. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +1 -0
  180. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +55 -0
  181. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +1 -0
  182. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +6 -14
  183. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +8 -0
  184. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +1 -0
  185. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +8 -0
  186. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +1 -0
  187. package/lib/runtime/components/react/dist/mpx-slider.d.ts +31 -0
  188. package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +1 -0
  189. package/lib/runtime/components/react/dist/mpx-slider.jsx +321 -0
  190. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +18 -0
  191. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +1 -0
  192. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +16 -0
  193. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +1 -0
  194. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +19 -0
  195. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +1 -0
  196. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +53 -0
  197. package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +1 -0
  198. package/lib/runtime/components/react/dist/mpx-swiper.jsx +9 -5
  199. package/lib/runtime/components/react/dist/mpx-switch.d.ts +27 -0
  200. package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +1 -0
  201. package/lib/runtime/components/react/dist/mpx-text.d.ts +23 -0
  202. package/lib/runtime/components/react/dist/mpx-text.d.ts.map +1 -0
  203. package/lib/runtime/components/react/dist/mpx-text.jsx +33 -5
  204. package/lib/runtime/components/react/dist/mpx-textarea.d.ts +8 -0
  205. package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +1 -0
  206. package/lib/runtime/components/react/dist/mpx-video.d.ts +102 -0
  207. package/lib/runtime/components/react/dist/mpx-video.d.ts.map +1 -0
  208. package/lib/runtime/components/react/dist/mpx-view.d.ts +35 -0
  209. package/lib/runtime/components/react/dist/mpx-view.d.ts.map +1 -0
  210. package/lib/runtime/components/react/dist/mpx-view.jsx +8 -11
  211. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +23 -0
  212. package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +1 -0
  213. package/lib/runtime/components/react/dist/mpx-web-view.jsx +1 -1
  214. package/lib/runtime/components/react/dist/parser.d.ts +40 -0
  215. package/lib/runtime/components/react/dist/parser.d.ts.map +1 -0
  216. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +33 -0
  217. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +1 -0
  218. package/lib/runtime/components/react/dist/useNodesRef.d.ts +12 -0
  219. package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +1 -0
  220. package/lib/runtime/components/react/dist/utils.d.ts +123 -0
  221. package/lib/runtime/components/react/dist/utils.d.ts.map +1 -0
  222. package/lib/runtime/components/react/dist/utils.jsx +16 -6
  223. package/lib/runtime/components/react/mpx-camera.tsx +275 -0
  224. package/lib/runtime/components/react/mpx-image.tsx +89 -42
  225. package/lib/runtime/components/react/mpx-input.tsx +44 -17
  226. package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +69 -49
  227. package/lib/runtime/components/react/mpx-nav.tsx +155 -0
  228. package/lib/runtime/components/react/mpx-picker-view/index.tsx +5 -2
  229. package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +26 -21
  230. package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItem.tsx +8 -12
  231. package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItemLite.tsx +55 -0
  232. package/lib/runtime/components/react/mpx-portal/index.tsx +8 -2
  233. package/lib/runtime/components/react/mpx-progress.tsx +26 -24
  234. package/lib/runtime/components/react/mpx-scroll-view.tsx +6 -17
  235. package/lib/runtime/components/react/mpx-slider.tsx +444 -0
  236. package/lib/runtime/components/react/mpx-swiper.tsx +9 -5
  237. package/lib/runtime/components/react/mpx-text.tsx +38 -5
  238. package/lib/runtime/components/react/mpx-view.tsx +8 -11
  239. package/lib/runtime/components/react/mpx-web-view.tsx +1 -1
  240. package/lib/runtime/components/react/types/common.d.ts +19 -0
  241. package/lib/runtime/components/react/utils.tsx +15 -6
  242. package/lib/runtime/components/web/mpx-input.vue +1 -1
  243. package/lib/runtime/components/web/mpx-scroll-view.vue +7 -1
  244. package/lib/runtime/components/web/mpx-video.vue +12 -1
  245. package/lib/runtime/optionProcessor.js +3 -1
  246. package/lib/runtime/optionProcessorReact.js +4 -2
  247. package/lib/runtime/stringify.wxs +2 -2
  248. package/lib/script-setup-compiler/index.js +2 -2
  249. package/lib/style-compiler/index.js +3 -2
  250. package/lib/style-compiler/load-postcss-config.js +1 -1
  251. package/lib/style-compiler/plugins/trans-special.js +10 -2
  252. package/lib/style-compiler/strip-conditional-loader.js +178 -15
  253. package/lib/template-compiler/bind-this.js +2 -2
  254. package/lib/template-compiler/compiler.js +277 -77
  255. package/lib/template-compiler/gen-node-react.js +18 -6
  256. package/lib/template-compiler/index.js +12 -10
  257. package/lib/template-compiler/parse-exps.js +1 -1
  258. package/lib/utils/chain-assign.js +47 -0
  259. package/lib/utils/check-core-version-match.js +75 -15
  260. package/lib/utils/const.js +2 -1
  261. package/lib/utils/dom-tag-config.js +6 -6
  262. package/lib/utils/env.js +6 -1
  263. package/lib/utils/get-build-tag-component.js +35 -0
  264. package/lib/utils/pre-process-json.js +5 -0
  265. package/lib/web/index.js +2 -0
  266. package/lib/web/processJSON.js +44 -16
  267. package/lib/web/processScript.js +1 -1
  268. package/lib/web/processTemplate.js +6 -4
  269. package/lib/web/script-helper.js +19 -9
  270. package/lib/wxs/pre-loader.js +6 -6
  271. package/lib/wxss/loader.js +1 -9
  272. package/package.json +17 -5
  273. package/LICENSE +0 -433
  274. package/lib/dependencies/ImportDependencyTemplate.js +0 -50
@@ -17,12 +17,12 @@ import { View } from 'react-native';
17
17
  import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing, runOnJS } from 'react-native-reanimated';
18
18
  import useInnerProps from './getInnerListeners';
19
19
  import useNodesRef from './useNodesRef';
20
- import { useLayout, useTransformStyle, extendObject } from './utils';
20
+ import { useLayout, useTransformStyle, extendObject, useRunOnJSCallback } from './utils';
21
21
  import Portal from './mpx-portal';
22
22
  const Progress = forwardRef((props, ref) => {
23
- const { percent = 0, 'stroke-width': strokeWidth = 6, color, activeColor = color || '#09BB07', backgroundColor = '#EBEBEB', active = false, 'active-mode': activeMode = 'backwards', duration = 30, bindactiveend, style = {}, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
23
+ const { percent = 0, 'stroke-width': strokeWidth = 6, color, activeColor = color || '#09BB07', backgroundColor = '#EBEBEB', active = false, 'active-mode': activeMode = 'backwards', duration = 30, style = {}, 'enable-var': enableVar, 'external-var-context': externalVarContext, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight } = props;
24
24
  const nodeRef = useRef(null);
25
- const propsRef = useRef({});
25
+ const propsRef = useRef(props);
26
26
  propsRef.current = props;
27
27
  // 进度值状态
28
28
  const [lastPercent, setLastPercent] = useState(0);
@@ -44,6 +44,21 @@ const Progress = forwardRef((props, ref) => {
44
44
  useNodesRef(props, ref, nodeRef, {
45
45
  style: normalStyle
46
46
  });
47
+ // 使用 useRunOnJSCallback 处理动画回调
48
+ const runOnJSCallbackRef = useRef({
49
+ triggerActiveEnd: (percent) => {
50
+ const currentProps = propsRef.current;
51
+ if (currentProps.bindactiveend) {
52
+ currentProps.bindactiveend({
53
+ type: 'activeend',
54
+ detail: {
55
+ percent: percent
56
+ }
57
+ });
58
+ }
59
+ }
60
+ });
61
+ const runOnJSCallback = useRunOnJSCallback(runOnJSCallbackRef);
47
62
  // 进度条动画函数
48
63
  const startProgressAnimation = (targetPercent, startPercent, animationDuration, onFinished) => {
49
64
  // 根据 active-mode 设置起始位置
@@ -53,22 +68,11 @@ const Progress = forwardRef((props, ref) => {
53
68
  easing: Easing.linear
54
69
  }, (finished) => {
55
70
  if (finished && onFinished) {
56
- // 在动画回调中,需要使用runOnJS回到主线程
57
- runOnJS(onFinished)();
71
+ // 在动画回调中,执行传入的worklet函数
72
+ onFinished();
58
73
  }
59
74
  });
60
75
  };
61
- // 创建在主线程执行的事件回调函数
62
- const triggerActiveEnd = (percent) => {
63
- if (bindactiveend) {
64
- bindactiveend({
65
- type: 'activeend',
66
- detail: {
67
- percent: percent
68
- }
69
- });
70
- }
71
- };
72
76
  // 进度变化时的动画效果
73
77
  useEffect(() => {
74
78
  const targetPercent = Math.max(0, Math.min(100, percent));
@@ -85,18 +89,18 @@ const Progress = forwardRef((props, ref) => {
85
89
  // 计算动画持续时间
86
90
  const percentDiff = Math.abs(targetPercent - startPercent);
87
91
  const animationDuration = percentDiff * duration;
88
- // 创建动画完成回调
89
- const onAnimationFinished = () => {
90
- triggerActiveEnd(targetPercent);
91
- };
92
92
  // 执行动画
93
- startProgressAnimation(targetPercent, startPercent, animationDuration, onAnimationFinished);
93
+ startProgressAnimation(targetPercent, startPercent, animationDuration, () => {
94
+ 'worklet';
95
+ // 在worklet函数内部执行runOnJS调用runOnJSCallback
96
+ runOnJS(runOnJSCallback)('triggerActiveEnd', targetPercent);
97
+ });
94
98
  }
95
99
  else {
96
100
  progressWidth.value = targetPercent;
97
101
  }
98
102
  setLastPercent(targetPercent);
99
- }, [percent, active, activeMode, duration, bindactiveend]);
103
+ }, [percent, active, activeMode, duration]);
100
104
  // 初始化时设置进度值
101
105
  useEffect(() => {
102
106
  if (!active) {
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ✔ bindchange
3
+ */
4
+ import { ReactNode } from 'react';
5
+ import { View, NativeSyntheticEvent, ViewStyle } from 'react-native';
6
+ import { HandlerRef } from './useNodesRef';
7
+ export interface RadioGroupProps {
8
+ name: string;
9
+ style?: ViewStyle & Record<string, any>;
10
+ 'enable-offset'?: boolean;
11
+ 'enable-var'?: boolean;
12
+ 'external-var-context'?: Record<string, any>;
13
+ 'parent-font-size'?: number;
14
+ 'parent-width'?: number;
15
+ 'parent-height'?: number;
16
+ children: ReactNode;
17
+ bindchange?: (evt: NativeSyntheticEvent<TouchEvent> | unknown) => void;
18
+ }
19
+ declare const radioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HandlerRef<View, RadioGroupProps>>>;
20
+ export default radioGroup;
21
+ //# sourceMappingURL=mpx-radio-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-radio-group.d.ts","sourceRoot":"","sources":["../mpx-radio-group.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAIL,SAAS,EAKV,MAAM,OAAO,CAAA;AACd,OAAO,EACL,IAAI,EACJ,oBAAoB,EACpB,SAAS,EACV,MAAM,cAAc,CAAA;AAKrB,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAIvD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,SAAS,CAAA;IACnB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;CACvE;AAED,QAAA,MAAM,UAAU,+HA8Id,CAAA;AAIF,eAAe,UAAU,CAAA"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * ✔ value
3
+ * ✔ disabled
4
+ * ✔ checked
5
+ * ✔ color
6
+ */
7
+ import { ReactNode } from 'react';
8
+ import { View, ViewStyle, NativeSyntheticEvent } from 'react-native';
9
+ import { HandlerRef } from './useNodesRef';
10
+ export interface RadioProps {
11
+ value?: string;
12
+ checked?: boolean;
13
+ disabled?: boolean;
14
+ color?: string;
15
+ style?: ViewStyle & Record<string, any>;
16
+ 'enable-offset'?: boolean;
17
+ 'enable-var'?: boolean;
18
+ 'external-var-context'?: Record<string, any>;
19
+ 'parent-font-size'?: number;
20
+ 'parent-width'?: number;
21
+ 'parent-height'?: number;
22
+ children: ReactNode;
23
+ bindtap?: (evt: NativeSyntheticEvent<TouchEvent> | unknown) => void;
24
+ }
25
+ declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HandlerRef<View, RadioProps>>>;
26
+ export default Radio;
27
+ //# sourceMappingURL=mpx-radio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-radio.d.ts","sourceRoot":"","sources":["../mpx-radio.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAgD,SAAS,EAAuD,MAAM,OAAO,CAAA;AACpI,OAAO,EAAE,IAAI,EAAc,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAIhF,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAKvD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;CACpE;AAoCD,QAAA,MAAM,KAAK,qHA8JV,CAAA;AAID,eAAe,KAAK,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const generateHTML: (html: string) => string;
2
+ //# sourceMappingURL=html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../mpx-rich-text/html.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,SAAU,MAAM,WAsCxC,CAAA"}
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * ✔ nodes
4
+ */
5
+ import { View, ViewProps, ViewStyle } from 'react-native';
6
+ import { HandlerRef } from '../useNodesRef';
7
+ type Node = {
8
+ type: 'node' | 'text';
9
+ name?: string;
10
+ attrs?: any;
11
+ children?: Array<Node>;
12
+ text: string;
13
+ };
14
+ interface _RichTextProps extends ViewProps {
15
+ style?: ViewStyle;
16
+ nodes: string | Array<Node>;
17
+ 'enable-var'?: boolean;
18
+ 'external-var-context'?: Record<string, any>;
19
+ 'parent-font-size'?: number;
20
+ 'parent-width'?: number;
21
+ 'parent-height'?: number;
22
+ }
23
+ declare const _RichText: import("react").ForwardRefExoticComponent<_RichTextProps & import("react").RefAttributes<HandlerRef<View, _RichTextProps>>>;
24
+ export default _RichText;
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../mpx-rich-text/index.tsx"],"names":[],"mappings":";AACA;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAGzD,OAAoB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAMxD,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,UAAU,cAAe,SAAQ,SAAS;IACxC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAyBD,QAAA,MAAM,SAAS,6HA4Eb,CAAA;AAIF,eAAe,SAAS,CAAA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * ✔ enable
3
+ */
4
+ import { ReactNode } from 'react';
5
+ interface RootPortalProps {
6
+ enable?: boolean;
7
+ children: ReactNode;
8
+ [x: string]: any;
9
+ }
10
+ declare const _RootPortal: {
11
+ (props: RootPortalProps): import("react").FunctionComponentElement<import("./mpx-portal/index").PortalProps>;
12
+ displayName: string;
13
+ };
14
+ export default _RootPortal;
15
+ //# sourceMappingURL=mpx-root-portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-root-portal.d.ts","sourceRoot":"","sources":["../mpx-root-portal.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAA2B,MAAM,OAAO,CAAA;AAG1D,UAAU,eAAe;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACjB;AAED,QAAA,MAAM,WAAW;YAAW,eAAe;;CAQ1C,CAAA;AAID,eAAe,WAAW,CAAA"}
@@ -0,0 +1,55 @@
1
+ import { View, NativeSyntheticEvent, NativeScrollEvent, ViewStyle } from 'react-native';
2
+ import { ReactNode } from 'react';
3
+ import { HandlerRef } from './useNodesRef';
4
+ import { GestureHandler } from './utils';
5
+ interface ScrollViewProps {
6
+ children?: ReactNode;
7
+ enhanced?: boolean;
8
+ bounces?: boolean;
9
+ style?: ViewStyle;
10
+ 'scroll-x'?: boolean;
11
+ 'scroll-y'?: boolean;
12
+ 'enable-back-to-top'?: boolean;
13
+ 'show-scrollbar'?: boolean;
14
+ 'paging-enabled'?: boolean;
15
+ 'upper-threshold'?: number;
16
+ 'lower-threshold'?: number;
17
+ 'scroll-with-animation'?: boolean;
18
+ 'refresher-triggered'?: boolean;
19
+ 'refresher-enabled'?: boolean;
20
+ 'refresher-default-style'?: 'black' | 'white' | 'none';
21
+ 'refresher-background'?: string;
22
+ 'refresher-threshold'?: number;
23
+ 'scroll-top'?: number;
24
+ 'scroll-left'?: number;
25
+ 'enable-offset'?: boolean;
26
+ 'scroll-into-view'?: string;
27
+ 'enable-trigger-intersection-observer'?: boolean;
28
+ 'enable-var'?: boolean;
29
+ 'external-var-context'?: Record<string, any>;
30
+ 'parent-font-size'?: number;
31
+ 'parent-width'?: number;
32
+ 'parent-height'?: number;
33
+ 'enable-sticky'?: boolean;
34
+ 'wait-for'?: Array<GestureHandler>;
35
+ 'simultaneous-handlers'?: Array<GestureHandler>;
36
+ 'scroll-event-throttle'?: number;
37
+ 'scroll-into-view-offset'?: number;
38
+ bindscrolltoupper?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
39
+ bindscrolltolower?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
40
+ bindscroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
41
+ bindrefresherrefresh?: (event: NativeSyntheticEvent<unknown>) => void;
42
+ binddragstart?: (event: NativeSyntheticEvent<DragEvent>) => void;
43
+ binddragging?: (event: NativeSyntheticEvent<DragEvent>) => void;
44
+ binddragend?: (event: NativeSyntheticEvent<DragEvent>) => void;
45
+ bindtouchstart?: (event: NativeSyntheticEvent<TouchEvent>) => void;
46
+ bindtouchmove?: (event: NativeSyntheticEvent<TouchEvent>) => void;
47
+ bindtouchend?: (event: NativeSyntheticEvent<TouchEvent>) => void;
48
+ bindscrollend?: (event: NativeSyntheticEvent<TouchEvent>) => void;
49
+ __selectRef?: (selector: string, nodeType: 'node' | 'component', all?: boolean) => HandlerRef<any, any>;
50
+ }
51
+ declare const _ScrollView: import("react").ForwardRefExoticComponent<ScrollViewProps & import("react").RefAttributes<HandlerRef<import("react").ForwardRefExoticComponent<import("react-native").ScrollViewProps & {
52
+ children?: ReactNode;
53
+ } & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react").ComponentType<any>>> & import("react-native").ScrollView & View, ScrollViewProps>>>;
54
+ export default _ScrollView;
55
+ //# sourceMappingURL=mpx-scroll-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-scroll-view.d.ts","sourceRoot":"","sources":["../mpx-scroll-view.tsx"],"names":[],"mappings":"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"}
@@ -48,8 +48,6 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
48
48
  const scrollOffset = useRef(new RNAnimated.Value(0)).current;
49
49
  const simultaneousHandlers = flatGesture(originSimultaneousHandlers);
50
50
  const waitForHandlers = flatGesture(waitFor);
51
- const snapScrollTop = useRef(0);
52
- const snapScrollLeft = useRef(0);
53
51
  const [refreshing, setRefreshing] = useState(false);
54
52
  const [enableScroll, setEnableScroll] = useState(true);
55
53
  const enableScrollValue = useSharedValue(true);
@@ -127,14 +125,12 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
127
125
  warn('scroll-x and scroll-y cannot be set to true at the same time, Mpx will use the value of scroll-y as the criterion');
128
126
  }
129
127
  useEffect(() => {
130
- if (snapScrollTop.current !== scrollTop || snapScrollLeft.current !== scrollLeft) {
131
- initialTimeout.current = setTimeout(() => {
132
- scrollToOffset(scrollLeft, scrollTop);
133
- }, 0);
134
- return () => {
135
- initialTimeout.current && clearTimeout(initialTimeout.current);
136
- };
137
- }
128
+ initialTimeout.current = setTimeout(() => {
129
+ scrollToOffset(scrollLeft, scrollTop);
130
+ }, 0);
131
+ return () => {
132
+ initialTimeout.current && clearTimeout(initialTimeout.current);
133
+ };
138
134
  }, [scrollTop, scrollLeft]);
139
135
  useEffect(() => {
140
136
  if (scrollIntoView && __selectRef) {
@@ -316,10 +312,6 @@ const _ScrollView = forwardRef((scrollViewProps = {}, ref) => {
316
312
  function scrollToOffset(x = 0, y = 0, animated = scrollWithAnimation) {
317
313
  if (scrollViewRef.current) {
318
314
  scrollViewRef.current.scrollTo({ x, y, animated });
319
- scrollOptions.current.scrollLeft = x;
320
- scrollOptions.current.scrollTop = y;
321
- snapScrollLeft.current = x;
322
- snapScrollTop.current = y;
323
315
  }
324
316
  }
325
317
  function onScrollTouchMove(e) {
@@ -0,0 +1,8 @@
1
+ import { TextProps } from 'react-native';
2
+ import { JSX } from 'react';
3
+ declare const SimpleText: {
4
+ (props: TextProps): JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default SimpleText;
8
+ //# sourceMappingURL=mpx-simple-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-simple-text.d.ts","sourceRoot":"","sources":["../mpx-simple-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAA;AAI1C,QAAA,MAAM,UAAU;YAAW,SAAS,GAAG,WAAW;;CAiBjD,CAAA;AAID,eAAe,UAAU,CAAA"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { ViewProps } from 'react-native';
3
+ declare const SimpleView: {
4
+ (simpleViewProps: ViewProps): JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default SimpleView;
8
+ //# sourceMappingURL=mpx-simple-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-simple-view.d.ts","sourceRoot":"","sources":["../mpx-simple-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAQ,SAAS,EAAa,MAAM,cAAc,CAAA;AAKzD,QAAA,MAAM,UAAU;sBAAqB,SAAS,GAAG,WAAW;;CAuB3D,CAAA;AAID,eAAe,UAAU,CAAA"}
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import { View, ViewStyle } from 'react-native';
3
+ import { HandlerRef } from './useNodesRef';
4
+ export interface SliderProps {
5
+ min?: number;
6
+ max?: number;
7
+ step?: number;
8
+ disabled?: boolean;
9
+ value?: number;
10
+ color?: string;
11
+ 'selected-color'?: string;
12
+ activeColor?: string;
13
+ backgroundColor?: string;
14
+ 'block-size'?: number;
15
+ 'block-color'?: string;
16
+ name?: string;
17
+ bindchange?: (event: any) => void;
18
+ catchchange?: (event: any) => void;
19
+ bindchanging?: (event: any) => void;
20
+ catchchanging?: (event: any) => void;
21
+ style?: ViewStyle & Record<string, any>;
22
+ 'enable-offset'?: boolean;
23
+ 'enable-var'?: boolean;
24
+ 'external-var-context'?: Record<string, any>;
25
+ 'parent-font-size'?: number;
26
+ 'parent-width'?: number;
27
+ 'parent-height'?: number;
28
+ }
29
+ declare const Slider: import("react").ForwardRefExoticComponent<SliderProps & import("react").RefAttributes<HandlerRef<View, SliderProps>>>;
30
+ export default Slider;
31
+ //# sourceMappingURL=mpx-slider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-slider.d.ts","sourceRoot":"","sources":["../mpx-slider.tsx"],"names":[],"mappings":";AA2BA,OAAO,EACL,IAAI,EACJ,SAAS,EACV,MAAM,cAAc,CAAA;AAMrB,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAKvD,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IACjC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IACnC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IACpC,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,QAAA,MAAM,MAAM,uHAqXV,CAAA;AAGF,eAAe,MAAM,CAAA"}