@mpxjs/webpack-plugin 2.10.14-beta.2 → 2.10.14-beta.21

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 (106) hide show
  1. package/lib/dependencies/ImportDependency.js +102 -0
  2. package/lib/index.js +18 -11
  3. package/lib/platform/style/wx/index.js +7 -1
  4. package/lib/platform/template/wx/component-config/button.js +13 -4
  5. package/lib/platform/template/wx/component-config/index.js +3 -1
  6. package/lib/platform/template/wx/component-config/nav-container.js +27 -0
  7. package/lib/react/LoadAsyncChunkModule.js +2 -5
  8. package/lib/runtime/components/ali/mpx-nav-container.mpx +3 -0
  9. package/lib/runtime/components/react/context.ts +18 -6
  10. package/lib/runtime/components/react/dist/context.d.ts +79 -0
  11. package/lib/runtime/components/react/dist/context.js +1 -0
  12. package/lib/runtime/components/react/dist/event.config.d.ts +7 -0
  13. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +7 -0
  14. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +12 -0
  15. package/lib/runtime/components/react/dist/mpx-button.d.ts +68 -0
  16. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +23 -0
  17. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +7 -0
  18. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +6 -0
  19. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +20 -0
  20. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +8 -0
  21. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +10 -0
  22. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +2 -0
  23. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +32 -0
  24. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +52 -0
  25. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +20 -0
  26. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +32 -0
  27. package/lib/runtime/components/react/dist/mpx-form.d.ts +27 -0
  28. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +18 -0
  29. package/lib/runtime/components/react/dist/mpx-image.d.ts +21 -0
  30. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +7 -0
  31. package/lib/runtime/components/react/dist/mpx-input.d.ts +50 -0
  32. package/lib/runtime/components/react/dist/mpx-input.jsx +38 -19
  33. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +12 -0
  34. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +81 -48
  35. package/lib/runtime/components/react/dist/mpx-label.d.ts +20 -0
  36. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +20 -0
  37. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +63 -0
  38. package/lib/runtime/components/react/dist/mpx-nav-container.d.ts +9 -0
  39. package/lib/runtime/components/react/dist/mpx-nav-container.jsx +23 -0
  40. package/lib/runtime/components/react/dist/mpx-navigator.d.ts +9 -0
  41. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +6 -0
  42. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +7 -0
  43. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +6 -0
  44. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +6 -0
  45. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +6 -0
  46. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +2 -0
  47. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +6 -0
  48. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +6 -0
  49. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +106 -0
  50. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +31 -0
  51. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +8 -0
  52. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +22 -0
  53. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +14 -0
  54. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +16 -0
  55. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +12 -0
  56. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +11 -0
  57. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +22 -0
  58. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +16 -0
  59. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +15 -0
  60. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +29 -0
  61. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +9 -0
  62. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +20 -0
  63. package/lib/runtime/components/react/dist/mpx-radio.d.ts +26 -0
  64. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +1 -0
  65. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +24 -0
  66. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +14 -0
  67. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +54 -0
  68. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +7 -0
  69. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +7 -0
  70. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +17 -0
  71. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +15 -0
  72. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +18 -0
  73. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +1 -1
  74. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +54 -0
  75. package/lib/runtime/components/react/dist/mpx-swiper.jsx +49 -5
  76. package/lib/runtime/components/react/dist/mpx-switch.d.ts +26 -0
  77. package/lib/runtime/components/react/dist/mpx-text.d.ts +21 -0
  78. package/lib/runtime/components/react/dist/mpx-textarea.d.ts +7 -0
  79. package/lib/runtime/components/react/dist/mpx-textarea.jsx +1 -0
  80. package/lib/runtime/components/react/dist/mpx-video.d.ts +101 -0
  81. package/lib/runtime/components/react/dist/mpx-view.d.ts +34 -0
  82. package/lib/runtime/components/react/dist/mpx-view.jsx +3 -2
  83. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +22 -0
  84. package/lib/runtime/components/react/dist/nav.d.ts +8 -0
  85. package/lib/runtime/components/react/dist/nav.jsx +138 -0
  86. package/lib/runtime/components/react/dist/parser.d.ts +39 -0
  87. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +32 -0
  88. package/lib/runtime/components/react/dist/useNavShared.d.ts +2 -0
  89. package/lib/runtime/components/react/dist/useNavShared.js +6 -0
  90. package/lib/runtime/components/react/dist/useNodesRef.d.ts +11 -0
  91. package/lib/runtime/components/react/dist/utils.d.ts +122 -0
  92. package/lib/runtime/components/react/mpx-input.tsx +48 -26
  93. package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +91 -47
  94. package/lib/runtime/components/react/mpx-nav-container.tsx +33 -0
  95. package/lib/runtime/components/react/mpx-swiper-item.tsx +1 -1
  96. package/lib/runtime/components/react/mpx-swiper.tsx +60 -7
  97. package/lib/runtime/components/react/mpx-textarea.tsx +1 -0
  98. package/lib/runtime/components/react/mpx-view.tsx +3 -2
  99. package/lib/runtime/components/react/nav.tsx +164 -0
  100. package/lib/runtime/components/react/types/common.d.ts +19 -0
  101. package/lib/runtime/components/react/useNavShared.ts +8 -0
  102. package/lib/runtime/components/web/mpx-nav-container.vue +13 -0
  103. package/lib/runtime/components/wx/mpx-nav-container.mpx +9 -0
  104. package/lib/utils/dom-tag-config.js +2 -2
  105. package/package.json +1 -1
  106. package/lib/dependencies/ImportDependencyTemplate.js +0 -50
