@leafer-ui/interaction 2.0.2 → 2.0.4

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": "2.0.2",
3
+ "version": "2.0.4",
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": "2.0.2",
26
- "@leafer-ui/draw": "2.0.2",
27
- "@leafer-ui/event": "2.0.2"
25
+ "@leafer/core": "2.0.4",
26
+ "@leafer-ui/draw": "2.0.4",
27
+ "@leafer-ui/event": "2.0.4"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "2.0.2",
31
- "@leafer-ui/interface": "2.0.2"
30
+ "@leafer/interface": "2.0.4",
31
+ "@leafer-ui/interface": "2.0.4"
32
32
  }
33
33
  }
@@ -417,6 +417,15 @@ export class InteractionBase implements IInteraction {
417
417
  }
418
418
 
419
419
 
420
+ public replaceDownTarget(target: ILeaf): void {
421
+ const { downData } = this
422
+ if (downData && target) {
423
+ const { path } = downData
424
+ path.remove(path.list[0])
425
+ path.addAt(target, 0)
426
+ }
427
+ }
428
+
420
429
  public updateDownData(data?: IPointerEvent, options?: IPickOptions, merge?: boolean): void {
421
430
  const { downData } = this
422
431
  if (!data && downData) data = downData
package/types/index.d.ts CHANGED
@@ -117,6 +117,7 @@ declare class InteractionBase implements IInteraction {
117
117
  isFocus(leaf: ILeaf): boolean;
118
118
  cancelHover(): void;
119
119
  stopDragAnimate(): void;
120
+ replaceDownTarget(target: ILeaf): void;
120
121
  updateDownData(data?: IPointerEvent, options?: IPickOptions, merge?: boolean): void;
121
122
  updateHoverData(data?: IPointerEvent): void;
122
123
  updateCursor(data?: IPointerEvent): void;