@tarojs/plugin-platform-harmony-ets 4.0.0-beta.95 → 4.0.0-beta.97

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.
Files changed (34) hide show
  1. package/dist/components-harmony-ets/button.ets +1 -1
  2. package/dist/components-harmony-ets/checkbox.ets +2 -2
  3. package/dist/components-harmony-ets/form.ets +6 -6
  4. package/dist/components-harmony-ets/icon.ets +2 -2
  5. package/dist/components-harmony-ets/image.ets +2 -2
  6. package/dist/components-harmony-ets/input.ets +1 -1
  7. package/dist/components-harmony-ets/label.ets +3 -3
  8. package/dist/components-harmony-ets/navigationBar.ets +3 -3
  9. package/dist/components-harmony-ets/pageMeta.ets +3 -3
  10. package/dist/components-harmony-ets/picker.ets +1 -1
  11. package/dist/components-harmony-ets/progress.ets +1 -1
  12. package/dist/components-harmony-ets/radio.ets +4 -4
  13. package/dist/components-harmony-ets/richText.ets +1 -1
  14. package/dist/components-harmony-ets/scrollList.ets +2 -2
  15. package/dist/components-harmony-ets/scrollView.ets +2 -2
  16. package/dist/components-harmony-ets/slider.ets +1 -1
  17. package/dist/components-harmony-ets/swiper.ets +1 -1
  18. package/dist/components-harmony-ets/switch.ets +1 -1
  19. package/dist/components-harmony-ets/text.ets +3 -3
  20. package/dist/components-harmony-ets/textArea.ets +1 -1
  21. package/dist/components-harmony-ets/utils/helper.ets +2 -3
  22. package/dist/components-harmony-ets/video.ets +1 -1
  23. package/dist/components-harmony-ets/view.ets +6 -6
  24. package/dist/components-harmony-ets/webView.ets +1 -1
  25. package/dist/runtime-ets/current.ts +2 -1
  26. package/dist/runtime-ets/dom/node.ts +3 -3
  27. package/dist/runtime-framework/react/app.ts +4 -4
  28. package/dist/runtime-framework/react/native-page.ts +1 -1
  29. package/dist/runtime-framework/react/page.ts +1 -1
  30. package/dist/runtime-framework/react/utils/index.ts +3 -3
  31. package/dist/runtime-framework/solid/app.ts +1 -1
  32. package/dist/runtime-framework/solid/page.ts +1 -1
  33. package/dist/runtime-framework/solid/utils/index.ts +3 -3
  34. package/package.json +9 -9
@@ -152,7 +152,7 @@ export default struct TaroButton {
152
152
  }
153
153
  eventHandler(e, 'click', this.node)
154
154
  })
155
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
155
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
156
156
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
157
157
  this.node._nodeInfo.areaInfo = res[1]
158
158
  }))
@@ -74,7 +74,7 @@ export struct TaroCheckbox {
74
74
  }
75
75
  }
76
76
  })
77
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
77
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
78
78
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
79
79
  if (this.node) {
80
80
  this.node._nodeInfo.areaInfo = res[1]
@@ -121,7 +121,7 @@ export struct TaroCheckboxGroup {
121
121
  }
122
122
 
123
123
  @Styles defaultEvent () {
124
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
124
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
125
125
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
126
126
  if (this.node) {
127
127
  this.node._nodeInfo.areaInfo = res[1]
@@ -29,8 +29,8 @@ export default struct TaroForm {
29
29
  this.createLazyChildren(this.node, 0)
30
30
  }
31
31
  .attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
32
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
33
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
32
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
33
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
34
34
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
35
35
  this.node._nodeInfo.areaInfo = res[1]
36
36
  }))
@@ -40,8 +40,8 @@ export default struct TaroForm {
40
40
  this.createLazyChildren(this.node, 0)
41
41
  }
42
42
  .attributeModifier(rowModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
43
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
44
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
43
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
44
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
45
45
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
46
46
  this.node._nodeInfo.areaInfo = res[1]
47
47
  }))
@@ -51,8 +51,8 @@ export default struct TaroForm {
51
51
  this.createLazyChildren(this.node, 0)
52
52
  }
53
53
  .attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
54
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
55
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
54
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
55
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
56
56
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
57
57
  this.node._nodeInfo.areaInfo = res[1]
