@mpxjs/webpack-plugin 2.10.2 → 2.10.3-beta.4
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/dependencies/RecordPageConfigsMapDependency.js +45 -0
- package/lib/index.js +13 -1
- package/lib/platform/json/wx/index.js +6 -3
- package/lib/platform/style/wx/index.js +29 -16
- 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/fix-component-name.js +3 -2
- 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 +24 -2
- package/lib/platform/template/wx/component-config/web-view.js +4 -0
- package/lib/platform/template/wx/index.js +32 -13
- package/lib/react/index.js +0 -1
- package/lib/react/processJSON.js +13 -2
- package/lib/react/processScript.js +5 -3
- package/lib/react/processTemplate.js +18 -3
- package/lib/react/script-helper.js +18 -4
- package/lib/runtime/components/react/dist/mpx-input.jsx +1 -11
- package/lib/runtime/components/react/dist/{KeyboardAvoidingView.jsx → mpx-keyboard-avoiding-view.jsx} +4 -3
- package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +2 -2
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.jsx +1 -2
- package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +10 -5
- package/lib/runtime/components/react/dist/mpx-simple-view.jsx +22 -0
- package/lib/runtime/components/react/dist/mpx-swiper.jsx +2 -2
- package/lib/runtime/components/react/dist/mpx-view.jsx +10 -5
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +10 -7
- package/lib/runtime/components/react/dist/useAnimationHooks.js +46 -48
- package/lib/runtime/components/react/dist/utils.jsx +18 -7
- package/lib/runtime/components/react/mpx-input.tsx +1 -19
- package/lib/runtime/components/react/{KeyboardAvoidingView.tsx → mpx-keyboard-avoiding-view.tsx} +4 -2
- package/lib/runtime/components/react/mpx-picker-view-column.tsx +2 -2
- package/lib/runtime/components/react/mpx-portal/portal-manager.tsx +1 -2
- package/lib/runtime/components/react/mpx-scroll-view.tsx +13 -4
- package/lib/runtime/components/react/mpx-simple-view.tsx +32 -0
- package/lib/runtime/components/react/mpx-swiper.tsx +4 -2
- package/lib/runtime/components/react/mpx-view.tsx +17 -10
- package/lib/runtime/components/react/mpx-web-view.tsx +15 -12
- package/lib/runtime/components/react/types/getInnerListeners.d.ts +1 -1
- package/lib/runtime/components/react/types/global.d.ts +1 -1
- package/lib/runtime/components/react/useAnimationHooks.ts +46 -48
- package/lib/runtime/components/react/utils.tsx +23 -11
- package/lib/runtime/components/web/mini-video-controls.min.js +1 -1
- package/lib/runtime/optionProcessor.js +3 -2
- package/lib/style-compiler/index.js +8 -6
- package/lib/template-compiler/compiler.js +21 -13
- package/lib/utils/env.js +1 -1
- package/lib/utils/match-condition.js +14 -8
- package/lib/web/processJSON.js +1 -3
- package/package.json +3 -3
- package/LICENSE +0 -433
package/lib/config.js
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const NullDependency = require('webpack/lib/dependencies/NullDependency')
|
|
2
|
+
const makeSerializable = require('webpack/lib/util/makeSerializable')
|
|
3
|
+
const isEmptyObject = require('../utils/is-empty-object')
|
|
4
|
+
|
|
5
|
+
class RecordPageConfigMapDependency extends NullDependency {
|
|
6
|
+
constructor (resourcePath, jsonObj) {
|
|
7
|
+
super()
|
|
8
|
+
this.resourcePath = resourcePath || ''
|
|
9
|
+
this.jsonObj = jsonObj || {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get type () {
|
|
13
|
+
return 'mpx record pageConfigsMap'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
mpxAction (module, compilation, callback) {
|
|
17
|
+
const mpx = compilation.__mpx__
|
|
18
|
+
const pagePath = mpx.pagesMap[this.resourcePath]
|
|
19
|
+
if (pagePath && !isEmptyObject(this.jsonObj)) mpx.pageConfigsMap[pagePath] = this.jsonObj
|
|
20
|
+
return callback()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
serialize (context) {
|
|
24
|
+
const { write } = context
|
|
25
|
+
write(this.resourcePath)
|
|
26
|
+
write(this.jsonObj)
|
|
27
|
+
super.serialize(context)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
deserialize (context) {
|
|
31
|
+
const { read } = context
|
|
32
|
+
this.pagePath = read()
|
|
33
|
+
this.jsonObj = read()
|
|
34
|
+
super.deserialize(context)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
RecordPageConfigMapDependency.Template = class RecordPageConfigMapDependencyTemplate {
|
|
39
|
+
apply () {
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
makeSerializable(RecordPageConfigMapDependency, '@mpxjs/webpack-plugin/lib/dependencies/RecordPageConfigMapDependency')
|
|
44
|
+
|
|
45
|
+
module.exports = RecordPageConfigMapDependency
|
package/lib/index.js
CHANGED
|
@@ -34,6 +34,7 @@ const FixDescriptionInfoPlugin = require('./resolver/FixDescriptionInfoPlugin')
|
|
|
34
34
|
// const RequireHeaderDependency = require('webpack/lib/dependencies/RequireHeaderDependency')
|
|
35
35
|
// const RemovedModuleDependency = require('./dependencies/RemovedModuleDependency')
|
|
36
36
|
const AppEntryDependency = require('./dependencies/AppEntryDependency')
|
|
37
|
+
const RecordPageConfigMapDependency = require('./dependencies/RecordPageConfigsMapDependency')
|
|
37
38
|
const RecordResourceMapDependency = require('./dependencies/RecordResourceMapDependency')
|
|
38
39
|
const RecordGlobalComponentsDependency = require('./dependencies/RecordGlobalComponentsDependency')
|
|
39
40
|
const RecordIndependentDependency = require('./dependencies/RecordIndependentDependency')
|
|
@@ -130,7 +131,7 @@ class MpxWebpackPlugin {
|
|
|
130
131
|
errors.push('MpxWebpackPlugin supports mode to be "web" only when srcMode is set to "wx"!')
|
|
131
132
|
}
|
|
132
133
|
if (isReact(options.mode) && options.srcMode !== 'wx') {
|
|
133
|
-
errors.push('MpxWebpackPlugin supports mode to be "ios" or "android" only when srcMode is set to "wx"!')
|
|
134
|
+
errors.push('MpxWebpackPlugin supports mode to be "ios" or "android" of "harmony" only when srcMode is set to "wx"!')
|
|
134
135
|
}
|
|
135
136
|
if (options.dynamicComponentRules && !options.dynamicRuntime) {
|
|
136
137
|
errors.push('Please make sure you have set dynamicRuntime true in mpx webpack plugin config because you have use the dynamic runtime feature.')
|
|
@@ -617,6 +618,9 @@ class MpxWebpackPlugin {
|
|
|
617
618
|
compilation.dependencyFactories.set(RemoveEntryDependency, new NullFactory())
|
|
618
619
|
compilation.dependencyTemplates.set(RemoveEntryDependency, new RemoveEntryDependency.Template())
|
|
619
620
|
|
|
621
|
+
compilation.dependencyFactories.set(RecordPageConfigMapDependency, new NullFactory())
|
|
622
|
+
compilation.dependencyTemplates.set(RecordPageConfigMapDependency, new RecordPageConfigMapDependency.Template())
|
|
623
|
+
|
|
620
624
|
compilation.dependencyFactories.set(RecordResourceMapDependency, new NullFactory())
|
|
621
625
|
compilation.dependencyTemplates.set(RecordResourceMapDependency, new RecordResourceMapDependency.Template())
|
|
622
626
|
|
|
@@ -656,6 +660,8 @@ class MpxWebpackPlugin {
|
|
|
656
660
|
__vfs,
|
|
657
661
|
// app信息,便于获取appName
|
|
658
662
|
appInfo: {},
|
|
663
|
+
// pageConfig信息
|
|
664
|
+
pageConfigsMap: {},
|
|
659
665
|
// pages全局记录,无需区分主包分包
|
|
660
666
|
pagesMap: {},
|
|
661
667
|
// 组件资源记录,依照所属包进行记录
|
|
@@ -1641,6 +1647,12 @@ class MpxWebpackPlugin {
|
|
|
1641
1647
|
if (isReact(mpx.mode)) {
|
|
1642
1648
|
// 添加 @refresh reset 注释用于在 React HMR 时刷新组件
|
|
1643
1649
|
source.add('/* @refresh reset */\n')
|
|
1650
|
+
// 注入页面的配置,供screen前置设置导航情况
|
|
1651
|
+
if (isRuntime) {
|
|
1652
|
+
source.add('// inject pageconfigmap for screen\n' +
|
|
1653
|
+
'var context = (function() { return this })() || Function("return this")();\n')
|
|
1654
|
+
source.add(`context.__mpxPageConfigsMap = ${JSON.stringify(mpx.pageConfigsMap)};\n`)
|
|
1655
|
+
}
|
|
1644
1656
|
source.add(originalSource)
|
|
1645
1657
|
compilation.assets[chunkFile] = source
|
|
1646
1658
|
processedChunk.add(chunk)
|
|
@@ -158,7 +158,8 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
158
158
|
test: 'usingComponents',
|
|
159
159
|
web: fixComponentName('usingComponents'),
|
|
160
160
|
ios: fixComponentName('usingComponents'),
|
|
161
|
-
android: fixComponentName('usingComponents')
|
|
161
|
+
android: fixComponentName('usingComponents'),
|
|
162
|
+
harmony: fixComponentName('usingComponents')
|
|
162
163
|
},
|
|
163
164
|
{
|
|
164
165
|
test: 'usingComponents',
|
|
@@ -268,7 +269,8 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
268
269
|
'dd',
|
|
269
270
|
'web',
|
|
270
271
|
'ios',
|
|
271
|
-
'android'
|
|
272
|
+
'android',
|
|
273
|
+
'harmony'
|
|
272
274
|
],
|
|
273
275
|
|
|
274
276
|
normalizeTest,
|
|
@@ -374,7 +376,8 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
374
376
|
test: 'usingComponents',
|
|
375
377
|
web: fixComponentName('usingComponents'),
|
|
376
378
|
ios: fixComponentName('usingComponents'),
|
|
377
|
-
android: fixComponentName('usingComponents')
|
|
379
|
+
android: fixComponentName('usingComponents'),
|
|
380
|
+
harmony: fixComponentName('usingComponents')
|
|
378
381
|
},
|
|
379
382
|
{
|
|
380
383
|
test: 'usingComponents',
|
|
@@ -7,7 +7,9 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
7
7
|
// React Native ios 不支持的 CSS property
|
|
8
8
|
ios: /^(vertical-align)$/,
|
|
9
9
|
// React Native android 不支持的 CSS property
|
|
10
|
-
android: /^(text-decoration-style|text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)
|
|
10
|
+
android: /^(text-decoration-style|text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)$/,
|
|
11
|
+
// TODO: rnoh 文档暂未找到 css 属性支持说明,暂时同步 android,同时需要注意此处校验是否有缺失,类似 will-change 之类属性
|
|
12
|
+
harmony: /^(text-decoration-style|text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)$/
|
|
11
13
|
}
|
|
12
14
|
// var(xx)
|
|
13
15
|
const cssVariableExp = /var\(/
|
|
@@ -47,7 +49,7 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
47
49
|
'flex-wrap': ['wrap', 'nowrap', 'wrap-reverse'],
|
|
48
50
|
'pointer-events': ['auto', 'box-none', 'box-only', 'none'],
|
|
49
51
|
'vertical-align': ['auto', 'top', 'bottom', 'center'],
|
|
50
|
-
position: ['relative', 'absolute'],
|
|
52
|
+
position: ['relative', 'absolute', 'fixed'],
|
|
51
53
|
'font-variant': ['small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums'],
|
|
52
54
|
'text-align': ['left', 'right', 'center', 'justify'],
|
|
53
55
|
'font-style': ['normal', 'italic'],
|
|
@@ -395,22 +397,22 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
395
397
|
case 'skewY':
|
|
396
398
|
case 'perspective':
|
|
397
399
|
// 单个值处理
|
|
400
|
+
// rotate 处理成 rotateZ
|
|
401
|
+
key = key === 'rotate' ? 'rotateZ' : key
|
|
398
402
|
transform.push({ [key]: val })
|
|
399
403
|
break
|
|
400
404
|
case 'matrix':
|
|
401
|
-
case 'matrix3d':
|
|
402
405
|
transform.push({ [key]: parseValues(val, ',').map(val => +val) })
|
|
403
406
|
break
|
|
404
407
|
case 'translate':
|
|
405
408
|
case 'scale':
|
|
406
409
|
case 'skew':
|
|
407
|
-
case 'rotate3d': // x y z angle
|
|
408
410
|
case 'translate3d': // x y 支持 z不支持
|
|
409
411
|
case 'scale3d': // x y 支持 z不支持
|
|
410
412
|
{
|
|
411
413
|
// 2 个以上的值处理
|
|
412
414
|
key = key.replace('3d', '')
|
|
413
|
-
const vals = parseValues(val, ',').splice(0,
|
|
415
|
+
const vals = parseValues(val, ',').splice(0, 3)
|
|
414
416
|
// scale(.5) === scaleX(.5) scaleY(.5)
|
|
415
417
|
if (vals.length === 1 && key === 'scale') {
|
|
416
418
|
vals.push(vals[0])
|
|
@@ -426,6 +428,8 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
426
428
|
}
|
|
427
429
|
case 'translateZ':
|
|
428
430
|
case 'scaleZ':
|
|
431
|
+
case 'rotate3d': // x y z angle
|
|
432
|
+
case 'matrix3d':
|
|
429
433
|
default:
|
|
430
434
|
// 不支持的属性处理
|
|
431
435
|
unsupportedPropError({ prop, value, selector }, { mode })
|
|
@@ -527,7 +531,7 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
527
531
|
return false
|
|
528
532
|
}
|
|
529
533
|
const cssMap = formatAbbreviation({ prop, value, selector }, { mode })
|
|
530
|
-
if (mode === 'android') return cssMap
|
|
534
|
+
if (mode === 'android' || mode === 'harmony') return cssMap
|
|
531
535
|
// ios 阴影需要额外设置 shadowOpacity=1
|
|
532
536
|
cssMap.push({
|
|
533
537
|
prop: 'shadowOpacity',
|
|
@@ -537,54 +541,63 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
537
541
|
}
|
|
538
542
|
|
|
539
543
|
return {
|
|
540
|
-
supportedModes: ['ios', 'android'],
|
|
544
|
+
supportedModes: ['ios', 'android', 'harmony'],
|
|
541
545
|
rules: [
|
|
542
546
|
{ // 背景相关属性的处理
|
|
543
547
|
test: /^(background|background-image|background-size|background-position)$/,
|
|
544
548
|
ios: checkBackgroundImage,
|
|
545
|
-
android: checkBackgroundImage
|
|
549
|
+
android: checkBackgroundImage,
|
|
550
|
+
harmony: checkBackgroundImage
|
|
546
551
|
},
|
|
547
552
|
{ // margin padding 内外边距的处理
|
|
548
553
|
test: /^(margin|padding|border-radius|border-width|border-color)$/,
|
|
549
554
|
ios: formatCompositeVal,
|
|
550
|
-
android: formatCompositeVal
|
|
555
|
+
android: formatCompositeVal,
|
|
556
|
+
harmony: formatCompositeVal
|
|
551
557
|
},
|
|
552
558
|
{ // line-height 换算
|
|
553
559
|
test: 'line-height',
|
|
554
560
|
ios: formatLineHeight,
|
|
555
|
-
android: formatLineHeight
|
|
561
|
+
android: formatLineHeight,
|
|
562
|
+
harmony: formatLineHeight
|
|
556
563
|
},
|
|
557
564
|
{
|
|
558
565
|
test: 'transform',
|
|
559
566
|
ios: formatTransform,
|
|
560
|
-
android: formatTransform
|
|
567
|
+
android: formatTransform,
|
|
568
|
+
harmony: formatTransform
|
|
561
569
|
},
|
|
562
570
|
{
|
|
563
571
|
test: 'flex',
|
|
564
572
|
ios: formatFlex,
|
|
565
|
-
android: formatFlex
|
|
573
|
+
android: formatFlex,
|
|
574
|
+
harmony: formatFlex
|
|
566
575
|
},
|
|
567
576
|
{
|
|
568
577
|
test: 'font-family',
|
|
569
578
|
ios: formatFontFamily,
|
|
570
|
-
android: formatFontFamily
|
|
579
|
+
android: formatFontFamily,
|
|
580
|
+
harmony: formatFontFamily
|
|
571
581
|
},
|
|
572
582
|
{
|
|
573
583
|
test: 'box-shadow',
|
|
574
584
|
ios: formatBoxShadow,
|
|
575
|
-
android: formatBoxShadow
|
|
585
|
+
android: formatBoxShadow,
|
|
586
|
+
harmony: formatBoxShadow
|
|
576
587
|
},
|
|
577
588
|
// 通用的简写格式匹配
|
|
578
589
|
{
|
|
579
590
|
test: new RegExp('^(' + Object.keys(AbbreviationMap).join('|') + ')$'),
|
|
580
591
|
ios: formatAbbreviation,
|
|
581
|
-
android: formatAbbreviation
|
|
592
|
+
android: formatAbbreviation,
|
|
593
|
+
harmony: formatAbbreviation
|
|
582
594
|
},
|
|
583
595
|
// 属性&属性值校验
|
|
584
596
|
{
|
|
585
597
|
test: () => true,
|
|
586
598
|
ios: verification,
|
|
587
|
-
android: verification
|
|
599
|
+
android: verification,
|
|
600
|
+
harmony: verification
|
|
588
601
|
}
|
|
589
602
|
]
|
|
590
603
|
}
|
|
@@ -37,6 +37,10 @@ module.exports = function ({ print }) {
|
|
|
37
37
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
38
38
|
const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
39
39
|
|
|
40
|
+
const harmonyValueLogError = print({ platform: 'harmony', tag: TAG_NAME, isError: true, type: 'value' })
|
|
41
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
42
|
+
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
43
|
+
|
|
40
44
|
return {
|
|
41
45
|
test: TAG_NAME,
|
|
42
46
|
web (tag, { el }) {
|
|
@@ -51,6 +55,10 @@ module.exports = function ({ print }) {
|
|
|
51
55
|
el.isBuiltIn = true
|
|
52
56
|
return 'mpx-button'
|
|
53
57
|
},
|
|
58
|
+
harmony (tag, { el }) {
|
|
59
|
+
el.isBuiltIn = true
|
|
60
|
+
return 'mpx-button'
|
|
61
|
+
},
|
|
54
62
|
props: [
|
|
55
63
|
{
|
|
56
64
|
test: 'open-type',
|
|
@@ -123,6 +131,7 @@ module.exports = function ({ print }) {
|
|
|
123
131
|
}
|
|
124
132
|
},
|
|
125
133
|
ios ({ name, value }) {
|
|
134
|
+
// TODO 此处open-type无其他属性支持了?
|
|
126
135
|
const supported = ['share']
|
|
127
136
|
if (!supported.includes(value)) {
|
|
128
137
|
iosValueLogError({ name, value })
|
|
@@ -133,6 +142,12 @@ module.exports = function ({ print }) {
|
|
|
133
142
|
if (!supported.includes(value)) {
|
|
134
143
|
androidValueLogError({ name, value })
|
|
135
144
|
}
|
|
145
|
+
},
|
|
146
|
+
harmony ({ name, value }) {
|
|
147
|
+
const supported = ['share']
|
|
148
|
+
if (!supported.includes(value)) {
|
|
149
|
+
harmonyValueLogError({ name, value })
|
|
150
|
+
}
|
|
136
151
|
}
|
|
137
152
|
},
|
|
138
153
|
{
|
|
@@ -173,7 +188,8 @@ module.exports = function ({ print }) {
|
|
|
173
188
|
{
|
|
174
189
|
test: /^(lang|from-type|hover-class|send-message-title|send-message-path|send-message-img|app-parameter|show-message-card|phone-number-no-quota-toast|bindgetuserinfo|bindcontact|createliveactivity|bindgetphonenumber|bindgetrealtimephonenumber|binderror|bindopensetting|bindlaunchapp|bindchooseavatar|bindagreeprivacyauthorization)$/,
|
|
175
190
|
ios: iosPropLog,
|
|
176
|
-
android: androidPropLog
|
|
191
|
+
android: androidPropLog,
|
|
192
|
+
harmony: harmonyPropLog
|
|
177
193
|
}
|
|
178
194
|
],
|
|
179
195
|
event: [
|
|
@@ -210,7 +226,8 @@ module.exports = function ({ print }) {
|
|
|
210
226
|
{
|
|
211
227
|
test: /^(getuserinfo|contact|getphonenumber|bindgetrealtimephonenumber|error|opensetting|launchapp|chooseavatar|agreeprivacyauthorization)$/,
|
|
212
228
|
ios: iosEventLog,
|
|
213
|
-
android: androidEventLog
|
|
229
|
+
android: androidEventLog,
|
|
230
|
+
harmony: harmonyEventLog
|
|
214
231
|
}
|
|
215
232
|
]
|
|
216
233
|
}
|
|
@@ -4,6 +4,7 @@ module.exports = function ({ print }) {
|
|
|
4
4
|
const aliEventLog = print({ platform: 'ali', tag: TAG_NAME, isError: false, type: 'event' })
|
|
5
5
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
6
6
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
7
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
7
8
|
return {
|
|
8
9
|
test: TAG_NAME,
|
|
9
10
|
web (tag, { el }) {
|
|
@@ -21,6 +22,10 @@ module.exports = function ({ print }) {
|
|
|
21
22
|
el.isBuiltIn = true
|
|
22
23
|
return 'mpx-image'
|
|
23
24
|
},
|
|
25
|
+
harmony (tag, { el }) {
|
|
26
|
+
el.isBuiltIn = true
|
|
27
|
+
return 'mpx-image'
|
|
28
|
+
},
|
|
24
29
|
props: [
|
|
25
30
|
{
|
|
26
31
|
test: 'use-built-in',
|
|
@@ -31,7 +36,8 @@ module.exports = function ({ print }) {
|
|
|
31
36
|
{
|
|
32
37
|
test: /^(referrer-policy)$/,
|
|
33
38
|
ios: iosPropLog,
|
|
34
|
-
android: androidPropLog
|
|
39
|
+
android: androidPropLog,
|
|
40
|
+
harmony: harmonyPropLog
|
|
35
41
|
}
|
|
36
42
|
],
|
|
37
43
|
event: [
|
|
@@ -15,10 +15,11 @@ module.exports = function () {
|
|
|
15
15
|
return {
|
|
16
16
|
waterfall: true,
|
|
17
17
|
skipNormalize: true,
|
|
18
|
-
supportedModes: ['web', 'ios', 'android'],
|
|
18
|
+
supportedModes: ['web', 'ios', 'android', 'harmony'],
|
|
19
19
|
test: (input) => isOriginTag(input) || isBuildInTag(input),
|
|
20
20
|
web: handleComponentTag,
|
|
21
21
|
ios: handleComponentTag,
|
|
22
|
-
android: handleComponentTag
|
|
22
|
+
android: handleComponentTag,
|
|
23
|
+
harmony: handleComponentTag
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -9,6 +9,7 @@ module.exports = function ({ print }) {
|
|
|
9
9
|
const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
|
|
10
10
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
11
11
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
12
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
12
13
|
|
|
13
14
|
return {
|
|
14
15
|
test: TAG_NAME,
|
|
@@ -25,6 +26,10 @@ module.exports = function ({ print }) {
|
|
|
25
26
|
el.isBuiltIn = true
|
|
26
27
|
return 'mpx-form'
|
|
27
28
|
},
|
|
29
|
+
harmony (tag, { el }) {
|
|
30
|
+
el.isBuiltIn = true
|
|
31
|
+
return 'mpx-form'
|
|
32
|
+
},
|
|
28
33
|
props: [
|
|
29
34
|
{
|
|
30
35
|
test: /^(report-submit-timeout)$/,
|
|
@@ -38,7 +43,8 @@ module.exports = function ({ print }) {
|
|
|
38
43
|
web: webPropLog,
|
|
39
44
|
qa: qaPropLog,
|
|
40
45
|
ios: iosPropLog,
|
|
41
|
-
android: androidPropLog
|
|
46
|
+
android: androidPropLog,
|
|
47
|
+
harmony: harmonyPropLog
|
|
42
48
|
}
|
|
43
49
|
]
|
|
44
50
|
}
|
|
@@ -8,6 +8,7 @@ module.exports = function ({ print }) {
|
|
|
8
8
|
const qaPropLog = print({ platform: 'qa', 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,6 +24,10 @@ module.exports = function ({ print }) {
|
|
|
23
24
|
el.isBuiltIn = true
|
|
24
25
|
return 'mpx-image'
|
|
25
26
|
},
|
|
27
|
+
harmony (tag, { el }) {
|
|
28
|
+
el.isBuiltIn = true
|
|
29
|
+
return 'mpx-image'
|
|
30
|
+
},
|
|
26
31
|
props: [
|
|
27
32
|
{
|
|
28
33
|
test: /^show-menu-by-longpress$/,
|
|
@@ -48,7 +53,8 @@ module.exports = function ({ print }) {
|
|
|
48
53
|
{
|
|
49
54
|
test: /^(show-menu-by-longpress|fade-in)$/,
|
|
50
55
|
ios: iosPropLog,
|
|
51
|
-
android: androidPropLog
|
|
56
|
+
android: androidPropLog,
|
|
57
|
+
harmony: harmonyPropLog
|
|
52
58
|
}
|
|
53
59
|
]
|
|
54
60
|
}
|
|
@@ -19,6 +19,9 @@ module.exports = function ({ print }) {
|
|
|
19
19
|
const androidValueLogError = print({ platform: 'android', tag: TAG_NAME, isError: true, type: 'value' })
|
|
20
20
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
21
21
|
const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
22
|
+
const harmonyValueLogError = print({ platform: 'harmony', tag: TAG_NAME, isError: true, type: 'value' })
|
|
23
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
24
|
+
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
22
25
|
|
|
23
26
|
return {
|
|
24
27
|
test: TAG_NAME,
|
|
@@ -34,6 +37,10 @@ module.exports = function ({ print }) {
|
|
|
34
37
|
el.isBuiltIn = true
|
|
35
38
|
return 'mpx-input'
|
|
36
39
|
},
|
|
40
|
+
harmony (tag, { el }) {
|
|
41
|
+
el.isBuiltIn = true
|
|
42
|
+
return 'mpx-input'
|
|
43
|
+
},
|
|
37
44
|
props: [
|
|
38
45
|
{
|
|
39
46
|
test: /^(cursor-spacing|auto-focus|adjust-position|hold-keyboard)$/,
|
|
@@ -75,6 +82,12 @@ 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 = ['safe-password', 'nickname']
|
|
88
|
+
if (notSupported.includes(value)) {
|
|
89
|
+
harmonyValueLogError({ name, value })
|
|
90
|
+
}
|
|
78
91
|
}
|
|
79
92
|
},
|
|
80
93
|
{
|
|
@@ -94,7 +107,8 @@ module.exports = function ({ print }) {
|
|
|
94
107
|
{
|
|
95
108
|
test: /^(always-embed|hold-keyboard|safe-password-.+)$/,
|
|
96
109
|
ios: iosPropLog,
|
|
97
|
-
android: androidPropLog
|
|
110
|
+
android: androidPropLog,
|
|
111
|
+
harmony: harmonyPropLog
|
|
98
112
|
}
|
|
99
113
|
],
|
|
100
114
|
event: [
|
|
@@ -113,7 +127,8 @@ module.exports = function ({ print }) {
|
|
|
113
127
|
{
|
|
114
128
|
test: /^(nicknamereview|onkeyboardheightchange|keyboard.+)$/,
|
|
115
129
|
ios: iosEventLog,
|
|
116
|
-
android: androidEventLog
|
|
130
|
+
android: androidEventLog,
|
|
131
|
+
harmony: harmonyEventLog
|
|
117
132
|
}
|
|
118
133
|
]
|
|
119
134
|
}
|
|
@@ -2,6 +2,7 @@ const TAG_NAME = 'movable-area'
|
|
|
2
2
|
|
|
3
3
|
module.exports = function ({ print }) {
|
|
4
4
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
5
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
5
6
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
6
7
|
return {
|
|
7
8
|
test: TAG_NAME,
|
|
@@ -13,6 +14,10 @@ module.exports = function ({ print }) {
|
|
|
13
14
|
el.isBuiltIn = true
|
|
14
15
|
return 'mpx-movable-area'
|
|
15
16
|
},
|
|
17
|
+
harmony (tag, { el }) {
|
|
18
|
+
el.isBuiltIn = true
|
|
19
|
+
return 'mpx-movable-area'
|
|
20
|
+
},
|
|
16
21
|
ios (tag, { el }) {
|
|
17
22
|
el.isBuiltIn = true
|
|
18
23
|
return 'mpx-movable-area'
|
|
@@ -21,7 +26,8 @@ module.exports = function ({ print }) {
|
|
|
21
26
|
{
|
|
22
27
|
test: /^(scale-area)$/,
|
|
23
28
|
ios: iosPropLog,
|
|
24
|
-
android: androidPropLog
|
|
29
|
+
android: androidPropLog,
|
|
30
|
+
harmony: harmonyPropLog
|
|
25
31
|
}
|
|
26
32
|
]
|
|
27
33
|
}
|
|
@@ -3,9 +3,11 @@ const TAG_NAME = 'movable-view'
|
|
|
3
3
|
module.exports = function ({ print }) {
|
|
4
4
|
const aliEventLog = print({ platform: 'ali', tag: TAG_NAME, isError: false, type: 'event' })
|
|
5
5
|
const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
|
|
6
|
+
const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
|
|
6
7
|
const iosEventLog = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'event' })
|
|
7
8
|
const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
|
|
8
9
|
const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
|
|
10
|
+
const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
|
|
9
11
|
const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
|
|
10
12
|
return {
|
|
11
13
|
test: TAG_NAME,
|
|
@@ -17,6 +19,10 @@ module.exports = function ({ print }) {
|
|
|
17
19
|
el.isBuiltIn = true
|
|
18
20
|
return 'mpx-movable-view'
|
|
19
21
|
},
|
|
22
|
+
harmony (tag, { el }) {
|
|
23
|
+
el.isBuiltIn = true
|
|
24
|
+
return 'mpx-movable-view'
|
|
25
|
+
},
|
|
20
26
|
ios (tag, { el }) {
|
|
21
27
|
el.isBuiltIn = true
|
|
22
28
|
return 'mpx-movable-view'
|
|
@@ -26,12 +32,14 @@ module.exports = function ({ print }) {
|
|
|
26
32
|
test: /^(out-of-bounds)$/,
|
|
27
33
|
ali: qaPropLog,
|
|
28
34
|
ios: iosPropLog,
|
|
29
|
-
android: androidPropLog
|
|
35
|
+
android: androidPropLog,
|
|
36
|
+
harmony: harmonyPropLog
|
|
30
37
|
},
|
|
31
38
|
{
|
|
32
39
|
test: /^(damping|friction|scale|scale-min|scale-max|scale-value)$/,
|
|
33
40
|
ios: iosPropLog,
|
|
34
|
-
android: androidPropLog
|
|
41
|
+
android: androidPropLog,
|
|
42
|
+
harmony: harmonyPropLog
|
|
35
43
|
}
|
|
36
44
|
],
|
|
37
45
|
event: [
|
|
@@ -42,7 +50,8 @@ module.exports = function ({ print }) {
|
|
|
42
50
|
{
|
|
43
51
|
test: /^(bindscale)$/,
|
|
44
52
|
ios: iosEventLog,
|
|
45
|
-
android: androidEventLog
|
|
53
|
+
android: androidEventLog,
|
|
54
|
+
harmony: harmonyEventLog
|
|
46
55
|
}
|
|
47
56
|
]
|
|
48
57
|
}
|
|
@@ -36,6 +36,10 @@ module.exports = function ({ print }) {
|
|
|
36
36
|
el.isBuiltIn = true
|
|
37
37
|
return 'mpx-navigator'
|
|
38
38
|
},
|
|
39
|
+
harmony (tag, { el }) {
|
|
40
|
+
el.isBuiltIn = true
|
|
41
|
+
return 'mpx-navigator'
|
|
42
|
+
},
|
|
39
43
|
props: [
|
|
40
44
|
{
|
|
41
45
|
test: /^(target|delta|app-id|path|extra-data|version|hover-stop-propagation)$/,
|