@shopware-ag/dive 1.19.0 → 1.19.1-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.
Files changed (197) hide show
  1. package/build/dive.cjs +388 -220
  2. package/build/dive.cjs.map +1 -1
  3. package/build/dive.js +395 -21946
  4. package/build/dive.js.map +1 -1
  5. package/build/dive.mjs +28206 -0
  6. package/build/dive.mjs.map +1 -0
  7. package/build/src/ar/AR.d.ts +37 -14
  8. package/build/src/ar/arquicklook/ARQuickLook.d.ts +5 -6
  9. package/build/src/ar/sceneviewer/SceneViewer.d.ts +42 -6
  10. package/build/src/com/actions/scene/launchar.d.ts +5 -2
  11. package/build/src/converter/Converter.d.ts +21 -0
  12. package/build/src/dive.d.ts +3 -2
  13. package/build/src/exporter/Exporter.d.ts +11 -0
  14. package/build/src/helper/applyMixins/applyMixins.d.ts +22 -6
  15. package/build/src/info/Info.d.ts +37 -13
  16. package/build/src/interface/Movable.d.ts +5 -5
  17. package/build/src/interface/Selectable.d.ts +4 -4
  18. package/build/src/loader/Loader.d.ts +11 -0
  19. package/build/src/model/Model.d.ts +2 -2
  20. package/build/src/node/Node.d.ts +3 -3
  21. package/build/src/scene/root/Root.d.ts +1 -1
  22. package/build/src/types/ExporterOptions.d.ts +15 -0
  23. package/build/src/types/FileTypes.d.ts +27 -0
  24. package/build/src/types/index.d.ts +4 -0
  25. package/build/src/types/info/index.d.ts +66 -0
  26. package/package.json +17 -3
  27. package/build/src/exporters/usdz/USDZExporter.d.ts +0 -15
  28. package/build/src/loadingmanager/LoadingManager.d.ts +0 -14
  29. package/src/__test__/DIVE.test.ts +0 -274
  30. package/src/animation/AnimationSystem.ts +0 -34
  31. package/src/animation/__test__/AnimationSystem.test.ts +0 -40
  32. package/src/ar/AR.ts +0 -98
  33. package/src/ar/__test__/AR.test.ts +0 -187
  34. package/src/ar/arquicklook/ARQuickLook.ts +0 -93
  35. package/src/ar/arquicklook/__test__/ARQuickLook.test.ts +0 -93
  36. package/src/ar/sceneviewer/SceneViewer.ts +0 -74
  37. package/src/ar/sceneviewer/__test__/SceneViewer.test.ts +0 -93
  38. package/src/ar/webxr/WebXR.ts +0 -176
  39. package/src/ar/webxr/controller/WebXRController.ts +0 -340
  40. package/src/ar/webxr/crosshair/WebXRCrosshair.ts +0 -35
  41. package/src/ar/webxr/origin/WebXROrigin.ts +0 -192
  42. package/src/ar/webxr/overlay/Overlay.ts +0 -50
  43. package/src/ar/webxr/raycaster/WebXRRaycaster.ts +0 -131
  44. package/src/ar/webxr/raycaster/ar/WebXRRaycasterAR.ts +0 -102
  45. package/src/ar/webxr/raycaster/three/WebXRRaycasterTHREE.ts +0 -49
  46. package/src/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.ts +0 -356
  47. package/src/axiscamera/AxisCamera.ts +0 -108
  48. package/src/axiscamera/__test__/AxisCamera.test.ts +0 -150
  49. package/src/camera/PerspectiveCamera.ts +0 -63
  50. package/src/camera/__test__/PerspectiveCamera.test.ts +0 -36
  51. package/src/com/Communication.ts +0 -808
  52. package/src/com/__test__/Communication.test.ts +0 -1024
  53. package/src/com/actions/camera/computeencompassingview.ts +0 -10
  54. package/src/com/actions/camera/getcameratransform.ts +0 -10
  55. package/src/com/actions/camera/movecamera.ts +0 -18
  56. package/src/com/actions/camera/resetcamera.ts +0 -5
  57. package/src/com/actions/camera/setcameralayer.ts +0 -5
  58. package/src/com/actions/camera/setcameratransform.ts +0 -10
  59. package/src/com/actions/camera/zoomcamera.ts +0 -5
  60. package/src/com/actions/index.ts +0 -61
  61. package/src/com/actions/media/generatemedia.ts +0 -18
  62. package/src/com/actions/object/addobject.ts +0 -7
  63. package/src/com/actions/object/deleteobject.ts +0 -7
  64. package/src/com/actions/object/deselectobject.ts +0 -7
  65. package/src/com/actions/object/getallobjects.ts +0 -7
  66. package/src/com/actions/object/getobjects.ts +0 -7
  67. package/src/com/actions/object/model/dropit.ts +0 -5
  68. package/src/com/actions/object/model/modelloaded.ts +0 -5
  69. package/src/com/actions/object/model/placeonfloor.ts +0 -5
  70. package/src/com/actions/object/selectobject.ts +0 -7
  71. package/src/com/actions/object/setparent.ts +0 -10
  72. package/src/com/actions/object/updateobject.ts +0 -7
  73. package/src/com/actions/renderer/startrender.ts +0 -5
  74. package/src/com/actions/scene/exportscene.ts +0 -7
  75. package/src/com/actions/scene/getallscenedata.ts +0 -7
  76. package/src/com/actions/scene/launchar.ts +0 -7
  77. package/src/com/actions/scene/setbackground.ts +0 -5
  78. package/src/com/actions/scene/updatescene.ts +0 -11
  79. package/src/com/actions/toolbox/select/setgizmomode.ts +0 -5
  80. package/src/com/actions/toolbox/transform/setgizmoscalelinked.ts +0 -5
  81. package/src/com/actions/toolbox/transform/setgizmovisible.ts +0 -5
  82. package/src/com/actions/toolbox/usetool.ts +0 -7
  83. package/src/com/types/COMBaseEntity.ts +0 -9
  84. package/src/com/types/COMEntity.ts +0 -7
  85. package/src/com/types/COMEntityType.ts +0 -1
  86. package/src/com/types/COMGeometry.ts +0 -8
  87. package/src/com/types/COMGeometryType.ts +0 -9
  88. package/src/com/types/COMGroup.ts +0 -9
  89. package/src/com/types/COMLight.ts +0 -11
  90. package/src/com/types/COMMaterial.ts +0 -12
  91. package/src/com/types/COMModel.ts +0 -12
  92. package/src/com/types/COMPov.ts +0 -8
  93. package/src/com/types/COMPrimitive.ts +0 -12
  94. package/src/com/types/index.ts +0 -23
  95. package/src/constant/AxisHelperColors.ts +0 -7
  96. package/src/constant/GridColors.ts +0 -2
  97. package/src/constant/VisibilityLayerMask.ts +0 -5
  98. package/src/controls/OrbitControls.ts +0 -211
  99. package/src/controls/__test__/OrbitControls.test.ts +0 -256
  100. package/src/dive.ts +0 -363
  101. package/src/events/EventExecutor.ts +0 -35
  102. package/src/exporters/usdz/USDZExporter.ts +0 -21
  103. package/src/exporters/usdz/__test__/USDZExporter.test.ts +0 -57
  104. package/src/gizmo/Gizmo.ts +0 -144
  105. package/src/gizmo/handles/AxisHandle.ts +0 -153
  106. package/src/gizmo/handles/RadialHandle.ts +0 -149
  107. package/src/gizmo/handles/ScaleHandle.ts +0 -195
  108. package/src/gizmo/plane/GizmoPlane.ts +0 -84
  109. package/src/gizmo/rotate/RotateGizmo.ts +0 -143
  110. package/src/gizmo/scale/ScaleGizmo.ts +0 -125
  111. package/src/gizmo/translate/TranslateGizmo.ts +0 -114
  112. package/src/grid/Grid.ts +0 -34
  113. package/src/grid/__test__/Grid.test.ts +0 -28
  114. package/src/group/Group.ts +0 -184
  115. package/src/group/__test__/Group.test.ts +0 -212
  116. package/src/helper/applyMixins/__test__/applyMixins.test.ts +0 -30
  117. package/src/helper/applyMixins/applyMixins.ts +0 -18
  118. package/src/helper/findInterface/__test__/findInterface.test.ts +0 -63
  119. package/src/helper/findInterface/findInterface.ts +0 -13
  120. package/src/helper/findSceneRecursive/__test__/findSceneRecursive.test.ts +0 -40
  121. package/src/helper/findSceneRecursive/findSceneRecursive.ts +0 -16
  122. package/src/helper/getObjectDelta/__test__/getObjectDelta.test.ts +0 -186
  123. package/src/helper/getObjectDelta/getObjectDelta.ts +0 -105
  124. package/src/helper/isInterface/__test__/implementsInterface.test.ts +0 -19
  125. package/src/helper/isInterface/implementsInterface.ts +0 -9
  126. package/src/info/Info.ts +0 -154
  127. package/src/info/__test__/Info.test.ts +0 -338
  128. package/src/interface/Draggable.ts +0 -14
  129. package/src/interface/Hoverable.ts +0 -14
  130. package/src/interface/Movable.ts +0 -12
  131. package/src/interface/Rotatable.ts +0 -10
  132. package/src/interface/Scalable.ts +0 -10
  133. package/src/interface/Selectable.ts +0 -11
  134. package/src/io/IO.ts +0 -62
  135. package/src/io/__test__/IO.test.ts +0 -116
  136. package/src/io/gltf/GLTFIO.ts +0 -56
  137. package/src/io/gltf/__test__/GLTFIO.test.ts +0 -108
  138. package/src/light/AmbientLight.ts +0 -39
  139. package/src/light/PointLight.ts +0 -115
  140. package/src/light/SceneLight.ts +0 -63
  141. package/src/light/__test__/AmbientLight.test.ts +0 -29
  142. package/src/light/__test__/PointLight.test.ts +0 -74
  143. package/src/light/__test__/SceneLight.test.ts +0 -47
  144. package/src/loadingmanager/LoadingManager.ts +0 -50
  145. package/src/loadingmanager/__test__/LoadingManager.test.ts +0 -27
  146. package/src/math/__test__/DIVEMath.test.ts +0 -12
  147. package/src/math/ceil/__test__/ceilExp.test.ts +0 -12
  148. package/src/math/ceil/ceilExp.ts +0 -6
  149. package/src/math/degToRad/__test__/degToRad.test.ts +0 -172
  150. package/src/math/degToRad/degToRad.ts +0 -5
  151. package/src/math/floor/__test__/floorExp.test.ts +0 -14
  152. package/src/math/floor/floorExp.ts +0 -6
  153. package/src/math/helper/__test__/shift.test.ts +0 -12
  154. package/src/math/helper/shift.ts +0 -4
  155. package/src/math/index.ts +0 -28
  156. package/src/math/radToDeg/__test__/radToDeg.test.ts +0 -155
  157. package/src/math/radToDeg/radToDeg.ts +0 -5
  158. package/src/math/round/__test__/roundExp.test.ts +0 -14
  159. package/src/math/round/roundExp.ts +0 -10
  160. package/src/math/signedAngleTo/__test__/signedAngleTo.test.ts +0 -20
  161. package/src/math/signedAngleTo/signedAngleTo.ts +0 -20
  162. package/src/math/toFixed/__test__/toFixedExp.test.ts +0 -14
  163. package/src/math/toFixed/toFixedExp.ts +0 -9
  164. package/src/math/truncate/__test__/truncateExp.test.ts +0 -14
  165. package/src/math/truncate/truncateExp.ts +0 -9
  166. package/src/mediacreator/MediaCreator.ts +0 -75
  167. package/src/mediacreator/__test__/MediaCreator.test.ts +0 -155
  168. package/src/model/Model.ts +0 -185
  169. package/src/model/__test__/Model.test.ts +0 -222
  170. package/src/module/Module.ts +0 -45
  171. package/src/module/__test__/Module.test.ts +0 -54
  172. package/src/node/Node.ts +0 -98
  173. package/src/node/__test__/Node.test.ts +0 -120
  174. package/src/primitive/Primitive.ts +0 -299
  175. package/src/primitive/__test__/Primitive.test.ts +0 -281
  176. package/src/primitive/floor/Floor.ts +0 -45
  177. package/src/primitive/floor/__test__/Floor.test.ts +0 -24
  178. package/src/renderer/Renderer.ts +0 -215
  179. package/src/renderer/__test__/Renderer.test.ts +0 -228
  180. package/src/scene/Scene.ts +0 -106
  181. package/src/scene/__test__/Scene.test.ts +0 -124
  182. package/src/scene/root/Root.ts +0 -426
  183. package/src/scene/root/__test__/Root.test.ts +0 -903
  184. package/src/scene/xrroot/XRRoot.ts +0 -56
  185. package/src/scene/xrroot/xrlightroot/XRLightRoot.ts +0 -80
  186. package/src/toolbox/BaseTool.ts +0 -319
  187. package/src/toolbox/Toolbox.ts +0 -129
  188. package/src/toolbox/__test__/BaseTool.test.ts +0 -627
  189. package/src/toolbox/__test__/Toolbox.test.ts +0 -143
  190. package/src/toolbox/select/SelectTool.ts +0 -92
  191. package/src/toolbox/select/__test__/SelectTool.test.ts +0 -237
  192. package/src/toolbox/transform/TransformTool.ts +0 -166
  193. package/src/toolbox/transform/__test__/TransformTool.test.ts +0 -147
  194. package/src/types/SceneData.ts +0 -26
  195. package/src/types/SceneObjects.ts +0 -14
  196. package/src/types/SceneType.ts +0 -14
  197. package/src/types/index.ts +0 -5