58
58
  }))
@@ -70,8 +70,8 @@ export default struct TaroIcon {
70
70
  width: Number(this.node._attrs.size) || 23,
71
71
  height: Number(this.node._attrs.size) || 23
72
72
  })
73
- .onComplete(e => eventHandler(e, 'complete', this.node))
74
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
73
+ .onComplete(e => { eventHandler(e, 'complete', this.node) })
74
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
75
75
  .onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
76
76
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
77
77
  this.node._nodeInfo.areaInfo = res[1]
@@ -31,13 +31,13 @@ export default struct TaroImage {
31
31
 
32
32
  build() {
33
33
  Image(this.node.getAttribute('src'))
34
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
34
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
35
35
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
36
36
  this.node._nodeInfo.areaInfo = res[1]
37
37
  }))
38
38
  .objectFit(getImageMode(this.node.getAttribute('mode')))
39
39
  .attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
40
- .onComplete(e => eventHandler(e, 'complete', this.node))
40
+ .onComplete(e => { eventHandler(e, 'complete', this.node) })
41
41
  .onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
42
42
  // TODO: 临时改为申明式,后续等鸿蒙修复modify设置失败的bug后删除该申明
43
43
  .borderRadius({
@@ -93,7 +93,7 @@ export default struct TaroInput {
93
93
  const event: TaroEvent = createTaroEvent('confirm', { detail: { value: this.value } }, this.node)
94
94
  eventHandler(event, 'confirm', this.node)
95
95
  })
96
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
96
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
97
97
  .onBlur(() => {
98
98
  const event: TaroEvent = createTaroEvent('blur', { detail: { value: this.value } }, this.node)
99
99
  eventHandler(event, 'blur', this.node)
@@ -61,7 +61,7 @@ export default struct TaroLabel {
61
61
  handleTargetChange(id)
62
62
  eventHandler(e, 'click', this.node)
63
63
  })
64
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
64
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
65
65
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
66
66
  this.node._nodeInfo.areaInfo = res[1]
67
67
  }))
@@ -78,7 +78,7 @@ export default struct TaroLabel {
78
78
  handleTargetChange(id)
79
79
  eventHandler(e, 'click', this.node)
80
80
  })
81
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
81
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
82
82
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
83
83
  this.node._nodeInfo.areaInfo = res[1]
84
84
  }))
@@ -95,7 +95,7 @@ export default struct TaroLabel {
95
95
  handleTargetChange(id)
96
96
  eventHandler(e, 'click', this.node)
97
97
  })
98
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
98
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
99
99
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
100
100
  this.node._nodeInfo.areaInfo = res[1]
101
101
  }))
@@ -20,12 +20,12 @@ export default struct TaroNavigationBar {
20
20
  }
21
21
 
22
22
  // FIXME 在 Harmony 提供 @Watch 文档后,根据 node 实际使用更细粒度的监听
23
- eventCenter.on('__taroComponentAttributeUpdate', this.handleAttributeUpdate)
23
+ eventCenter?.on('__taroComponentAttributeUpdate', this.handleAttributeUpdate)
24
24
  this.handleAttributes(this.node._attrs)
25
25
  }
26
26
 
27
27
  aboutToDisappear(): void {
28
- eventCenter.off('__taroComponentAttributeUpdate', this.handleAttributeUpdate)
28
+ eventCenter?.off('__taroComponentAttributeUpdate', this.handleAttributeUpdate)
29
29
  }
30
30
 
