@mpxjs/webpack-plugin 2.10.17 → 2.10.18-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 (275) hide show
  1. package/lib/config.js +60 -0
  2. package/lib/file-loader.js +4 -1
  3. package/lib/global.d.ts +231 -0
  4. package/lib/index.js +71 -74
  5. package/lib/init.js +3 -0
  6. package/lib/json-compiler/index.js +13 -4
  7. package/lib/loader.js +4 -0
  8. package/lib/platform/json/wx/index.js +6 -0
  9. package/lib/platform/style/wx/index.js +102 -72
  10. package/lib/platform/template/wx/component-config/ad.js +5 -0
  11. package/lib/platform/template/wx/component-config/button.js +10 -3
  12. package/lib/platform/template/wx/component-config/camera.js +25 -3
  13. package/lib/platform/template/wx/component-config/canvas.js +8 -1
  14. package/lib/platform/template/wx/component-config/cover-image.js +7 -2
  15. package/lib/platform/template/wx/component-config/cover-view.js +3 -1
  16. package/lib/platform/template/wx/component-config/form.js +27 -2
  17. package/lib/platform/template/wx/component-config/image.js +5 -0
  18. package/lib/platform/template/wx/component-config/input.js +10 -0
  19. package/lib/platform/template/wx/component-config/label.js +10 -2
  20. package/lib/platform/template/wx/component-config/map.js +11 -0
  21. package/lib/platform/template/wx/component-config/movable-area.js +4 -1
  22. package/lib/platform/template/wx/component-config/movable-view.js +17 -2
  23. package/lib/platform/template/wx/component-config/navigator.js +26 -0
  24. package/lib/platform/template/wx/component-config/picker-view.js +12 -0
  25. package/lib/platform/template/wx/component-config/picker.js +3 -1
  26. package/lib/platform/template/wx/component-config/progress.js +11 -1
  27. package/lib/platform/template/wx/component-config/rich-text.js +5 -0
  28. package/lib/platform/template/wx/component-config/scroll-view.js +12 -1
  29. package/lib/platform/template/wx/component-config/slider.js +8 -0
  30. package/lib/platform/template/wx/component-config/swiper-item.js +5 -2
  31. package/lib/platform/template/wx/component-config/swiper.js +10 -0
  32. package/lib/platform/template/wx/component-config/text.js +5 -0
  33. package/lib/platform/template/wx/component-config/textarea.js +19 -2
  34. package/lib/platform/template/wx/component-config/titlebar.js +12 -0
  35. package/lib/platform/template/wx/component-config/unsupported.js +10 -1
  36. package/lib/platform/template/wx/component-config/video.js +10 -0
  37. package/lib/platform/template/wx/index.js +21 -1
  38. package/lib/react/LoadAsyncChunkModule.js +3 -6
  39. package/lib/react/processStyles.js +21 -9
  40. package/lib/react/script-helper.js +2 -2
  41. package/lib/react/style-helper.js +76 -13
  42. package/lib/resolver/AddModePlugin.js +17 -7
  43. package/lib/resolver/ExtendComponentsPlugin.js +60 -0
  44. package/lib/runtime/components/ali/mpx-section-list.mpx +566 -0
  45. package/lib/runtime/components/ali/mpx-sticky-header.mpx +212 -0
  46. package/lib/runtime/components/ali/mpx-sticky-section.mpx +17 -0
  47. package/lib/runtime/components/react/animationHooks/index.ts +75 -0
  48. package/lib/runtime/components/react/animationHooks/useAnimationAPIHooks.ts +197 -0
  49. package/lib/runtime/components/react/animationHooks/useTransitionHooks.ts +301 -0
  50. package/lib/runtime/components/react/animationHooks/utils.ts +197 -0
  51. package/lib/runtime/components/react/context.ts +12 -3
  52. package/lib/runtime/components/react/dist/animationHooks/index.d.ts +15 -0
  53. package/lib/runtime/components/react/dist/animationHooks/index.js +67 -0
  54. package/lib/runtime/components/react/dist/animationHooks/useAnimationAPIHooks.d.ts +3 -0
  55. package/lib/runtime/components/react/dist/animationHooks/useAnimationAPIHooks.js +181 -0
  56. package/lib/runtime/components/react/dist/animationHooks/useTransitionHooks.d.ts +3 -0
  57. package/lib/runtime/components/react/dist/animationHooks/useTransitionHooks.js +279 -0
  58. package/lib/runtime/components/react/dist/animationHooks/utils.d.ts +109 -0
  59. package/lib/runtime/components/react/dist/animationHooks/utils.js +151 -0
  60. package/lib/runtime/components/react/dist/context.d.ts +10 -3
  61. package/lib/runtime/components/react/dist/context.js +1 -2
  62. package/lib/runtime/components/react/dist/event.config.d.ts +0 -1
  63. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +0 -1
  64. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +0 -1
  65. package/lib/runtime/components/react/dist/mpx-async-suspense.jsx +3 -1
  66. package/lib/runtime/components/react/dist/mpx-button.d.ts +0 -1
  67. package/lib/runtime/components/react/dist/mpx-camera.d.ts +31 -0
  68. package/lib/runtime/components/react/dist/mpx-camera.jsx +236 -0
  69. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +0 -1
  70. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +0 -1
  71. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +0 -1
  72. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +0 -1
  73. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +0 -1
  74. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +0 -1
  75. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +0 -1
  76. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -1
  77. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +0 -1
  78. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -1
  79. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +0 -1
  80. package/lib/runtime/components/react/dist/mpx-form.d.ts +0 -1
  81. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -1
  82. package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -1
  83. package/lib/runtime/components/react/dist/mpx-image.jsx +2 -2
  84. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +0 -1
  85. package/lib/runtime/components/react/dist/mpx-input.d.ts +2 -1
  86. package/lib/runtime/components/react/dist/mpx-input.jsx +69 -50
  87. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +0 -1
  88. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +35 -6
  89. package/lib/runtime/components/react/dist/mpx-label.d.ts +0 -1
  90. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -1
  91. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +0 -1
  92. package/lib/runtime/components/react/dist/mpx-nav.d.ts +0 -1
  93. package/lib/runtime/components/react/dist/mpx-navigator.d.ts +0 -1
  94. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +0 -1
  95. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +0 -1
  96. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +0 -1
  97. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +0 -1
  98. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +0 -1
  99. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +0 -1
  100. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +0 -1
  101. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +0 -1
  102. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +0 -1
  103. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +0 -1
  104. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +0 -1
  105. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +0 -1
  106. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +0 -1
  107. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +0 -1
  108. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +0 -1
  109. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +0 -1
  110. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +0 -1
  111. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +0 -1
  112. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +0 -1
  113. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +0 -1
  114. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +0 -1
  115. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +0 -1
  116. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.jsx +2 -2
  117. package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -1
  118. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -1
  119. package/lib/runtime/components/react/dist/mpx-radio.d.ts +0 -1
  120. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +0 -1
  121. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -1
  122. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +0 -1
  123. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +0 -1
  124. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +84 -78
  125. package/lib/runtime/components/react/dist/mpx-section-list.d.ts +48 -0
  126. package/lib/runtime/components/react/dist/mpx-section-list.jsx +292 -0
  127. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +0 -1
  128. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +0 -1
  129. package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -1
  130. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +0 -1
  131. package/lib/runtime/components/react/dist/mpx-sticky-header.jsx +20 -20
  132. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +0 -1
  133. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +0 -1
  134. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +11 -1
  135. package/lib/runtime/components/react/dist/mpx-swiper.jsx +136 -83
  136. package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -1
  137. package/lib/runtime/components/react/dist/mpx-text.d.ts +0 -1
  138. package/lib/runtime/components/react/dist/mpx-textarea.d.ts +0 -1
  139. package/lib/runtime/components/react/dist/mpx-textarea.jsx +1 -0
  140. package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -1
  141. package/lib/runtime/components/react/dist/mpx-view.d.ts +3 -3
  142. package/lib/runtime/components/react/dist/mpx-view.jsx +22 -8
  143. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +0 -1
  144. package/lib/runtime/components/react/dist/mpx-web-view.jsx +1 -1
  145. package/lib/runtime/components/react/dist/parser.d.ts +0 -1
  146. package/lib/runtime/components/react/dist/useNodesRef.d.ts +0 -1
  147. package/lib/runtime/components/react/dist/utils.d.ts +10 -9
  148. package/lib/runtime/components/react/dist/utils.jsx +47 -24
  149. package/lib/runtime/components/react/mpx-async-suspense.tsx +3 -1
  150. package/lib/runtime/components/react/mpx-camera.tsx +327 -0
  151. package/lib/runtime/components/react/mpx-image.tsx +2 -2
  152. package/lib/runtime/components/react/mpx-input.tsx +71 -52
  153. package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +35 -6
  154. package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +10 -0
  155. package/lib/runtime/components/react/mpx-portal/portal-manager.tsx +2 -2
  156. package/lib/runtime/components/react/mpx-scroll-view.tsx +110 -114
  157. package/lib/runtime/components/react/mpx-section-list.tsx +439 -0
  158. package/lib/runtime/components/react/mpx-sticky-header.tsx +24 -24
  159. package/lib/runtime/components/react/mpx-swiper.tsx +174 -84
  160. package/lib/runtime/components/react/mpx-textarea.tsx +1 -0
  161. package/lib/runtime/components/react/mpx-view.tsx +27 -12
  162. package/lib/runtime/components/react/mpx-web-view.tsx +1 -1
  163. package/lib/runtime/components/react/tsconfig.json +26 -0
  164. package/lib/runtime/components/react/types/global.d.ts +1 -0
  165. package/lib/runtime/components/react/utils.tsx +51 -27
  166. package/lib/runtime/components/web/mpx-scroll-view.vue +5 -2
  167. package/lib/runtime/components/web/mpx-section-list.vue +551 -0
  168. package/lib/runtime/components/web/mpx-titlebar.vue +244 -0
  169. package/lib/runtime/components/wx/mpx-section-list-default/list-footer.mpx +26 -0
  170. package/lib/runtime/components/wx/mpx-section-list-default/list-header.mpx +26 -0
  171. package/lib/runtime/components/wx/mpx-section-list-default/list-item.mpx +26 -0
  172. package/lib/runtime/components/wx/mpx-section-list-default/section-header.mpx +26 -0
  173. package/lib/runtime/components/wx/mpx-section-list.mpx +209 -0
  174. package/lib/runtime/components/wx/mpx-sticky-header.mpx +40 -0
  175. package/lib/runtime/components/wx/mpx-sticky-section.mpx +31 -0
  176. package/lib/runtime/optionProcessor.js +5 -0
  177. package/lib/runtime/optionProcessorReact.js +7 -0
  178. package/lib/runtime/stringify.wxs +2 -2
  179. package/lib/script-setup-compiler/index.js +1 -2
  180. package/lib/style-compiler/strip-conditional.js +244 -0
  181. package/lib/template-compiler/compiler.js +89 -9
  182. package/lib/utils/const.js +29 -0
  183. package/lib/utils/dom-tag-config.js +1 -1
  184. package/lib/utils/string.js +25 -1
  185. package/lib/web/processMainScript.js +3 -1
  186. package/lib/wxss/loader.js +4 -1
  187. package/lib/wxss/utils.js +7 -2
  188. package/package.json +7 -14
  189. package/LICENSE +0 -433
  190. package/lib/runtime/components/react/dist/context.d.ts.map +0 -1
  191. package/lib/runtime/components/react/dist/event.config.d.ts.map +0 -1
  192. package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +0 -1
  193. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +0 -1
  194. package/lib/runtime/components/react/dist/mpx-button.d.ts.map +0 -1
  195. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +0 -1
  196. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +0 -1
  197. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +0 -1
  198. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +0 -1
  199. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +0 -1
  200. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +0 -1
  201. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +0 -1
  202. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +0 -1
  203. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +0 -1
  204. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +0 -1
  205. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +0 -1
  206. package/lib/runtime/components/react/dist/mpx-form.d.ts.map +0 -1
  207. package/lib/runtime/components/react/dist/mpx-icon/icons/cancel.png +0 -0
  208. package/lib/runtime/components/react/dist/mpx-icon/icons/clear.png +0 -0
  209. package/lib/runtime/components/react/dist/mpx-icon/icons/download.png +0 -0
  210. package/lib/runtime/components/react/dist/mpx-icon/icons/info.png +0 -0
  211. package/lib/runtime/components/react/dist/mpx-icon/icons/search.png +0 -0
  212. package/lib/runtime/components/react/dist/mpx-icon/icons/success.png +0 -0
  213. package/lib/runtime/components/react/dist/mpx-icon/icons/success_no_circle.png +0 -0
  214. package/lib/runtime/components/react/dist/mpx-icon/icons/waiting.png +0 -0
  215. package/lib/runtime/components/react/dist/mpx-icon/icons/warn.png +0 -0
  216. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +0 -1
  217. package/lib/runtime/components/react/dist/mpx-image.d.ts.map +0 -1
  218. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +0 -1
  219. package/lib/runtime/components/react/dist/mpx-input.d.ts.map +0 -1
  220. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +0 -1
  221. package/lib/runtime/components/react/dist/mpx-label.d.ts.map +0 -1
  222. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +0 -1
  223. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +0 -1
  224. package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +0 -1
  225. package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +0 -1
  226. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +0 -1
  227. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +0 -1
  228. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +0 -1
  229. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +0 -1
  230. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +0 -1
  231. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +0 -1
  232. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +0 -1
  233. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +0 -1
  234. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +0 -1
  235. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +0 -1
  236. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +0 -1
  237. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +0 -1
  238. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +0 -1
  239. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +0 -1
  240. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +0 -1
  241. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +0 -1
  242. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +0 -1
  243. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +0 -1
  244. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +0 -1
  245. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +0 -1
  246. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +0 -1
  247. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +0 -1
  248. package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +0 -1
  249. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +0 -1
  250. package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +0 -1
  251. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +0 -1
  252. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +0 -1
  253. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +0 -1
  254. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +0 -1
  255. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +0 -1
  256. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +0 -1
  257. package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +0 -1
  258. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +0 -1
  259. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +0 -1
  260. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +0 -1
  261. package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +0 -1
  262. package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +0 -1
  263. package/lib/runtime/components/react/dist/mpx-text.d.ts.map +0 -1
  264. package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +0 -1
  265. package/lib/runtime/components/react/dist/mpx-video.d.ts.map +0 -1
  266. package/lib/runtime/components/react/dist/mpx-view.d.ts.map +0 -1
  267. package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +0 -1
  268. package/lib/runtime/components/react/dist/parser.d.ts.map +0 -1
  269. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +0 -33
  270. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +0 -1
  271. package/lib/runtime/components/react/dist/useAnimationHooks.js +0 -289
  272. package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +0 -1
  273. package/lib/runtime/components/react/dist/utils.d.ts.map +0 -1
  274. package/lib/runtime/components/react/useAnimationHooks.ts +0 -320
  275. package/lib/style-compiler/strip-conditional-loader.js +0 -289
