@shopware-ag/dive 1.16.3 → 1.16.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/build/dive.cjs CHANGED
@@ -147,15 +147,23 @@ var init_BaseTool = __esm({
147
147
  onPointerDown(e) {
148
148
  var _a;
149
149
  switch (e.button) {
150
- case 0:
150
+ case 0: {
151
151
  this._pointerPrimaryDown = true;
152
152
  break;
153
- case 1:
153
+ }
154
+ case 1: {
154
155
  this._pointerMiddleDown = true;
155
156
  break;
156
- case 2:
157
+ }
158
+ case 2: {
157
159
  this._pointerSecondaryDown = true;
158
160
  break;
161
+ }
162
+ default: {
163
+ console.warn(
164
+ "DIVEBaseTool.onPointerDown: Unknown button: " + e.button
165
+ );
166
+ }
159
167
  }
160
168
  this._lastPointerDown.copy(this._pointer);
161
169
  this._draggable = findInterface(
@@ -592,40 +600,32 @@ var init_IO = __esm({
592
600
  this._gltfIO = new DIVEGLTFIO();
593
601
  }
594
602
  Import(type, url) {
595
- return this._importFromURL(type, url).catch((error) => {
596
- console.error(error);
597
- return null;
598
- });
599
- }
600
- Export(type) {
601
- return this._exportToURL(type).catch((error) => {
602
- console.error(error);
603
- return null;
604
- });
605
- }
606
- _importFromURL(type, url) {
607
603
  switch (type) {
608
604
  case "glb": {
609
- return this._gltfIO.Import(url);
605
+ return this._gltfIO.Import(url).catch((error) => {
606
+ console.error(error);
607
+ return null;
608
+ });
610
609
  }
611
610
  default: {
612
- return Promise.reject("Unsupported file type: " + type);
611
+ console.error("DIVEIO.Import: Unsupported file type: " + type);
612
+ return Promise.reject();
613
613
  }
614
614
  }
615
615
  }
616
- _exportToURL(type) {
616
+ Export(type) {
617
617
  switch (type) {
618
618
  case "glb": {
619
- return new Promise((resolve, reject) => {
620
- this._gltfIO.Export(this._scene, true, true).then((data) => {
621
- resolve(this._createBlobURL(data));
622
- }).catch((error) => {
623
- reject(error);
624
- });
619
+ return this._gltfIO.Export(this._scene, true, true).then((data) => {
620
+ return this._createBlobURL(data);
621
+ }).catch((error) => {
622
+ console.error(error);
623
+ return null;
625
624
  });
626
625
  }
627
626
  default: {
628
- return Promise.reject("Unsupported file type: " + type);
627
+ console.error("DIVEIO.Export: Unsupported file type: " + type);
628
+ return Promise.reject();
629
629
  }
630
630
  }
631
631
  }
@@ -1024,6 +1024,11 @@ var _DIVECommunication = class _DIVECommunication {
1024
1024
  );
1025
1025
  break;
1026
1026
  }
1027
+ default: {
1028
+ console.warn(
1029
+ `DIVECommunication.PerformAction: has been executed with unknown Action type ${action}`
1030
+ );
1031
+ }
1027
1032
  }
1028
1033
  this.dispatch(action, payload);
1029
1034
  return returnValue;
@@ -1652,7 +1657,9 @@ var DIVEPrimitive = class extends DIVENode {
1652
1657
  this.add(this._mesh);
1653
1658
  }
1654
1659
  SetGeometry(geometry) {
1655
- this._mesh.geometry = this.assembleGeometry(geometry);
1660
+ const geo = this.assembleGeometry(geometry);
1661
+ if (!geo) return;
1662
+ this._mesh.geometry = geo;
1656
1663
  this._boundingBox.setFromObject(this._mesh);
1657
1664
  }
1658
1665
  SetMaterial(material) {
@@ -1750,6 +1757,7 @@ var DIVEPrimitive = class extends DIVENode {
1750
1757
  return this.createSphereGeometry(geometry);
1751
1758
  case "pyramid":
1752
1759
  return this.createPyramidGeometry(geometry);
1760
+ case "cube":
1753
1761
  case "box":
1754
1762
  return this.createBoxGeometry(geometry);
1755
1763
  case "cone":
@@ -1760,10 +1768,10 @@ var DIVEPrimitive = class extends DIVENode {
1760
1768
  return this.createPlaneGeometry(geometry);
1761
1769
  default: {
1762
1770
  console.warn(
1763
- "DIVEPrimitive: Invalid geometry type:",
1771
+ "DIVEPrimitive.assembleGeometry: Invalid geometry type:",
1764
1772
  geometry.name.toLowerCase()
1765
1773
  );
1766
- return new import_three9.BufferGeometry();
1774
+ return null;
1767
1775
  }
1768
1776
  }
1769
1777
  }
@@ -1996,6 +2004,11 @@ var DIVERoot = class extends import_three11.Object3D {
1996
2004
  this.updateGroup(object);
1997
2005
  break;
1998
2006
  }
2007
+ default: {
2008
+ console.warn(
2009
+ `DIVERoot.AddSceneObject: Unknown entity type: ${object.entityType}`
2010
+ );
2011
+ }
1999
2012
  }
2000
2013
  }
2001
2014
  UpdateSceneObject(object) {
@@ -2019,6 +2032,11 @@ var DIVERoot = class extends import_three11.Object3D {
2019
2032
  this.updateGroup(object);
2020
2033
  break;
2021
2034
  }
2035
+ default: {
2036
+ console.warn(
2037
+ `DIVERoot.UpdateSceneObject: Unknown entity type: ${object.entityType}`
2038
+ );
2039
+ }
2022
2040
  }
2023
2041
  }
2024
2042
  DeleteSceneObject(object) {
@@ -2042,6 +2060,11 @@ var DIVERoot = class extends import_three11.Object3D {
2042
2060
  this.deleteGroup(object);
2043
2061
  break;
2044
2062
  }
2063
+ default: {
2064
+ console.warn(
2065
+ `DIVERoot.DeleteSceneObject: Unknown entity type: ${object.entityType}`
2066
+ );
2067
+ }
2045
2068
  }
2046
2069
  }
2047
2070
  PlaceOnFloor(object) {
@@ -2055,6 +2078,11 @@ var DIVERoot = class extends import_three11.Object3D {
2055
2078
  this.placeOnFloor(object);
2056
2079
  break;
2057
2080
  }
2081
+ default: {
2082
+ console.warn(
2083
+ `DIVERoot.PlaceOnFloor: Unknown entity type: ${object.entityType}`
2084
+ );
2085
+ }
2058
2086
  }
2059
2087
  }
2060
2088
  updateLight(light) {
@@ -2529,7 +2557,7 @@ var DIVEToolbox = class {
2529
2557
  break;
2530
2558
  }
2531
2559
  default: {
2532
- throw new Error(`ToolBox.UseTool: Unknown tool: ${tool}`);
2560
+ console.warn(`DIVEToolBox.UseTool: Unknown tool: ${tool}`);
2533
2561
  }
2534
2562
  }
2535
2563
  }
@@ -2851,7 +2879,7 @@ DIVEInfo._supportsWebXR = null;
2851
2879
  // package.json
2852
2880
  var package_default = {
2853
2881
  name: "@shopware-ag/dive",
2854
- version: "1.16.3",
2882
+ version: "1.16.4",
2855
2883
  description: "Shopware Spatial Framework",
2856
2884
  type: "module",
2857
2885
  main: "./build/dive.cjs",