31
31
  handleAttributeUpdate = (opt: IComponentAttributeUpdateEvents) => {
@@ -51,7 +51,7 @@ export default struct TaroNavigationBar {
51
51
  if (attrs.frontColor) {
52
52
  options.frontColor = attrs.frontColor
53
53
  }
54
- eventCenter.trigger('__taroNavigationStyle', options)
54
+ eventCenter?.trigger('__taroNavigationStyle', options)
55
55
  // FIXME: 以下属性暂时不支持
56
56
  // attrs.colorAnimationDuration
57
57
  // attrs.colorAnimationTimingFunc
@@ -32,12 +32,12 @@ export default struct TaroPageMeta {
32
32
  }
33
33
 
34
34
  // FIXME 在 Harmony 提供 @Watch 文档后,根据 node 实际使用更细粒度的监听
35
- eventCenter.on('__taroComponentAttributeUpdate', this.handleAttributeUpdate)
35
+ eventCenter?.on('__taroComponentAttributeUpdate', this.handleAttributeUpdate)
36
36
  this.handleAttributes(this.node._attrs)
37
37
  }
38
38
 
39
39
  aboutToDisappear(): void {
40
- eventCenter.off('__taroComponentAttributeUpdate', this.handleAttributeUpdate)
40
+ eventCenter?.off('__taroComponentAttributeUpdate', this.handleAttributeUpdate)
41
41
  }
42
42
 
43
43
  handleAttributeUpdate = (opt: IComponentAttributeUpdateEvents) => {
@@ -79,7 +79,7 @@ export default struct TaroPageMeta {
79
79
  // pageFontSize
80
80
  // pageOrientation
81
81
  if (triggerStyleEvent) {
82
- eventCenter.trigger('__taroPageStyle', options)
82
+ eventCenter?.trigger('__taroPageStyle', options)
83
83
  }
84
84
  // onResize
85
85
  // onScroll
@@ -298,7 +298,7 @@ export default struct TaroPicker {
298
298
  .onClick((e: ClickEvent) => {
299
299
  eventHandler(e, 'click', this.node)
300
300
  })
301
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
301
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
302
302
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
303
303
  if (this.node) {
304
304
  this.node._nodeInfo.areaInfo = res[1]
@@ -35,7 +35,7 @@ export default struct TaroProgress {
35
35
  enableSmoothEffect: Boolean(this.node.getAttribute('active')),
36
36
  })
37
37
 
38
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
38
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
39
39
  .onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
40
40
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
41
41
  if (this.node) {
@@ -17,7 +17,7 @@ interface RadioAttrs {
17
17
  @Extend(Radio)
18
18
  function radioAttr (attr: RadioAttrs) {
19
19
  .radioStyle(attr.radioStyle)
20
- .themeStyles(attr.themeStyles)
20
+ .themeStyles(attr.themeStyles || false)
21
21
  .enabled(!attr.disabled)
22
22
  }
23
23
 
@@ -75,7 +75,7 @@ export struct TaroRadio {
75
75
  }
76
76
  }
77
77
  })
78
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
78
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
79
79
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
80
80
  if (this.node) {
81
81
  this.node._nodeInfo.areaInfo = res[1]
@@ -122,8 +122,8 @@ export struct TaroRadioGroup {
122
122
  }
123
123
 
124
124
  @Styles defaultEvent () {
125
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
126
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
125
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
126
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
127
127
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
128
128
  if (this.node) {
129
129
  this.node._nodeInfo.areaInfo = res[1]
@@ -15,7 +15,7 @@ export default struct TaroRichText {
15
15
  build () {
16
16
  RichText(generateText(this.node))
17
17
  .attributeModifier(commonStyleModify.setNode(this.node))
18
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
18
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
19
19
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
20
20
  this.node._nodeInfo.areaInfo = res[1]
21
21
  }))
@@ -87,8 +87,8 @@ export default struct TaroScrollList {
87
87
  })
88
88
  })
89
89
  })
90
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
91
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
90
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
91
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
92
92
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
93
93
  this.node._nodeInfo.areaInfo = res[1]
94
94
  }))
@@ -117,8 +117,8 @@ export default struct TaroScrollView {
117
117
  .clip(true)
118
118
  .scrollable(getScrollable(this.node))
119
119
  .scrollBar(getAttributes(this.node).scrollBar)
120
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
121
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
120
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
121
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
122
122
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
123
123
  this.node._nodeInfo.areaInfo = res[1]
124
124
  }))
@@ -90,7 +90,7 @@ export default struct TaroSlider {
90
90
  }
91
91
  }
92
92
  })
93
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
93
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
94
94
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
95
95
  if (this.node) {
96
96
  this.node._nodeInfo.areaInfo = res[1]
@@ -72,7 +72,7 @@ export default struct TaroSwiper {
72
72
  const event: TaroEvent = createTaroEvent('change', { detail: { current: index } }, this.node)
73
73
  eventHandler(event, 'change', this.node)
74
74
  })
75
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
75
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
76
76
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
77
77
  this.node._nodeInfo.areaInfo = res[1]
78
78
  }))
