@mpxjs/webpack-plugin 2.10.1-beta.1 → 2.10.1-beta.3
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 +2 -1
- package/lib/index.js +1 -1
- package/lib/platform/json/wx/index.js +6 -3
- package/lib/platform/style/wx/index.js +23 -12
- package/lib/platform/template/wx/component-config/button.js +19 -2
- package/lib/platform/template/wx/component-config/canvas.js +4 -0
- package/lib/platform/template/wx/component-config/checkbox-group.js +4 -0
- package/lib/platform/template/wx/component-config/checkbox.js +4 -0
- package/lib/platform/template/wx/component-config/cover-image.js +7 -1
- package/lib/platform/template/wx/component-config/cover-view.js +4 -0
- package/lib/platform/template/wx/component-config/form.js +7 -1
- package/lib/platform/template/wx/component-config/icon.js +4 -0
- package/lib/platform/template/wx/component-config/image.js +7 -1
- package/lib/platform/template/wx/component-config/input.js +17 -2
- package/lib/platform/template/wx/component-config/label.js +4 -0
- package/lib/platform/template/wx/component-config/movable-area.js +7 -1
- package/lib/platform/template/wx/component-config/movable-view.js +12 -3
- package/lib/platform/template/wx/component-config/navigator.js +4 -0
- package/lib/platform/template/wx/component-config/picker-view-column.js +4 -0
- package/lib/platform/template/wx/component-config/picker-view.js +7 -1
- package/lib/platform/template/wx/component-config/picker.js +7 -1
- package/lib/platform/template/wx/component-config/radio-group.js +4 -0
- package/lib/platform/template/wx/component-config/radio.js +4 -0
- package/lib/platform/template/wx/component-config/rich-text.js +4 -0
- package/lib/platform/template/wx/component-config/root-portal.js +4 -0
- package/lib/platform/template/wx/component-config/scroll-view.js +10 -2
- package/lib/platform/template/wx/component-config/swiper-item.js +7 -1
- package/lib/platform/template/wx/component-config/swiper.js +12 -3
- package/lib/platform/template/wx/component-config/switch.js +4 -0
- package/lib/platform/template/wx/component-config/text.js +7 -1
- package/lib/platform/template/wx/component-config/textarea.js +17 -2
- package/lib/platform/template/wx/component-config/unsupported.js +7 -0
- package/lib/platform/template/wx/component-config/video.js +10 -2
- package/lib/platform/template/wx/component-config/view.js +7 -1
- package/lib/platform/template/wx/component-config/web-view.js +4 -0
- package/lib/platform/template/wx/index.js +32 -13
- package/lib/runtime/components/web/mini-video-controls.min.js +1 -1
- package/lib/template-compiler/compiler.js +1 -1
- package/lib/utils/env.js +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ module.exports = function ({ print }) {
|
|
|
8
8
|
const qqPropLog = print({ platform: 'qq', tag: TAG_NAME, isError: false })
|
|
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
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
11
12
|
|
|
12
13
|
return {
|
|
13
14
|
test: TAG_NAME,
|
|
@@ -23,12 +24,17 @@ module.exports = function ({ print }) {
|
|
|
23
24
|
el.isBuiltIn = true
|
|
24
25
|
return 'mpx-swiper-item'
|
|
25
26
|
},
|
|
27
|
+
harmony (tag, { el }) {
|
|
28
|
+
el.isBuiltIn = true
|
|
29
|
+
return 'mpx-swiper-item'
|
|
30
|
+
},
|
|
26
31
|
props: [
|
|
27
32
|
{
|
|
28
33
|
test: /^(item-id)$/,
|
|
29
34
|
ali: aliPropLog,
|
|
30
35
|
ios: iosPropLog,
|
|
31
|
-
android: androidPropLog
|
|
36
|
+
android: androidPropLog,
|
|
37
|
+
harmony: harmonyPropLog
|
|
32
38
|
},
|
|
33
39
|
{
|
|
34
40
|
test: /^(skip-hidden-item-layout)$/,
|
|
@@ -14,6 +14,8 @@ module.exports = function ({ print }) {
|
|
|
14
14
|
const iosEventLog = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'event' })
|
|
15
15
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
16
16
|
const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
17
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
18
|
+
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
17
19
|
|
|
18
20
|
return {
|
|
19
21
|
test: TAG_NAME,
|
|
@@ -29,6 +31,10 @@ module.exports = function ({ print }) {
|
|
|
29
31
|
el.isBuiltIn = true
|
|
30
32
|
return 'mpx-swiper'
|
|
31
33
|
},
|
|
34
|
+
harmony (tag, { el }) {
|
|
35
|
+
el.isBuiltIn = true
|
|
36
|
+
return 'mpx-swiper'
|
|
37
|
+
},
|
|
32
38
|
props: [
|
|
33
39
|
{
|
|
34
40
|
test: /^(display-multiple-items|skip-hidden-item-layout)$/,
|
|
@@ -61,7 +67,8 @@ module.exports = function ({ print }) {
|
|
|
61
67
|
{
|
|
62
68
|
test: /^(display-multiple-items|snap-to-edge|easing-function)$/,
|
|
63
69
|
ios: iosPropLog,
|
|
64
|
-
android: androidPropLog
|
|
70
|
+
android: androidPropLog,
|
|
71
|
+
harmony: harmonyPropLog
|
|
65
72
|
}
|
|
66
73
|
],
|
|
67
74
|
event: [
|
|
@@ -80,12 +87,14 @@ module.exports = function ({ print }) {
|
|
|
80
87
|
swan: baiduEventLog,
|
|
81
88
|
jd: jdEventLog,
|
|
82
89
|
ios: iosEventLog,
|
|
83
|
-
android: androidEventLog
|
|
90
|
+
android: androidEventLog,
|
|
91
|
+
harmony: harmonyEventLog
|
|
84
92
|
},
|
|
85
93
|
{
|
|
86
94
|
test: /^(animationfinish)$/,
|
|
87
95
|
ios: iosEventLog,
|
|
88
|
-
android: androidEventLog
|
|
96
|
+
android: androidEventLog,
|
|
97
|
+
harmony: harmonyEventLog
|
|
89
98
|
}
|
|
90
99
|
]
|
|
91
100
|
}
|
|
@@ -8,6 +8,7 @@ module.exports = function ({ print }) {
|
|
|
8
8
|
const qqPropLog = print({ platform: 'qq', tag: TAG_NAME, isError: false })
|
|
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
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
11
12
|
|
|
12
13
|
return {
|
|
13
14
|
test: TAG_NAME,
|
|
@@ -30,6 +31,10 @@ module.exports = function ({ print }) {
|
|
|
30
31
|
el.isBuiltIn = true
|
|
31
32
|
return 'mpx-text'
|
|
32
33
|
},
|
|
34
|
+
harmony (tag, { el }) {
|
|
35
|
+
el.isBuiltIn = true
|
|
36
|
+
return 'mpx-text'
|
|
37
|
+
},
|
|
33
38
|
props: [
|
|
34
39
|
{
|
|
35
40
|
test: /^(decode|user-select)$/,
|
|
@@ -45,7 +50,8 @@ module.exports = function ({ print }) {
|
|
|
45
50
|
{
|
|
46
51
|
test: /^(space|decode)$/,
|
|
47
52
|
ios: iosPropLog,
|
|
48
|
-
android: androidPropLog
|
|
53
|
+
android: androidPropLog,
|
|
54
|
+
harmony: harmonyPropLog
|
|
49
55
|
},
|
|
50
56
|
{
|
|
51
57
|
test: /^(selectable|space|decode|use-built-in)$/,
|
|
@@ -20,6 +20,9 @@ module.exports = function ({ print }) {
|
|
|
20
20
|
const androidValueLogError = print({ platform: 'android', tag: TAG_NAME, isError: true, type: 'value' })
|
|
21
21
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
22
22
|
const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
23
|
+
const harmonyValueLogError = print({ platform: 'harmony', tag: TAG_NAME, isError: true, type: 'value' })
|
|
24
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
25
|
+
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
23
26
|
|
|
24
27
|
return {
|
|
25
28
|
test: TAG_NAME,
|
|
@@ -36,6 +39,10 @@ module.exports = function ({ print }) {
|
|
|
36
39
|
el.isBuiltIn = true
|
|
37
40
|
return 'mpx-textarea'
|
|
38
41
|
},
|
|
42
|
+
harmony (tag, { el }) {
|
|
43
|
+
el.isBuiltIn = true
|
|
44
|
+
return 'mpx-textarea'
|
|
45
|
+
},
|
|
39
46
|
props: [
|
|
40
47
|
{
|
|
41
48
|
test: /^(auto-focus|fixed|cursor-spacing|cursor|show-confirm-bar|selection-start|selection-end|adjust-position|hold-keyboard|disable-default-padding|confirm-type)$/,
|
|
@@ -75,12 +82,19 @@ module.exports = function ({ print }) {
|
|
|
75
82
|
if (notSupported.includes(value)) {
|
|
76
83
|
androidValueLogError({ name, value })
|
|
77
84
|
}
|
|
85
|
+
},
|
|
86
|
+
harmony ({ name, value }) {
|
|
87
|
+
const notSupported = ['return']
|
|
88
|
+
if (notSupported.includes(value)) {
|
|
89
|
+
harmonyValueLogError({ name, value })
|
|
90
|
+
}
|
|
78
91
|
}
|
|
79
92
|
},
|
|
80
93
|
{
|
|
81
94
|
test: /^(placeholder-style|placeholder-class|always-embed|hold-keyboard|disable-default-padding|adjust-keyboard-to|fixed|show-confirm-bar)$/,
|
|
82
95
|
ios: iosPropLog,
|
|
83
|
-
android: androidPropLog
|
|
96
|
+
android: androidPropLog,
|
|
97
|
+
harmony: harmonyPropLog
|
|
84
98
|
}
|
|
85
99
|
],
|
|
86
100
|
event: [
|
|
@@ -109,7 +123,8 @@ module.exports = function ({ print }) {
|
|
|
109
123
|
{
|
|
110
124
|
test: /^keyboard.+$/,
|
|
111
125
|
ios: iosEventLog,
|
|
112
|
-
android: androidEventLog
|
|
126
|
+
android: androidEventLog,
|
|
127
|
+
harmony: harmonyEventLog
|
|
113
128
|
}
|
|
114
129
|
]
|
|
115
130
|
}
|
|
@@ -26,6 +26,7 @@ module.exports = function ({ print }) {
|
|
|
26
26
|
const qaUnsupportedTagError = print({ platform: 'qa', isError: true, type: 'tag' })
|
|
27
27
|
const iosUnsupportedTagError = print({ platform: 'ios', isError: true, type: 'tag' })
|
|
28
28
|
const androidUnsupportedTagError = print({ platform: 'android', isError: true, type: 'tag' })
|
|
29
|
+
const harmonyUnsupportedTagError = print({ platform: 'harmony', isError: true, type: 'tag' })
|
|
29
30
|
|
|
30
31
|
const aliUnsupportedExp = new RegExp('^(' + ALI_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
31
32
|
const baiduUnsupportedExp = new RegExp('^(' + BAIDU_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
@@ -35,6 +36,7 @@ module.exports = function ({ print }) {
|
|
|
35
36
|
const qaUnsupportedExp = new RegExp('^(' + QA_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
36
37
|
const iosUnsupportedExp = new RegExp('^(' + RN_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
37
38
|
const androidUnsupportedExp = new RegExp('^(' + RN_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
39
|
+
const harmonyUnsupportedExp = new RegExp('^(' + RN_UNSUPPORTED_TAG_NAME_ARR.join('|') + ')$')
|
|
38
40
|
|
|
39
41
|
return [
|
|
40
42
|
{
|
|
@@ -76,6 +78,11 @@ module.exports = function ({ print }) {
|
|
|
76
78
|
supportedModes: ['android'],
|
|
77
79
|
test: androidUnsupportedExp,
|
|
78
80
|
android: androidUnsupportedTagError
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
supportedModes: ['harmony'],
|
|
84
|
+
test: harmonyUnsupportedExp,
|
|
85
|
+
harmony: harmonyUnsupportedTagError
|
|
79
86
|
}
|
|
80
87
|
]
|
|
81
88
|
}
|
|
@@ -15,6 +15,8 @@ module.exports = function ({ print }) {
|
|
|
15
15
|
const iosEventLogError = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'event' })
|
|
16
16
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
17
17
|
const androidEventLogError = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
18
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
19
|
+
const harmonyEventLogError = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
18
20
|
return {
|
|
19
21
|
test: TAG_NAME,
|
|
20
22
|
web (tag, { el }) {
|
|
@@ -25,6 +27,10 @@ module.exports = function ({ print }) {
|
|
|
25
27
|
el.isBuiltIn = true
|
|
26
28
|
return 'mpx-video'
|
|
27
29
|
},
|
|
30
|
+
harmony (tag, { el }) {
|
|
31
|
+
el.isBuiltIn = true
|
|
32
|
+
return 'mpx-video'
|
|
33
|
+
},
|
|
28
34
|
ios (tag, { el }) {
|
|
29
35
|
el.isBuiltIn = true
|
|
30
36
|
return 'mpx-video'
|
|
@@ -66,7 +72,8 @@ module.exports = function ({ print }) {
|
|
|
66
72
|
},
|
|
67
73
|
{
|
|
68
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)$/,
|
|
69
|
-
android: androidPropLog
|
|
75
|
+
android: androidPropLog,
|
|
76
|
+
harmony: harmonyPropLog
|
|
70
77
|
}
|
|
71
78
|
],
|
|
72
79
|
event: [
|
|
@@ -108,7 +115,8 @@ module.exports = function ({ print }) {
|
|
|
108
115
|
},
|
|
109
116
|
{
|
|
110
117
|
test: /^(progress|enterpictureinpicture|leavepictureinpicture|castinguserselect|castingstatechange|castinginterrupt)$/,
|
|
111
|
-
android: androidEventLogError
|
|
118
|
+
android: androidEventLogError,
|
|
119
|
+
harmony: harmonyEventLogError
|
|
112
120
|
}
|
|
113
121
|
]
|
|
114
122
|
}
|
|
@@ -5,6 +5,7 @@ module.exports = function ({ print }) {
|
|
|
5
5
|
const qaEventLogError = print({ platform: 'qa', tag: TAG_NAME, isError: false, type: 'event' })
|
|
6
6
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
7
7
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
8
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
8
9
|
|
|
9
10
|
return {
|
|
10
11
|
// 匹配标签名,可传递正则
|
|
@@ -31,6 +32,10 @@ module.exports = function ({ print }) {
|
|
|
31
32
|
el.isBuiltIn = true
|
|
32
33
|
return 'mpx-view'
|
|
33
34
|
},
|
|
35
|
+
harmony (tag, { el }) {
|
|
36
|
+
el.isBuiltIn = true
|
|
37
|
+
return 'mpx-view'
|
|
38
|
+
},
|
|
34
39
|
qa (tag) {
|
|
35
40
|
return 'div'
|
|
36
41
|
},
|
|
@@ -46,7 +51,8 @@ module.exports = function ({ print }) {
|
|
|
46
51
|
}, {
|
|
47
52
|
test: /^(hover-stop-propagation)$/,
|
|
48
53
|
android: androidPropLog,
|
|
49
|
-
ios: iosPropLog
|
|
54
|
+
ios: iosPropLog,
|
|
55
|
+
harmony: harmonyPropLog
|
|
50
56
|
}
|
|
51
57
|
],
|
|
52
58
|
// 组件事件中的差异部分
|
|
@@ -9,7 +9,7 @@ const { dash2hump } = require('../../../utils/hump-dash')
|
|
|
9
9
|
|
|
10
10
|
module.exports = function getSpec ({ warn, error }) {
|
|
11
11
|
const spec = {
|
|
12
|
-
supportedModes: ['ali', 'swan', 'qq', 'tt', 'web', 'qa', 'jd', 'dd', 'ios', 'android'],
|
|
12
|
+
supportedModes: ['ali', 'swan', 'qq', 'tt', 'web', 'qa', 'jd', 'dd', 'ios', 'android', 'harmony'],
|
|
13
13
|
// props预处理
|
|
14
14
|
preProps: [],
|
|
15
15
|
// props后处理
|
|
@@ -347,18 +347,6 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
347
347
|
value
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
|
-
// tt ({ name, value }, { eventRules }) {
|
|
351
|
-
// const match = this.test.exec(name)
|
|
352
|
-
// const prefix = match[1]
|
|
353
|
-
// const eventName = match[2]
|
|
354
|
-
// const modifierStr = match[3] || ''
|
|
355
|
-
// const rEventName = runRules(eventRules, eventName, { mode: 'tt' })
|
|
356
|
-
// return {
|
|
357
|
-
// // 字节将所有事件转为小写
|
|
358
|
-
// name: prefix + rEventName.toLowerCase() + modifierStr,
|
|
359
|
-
// value
|
|
360
|
-
// }
|
|
361
|
-
// },
|
|
362
350
|
tt ({ name, value }, { eventRules }) {
|
|
363
351
|
const match = this.test.exec(name)
|
|
364
352
|
const prefix = match[1]
|
|
@@ -430,6 +418,21 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
430
418
|
name: rPrefix + rEventName + meta.modifierStr,
|
|
431
419
|
value
|
|
432
420
|
}
|
|
421
|
+
},
|
|
422
|
+
harmony ({ name, value }, { eventRules, el }) {
|
|
423
|
+
const match = this.test.exec(name)
|
|
424
|
+
const prefix = match[1]
|
|
425
|
+
const eventName = match[2]
|
|
426
|
+
const modifierStr = match[3] || ''
|
|
427
|
+
const meta = {
|
|
428
|
+
modifierStr
|
|
429
|
+
}
|
|
430
|
+
const rPrefix = runRules(spec.event.prefix, prefix, { mode: 'harmony' })
|
|
431
|
+
const rEventName = runRules(eventRules, eventName, { mode: 'harmony', data: { el } })
|
|
432
|
+
return {
|
|
433
|
+
name: rPrefix + rEventName + meta.modifierStr,
|
|
434
|
+
value
|
|
435
|
+
}
|
|
433
436
|
}
|
|
434
437
|
},
|
|
435
438
|
// 无障碍
|
|
@@ -565,6 +568,22 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
565
568
|
} else {
|
|
566
569
|
error(`React native environment does not support [${eventName}] event!`)
|
|
567
570
|
}
|
|
571
|
+
},
|
|
572
|
+
harmony (eventName) {
|
|
573
|
+
const eventMap = {
|
|
574
|
+
tap: 'tap',
|
|
575
|
+
longtap: 'longpress',
|
|
576
|
+
longpress: 'longpress',
|
|
577
|
+
touchstart: 'touchstart',
|
|
578
|
+
touchmove: 'touchmove',
|
|
579
|
+
touchend: 'touchend',
|
|
580
|
+
touchcancel: 'touchcancel'
|
|
581
|
+
}
|
|
582
|
+
if (eventMap[eventName]) {
|
|
583
|
+
return eventMap[eventName]
|
|
584
|
+
} else {
|
|
585
|
+
error(`React native environment does not support [${eventName}] event!`)
|
|
586
|
+
}
|
|
568
587
|
}
|
|
569
588
|
},
|
|
570
589
|
// web event escape
|