Skip to content

Commit 7a4ee92

Browse files
oneyouziyucongshuang
andauthored
灵感组件编译修改 (#133)
* 暂定颜色值以ux开始的不校验 * 灵感组件控制不在白名单内的也能编译进去以及minCardPlatformVersion非必填功能 * 灵感组件控制不在白名单内的也能编译进去以及minCardPlatformVersion非必填功能 * 将灵感组件的样式从白名单移除不校验 --------- Co-authored-by: yucongshuang <[email protected]>
1 parent 06a57db commit 7a4ee92

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/hap-compiler/src/style/validator.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,15 @@ const validateTime = function (v) {
403403
const themeColors = [
404404
'uxCardColorBackground',
405405
'uxCardColorAccent',
406+
'uxCardColorTheme',
406407
'uxCardColorContainer',
407-
'uxCardColorHue',
408-
'uxCardColorHueSecondary',
409408
'uxCardColorPrimary',
410409
'uxCardColorQuaternary',
410+
'uxCardColorSecondary',
411411
'uxCardColorSecondaryVariant',
412-
'uxCardColorTertiary'
412+
'uxCardColorTertiary',
413+
'uxCardColorHue',
414+
'uxCardColorHueSecondary'
413415
]
414416
const validator = {
415417
/**
@@ -2702,12 +2704,12 @@ const validatorMap = {
27022704
// font
27032705
fontSrc: validator.fontSrc,
27042706
fontFamily: validator.fontFamily,
2705-
themeColor: makeEnumValidator(themeColors),
2707+
/* themeColor: makeEnumValidator(themeColors),
27062708
themeBackgroundColor: makeEnumValidator(themeColors),
27072709
themeLayerColor: makeEnumValidator(themeColors),
27082710
themeTrackColor: makeEnumValidator(themeColors),
27092711
themeSelectedColor: makeEnumValidator(themeColors),
2710-
themeBlockColor: makeEnumValidator(themeColors),
2712+
themeBlockColor: makeEnumValidator(themeColors), */
27112713
letterSpacing: validator.letterSpacing
27122714
}
27132715

packages/hap-packager/src/common/shared.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,10 @@ function populateWidgetFields(widgetsObj) {
234234
conf.minPlatformVersion = conf.minCardPlatformVersion
235235
} else if (!conf.minPlatformVersion) {
236236
// 没写 minCardPlatformVersion 和 minPlatformVersion 字段
237-
colorconsole.throw(
237+
// 不填minCardPlatformVersion也能编译
238+
/* colorconsole.throw(
238239
`manifest.json 文件 widgets 字段下,${routePath} 缺少 minCardPlatformVersion 字段`
239-
)
240+
) */
240241
}
241242
}
242243
if (conf.type === 'lite' && !conf.minCardPlatformVersion) {

0 commit comments

Comments
 (0)