@@ -63,7 +63,7 @@ export default struct TaroSwitch {
63
63
  }
64
64
  }
65
65
  })
66
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
66
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
67
67
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
68
68
  if (this.node) {
69
69
  this.node._nodeInfo.areaInfo = res[1]
@@ -64,7 +64,7 @@ export default struct TaroText {
64
64
  }, (item: TaroElement) => `${item._nid}${this.node._updateTrigger}`)
65
65
  }
66
66
  }
67
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
67
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
68
68
  .attributeModifier(textModify.setNode(this.node).withNormalStyle().setAnimationStyle(this.overwriteStyle))
69
69
  .onVisibleAreaChange(getNodeThresholds(this.node) || [0.0, 1.0], getComponentEventCallback(this.node, VISIBLE_CHANGE_EVENT_NAME))
70
70
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
@@ -110,7 +110,7 @@ function createTextChildNode (item: TaroElement) {
110
110
  bottomLeft: item._st.hmStyle.borderBottomLeftRadius,
111
111
  bottomRight: item._st.hmStyle.borderBottomRightRadius
112
112
  })
113
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', item), item, ['click']))
113
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', item) }, item, ['click']))
114
114
  } else if (item.nodeType === NodeType.TEXT_NODE) {
115
115
  Span(item.textContent)
116
116
  } else if (item.tagName === 'TEXT') {
@@ -126,7 +126,7 @@ function createTextChildNode (item: TaroElement) {
126
126
  bottomRight: item._st.hmStyle.borderBottomRightRadius,
127
127
  }
128
128
  })
129
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', item), item, ['click']))
129
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', item) }, item, ['click']))
130
130
  }
131
131
  }
132
132
 
@@ -76,7 +76,7 @@ export default struct TaroTextArea {
76
76
  this.node?.updateFormWidgetValue(value)
77
77
  eventHandler(event, 'input', this.node)
78
78
  })
79
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
79
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
80
80
  .onBlur(() => {
81
81
  const event: TaroEvent = createTaroEvent('blur', { detail: { value: this.value } }, this.node)
82
82
  eventHandler(event, 'blur', this.node)
@@ -2,8 +2,7 @@ import { VIEW } from '@tarojs/runtime/dist/runtime.esm'
2
2
 
3
3
  import { getNormalAttributes, getFontAttributes, getStyleAttr } from './styles'
4
4
 
5
- import type { TFunc } from '@tarojs/runtime/dist/runtime.esm'
6
- import type { TaroElement, TaroNode } from '@tarojs/runtime'
5
+ import type { TaroElement, TaroNode, TaroAny } from '@tarojs/runtime'
7
6
 
8
7
  export const parseStyles = (styles = ''): Record<string, string> => {
9
8
  const styleObj: Record<string, string> = {}
@@ -22,7 +21,7 @@ export const parseStyles = (styles = ''): Record<string, string> => {
22
21
  return styleObj
23
22
  }
24
23
 
25
- export function shouldBindEvent (cb: TFunc, node: TaroElement | null, eventNames: string[], disabled = false) {
24
+ export function shouldBindEvent (cb: TaroAny, node: TaroElement | null, eventNames: string[], disabled = false): TaroAny {
26
25
  if (!node || node._attrs?.disabled || disabled) return null
27
26
  if (!node.__listeners) {
28
27
  return null
@@ -105,7 +105,7 @@ export default struct TaroVideo {
105
105
  .onSeeked(shouldBindEvent(() => { emitEvent(this.node, 'seeked') }, this.node, ['seeked']))
106
106
  .onFullscreenChange(shouldBindEvent((e: TaroAny) => { emitEvent(this.node, 'fullScreenChange', { fullScreen: e.fullscreen}) }, this.node, ['fullscreenchange']))
107
107
  .onClick((e: ClickEvent) => { eventHandler(e, 'click', this.node) })
108
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
108
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
109
109
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
110
110
  this.node._nodeInfo.areaInfo = res[1]
111
111
  }))
@@ -32,8 +32,8 @@ export default struct TaroView {
32
32
  }
33
33
  }
34
34
  .attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
35
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
36
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
35
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
36
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
37
37
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
38
38
  this.node._nodeInfo.areaInfo = res[1]
39
39
  }))
@@ -47,8 +47,8 @@ export default struct TaroView {
47
47
  }
