@tmagic/stage 1.2.0-beta.1 → 1.2.0-beta.3

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.
@@ -493,10 +493,14 @@ class StageDragResize extends EventEmitter {
493
493
  this.dragStatus = StageDragStatus.END;
494
494
  const frame = this.moveableHelper?.getFrame(e.target);
495
495
  this.emit("update", {
496
- el: this.target,
497
- style: {
498
- transform: frame?.get("transform")
499
- }
496
+ data: [
497
+ {
498
+ el: this.target,
499
+ style: {
500
+ transform: frame?.get("transform")
501
+ }
502
+ }
503
+ ]
500
504
  });
501
505
  });
502
506
  }
@@ -517,10 +521,14 @@ class StageDragResize extends EventEmitter {
517
521
  this.dragStatus = StageDragStatus.END;
518
522
  const frame = this.moveableHelper?.getFrame(e.target);
519
523
  this.emit("update", {
520
- el: this.target,
521
- style: {
522
- transform: frame?.get("transform")
523
- }
524
+ data: [
525
+ {
526
+ el: this.target,
527
+ style: {
528
+ transform: frame?.get("transform")
529
+ }
530
+ }
531
+ ]
524
532
  });
525
533
  });
526
534
  }
@@ -625,7 +633,7 @@ class StageDragResize extends EventEmitter {
625
633
  resizable: true,
626
634
  scalable: false,
627
635
  rotatable: false,
628
- snappable: isAbsolute || isFixed,
636
+ snappable: true,
629
637
  snapGap: isAbsolute || isFixed,
630
638
  snapThreshold: 5,
631
639
  snapDigit: 0,
@@ -1529,6 +1537,7 @@ class StageCore extends EventEmitter {
1529
1537
  this.selectedDomList.push(el);
1530
1538
  }
1531
1539
  this.multiSelect(this.selectedDomList);
1540
+ this.emit("multiSelect", this.selectedDomList);
1532
1541
  });
1533
1542
  this.dr.on("update", (data) => {
1534
1543
  setTimeout(() => this.emit("update", data));
@@ -1603,9 +1612,8 @@ class StageCore extends EventEmitter {
1603
1612
  }
1604
1613
  async multiSelect(idOrElList) {
1605
1614
  this.clearSelectStatus("select");
1606
- const elList = await Promise.all(idOrElList.map(async (idOrEl) => await this.getTargetElement(idOrEl)));
1607
- this.multiDr.multiSelect(elList);
1608
- this.emit("multiSelect", elList);
1615
+ this.selectedDomList = await Promise.all(idOrElList.map(async (idOrEl) => await this.getTargetElement(idOrEl)));
1616
+ this.multiDr.multiSelect(this.selectedDomList);
1609
1617
  }
1610
1618
  update(data) {
1611
1619
  const { config } = data;