@shopware-ag/dive 1.16.16-beta.0 → 1.16.16

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.
Files changed (44) hide show
  1. package/build/dive.cjs +203 -1652
  2. package/build/dive.cjs.map +1 -1
  3. package/build/dive.d.cts +8 -50
  4. package/build/dive.d.ts +8 -50
  5. package/build/dive.js +159 -1619
  6. package/build/dive.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/axiscamera/AxisCamera.ts +4 -4
  9. package/src/axiscamera/__test__/AxisCamera.test.ts +0 -4
  10. package/src/com/Communication.ts +0 -17
  11. package/src/com/__test__/Communication.test.ts +1 -1
  12. package/src/com/actions/index.ts +0 -2
  13. package/src/dive.ts +9 -51
  14. package/src/helper/findSceneRecursive/findSceneRecursive.ts +2 -2
  15. package/src/info/Info.ts +1 -37
  16. package/src/info/__test__/Info.test.ts +5 -45
  17. package/src/mediacreator/MediaCreator.ts +4 -4
  18. package/src/mediacreator/__test__/MediaCreator.test.ts +2 -7
  19. package/src/renderer/Renderer.ts +11 -21
  20. package/src/renderer/__test__/Renderer.test.ts +1 -19
  21. package/src/scene/Scene.ts +12 -35
  22. package/src/scene/__test__/Scene.test.ts +5 -39
  23. package/src/scene/root/Root.ts +0 -1
  24. package/src/toolbox/BaseTool.ts +3 -9
  25. package/src/toolbox/Toolbox.ts +1 -1
  26. package/src/toolbox/__test__/Toolbox.test.ts +1 -1
  27. package/src/toolbox/select/SelectTool.ts +1 -1
  28. package/src/toolbox/select/__test__/SelectTool.test.ts +1 -1
  29. package/src/toolbox/transform/TransformTool.ts +4 -4
  30. package/src/toolbox/transform/__test__/TransformTool.test.ts +4 -2
  31. package/src/ar/AR.ts +0 -164
  32. package/src/ar/arquicklook/ARQuickLook.ts +0 -42
  33. package/src/ar/webxr/WebXR.ts +0 -176
  34. package/src/ar/webxr/controller/WebXRController.ts +0 -334
  35. package/src/ar/webxr/crosshair/WebXRCrosshair.ts +0 -35
  36. package/src/ar/webxr/origin/WebXROrigin.ts +0 -191
  37. package/src/ar/webxr/overlay/Overlay.ts +0 -50
  38. package/src/ar/webxr/raycaster/WebXRRaycaster.ts +0 -131
  39. package/src/ar/webxr/raycaster/ar/WebXRRaycasterAR.ts +0 -102
  40. package/src/ar/webxr/raycaster/three/WebXRRaycasterTHREE.ts +0 -49
  41. package/src/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.ts +0 -356
  42. package/src/events/EventExecutor.ts +0 -35
  43. package/src/scene/xrroot/XRRoot.ts +0 -56
  44. package/src/scene/xrroot/xrlightroot/XRLightRoot.ts +0 -80
package/build/dive.d.cts CHANGED
@@ -3,6 +3,7 @@ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
3
3
  import { Tween } from '@tweenjs/tween.js';
4
4
  import { TransformControls } from 'three/examples/jsm/controls/TransformControls';
5
5
  import { TransformControls as TransformControls$1, GLTF } from 'three/examples/jsm/Addons.js';
6
+ import { TransformControls as TransformControls$2 } from 'three/examples/jsm/Addons';
6
7
  import { GLTF as GLTF$1 } from 'three/examples/jsm/loaders/GLTFLoader';
7
8
 
