@shopware-ag/dive 1.16.2 → 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/README.md +26 -26
- package/build/dive.cjs +58 -30
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.cts +4 -2
- package/build/dive.d.ts +4 -2
- package/build/dive.js +58 -31
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/com/Communication.ts +5 -0
- package/src/com/__test__/Communication.test.ts +7 -1
- package/src/com/types/COMGeometry.ts +3 -1
- package/src/com/types/COMGeometryType.ts +9 -0
- package/src/com/types/index.ts +2 -0
- package/src/io/IO.ts +19 -42
- package/src/io/__test__/IO.test.ts +32 -15
- package/src/primitive/Primitive.ts +8 -4
- package/src/primitive/__test__/Primitive.test.ts +17 -2
- package/src/renderer/__test__/Renderer.test.ts +3 -2
- package/src/scene/root/Root.ts +20 -0
- package/src/scene/root/__test__/Root.test.ts +54 -1
- package/src/toolbox/BaseTool.ts +11 -3
- package/src/toolbox/Toolbox.ts +1 -1
- package/src/toolbox/__test__/BaseTool.test.ts +37 -1
- package/src/toolbox/__test__/Toolbox.test.ts +18 -18
package/build/dive.d.cts
CHANGED
|
@@ -257,8 +257,10 @@ type COMModel = COMBaseEntity & {
|
|
|
257
257
|
material?: Partial<COMMaterial>;
|
|
258
258
|
};
|
|
259
259
|
|
|
260
|
+
type COMGeometryType = 'cylinder' | 'sphere' | 'pyramid' | 'cube' | 'box' | 'cone' | 'wall' | 'plane';
|
|
261
|
+
|
|
260
262
|
type COMGeometry = {
|
|
261
|
-
name:
|
|
263
|
+
name: COMGeometryType;
|
|
262
264
|
width: number;
|
|
263
265
|
height: number;
|
|
264
266
|
depth: number;
|
|
@@ -1057,4 +1059,4 @@ declare class DIVE {
|
|
|
1057
1059
|
private removeResizeObserver;
|
|
1058
1060
|
}
|
|
1059
1061
|
|
|
1060
|
-
export { type Actions, type COMEntity, type COMEntityType, type COMGeometry, type COMGroup, type COMLight, type COMMaterial, type COMModel, type COMPov, type COMPrimitive, DIVE, DIVECommunication, DIVEDefaultSettings, DIVEMath, type DIVESettings, DIVE as default };
|
|
1062
|
+
export { type Actions, type COMEntity, type COMEntityType, type COMGeometry, type COMGeometryType, type COMGroup, type COMLight, type COMMaterial, type COMModel, type COMPov, type COMPrimitive, DIVE, DIVECommunication, DIVEDefaultSettings, DIVEMath, type DIVESettings, DIVE as default };
|
package/build/dive.d.ts
CHANGED
|
@@ -257,8 +257,10 @@ type COMModel = COMBaseEntity & {
|
|
|
257
257
|
material?: Partial<COMMaterial>;
|
|
258
258
|
};
|
|
259
259
|
|
|
260
|
+
type COMGeometryType = 'cylinder' | 'sphere' | 'pyramid' | 'cube' | 'box' | 'cone' | 'wall' | 'plane';
|
|
261
|
+
|
|
260
262
|
type COMGeometry = {
|
|
261
|
-
name:
|
|
263
|
+
name: COMGeometryType;
|
|
262
264
|
width: number;
|
|
263
265
|
height: number;
|
|
264
266
|
depth: number;
|
|
@@ -1057,4 +1059,4 @@ declare class DIVE {
|
|
|
1057
1059
|
private removeResizeObserver;
|
|
1058
1060
|
}
|
|
1059
1061
|
|
|
1060
|
-
export { type Actions, type COMEntity, type COMEntityType, type COMGeometry, type COMGroup, type COMLight, type COMMaterial, type COMModel, type COMPov, type COMPrimitive, DIVE, DIVECommunication, DIVEDefaultSettings, DIVEMath, type DIVESettings, DIVE as default };
|
|
1062
|
+
export { type Actions, type COMEntity, type COMEntityType, type COMGeometry, type COMGeometryType, type COMGroup, type COMLight, type COMMaterial, type COMModel, type COMPov, type COMPrimitive, DIVE, DIVECommunication, DIVEDefaultSettings, DIVEMath, type DIVESettings, DIVE as default };
|
package/build/dive.js
CHANGED
|
@@ -136,15 +136,23 @@ var init_BaseTool = __esm({
|
|
|
136
136
|
onPointerDown(e) {
|
|
137
137
|
var _a;
|
|
138
138
|
switch (e.button) {
|
|
139
|
-
case 0:
|
|
139
|
+
case 0: {
|
|
140
140
|
this._pointerPrimaryDown = true;
|
|
141
141
|
break;
|
|
142
|
-
|
|
142
|
+
}
|
|
143
|
+
case 1: {
|
|
143
144
|
this._pointerMiddleDown = true;
|
|
144
145
|
break;
|
|
145
|
-
|
|
146
|
+
}
|
|
147
|
+
case 2: {
|
|
146
148
|
this._pointerSecondaryDown = true;
|
|
147
149
|
break;
|
|
150
|
+
}
|
|
151
|
+
default: {
|
|
152
|
+
console.warn(
|
|
153
|
+
"DIVEBaseTool.onPointerDown: Unknown button: " + e.button
|
|
154
|
+
);
|
|
155
|
+
}
|
|
148
156
|
}
|
|
149
157
|
this._lastPointerDown.copy(this._pointer);
|
|
150
158
|
this._draggable = findInterface(
|
|
@@ -581,40 +589,32 @@ var init_IO = __esm({
|
|
|
581
589
|
this._gltfIO = new DIVEGLTFIO();
|
|
582
590
|
}
|
|
583
591
|
Import(type, url) {
|
|
584
|
-
return this._importFromURL(type, url).catch((error) => {
|
|
585
|
-
console.error(error);
|
|
586
|
-
return null;
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
Export(type) {
|
|
590
|
-
return this._exportToURL(type).catch((error) => {
|
|
591
|
-
console.error(error);
|
|
592
|
-
return null;
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
_importFromURL(type, url) {
|
|
596
592
|
switch (type) {
|
|
597
593
|
case "glb": {
|
|
598
|
-
return this._gltfIO.Import(url)
|
|
594
|
+
return this._gltfIO.Import(url).catch((error) => {
|
|
595
|
+
console.error(error);
|
|
596
|
+
return null;
|
|
597
|
+
});
|
|
599
598
|
}
|
|
600
599
|
default: {
|
|
601
|
-
|
|
600
|
+
console.error("DIVEIO.Import: Unsupported file type: " + type);
|
|
601
|
+
return Promise.reject();
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
|
|
605
|
+
Export(type) {
|
|
606
606
|
switch (type) {
|
|
607
607
|
case "glb": {
|
|
608
|
-
return
|
|
609
|
-
this.
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
});
|
|
608
|
+
return this._gltfIO.Export(this._scene, true, true).then((data) => {
|
|
609
|
+
return this._createBlobURL(data);
|
|
610
|
+
}).catch((error) => {
|
|
611
|
+
console.error(error);
|
|
612
|
+
return null;
|
|
614
613
|
});
|
|
615
614
|
}
|
|
616
615
|
default: {
|
|
617
|
-
|
|
616
|
+
console.error("DIVEIO.Export: Unsupported file type: " + type);
|
|
617
|
+
return Promise.reject();
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
620
|
}
|
|
@@ -1014,6 +1014,11 @@ var _DIVECommunication = class _DIVECommunication {
|
|
|
1014
1014
|
);
|
|
1015
1015
|
break;
|
|
1016
1016
|
}
|
|
1017
|
+
default: {
|
|
1018
|
+
console.warn(
|
|
1019
|
+
`DIVECommunication.PerformAction: has been executed with unknown Action type ${action}`
|
|
1020
|
+
);
|
|
1021
|
+
}
|
|
1017
1022
|
}
|
|
1018
1023
|
this.dispatch(action, payload);
|
|
1019
1024
|
return returnValue;
|
|
@@ -1630,7 +1635,6 @@ var DIVELoadingManager = class {
|
|
|
1630
1635
|
// src/primitive/Primitive.ts
|
|
1631
1636
|
import {
|
|
1632
1637
|
BoxGeometry,
|
|
1633
|
-
BufferGeometry,
|
|
1634
1638
|
Color as Color4,
|
|
1635
1639
|
ConeGeometry,
|
|
1636
1640
|
CylinderGeometry,
|
|
@@ -1653,7 +1657,9 @@ var DIVEPrimitive = class extends DIVENode {
|
|
|
1653
1657
|
this.add(this._mesh);
|
|
1654
1658
|
}
|
|
1655
1659
|
SetGeometry(geometry) {
|
|
1656
|
-
|
|
1660
|
+
const geo = this.assembleGeometry(geometry);
|
|
1661
|
+
if (!geo) return;
|
|
1662
|
+
this._mesh.geometry = geo;
|
|
1657
1663
|
this._boundingBox.setFromObject(this._mesh);
|
|
1658
1664
|
}
|
|
1659
1665
|
SetMaterial(material) {
|
|
@@ -1751,6 +1757,7 @@ var DIVEPrimitive = class extends DIVENode {
|
|
|
1751
1757
|
return this.createSphereGeometry(geometry);
|
|
1752
1758
|
case "pyramid":
|
|
1753
1759
|
return this.createPyramidGeometry(geometry);
|
|
1760
|
+
case "cube":
|
|
1754
1761
|
case "box":
|
|
1755
1762
|
return this.createBoxGeometry(geometry);
|
|
1756
1763
|
case "cone":
|
|
@@ -1761,10 +1768,10 @@ var DIVEPrimitive = class extends DIVENode {
|
|
|
1761
1768
|
return this.createPlaneGeometry(geometry);
|
|
1762
1769
|
default: {
|
|
1763
1770
|
console.warn(
|
|
1764
|
-
"DIVEPrimitive: Invalid geometry type:",
|
|
1771
|
+
"DIVEPrimitive.assembleGeometry: Invalid geometry type:",
|
|
1765
1772
|
geometry.name.toLowerCase()
|
|
1766
1773
|
);
|
|
1767
|
-
return
|
|
1774
|
+
return null;
|
|
1768
1775
|
}
|
|
1769
1776
|
}
|
|
1770
1777
|
}
|
|
@@ -1997,6 +2004,11 @@ var DIVERoot = class extends Object3D6 {
|
|
|
1997
2004
|
this.updateGroup(object);
|
|
1998
2005
|
break;
|
|
1999
2006
|
}
|
|
2007
|
+
default: {
|
|
2008
|
+
console.warn(
|
|
2009
|
+
`DIVERoot.AddSceneObject: Unknown entity type: ${object.entityType}`
|
|
2010
|
+
);
|
|
2011
|
+
}
|
|
2000
2012
|
}
|
|
2001
2013
|
}
|
|
2002
2014
|
UpdateSceneObject(object) {
|
|
@@ -2020,6 +2032,11 @@ var DIVERoot = class extends Object3D6 {
|
|
|
2020
2032
|
this.updateGroup(object);
|
|
2021
2033
|
break;
|
|
2022
2034
|
}
|
|
2035
|
+
default: {
|
|
2036
|
+
console.warn(
|
|
2037
|
+
`DIVERoot.UpdateSceneObject: Unknown entity type: ${object.entityType}`
|
|
2038
|
+
);
|
|
2039
|
+
}
|
|
2023
2040
|
}
|
|
2024
2041
|
}
|
|
2025
2042
|
DeleteSceneObject(object) {
|
|
@@ -2043,6 +2060,11 @@ var DIVERoot = class extends Object3D6 {
|
|
|
2043
2060
|
this.deleteGroup(object);
|
|
2044
2061
|
break;
|
|
2045
2062
|
}
|
|
2063
|
+
default: {
|
|
2064
|
+
console.warn(
|
|
2065
|
+
`DIVERoot.DeleteSceneObject: Unknown entity type: ${object.entityType}`
|
|
2066
|
+
);
|
|
2067
|
+
}
|
|
2046
2068
|
}
|
|
2047
2069
|
}
|
|
2048
2070
|
PlaceOnFloor(object) {
|
|
@@ -2056,6 +2078,11 @@ var DIVERoot = class extends Object3D6 {
|
|
|
2056
2078
|
this.placeOnFloor(object);
|
|
2057
2079
|
break;
|
|
2058
2080
|
}
|
|
2081
|
+
default: {
|
|
2082
|
+
console.warn(
|
|
2083
|
+
`DIVERoot.PlaceOnFloor: Unknown entity type: ${object.entityType}`
|
|
2084
|
+
);
|
|
2085
|
+
}
|
|
2059
2086
|
}
|
|
2060
2087
|
}
|
|
2061
2088
|
updateLight(light) {
|
|
@@ -2535,7 +2562,7 @@ var DIVEToolbox = class {
|
|
|
2535
2562
|
break;
|
|
2536
2563
|
}
|
|
2537
2564
|
default: {
|
|
2538
|
-
|
|
2565
|
+
console.warn(`DIVEToolBox.UseTool: Unknown tool: ${tool}`);
|
|
2539
2566
|
}
|
|
2540
2567
|
}
|
|
2541
2568
|
}
|
|
@@ -2863,7 +2890,7 @@ DIVEInfo._supportsWebXR = null;
|
|
|
2863
2890
|
// package.json
|
|
2864
2891
|
var package_default = {
|
|
2865
2892
|
name: "@shopware-ag/dive",
|
|
2866
|
-
version: "1.16.
|
|
2893
|
+
version: "1.16.4",
|
|
2867
2894
|
description: "Shopware Spatial Framework",
|
|
2868
2895
|
type: "module",
|
|
2869
2896
|
main: "./build/dive.cjs",
|