@@ -0,0 +1,244 @@
1
+ const fs = require('fs')
2
+
3
+ class Node {
4
+ constructor(type, condition = null) {
5
+ this.type = type // 'If', 'ElseIf', 'Else' 或 'Text'
6
+ this.condition = condition // If 或 Elif 的条件
7
+ this.children = []
8
+ this.value = ''
9
+ }
10
+ }
11
+
12
+ // 提取 css string 为 token
13
+ function tokenize(cssString) {
14
+ // Support /* ... */, // ..., and <!-- ... --> styles
15
+ // 1. : /\/\*\s*@mpx-(if|elif|else|endif)(?:\s*\(([\s\S]*?)\))?\s*\*\//g
16
+ // 2. : /\/\/\s*@mpx-(if|elif|else|endif)(?:\s*\((.*?)\))?\s*$/gm
17
+ // 3. : /<!--\s*@mpx-(if|elif|else|endif)(?:\s*\(([\s\S]*?)\))?\s*-->/g
18
+ // Combined:
19
+ const regex = /(?:\/\*\s*@mpx-(if|elif|else|endif)(?:\s*\(([\s\S]*?)\))?\s*\*\/)|(?:\/\/\s*@mpx-(if|elif|else|endif)(?:\s*\((.*?)\))?\s*)|(?:<!--\s*@mpx-(if|elif|else|endif)(?:\s*\(([\s\S]*?)\))?\s*-->)/g
20
+ const tokens = []
21
+ let lastIndex = 0
22
+ let match
23
+
24
+ while ((match = regex.exec(cssString)) !== null) {
25
+ // 如果 token 前有普通文本,生成文本 token
26
+ if (match.index > lastIndex) {
27
+ const text = cssString.substring(lastIndex, match.index)
28
+ tokens.push({ type: 'text', content: text })
29
+ }
30
+ // 1,2: (/* ... */)
31
+ // 3,4: (// ...)
32
+ // 5,6: (<!-- ... -->)
33
+ const type = match[1] || match[3] || match[5]
34
+ const condition = (match[2] || match[4] || match[6])
35
+
36
+ tokens.push({
37
+ type: type,
38
+ condition: condition ? condition.trim() : null
39
+ })
40
+ lastIndex = regex.lastIndex
41
+ }
42
+ // 处理结尾剩余的文本
43
+ if (lastIndex < cssString.length) {
44
+ const text = cssString.substring(lastIndex)
45
+ tokens.push({ type: 'text', content: text })
46
+ }
47
+ return tokens
48
+ }
49
+
50
+ // parse:将生成的 token 数组构造成嵌套的 AST
51
+ function parse(cssString) {
52
+ const tokens = tokenize(cssString)
53
+ const ast = []
54
+ const nodeStack = []
55
+ let currentChildren = ast
56
+ tokens.forEach(token => {
57
+ if (token.type === 'text') {
58
+ const node = new Node('Text')
59
+ node.value = token.content
60
+ currentChildren.push(node)
61
+ } else if (token.type === 'if') {
62
+ const node = new Node('If', token.condition)
63
+ currentChildren.push(node)
64
+ nodeStack.push(currentChildren)
65
+ currentChildren = node.children
66
+ } else if (token.type === 'elif') {
67
+ if (nodeStack.length === 0) {
68
+ throw new Error('[Mpx style error]: elif without a preceding if')
69
+ }
70
+ currentChildren = nodeStack[nodeStack.length - 1]
71
+ const node = new Node('ElseIf', token.condition)
72
+ currentChildren.push(node)
73
+ currentChildren = node.children
74
+ } else if (token.type === 'else') {
75
+ if (nodeStack.length === 0) {
76
+ throw new Error('[Mpx style error]: else without a preceding if')
77
+ }
78
+ currentChildren = nodeStack[nodeStack.length - 1]
79
+ const node = new Node('Else')
80
+ currentChildren.push(node)
81
+ currentChildren = node.children
82
+ } else if (token.type === 'endif') {
83
+ if (nodeStack.length > 0) {
84
+ currentChildren = nodeStack.pop()
85
+ }
86
+ }
87
+ })
88
+ if (nodeStack.length > 0) {
89
+ throw new Error('[Mpx strip conditional error]: mpx-if without a matching endif')
90
+ }
91
+ return ast
92
+ }
93
+
94
+ function evaluateCondition(condition, defs, filePath) {
95
+ try {
96
+ const keys = Object.keys(defs)
97
+ const values = keys.map(key => defs[key])
98
+ /* eslint-disable no-new-func */
99
+ const func = new Function(...keys, `return (${condition});`)
100
+ return func(...values)
101
+ } catch (e) {
102
+ console.error(`[Mpx style error] File: ${filePath}, Error evaluating condition: ${condition}`, e)
103
+ return false
104
+ }
105
+ }
106
+
107
+ function traverseAndEvaluate(ast, defs, filePath) {
108
+ let output = ''
109
+ let batchedIf = false
110
+ function traverse(nodes) {
111
+ for (const node of nodes) {
112
+ if (node.type === 'Text') {
113
+ output += node.value
114
+ } else if (node.type === 'If') {
115
+ // 直接判断 If 节点
116
+ batchedIf = false
117
+ if (evaluateCondition(node.condition, defs, filePath)) {
118
+ traverse(node.children)
119
+ batchedIf = true
120
+ }
121
+ } else if (node.type === 'ElseIf' && !batchedIf) {
122
+ if (evaluateCondition(node.condition, defs, filePath)) {
123
+ traverse(node.children)
124
+ batchedIf = true
125
+ }
126
+ } else if (node.type === 'Else' && !batchedIf) {
127
+ traverse(node.children)
128
+ }
129
+ }
130
+ }
131
+ traverse(ast)
132
+ return output
133
+ }
134
+
135
+ /**
136
+ *
137
+ * @param {string} content
138
+ * @param {Record<string, any>} defs
139
+ * @param {string} [filePath]
140
+ * @returns
141
+ */
142
+ function stripCondition(content, defs, filePath) {
143
+ const ast = parse(content)
144
+ return traverseAndEvaluate(ast, defs, filePath || 'unknown')
145
+ }
146
+
147
+ let proxyReadFileSync
148
+ let proxyReadFile
149
+ const rawReadFileSync = fs.readFileSync
150
+ const rawReadFile = fs.readFile
151
+
152
+ let isRewritten = false
153
+ let __compilation = null
154
+
155
+ function registerStripCompilation(compilation) {
156
+ __compilation = compilation
157
+ }
158
+
159
+ function logStripError(path, e) {
160
+ const msg = `[Mpx strip conditional error]\n path: ${path}\n message: ${e && e.message}\n stack:\n${e && e.stack}`
161
+ console.error(msg)
162
+ if (__compilation && Array.isArray(__compilation.errors)) {
163
+ const err = new Error(msg)
164
+ err.file = path
165
+ __compilation.errors.push(err)
166
+ }
167
+ }
168
+
169
+ function rewriteFSForCss() {
170
+ if (isRewritten) return
171
+ isRewritten = true
172
+ fs.readFileSync = function () {
173
+ return (proxyReadFileSync || rawReadFileSync).apply(fs, arguments)
174
+ }
175
+ fs.readFile = function () {
176
+ return (proxyReadFile || rawReadFile).apply(fs, arguments)
177
+ }
178
+ }
179
+
180
+ function startFSStripForCss(defs) {
181
+ function shouldStrip(path) {
182
+ return typeof path === 'string' && /\.(styl|scss|sass|less|css|mpx)$/.test(path)
183
+ }
184
+ proxyReadFileSync = function (path, options) {
185
+ const content = rawReadFileSync.call(fs, path, options)
186
+ if (shouldStrip(path)) {
187
+ try {
188
+ if (typeof content === 'string') {
189
+ return stripCondition(content, defs, path)
190
+ } else if (Buffer.isBuffer(content)) {
191
+ const str = content.toString('utf-8')
192
+ const result = stripCondition(str, defs, path)
193
+ if (result !== str) {
194
+ return Buffer.from(result, 'utf-8')
195
+ }
196
+ }
197
+ } catch (e) {
198
+ logStripError(path, e)
199
+ return content
200
+ }
201
+ }
202
+ return content
203
+ }
204
+
205
+ proxyReadFile = function () {
206
+ const args = Array.from(arguments)
207
+ const callback = args[args.length - 1]
208
+ const path = args[0]
209
+
210
+ if (typeof callback !== 'function') {
211
+ return rawReadFile.apply(fs, args)
212
+ }
213
+
214
+ const wrappedCallback = (err, data) => {
215
+ if (err) return callback(err)
216
+ if (shouldStrip(path)) {
217
+ try {
218
+ if (typeof data === 'string') {
219
+ const result = stripCondition(data, defs, path)
220
+ return callback(null, result)
221
+ } else if (Buffer.isBuffer(data)) {
222
+ const content = data.toString('utf-8')
223
+ const result = stripCondition(content, defs, path)
224
+ if (result !== content) {
225
+ return callback(null, Buffer.from(result, 'utf-8'))
226
+ }
227
+ }
228
+ } catch (e) {
229
+ logStripError(path, e)
230
+ return callback(null, data)
231
+ }
232
+ }
233
+ callback(null, data)
234
+ }
235
+
236
+ args[args.length - 1] = wrappedCallback
237
+ return rawReadFile.apply(fs, args)
238
+ }
239
+ }
240
+
241
+ module.exports.stripCondition = stripCondition
242
+ module.exports.rewriteFSForCss = rewriteFSForCss
243
+ module.exports.startFSStripForCss = startFSStripForCss
244
+ module.exports.registerStripCompilation = registerStripCompilation
@@ -1,7 +1,7 @@
1
1
  const JSON5 = require('json5')
