@mpxjs/webpack-plugin 2.10.15-prelease.1 → 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 (257) hide show
  1. package/lib/config.js +60 -0
  2. package/lib/dependencies/AppEntryDependency.js +2 -2
  3. package/lib/dependencies/RecordModuleIdMapDependency.js +49 -0
  4. package/lib/dependencies/ResolveDependency.js +1 -1
  5. package/lib/file-loader.js +13 -3
  6. package/lib/helpers.js +2 -0
  7. package/lib/index.js +40 -15
  8. package/lib/json-compiler/helper.js +72 -2
  9. package/lib/json-compiler/index.js +16 -56
  10. package/lib/json-compiler/plugin.js +2 -2
  11. package/lib/loader.js +10 -4
  12. package/lib/native-loader.js +6 -3
  13. package/lib/platform/json/wx/index.js +30 -29
  14. package/lib/platform/style/wx/index.js +8 -1
  15. package/lib/platform/template/wx/component-config/ad.js +5 -0
  16. package/lib/platform/template/wx/component-config/button.js +21 -5
  17. package/lib/platform/template/wx/component-config/camera.js +25 -3
  18. package/lib/platform/template/wx/component-config/canvas.js +8 -1
  19. package/lib/platform/template/wx/component-config/component.js +31 -33
  20. package/lib/platform/template/wx/component-config/cover-image.js +7 -2
  21. package/lib/platform/template/wx/component-config/cover-view.js +3 -1
  22. package/lib/platform/template/wx/component-config/fix-component-name.js +2 -2
  23. package/lib/platform/template/wx/component-config/form.js +27 -2
  24. package/lib/platform/template/wx/component-config/image.js +5 -0
  25. package/lib/platform/template/wx/component-config/input.js +10 -0
  26. package/lib/platform/template/wx/component-config/label.js +10 -2
  27. package/lib/platform/template/wx/component-config/map.js +11 -0
  28. package/lib/platform/template/wx/component-config/movable-area.js +4 -1
  29. package/lib/platform/template/wx/component-config/movable-view.js +17 -2
  30. package/lib/platform/template/wx/component-config/navigator.js +26 -0
  31. package/lib/platform/template/wx/component-config/picker-view.js +12 -0
  32. package/lib/platform/template/wx/component-config/picker.js +3 -1
  33. package/lib/platform/template/wx/component-config/progress.js +11 -1
  34. package/lib/platform/template/wx/component-config/rich-text.js +5 -0
  35. package/lib/platform/template/wx/component-config/scroll-view.js +12 -1
  36. package/lib/platform/template/wx/component-config/slider.js +8 -0
  37. package/lib/platform/template/wx/component-config/swiper-item.js +5 -2
  38. package/lib/platform/template/wx/component-config/swiper.js +10 -0
  39. package/lib/platform/template/wx/component-config/text.js +5 -0
  40. package/lib/platform/template/wx/component-config/textarea.js +19 -2
  41. package/lib/platform/template/wx/component-config/unsupported.js +10 -1
  42. package/lib/platform/template/wx/component-config/video.js +10 -0
  43. package/lib/platform/template/wx/index.js +21 -1
  44. package/lib/react/index.js +2 -0
  45. package/lib/react/processJSON.js +39 -71
  46. package/lib/react/processStyles.js +3 -2
  47. package/lib/react/processTemplate.js +8 -6
  48. package/lib/react/script-helper.js +6 -16
  49. package/lib/react/style-helper.js +10 -2
  50. package/lib/runtime/components/react/context.ts +13 -6
  51. package/lib/runtime/components/react/dist/context.d.ts +76 -0
  52. package/lib/runtime/components/react/dist/context.d.ts.map +1 -0
  53. package/lib/runtime/components/react/dist/context.js +1 -0
  54. package/lib/runtime/components/react/dist/event.config.d.ts +8 -0
  55. package/lib/runtime/components/react/dist/event.config.d.ts.map +1 -0
  56. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +8 -0
  57. package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +1 -0
  58. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +13 -0
  59. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +1 -0
  60. package/lib/runtime/components/react/dist/mpx-button.d.ts +69 -0
  61. package/lib/runtime/components/react/dist/mpx-button.d.ts.map +1 -0
  62. package/lib/runtime/components/react/dist/mpx-camera.d.ts +27 -0
  63. package/lib/runtime/components/react/dist/mpx-camera.d.ts.map +1 -0
  64. package/lib/runtime/components/react/dist/mpx-camera.jsx +197 -0
  65. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +24 -0
  66. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +1 -0
  67. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +8 -0
  68. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +1 -0
  69. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +7 -0
  70. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +1 -0
  71. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +21 -0
  72. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +1 -0
  73. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +9 -0
  74. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +1 -0
  75. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +11 -0
  76. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +1 -0
  77. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +3 -0
  78. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +1 -0
  79. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +33 -0
  80. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +1 -0
  81. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +53 -0
  82. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +1 -0
  83. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +21 -0
  84. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +1 -0
  85. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +33 -0
  86. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +1 -0
  87. package/lib/runtime/components/react/dist/mpx-form.d.ts +28 -0
  88. package/lib/runtime/components/react/dist/mpx-form.d.ts.map +1 -0
  89. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +19 -0
  90. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +1 -0
  91. package/lib/runtime/components/react/dist/mpx-image.d.ts +22 -0
  92. package/lib/runtime/components/react/dist/mpx-image.d.ts.map +1 -0
  93. package/lib/runtime/components/react/dist/mpx-image.jsx +81 -37
  94. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +8 -0
  95. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +1 -0
  96. package/lib/runtime/components/react/dist/mpx-input.d.ts +51 -0
  97. package/lib/runtime/components/react/dist/mpx-input.d.ts.map +1 -0
  98. package/lib/runtime/components/react/dist/mpx-input.jsx +37 -11
  99. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +13 -0
  100. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +1 -0
  101. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +61 -50
  102. package/lib/runtime/components/react/dist/mpx-label.d.ts +21 -0
  103. package/lib/runtime/components/react/dist/mpx-label.d.ts.map +1 -0
  104. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +21 -0
  105. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +1 -0
  106. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +66 -0
  107. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +1 -0
  108. package/lib/runtime/components/react/dist/mpx-nav.d.ts +9 -0
  109. package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +1 -0
  110. package/lib/runtime/components/react/dist/mpx-nav.jsx +132 -0
  111. package/lib/runtime/components/react/dist/mpx-navigator.d.ts +10 -0
  112. package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +1 -0
  113. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +7 -0
  114. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +1 -0
  115. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +8 -0
  116. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +1 -0
  117. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +7 -0
  118. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +1 -0
  119. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +7 -0
  120. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +1 -0
  121. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +7 -0
  122. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +1 -0
  123. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +3 -0
  124. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +1 -0
  125. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +7 -0
  126. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +1 -0
  127. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +7 -0
  128. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +1 -0
  129. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +107 -0
  130. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +1 -0
  131. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +33 -0
  132. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +1 -0
  133. package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +4 -3
  134. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +9 -0
  135. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +1 -0
  136. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +24 -0
  137. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +1 -0
  138. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +12 -18
  139. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +15 -0
  140. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +1 -0
  141. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.jsx +8 -11
  142. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +14 -0
  143. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +1 -0
  144. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.jsx +20 -0
  145. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +17 -0
  146. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +1 -0
  147. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +13 -0
  148. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +1 -0
  149. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +12 -0
  150. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +1 -0
  151. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +23 -0
  152. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +1 -0
  153. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +17 -0
  154. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +1 -0
  155. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +16 -0
  156. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +1 -0
  157. package/lib/runtime/components/react/dist/mpx-portal/index.jsx +5 -1
  158. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +30 -0
  159. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +1 -0
  160. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +10 -0
  161. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +1 -0
  162. package/lib/runtime/components/react/dist/mpx-progress.d.ts +24 -0
  163. package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +1 -0
  164. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +21 -0
  165. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +1 -0
  166. package/lib/runtime/components/react/dist/mpx-radio.d.ts +27 -0
  167. package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +1 -0
  168. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +2 -0
  169. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +1 -0
  170. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +25 -0
  171. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +1 -0
  172. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +15 -0
  173. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +1 -0
  174. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +55 -0
  175. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +1 -0
  176. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +6 -14
  177. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +8 -0
  178. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +1 -0
  179. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +8 -0
  180. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +1 -0
  181. package/lib/runtime/components/react/dist/mpx-slider.d.ts +31 -0
  182. package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +1 -0
  183. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +18 -0
  184. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +1 -0
  185. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +16 -0
  186. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +1 -0
  187. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +19 -0
  188. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +1 -0
  189. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +53 -0
  190. package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +1 -0
  191. package/lib/runtime/components/react/dist/mpx-swiper.jsx +9 -5
  192. package/lib/runtime/components/react/dist/mpx-switch.d.ts +27 -0
  193. package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +1 -0
  194. package/lib/runtime/components/react/dist/mpx-text.d.ts +23 -0
  195. package/lib/runtime/components/react/dist/mpx-text.d.ts.map +1 -0
  196. package/lib/runtime/components/react/dist/mpx-text.jsx +33 -5
  197. package/lib/runtime/components/react/dist/mpx-textarea.d.ts +8 -0
  198. package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +1 -0
  199. package/lib/runtime/components/react/dist/mpx-video.d.ts +102 -0
  200. package/lib/runtime/components/react/dist/mpx-video.d.ts.map +1 -0
  201. package/lib/runtime/components/react/dist/mpx-view.d.ts +35 -0
  202. package/lib/runtime/components/react/dist/mpx-view.d.ts.map +1 -0
  203. package/lib/runtime/components/react/dist/mpx-view.jsx +1 -1
  204. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +23 -0
  205. package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +1 -0
  206. package/lib/runtime/components/react/dist/mpx-web-view.jsx +1 -1
  207. package/lib/runtime/components/react/dist/parser.d.ts +40 -0
  208. package/lib/runtime/components/react/dist/parser.d.ts.map +1 -0
  209. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +33 -0
  210. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +1 -0
  211. package/lib/runtime/components/react/dist/useNodesRef.d.ts +12 -0
  212. package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +1 -0
  213. package/lib/runtime/components/react/dist/utils.d.ts +123 -0
  214. package/lib/runtime/components/react/dist/utils.d.ts.map +1 -0
  215. package/lib/runtime/components/react/dist/utils.jsx +16 -6
  216. package/lib/runtime/components/react/mpx-camera.tsx +275 -0
  217. package/lib/runtime/components/react/mpx-image.tsx +89 -42
  218. package/lib/runtime/components/react/mpx-input.tsx +44 -17
  219. package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +69 -49
  220. package/lib/runtime/components/react/mpx-nav.tsx +155 -0
  221. package/lib/runtime/components/react/mpx-picker-view/index.tsx +5 -2
  222. package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +26 -21
  223. package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItem.tsx +8 -12
  224. package/lib/runtime/components/react/mpx-picker-view-column/pickerViewColumnItemLite.tsx +55 -0
  225. package/lib/runtime/components/react/mpx-portal/index.tsx +8 -2
  226. package/lib/runtime/components/react/mpx-scroll-view.tsx +6 -17
  227. package/lib/runtime/components/react/mpx-swiper.tsx +9 -5
  228. package/lib/runtime/components/react/mpx-text.tsx +38 -5
  229. package/lib/runtime/components/react/mpx-view.tsx +1 -1
  230. package/lib/runtime/components/react/mpx-web-view.tsx +1 -1
  231. package/lib/runtime/components/react/types/common.d.ts +19 -0
  232. package/lib/runtime/components/react/utils.tsx +15 -6
  233. package/lib/runtime/components/web/mpx-input.vue +0 -14
  234. package/lib/runtime/stringify.wxs +2 -2
  235. package/lib/script-setup-compiler/index.js +2 -2
  236. package/lib/style-compiler/index.js +3 -2
  237. package/lib/style-compiler/load-postcss-config.js +1 -1
  238. package/lib/style-compiler/plugins/trans-special.js +10 -2
  239. package/lib/style-compiler/strip-conditional-loader.js +178 -15
  240. package/lib/template-compiler/bind-this.js +2 -2
  241. package/lib/template-compiler/compiler.js +267 -71
  242. package/lib/template-compiler/gen-node-react.js +18 -6
  243. package/lib/template-compiler/index.js +12 -10
  244. package/lib/template-compiler/parse-exps.js +1 -1
  245. package/lib/utils/const.js +2 -1
  246. package/lib/utils/dom-tag-config.js +6 -6
  247. package/lib/utils/env.js +6 -1
  248. package/lib/utils/get-build-tag-component.js +35 -0
  249. package/lib/utils/pre-process-json.js +5 -0
  250. package/lib/web/index.js +2 -0
  251. package/lib/web/processJSON.js +44 -16
  252. package/lib/web/processScript.js +1 -1
  253. package/lib/web/processTemplate.js +6 -4
  254. package/lib/web/script-helper.js +19 -9
  255. package/lib/wxs/pre-loader.js +1 -1
  256. package/lib/wxss/loader.js +1 -9
  257. package/package.json +15 -4
