@shopware-ag/dive 1.18.4 → 1.18.5-beta.1
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/AR-B6LRgTEL.js +1482 -0
- package/build/AR-B6LRgTEL.js.map +1 -0
- package/build/AR-YJZL1lm5.cjs +170 -0
- package/build/AR-YJZL1lm5.cjs.map +1 -0
- package/build/dive-BmDCwQRo.js +24811 -0
- package/build/dive-BmDCwQRo.js.map +1 -0
- package/build/dive-C-5_QywE.cjs +3857 -0
- package/build/dive-C-5_QywE.cjs.map +1 -0
- package/build/dive.cjs +2 -4860
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.ts +6 -1186
- package/build/dive.js +7 -4889
- package/build/dive.js.map +1 -1
- package/build/src/animation/AnimationSystem.d.ts +16 -0
- package/build/src/ar/AR.d.ts +21 -0
- package/build/src/ar/arquicklook/ARQuickLook.d.ts +8 -0
- package/build/src/ar/sceneviewer/SceneViewer.d.ts +7 -0
- package/build/src/ar/webxr/WebXR.d.ts +21 -0
- package/build/src/ar/webxr/controller/WebXRController.d.ts +46 -0
- package/build/src/ar/webxr/crosshair/WebXRCrosshair.d.ts +7 -0
- package/build/src/ar/webxr/origin/WebXROrigin.d.ts +31 -0
- package/build/src/ar/webxr/overlay/Overlay.d.ts +8 -0
- package/build/src/ar/webxr/raycaster/WebXRRaycaster.d.ts +40 -0
- package/build/src/ar/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +15 -0
- package/build/src/ar/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +12 -0
- package/build/src/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +73 -0
- package/build/src/axiscamera/AxisCamera.d.ts +18 -0
- package/build/src/camera/PerspectiveCamera.d.ts +20 -0
- package/build/src/com/Communication.d.ts +77 -0
- package/build/src/com/actions/camera/computeencompassingview.d.ts +9 -0
- package/build/src/com/actions/camera/getcameratransform.d.ts +9 -0
- package/build/src/com/actions/camera/movecamera.d.ts +15 -0
- package/build/src/com/actions/camera/resetcamera.d.ts +7 -0
- package/build/src/com/actions/camera/setcameralayer.d.ts +7 -0
- package/build/src/com/actions/camera/setcameratransform.d.ts +9 -0
- package/build/src/com/actions/camera/zoomcamera.d.ts +8 -0
- package/build/src/com/actions/index.d.ts +58 -0
- package/build/src/com/actions/media/generatemedia.d.ts +15 -0
- package/build/src/com/actions/object/addobject.d.ts +6 -0
- package/build/src/com/actions/object/deleteobject.d.ts +8 -0
- package/build/src/com/actions/object/deselectobject.d.ts +8 -0
- package/build/src/com/actions/object/getallobjects.d.ts +6 -0
- package/build/src/com/actions/object/getobjects.d.ts +8 -0
- package/build/src/com/actions/object/model/dropit.d.ts +7 -0
- package/build/src/com/actions/object/model/modelloaded.d.ts +7 -0
- package/build/src/com/actions/object/model/placeonfloor.d.ts +7 -0
- package/build/src/com/actions/object/selectobject.d.ts +8 -0
- package/build/src/com/actions/object/setparent.d.ts +13 -0
- package/build/src/com/actions/object/updateobject.d.ts +8 -0
- package/build/src/com/actions/scene/exportscene.d.ts +8 -0
- package/build/src/com/actions/scene/getallscenedata.d.ts +6 -0
- package/build/src/com/actions/scene/launchar.d.ts +6 -0
- package/build/src/com/actions/scene/setbackground.d.ts +7 -0
- package/build/src/com/actions/scene/updatescene.d.ts +11 -0
- package/build/src/com/actions/toolbox/select/setgizmomode.d.ts +7 -0
- package/build/src/com/actions/toolbox/transform/setgizmoscalelinked.d.ts +5 -0
- package/build/src/com/actions/toolbox/transform/setgizmovisible.d.ts +5 -0
- package/build/src/com/actions/toolbox/usetool.d.ts +8 -0
- package/build/src/com/types/COMBaseEntity.d.ts +8 -0
- package/build/src/com/types/COMEntity.d.ts +6 -0
- package/build/src/com/types/COMEntityType.d.ts +1 -0
- package/build/src/com/types/COMGeometry.d.ts +7 -0
- package/build/src/com/types/COMGeometryType.d.ts +1 -0
- package/build/src/com/types/COMGroup.d.ts +8 -0
- package/build/src/com/types/COMLight.d.ts +10 -0
- package/build/src/com/types/COMMaterial.d.ts +11 -0
- package/build/src/com/types/COMModel.d.ts +11 -0
- package/build/src/com/types/COMPov.d.ts +7 -0
- package/build/src/com/types/COMPrimitive.d.ts +11 -0
- package/build/src/com/types/index.d.ts +11 -0
- package/build/src/constant/AxisHelperColors.d.ts +6 -0
- package/build/src/constant/GridColors.d.ts +2 -0
- package/build/src/constant/VisibilityLayerMask.d.ts +5 -0
- package/build/src/controls/OrbitControls.d.ts +38 -0
- package/build/src/dive.d.ts +64 -0
- package/build/src/events/EventExecutor.d.ts +5 -0
- package/build/src/exporters/usdz/USDZExporter.d.ts +15 -0
- package/build/src/gizmo/Gizmo.d.ts +27 -0
- package/build/src/gizmo/handles/AxisHandle.d.ts +30 -0
- package/build/src/gizmo/handles/RadialHandle.d.ts +30 -0
- package/build/src/gizmo/handles/ScaleHandle.d.ts +33 -0
- package/build/src/gizmo/plane/GizmoPlane.d.ts +12 -0
- package/build/src/gizmo/rotate/RotateGizmo.d.ts +17 -0
- package/build/src/gizmo/scale/ScaleGizmo.d.ts +20 -0
- package/build/src/gizmo/translate/TranslateGizmo.d.ts +17 -0
- package/build/src/grid/Grid.d.ts +10 -0
- package/build/src/group/Group.d.ts +23 -0
- package/build/src/helper/applyMixins/applyMixins.d.ts +8 -0
- package/build/src/helper/findInterface/findInterface.d.ts +2 -0
- package/build/src/helper/findSceneRecursive/findSceneRecursive.d.ts +9 -0
- package/build/src/helper/getObjectDelta/getObjectDelta.d.ts +4 -0
- package/build/src/helper/isInterface/implementsInterface.d.ts +2 -0
- package/build/src/info/Info.d.ts +39 -0
- package/build/src/interface/Draggable.d.ts +7 -0
- package/build/src/interface/Hoverable.d.ts +7 -0
- package/build/src/interface/Movable.d.ts +11 -0
- package/build/src/interface/Rotatable.d.ts +9 -0
- package/build/src/interface/Scalable.d.ts +9 -0
- package/build/src/interface/Selectable.d.ts +10 -0
- package/build/src/io/IO.d.ts +10 -0
- package/build/src/io/gltf/GLTFIO.d.ts +12 -0
- package/build/src/light/AmbientLight.d.ts +17 -0
- package/build/src/light/PointLight.d.ts +29 -0
- package/build/src/light/SceneLight.d.ts +18 -0
- package/build/src/loadingmanager/LoadingManager.d.ts +14 -0
- package/build/src/math/ceil/ceilExp.d.ts +1 -0
- package/build/src/math/degToRad/degToRad.d.ts +1 -0
- package/build/src/math/floor/floorExp.d.ts +1 -0
- package/build/src/math/helper/shift.d.ts +1 -0
- package/build/src/math/index.d.ts +18 -0
- package/build/src/math/radToDeg/radToDeg.d.ts +1 -0
- package/build/src/math/round/roundExp.d.ts +1 -0
- package/build/src/math/signedAngleTo/signedAngleTo.d.ts +9 -0
- package/build/src/math/toFixed/toFixedExp.d.ts +1 -0
- package/build/src/math/truncate/truncateExp.d.ts +1 -0
- package/build/src/mediacreator/MediaCreator.d.ts +17 -0
- package/build/src/model/Model.d.ts +21 -0
- package/build/src/node/Node.d.ts +24 -0
- package/build/src/primitive/Primitive.d.ts +28 -0
- package/build/src/primitive/floor/Floor.d.ts +14 -0
- package/build/src/renderer/Renderer.d.ts +69 -0
- package/build/src/scene/Scene.d.ts +46 -0
- package/build/src/scene/root/Root.d.ts +42 -0
- package/build/src/scene/xrroot/XRRoot.d.ts +17 -0
- package/build/src/scene/xrroot/xrlightroot/XRLightRoot.d.ts +13 -0
- package/build/src/toolbox/BaseTool.d.ts +48 -0
- package/build/src/toolbox/Toolbox.d.ts +31 -0
- package/build/src/toolbox/select/SelectTool.d.ts +26 -0
- package/build/src/toolbox/transform/TransformTool.d.ts +27 -0
- package/build/src/types/SceneData.d.ts +19 -0
- package/build/src/types/SceneObjects.d.ts +7 -0
- package/build/src/types/SceneType.d.ts +4 -0
- package/build/src/types/index.d.ts +4 -0
- package/package.json +9 -8
- package/src/camera/PerspectiveCamera.ts +1 -1
- package/src/com/Communication.ts +33 -8
- package/src/com/__test__/Communication.test.ts +2 -1
- package/src/dive.ts +0 -3
- package/build/dive.d.cts +0 -1186
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DIVEScene } from '../../scene/Scene.ts';
|
|
2
|
+
import { default as DIVETransformTool } from '../transform/TransformTool.ts';
|
|
3
|
+
import { default as DIVEOrbitControls } from '../../controls/OrbitControls.ts';
|
|
4
|
+
import { DIVESelectable } from '../../interface/Selectable.ts';
|
|
5
|
+
import { DIVEBaseTool } from '../BaseTool.ts';
|
|
6
|
+
export declare const isSelectTool: (tool: DIVEBaseTool) => tool is DIVESelectTool;
|
|
7
|
+
export interface DIVEObjectEventMap {
|
|
8
|
+
select: object;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A Tool to select and move objects in the scene.
|
|
12
|
+
*
|
|
13
|
+
* Objects have to implement the DIVESelectable interface to be selectable and DIVEMovable to be movable.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
export declare class DIVESelectTool extends DIVETransformTool {
|
|
18
|
+
readonly isSelectTool: boolean;
|
|
19
|
+
constructor(scene: DIVEScene, controller: DIVEOrbitControls);
|
|
20
|
+
Activate(): void;
|
|
21
|
+
Select(selectable: DIVESelectable): void;
|
|
22
|
+
Deselect(selectable: DIVESelectable): void;
|
|
23
|
+
AttachGizmo(selectable: DIVESelectable): void;
|
|
24
|
+
DetachGizmo(): void;
|
|
25
|
+
onClick(e: PointerEvent): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DIVEBaseTool } from '../BaseTool.ts';
|
|
2
|
+
import { DIVEScene } from '../../scene/Scene.ts';
|
|
3
|
+
import { default as DIVEOrbitControls } from '../../controls/OrbitControls.ts';
|
|
4
|
+
import { TransformControls } from 'three/examples/jsm/controls/TransformControls';
|
|
5
|
+
import { DIVEGizmo } from '../../gizmo/Gizmo.ts';
|
|
6
|
+
export declare const isTransformTool: (tool: DIVEBaseTool) => tool is DIVETransformTool;
|
|
7
|
+
export interface DIVEObjectEventMap {
|
|
8
|
+
select: object;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A Tool to select and move objects in the scene.
|
|
12
|
+
*
|
|
13
|
+
* Objects have to implement the DIVESelectable interface to be selectable and DIVEMovable to be movable.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
export default class DIVETransformTool extends DIVEBaseTool {
|
|
18
|
+
readonly isTransformTool: boolean;
|
|
19
|
+
private _scaleLinked;
|
|
20
|
+
protected _gizmo: TransformControls | DIVEGizmo;
|
|
21
|
+
constructor(scene: DIVEScene, controller: DIVEOrbitControls);
|
|
22
|
+
Activate(): void;
|
|
23
|
+
SetGizmoMode(mode: 'translate' | 'rotate' | 'scale'): void;
|
|
24
|
+
SetGizmoVisibility(active: boolean): void;
|
|
25
|
+
SetGizmoScaleLinked(linked: boolean): void;
|
|
26
|
+
private initGizmo;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Vector3Like } from 'three';
|
|
2
|
+
import { COMGroup, COMLight, COMModel, COMPov, COMPrimitive } from '../dive';
|
|
3
|
+
export type DIVESceneData = {
|
|
4
|
+
name: string;
|
|
5
|
+
mediaItem: null;
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
floorEnabled: boolean;
|
|
8
|
+
floorColor: string;
|
|
9
|
+
userCamera: {
|
|
10
|
+
position: Vector3Like;
|
|
11
|
+
target: Vector3Like;
|
|
12
|
+
};
|
|
13
|
+
spotmarks: object[];
|
|
14
|
+
lights: COMLight[];
|
|
15
|
+
objects: COMModel[];
|
|
16
|
+
cameras: COMPov[];
|
|
17
|
+
primitives: COMPrimitive[];
|
|
18
|
+
groups: COMGroup[];
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DIVEGroup } from '../group/Group';
|
|
2
|
+
import { default as DIVEAmbientLight } from '../light/AmbientLight';
|
|
3
|
+
import { default as DIVEPointLight } from '../light/PointLight';
|
|
4
|
+
import { default as DIVESceneLight } from '../light/SceneLight';
|
|
5
|
+
import { DIVEModel } from '../model/Model';
|
|
6
|
+
import { DIVEPrimitive } from '../primitive/Primitive';
|
|
7
|
+
export type DIVESceneObject = DIVEModel | DIVEGroup | DIVEPrimitive | DIVEAmbientLight | DIVEPointLight | DIVESceneLight;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopware-ag/dive",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.5-beta.1",
|
|
4
4
|
"description": "Shopware Spatial Framework",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "
|
|
7
|
-
"module": "
|
|
8
|
-
"types": "
|
|
6
|
+
"main": "build/dive.cjs",
|
|
7
|
+
"module": "build/dive.js",
|
|
8
|
+
"types": "build/dive.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"build",
|
|
11
11
|
"LICENSE",
|
|
@@ -51,13 +51,14 @@
|
|
|
51
51
|
"ts-jest": "^29.1.2",
|
|
52
52
|
"ts-node": "^10.9.2",
|
|
53
53
|
"tsc": "^2.0.4",
|
|
54
|
-
"tsup": "^8.0.2",
|
|
55
54
|
"typescript": "^5.4.5",
|
|
56
|
-
"typescript-eslint": "^7.7.1"
|
|
55
|
+
"typescript-eslint": "^7.7.1",
|
|
56
|
+
"vite": "^6.2.1",
|
|
57
|
+
"vite-plugin-dts": "^4.5.3"
|
|
57
58
|
},
|
|
58
59
|
"scripts": {
|
|
59
|
-
"build": "
|
|
60
|
-
"dev": "
|
|
60
|
+
"build": "vite build",
|
|
61
|
+
"dev": "vite build --watch",
|
|
61
62
|
"lint": "eslint",
|
|
62
63
|
"lint:actions": "yarn lint:actions:transpile && yarn lint:actions:check && yarn lint:actions:cleanup",
|
|
63
64
|
"lint:actions:transpile": "yarn tsc --resolveJsonModule --esModuleInterop ci/lint/lint-actions.ts && mv ci/lint/lint-actions.js ci/lint/lint-actions.cjs",
|
package/src/com/Communication.ts
CHANGED
|
@@ -99,13 +99,30 @@ export class DIVECommunication {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
private _ar: DIVEAR | null;
|
|
102
|
-
private get ar(): DIVEAR {
|
|
102
|
+
private get ar(): Promise<DIVEAR> {
|
|
103
103
|
if (!this._ar) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
return new Promise((resolve, reject) => {
|
|
105
|
+
import('../ar/AR.ts')
|
|
106
|
+
.then((module) => {
|
|
107
|
+
const DIVEAR = module.DIVEAR;
|
|
108
|
+
this._ar = new DIVEAR(
|
|
109
|
+
this.renderer,
|
|
110
|
+
this.scene,
|
|
111
|
+
this.controller,
|
|
112
|
+
);
|
|
113
|
+
resolve(this._ar);
|
|
114
|
+
})
|
|
115
|
+
.catch((error) => {
|
|
116
|
+
console.error(
|
|
117
|
+
'DIVE: Error while lazy-loading AR module:',
|
|
118
|
+
error,
|
|
119
|
+
);
|
|
120
|
+
reject(error);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
107
123
|
}
|
|
108
|
-
|
|
124
|
+
|
|
125
|
+
return Promise.resolve(this._ar);
|
|
109
126
|
}
|
|
110
127
|
|
|
111
128
|
private registered: Map<string, COMEntity> = new Map();
|
|
@@ -311,9 +328,17 @@ export class DIVECommunication {
|
|
|
311
328
|
break;
|
|
312
329
|
}
|
|
313
330
|
case 'LAUNCH_AR': {
|
|
314
|
-
returnValue =
|
|
315
|
-
|
|
316
|
-
|
|
331
|
+
returnValue = new Promise<void>((resolve, reject) => {
|
|
332
|
+
this.ar
|
|
333
|
+
.then((arModule) => {
|
|
334
|
+
resolve(
|
|
335
|
+
arModule.Launch(
|
|
336
|
+
payload as Actions['LAUNCH_AR']['PAYLOAD'],
|
|
337
|
+
),
|
|
338
|
+
);
|
|
339
|
+
})
|
|
340
|
+
.catch(reject);
|
|
341
|
+
});
|
|
317
342
|
break;
|
|
318
343
|
}
|
|
319
344
|
default: {
|
|
@@ -965,8 +965,9 @@ describe('dive/communication/DIVECommunication', () => {
|
|
|
965
965
|
});
|
|
966
966
|
|
|
967
967
|
it('should perform action LAUNCH_AR', async () => {
|
|
968
|
+
const arModule = await testCom['ar'];
|
|
968
969
|
const arLaunchSpy = jest
|
|
969
|
-
.spyOn(
|
|
970
|
+
.spyOn(arModule, 'Launch')
|
|
970
971
|
.mockResolvedValueOnce();
|
|
971
972
|
|
|
972
973
|
const result = await testCom.PerformAction('LAUNCH_AR', undefined);
|
package/src/dive.ts
CHANGED
|
@@ -277,9 +277,6 @@ export default class DIVE {
|
|
|
277
277
|
};
|
|
278
278
|
|
|
279
279
|
console.log(`DIVE ${pkgjson.version} initialized successfully!`);
|
|
280
|
-
if (process.env.DIVE_NODE_ENV === 'development') {
|
|
281
|
-
console.log('DIVE is running in development mode.');
|
|
282
|
-
}
|
|
283
280
|
console.log(`
|
|
284
281
|
@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
|
|
285
282
|
@@@@+-:::::::---------------------==------------------------------=#@@@@
|