2
2
  const he = require('he')
3
3
  const config = require('../config')
4
- const { MPX_ROOT_VIEW, MPX_APP_MODULE_ID, PARENT_MODULE_ID, MPX_TAG_PAGE_SELECTOR } = require('../utils/const')
4
+ const { MPX_ROOT_VIEW, MPX_APP_MODULE_ID, PARENT_MODULE_ID, MPX_TAG_PAGE_SELECTOR, EXTEND_COMPONENT_CONFIG } = require('../utils/const')
5
5
  const normalize = require('../utils/normalize')
6
6
  const { normalizeCondition } = require('../utils/match-condition')
7
7
  const isValidIdentifierStr = require('../utils/is-valid-identifier-str')
@@ -764,9 +764,7 @@ function parse (template, options) {
764
764
 
765
765
  const children = currentParent.children
766
766
 
767
- const isTextLikeParent = currentParent.tag === 'text' || currentParent.tag === 'mpx-text' || currentParent.tag === 'Text' || currentParent.tag === 'mpx-simple-text'
768
-
769
- if (!isTextLikeParent) {
767
+ if (currentParent.tag !== 'text') {
770
768
  text = text.trim()
771
769
  } else {
772
770
  text = text.trim() ? text : ''
@@ -2247,7 +2245,6 @@ function postProcessIfReact (el) {
2247
2245
  delete el.elseif
2248
2246
  el._if = true
2249
2247
  addIfCondition(ifNode, {
2250
- exp: el.elseif.exp,
2251
2248
  block: el
2252
2249
  })
2253
2250
  removeNode(el, true)
@@ -2435,7 +2432,11 @@ function isRealNode (el) {
2435
2432
  }
2436
2433
 
2437
2434
  function isComponentNode (el) {
2438
- return usingComponents.indexOf(el.tag) !== -1 || el.tag === 'component' || componentGenerics[el.tag]
2435
+ return usingComponents.indexOf(el.tag) !== -1 || el.tag === 'component' || componentGenerics[el.tag] || isExtendComponentNode(el)
2436
+ }
2437
+
2438
+ function isExtendComponentNode (el) {
2439
+ return EXTEND_COMPONENT_CONFIG[el.tag]?.[mode]
2439
2440
  }
2440
2441
 
2441
2442
  function getComponentInfo (el) {
@@ -2443,7 +2444,7 @@ function getComponentInfo (el) {
2443
2444
  }
2444
2445
 
2445
2446
  function isReactComponent (el) {
2446
- return !isComponentNode(el) && isRealNode(el) && !el.isBuiltIn
2447
+ return !isComponentNode(el) && isRealNode(el) && !el.isBuiltIn && !isExtendComponentNode(el)
2447
2448
  }
2448
2449
 
2449
2450
  function processExternalClasses (el, options) {
@@ -2615,6 +2616,78 @@ function postProcessAliComponentRootView (el, options, meta) {
2615
2616
  }
2616
2617
  }
2617
2618
 
2619
+ function getWebTitleBarContainer(root, options, meta) {
2620
+ // titlebar 容器(替代 .wx-titlebar)
2621
+ const titlebarStyle = 'position:fixed;top:0;left:0;right:0;width:100%;box-sizing:border-box;z-index:99999;background-color:#ffffff;height:calc(44px + env(safe-area-inset-top, 0px));padding-top:env(safe-area-inset-top, 0px);display:flex;align-items:center;justify-content:center;user-select:none;'
2622
+ const titlebar = createASTElement('view', [
2623
+ { name: 'style', value: titlebarStyle },
2624
+ { name: 'wx:if', value: '{{($options?.__mpxPageConfig?.navigationStyle || global?.__mpxPageConfig?.navigationStyle) !== "custom"}}' }
2625
+ ])
2626
+
2627
+ // 左侧返回按钮容器(替代 .wx-titlebar__left)
2628
+ const leftStyle = 'position:absolute;left:12px;top:env(safe-area-inset-top, 0px);height:44px;display:flex;align-items:center;cursor:pointer;opacity:0.9;transition:opacity 0.15s;'
2629
+ const left = createASTElement('view', [
2630
+ { name: 'style', value: leftStyle },
2631
+ { name: '@tap', value: '() => this.$router.back()' }
2632
+ ])
2633
+
2634
+ // svg 图标(替代 .wx-titlebar__back-icon)
2635
+ const svg = createASTElement('svg', [
2636
+ { name: 'style', value: 'width:18px;height:18px;fill:#000;' },
2637
+ { name: 'viewBox', value: '0 0 1024 1024' }
2638
+ ])
2639
+
2640
+ const path = createASTElement('path', [
2641
+ { name: 'd', value: 'M621.6 170.4L408.8 384l212.8 213.6-59.2 59.2L290.4 384 562.4 111.2z' }
2642
+ ])
2643
+
2644
+ // 标题(替代 .wx-titlebar__title)
2645
+ const titleStyle = 'font-size:17px;font-weight:500;color:#111;line-height:44px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:70%;text-align:center;'
2646
+ const title = createASTElement('view', [
2647
+ { name: 'style', value: titleStyle }
2648
+ ])
2649
+
2650
+ const text = {
2651
+ type: 3,
2652
+ // 支付宝小程序模板解析中未对Mustache进行特殊处理,无论是否decode都会解析失败,无解,只能支付宝侧进行修复
2653
+ text: '{{$options.__mpxPageConfig.navigationBarTitleText}}'
2654
+ }
2655
+
2656
+ // 页面内容容器(替代 .page-content),并保留原始内部 transform
2657
+ const contentStyle = 'transform: translateX(0);margin-top:calc(44px + env(safe-area-inset-top, 0px));padding:16px;'
2658
+ const content = createASTElement('view', [
2659
+ { name: 'style', value: contentStyle }
2660
+ ])
2661
+
2662
+ // 组装节点树
2663
+ addChild(svg, path)
2664
+ addChild(left, svg)
2665
+
2666
+ addChild(title, text)
2667
+
2668
+ addChild(titlebar, left)
2669
+ addChild(titlebar, title)
2670
+
2671
+ addChild(root, titlebar)
2672
+ addChild(root, content)
2673
+
2674
+ // processElement(root, root, options, meta)
2675
+ processElement(titlebar, root, options, meta)
2676
+ closeElement(titlebar, options, meta)
2677
+ processElement(left, root, options, meta)
2678
+ // closeElement(left, options, meta)
2679
+ processElement(svg, root, options, meta)
2680
+ processElement(path, root, options, meta)
2681
+ processElement(title, root, options, meta)
2682
+ processElement(content, root, options, meta)
2683
+ processText(text, options, meta)
2684
+
2685
+ return {
2686
+ content,
2687
+ titlebar
2688
+ }
2689
+ }
2690
+
2618
2691
  // 有virtualHost情况wx组件注入virtualHost。无virtualHost阿里组件注入root-view。其他跳过。
2619
2692
  function getVirtualHostRoot (options, meta) {
2620
2693
  if (srcMode === 'wx') {
@@ -2651,7 +2724,14 @@ function getVirtualHostRoot (options, meta) {
2651
2724
  }
2652
2725
  }
2653
2726
  if (isWeb(mode) && ctorType === 'page') {
2654
- return createASTElement('page')
2727
+ const rootView = createASTElement('mpx-titlebar', [
2728
+ {
2729
+ name: 'pageConfig',
2730
+ value: '{{ this.$options.__mpxPageConfig }}'
2731
+ }
2732
+ ])
2733
+ processElement(rootView, rootView, options, meta)
2734
+ return rootView
2655
2735
  }
2656
2736
  if (isReact(mode) && ctorType === 'page') {
2657
2737
  const rootView = createASTElement('view', [
@@ -2720,7 +2800,7 @@ function postProcessTemplate (el) {
2720
2800
  }
2721
2801
  }
2722
2802
 
2723
- const isValidMode = makeMap('wx,ali,swan,tt,qq,web,qa,jd,dd,tenon,ios,android,harmony,noMode')
2803
+ const isValidMode = makeMap('wx,ali,swan,tt,qq,web,qa,jd,dd,tenon,ios,android,harmony,ks,noMode')
2724
2804
 
2725
2805
  function isValidModeP (i) {
2726
2806
  return isValidMode(i[0] === '_' ? i.slice(1) : i)
@@ -1,3 +1,5 @@
1
+ const componentPrefixPath = '@mpxjs/webpack-plugin/lib/runtime/components'
2
+
1
3
  module.exports = {
2
4
  MPX_PROCESSED_FLAG: 'mpx_processed',
3
5
  MPX_DISABLE_EXTRACTOR_CACHE: 'mpx_disable_extractor_cache',
@@ -7,5 +9,32 @@ module.exports = {
7
9
  MPX_ROOT_VIEW: 'mpx-root-view', // 根节点类名
8
10
  MPX_APP_MODULE_ID: 'mpx-app-scope', // app文件moduleId
9
11
  PARENT_MODULE_ID: '__pid',
12
+ // 扩展组件的平台配置:声明哪些组件在哪些平台有专用实现,哪些使用公共组件
13
+ EXTEND_COMPONENT_CONFIG: {
14
+ 'section-list': {
15
+ wx: `${componentPrefixPath}/wx/mpx-section-list.mpx`,
16
+ ali: `${componentPrefixPath}/ali/mpx-section-list.mpx`,
17
+ web: `${componentPrefixPath}/web/mpx-section-list.vue`,
18
+ ios: `${componentPrefixPath}/react/dist/mpx-section-list.jsx`,
19
+ android: `${componentPrefixPath}/react/dist/mpx-section-list.jsx`,
20
+ harmony: `${componentPrefixPath}/react/dist/mpx-section-list.jsx`
21
+ },
22
+ 'sticky-header': {
23
+ wx: `${componentPrefixPath}/wx/mpx-sticky-header.mpx`,
24
+ ali: `${componentPrefixPath}/ali/mpx-sticky-header.mpx`,
25
+ web: `${componentPrefixPath}/web/mpx-sticky-header.vue`,
26
+ ios: `${componentPrefixPath}/react/dist/mpx-sticky-header.jsx`,
27
+ android: `${componentPrefixPath}/react/dist/mpx-sticky-header.jsx`,
28
+ harmony: `${componentPrefixPath}/react/dist/mpx-sticky-header.jsx`
29
+ },
30
+ 'sticky-section': {
31
+ wx: `${componentPrefixPath}/wx/mpx-sticky-section.mpx`,
32
+ ali: `${componentPrefixPath}/ali/mpx-sticky-section.mpx`,
33
+ web: `${componentPrefixPath}/web/mpx-sticky-section.vue`,
34
+ ios: `${componentPrefixPath}/react/dist/mpx-sticky-section.jsx`,
35
+ android: `${componentPrefixPath}/react/dist/mpx-sticky-section.jsx`,
36
+ harmony: `${componentPrefixPath}/react/dist/mpx-sticky-section.jsx`
37
+ }
38
+ },
10
39
  MPX_TAG_PAGE_SELECTOR: 'mpx-page'
11
40
  }
@@ -91,7 +91,7 @@ const isBuildInReactTag = makeMap(
91
91
  'mpx-movable-area,mpx-label,mpx-input,' +
92
92
  'mpx-image,mpx-form,mpx-checkbox,mpx-checkbox-group,mpx-button,' +
93
93
  'mpx-rich-text,mpx-picker-view-column,mpx-picker-view,mpx-picker,' +
94
- 'mpx-icon,mpx-canvas'
94
+ 'mpx-icon,mpx-canvas,mpx-camera'
95
95
  )
96
96
 
97
97
  const isSpace = makeMap('ensp,emsp,nbsp')
@@ -28,9 +28,33 @@ function trimBlankRow (str) {
28
28
  return str.replace(/^\s*[\r\n]/gm, '')
29
29
  }
30
30
 
31
+ // 多value解析
32
+ function parseValues (str, char = ' ') {
33
+ let stack = 0
34
+ let temp = ''
35
+ const result = []
36
+ for (let i = 0; i < str.length; i++) {
37
+ if (str[i] === '(') {
38
+ stack++
39
+ } else if (str[i] === ')') {
40
+ stack--
41
+ }
42
+ // 非括号内 或者 非分隔字符且非空
43
+ if (stack !== 0 || str[i] !== char) {
44
+ temp += str[i]
45
+ }
46
+ if ((stack === 0 && str[i] === char) || i === str.length - 1) {
47
+ result.push(temp.trim())
48
+ temp = ''
49
+ }
50
+ }
51
+ return result
52
+ }
53
+
31
54
  module.exports = {
32
55
  isCapital,
33
56
  isMustache,
34
57
  capitalToHyphen,
35
- trimBlankRow
58
+ trimBlankRow,
59
+ parseValues
36
60
  }
@@ -60,7 +60,9 @@ Vue.use(VueRouter)\n`
60
60
  globalTabBar
61
61
  })
62
62
 
63
- output += `var App = require(${stringifyRequest(loaderContext, addQuery(loaderContext.resource, { isApp: true }))}).default\n`
63
+ output += `var App = require(${stringifyRequest(loaderContext, addQuery(loaderContext.resource, { isApp: true }))}).default;\n`
64
+
65
+ output += `Vue.component('mpx-titlebar', require(${stringifyRequest(loaderContext, normalize.lib('runtime/components/web/mpx-titlebar.vue'))}).default);\n`
64
66
 
65
67
  output += `
66
68
  export default processAppOption({
@@ -92,6 +92,9 @@ module.exports = async function loader (content, map, meta) {
92
92
  filter: options.import.filter,
93
93
  urlHandler: (url) => {
94
94
  url = combineRequests(getPreRequester(this)(options.importLoaders), url)
95
+ if (isRN) {
96
+ return stringifyRequest(this, url)
97
+ }
95
98
  return getRequestString('styles', { src: url }, {
96
99
  isStatic: true,
97
100
  issuerResource: this.resource,
@@ -249,7 +252,7 @@ module.exports = async function loader (content, map, meta) {
249
252
  let moduleCode
250
253
 
251
254
  try {
252
- moduleCode = getModuleCode(result, api, replacements, options, this)
255
+ moduleCode = getModuleCode(result, api, replacements, options, isRN, this)
253
256
  } catch (error) {
254
257
  callback(error)
255
258
 
package/lib/wxss/utils.js CHANGED
@@ -1016,6 +1016,7 @@ function getModuleCode (
1016
1016
  api,
1017
1017
  replacements,
1018
1018
  options,
1019
+ isRN,
1019
1020
  loaderContext
1020
1021
  ) {
1021
1022
  if (options.modules.exportOnlyLocals === true) {
@@ -1054,8 +1055,12 @@ function getModuleCode (
1054
1055
  } else {
1055
1056
  // 符合css后缀名的文件经过mpx处理后会带上相应的后缀防止使用 webpack 的默认解析规则,此时 require/import 相应路径时,导出的不是一段 css 代码了,事实上是一个文件路径。
1056
1057
  const printedParam = printParams(media, dedupe, supports, layer)
1057
- const otherParams = printedParam.length > 0 ? printedParam : ''
1058
- beforeCode += `___CSS_LOADER_EXPORT___.push([module.id, '@import "' + ${item.importName} + '";', ${JSON.stringify(otherParams)} ]);\n`
1058
+ const hasParams = printedParam.length > 0
1059
+ if (isRN) {
1060
+ beforeCode += `___CSS_LOADER_EXPORT___.i(${item.importName}${hasParams ? `, ${printedParam}` : ''});\n`
1061
+ } else {
1062
+ beforeCode += `___CSS_LOADER_EXPORT___.push([module.id, '@import "' + ${item.importName} + '";'${hasParams ? `, ${printedParam}` : ''}]);\n`
1063
+ }
1059
1064
  }
1060
1065
  }
1061
1066
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.17",
3
+ "version": "2.10.18-beta.10",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -29,7 +29,7 @@
29
29
  "@better-scroll/wheel": "^2.5.1",
30
30
  "@better-scroll/zoom": "^2.5.1",
31
31
  "@mpxjs/template-engine": "^2.8.7",
32
- "@mpxjs/utils": "^2.10.17",
32
+ "@mpxjs/utils": "^2.10.18",
33
33
  "acorn": "^8.11.3",
34
34
  "acorn-walk": "^7.2.0",
35
35
  "async": "^2.6.0",
@@ -51,25 +51,18 @@
51
51
  "mime": "^2.2.2",
52
52
  "object-assign": "^4.1.1",
53
53
  "postcss": "^8.4.5",
54
- "postcss-import": "^16.1.1",
55
- "postcss-less": "^6.0.0",
56
54
  "postcss-load-config": "^3.1.1",
57
55
  "postcss-modules-extract-imports": "^3.0.0",
58
56
  "postcss-modules-local-by-default": "^4.0.0",
59
57
  "postcss-modules-scope": "^3.0.0",
60
58
  "postcss-modules-values": "^4.0.0",
61
- "postcss-scss": "^4.0.9",
62
59
  "postcss-selector-parser": "^6.0.8",
63
- "postcss-styl": "^0.12.3",
64
60
  "postcss-value-parser": "^4.0.2",
65
61
  "semver": "^7.5.4",
66
62
  "source-list-map": "^2.0.0",
67
63
  "webpack-virtual-modules": "^0.6.0"
68
64
  },
69
65
  "peerDependencies": {
70
- "postcss-less": "^6.0.0",
71
- "postcss-scss": "^4.0.9",
72
- "postcss-styl": "^0.12.3",
73
66
  "webpack": "^5.75.0"
74
67
  },
75
68
  "publishConfig": {
@@ -87,15 +80,14 @@
87
80
  "scripts": {
88
81
  "test": "jest --passWithNoTests",
89
82
  "copy-icons": "cp -r ./lib/runtime/components/react/mpx-icon/icons ./lib/runtime/components/react/dist/mpx-icon/icons",
90
- "build": "rimraf ./lib/runtime/components/react/dist && tsc && npm run copy-icons"
83
+ "build": "rimraf ./lib/runtime/components/react/dist && tsc -p ./lib/runtime/components/react/tsconfig.json && npm run copy-icons"
91
84
  },
92
85
  "devDependencies": {
93
86
  "@d11/react-native-fast-image": "^8.6.12",
94
- "@mpxjs/api-proxy": "^2.10.17",
87
+ "@mpxjs/api-proxy": "^2.10.18",
95
88
  "@types/babel-traverse": "^6.25.4",
96
89
  "@types/babel-types": "^7.0.4",
97
90
  "@types/glob": "^8.1.0",
98
- "@types/postcss-import": "^14.0.3",
99
91
  "@types/react": "^18.2.79",
100
92
  "glob": "^11.0.2",
101
93
  "react-native": "^0.74.5",
@@ -106,10 +98,11 @@
106
98
  "react-native-svg": "^15.8.0",
107
99
  "react-native-video": "^6.9.0",
108
100
  "react-native-webview": "^13.12.2",
109
- "rimraf": "^6.0.1"
101
+ "rimraf": "^6.0.1",
102
+ "webpack": "^5.75.0"
110
103
  },
111
104
  "engines": {
112
105
  "node": ">=14.14.0"
113
106
  },
114
- "gitHead": "33fbd0bb8d4b83555239a8931fabb23022af0866"
107
+ "gitHead": "2d37697869b9bdda3efab92dda8c910b68fd05c0"
115
108
  }