@shopware-ag/dive 1.13.0 → 1.14.0

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/build/dive.d.cts CHANGED
@@ -446,6 +446,9 @@ declare class DIVEGroup extends Object3D implements DIVESelectable, DIVEMoveable
446
446
  */
447
447
  private updateBB;
448
448
  private updateBoxMesh;
449
+ onMove(): void;
450
+ onSelect(): void;
451
+ onDeselect(): void;
449
452
  }
450
453
 
451
454
  /**
package/build/dive.d.ts CHANGED
@@ -446,6 +446,9 @@ declare class DIVEGroup extends Object3D implements DIVESelectable, DIVEMoveable
446
446
  */
447
447
  private updateBB;
448
448
  private updateBoxMesh;
449
+ onMove(): void;
450
+ onSelect(): void;
451
+ onDeselect(): void;
449
452
  }
450
453
 
451
454
  /**
package/build/dive.js CHANGED
@@ -1546,6 +1546,7 @@ var DIVEGroup = class extends Object3D7 {
1546
1546
  * Children's world positions are kept.
1547
1547
  */
1548
1548
  recalculatePosition() {
1549
+ var _a;
1549
1550
  const childrensWorldPositions = this.children.map((child) => child.getWorldPosition(new Vector34()));
1550
1551
  const bbcenter = this.updateBB();
1551
1552
  this.position.copy(bbcenter);
@@ -1553,6 +1554,7 @@ var DIVEGroup = class extends Object3D7 {
1553
1554
  if (child.uuid === this._boxMesh.uuid) return;
1554
1555
  child.position.copy(this.worldToLocal(childrensWorldPositions[i]));
1555
1556
  });
1557
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position });
1556
1558
  }
1557
1559
  /**
1558
1560
  * Updates the bounding box of the group.
@@ -1569,6 +1571,18 @@ var DIVEGroup = class extends Object3D7 {
1569
1571
  updateBoxMesh() {
1570
1572
  this._boxMesh.geometry = new BoxGeometry2(this._bb.max.x - this._bb.min.x, this._bb.max.y - this._bb.min.y, this._bb.max.z - this._bb.min.z);
1571
1573
  }
1574
+ onMove() {
1575
+ var _a;
1576
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("UPDATE_OBJECT", { id: this.userData.id, position: this.position, rotation: this.rotation, scale: this.scale });
1577
+ }
1578
+ onSelect() {
1579
+ var _a;
1580
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("SELECT_OBJECT", { id: this.userData.id });
1581
+ }
1582
+ onDeselect() {
1583
+ var _a;
1584
+ (_a = DIVECommunication.get(this.userData.id)) == null ? void 0 : _a.PerformAction("DESELECT_OBJECT", { id: this.userData.id });
1585
+ }
1572
1586
  };
1573
1587
 
1574
1588
  // src/scene/root/Root.ts