48
48
  }
49
49
  .attributeModifier(rowModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
50
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
51
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
50
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
51
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
52
52
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
53
53
  this.node._nodeInfo.areaInfo = res[1]
54
54
  }))
@@ -62,8 +62,8 @@ export default struct TaroView {
62
62
  }
63
63
  }
64
64
  .attributeModifier(columnModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
65
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
66
- .onTouch(shouldBindEvent((e: TouchEvent) => eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node), this.node, TOUCH_EVENT_MAP.values()))
65
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
66
+ .onTouch(shouldBindEvent((e: TouchEvent) => { eventHandler(e, TOUCH_EVENT_MAP.get(e.type), this.node) }, this.node, TOUCH_EVENT_MAP.values()))
67
67
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
68
68
  this.node._nodeInfo.areaInfo = res[1]
69
69
  }))
@@ -47,7 +47,7 @@ export default struct TaroWebView {
47
47
 
48
48
  eventHandler(event, 'error', this.node)
49
49
  }, this.node, ['error']))
50
- .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
50
+ .onClick(shouldBindEvent((e: ClickEvent) => { eventHandler(e, 'click', this.node) }, this.node, ['click']))
51
51
  .onAreaChange(getComponentEventCallback(this.node, AREA_CHANGE_EVENT_NAME, (res: TaroAny) => {
52
52
  this.node._nodeInfo.areaInfo = res[1]
53
53
  }))
@@ -1,5 +1,6 @@
1
1
  export const context: any = {
2
- resolver: null
2
+ resolver: null,
3
+ value: null
3
4
  }
4
5
 
5
6
  // @ts-nocheck
@@ -21,8 +21,8 @@ export enum NodeType {
21
21
  }
22
22
 
23
23
  let _id = 0
