@tarojs/plugin-platform-harmony-ets 4.0.0-beta.54 → 4.0.0-beta.55

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.
@@ -72,6 +72,7 @@ export default struct TaroInput {
72
72
  .maxLength(Number(this.node._attrs?.maxlength) || null)
73
73
  .placeholderColor(getPlaceholderColor(this.node))
74
74
  .enterKeyType(INPUT_CONFIRM_MAP.get(this.node._attrs?.confirmType) || EnterKeyType.Done)
75
+ .padding(0) // Note: 移出 Input 默认 padding 设置
75
76
  .attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
76
77
  .styles(this.node?.hmStyle)
77
78
  .attrs(getAttributes(this.node))
@@ -113,6 +113,7 @@ class PseudoStyleModify implements AttributeModifier<CommonAttribute> {
113
113
  applyNormalAttribute(instance: CommonAttribute): void {
114
114
  if (this.style) {
115
115
  setNormalAttributeIntoInstance(instance, this.style)
116
+ setTransformAttributeIntoInstance(instance, this.style || {})
116
117
  }
117
118
  }
118
119
  }
@@ -60,7 +60,7 @@ export default struct TaroText {
60
60
  // text 下还有标签
61
61
  if (this.node.childNodes.length > 1 || ((this.node.childNodes[0] && this.node.childNodes[0] as TaroElement)?.nodeType === NodeType.ELEMENT_NODE)) {
62
62
  ForEach(this.node.childNodes, (item: TaroElement) => {
63
- createTextChildNode(item, getSpanVerticalAlign(this.node.hmStyle?.verticalAlign))
63
+ createTextChildNode(item)
64
64
  }, (item: TaroElement) => item._nid)
65
65
  }
66
66
  }
@@ -75,12 +75,12 @@ export default struct TaroText {
75
75
  }
76
76
 
77
77
  @Builder
78
- function createTextChildNode (item: TaroElement, align: ImageSpanAlignment) {
78
+ function createTextChildNode (item: TaroElement) {
79
79
  if (item.tagName === 'IMAGE') {
80
80
  ImageSpan(item.getAttribute('src'))
81
81
  // .attributeModifier(commonStyleModify.setNode(item))
82
82
  .objectFit(getImageMode(item.getAttribute('mode')))
83
- .verticalAlign(align)
83
+ // .verticalAlign(align)
84
84
  .width(item._st.hmStyle.width)
85
85
  .height(item._st.hmStyle.height)
86
86
  .margin({
@@ -104,6 +104,12 @@ function createTextChildNode (item: TaroElement, align: ImageSpanAlignment) {
104
104
  bottomRight: item._st.hmStyle.borderBottomRightRadius,
105
105
  }
106
106
  })
107
+ .borderRadius({
108
+ topLeft: item._st.hmStyle.borderTopLeftRadius,
109
+ topRight: item._st.hmStyle.borderTopRightRadius,
110
+ bottomLeft: item._st.hmStyle.borderBottomLeftRadius,
111
+ bottomRight: item._st.hmStyle.borderBottomRightRadius
112
+ })
107
113
  .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', item), item, ['click']))
108
114
  } else if (item.nodeType === NodeType.TEXT_NODE) {
109
115
  Span(item.textContent)
@@ -124,26 +130,26 @@ function createTextChildNode (item: TaroElement, align: ImageSpanAlignment) {
124
130
  }
125
131
  }
126
132
 
127
- function getSpanVerticalAlign (verticalAlign?: Alignment) {
128
- switch (verticalAlign) {
129
- case Alignment.Start:
130
- case Alignment.TopStart:
131
- case Alignment.Top:
132
- case Alignment.TopEnd: {
133
- return ImageSpanAlignment.TOP
134
- }
135
- case Alignment.End:
136
- case Alignment.BottomStart:
137
- case Alignment.Bottom:
138
- case Alignment.BottomEnd: {
139
- return ImageSpanAlignment.BOTTOM
140
- }
141
- case Alignment.Center: {
142
- return ImageSpanAlignment.CENTER
143
- }
144
- }
145
- return ImageSpanAlignment.BASELINE
146
- }
133
+ // function getSpanVerticalAlign (verticalAlign?: Alignment) {
134
+ // switch (verticalAlign) {
135
+ // case Alignment.Start:
136
+ // case Alignment.TopStart:
137
+ // case Alignment.Top:
138
+ // case Alignment.TopEnd: {
139
+ // return ImageSpanAlignment.TOP
140
+ // }
141
+ // case Alignment.End:
142
+ // case Alignment.BottomStart:
143
+ // case Alignment.Bottom:
144
+ // case Alignment.BottomEnd: {
145
+ // return ImageSpanAlignment.BOTTOM
146
+ // }
147
+ // case Alignment.Center: {
148
+ // return ImageSpanAlignment.CENTER
149
+ // }
150
+ // }
151
+ // return ImageSpanAlignment.BASELINE
152
+ // }
147
153
 
148
154
 
149
155
  class SpanStyleModify implements AttributeModifier<SpanAttribute> {
@@ -77,7 +77,7 @@ function depthTraversal(root: ReactElement) {
77
77
  // import { View } from '~/components'
78
78
  // hack:如果是taro节点,但是被赋予了__styleSheet,则走一下__styleSheet转__hmStyle
79
79
  if (tree.props.__styleSheet && typeof tree.type !== 'function') {
80
- tree.props.__hmStyle = tree.props.__styleSheet.value
80
+ tree.props.__hmStyle = Object.assign({}, tree.props.__hmStyle, tree.props.__styleSheet.value)
81
81
  }
82
82
 
83
83
  // 后代选择器
@@ -55,6 +55,7 @@ export function parseClasses (classNames = ''): string[] {
55
55
 
56
56
  // 合并静态样式,从样式表里面找到对应的样式
57
57
  export function calcStaticStyle (styleSheet: Record<string, CSSProperties>, classNames = ''): CSSProperties {
58
+ classNames = classNames || '' // 兼容有些开发者传入了false/null等非字符串类型
58
59
  const obj: CSSProperties[] = []
59
60
 
60
61
  if (!styleSheet.cache) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-platform-harmony-ets",
3
- "version": "4.0.0-beta.54",
3
+ "version": "4.0.0-beta.55",
4
4
  "description": "OpenHarmony & 鸿蒙系统插件",
5
5
  "author": "O2Team",
6
6
  "homepage": "https://gitee.com/openharmony-sig/taro",
@@ -25,13 +25,13 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "webpack-sources": "^3.2.3",
28
- "@tarojs/components": "4.0.0-beta.54",
29
- "@tarojs/runner-utils": "4.0.0-beta.54",
30
- "@tarojs/helper": "4.0.0-beta.54",
31
- "@tarojs/runtime": "4.0.0-beta.54",
32
- "@tarojs/service": "4.0.0-beta.54",
33
- "@tarojs/shared": "4.0.0-beta.54",
34
- "@tarojs/taro": "4.0.0-beta.54"
28
+ "@tarojs/components": "4.0.0-beta.55",
29
+ "@tarojs/helper": "4.0.0-beta.55",
30
+ "@tarojs/runtime": "4.0.0-beta.55",
31
+ "@tarojs/runner-utils": "4.0.0-beta.55",
32
+ "@tarojs/service": "4.0.0-beta.55",
33
+ "@tarojs/shared": "4.0.0-beta.55",
34
+ "@tarojs/taro": "4.0.0-beta.55"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -44,7 +44,7 @@
44
44
  "solid-js": "^1.8.16",
45
45
  "tslib": "^2.4.0",
46
46
  "typescript": "^4.8.2",
47
- "rollup-plugin-copy": "4.0.0-beta.54"
47
+ "rollup-plugin-copy": "4.0.0-beta.55"
48
48
  },
49
49
  "scripts": {
50
50
  "prebuild": "rimraf ./dist",