@mpxjs/webpack-plugin 2.10.16-beta.7 → 2.10.17-beta.1
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/config.js +0 -60
- package/lib/file-loader.js +3 -13
- package/lib/json-compiler/index.js +2 -2
- package/lib/platform/json/wx/index.js +0 -6
- package/lib/platform/template/wx/component-config/ad.js +0 -5
- package/lib/platform/template/wx/component-config/button.js +2 -9
- package/lib/platform/template/wx/component-config/camera.js +3 -25
- package/lib/platform/template/wx/component-config/canvas.js +1 -8
- package/lib/platform/template/wx/component-config/cover-image.js +2 -7
- package/lib/platform/template/wx/component-config/cover-view.js +1 -3
- package/lib/platform/template/wx/component-config/form.js +2 -27
- package/lib/platform/template/wx/component-config/image.js +0 -5
- package/lib/platform/template/wx/component-config/input.js +0 -10
- package/lib/platform/template/wx/component-config/label.js +2 -10
- package/lib/platform/template/wx/component-config/map.js +0 -11
- package/lib/platform/template/wx/component-config/movable-area.js +1 -4
- package/lib/platform/template/wx/component-config/movable-view.js +2 -17
- package/lib/platform/template/wx/component-config/navigator.js +0 -26
- package/lib/platform/template/wx/component-config/picker-view.js +0 -12
- package/lib/platform/template/wx/component-config/picker.js +1 -3
- package/lib/platform/template/wx/component-config/progress.js +1 -11
- package/lib/platform/template/wx/component-config/rich-text.js +0 -5
- package/lib/platform/template/wx/component-config/scroll-view.js +1 -12
- package/lib/platform/template/wx/component-config/slider.js +0 -8
- package/lib/platform/template/wx/component-config/swiper-item.js +2 -5
- package/lib/platform/template/wx/component-config/swiper.js +0 -10
- package/lib/platform/template/wx/component-config/text.js +0 -5
- package/lib/platform/template/wx/component-config/textarea.js +2 -19
- package/lib/platform/template/wx/component-config/unsupported.js +1 -10
- package/lib/platform/template/wx/component-config/video.js +0 -10
- package/lib/platform/template/wx/index.js +1 -21
- package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-image.d.ts.map +1 -1
- package/lib/runtime/components/react/dist/mpx-image.jsx +26 -20
- package/lib/runtime/components/react/dist/mpx-input.d.ts.map +1 -1
- package/lib/runtime/components/react/dist/mpx-input.jsx +1 -3
- package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +1 -1
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +11 -3
- package/lib/runtime/components/react/mpx-canvas/index.tsx +1 -1
- package/lib/runtime/components/react/mpx-image.tsx +41 -35
- package/lib/runtime/components/react/mpx-input.tsx +1 -3
- package/lib/runtime/components/react/mpx-rich-text/index.tsx +1 -1
- package/lib/runtime/components/react/mpx-web-view.tsx +14 -5
- package/lib/runtime/stringify.wxs +2 -2
- package/lib/style-compiler/strip-conditional-loader.js +142 -90
- package/lib/template-compiler/bind-this.js +2 -2
- package/lib/template-compiler/compiler.js +3 -4
- package/lib/template-compiler/index.js +6 -6
- package/lib/utils/dom-tag-config.js +1 -1
- package/lib/utils/merge-visitors.js +55 -0
- package/lib/wxs/pre-loader.js +8 -5
- package/package.json +3 -12
- package/lib/runtime/components/react/dist/mpx-camera.d.ts +0 -28
- package/lib/runtime/components/react/dist/mpx-camera.d.ts.map +0 -1
- package/lib/runtime/components/react/dist/mpx-camera.jsx +0 -102
- package/lib/runtime/components/react/mpx-camera.tsx +0 -167
- package/lib/utils/chain-assign.js +0 -47
|
@@ -10,7 +10,6 @@ module.exports = function ({ print }) {
|
|
|
10
10
|
const jdPropLog = print({ platform: 'jd', tag: TAG_NAME, isError: false })
|
|
11
11
|
const jdEventLog = print({ platform: 'jd', tag: TAG_NAME, isError: false, type: 'event' })
|
|
12
12
|
const qqPropLog = print({ platform: 'qq', tag: TAG_NAME, isError: false })
|
|
13
|
-
const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
|
|
14
13
|
|
|
15
14
|
return {
|
|
16
15
|
test: TAG_NAME,
|
|
@@ -56,14 +55,6 @@ module.exports = function ({ print }) {
|
|
|
56
55
|
}
|
|
57
56
|
obj.name = propsMap[obj.name]
|
|
58
57
|
return obj
|
|
59
|
-
},
|
|
60
|
-
ks (obj) {
|
|
61
|
-
const propsMap = {
|
|
62
|
-
activeColor: 'active-color',
|
|
63
|
-
backgroundColor: 'background-color'
|
|
64
|
-
}
|
|
65
|
-
obj.name = propsMap[obj.name]
|
|
66
|
-
return obj
|
|
67
58
|
}
|
|
68
59
|
},
|
|
69
60
|
{
|
|
@@ -85,8 +76,7 @@ module.exports = function ({ print }) {
|
|
|
85
76
|
ali: aliEventLog,
|
|
86
77
|
swan: baiduEventLog,
|
|
87
78
|
tt: ttEventLog,
|
|
88
|
-
jd: jdEventLog
|
|
89
|
-
ks: ksEventLog
|
|
79
|
+
jd: jdEventLog
|
|
90
80
|
}
|
|
91
81
|
]
|
|
92
82
|
}
|
|
@@ -5,7 +5,6 @@ module.exports = function ({ print }) {
|
|
|
5
5
|
const baiduPropLog = print({ platform: 'baidu', tag: TAG_NAME, isError: false })
|
|
6
6
|
const ttPropLog = print({ platform: 'bytedance', tag: TAG_NAME, isError: false })
|
|
7
7
|
const jdPropLog = print({ platform: 'jd', tag: TAG_NAME, isError: false })
|
|
8
|
-
const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
|
|
9
8
|
|
|
10
9
|
return {
|
|
11
10
|
test: TAG_NAME,
|
|
@@ -36,10 +35,6 @@ module.exports = function ({ print }) {
|
|
|
36
35
|
{
|
|
37
36
|
test: /^(nodes)$/,
|
|
38
37
|
jd: jdPropLog
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
test: /^(user-select)$/,
|
|
42
|
-
ks: ksPropLog
|
|
43
38
|
}
|
|
44
39
|
]
|
|
45
40
|
}
|
|
@@ -18,8 +18,6 @@ module.exports = function ({ print }) {
|
|
|
18
18
|
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
19
19
|
const iosEventLog = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'event' })
|
|
20
20
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
21
|
-
const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
|
|
22
|
-
const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
|
|
23
21
|
|
|
24
22
|
return {
|
|
25
23
|
test: TAG_NAME,
|
|
@@ -69,10 +67,6 @@ module.exports = function ({ print }) {
|
|
|
69
67
|
{
|
|
70
68
|
test: /^(refresher-default-style|refresher-background)$/,
|
|
71
69
|
ios: iosPropLog
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
test: /^(scroll-into-view-offset|enable-back-to-top|enable-passive|refresher-enabled|refresher-threshold|refresher-default-style|refresher-background|refresher-triggered|bounces|fast-deceleration|enable-flex|enhanced|paging-enabled|using-sticky|type|associative-container|reverse|clip|enable-back-to-top|cache-extent|min-drag-distance|scroll-into-view-within-extent|scroll-into-view-alignment|padding|refresher-two-level-enabled|refresher-two-level-triggered|refresher-two-level-threshold|refresher-two-level-close-threshold|refresher-two-level-close-threshold|refresher-two-level-scroll-enabled|refresher-ballistic-refresh-enabled|refresher-two-level-pinned|scroll-anchoring)$/,
|
|
75
|
-
ks: ksPropLog
|
|
76
70
|
}
|
|
77
71
|
],
|
|
78
72
|
event: [
|
|
@@ -96,18 +90,13 @@ module.exports = function ({ print }) {
|
|
|
96
90
|
ali: aliEventLog,
|
|
97
91
|
tt: ttEventLog,
|
|
98
92
|
qq: qqEventLog,
|
|
99
|
-
swan: baiduEventLog
|
|
100
|
-
ks: ksEventLog
|
|
93
|
+
swan: baiduEventLog
|
|
101
94
|
},
|
|
102
95
|
{
|
|
103
96
|
test: /^(refresherpulling|refresherrestore|refresherabort)$/,
|
|
104
97
|
android: androidEventLog,
|
|
105
98
|
ios: iosEventLog,
|
|
106
99
|
harmony: harmonyEventLog
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
test: /^(scrollstart|scrollend|refresherwillrefresh|refresherstatuschange)$/,
|
|
110
|
-
ks: ksEventLog
|
|
111
100
|
}
|
|
112
101
|
]
|
|
113
102
|
}
|
|
@@ -60,14 +60,6 @@ module.exports = function ({ print }) {
|
|
|
60
60
|
}
|
|
61
61
|
obj.name = propsMap[obj.name]
|
|
62
62
|
return obj
|
|
63
|
-
},
|
|
64
|
-
ks (obj) {
|
|
65
|
-
const propsMap = {
|
|
66
|
-
activeColor: 'active-color',
|
|
67
|
-
backgroundColor: 'background-color'
|
|
68
|
-
}
|
|
69
|
-
obj.name = propsMap[obj.name]
|
|
70
|
-
return obj
|
|
71
63
|
}
|
|
72
64
|
}
|
|
73
65
|
]
|
|
@@ -9,7 +9,6 @@ module.exports = function ({ print }) {
|
|
|
9
9
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
10
10
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
11
11
|
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
12
|
-
const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
|
|
13
12
|
|
|
14
13
|
return {
|
|
15
14
|
test: TAG_NAME,
|
|
@@ -35,8 +34,7 @@ module.exports = function ({ print }) {
|
|
|
35
34
|
ali: aliPropLog,
|
|
36
35
|
ios: iosPropLog,
|
|
37
36
|
android: androidPropLog,
|
|
38
|
-
harmony: harmonyPropLog
|
|
39
|
-
ks: ksPropLog
|
|
37
|
+
harmony: harmonyPropLog
|
|
40
38
|
},
|
|
41
39
|
{
|
|
42
40
|
test: /^(skip-hidden-item-layout)$/,
|
|
@@ -44,8 +42,7 @@ module.exports = function ({ print }) {
|
|
|
44
42
|
ali: aliPropLog,
|
|
45
43
|
tt: ttPropLog,
|
|
46
44
|
swan: baiduPropLog,
|
|
47
|
-
qq: qqPropLog
|
|
48
|
-
ks: ksPropLog
|
|
45
|
+
qq: qqPropLog
|
|
49
46
|
}
|
|
50
47
|
]
|
|
51
48
|
}
|
|
@@ -7,7 +7,6 @@ module.exports = function ({ print }) {
|
|
|
7
7
|
const qqPropLog = print({ platform: 'qq', tag: TAG_NAME, isError: false })
|
|
8
8
|
const ttPropLog = print({ platform: 'bytedance', tag: TAG_NAME, isError: false })
|
|
9
9
|
const webPropLog = print({ platform: 'web', tag: TAG_NAME, isError: false })
|
|
10
|
-
const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
|
|
11
10
|
const jdEventLog = print({ platform: 'jd', tag: TAG_NAME, isError: false, type: 'event' })
|
|
12
11
|
const jdPropLog = print({ platform: 'jd', tag: TAG_NAME, isError: false })
|
|
13
12
|
const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
|
|
@@ -17,7 +16,6 @@ module.exports = function ({ print }) {
|
|
|
17
16
|
const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
18
17
|
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
19
18
|
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
20
|
-
const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
|
|
21
19
|
|
|
22
20
|
return {
|
|
23
21
|
test: TAG_NAME,
|
|
@@ -71,10 +69,6 @@ module.exports = function ({ print }) {
|
|
|
71
69
|
ios: iosPropLog,
|
|
72
70
|
android: androidPropLog,
|
|
73
71
|
harmony: harmonyPropLog
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
test: /^(snap-to-edge|previous-margin|next-margin|display-multiple-items|direction|layout-type|transformer-type|indicator-type|indicator-margin|indicator-spacing|indicator-radius|indicator-width|indicator-height|indicator-alignment|indicator-offset|scroll-with-animation|cache-extent)$/,
|
|
77
|
-
ks: ksPropLog
|
|
78
72
|
}
|
|
79
73
|
],
|
|
80
74
|
event: [
|
|
@@ -101,10 +95,6 @@ module.exports = function ({ print }) {
|
|
|
101
95
|
ios: iosEventLog,
|
|
102
96
|
android: androidEventLog,
|
|
103
97
|
harmony: harmonyEventLog
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
test: /^(onscrollstart|onscrollupdate|onscrollend)$/,
|
|
107
|
-
ks: ksEventLog
|
|
108
98
|
}
|
|
109
99
|
]
|
|
110
100
|
}
|
|
@@ -9,7 +9,6 @@ module.exports = function ({ print }) {
|
|
|
9
9
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
10
10
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
11
11
|
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
12
|
-
const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
|
|
13
12
|
|
|
14
13
|
return {
|
|
15
14
|
test: TAG_NAME,
|
|
@@ -75,10 +74,6 @@ module.exports = function ({ print }) {
|
|
|
75
74
|
el.isSimple = true
|
|
76
75
|
return false
|
|
77
76
|
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
test: /^(user-select|overflow|max-lines|decode)$/,
|
|
81
|
-
ks: ksPropLog
|
|
82
77
|
}
|
|
83
78
|
]
|
|
84
79
|
}
|
|
@@ -23,8 +23,6 @@ module.exports = function ({ print }) {
|
|
|
23
23
|
const harmonyValueLogError = print({ platform: 'harmony', tag: TAG_NAME, isError: true, type: 'value' })
|
|
24
24
|
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
25
25
|
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
26
|
-
const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
|
|
27
|
-
const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
|
|
28
26
|
|
|
29
27
|
return {
|
|
30
28
|
test: TAG_NAME,
|
|
@@ -97,17 +95,12 @@ module.exports = function ({ print }) {
|
|
|
97
95
|
ios: iosPropLog,
|
|
98
96
|
android: androidPropLog,
|
|
99
97
|
harmony: harmonyPropLog
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
test: /^(cursor-spacing|cursor|selection-start|selection-end|adjust-position|hold-keyboard|disable-default-padding|confirm-hold|adjust-keyboard-to|placeholder-class|show-confirm-bar)$/,
|
|
103
|
-
ks: ksPropLog
|
|
104
98
|
}
|
|
105
99
|
],
|
|
106
100
|
event: [
|
|
107
101
|
{
|
|
108
102
|
test: /^(confirm|linechange)$/,
|
|
109
|
-
web: webEventLog
|
|
110
|
-
ks: ksEventLog
|
|
103
|
+
web: webEventLog
|
|
111
104
|
},
|
|
112
105
|
{
|
|
113
106
|
test: /^keyboardheightchange$/,
|
|
@@ -131,17 +124,7 @@ module.exports = function ({ print }) {
|
|
|
131
124
|
test: /^keyboard.+$/,
|
|
132
125
|
ios: iosEventLog,
|
|
133
126
|
android: androidEventLog,
|
|
134
|
-
harmony: harmonyEventLog
|
|
135
|
-
ks: ksEventLog
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
test: /^(selectionchange)$/,
|
|
139
|
-
ks: ksEventLog,
|
|
140
|
-
ali: aliEventLog,
|
|
141
|
-
jd: jdEventLog,
|
|
142
|
-
qq: qqEventLog,
|
|
143
|
-
tt: ttEventLog,
|
|
144
|
-
web: webEventLog
|
|
127
|
+
harmony: harmonyEventLog
|
|
145
128
|
}
|
|
146
129
|
]
|
|
147
130
|
}
|
|
@@ -6,14 +6,12 @@ const BAIDU_UNSUPPORTED_TAG_NAME_ARR = ['functional-page-navigator', 'live-pushe
|
|
|
6
6
|
const QQ_UNSUPPORTED_TAG_NAME_ARR = ['functional-page-navigator', 'official-account', 'editor']
|
|
7
7
|
// 头条小程序不支持的标签集合
|
|
8
8
|
const TT_UNSUPPORTED_TAG_NAME_ARR = ['movable-view', 'cover-image', 'cover-view', 'movable-area', 'open-data', 'official-account', 'editor', 'functional-page-navigator', 'audio', 'live-pusher']
|
|
9
|
-
// 快手小程序不支持的标签集合
|
|
10
|
-
const KS_UNSUPPORTED_TAG_NAME_ARR = ['match-media', 'page-container', 'root-portal', 'selection', 'functional-page-navigator', 'editor', 'editor-portal', 'keyboard-accessory', 'live-player', 'live-pusher', 'voip-room', 'channel-live', 'channel-video', 'ad-custom', 'official-account', 'official-account-publisher', 'open-data', 'store-coupon', 'store-gift', 'store-home', 'store-product']
|
|
11
9
|
// 京东小程序不支持的标签集合
|
|
12
10
|
const JD_UNSUPPORTED_TAG_NAME_ARR = ['functional-page-navigator', 'live-pusher', 'live-player', 'rich-text', 'audio', 'video', 'camera']
|
|
13
11
|
// 快应用不支持的标签集合
|
|
14
12
|
const QA_UNSUPPORTED_TAG_NAME_ARR = ['movable-view', 'movable-area', 'open-data', 'official-account', 'editor', 'functional-page-navigator', 'live-player', 'live-pusher', 'ad', 'cover-image']
|
|
15
13
|
// RN不支持的标签集合
|
|
16
|
-
const RN_UNSUPPORTED_TAG_NAME_ARR = ['open-data', 'official-account', 'editor', 'functional-page-navigator', 'live-player', 'live-pusher', 'ad', 'audio', 'match-media', 'page-container', 'editor', 'keyboard-accessory', 'map']
|
|
14
|
+
const RN_UNSUPPORTED_TAG_NAME_ARR = ['open-data', 'official-account', 'editor', 'functional-page-navigator', 'live-player', 'live-pusher', 'ad', 'audio', 'camera', 'match-media', 'page-container', 'editor', 'keyboard-accessory', 'map']
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
17
|
* @param {function(object): function} print
|
|
@@ -24,7 +22,6 @@ module.exports = function ({ print }) {
|
|
|
24
22
|
const baiduUnsupportedTagError = print({ platform: 'baidu', isError: true, type: 'tag' })
|
|
25
23
|
const qqUnsupportedTagError = print({ platform: 'qq', isError: true, type: 'tag' })
|
|
26
24
|
const ttUnsupportedTagError = print({ platform: 'bytedance', isError: true, type: 'tag' })
|
|
27
|
-
const ksUnsupportedTagError = print({ platform: 'ks', isError: true, type: 'tag' })
|
|
28
25
|
const jdUnsupportedTagError = print({ platform: 'jd', isError: true, type: 'tag' })
|
|
29
26
|
const qaUnsupportedTagError = print({ platform: 'qa', isError: true, type: 'tag' })
|
|
30
27
|
const iosUnsupportedTagError = print({ platform: 'ios', isError: true, type: 'tag' })
|
|
@@ -35,7 +32,6 @@ module.exports = function ({ print }) {
|
|
|
35
32
|
const baiduUnsupportedExp = new RegExp('^(' + BAIDU_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
36
33
|
const qqUnsupportedExp = new RegExp('^(' + QQ_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
37
34
|
const ttUnsupportedExp = new RegExp('^(' + TT_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
38
|
-
const ksUnsupportedExp = new RegExp('^(' + KS_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
39
35
|
const jdUnsupportedExp = new RegExp('^(' + JD_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
40
36
|
const qaUnsupportedExp = new RegExp('^(' + QA_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
41
37
|
const iosUnsupportedExp = new RegExp('^(' + RN_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
@@ -63,11 +59,6 @@ module.exports = function ({ print }) {
|
|
|
63
59
|
test: ttUnsupportedExp,
|
|
64
60
|
tt: ttUnsupportedTagError
|
|
65
61
|
},
|
|
66
|
-
{
|
|
67
|
-
supportedModes: ['ks'],
|
|
68
|
-
test: ksUnsupportedExp,
|
|
69
|
-
ks: ksUnsupportedTagError
|
|
70
|
-
},
|
|
71
62
|
{
|
|
72
63
|
supportedModes: ['jd'],
|
|
73
64
|
test: jdUnsupportedExp,
|
|
@@ -17,8 +17,6 @@ module.exports = function ({ print }) {
|
|
|
17
17
|
const androidEventLogError = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
18
18
|
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
19
19
|
const harmonyEventLogError = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
20
|
-
const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
|
|
21
|
-
const ksEventLogError = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
|
|
22
20
|
return {
|
|
23
21
|
test: TAG_NAME,
|
|
24
22
|
web (tag, { el }) {
|
|
@@ -76,10 +74,6 @@ module.exports = function ({ print }) {
|
|
|
76
74
|
test: /^(duration|enable-danmu|danmu-btn|page-gesture|direction|show-progress|show-fullscreen-btn|show-center-play-btn|enable-progress-gesture|show-mute-btn|title|play-btn-position|enable-play-gesture|auto-pause-if-navigate|auto-pause-if-open-native|vslide-gesture|vslide-gesture-in-fullscreen|show-bottom-progress|ad-unit-id|poster-for-crawler|show-casting-button|picture-in-picture-mode|picture-in-picture-show-progress| picture-in-picture-init-position|enable-auto-rotation|show-snapshot-button|show-screen-lock-button|show-background-playback-button|background-poster|referrer-policy|is-live)$/,
|
|
77
75
|
android: androidPropLog,
|
|
78
76
|
harmony: harmonyPropLog
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
test: /^(duration|danmu-list|enable-danmu|danmu-btn|auto-pause-if-navigate|auto-pause-if-open-native|ad-unit-id|poster-for-crawler|picture-in-picture-mode|picture-in-picture-show-progress|picture-in-picture-init-position|enable-auto-rotation|show-snapshot-button|show-background-playback-button|background-poster|is-drm|is-live|provision-url|certificate-url|license-url|preferred-peak-bit-rate)$/,
|
|
82
|
-
ks: ksPropLog
|
|
83
77
|
}
|
|
84
78
|
],
|
|
85
79
|
event: [
|
|
@@ -123,10 +117,6 @@ module.exports = function ({ print }) {
|
|
|
123
117
|
test: /^(progress|enterpictureinpicture|leavepictureinpicture|castinguserselect|castingstatechange|castinginterrupt)$/,
|
|
124
118
|
android: androidEventLogError,
|
|
125
119
|
harmony: harmonyEventLogError
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
test: /^(waiting|controlstoggle|enterpictureinpicture|leavepictureinpicture|seekcomplete|castinguserselect)$/,
|
|
129
|
-
ks: ksEventLogError
|
|
130
120
|
}
|
|
131
121
|
]
|
|
132
122
|
}
|
|
@@ -62,7 +62,7 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
const spec = {
|
|
65
|
-
supportedModes: ['ali', 'swan', 'qq', 'tt', '
|
|
65
|
+
supportedModes: ['ali', 'swan', 'qq', 'tt', 'web', 'qa', 'jd', 'dd', 'ios', 'android', 'harmony'],
|
|
66
66
|
// props预处理
|
|
67
67
|
preProps: [],
|
|
68
68
|
// props后处理
|
|
@@ -325,13 +325,6 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
325
325
|
value
|
|
326
326
|
}
|
|
327
327
|
},
|
|
328
|
-
ks ({ name, value }) {
|
|
329
|
-
const dir = this.test.exec(name)[1]
|
|
330
|
-
return {
|
|
331
|
-
name: 'ks:' + dir,
|
|
332
|
-
value
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
328
|
dd ({ name, value }) {
|
|
336
329
|
const dir = this.test.exec(name)[1]
|
|
337
330
|
return {
|
|
@@ -420,19 +413,6 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
420
413
|
value
|
|
421
414
|
}
|
|
422
415
|
},
|
|
423
|
-
ks ({ name, value }, { eventRules }) {
|
|
424
|
-
const match = this.test.exec(name)
|
|
425
|
-
const prefix = match[1]
|
|
426
|
-
const eventName = match[2]
|
|
427
|
-
const modifierStr = match[3] || ''
|
|
428
|
-
let rPrefix = runRules(spec.event.prefix, prefix, { mode: 'ks' })
|
|
429
|
-
const rEventName = runRules(eventRules, eventName, { mode: 'ks' })
|
|
430
|
-
if (rEventName.includes('-')) rPrefix += ':'
|
|
431
|
-
return {
|
|
432
|
-
name: rPrefix + rEventName + modifierStr,
|
|
433
|
-
value
|
|
434
|
-
}
|
|
435
|
-
},
|
|
436
416
|
dd ({ name, value }, { eventRules }) {
|
|
437
417
|
const match = this.test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@ const Image = forwardRef((props, ref) => {
|
|
|
315
315
|
], {
|
|
316
316
|
layoutRef
|
|
317
317
|
});
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
318
|
+
function renderSvgImage() {
|
|
319
|
+
return createElement(View, innerProps, createElement(SvgCssUri, {
|
|
320
|
+
uri: src,
|
|
321
|
+
onLayout: onSvgLoad,
|
|
322
|
+
onError: binderror && onSvgError,
|
|
323
|
+
style: extendObject({ transformOrigin: 'left top' }, modeStyle)
|
|
324
|
+
}));
|
|
325
|
+
}
|
|
326
|
+
function renderBaseImage() {
|
|
327
|
+
return renderImage(extendObject({
|
|
328
|
+
source: { uri: src },
|
|
329
|
+
resizeMode: resizeMode,
|
|
330
|
+
onLoad: bindload && onImageLoad,
|
|
331
|
+
onError: binderror && onImageError,
|
|
332
|
+
style: extendObject({
|
|
333
|
+
transformOrigin: 'left top',
|
|
334
|
+
width: isCropMode ? imageWidth : '100%',
|
|
335
|
+
height: isCropMode ? imageHeight : '100%'
|
|
336
|
+
}, isCropMode ? modeStyle : {})
|
|
337
|
+
}, isLayoutMode ? {} : innerProps), enableFastImage);
|
|
338
|
+
}
|
|
339
|
+
function renderLayoutImage() {
|
|
340
|
+
return createElement(View, innerProps, loaded && renderBaseImage());
|
|
341
|
+
}
|
|
342
|
+
const finalComponent = isSvg ? renderSvgImage() : isLayoutMode ? renderLayoutImage() : renderBaseImage();
|
|
337
343
|
if (hasPositionFixed) {
|
|
338
344
|
return createElement(Portal, null, finalComponent);
|
|
339
345
|
}
|
|
340
346
|
return finalComponent;
|
|
341
347
|
});
|
|
342
|
-
Image.displayName = '
|
|
348
|
+
Image.displayName = 'MpxImage';
|
|
343
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G,OAAO,KAAK,IAAI,CAAA;CACvG;AAED,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,mCAAmC,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;CACpG;AAED,KAAK,eAAe,GAAG,UAAU,GAAG,iBAAiB,CAAA;AASrD,QAAA,MAAM,KAAK,mJAqYT,CAAA;AAIF,eAAe,KAAK,CAAA"}
|
|
@@ -156,9 +156,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
156
156
|
evt.nativeEvent.origin = 'input';
|
|
157
157
|
};
|
|
158
158
|
const onFocus = (evt) => {
|
|
159
|
-
|
|
160
|
-
setKeyboardAvoidContext();
|
|
161
|
-
}
|
|
159
|
+
setKeyboardAvoidContext();
|
|
162
160
|
if (bindfocus) {
|
|
163
161
|
const focusAction = () => {
|
|
164
162
|
bindfocus(getCustomEvent('focus', evt, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mpx-web-view.d.ts","sourceRoot":"","sources":["../mpx-web-view.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAMvD,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE;QACN,IAAI,EAAE,GAAG,EAAE,CAAA;KACZ,CAAA;CACF,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;CACF,CAAA;AAED,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAA;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAC/C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAChD,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACjB;AAgDD,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"mpx-web-view.d.ts","sourceRoot":"","sources":["../mpx-web-view.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAMvD,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE;QACN,IAAI,EAAE,GAAG,EAAE,CAAA;KACZ,CAAA;CACF,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;CACF,CAAA;AAED,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAA;IACrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAC/C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAChD,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACjB;AAgDD,QAAA,MAAM,QAAQ,6IAmSZ,CAAA;AAIF,eAAe,QAAQ,CAAA"}
|
|
@@ -80,8 +80,16 @@ const _WebView = forwardRef((props, ref) => {
|
|
|
80
80
|
useNodesRef(props, ref, webViewRef, {
|
|
81
81
|
style: defaultWebViewStyle
|
|
82
82
|
});
|
|
83
|
+
const getHostFromUrl = function (url) {
|
|
84
|
+
if (!url)
|
|
85
|
+
return '';
|
|
86
|
+
// 匹配协议://主机名(:端口) 的模式
|
|
87
|
+
const regex = /^(?:https?|ftp):\/\/([^/?:#]+)(?::(\d+))?/i;
|
|
88
|
+
const match = url.match(regex);
|
|
89
|
+
return match ? match[1] : '';
|
|
90
|
+
};
|
|
83
91
|
const hostValidate = (url) => {
|
|
84
|
-
const host = url &&
|
|
92
|
+
const host = url && getHostFromUrl(url);
|
|
85
93
|
const hostWhitelists = mpx.config.rnConfig?.webviewConfig?.hostWhitelists || [];
|
|
86
94
|
if (hostWhitelists.length) {
|
|
87
95
|
return hostWhitelists.some((item) => {
|
|
@@ -176,7 +184,7 @@ const _WebView = forwardRef((props, ref) => {
|
|
|
176
184
|
}
|
|
177
185
|
break;
|
|
178
186
|
case 'postMessage':
|
|
179
|
-
bindmessage && bindmessage(getCustomEvent('
|
|
187
|
+
bindmessage && bindmessage(getCustomEvent('messsage', {}, {
|
|
180
188
|
detail: {
|
|
181
189
|
data: params[0]?.data
|
|
182
190
|
}
|
|
@@ -291,7 +299,7 @@ const _WebView = forwardRef((props, ref) => {
|
|
|
291
299
|
<View style={styles.loadErrorText}><Text style={{ fontSize: 14, color: '#999999' }}>{currentErrorText.text}</Text></View>
|
|
292
300
|
<View style={styles.loadErrorButton} onTouchEnd={_reload}><Text style={{ fontSize: 12, color: '#666666' }}>{currentErrorText.button}</Text></View>
|
|
293
301
|
</View>)
|
|
294
|
-
: (<WebView
|
|
302
|
+
: (<WebView containerStyle={defaultWebViewStyle} source={{ uri: src }} ref={webViewRef} javaScriptEnabled={true} onNavigationStateChange={_changeUrl} onMessage={_message} injectedJavaScript={injectedJavaScript} onLoadProgress={_onLoadProgress} onLoadEnd={onLoadEnd} onHttpError={onHttpError} onError={onError} allowsBackForwardNavigationGestures={true}></WebView>)}
|
|
295
303
|
</Portal>);
|
|
296
304
|
});
|
|
297
305
|
_WebView.displayName = 'MpxWebview';
|
|
@@ -464,44 +464,50 @@ const Image = forwardRef<HandlerRef<RNImage, ImageProps>, ImageProps>((props, re
|
|
|
464
464
|
}
|
|
465
465
|
)
|
|
466
466
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
{ transformOrigin: 'left top' },
|
|
476
|
-
modeStyle
|
|
477
|
-
)
|
|
478
|
-
})
|
|
479
|
-
)
|
|
480
|
-
|
|
481
|
-
const BaseImage = renderImage(
|
|
482
|
-
extendObject(
|
|
483
|
-
{
|
|
484
|
-
source: { uri: src },
|
|
485
|
-
resizeMode: resizeMode,
|
|
486
|
-
onLoad: bindload && onImageLoad,
|
|
487
|
-
onError: binderror && onImageError,
|
|
467
|
+
function renderSvgImage () {
|
|
468
|
+
return createElement(
|
|
469
|
+
View,
|
|
470
|
+
innerProps,
|
|
471
|
+
createElement(SvgCssUri, {
|
|
472
|
+
uri: src,
|
|
473
|
+
onLayout: onSvgLoad,
|
|
474
|
+
onError: binderror && onSvgError,
|
|
488
475
|
style: extendObject(
|
|
489
|
-
{
|
|
490
|
-
|
|
491
|
-
width: isCropMode ? imageWidth : '100%',
|
|
492
|
-
height: isCropMode ? imageHeight : '100%'
|
|
493
|
-
},
|
|
494
|
-
isCropMode ? modeStyle : {}
|
|
476
|
+
{ transformOrigin: 'left top' },
|
|
477
|
+
modeStyle
|
|
495
478
|
)
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
enableFastImage
|
|
500
|
-
)
|
|
479
|
+
})
|
|
480
|
+
)
|
|
481
|
+
}
|
|
501
482
|
|
|
502
|
-
|
|
483
|
+
function renderBaseImage () {
|
|
484
|
+
return renderImage(
|
|
485
|
+
extendObject(
|
|
486
|
+
{
|
|
487
|
+
source: { uri: src },
|
|
488
|
+
resizeMode: resizeMode,
|
|
489
|
+
onLoad: bindload && onImageLoad,
|
|
490
|
+
onError: binderror && onImageError,
|
|
491
|
+
style: extendObject(
|
|
492
|
+
{
|
|
493
|
+
transformOrigin: 'left top',
|
|
494
|
+
width: isCropMode ? imageWidth : '100%',
|
|
495
|
+
height: isCropMode ? imageHeight : '100%'
|
|
496
|
+
},
|
|
497
|
+
isCropMode ? modeStyle : {}
|
|
498
|
+
)
|
|
499
|
+
},
|
|
500
|
+
isLayoutMode ? {} : innerProps
|
|
501
|
+
),
|
|
502
|
+
enableFastImage
|
|
503
|
+
)
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function renderLayoutImage () {
|
|
507
|
+
return createElement(View, innerProps, loaded && renderBaseImage())
|
|
508
|
+
}
|
|
503
509
|
|
|
504
|
-
const finalComponent = isSvg ?
|
|
510
|
+
const finalComponent = isSvg ? renderSvgImage() : isLayoutMode ? renderLayoutImage() : renderBaseImage()
|
|
505
511
|
|
|
506
512
|
if (hasPositionFixed) {
|
|
507
513
|
return createElement(Portal, null, finalComponent)
|
|
@@ -510,6 +516,6 @@ const Image = forwardRef<HandlerRef<RNImage, ImageProps>, ImageProps>((props, re
|
|
|
510
516
|
return finalComponent
|
|
511
517
|
})
|
|
512
518
|
|
|
513
|
-
Image.displayName = '
|
|
519
|
+
Image.displayName = 'MpxImage'
|
|
514
520
|
|
|
515
521
|
export default Image
|
|
@@ -295,9 +295,7 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
const onFocus = (evt: NativeSyntheticEvent<TextInputFocusEventData>) => {
|
|
298
|
-
|
|
299
|
-
setKeyboardAvoidContext()
|
|
300
|
-
}
|
|
298
|
+
setKeyboardAvoidContext()
|
|
301
299
|
|
|
302
300
|
if (bindfocus) {
|
|
303
301
|
const focusAction = () => {
|