@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.
@@ -499,10 +499,14 @@
499
499
  this.dragStatus = StageDragStatus.END;
500
500
  const frame = this.moveableHelper?.getFrame(e.target);
501
501
  this.emit("update", {
502
- el: this.target,
503
- style: {
504
- transform: frame?.get("transform")
505
- }
502
+ data: [
503
+ {
504
+ el: this.target,
505
+ style: {
506
+ transform: frame?.get("transform")
507
+ }
508
+ }
509
+ ]
506
510
  });
507
511
  });
508
512
  }
@@ -523,10 +527,14 @@
523
527
  this.dragStatus = StageDragStatus.END;
524
528
  const frame = this.moveableHelper?.getFrame(e.target);
525
529
  this.emit("update", {
526
- el: this.target,
527
- style: {
528
- transform: frame?.get("transform")
529
- }
530
+ data: [
531
+ {
532
+ el: this.target,
533
+ style: {
534
+ transform: frame?.get("transform")
535
+ }
536
+ }
537
+ ]
530
538
  });
531
539
  });
532
540
  }
@@ -631,7 +639,7 @@
631
639
  resizable: true,
632
640
  scalable: false,
633
641
  rotatable: false,
634
- snappable: isAbsolute || isFixed,
642
+ snappable: true,
635
643
  snapGap: isAbsolute || isFixed,
636
644
  snapThreshold: 5,
637
645
  snapDigit: 0,
@@ -1535,6 +1543,7 @@
1535
1543
  this.selectedDomList.push(el);
1536
1544
  }
1537
1545
  this.multiSelect(this.selectedDomList);
1546
+ this.emit("multiSelect", this.selectedDomList);
1538
1547
  });
1539
1548
  this.dr.on("update", (data) => {
1540
1549
  setTimeout(() => this.emit("update", data));
@@ -1609,9 +1618,8 @@
1609
1618
  }
1610
1619
  async multiSelect(idOrElList) {
1611
1620
  this.clearSelectStatus("select");
1612
- const elList = await Promise.all(idOrElList.map(async (idOrEl) => await this.getTargetElement(idOrEl)));
1613
- this.multiDr.multiSelect(elList);
1614
- this.emit("multiSelect", elList);
1621
+ this.selectedDomList = await Promise.all(idOrElList.map(async (idOrEl) => await this.getTargetElement(idOrEl)));
1622
+ this.multiDr.multiSelect(this.selectedDomList);
1615
1623
  }
1616
1624
  update(data) {
1617
1625
  const { config } = data;