@@ -1,21 +1,44 @@
1
- import { DIVEScene } from '../scene/Scene';
2
- import { DIVERenderer } from '../renderer/Renderer';
3
- import { default as DIVEOrbitControls } from '../controls/OrbitControls';
4
- export type DIVEAROptions = {
1
+ /**
2
+ * Options for configuring the AR system behavior
3
+ */
4
+ export type ARSystemOptions = {
5
+ /** The placement orientation for AR content - either horizontal or vertical */
5
6
  arPlacement: 'horizontal' | 'vertical';
7
+ /** The scaling behavior for AR content - either automatic or fixed */
6
8
  arScale: 'auto' | 'fixed';
9
+ };
10
+ /**
11
+ * Main class for handling AR functionality across different platforms
12
+ * Provides methods to launch AR experiences using platform-specific implementations
13
+ */
14
+ export declare class ARSystem {
7
15
  /**
8
- * experimental, currently deactivated
16
+ * Launches an AR experience using the appropriate platform-specific implementation
17
+ *
18
+ * @param uri - The URI of the 3D model to display in AR
19
+ * @param options - Optional configuration for the AR experience
20
+ * @returns Promise that resolves when AR is launched successfully
21
+ * @throws Error if AR is not supported on the current platform
22
+ */
23
+ launch(uri: string, options?: ARSystemOptions): Promise<void>;
24
+ /**
25
+ * Attempts to launch AR using ARQuickLook (iOS-specific implementation)
26
+ *
27
+ * @param uri - The URI of the 3D model to display in AR
28
+ * @param options - Optional configuration for the AR experience
29
+ * @returns Promise that resolves when ARQuickLook is launched successfully
30
+ * @throws Error if ARQuickLook is not supported on the device
9
31
  */
10
- useWebXR: false;
11
- };
12
- export declare class DIVEAR {
13
- private _renderer;
14
- private _scene;
15
- private _controller;
16
- constructor(renderer: DIVERenderer, scene: DIVEScene, controller: DIVEOrbitControls);
17
- Launch(options?: DIVEAROptions): Promise<void>;
18
32
  private tryARQuickLook;
19
- private tryWebXR;
33
+ /**
34
+ * Launches AR using SceneViewer (Android-specific implementation)
35
+ * Note: SceneViewer is supported on all Android devices. If ARCore is not installed,
36
+ * the model will be displayed in 3D view mode instead of AR mode.
37
+ *
38
+ * @param uri - The URI of the 3D model to display in AR
39
+ * @param options - Optional configuration for the AR experience
40
+ * @returns Promise that resolves when SceneViewer is launched successfully
41
+ * @throws Error if there's an issue launching SceneViewer
42
+ */
20
43
  private trySceneViewer;
21
44
  }
@@ -1,7 +1,6 @@
1
- import { DIVEScene } from '../../scene/Scene';
2
- import { DIVEAROptions } from '../AR';
3
- export declare class DIVEARQuickLook {
4
- static Launch(scene: DIVEScene, options?: DIVEAROptions): Promise<void>;
5
- private static launchARQuickLook;
6
- private static findARQuickLookSrc;
1
+ import { ARSystemOptions } from '../AR';
2
+ export declare class ARQuickLook {
3
+ launch(uri: string, options?: ARSystemOptions): Promise<void>;
4
+ private convertToUSDZ;
5
+ private launchARQuickLook;
7
6
  }
@@ -1,7 +1,43 @@
1
- import { DIVEScene } from '../../scene/Scene';
2
- import { DIVEAROptions } from '../AR';
3
- export declare class DIVESceneViewer {
4
- static Launch(scene: DIVEScene, options?: DIVEAROptions): void;
5
- private static launchSceneViewer;
6
- private static findSceneViewerSrc;
1
+ import { ARSystemOptions } from '../AR';
2
+ export declare class SceneViewer {
3
+ launch(uri: string, options?: ARSystemOptions): void;
4
+ /**
5
+ * Creates the base URL parameters for SceneViewer
6
+ * @param location Current page location URL
7
+ * @returns URLSearchParams with base configuration
8
+ */
9
+ private _createParams;
10
+ /**
11
+ * Applies the scale option to the parameters
12
+ * If scale is set to 'fixed', the model will not be resizable in AR
13
+ * @param params URLSearchParams to modify
14
+ */
15
+ private _applyScaleOption;
16
+ /**
17
+ * Applies the placement option to the parameters
18
+ * If placement is set to 'vertical', vertical placement will be enabled
19
+ * @param params URLSearchParams to modify
20
+ */
21
+ private _applyPlacementOption;
22
+ /**
23
+ * Applies the sound option to the parameters if present
24
+ * This will resolve any relative sound URLs to absolute URLs
25
+ * @param params URLSearchParams to modify
26
+ * @param location Current page location URL
27
+ */
28
+ private _applySoundOption;
29
+ /**
30
+ * Applies the link option to the parameters if present
31
+ * This will resolve any relative link URLs to absolute URLs
32
+ * @param params URLSearchParams to modify
33
+ * @param location Current page location URL
34
+ */
35
+ private _applyLinkOption;
36
+ /**
37
+ * Creates the Android Intent URL for SceneViewer
38
+ * @param params URLSearchParams containing all configuration
39
+ * @param location Current page location URL
40
+ * @returns The complete Intent URL
41
+ */
42
+ private _createIntent;
7
43
  }
@@ -1,6 +1,9 @@
1
- import { DIVEAROptions } from '../../../ar/AR';
1
+ import { ARSystemOptions } from '../../../ar/AR';
2
2
  export default interface LAUNCH_AR {
3
3
  DESCRIPTION: 'Launches AR mode in native capabilities. (iOS: AR Quick Look, Android: Google Scene Viewer)';
4
- PAYLOAD?: DIVEAROptions;
4
+ PAYLOAD: {
5
+ uri: string;
6
+ options?: ARSystemOptions;
7
+ };
5
8
  RETURN: Promise<void>;
6
9
  }
@@ -0,0 +1,21 @@
1
+ import { FileType, ExportOptions } from '../types';
2
+ export declare class ConversionError extends Error {
3
+ readonly cause?: unknown | undefined;
4
+ constructor(message: string, cause?: unknown | undefined);
5
+ }
6
+ export declare class FileTypeError extends ConversionError {
7
+ constructor(extension: string);
8
+ }
9
+ export declare class NetworkError extends ConversionError {
10
+ constructor(uri: string, cause?: unknown);
11
+ }
12
+ export declare class Converter {
13
+ private readonly _uri;
14
+ private _loader;
15
+ private _exporter;
16
+ constructor(_uri: string);
17
+ static convert(uri: string): Converter;
18
+ to<T extends FileType>(type: T, options?: ExportOptions<T>): Promise<ArrayBuffer>;
19
+ private _getFileTypeFromUri;
20
+ private _loadFile;
21
+ }
@@ -2,7 +2,7 @@ import { DIVERendererSettings } from './renderer/Renderer.ts';
2
2
  import { DIVEPerspectiveCameraSettings } from './camera/PerspectiveCamera.ts';
3
3
  import { DIVEOrbitControlsSettings } from './controls/OrbitControls.ts';
4
4
  import { DIVECommunication } from './com/Communication.ts';
5
- import { DIVEInfo } from './info/Info.ts';
5
+ import { SystemInfo } from './info/Info.ts';
6
6
  export type DIVESettings = {
7
7
  autoResize: boolean;
8
8
  autoStart: boolean;
@@ -50,7 +50,7 @@ export default class DIVE {
50
50
  private axisCamera;
51
51
  get Communication(): DIVECommunication;
52
52
  get Canvas(): HTMLCanvasElement;
53
- get Info(): DIVEInfo;
53
+ get Info(): SystemInfo;
54
54
  set Settings(settings: Partial<DIVESettings>);
55
55
  constructor(settings?: Partial<DIVESettings>);
56
56
  Dispose(): void;
@@ -60,6 +60,7 @@ export default class DIVE {
60
60
  }
61
61
  export { DIVE, DIVECommunication };
62
62
  export * from './math/index.ts';
63
+ export * from './ar/AR';
63
64
  export type * from './com/actions/index.ts';
64
65
  export type * from './com/types';
65
66
  export type * from './types';
@@ -0,0 +1,11 @@
1
+ import { Object3D } from 'three';
2
+ import { FileType, ExportOptions } from '../types';
3
+ export declare class Exporter {
4
+ private _gltfExporter;
5
+ private _usdzExporter;
6
+ constructor();
7
+ export<T extends FileType>(object: Object3D, type: T, options?: ExportOptions<T>): Promise<ArrayBuffer>;
8
+ private _exportGlb;
9
+ private _exportGltf;
10
+ private _exportUsdz;
11
+ }
@@ -1,8 +1,24 @@
1
+ type Constructor<T = {}> = new (...args: any[]) => T;
2
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
3
+ type MixedInstance<T extends Constructor, K extends readonly Constructor[]> = InstanceType<T> & UnionToIntersection<InstanceType<K[number]>>;
4
+ type FlattenConstructorParams<T extends readonly Constructor[]> = T extends readonly [infer First, ...infer Rest] ? First extends Constructor ? Rest extends readonly Constructor[] ? [
5
+ ...ConstructorParameters<First>,
6
+ ...FlattenConstructorParams<Rest>
7
+ ] : ConstructorParameters<First> : [] : [];
8
+ type MixedConstructor<T extends Constructor, K extends readonly Constructor[]> = new (...args: [...ConstructorParameters<T>, ...FlattenConstructorParams<K>]) => MixedInstance<T, K>;
1
9
  /**
2
- * Merges two class prototypes to a new one.
10
+ * Applies mixins to a base class.
11
+ *
12
+ * @param derivedCtor Base class constructor
13
+ * @param constructors Additional constructors that get mixed into the base class
14
+ * @returns A mixed constructor with the instance type of the base class and all mixin classes
15
+ * @example
16
+ * ```
17
+ * const SelectableMovableObject3D = applyMixins(Object3D, [DIVESelectable, DIVEMovable]);
18
+ * const instance = new SelectableMovableObject3D();
19
+ * instance.onMove();
20
+ * instance.onSelect();
21
+ * ```
3
22
  */
4
- export declare const applyMixins: (derivedCtor: {
5
- prototype: object;
6
- }, constructors: {
7
- prototype: object;
8
- }[]) => void;
23
+ export declare function applyMixins<T extends Constructor, K extends readonly Constructor[]>(derivedCtor: T, constructors: K): MixedConstructor<T, K>;
24
+ export {};
@@ -1,29 +1,53 @@
1
- export declare enum WebXRUnsupportedReason {
2
- 'UNKNWON_ERROR' = 0,
3
- 'NO_HTTPS' = 1,
4
- 'IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE' = 2,
5
- 'AR_SESSION_NOT_ALLOWED' = 3
6
- }
7
- export declare class DIVEInfo {
1
+ import { ESystem, EWebXRUnsupportedReason } from '../types/info';
2
+ export declare class SystemInfo {
8
3
  private static _supportsWebXR;
9
4
  private static _webXRUnsupportedReason;
10
5
  /**
11
- *
12
- * @returns The system the user is using. Possible values are "Android", "iOS", "Windows", "MacOS", "Linux" or "Unknown".
6
+ * Gets the current system (iOS, Android, Windows, etc.)
7
+ * @returns DIVESystem The current system
13
8
  */
14
- static GetSystem(): string;
9
+ static GetSystem(): ESystem;
15
10
  /**
16
11
  * @returns A promise that resolves to a boolean indicating whether the user's device supports WebXR.
17
12
  */
18
13
  static GetSupportsWebXR(): Promise<boolean>;
19
14
  /**
20
- * @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.
15
+ * @returns The reason why WebXR is not supported on the user's device. Returns null if WebXR is supported.
21
16
  */
22
- static GetWebXRUnsupportedReason(): WebXRUnsupportedReason | null;
17
+ static GetWebXRUnsupportedReason(): EWebXRUnsupportedReason | null;
23
18
  /**
24
- * @returns A boolean indicating whether the user's device supports AR Quick Look.
19
+ * Checks if ARQuickLook is supported on the current device
20
+ * This checks for:
21
+ * 1. AR support via relList
22
+ *
23
+ * Requirements:
24
+ * - iOS 13.0 or later
25
+ * - Safari browser (ARQuickLook is only supported in Safari)
26
+ * - Device with AR capabilities (iPhone/iPad with LiDAR scanner or ARKit support)
27
+ *
28
+ * Note: ARQuickLook is only available in Safari on iOS. Other browsers
29
+ * (Chrome, Firefox, etc.) do not support ARQuickLook, even on iOS.
30
+ *
31
+ * @returns boolean indicating if ARQuickLook is supported
25
32
  */
26
33
  static GetSupportsARQuickLook(): boolean;
34
+ /**
35
+ * Checks if SceneViewer is supported on the current device
36
+ * This checks for:
37
+ * 1. Android device
38
+ * 2. Chrome browser (version 89 or later)
39
+ *
40
+ * Requirements:
41
+ * - Android 7.0 (API level 24) or later
42
+ * - Chrome for Android 89 or later
43
+ *
44
+ * Note: According to Google's documentation, if these requirements are met,
45
+ * SceneViewer will be available. If ARCore is not installed, SceneViewer will
46
+ * fall back to showing the model in 3D.
47
+ *
48
+ * @returns boolean indicating if SceneViewer is supported
49
+ */
50
+ static GetSupportsSceneViewer(): boolean;
27
51
  /**
28
52
  * @returns A boolean indicating whether the user's device is a mobile device.
29
53
  */
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- export interface DIVEMovable {
7
- isMovable: true;
8
- onMoveStart?: () => void;
9
- onMove?: () => void;
10
- onMoveEnd?: () => void;
6
+ export declare class DIVEMovable {
7
+ readonly isMovable: true;
8
+ onMoveStart?(): void;
9
+ onMove?(): void;
10
+ onMoveEnd?(): void;
11
11
  }
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- export interface DIVESelectable {
7
- isSelectable: true;
8
- onSelect?: () => void;
9
- onDeselect?: () => void;
6
+ export declare class DIVESelectable {
7
+ readonly isSelectable: true;
8
+ onSelect?(): void;
9
+ onDeselect?(): void;
10
10
  }
@@ -0,0 +1,11 @@
1
+ import { Object3D } from 'three';
2
+ export declare class Loader {
3
+ private _gltfLoader;
4
+ private _usdzLoader;
5
+ constructor();
6
+ load(uri: string): Promise<Object3D>;
7
+ private _getFileTypeFromUri;
8
+ private _load;
9
+ private _loadGltf;
10
+ private _loadUsdz;
11
+ }
@@ -1,4 +1,4 @@
1
- import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
1
+ import { Object3D } from 'three';
2
2
  import { COMMaterial } from '../com/types';
3
3
  import { DIVENode } from '../node/Node';
4
4
  /**
@@ -14,7 +14,7 @@ export declare class DIVEModel extends DIVENode {
14
14
  readonly isDIVEModel: true;
15
15
  private _mesh;
16
16
  private _material;
17
- SetModel(gltf: GLTF): void;
17
+ SetModel(gltf: Object3D): void;
18
18
  SetMaterial(material: Partial<COMMaterial>): void;
19
19
  PlaceOnFloor(): void;
20
20
  DropIt(): void;
@@ -2,10 +2,9 @@ import { Box3, Object3D, Vector3, Vector3Like } from 'three';
2
2
  import { DIVEMovable } from '../interface/Movable';
3
3
  import { DIVESelectable } from '../interface/Selectable';
4
4
  import { TransformControls } from 'three/examples/jsm/controls/TransformControls';
5
- export declare class DIVENode extends Object3D implements DIVESelectable, DIVEMovable {
5
+ declare const DIVENode_base: new () => Object3D<import('three').Object3DEventMap> & DIVEMovable & DIVESelectable;
6
+ export declare class DIVENode extends DIVENode_base {
6
7
  readonly isDIVENode: true;
7
- readonly isSelectable: true;
8
- readonly isMovable: true;
9
8
  gizmo: TransformControls | null;
10
9
  protected _positionWorldBuffer: Vector3;
11
10
  protected _boundingBox: Box3;
@@ -22,3 +21,4 @@ export declare class DIVENode extends Object3D implements DIVESelectable, DIVEMo
22
21
  onSelect(): void;
23
22
  onDeselect(): void;
24
23
  }
24
+ export {};
@@ -8,7 +8,7 @@ import { DIVESceneObject } from '../../types';
8
8
  */
9
9
  export declare class DIVERoot extends Object3D {
10
10
  readonly isDIVERoot: true;
11
- private loadingManager;
11
+ private loader;
12
12
  constructor();
13
13
  ComputeSceneBB(): Box3;
14
14
  GetSceneObject<T extends DIVESceneObject>(object: Partial<COMEntity> & {
@@ -0,0 +1,15 @@
1
+ import { GLTFExporterOptions as THREEGLTFExporterOptions } from 'three/examples/jsm/exporters/GLTFExporter';
2
+ import { USDZExporterOptions as THREEUSDZExporterOptions } from 'three/examples/jsm/exporters/USDZExporter';
3
+ import { FileType, FileTypeOptions } from './FileTypes';
4
+ export type USDZExporterOptions = THREEUSDZExporterOptions & {
5
+ ar?: {
6
+ anchoring: {
7
+ type: 'plane' | 'image' | 'face' | 'none';
8
+ };
9
+ planeAnchoring: {
10
+ alignment: 'horizontal' | 'vertical' | 'any';
11
+ };
12
+ };
13
+ };
14
+ export type GLTFExporterOptions = THREEGLTFExporterOptions;
15
+ export type ExportOptions<T extends FileType> = FileTypeOptions<T>;
@@ -0,0 +1,27 @@
1
+ import { GLTFExporterOptions, USDZExporterOptions } from './ExporterOptions';
2
+ export type FileTypeDefinition<T extends string, O> = {
3
+ key: T;
4
+ extension: string;
5
+ options: O;
6
+ };
7
+ export declare const FILE_TYPES: {
8
+ readonly glb: {
9
+ readonly key: "glb";
10
+ readonly extension: ".glb";
11
+ readonly options: GLTFExporterOptions;
12
+ };
13
+ readonly gltf: {
14
+ readonly key: "gltf";
15
+ readonly extension: ".gltf";
16
+ readonly options: GLTFExporterOptions;
17
+ };
18
+ readonly usdz: {
19
+ readonly key: "usdz";
20
+ readonly extension: ".usdz";
21
+ readonly options: USDZExporterOptions;
22
+ };
23
+ };
24
+ export type FileType = keyof typeof FILE_TYPES;
25
+ export type FileTypeKey = (typeof FILE_TYPES)[FileType]['key'];
26
+ export type FileTypeOptions<T extends FileType> = (typeof FILE_TYPES)[T]['options'];
27
+ export declare const SUPPORTED_FILE_TYPES: readonly string[];
@@ -1,4 +1,8 @@
1
1
  import { DIVESceneObject } from './SceneObjects';
2
2
  import { DIVESceneFileType } from './SceneType';
3
3
  import { DIVESceneData } from './SceneData';
4
+ import { FileType, FileTypeKey, FileTypeOptions, FileTypeDefinition, FILE_TYPES, SUPPORTED_FILE_TYPES } from './FileTypes';
5
+ import { GLTFExporterOptions, USDZExporterOptions, ExportOptions } from './ExporterOptions';
4
6
  export { type DIVESceneObject, type DIVESceneFileType, type DIVESceneData };
7
+ export { type FileType, type FileTypeKey, type FileTypeOptions, type FileTypeDefinition, FILE_TYPES, SUPPORTED_FILE_TYPES, };
8
+ export { type GLTFExporterOptions, type USDZExporterOptions, type ExportOptions, };
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Enum representing supported operating systems
3
+ */
4
+ export declare enum ESystem {
5
+ /**
6
+ * iOS devices (iPhone, iPad)
7
+ */
8
+ IOS = "iOS",
9
+ /**
10
+ * Android devices
11
+ */
12
+ ANDROID = "Android",
13
+ /**
14
+ * Windows operating system
15
+ */
16
+ WINDOWS = "Windows",
17
+ /**
18
+ * macOS operating system
19
+ */
20
+ MACOS = "MacOS",
21
+ /**
22
+ * Linux operating system
23
+ */
24
+ LINUX = "Linux",
25
+ /**
26
+ * Unknown or unsupported system
27
+ */
28
+ UNKNOWN = "Unknown"
29
+ }
30
+ /**
31
+ * Enum representing reasons why WebXR AR might not be supported
32
+ */
33
+ export declare enum EWebXRUnsupportedReason {
34
+ /**
35
+ * The browser doesn't implement the WebXR API at all.
36
+ * This typically means the browser is outdated or doesn't support WebXR.
37
+ */
38
+ NO_WEBXR_API = "NO_WEBXR_API",
39
+ /**
40
+ * The page is not served over HTTPS.
41
+ * WebXR requires a secure context (HTTPS) to work.
42
+ */
43
+ NO_HTTPS = "NO_HTTPS",
44
+ /**
45
+ * The device doesn't support immersive AR sessions.
46
+ * This could be because:
47
+ * - The device doesn't have AR capabilities
48
+ * - The browser doesn't support AR features
49
+ * - The device's AR features are disabled
50
+ */
51
+ IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE = "IMMERSIVE_AR_NOT_SUPPORTED_BY_DEVICE",
52
+ /**
53
+ * Access to AR features has been denied by the system or browser.
54
+ * This could be due to:
55
+ * - Privacy settings
56
+ * - System restrictions
57
+ * - Browser policies
58
+ * - Hardware limitations
59
+ */
60
+ AR_PERMISSION_DENIED = "AR_PERMISSION_DENIED",
61
+ /**
62
+ * An unexpected error occurred while checking for WebXR support.
63
+ * This is a fallback for any unhandled cases.
64
+ */
65
+ UNKNOWN_ERROR = "UNKNOWN_ERROR"
66
+ }
package/package.json CHANGED
@@ -1,17 +1,31 @@
1
1
  {
2
2
  "name": "@shopware-ag/dive",
3
- "version": "1.19.0",
3
+ "version": "1.19.1-beta.1",
4
4
  "description": "Shopware Spatial Framework",
5
5
  "type": "module",
6
6
  "main": "build/dive.cjs",
7
7
  "module": "build/dive.js",
8
8
  "types": "build/dive.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./build/dive.d.ts",
12
+ "node": {
13
+ "import": {
14
+ "default": "./build/dive.mjs"
15
+ },
16
+ "require": {
17
+ "default": "./build/dive.cjs"
18
+ }
19
+ },
20
+ "import": "./build/dive.mjs",
21
+ "require": "./build/dive.cjs"
22
+ }
23
+ },
9
24
  "files": [
10
25
  "build",
11
26
  "LICENSE",
12
27
  "package.json",
13
- "README.md",
14
- "src"
28
+ "README.md"
15
29
  ],
16
30
  "keywords": [
17
31
  "dive",
@@ -1,15 +0,0 @@
1
- import { Object3D } from 'three';
2
- import { USDZExporter, USDZExporterOptions } from 'three/examples/jsm/exporters/USDZExporter';
3
- export type DIVEUSDZExporterOptions = USDZExporterOptions & {
4
- ar?: {
5
- anchoring: {
6
- type: 'plane' | 'image' | 'face' | 'none';
7
- };
8
- planeAnchoring: {
9
- alignment: 'horizontal' | 'vertical' | 'any';
10
- };
11
- };
12
- };
13
- export declare class DIVEUSDZExporter extends USDZExporter {
14
- parse(scene: Object3D, options?: DIVEUSDZExporterOptions): Promise<Uint8Array>;
15
- }
@@ -1,14 +0,0 @@
1
- import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
2
- /**
3
- * A basic loading manager.
4
- *
5
- * @module
6
- */
7
- export declare class DIVELoadingManager {
8
- private gltfloader;
9
- private dracoloader;
10
- constructor();
11
- private progress;
12
- LoadGLTF(uri: string): Promise<GLTF>;
13
- PollProgress(): number;
14
- }