8
9
  type DIVERendererSettings = {
@@ -14,7 +15,6 @@ type DIVERendererSettings = {
14
15
  toneMapping: ToneMapping;
15
16
  canvas?: HTMLCanvasElement;
16
17
  };
17
- type DIVERenderCallback = (time: DOMHighResTimeStamp, frame: XRFrame) => void;
18
18
  /**
19
19
  * A changed version of the WebGLRenderer.
20
20
  *
@@ -40,7 +40,7 @@ declare class DIVERenderer extends WebGLRenderer {
40
40
  * @param callback Executed before rendering.
41
41
  * @returns uuid to remove the callback.
42
42
  */
43
- AddPreRenderCallback(callback: DIVERenderCallback): string;
43
+ AddPreRenderCallback(callback: () => void): string;
44
44
  /**
45
45
  * Removes a callback from the render loop before actual render call.
46
46
  * @param uuid of callback to remove.
@@ -52,7 +52,7 @@ declare class DIVERenderer extends WebGLRenderer {
52
52
  * @param callback Executed after rendering.
53
53
  * @returns uuid to remove the callback.
54
54
  */
55
- AddPostRenderCallback(callback: DIVERenderCallback): string;
55
+ AddPostRenderCallback(callback: () => void): string;
56
56
  /**
57
57
  * Removes a callback from the render loop after actual render call.
58
58
  * @param uuid of callback to remove.
@@ -669,30 +669,6 @@ declare class DIVEFloor extends Mesh {
669
669
  SetColor(color: ColorRepresentation): void;
670
670
  }
671
671
 
672
- declare class DIVEXRLightRoot extends Object3D {
673
- private _scene;
674
- private _xrLight;
675
- private _lightRoot;
676
- constructor(scene: DIVEScene);
677
- InitLightEstimation(renderer: DIVERenderer): void;
678
- DisposeLightEstimation(): void;
679
- private onEstimationStart;
680
- private onEstimationEnd;
681
- }
682
-
683
- declare class DIVEXRRoot extends Object3D {
684
- private _xrLightRoot;
685
- private _xrModelRoot;
686
- private _xrHandNode;
687
- get XRModelRoot(): DIVERoot;
688
- get XRLightRoot(): DIVEXRLightRoot;
689
- get XRHandNode(): Object3D;
690
- private _xrShadowPlane;
691
- constructor(scene: DIVEScene);
692
- InitLightEstimation(renderer: DIVERenderer): void;
693
- DisposeLightEstimation(): void;
694
- }
695
-
696
672
  /**
697
673
  * A basic scene class.
698
674
  *
@@ -701,17 +677,13 @@ declare class DIVEXRRoot extends Object3D {
701
677
  * @module
702
678
  */
703
679
  declare class DIVEScene extends Scene {
704
- private _root;
705
- private _floor;
706
- private _grid;
680
+ private root;
681
+ private floor;
682
+ private grid;
707
683
  get Root(): DIVERoot;
708
- private _xrRoot;
709
- get XRRoot(): DIVEXRRoot;
710
684
  get Floor(): DIVEFloor;
711
685
  get Grid(): DIVEGrid;
712
686
  constructor();
713
- InitXR(renderer: DIVERenderer): void;
714
- DisposeXR(): void;
715
687
  SetBackground(color: ColorRepresentation): void;
716
688
  ComputeSceneBB(): Box3;
717
689
  GetSceneObject<T extends DIVESceneObject>(object: Partial<COMEntity> & {
@@ -811,7 +783,7 @@ declare abstract class DIVEBaseTool {
811
783
  */
812
784
  declare class DIVETransformTool extends DIVEBaseTool {
813
785
  readonly isTransformTool: boolean;
814
- protected _gizmo: TransformControls;
786
+ protected _gizmo: TransformControls$2;
815
787
  constructor(scene: DIVEScene, controller: DIVEOrbitControls);
816
788
  Activate(): void;
817
789
  SetGizmoMode(mode: 'translate' | 'rotate' | 'scale'): void;
@@ -919,7 +891,6 @@ interface Actions {
919
891
  GENERATE_MEDIA: GENERATE_MEDIA;
920
892
  SET_PARENT: SET_PARENT;
921
893
  EXPORT_SCENE: EXPORT_SCENE;
922
- LAUNCH_AR: any;
923
894
  }
924
895
 
925
896
  type EventListener<Action extends keyof Actions> = (payload: Actions[Action]['PAYLOAD']) => void;
@@ -956,8 +927,6 @@ declare class DIVECommunication {
956
927
  private get mediaGenerator();
957
928
  private _io;
958
929
  private get io();
959
- private _ar;
960
- private get ar();
961
930
  private registered;
962
931
  private listeners;
963
932
  constructor(renderer: DIVERenderer, scene: DIVEScene, controls: DIVEOrbitControls, toolbox: DIVEToolbox);
@@ -993,15 +962,8 @@ declare class DIVECommunication {
993
962
  private exportScene;
994
963
  }
995
964
 
996
- declare enum WebXRUnsupportedReason {
997
- 'UNKNWON_ERROR' = 0,
998
- 'NO_HTTPS' = 1,
999
- 'IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE' = 2,
1000
- 'AR_SESSION_NOT_ALLOWED' = 3
1001
- }
1002
965
  declare class DIVEInfo {
1003
966
  private static _supportsWebXR;
1004
- private static _webXRUnsupportedReason;
1005
967
  /**
1006
968
  *
1007
969
  * @returns The system the user is using. Possible values are "Android", "iOS", "Windows", "MacOS", "Linux" or "Unknown".
@@ -1011,10 +973,6 @@ declare class DIVEInfo {
1011
973
  * @returns A promise that resolves to a boolean indicating whether the user's device supports WebXR.
1012
974
  */
1013
975
  static GetSupportsWebXR(): Promise<boolean>;
1014
- /**
1015
- * @returns The reason why WebXR is not supported on the user's device. Returns null if WebXR is supported nor not has been checked yet.
1016
- */
1017
- static GetWebXRUnsupportedReason(): WebXRUnsupportedReason | null;
1018
976
  /**
1019
977
  * @returns A boolean indicating whether the user's device supports AR Quick Look.
1020
978
  */
@@ -1098,7 +1056,7 @@ declare const DIVEDefaultSettings: DIVESettings;
1098
1056
  * @module
1099
1057
  */
1100
1058
  declare class DIVE {
1101
- static QuickView(uri: string, settings?: Partial<DIVESettings>): DIVE;
1059
+ static QuickView(uri: string): DIVE;
1102
1060
  private _settings;
1103
1061
  private _resizeObserverId;
1104
1062
  private _width;
package/build/dive.d.ts CHANGED
@@ -3,6 +3,7 @@ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
3
3
  import { Tween } from '@tweenjs/tween.js';
4
4
  import { TransformControls } from 'three/examples/jsm/controls/TransformControls';
5
5
  import { TransformControls as TransformControls$1, GLTF } from 'three/examples/jsm/Addons.js';
6
+ import { TransformControls as TransformControls$2 } from 'three/examples/jsm/Addons';
6
7
  import { GLTF as GLTF$1 } from 'three/examples/jsm/loaders/GLTFLoader';
7
8
 
8
9
  type DIVERendererSettings = {
@@ -14,7 +15,6 @@ type DIVERendererSettings = {
14
15
  toneMapping: ToneMapping;
15
16
  canvas?: HTMLCanvasElement;
16
17
  };
17
- type DIVERenderCallback = (time: DOMHighResTimeStamp, frame: XRFrame) => void;
18
18
  /**
19
19
  * A changed version of the WebGLRenderer.
20
20
  *
@@ -40,7 +40,7 @@ declare class DIVERenderer extends WebGLRenderer {
40
40
  * @param callback Executed before rendering.
41
41
  * @returns uuid to remove the callback.
42
42
  */
43
- AddPreRenderCallback(callback: DIVERenderCallback): string;
43
+ AddPreRenderCallback(callback: () => void): string;
44
44
  /**
45
45
  * Removes a callback from the render loop before actual render call.
46
46
  * @param uuid of callback to remove.
@@ -52,7 +52,7 @@ declare class DIVERenderer extends WebGLRenderer {
52
52
  * @param callback Executed after rendering.
53
53
  * @returns uuid to remove the callback.
54
54
  */
55
- AddPostRenderCallback(callback: DIVERenderCallback): string;
55
+ AddPostRenderCallback(callback: () => void): string;
56
56
  /**
57
57
  * Removes a callback from the render loop after actual render call.
58
58
  * @param uuid of callback to remove.
@@ -669,30 +669,6 @@ declare class DIVEFloor extends Mesh {
669
669
  SetColor(color: ColorRepresentation): void;
670
670
  }
671
671
 
672
- declare class DIVEXRLightRoot extends Object3D {
673
- private _scene;
674
- private _xrLight;
675
- private _lightRoot;
676
- constructor(scene: DIVEScene);
677
- InitLightEstimation(renderer: DIVERenderer): void;
678
- DisposeLightEstimation(): void;
679
- private onEstimationStart;
680
- private onEstimationEnd;
681
- }
682
-
683
- declare class DIVEXRRoot extends Object3D {
684
- private _xrLightRoot;
685
- private _xrModelRoot;
686
- private _xrHandNode;
687
- get XRModelRoot(): DIVERoot;
688
- get XRLightRoot(): DIVEXRLightRoot;
689
- get XRHandNode(): Object3D;
690
- private _xrShadowPlane;
691
- constructor(scene: DIVEScene);
692
- InitLightEstimation(renderer: DIVERenderer): void;
693
- DisposeLightEstimation(): void;
694
- }
695
-
696
672
  /**
697
673
  * A basic scene class.
698
674
  *
@@ -701,17 +677,13 @@ declare class DIVEXRRoot extends Object3D {
701
677
  * @module
702
678
  */
703
679
  declare class DIVEScene extends Scene {
704
- private _root;
705
- private _floor;
706
- private _grid;
680
+ private root;
681
+ private floor;
682
+ private grid;
707
683
  get Root(): DIVERoot;
708
- private _xrRoot;
709
- get XRRoot(): DIVEXRRoot;
710
684
  get Floor(): DIVEFloor;
711
685
  get Grid(): DIVEGrid;
712
686
  constructor();
713
- InitXR(renderer: DIVERenderer): void;
714
- DisposeXR(): void;
715
687
  SetBackground(color: ColorRepresentation): void;
716
688
  ComputeSceneBB(): Box3;
717
689
  GetSceneObject<T extends DIVESceneObject>(object: Partial<COMEntity> & {
@@ -811,7 +783,7 @@ declare abstract class DIVEBaseTool {
811
783
  */
812
784
  declare class DIVETransformTool extends DIVEBaseTool {
813
785
  readonly isTransformTool: boolean;
814
- protected _gizmo: TransformControls;
786
+ protected _gizmo: TransformControls$2;
815
787
  constructor(scene: DIVEScene, controller: DIVEOrbitControls);
816
788
  Activate(): void;
817
789
  SetGizmoMode(mode: 'translate' | 'rotate' | 'scale'): void;
@@ -919,7 +891,6 @@ interface Actions {
919
891
  GENERATE_MEDIA: GENERATE_MEDIA;
920
892
  SET_PARENT: SET_PARENT;
921
893
  EXPORT_SCENE: EXPORT_SCENE;
922
- LAUNCH_AR: any;
923
894
  }
924
895
 
925
896
  type EventListener<Action extends keyof Actions> = (payload: Actions[Action]['PAYLOAD']) => void;
@@ -956,8 +927,6 @@ declare class DIVECommunication {
956
927
  private get mediaGenerator();
957
928
  private _io;
958
929
  private get io();
959
- private _ar;
960
- private get ar();
961
930
  private registered;
962
931
  private listeners;
963
932
  constructor(renderer: DIVERenderer, scene: DIVEScene, controls: DIVEOrbitControls, toolbox: DIVEToolbox);
@@ -993,15 +962,8 @@ declare class DIVECommunication {
993
962
  private exportScene;
994
963
  }
995
964
 
996
- declare enum WebXRUnsupportedReason {
997
- 'UNKNWON_ERROR' = 0,
998
- 'NO_HTTPS' = 1,
999
- 'IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE' = 2,
1000
- 'AR_SESSION_NOT_ALLOWED' = 3
1001
- }
1002
965
  declare class DIVEInfo {
1003
966
  private static _supportsWebXR;
1004
- private static _webXRUnsupportedReason;
1005
967
  /**
1006
968
  *
1007
969
  * @returns The system the user is using. Possible values are "Android", "iOS", "Windows", "MacOS", "Linux" or "Unknown".
@@ -1011,10 +973,6 @@ declare class DIVEInfo {
1011
973
  * @returns A promise that resolves to a boolean indicating whether the user's device supports WebXR.
1012
974
  */
1013
975
  static GetSupportsWebXR(): Promise<boolean>;
1014
- /**
1015
- * @returns The reason why WebXR is not supported on the user's device. Returns null if WebXR is supported nor not has been checked yet.
1016
- */
1017
- static GetWebXRUnsupportedReason(): WebXRUnsupportedReason | null;
1018
976
  /**
1019
977
  * @returns A boolean indicating whether the user's device supports AR Quick Look.
1020
978
  */
@@ -1098,7 +1056,7 @@ declare const DIVEDefaultSettings: DIVESettings;
1098
1056
  * @module
1099
1057
  */
1100
1058
  declare class DIVE {
1101
- static QuickView(uri: string, settings?: Partial<DIVESettings>): DIVE;
1059
+ static QuickView(uri: string): DIVE;
1102
1060
  private _settings;
1103
1061
  private _resizeObserverId;
1104
1062
  private _width;