@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.
- package/lib/dependencies/ImportDependency.js +102 -0
- package/lib/index.js +18 -11
- package/lib/platform/style/wx/index.js +7 -1
- package/lib/platform/template/wx/component-config/button.js +13 -4
- package/lib/platform/template/wx/component-config/index.js +3 -1
- package/lib/platform/template/wx/component-config/nav-container.js +27 -0
- package/lib/react/LoadAsyncChunkModule.js +2 -5
- package/lib/runtime/components/ali/mpx-nav-container.mpx +3 -0
- package/lib/runtime/components/react/context.ts +18 -6
- package/lib/runtime/components/react/dist/context.d.ts +79 -0
- package/lib/runtime/components/react/dist/context.js +1 -0
- package/lib/runtime/components/react/dist/event.config.d.ts +7 -0
- package/lib/runtime/components/react/dist/getInnerListeners.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +12 -0
- package/lib/runtime/components/react/dist/mpx-button.d.ts +68 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +23 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +6 -0
- package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +20 -0
- package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +10 -0
- package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +2 -0
- package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +32 -0
- package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +52 -0
- package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +20 -0
- package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +32 -0
- package/lib/runtime/components/react/dist/mpx-form.d.ts +27 -0
- package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +18 -0
- package/lib/runtime/components/react/dist/mpx-image.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-input.d.ts +50 -0
- package/lib/runtime/components/react/dist/mpx-input.jsx +38 -19
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +12 -0
- package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +81 -48
- package/lib/runtime/components/react/dist/mpx-label.d.ts +20 -0
- package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +20 -0
- package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +63 -0
- package/lib/runtime/components/react/dist/mpx-nav-container.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-nav-container.jsx +23 -0
- package/lib/runtime/components/react/dist/mpx-navigator.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +6 -0
- package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +6 -0
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +6 -0
- package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +6 -0
- package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +2 -0
- package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +6 -0
- package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +6 -0
- package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +106 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +31 -0
- package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +8 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +22 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +14 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +16 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +12 -0
- package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +11 -0
- package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +22 -0
- package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +16 -0
- package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +15 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +29 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +9 -0
- package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +20 -0
- package/lib/runtime/components/react/dist/mpx-radio.d.ts +26 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +1 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +24 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +14 -0
- package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +54 -0
- package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +17 -0
- package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +15 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +18 -0
- package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts +54 -0
- package/lib/runtime/components/react/dist/mpx-swiper.jsx +49 -5
- package/lib/runtime/components/react/dist/mpx-switch.d.ts +26 -0
- package/lib/runtime/components/react/dist/mpx-text.d.ts +21 -0
- package/lib/runtime/components/react/dist/mpx-textarea.d.ts +7 -0
- package/lib/runtime/components/react/dist/mpx-textarea.jsx +1 -0
- package/lib/runtime/components/react/dist/mpx-video.d.ts +101 -0
- package/lib/runtime/components/react/dist/mpx-view.d.ts +34 -0
- package/lib/runtime/components/react/dist/mpx-view.jsx +3 -2
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts +22 -0
- package/lib/runtime/components/react/dist/nav.d.ts +8 -0
- package/lib/runtime/components/react/dist/nav.jsx +138 -0
- package/lib/runtime/components/react/dist/parser.d.ts +39 -0
- package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +32 -0
- package/lib/runtime/components/react/dist/useNavShared.d.ts +2 -0
- package/lib/runtime/components/react/dist/useNavShared.js +6 -0
- package/lib/runtime/components/react/dist/useNodesRef.d.ts +11 -0
- package/lib/runtime/components/react/dist/utils.d.ts +122 -0
- package/lib/runtime/components/react/mpx-input.tsx +48 -26
- package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +91 -47
- package/lib/runtime/components/react/mpx-nav-container.tsx +33 -0
- package/lib/runtime/components/react/mpx-swiper-item.tsx +1 -1
- package/lib/runtime/components/react/mpx-swiper.tsx +60 -7
- package/lib/runtime/components/react/mpx-textarea.tsx +1 -0
- package/lib/runtime/components/react/mpx-view.tsx +3 -2
- package/lib/runtime/components/react/nav.tsx +164 -0
- package/lib/runtime/components/react/types/common.d.ts +19 -0
- package/lib/runtime/components/react/useNavShared.ts +8 -0
- package/lib/runtime/components/web/mpx-nav-container.vue +13 -0
- package/lib/runtime/components/wx/mpx-nav-container.mpx +9 -0
- package/lib/utils/dom-tag-config.js +2 -2
- package/package.json +1 -1
- 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,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
|