@leafer-ui/interaction 1.10.1 → 1.11.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/interaction",
3
- "version": "1.10.1",
3
+ "version": "1.11.1",
4
4
  "description": "@leafer-ui/interaction",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,12 +22,12 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.10.1",
26
- "@leafer-ui/draw": "1.10.1",
27
- "@leafer-ui/event": "1.10.1"
25
+ "@leafer/core": "1.11.1",
26
+ "@leafer-ui/draw": "1.11.1",
27
+ "@leafer-ui/event": "1.11.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.10.1",
31
- "@leafer-ui/interface": "1.10.1"
30
+ "@leafer/interface": "1.11.1",
31
+ "@leafer-ui/interface": "1.11.1"
32
32
  }
33
33
  }
package/src/Dragger.ts CHANGED
@@ -105,10 +105,12 @@ export class Dragger {
105
105
  this.dragData.path = path
106
106
 
107
107
  if (this.moving) {
108
+ data.moving = true;
108
109
  (this.dragData as IMoveEvent).moveType = 'drag'
109
110
  interaction.emit(MoveEvent.BEFORE_MOVE, this.dragData)
110
111
  interaction.emit(MoveEvent.MOVE, this.dragData)
111
112
  } else if (this.dragging) {
113
+ data.dragging = true
112
114
  this.dragReal()
113
115
  interaction.emit(DragEvent.BEFORE_DRAG, this.dragData)
114
116
  interaction.emit(DragEvent.DRAG, this.dragData)
package/src/emit.ts CHANGED
@@ -10,11 +10,9 @@ export function emit(type: string, data: IUIEvent, path?: ILeafList, excludePath
10
10
 
11
11
  let leaf: ILeaf
12
12
  data.type = type
13
- if (path) {
14
- data = { ...data, path }
15
- } else {
16
- path = data.path
17
- }
13
+
14
+ if (path) data = { ...data, path }
15
+ else path = data.path
18
16
 
19
17
  data.target = path.indexAt(0)
20
18