24
- function genId (): string {
25
- return `_n_${_id++}`
24
+ function genId (): number {
25
+ return ++_id
26
26
  }
27
27
 
28
28
  export class TaroNode extends TaroDataSourceElement {
@@ -30,7 +30,7 @@ export class TaroNode extends TaroDataSourceElement {
30
30
  public readonly nodeType: NodeType
31
31
  public childNodes: TaroNode[] = []
32
32
  public parentNode: TaroNode | null = null
33
- public _nid: string = genId()
33
+ public _nid: number = genId()
34
34
  public _doc: TaroDocument | null = null
35
35
  public _instance?: TaroAny
36
36
 
@@ -23,7 +23,7 @@ export const ReactMeta: IReactMeta = {
23
23
  PageContext: EMPTY_OBJ
24
24
  }
25
25
 
26
- const pageKeyId = incrementId()
26
+ const pageKeyId = incrementId(1)
27
27
 
28
28
  export function connectReactPage (
29
29
  R: typeof React,
@@ -85,7 +85,7 @@ export function createReactApp (
85
85
  App,
86
86
  react,
87
87
  dom,
88
- _config?: any
88
+ config?: any
89
89
  ) {
90
90
  ReactMeta.R = react
91
91
  h = react.createElement
@@ -107,7 +107,7 @@ export function createReactApp (
107
107
  }
108
108
 
109
109
  function renderReactRoot () {
110
- const appId = 'app'
110
+ const appId = config?.appId || 'app'
111
111
 
112
112
  if (ReactMeta.Container === EMPTY_OBJ) {
113
113
  const Container = document.createElement('view')
@@ -132,7 +132,7 @@ export function createReactApp (
132
132
 
133
133
  public mount (pageComponent: any, id: string, getCtx: () => any, cb: () => void) {
134
134
  const pageWrapper = connectReactPage(react, id, getCtx)(pageComponent)
135
- const key = id + pageKeyId()
135
+ const key = `${id}_${pageKeyId()}`
136
136
  const page = () => h(pageWrapper, { key, tid: id })
137
137
  this.pages.push(page)
138
138
  this.forceUpdate(cb)
@@ -19,7 +19,7 @@ import { EMPTY_OBJ, incrementId, isClassComponent } from './utils'
19
19
  import type { AppInstance } from '@tarojs/taro'
20
20
  import type * as React from 'react'
21
21
 
22
- const getNativeCompId = incrementId()
22
+ const getNativeCompId = incrementId(1)
23
23
  let h: typeof React.createElement
24
24
  let ReactDOM
25
25
  let nativeComponentApp: AppInstance
@@ -8,7 +8,7 @@ import { incrementId } from './utils'
8
8
  import type { PageConfig } from '@tarojs/taro'
9
9
 
10
10
  const instances = new Map<string, any>()
11
- const pageId = incrementId()
11
+ const pageId = incrementId(1)
12
12
 
13
13
  export function injectPageInstance (inst: any, id: string) {
14
14
  hooks.call('mergePageInstance', instances.get(id), inst)
@@ -7,9 +7,9 @@ export function capitalize (s: string) {
7
7
  return s.charAt(0).toUpperCase() + s.slice(1)
8
8
  }
9
9
 
10
- export const incrementId = () => {
11
- let n = 0
12
- return () => (n++).toString()
10
+ export const incrementId = (init = 0) => {
11
+ let n = init
12
+ return () => n++
13
13
  }
14
14
 
15
15
  export function ensureIsArray<T> (item: T | T[]): T[] {
@@ -31,7 +31,7 @@ export function createSolidApp(App: SolidComponent, config: AppConfig) {
31
31
  }
32
32
 
33
33
  function renderReactRoot() {
34
- const appId = 'app'
34
+ const appId = config?.appId || 'app'
35
35
 
36
36
  if (ReactMeta.Container === EMPTY_OBJ) {
37
37
  const Container = document.createElement('view')
@@ -8,7 +8,7 @@ import { incrementId } from './utils'
8
8
  import type { PageConfig } from '@tarojs/taro'
9
9
 
10
10
  const instances = new Map<string, any>()
11
- const pageId = incrementId()
11
+ const pageId = incrementId(1)
12
12
 
13
13
  export function injectPageInstance (inst: any, id: string) {
14
14
  hooks.call('mergePageInstance', instances.get(id), inst)
@@ -9,9 +9,9 @@ export function capitalize (s: string) {
9
9
  return s.charAt(0).toUpperCase() + s.slice(1)
10
10
  }
11
11
 
12
- export const incrementId = () => {
13
- let n = 0
14
- return () => (n++).toString()
12
+ export const incrementId = (init = 0) => {
13
+ let n = init
14
+ return () => n++
15
15
  }
16
16
 
17
17
  export const EMPTY_OBJ: any = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-platform-harmony-ets",
3
- "version": "4.0.0-beta.95",
3
+ "version": "4.0.0-beta.97",
4
4
  "description": "OpenHarmony & 鸿蒙系统插件",
5
5
  "author": "O2Team",
6
6
  "homepage": "https://gitee.com/openharmony-sig/taro",
@@ -27,13 +27,13 @@
27
27
  "webpack-sources": "^3.2.3",
28
28
  "@babel/preset-react": "^7.24.1",
29
29
  "webpack": "5.91.0",
30
- "@tarojs/helper": "4.0.0-beta.95",
31
- "@tarojs/components": "4.0.0-beta.95",
32
- "@tarojs/runner-utils": "4.0.0-beta.95",
33
- "@tarojs/service": "4.0.0-beta.95",
34
- "@tarojs/runtime": "4.0.0-beta.95",
35
- "@tarojs/shared": "4.0.0-beta.95",
36
- "@tarojs/taro": "4.0.0-beta.95"
30
+ "@tarojs/components": "4.0.0-beta.97",
31
+ "@tarojs/helper": "4.0.0-beta.97",
32
+ "@tarojs/runner-utils": "4.0.0-beta.97",
33
+ "@tarojs/service": "4.0.0-beta.97",
34
+ "@tarojs/runtime": "4.0.0-beta.97",
35
+ "@tarojs/taro": "4.0.0-beta.97",
36
+ "@tarojs/shared": "4.0.0-beta.97"
37
37
  },
38
38
  "devDependencies": {
39
39
  "fast-glob": "^3.3.1",
@@ -42,7 +42,7 @@
42
42
  "rollup-plugin-ts": "^3.0.2",
43
43
  "solid-js": "^1.8.16",
44
44
  "tslib": "^2.4.0",
45
- "rollup-plugin-copy": "4.0.0-beta.95"
45
+ "rollup-plugin-copy": "4.0.0-beta.97"
46
46
  },
47
47
  "scripts": {
48
48
  "prod": "pnpm run build",