@@ -12,11 +12,8 @@ const { transSubpackage } = require('../utils/trans-async-sub-rules')
12
12
  const createJSONHelper = require('../json-compiler/helper')
13
13
  const getRulesRunner = require('../platform/index')
14
14
  const { RESOLVE_IGNORED_ERR } = require('../utils/const')
15
- const normalize = require('../utils/normalize')
16
15
  const RecordResourceMapDependency = require('../dependencies/RecordResourceMapDependency')
17
16
  const RecordPageConfigsMapDependency = require('../dependencies/RecordPageConfigsMapDependency')
18
- const mpxViewPath = normalize.lib('runtime/components/react/dist/mpx-view.jsx')
19
- const mpxTextPath = normalize.lib('runtime/components/react/dist/mpx-text.jsx')
20
17
 
21
18
  module.exports = function (jsonContent, {
22
19
  loaderContext,
@@ -42,23 +39,38 @@ module.exports = function (jsonContent, {
42
39
 
43
40
  const emitWarning = (msg) => {
44
41
  loaderContext.emitWarning(
45
- new Error('[json processor][' + loaderContext.resource + ']: ' + msg)
42
+ new Error('[Mpx json warning][' + loaderContext.resource + ']: ' + msg)
46
43
  )
47
44
  }
48
45
 
49
46
  const emitError = (msg) => {
50
47
  loaderContext.emitError(
51
- new Error('[json compiler][' + loaderContext.resource + ']: ' + msg)
48
+ new Error('[Mpx json error][' + loaderContext.resource + ']: ' + msg)
52
49
  )
53
50
  }
54
51
 
55
52
  const stringifyRequest = r => loaderUtils.stringifyRequest(loaderContext, r)
56
53
 
54
+ function fillInComponentsMap (name, entry, tarRoot) {
55
+ const { resource, outputPath } = entry
56
+ const { resourcePath } = parseRequest(resource)
57
+ componentsMap[resourcePath] = outputPath
58
+ loaderContext._module && loaderContext._module.addPresentationalDependency(new RecordResourceMapDependency(resourcePath, 'component', outputPath))
59
+ localComponentsMap[name] = {
60
+ resource: addQuery(resource, {
61
+ isComponent: true,
62
+ outputPath
63
+ }),
64
+ async: tarRoot
65
+ }
66
+ }
67
+
57
68
  const {
58
69
  isUrlRequest,
59
70
  urlToRequest,
60
71
  processPage,
61
- processComponent
72
+ processComponent,
73
+ processPlaceholder
62
74
  } = createJSONHelper({
63
75
  loaderContext,
64
76
  emitWarning,
@@ -137,45 +149,6 @@ module.exports = function (jsonContent, {
137
149
  isShow: true
138
150
  }
139
151
 
140
- const fillInComponentPlaceholder = (name, placeholder, placeholderEntry) => {
141
- const componentPlaceholder = jsonObj.componentPlaceholder || {}
142
- if (componentPlaceholder[name]) return
143
- componentPlaceholder[name] = placeholder
144
- jsonObj.componentPlaceholder = componentPlaceholder
145
- if (placeholderEntry && !jsonObj.usingComponents[placeholder]) jsonObj.usingComponents[placeholder] = placeholderEntry
146
- }
147
-
148
- const fillInComponentsMap = (name, entry, tarRoot) => {
149
- const { resource, outputPath } = entry
150
- const { resourcePath } = parseRequest(resource)
151
- tarRoot = transSubpackage(mpx.transSubpackageRules, tarRoot)
152
- componentsMap[resourcePath] = outputPath
153
- loaderContext._module && loaderContext._module.addPresentationalDependency(new RecordResourceMapDependency(resourcePath, 'component', outputPath))
154
- localComponentsMap[name] = {
155
- resource: addQuery(resource, {
156
- isComponent: true,
157
- outputPath
158
- }),
159
- async: tarRoot
160
- }
161
- }
162
-
163
- const normalizePlaceholder = (placeholder) => {
164
- if (typeof placeholder === 'string') {
165
- const placeholderMap = mode === 'ali'
166
- ? {
167
- view: { name: 'mpx-view', resource: mpxViewPath },
168
- text: { name: 'mpx-text', resource: mpxTextPath }
169
- }
170
- : {}
171
- placeholder = placeholderMap[placeholder] || { name: placeholder }
172
- }
173
- if (!placeholder.name) {
174
- emitError('The asyncSubpackageRules configuration format of @mpxjs/webpack-plugin a is incorrect')
175
- }
176
- return placeholder
177
- }
178
-
179
152
  const processTabBar = (tabBar, callback) => {
180
153
  if (tabBar) {
181
154
  tabBar = Object.assign({}, defaultTabbar, tabBar)
@@ -345,38 +318,34 @@ module.exports = function (jsonContent, {
345
318
 
346
319
  const processComponents = (components, context, callback) => {
347
320
  if (components) {
321
+ const asyncComponents = []
322
+ const resolveResourcePathMap = new Map()
348
323
  async.eachOf(components, (component, name, callback) => {
349
- processComponent(component, context, {}, (err, entry = {}, { tarRoot, placeholder } = {}) => {
324
+ processComponent(component, context, {}, (err, entry = {}, { tarRoot, placeholder, resourcePath } = {}) => {
350
325
  if (err) return callback(err === RESOLVE_IGNORED_ERR ? null : err)
351
- fillInComponentsMap(name, entry, tarRoot)
352
326
  const { relativePath } = entry
353
327
 
354
- if (tarRoot) {
328
+ tarRoot = transSubpackage(mpx.transSubpackageRules, tarRoot)
329
+
330
+ resolveResourcePathMap.set(name, resourcePath)
331
+ if (tarRoot) asyncComponents.push({ name, tarRoot, placeholder, relativePath })
332
+
333
+ fillInComponentsMap(name, entry, tarRoot)
334
+ callback()
335
+ })
336
+ }, (err) => {
337
+ if (err) return callback(err)
338
+ async.each(asyncComponents, ({ name, tarRoot, placeholder, relativePath }, callback) => {
339
+ processPlaceholder({ jsonObj, context, name, tarRoot, placeholder, relativePath, resolveResourcePathMap }, (err, placeholder) => {
340
+ if (err) return callback(err)
355
341
  if (placeholder) {
356
- placeholder = normalizePlaceholder(placeholder)
357
- if (placeholder.resource) {
358
- processComponent(placeholder.resource, projectRoot, { relativePath }, (err, entry) => {
359
- if (err) return callback(err)
360
- fillInComponentPlaceholder(name, placeholder.name, entry)
361
- fillInComponentsMap(placeholder.name, entry, '')
362
- callback()
363
- })
364
- } else {
365
- fillInComponentPlaceholder(name, placeholder.name)
366
- callback()
367
- }
368
- } else {
369
- if (!jsonObj.componentPlaceholder || !jsonObj.componentPlaceholder[name]) {
370
- const errMsg = `componentPlaceholder of "${name}" doesn't exist! \n\r`
371
- emitError(errMsg)
372
- }
373
- callback()
342
+ const { name, entry } = placeholder
343
+ fillInComponentsMap(name, entry, '')
374
344
  }
375
- } else {
376
345
  callback()
377
- }
378
- })
379
- }, callback)
346
+ })
347
+ }, callback)
348
+ })
380
349
  } else {
381
350
  callback()
382
351
  }
@@ -394,7 +363,6 @@ module.exports = function (jsonContent, {
394
363
  callback()
395
364
  }
396
365
  }
397
-
398
366
  async.parallel([
399
367
  (callback) => {
400
368
  // 添加首页标识
@@ -15,12 +15,12 @@ module.exports = function (styles, {
15
15
  if (styles.length) {
16
16
  const warn = (msg) => {
17
17
  loaderContext.emitWarning(
18
- new Error('[style compiler][' + loaderContext.resource + ']: ' + msg)
18
+ new Error('[Mpx style warning][' + loaderContext.resource + ']: ' + msg)
19
19
  )
20
20
  }
21
21
  const error = (msg) => {
22
22
  loaderContext.emitError(
23
- new Error('[style compiler][' + loaderContext.resource + ']: ' + msg)
23
+ new Error('[Mpx style error][' + loaderContext.resource + ']: ' + msg)
24
24
  )
25
25
  }
26
26
  const { mode, srcMode } = loaderContext.getMpx()
@@ -52,6 +52,7 @@ module.exports = function (styles, {
52
52
  filename: loaderContext.resourcePath,
53
53
  mode,
54
54
  srcMode,
55
+ ctorType,
55
56
  warn,
56
57
  error
57
58
  })
@@ -17,6 +17,7 @@ module.exports = function (template, {
17
17
  moduleId,
18
18
  ctorType,
19
19
  usingComponentsInfo,
20
+ originalUsingComponents,
20
21
  componentGenerics
21
22
  }, callback) {
22
23
  const mpx = loaderContext.getMpx()
@@ -46,28 +47,29 @@ module.exports = function (template, {
46
47
  if (template) {
47
48
  // 由于远端src template资源引用的相对路径可能发生变化,暂时不支持。
48
49
  if (template.src) {
49
- return callback(new Error('[mpx loader][' + loaderContext.resource + ']: ' + 'template content must be inline in .mpx files!'))
50
+ return callback(new Error('[Mpx template error][' + loaderContext.resource + ']: ' + 'template content must be inline in .mpx files!'))
50
51
  }
51
52
  if (template.lang) {
52
- return callback(new Error('[mpx loader][' + loaderContext.resource + ']: ' + 'template lang is not supported in trans react native mode temporarily, we will support it in the future!'))
53
+ return callback(new Error('[Mpx template error][' + loaderContext.resource + ']: ' + 'template lang is not supported in trans react native mode temporarily, we will support it in the future!'))
53
54
  }
54
55
 
55
56
  if (template.content) {
56
57
  const templateSrcMode = template.mode || srcMode
57
58
  const warn = (msg) => {
58
59
  loaderContext.emitWarning(
59
- new Error('[template compiler][' + loaderContext.resource + ']: ' + msg)
60
+ new Error('[Mpx template warning][' + loaderContext.resource + ']: ' + msg)
60
61
  )
61
62
  }
62
63
  const error = (msg) => {
63
64
  loaderContext.emitError(
64
- new Error('[template compiler][' + loaderContext.resource + ']: ' + msg)
65
+ new Error('[mpx template error][' + loaderContext.resource + ']: ' + msg)
65
66
  )
66
67
  }
67
68
  const { root, meta } = templateCompiler.parse(template.content, {
68
69
  warn,
69
70
  error,
70
71
  usingComponentsInfo, // processTemplate中无其他地方使用,直接透传 string 类型
72
+ originalUsingComponents,
71
73
  hasComment,
72
74
  isNative,
73
75
  ctorType,
@@ -113,7 +115,7 @@ module.exports = function (template, {
113
115
  output += `var ${module} = require(${loaderUtils.stringifyRequest(this, src)});\n`
114
116
  }
115
117
 
116
- const rawCode = genNode(root)
118
+ const rawCode = genNode(root, true)
117
119
  if (rawCode) {
118
120
  try {
119
121
  const ignoreMap = Object.assign({
@@ -130,7 +132,7 @@ module.exports = function (template, {
130
132
  return ${bindResult.code}
131
133
  };\n`
132
134
  } catch (e) {
133
- error(`Invalid render function generated by the template, please check!
135
+ error(`[Mpx template error]: Invalid render function generated by the template, please check!
134
136
  Error code:
135
137
  ${rawCode}
136
138
  Error Detail:
@@ -4,16 +4,11 @@ const parseRequest = require('../utils/parse-request')
4
4
  const shallowStringify = require('../utils/shallow-stringify')
5
5
  const normalize = require('../utils/normalize')
6
6
  const addQuery = require('../utils/add-query')
7
- const { isBuildInReactTag } = require('../utils/dom-tag-config')
8
7
 
9
8
  function stringifyRequest (loaderContext, request) {
10
9
  return loaderUtils.stringifyRequest(loaderContext, request)
11
10
  }
12
11
 
13
- function getBuiltInComponentRequest (component) {
14
- return JSON.stringify(addQuery(`@mpxjs/webpack-plugin/lib/runtime/components/react/dist/${component}`, { isComponent: true }))
15
- }
16
-
17
12
  function getAsyncChunkName (chunkName) {
18
13
  if (chunkName && typeof chunkName !== 'boolean') {
19
14
  return `/* webpackChunkName: "${chunkName}/index" */`
@@ -26,8 +21,8 @@ function getAsyncSuspense (type, moduleId, componentRequest, componentName, chun
26
21
  type: ${JSON.stringify(type)},
27
22
  moduleId: ${JSON.stringify(moduleId)},
28
23
  chunkName: ${JSON.stringify(chunkName)},
29
- getFallback: ${getFallback},
30
- getLoading: ${getLoading},
24
+ ${getFallback ? `getFallback: ${getFallback},` : ''}
25
+ ${getLoading ? `getLoading: ${getLoading},` : ''}
31
26
  getChildren () {
32
27
  return import(${getAsyncChunkName(chunkName)}${componentRequest}).then(function (res) {
33
28
  return getComponent(res, {displayName: ${JSON.stringify(componentName)}})
@@ -95,22 +90,17 @@ function buildComponentsMap ({ localComponentsMap, builtInComponentsMap, loaderC
95
90
  if (placeholder) {
96
91
  if (localComponentsMap[placeholder]) {
97
92
  const placeholderCfg = localComponentsMap[placeholder]
98
- const placeholderRequest = stringifyRequest(loaderContext, placeholderCfg.resource)
99
93
  if (placeholderCfg.async) {
100
94
  loaderContext.emitWarning(
101
95
  new Error(`[json processor][${loaderContext.resource}]: componentPlaceholder ${placeholder} should not be a async component, please check!`)
102
96
  )
103
97
  }
98
+ const placeholderRequest = stringifyRequest(loaderContext, placeholderCfg.resource)
104
99
  getFallback = getComponentGetter(getComponent(placeholderRequest, placeholder))
105
100
  } else {
106
- const tag = `mpx-${placeholder}`
107
- if (isBuildInReactTag(tag)) {
108
- getFallback = getComponentGetter(getBuiltInComponent(getBuiltInComponentRequest(tag)))
109
- } else {
110
- loaderContext.emitError(
111
- new Error(`[json processor][${loaderContext.resource}]: componentPlaceholder ${placeholder} is not built-in component, please check!`)
112
- )
113
- }
101
+ loaderContext.emitError(
102
+ new Error(`[json processor][${loaderContext.resource}]: componentPlaceholder ${placeholder} is not built-in component or custom component, please check!`)
103
+ )
114
104
  }
115
105
  } else {
116
106
  loaderContext.emitError(
@@ -1,5 +1,6 @@
1
1
  const postcss = require('postcss')
2
2
  const selectorParser = require('postcss-selector-parser')
3
+ const { MPX_TAG_PAGE_SELECTOR } = require('../utils/const')
3
4
  const getRulesRunner = require('../platform/index')
4
5
  const dash2hump = require('../utils/hump-dash').dash2hump
5
6
  const unitRegExp = /^\s*(-?\d+(?:\.\d+)?)(rpx|vw|vh)\s*$/
@@ -7,8 +8,8 @@ const numberRegExp = /^\s*(-?\d+(\.\d+)?)(px)?\s*$/
7
8
  const hairlineRegExp = /^\s*hairlineWidth\s*$/
8
9
  const varRegExp = /^--/
9
10
  const cssPrefixExp = /^-(webkit|moz|ms|o)-/
10
- function getClassMap ({ content, filename, mode, srcMode, warn, error }) {
11
- const classMap = {}
11
+ function getClassMap ({ content, filename, mode, srcMode, ctorType, warn, error }) {
12
+ const classMap = ctorType === 'page' ? { [MPX_TAG_PAGE_SELECTOR]: { flex: 1 } } : {}
12
13
 
13
14
  const root = postcss.parse(content, {
14
15
  from: filename
@@ -36,6 +37,13 @@ function getClassMap ({ content, filename, mode, srcMode, warn, error }) {
36
37
  error
37
38
  })
38
39
 
40
+ // 目前所有 AtRule 只支持 @media,其他全部给出错误提示
41
+ root.walkAtRules(rule => {
42
+ if (rule.name !== 'media') {
43
+ warn(`Only @media rule is supported in react native mode temporarily, but got @${rule.name}`)
44
+ }
45
+ })
46
+
39
47
  root.walkRules(rule => {
40
48
  const classMapValue = {}
41
49
  rule.walkDecls(({ prop, value }) => {
@@ -6,9 +6,14 @@ export type LabelContextValue = MutableRefObject<{
6
6
  triggerChange: (evt: NativeSyntheticEvent<TouchEvent>) => void
7
7
  }>
8
8
 
9
- export type KeyboardAvoidContextValue = MutableRefObject<
10
- { cursorSpacing: number, ref: MutableRefObject<any> } | null
11
- >
9
+ export type KeyboardAvoidContextValue = MutableRefObject<{
10
+ cursorSpacing: number
11
+ ref: MutableRefObject<any>
12
+ adjustPosition: boolean
13
+ holdKeyboard?: boolean
14
+ keyboardHeight?: number
15
+ onKeyboardShow?: () => void
16
+ } | null>
12
17
 
13
18
  export interface GroupValue {
14
19
  [key: string]: { checked: boolean; setValue: Dispatch<SetStateAction<boolean>> }
@@ -37,13 +42,13 @@ export interface IntersectionObserver {
37
42
  }
38
43
 
39
44
  export interface PortalContextValue {
40
- mount: (children: React.ReactNode, key?: number | null, id?: number| null) => number| undefined
45
+ mount: (children: React.ReactNode, key?: number | null, id?: number | null) => number | undefined
41
46
  update: (key: number, children: React.ReactNode) => void
42
47
  unmount: (key: number) => void
43
48
  }
44
49
 
45
50
  export interface ScrollViewContextValue {
46
- gestureRef: React.RefObject<any> | null,
51
+ gestureRef: React.RefObject<any> | null
47
52
  scrollOffset: Animated.Value
48
53
  }
49
54
 
@@ -53,7 +58,7 @@ export interface RouteContextValue {
53
58
  }
54
59
 
55
60
  export interface StickyContextValue {
56
- registerStickyHeader: Function,
61
+ registerStickyHeader: Function
57
62
  unregisterStickyHeader: Function
58
63
  }
59
64
 
@@ -84,3 +89,5 @@ export const ScrollViewContext = createContext<ScrollViewContextValue>({ gesture
84
89
  export const PortalContext = createContext<PortalContextValue>(null as any)
85
90
 
86
91
  export const StickyContext = createContext<StickyContextValue>({ registerStickyHeader: noop, unregisterStickyHeader: noop })
92
+
93
+ export const ProviderContext = createContext(null)
@@ -0,0 +1,76 @@
1
+ import { Dispatch, MutableRefObject, SetStateAction } from 'react';
2
+ import { NativeSyntheticEvent, Animated } from 'react-native';
3
+ export type LabelContextValue = MutableRefObject<{
4
+ triggerChange: (evt: NativeSyntheticEvent<TouchEvent>) => void;
5
+ }>;
6
+ export type KeyboardAvoidContextValue = MutableRefObject<{
7
+ cursorSpacing: number;
8
+ ref: MutableRefObject<any>;
9
+ adjustPosition: boolean;
10
+ holdKeyboard?: boolean;
11
+ keyboardHeight?: number;
12
+ onKeyboardShow?: () => void;
13
+ } | null>;
14
+ export interface GroupValue {
15
+ [key: string]: {
16
+ checked: boolean;
17
+ setValue: Dispatch<SetStateAction<boolean>>;
18
+ };
19
+ }
20
+ export interface GroupContextValue {
21
+ groupValue: GroupValue;
22
+ notifyChange: (evt: NativeSyntheticEvent<TouchEvent>) => void;
23
+ }
24
+ export interface FormFieldValue {
25
+ getValue: () => any;
26
+ resetValue: ({ newVal, type }: {
27
+ newVal?: any;
28
+ type?: string;
29
+ }) => void;
30
+ }
31
+ export interface FormContextValue {
32
+ formValuesMap: Map<string, FormFieldValue>;
33
+ submit: () => void;
34
+ reset: () => void;
35
+ }
36
+ export interface IntersectionObserver {
37
+ [key: number]: {
38
+ throttleMeasure: () => void;
39
+ };
40
+ }
41
+ export interface PortalContextValue {
42
+ mount: (children: React.ReactNode, key?: number | null, id?: number | null) => number | undefined;
43
+ update: (key: number, children: React.ReactNode) => void;
44
+ unmount: (key: number) => void;
45
+ }
46
+ export interface ScrollViewContextValue {
47
+ gestureRef: React.RefObject<any> | null;
48
+ scrollOffset: Animated.Value;
49
+ }
50
+ export interface RouteContextValue {
51
+ pageId: number;
52
+ navigation: Record<string, any>;
53
+ }
54
+ export interface StickyContextValue {
55
+ registerStickyHeader: Function;
56
+ unregisterStickyHeader: Function;
57
+ }
58
+ export declare const MovableAreaContext: import("react").Context<{
59
+ width: number;
60
+ height: number;
61
+ }>;
62
+ export declare const FormContext: import("react").Context<FormContextValue | null>;
63
+ export declare const CheckboxGroupContext: import("react").Context<GroupContextValue | null>;
64
+ export declare const RadioGroupContext: import("react").Context<GroupContextValue | null>;
65
+ export declare const LabelContext: import("react").Context<LabelContextValue | null>;
66
+ export declare const PickerContext: import("react").Context<null>;
67
+ export declare const VarContext: import("react").Context<{}>;
68
+ export declare const IntersectionObserverContext: import("react").Context<IntersectionObserver | null>;
69
+ export declare const RouteContext: import("react").Context<RouteContextValue | null>;
70
+ export declare const SwiperContext: import("react").Context<{}>;
71
+ export declare const KeyboardAvoidContext: import("react").Context<KeyboardAvoidContextValue | null>;
72
+ export declare const ScrollViewContext: import("react").Context<ScrollViewContextValue>;
73
+ export declare const PortalContext: import("react").Context<PortalContextValue>;
74
+ export declare const StickyContext: import("react").Context<StickyContextValue>;
75
+ export declare const ProviderContext: import("react").Context<null>;
76
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACjF,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAG7D,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;IAC/C,aAAa,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,UAAU,CAAC,KAAK,IAAI,CAAA;CAC/D,CAAC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;IACvD,aAAa,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAA;IAC1B,cAAc,EAAE,OAAO,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;CAC5B,GAAG,IAAI,CAAC,CAAA;AAET,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;KAAE,CAAA;CACjF;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,UAAU,CAAC,KAAK,IAAI,CAAA;CAC9D;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,GAAG,CAAA;IACnB,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;QAAE,MAAM,CAAC,EAAE,GAAG,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACxE;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC1C,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,eAAe,EAAE,MAAM,IAAI,CAAA;KAC5B,CAAA;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,GAAG,SAAS,CAAA;IACjG,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAA;IACxD,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;IACvC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAA;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,oBAAoB,EAAE,QAAQ,CAAA;IAC9B,sBAAsB,EAAE,QAAQ,CAAA;CACjC;AAED,eAAO,MAAM,kBAAkB;;;EAAyC,CAAA;AAExE,eAAO,MAAM,WAAW,kDAA+C,CAAA;AAEvE,eAAO,MAAM,oBAAoB,mDAAgD,CAAA;AAEjF,eAAO,MAAM,iBAAiB,mDAAgD,CAAA;AAE9E,eAAO,MAAM,YAAY,mDAAgD,CAAA;AAEzE,eAAO,MAAM,aAAa,+BAAsB,CAAA;AAEhD,eAAO,MAAM,UAAU,6BAAoB,CAAA;AAE3C,eAAO,MAAM,2BAA2B,sDAAmD,CAAA;AAE3F,eAAO,MAAM,YAAY,mDAAgD,CAAA;AAEzE,eAAO,MAAM,aAAa,6BAAoB,CAAA;AAE9C,eAAO,MAAM,oBAAoB,2DAAwD,CAAA;AAEzF,eAAO,MAAM,iBAAiB,iDAAmG,CAAA;AAEjI,eAAO,MAAM,aAAa,6CAAiD,CAAA;AAE3E,eAAO,MAAM,aAAa,6CAAkG,CAAA;AAE5H,eAAO,MAAM,eAAe,+BAAsB,CAAA"}
@@ -15,3 +15,4 @@ export const KeyboardAvoidContext = createContext(null);
15
15
  export const ScrollViewContext = createContext({ gestureRef: null, scrollOffset: new Animated.Value(0) });
16
16
  export const PortalContext = createContext(null);
17
17
  export const StickyContext = createContext({ registerStickyHeader: noop, unregisterStickyHeader: noop });
18
+ export const ProviderContext = createContext(null);
@@ -0,0 +1,8 @@
1
+ declare const eventConfigMap: {
2
+ [key: string]: {
3
+ bitFlag: string;
4
+ events: string[];
5
+ };
6
+ };
7
+ export default eventConfigMap;
8
+ //# sourceMappingURL=event.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.config.d.ts","sourceRoot":"","sources":["../event.config.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,cAAc,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAyB3E,CAAA;AAED,eAAe,cAAc,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { Props, RawConfig, RemoveProps, LayoutRef, ExtendedNativeTouchEvent } from './types/getInnerListeners';
2
+ export declare const getCustomEvent: (type: string | undefined, oe: any, { detail, layoutRef }: {
3
+ detail?: Record<string, unknown> | undefined;
4
+ layoutRef?: LayoutRef | undefined;
5
+ }, props?: Props) => any;
6
+ declare const useInnerProps: (props?: Props, userRemoveProps?: RemoveProps, rawConfig?: RawConfig) => Record<string, (e: ExtendedNativeTouchEvent) => void> & Omit<Props, string>;
7
+ export default useInnerProps;
8
+ //# sourceMappingURL=getInnerListeners.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getInnerListeners.d.ts","sourceRoot":"","sources":["../getInnerListeners.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,EAEL,SAAS,EAET,WAAW,EAEX,SAAS,EACT,wBAAwB,EAEzB,MAAM,2BAA2B,CAAA;AAsElC,eAAO,MAAM,cAAc,iCAErB,GAAG;;;WAKA,KAAK,QAgBb,CAAA;AAyID,QAAA,MAAM,aAAa,WACV,KAAK,6CAEA,SAAS,wBA8Dc,wBAAwB,KAAK,IAAI,uBA2BrE,CAAA;AACD,eAAe,aAAa,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ interface AsyncSuspenseProps {
3
+ type: 'component' | 'page';
4
+ chunkName: string;
5
+ moduleId: string;
6
+ innerProps: any;
7
+ getLoading?: () => ComponentType<unknown>;
8
+ getFallback?: () => ComponentType<unknown>;
9
+ getChildren: () => Promise<ReactNode>;
10
+ }
11
+ declare const AsyncSuspense: React.FC<AsyncSuspenseProps>;
12
+ export default AsyncSuspense;
13
+ //# sourceMappingURL=mpx-async-suspense.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-async-suspense.d.ts","sourceRoot":"","sources":["../mpx-async-suspense.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,aAAa,EAAkC,SAAS,EAAiB,MAAM,OAAO,CAAA;AAiGzG,UAAU,kBAAkB;IAC1B,IAAI,EAAE,WAAW,GAAG,MAAM,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,GAAG,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,aAAa,CAAC,OAAO,CAAC,CAAA;IACzC,WAAW,CAAC,EAAE,MAAM,aAAa,CAAC,OAAO,CAAC,CAAA;IAC1C,WAAW,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,CAAA;CACtC;AAID,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6E/C,CAAA;AAID,eAAe,aAAa,CAAA"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * ✔ size
3
+ * ✔ type
4
+ * ✔ plain
5
+ * ✔ disabled
6
+ * ✔ loading
7
+ * ✔ form-type
8
+ * - open-type: Partially. Only support `share`、`getUserInfo`
9
+ * ✔ hover-class: Convert hoverClass to hoverStyle.
10
+ * ✔ hover-style
11
+ * ✘ hover-stop-propagation
12
+ * ✔ hover-start-time
13
+ * ✔ hover-stay-time
14
+ * ✘ lang
15
+ * ✘ session-from
16
+ * ✘ send-message-title
17
+ * ✘ send-message-path
18
+ * ✘ send-message-img
19
+ * ✘ app-parameter
20
+ * ✘ show-message-card
21
+ * ✘ phone-number-no-quota-toast
22
+ * ✘ bindgetuserinfo
23
+ * ✘ bindcontact
24
+ * ✘ createliveactivity
25
+ * ✘ bindgetphonenumber
26
+ * ✘ bindgetphonenumber
27
+ * ✘ bindgetrealtimephonenumber
28
+ * ✘ binderror
29
+ * ✘ bindopensetting
30
+ * ✘ bindlaunchapp
31
+ * ✘ bindlaunchapp
32
+ * ✘ bindchooseavatar
33
+ * ✘ bindchooseavatar
34
+ * ✘ bindagreeprivacyauthorization
35
+ * ✔ bindtap
36
+ */
37
+ import { ReactNode } from 'react';
38
+ import { View, ViewStyle, TextStyle, NativeSyntheticEvent } from 'react-native';
39
+ import { HandlerRef } from './useNodesRef';
40
+ import type { ExtendedViewStyle } from './types/common';
41
+ export type Type = 'default' | 'primary' | 'warn';
42
+ export type OpenType = 'share' | 'getUserInfo';
43
+ export type OpenTypeEvent = 'onShareAppMessage' | 'onUserInfo';
44
+ export interface ButtonProps {
45
+ size?: string;
46
+ type?: Type;
47
+ plain?: boolean;
48
+ disabled?: boolean;
49
+ loading?: boolean;
50
+ 'hover-class'?: string;
51
+ 'hover-style'?: ExtendedViewStyle;
52
+ 'hover-start-time'?: number;
53
+ 'hover-stay-time'?: number;
54
+ 'open-type'?: OpenType;
55
+ 'form-type'?: 'submit' | 'reset';
56
+ 'enable-offset'?: boolean;
57
+ 'enable-var'?: boolean;
58
+ 'external-var-context'?: Record<string, any>;
59
+ 'parent-font-size'?: number;
60
+ 'parent-width'?: number;
61
+ 'parent-height'?: number;
62
+ style?: ViewStyle & TextStyle & Record<string, any>;
63
+ children: ReactNode;
64
+ bindgetuserinfo?: (userInfo: any) => void;
65
+ bindtap?: (evt: NativeSyntheticEvent<TouchEvent> | unknown) => void;
66
+ }
67
+ declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HandlerRef<View, ButtonProps>>>;
68
+ export default Button;
69
+ //# sourceMappingURL=mpx-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-button.d.ts","sourceRoot":"","sources":["../mpx-button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAoC,SAAS,EAA+B,MAAM,OAAO,CAAA;AAChG,OAAO,EACL,IAAI,EAEJ,SAAS,EACT,SAAS,EAGT,oBAAoB,EAErB,MAAM,cAAc,CAAA;AAKrB,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGvD,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAOjD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,YAAY,CAAA;AAE9D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,WAAW,CAAC,EAAE,QAAQ,CAAA;IACtB,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;IAChC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,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,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnD,QAAQ,EAAE,SAAS,CAAA;IACnB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAA;IACzC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;CACpE;AA4GD,QAAA,MAAM,MAAM,uHAqOV,CAAA;AAIF,eAAe,MAAM,CAAA"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ interface CameraProps {
3
+ mode?: 'normal' | 'scanCode';
4
+ resolution?: 'low' | 'medium' | 'high';
5
+ devicePosition?: 'front' | 'back';
6
+ flash?: 'auto' | 'on' | 'off';
7
+ frameSize?: 'small' | 'medium' | 'large';
8
+ style?: Record<string, any>;
9
+ bindstop?: () => void;
10
+ binderror?: (error: {
11
+ message: string;
12
+ }) => void;
13
+ bindinitdone?: (result: {
14
+ type: string;
15
+ data: string;
16
+ }) => void;
17
+ bindscancode?: (result: {
18
+ type: string;
19
+ data: string;
20
+ }) => void;
21
+ }
22
+ type HandlerRef<T, P> = {
23
+ current: T | null;
24
+ };
25
+ declare const _camera: React.ForwardRefExoticComponent<CameraProps & React.RefAttributes<HandlerRef<any, CameraProps>>>;
26
+ export default _camera;
27
+ //# sourceMappingURL=mpx-camera.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpx-camera.d.ts","sourceRoot":"","sources":["../mpx-camera.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAA;AAa/F,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC5B,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;IACtC,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAA;IAC7B,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAChD,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAC/D,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CAChE;AA8BD,KAAK,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI;IACtB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAA;CAClB,CAAA;AAID,QAAA,MAAM,OAAO,kGAkNX,CAAA;AAIF,eAAe,OAAO,CAAA"}