@@ -78,7 +78,7 @@ const isBuildInWebTag = makeMap(
78
78
  'mpx-swiper,mpx-view,mpx-checkbox-group,mpx-movable-area,mpx-radio-group,' +
79
79
  'mpx-switch,mpx-web-view,mpx-checkbox,mpx-movable-view,mpx-radio,' +
80
80
  'mpx-tab-bar-container,mpx-form,mpx-navigator,mpx-rich-text,mpx-tab-bar,' +
81
- 'mpx-icon,mpx-picker-view-column,mpx-scroll-view,mpx-text'
81
+ 'mpx-icon,mpx-picker-view-column,mpx-scroll-view,mpx-text,mpx-nav-container'
82
82
  )
83
83
 
84
84
  /**
@@ -91,7 +91,7 @@ const isBuildInReactTag = makeMap(
91
91
  'mpx-movable-area,mpx-label,mpx-keyboard-avoiding-view,mpx-input,mpx-inline-text,' +
92
92
  'mpx-image,mpx-form,mpx-checkbox,mpx-checkbox-group,mpx-button,' +
93
93
  'mpx-rich-text,mpx-portal,mpx-popup,mpx-picker-view-column,mpx-picker-view,mpx-picker,' +
94
- 'mpx-icon,mpx-canvas'
94
+ 'mpx-icon,mpx-canvas,mpx-nav-container'
95
95
  )
96
96
 
97
97
  const isSpace = makeMap('ensp,emsp,nbsp')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.14-beta.2",
3
+ "version": "2.10.14-beta.21",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -1,50 +0,0 @@
1
- const ModuleDependency = require('webpack/lib/dependencies/ModuleDependency')
2
- const { RetryRuntimeGlobal } = require('../retry-runtime-module')
3
- const parseRequest = require('../utils/parse-request')
4
-
5
- class ImportDependencyTemplate extends (
6
- ModuleDependency.Template
7
- ) {
8
- /**
9
- * @param {Dependency} dependency the dependency for which the template should be applied
10
- * @param {ReplaceSource} source the current replace source which can be modified
11
- * @param {DependencyTemplateContext} templateContext the context object
12
- * @returns {void}
13
- */
14
- apply (
15
- dependency,
16
- source,
17
- { runtimeTemplate, module, moduleGraph, chunkGraph, runtimeRequirements }
18
- ) {
19
- const dep = /** @type {ImportDependency} */ (dependency)
20
- const block = /** @type {AsyncDependenciesBlock} */ (
21
- moduleGraph.getParentBlock(dep)
22
- )
23
- let content = runtimeTemplate.moduleNamespacePromise({
24
- chunkGraph,
25
- block: block,
26
- module: /** @type {Module} */ (moduleGraph.getModule(dep)),
27
- request: dep.request,
28
- strict: /** @type {BuildMeta} */ (module.buildMeta).strictHarmonyModule,
29
- message: 'import()',
30
- runtimeRequirements
31
- })
32
- // replace fakeType by 9 to fix require.async to commonjs2 module like 'module.exports = function(){...}'
33
- content = content.replace(/(__webpack_require__\.t\.bind\(.+,\s*)(\d+)(\s*\))/, (_, p1, p2, p3) => {
34
- return p1 + '9' + p3
35
- })
36
-
37
- const { queryObj } = parseRequest(dep.request)
38
- const retryRequireAsync = queryObj.retryRequireAsync && JSON.parse(queryObj.retryRequireAsync)
39
-
40
- // require.async 的场景且配置了重试次数才注入 RetryRuntimeModule
41
- if (queryObj.isRequireAsync && retryRequireAsync && retryRequireAsync.times > 0) {
42
- runtimeRequirements.add(RetryRuntimeGlobal)
43
- content = `${RetryRuntimeGlobal}(function() { return ${content} }, ${retryRequireAsync.times}, ${retryRequireAsync.interval})`
44
- }
45
-
46
- source.replace(dep.range[0], dep.range[1] - 1, content)
47
- }
48
- }
49
-
50
- module.exports = ImportDependencyTemplate