@tarojs/plugin-platform-harmony-ets 4.0.0-beta.66 → 4.0.0-beta.67

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.
@@ -3,19 +3,8 @@ import type { TaroAny, TaroMovableViewElement, TaroElement } from '@tarojs/runti
3
3
  import commonStyleModify, { rowModify, columnModify } from './style'
4
4
 
5
5
  import { FlexManager } from './utils/flexManager'
6
- import { isUndefined } from '@tarojs/shared'
7
6
 
8
- function callTouchEventFnFromGesture(node: TaroElement, eventName: string, gestureEvent: GestureEvent) {
9
- const touchFns = (node?.__listeners?.[eventName] || []) as Function[]
10
- touchFns.forEach(fn => {
11
- fn({
12
- changedTouches: gestureEvent.fingerList.map(finger => ({
13
- clientX: finger.globalX,
14
- clientY: finger.globalY
15
- }))
16
- })
17
- })
18
- }
7
+
19
8
 
20
9
  @Component
21
10
  export default struct TaroMovableView {
@@ -58,23 +47,23 @@ export default struct TaroMovableView {
58
47
  .translate({ x: this.node.position.x, y: this.node.position.y })
59
48
  .scale({ x: this.node.scaleValue, y: this.node.scaleValue })
60
49
  .onAreaChange((oldValue: Area, newValue: Area) => {
61
- this.node.selfSize = {w: Number(newValue.width), h: Number(newValue.height)}
50
+ this.node.selfSize = { w: Number(newValue.width), h: Number(newValue.height) }
62
51
  })
63
52
  .gesture(
64
53
  GestureGroup(GestureMode.Exclusive,
65
- PanGesture({fingers:1}).onActionStart((e: GestureEvent) => {
54
+ PanGesture({ fingers: 1 }).onActionStart((e: GestureEvent) => {
66
55
 
67
56
  this.node.startMove()
68
- callTouchEventFnFromGesture(this.node, 'touchstart', e)
57
+ this.node.callTouchEventFnFromGesture('touchstart', e)
69
58
  }).onActionUpdate((e: GestureEvent) => {
70
- callTouchEventFnFromGesture(this.node, 'touchmove', e)
59
+ this.node.callTouchEventFnFromGesture('touchmove', e)
71
60
  this.node.doMove({
72
61
  x: e.offsetX,
73
62
  y: e.offsetY
74
63
  })
75
64
 
76
- }).onActionEnd(() => {
77
- callTouchEventFnFromGesture(this.node, 'touchend', e)
65
+ }).onActionEnd((e: GestureEvent) => {
66
+ this.node.callTouchEventFnFromGesture('touchend', e)
78
67
  this.node.checkPositionBoundary(this.node.position, this.node.scaleValue)
79
68
  }),
80
69
  PinchGesture({ fingers: 2 }).onActionStart((event: GestureEvent) => {
@@ -95,7 +95,6 @@ export default struct TaroVideo {
95
95
  Video(getVideoData(this.node))
96
96
  .attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
97
97
  .props(getVideoProps(this.node))
98
- .aspectRatio(4 / 3)
99
98
  .onStart(shouldBindEvent(() => { emitEvent(this.node, 'play') }, this.node, ['play']))
100
99
  .onPause(shouldBindEvent(() => { emitEvent(this.node, 'pause') }, this.node, ['pause']))
101
100
  .onFinish(shouldBindEvent(() => { emitEvent(this.node, 'ended') }, this.node, ['ended']))
@@ -194,4 +194,16 @@ export class TaroMovableViewElement extends TaroElement<MovableViewProps & { ani
194
194
 
195
195
  super.setAttribute(name, value)
196
196
  }
197
+
198
+ public callTouchEventFnFromGesture(eventName: string, gestureEvent: GestureEvent) {
199
+ const touchFns = (this?.__listeners?.[eventName] || []) as Function[]
200
+ touchFns.forEach(fn => {
201
+ fn({
202
+ changedTouches: gestureEvent.fingerList.map(finger => ({
203
+ clientX: finger.globalX,
204
+ clientY: finger.globalY
205
+ }))
206
+ })
207
+ })
208
+ }
197
209
  }
@@ -86,7 +86,6 @@ function stopOrTriggerPropagation (event: TaroEvent, node: TaroElement) {
86
86
 
87
87
  // eslint-disable-next-line no-unmodified-loop-condition
88
88
  while ((target = target.parentNode as TaroElement)) {
89
- event.currentTarget = target
90
89
  const listeners = target.__listeners[event.type]
91
90
 
92
91
  if (!Array.isArray(listeners) || target._attrs?.disabled) {
@@ -43,6 +43,8 @@ class TaroEventTarget extends Events {
43
43
  }
44
44
 
45
45
  public dispatchEvent (event: TaroEvent) {
46
+ // @ts-ignore
47
+ event.currentTarget = this
46
48
  const cancelable = event.cancelable
47
49
  const listeners = this.__listeners[event.type]
48
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/plugin-platform-harmony-ets",
3
- "version": "4.0.0-beta.66",
3
+ "version": "4.0.0-beta.67",
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.66",
29
- "@tarojs/helper": "4.0.0-beta.66",
30
- "@tarojs/runner-utils": "4.0.0-beta.66",
31
- "@tarojs/shared": "4.0.0-beta.66",
32
- "@tarojs/runtime": "4.0.0-beta.66",
33
- "@tarojs/taro": "4.0.0-beta.66",
34
- "@tarojs/service": "4.0.0-beta.66"
28
+ "@tarojs/components": "4.0.0-beta.67",
29
+ "@tarojs/runner-utils": "4.0.0-beta.67",
30
+ "@tarojs/helper": "4.0.0-beta.67",
31
+ "@tarojs/runtime": "4.0.0-beta.67",
32
+ "@tarojs/service": "4.0.0-beta.67",
33
+ "@tarojs/shared": "4.0.0-beta.67",
34
+ "@tarojs/taro": "4.0.0-beta.67"
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.66"
47
+ "rollup-plugin-copy": "4.0.0-beta.67"
48
48
  },
49
49
  "scripts": {
50
50
  "prebuild": "rimraf ./dist",