@shopware-ag/dive 3.1.0 → 4.0.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 (196) hide show
  1. package/README.md +31 -5
  2. package/build/chunks/{AssetCache-xpY_N7Yp.cjs → AssetCache-CUVFS7wk.cjs} +1 -1
  3. package/build/chunks/{AssetCache-C3YXhbaX.mjs → AssetCache-DnAAa719.mjs} +1 -1
  4. package/build/chunks/AssetExporter-CD2iuQce.mjs +108 -0
  5. package/build/chunks/AssetExporter-CoL-QXkB.cjs +1 -0
  6. package/build/chunks/{AssetLoader-MfH5d_Rr.mjs → AssetLoader-Bkp3fWZz.mjs} +9 -9
  7. package/build/chunks/{AssetLoader-CRxLq0AL.cjs → AssetLoader-DnVvCd41.cjs} +2 -2
  8. package/build/chunks/FileTypes-B-MjfMGd.cjs +29 -0
  9. package/build/chunks/FileTypes-D3Dxr2dj.mjs +2294 -0
  10. package/build/chunks/ModelComponent-Cmu0EX0r.cjs +1 -0
  11. package/build/chunks/ModelComponent-WA0kLOEY.mjs +87 -0
  12. package/build/chunks/OrbitController-CAJIiZeE.cjs +1 -0
  13. package/build/chunks/OrbitController-DxCbrQVB.mjs +612 -0
  14. package/build/chunks/SpriteTextComponent-BpoKLOjA.cjs +1 -0
  15. package/build/chunks/SpriteTextComponent-DIZFqao0.mjs +83 -0
  16. package/build/chunks/collectAnimations-BgYCN1le.mjs +35 -0
  17. package/build/chunks/collectAnimations-C3HfZHte.cjs +1 -0
  18. package/build/chunks/contributesToBounds-C1mva__U.cjs +1 -0
  19. package/build/chunks/contributesToBounds-DYmHYES4.mjs +14 -0
  20. package/build/chunks/detachTransformControls-B4iRF1bw.mjs +209 -0
  21. package/build/chunks/detachTransformControls-CZ2cd5hx.cjs +1 -0
  22. package/build/chunks/{isFileTypeSupported-BBU39V4u.cjs → isFileExtensionSupported-B1q2eWs7.cjs} +1 -1
  23. package/build/chunks/{isFileTypeSupported-9h8lrIuG.mjs → isFileExtensionSupported-BqOqU3-h.mjs} +1 -1
  24. package/build/chunks/isVisibleInHierarchy-D9JcLqR5.cjs +1 -0
  25. package/build/chunks/isVisibleInHierarchy-KzVGvDEw.mjs +21 -0
  26. package/build/components/boundingbox/BoundingBoxComponent.d.ts +100 -0
  27. package/build/components/boundingbox/index.d.ts +1 -0
  28. package/build/components/camera/CameraComponent.d.ts +75 -0
  29. package/build/components/camera/index.d.ts +2 -0
  30. package/build/components/camera/perspective/PerspectiveCameraComponent.d.ts +39 -0
  31. package/build/components/grid/GridComponent.d.ts +50 -0
  32. package/build/components/index.d.ts +6 -10
  33. package/build/components/light/LightComponent.d.ts +65 -0
  34. package/build/components/light/ambient/AmbientLightComponent.d.ts +10 -0
  35. package/build/components/light/directional/DirectionalLightComponent.d.ts +23 -0
  36. package/build/components/light/hemi/HemisphereLightComponent.d.ts +21 -0
  37. package/build/components/light/index.d.ts +5 -3
  38. package/build/components/light/point/PointLightComponent.d.ts +26 -0
  39. package/build/components/line/MultiLineComponent.d.ts +133 -0
  40. package/build/components/line/index.d.ts +1 -0
  41. package/build/components/mesh/MeshComponent.d.ts +74 -0
  42. package/build/components/mesh/floor/FloorComponent.d.ts +36 -0
  43. package/build/components/mesh/index.d.ts +4 -0
  44. package/build/components/mesh/model/ModelComponent.d.ts +67 -0
  45. package/build/components/mesh/primitive/PrimitiveComponent.d.ts +43 -0
  46. package/build/components/spritetext/SpriteTextComponent.d.ts +58 -0
  47. package/build/constants/VisibilityLayerMask.d.ts +23 -0
  48. package/build/dive.cjs +1 -1
  49. package/build/dive.mjs +252 -773
  50. package/build/engine/Dive.d.ts +11 -13
  51. package/build/engine/boundingbox/BoundingBox.d.ts +76 -0
  52. package/build/engine/component/Component.d.ts +236 -0
  53. package/build/engine/environment/Environment.d.ts +0 -18
  54. package/build/engine/index.d.ts +4 -1
  55. package/build/engine/node/Node.d.ts +189 -0
  56. package/build/engine/promise/abortable/AbortablePromise.d.ts +8 -0
  57. package/build/engine/renderer/Renderer.d.ts +43 -7
  58. package/build/engine/scene/Scene.d.ts +88 -4
  59. package/build/engine/scene/root/Root.d.ts +29 -0
  60. package/build/engine/scene/xrroot/XRRoot.d.ts +1 -1
  61. package/build/engine/view/View.d.ts +15 -4
  62. package/build/helpers/collectAnimations/collectAnimations.d.ts +23 -0
  63. package/build/helpers/computeProductBounds/computeProductBounds.d.ts +18 -0
  64. package/build/helpers/contributesToBounds/contributesToBounds.d.ts +17 -0
  65. package/build/helpers/detachTransformControls/detachTransformControls.d.ts +15 -0
  66. package/build/helpers/disposeComponents/disposeComponents.d.ts +20 -0
  67. package/build/helpers/findSceneRecursive/findSceneRecursive.d.ts +7 -3
  68. package/build/helpers/implementsInterface/implementsInterface.d.ts +11 -0
  69. package/build/helpers/index.d.ts +6 -1
  70. package/build/helpers/isVisibleInHierarchy/isVisibleInHierarchy.d.ts +12 -0
  71. package/build/index.d.ts +0 -1
  72. package/build/plugins/animation/index.mjs +3 -2
  73. package/build/plugins/animation/src/system/AnimationSystem.d.ts +3 -2
  74. package/build/plugins/ar/index.cjs +1 -1
  75. package/build/plugins/ar/index.mjs +2 -2
  76. package/build/plugins/ar/src/webxr/WebXR.d.ts +7 -0
  77. package/build/plugins/assetcache/index.cjs +1 -1
  78. package/build/plugins/assetcache/index.mjs +1 -1
  79. package/build/plugins/assetexporter/index.cjs +1 -1
  80. package/build/plugins/assetexporter/index.mjs +1 -1
  81. package/build/plugins/assetexporter/src/AssetExporter.d.ts +12 -0
  82. package/build/plugins/assetloader/index.cjs +1 -1
  83. package/build/plugins/assetloader/index.mjs +2 -2
  84. package/build/plugins/mediacreator/index.cjs +1 -1
  85. package/build/plugins/mediacreator/index.mjs +32 -30
  86. package/build/plugins/mediacreator/src/MediaCreator.d.ts +1 -2
  87. package/build/plugins/orbitcontroller/index.cjs +1 -1
  88. package/build/plugins/orbitcontroller/index.d.ts +1 -0
  89. package/build/plugins/orbitcontroller/index.mjs +1 -1
  90. package/build/plugins/orbitcontroller/src/OrbitController.d.ts +39 -6
  91. package/build/plugins/orientationdisplay/index.cjs +1 -1
  92. package/build/plugins/orientationdisplay/index.mjs +39 -31
  93. package/build/plugins/orientationdisplay/src/OrientationDisplay.d.ts +3 -3
  94. package/build/plugins/quickview/index.cjs +1 -1
  95. package/build/plugins/quickview/index.mjs +68 -45
  96. package/build/plugins/quickview/src/QuickView.d.ts +40 -13
  97. package/build/plugins/quickview/types/index.d.ts +0 -18
  98. package/build/plugins/state/index.cjs +1 -27
  99. package/build/plugins/state/index.mjs +1983 -4262
  100. package/build/plugins/state/src/EngineGateway.d.ts +98 -0
  101. package/build/plugins/state/src/EntityRegistry.d.ts +51 -0
  102. package/build/plugins/state/src/State.d.ts +20 -9
  103. package/build/plugins/state/src/actions/camera/computeencompassingview.d.ts +1 -1
  104. package/build/plugins/state/src/actions/camera/movecamera.d.ts +2 -2
  105. package/build/plugins/state/src/actions/media/generatemedia.d.ts +1 -1
  106. package/build/plugins/state/src/actions/object/addobject.d.ts +2 -3
  107. package/build/plugins/state/src/actions/object/deleteobject.d.ts +3 -4
  108. package/build/plugins/state/src/actions/object/deselectobject.d.ts +3 -4
  109. package/build/plugins/state/src/actions/object/dropit.d.ts +2 -2
  110. package/build/plugins/state/src/actions/object/getallobjects.d.ts +2 -3
  111. package/build/plugins/state/src/actions/object/getobjects.d.ts +3 -4
  112. package/build/plugins/state/src/actions/object/index.d.ts +0 -1
  113. package/build/plugins/state/src/actions/object/modelloaded.d.ts +2 -2
  114. package/build/plugins/state/src/actions/object/selectobject.d.ts +3 -4
  115. package/build/plugins/state/src/actions/object/setparent.d.ts +3 -4
  116. package/build/plugins/state/src/actions/object/updateobject.d.ts +3 -4
  117. package/build/plugins/state/src/actions/renderer/startrender.d.ts +1 -1
  118. package/build/plugins/state/src/actions/scene/exportscene.d.ts +2 -2
  119. package/build/plugins/state/src/actions/scene/index.d.ts +0 -1
  120. package/build/plugins/state/src/actions/scene/setbackground.d.ts +2 -2
  121. package/build/plugins/state/src/actions/scene/updatescene.d.ts +2 -2
  122. package/build/plugins/state/src/actions/state/getstate.d.ts +1 -1
  123. package/build/plugins/state/src/actions/state/setstate.d.ts +1 -1
  124. package/build/plugins/state/src/helpers/copyVectors/copyVectors.d.ts +17 -0
  125. package/build/plugins/state/src/helpers/updateParentLink/updateParentLink.d.ts +29 -0
  126. package/build/plugins/state/src/helpers/watchEntity/watchEntity.d.ts +30 -0
  127. package/build/plugins/state/types/ActionTypes.d.ts +18 -3
  128. package/build/plugins/state/types/RegisteredEntity.d.ts +27 -0
  129. package/build/plugins/state/types/StateData.d.ts +1 -1
  130. package/build/plugins/state/types/index.d.ts +2 -1
  131. package/build/{types → plugins/state/types}/schema/GroupSchema.d.ts +1 -1
  132. package/build/{types → plugins/state/types}/schema/ModelSchema.d.ts +7 -4
  133. package/build/{types → plugins/state/types}/schema/PrimitiveSchema.d.ts +4 -5
  134. package/build/{types → plugins/state/types}/schema/index.d.ts +0 -3
  135. package/build/plugins/toolbox/index.cjs +1 -1
  136. package/build/plugins/toolbox/index.mjs +193 -140
  137. package/build/plugins/toolbox/src/PointerContext.d.ts +7 -0
  138. package/build/plugins/toolbox/src/SelectionState.d.ts +21 -0
  139. package/build/plugins/toolbox/src/Toolbox.d.ts +9 -2
  140. package/build/{components → plugins/toolbox/src}/gizmo/Gizmo.d.ts +16 -2
  141. package/build/{components → plugins/toolbox/src}/gizmo/handles/AxisHandle.d.ts +2 -3
  142. package/build/{components → plugins/toolbox/src}/gizmo/handles/RadialHandle.d.ts +2 -3
  143. package/build/{components → plugins/toolbox/src}/gizmo/handles/ScaleHandle.d.ts +2 -3
  144. package/build/{components → plugins/toolbox/src}/gizmo/rotate/RotateGizmo.d.ts +2 -2
  145. package/build/{components → plugins/toolbox/src}/gizmo/scale/ScaleGizmo.d.ts +3 -3
  146. package/build/{components → plugins/toolbox/src}/gizmo/translate/TranslateGizmo.d.ts +2 -2
  147. package/build/types/components/DIVESceneObject.d.ts +13 -6
  148. package/build/types/components/index.d.ts +0 -1
  149. package/build/types/events/DIVEComponentEventMap.d.ts +14 -0
  150. package/build/types/events/DIVEEntityEventMap.d.ts +47 -0
  151. package/build/types/events/index.d.ts +2 -0
  152. package/build/types/{schema/GeometrySchema.d.ts → geometry/DIVEGeometry.d.ts} +4 -4
  153. package/build/types/{schema/GeometryTypeSchema.d.ts → geometry/DIVEGeometryType.d.ts} +1 -1
  154. package/build/types/geometry/index.d.ts +2 -0
  155. package/build/types/index.d.ts +3 -1
  156. package/build/types/{schema/MaterialSchema.d.ts → material/DIVEMaterial.d.ts} +1 -1
  157. package/build/types/material/index.d.ts +1 -0
  158. package/package.json +6 -5
  159. package/build/chunks/AssetExporter-C5MScs9S.mjs +0 -70
  160. package/build/chunks/AssetExporter-Cdxb04b3.cjs +0 -1
  161. package/build/chunks/CameraSchema-cgY5WBGW.mjs +0 -10
  162. package/build/chunks/CameraSchema-twxH-72N.cjs +0 -1
  163. package/build/chunks/FileTypes-Cgyf8ocm.cjs +0 -29
  164. package/build/chunks/FileTypes-DiYB3WBp.mjs +0 -2166
  165. package/build/chunks/PerspectiveCamera-B5TvUzTa.mjs +0 -39
  166. package/build/chunks/PerspectiveCamera-DwQUmkDv.cjs +0 -1
  167. package/build/chunks/SpriteText-2lCRglsw.cjs +0 -1
  168. package/build/chunks/SpriteText-C_CQPvUn.mjs +0 -50
  169. package/build/chunks/findInterface-C6mrvf_t.cjs +0 -1
  170. package/build/chunks/findInterface-DbJ5qzbc.mjs +0 -11
  171. package/build/components/boundingbox/BoundingBox.d.ts +0 -140
  172. package/build/components/floor/Floor.d.ts +0 -14
  173. package/build/components/grid/Grid.d.ts +0 -23
  174. package/build/components/group/Group.d.ts +0 -28
  175. package/build/components/light/AmbientLight.d.ts +0 -19
  176. package/build/components/light/PointLight.d.ts +0 -29
  177. package/build/components/light/SceneLight.d.ts +0 -20
  178. package/build/components/model/Model.d.ts +0 -26
  179. package/build/components/node/Node.d.ts +0 -24
  180. package/build/components/primitive/Primitive.d.ts +0 -27
  181. package/build/components/root/Root.d.ts +0 -34
  182. package/build/components/spritetext/SpriteText.d.ts +0 -27
  183. package/build/engine/camera/PerspectiveCamera.d.ts +0 -24
  184. package/build/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +0 -9
  185. package/build/plugins/quickview/src/state/QuickViewState.d.ts +0 -4
  186. package/build/plugins/quickview/src/uri/QuickViewUri.d.ts +0 -3
  187. package/build/plugins/state/src/actions/object/placeonfloor.d.ts +0 -12
  188. package/build/plugins/state/src/actions/scene/getallscenedata.d.ts +0 -12
  189. package/build/plugins/state/types/StateSceneData.d.ts +0 -5
  190. package/build/types/components/DIVELight.d.ts +0 -4
  191. /package/build/{types → plugins/state/types}/schema/BaseEntitySchema.d.ts +0 -0
  192. /package/build/{types → plugins/state/types}/schema/CameraSchema.d.ts +0 -0
  193. /package/build/{types → plugins/state/types}/schema/EntitySchema.d.ts +0 -0
  194. /package/build/{types → plugins/state/types}/schema/EntityTypeSchema.d.ts +0 -0
  195. /package/build/{types → plugins/state/types}/schema/LightSchema.d.ts +0 -0
  196. /package/build/{components → plugins/toolbox/src}/gizmo/plane/GizmoPlane.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import { Object3D } from 'three/webgpu';
2
- import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
2
+ import { OrbitController } from '../../../../orbitcontroller/index.ts';
3
3
  import { DIVERadialHandle } from '../handles/RadialHandle.ts';
4
- import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
4
+ import { DraggableEvent } from '../../drag/DraggableEvent.ts';
5
5
  export declare class DIVERotateGizmo extends Object3D {
6
6
  children: DIVERadialHandle[];
7
7
  private _controller;
@@ -1,8 +1,8 @@
1
1
  import { Object3D, Vector3 } from 'three/webgpu';
2
- import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
3
- import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
2
+ import { DIVEHoverable } from '../../../../../index.ts';
3
+ import { OrbitController } from '../../../../orbitcontroller/index.ts';
4
4
  import { DIVEScaleHandle } from '../handles/ScaleHandle.ts';
5
- import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
5
+ import { DraggableEvent } from '../../drag/DraggableEvent.ts';
6
6
  export declare class DIVEScaleGizmo extends Object3D implements DIVEHoverable {
7
7
  readonly isHoverable: true;
8
8
  children: DIVEScaleHandle[];
@@ -1,7 +1,7 @@
1
1
  import { Object3D } from 'three/webgpu';
2
- import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
2
+ import { OrbitController } from '../../../../orbitcontroller/index.ts';
3
3
  import { DIVEAxisHandle } from '../handles/AxisHandle.ts';
4
- import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
4
+ import { DraggableEvent } from '../../drag/DraggableEvent.ts';
5
5
  export declare class DIVETranslateGizmo extends Object3D {
6
6
  private _controller;
7
7
  set debug(value: boolean);
@@ -1,6 +1,13 @@
1
- import { DIVEGroup } from '../../components/group/Group.ts';
2
- import { DIVEModel } from '../../components/model/Model.ts';
3
- import { DIVEPrimitive } from '../../components/primitive/Primitive.ts';
4
- import { DIVELight } from './DIVELight.ts';
5
- import { EntityTypeSchema } from '../index.ts';
6
- export type DIVESceneObject<T extends EntityTypeSchema | void = void> = T extends 'model' ? DIVEModel : T extends 'group' ? DIVEGroup : T extends 'primitive' ? DIVEPrimitive : T extends 'light' ? DIVELight : DIVEModel | DIVEGroup | DIVEPrimitive | DIVELight;
1
+ import { DIVENode } from '../../engine/node/Node.ts';
2
+ /**
3
+ * Anything the engine can put in the scene tree.
4
+ *
5
+ * Every entity is a `DIVENode`: what it *is* comes from the components attached
6
+ * to it, not from its class. Lights, models, primitives and groups are all
7
+ * plain nodes with different component sets, and the state plugin's gateway is
8
+ * what decides which set an entity type gets.
9
+ *
10
+ * Kept as a named type because it reads better at the boundary and leaves room
11
+ * to narrow again later.
12
+ */
13
+ export type DIVESceneObject = DIVENode;
@@ -1,2 +1 @@
1
- export * from './DIVELight.ts';
2
1
  export * from './DIVESceneObject.ts';
@@ -0,0 +1,14 @@
1
+ /** Carries nothing beyond the fact that it happened. */
2
+ type DIVEComponentBareEvent = object;
3
+ /**
4
+ * What a component announces about itself.
5
+ *
6
+ * Separate from {@link DIVEEntityEventMap}: a component knows about an asset, a
7
+ * geometry, a material -- never about entities or their ids. Whoever listens
8
+ * knows which component it attached to, and `event.target` is there for anyone
9
+ * who does not.
10
+ */
11
+ export type DIVEComponentEventMap = {
12
+ 'object-load': DIVEComponentBareEvent;
13
+ };
14
+ export {};
@@ -0,0 +1,47 @@
1
+ import { Object3DEventMap, Vector3Like } from 'three/webgpu';
2
+ import { DIVEComponent } from '../../engine/component/Component.ts';
3
+ /**
4
+ * The transform an entity reports about itself.
5
+ *
6
+ * `position` is in world space, `rotation` and `scale` are local — that is
7
+ * what the objects already computed before they reported anything.
8
+ *
9
+ * The vectors are live references into the emitting object, including a
10
+ * scratch buffer that the next frame overwrites. A listener that keeps them
11
+ * must copy first. This is deliberate: the event fires once per gizmo frame
12
+ * and must not allocate.
13
+ */
14
+ export type DIVEEntityTransformEvent = {
15
+ position: Vector3Like;
16
+ rotation: Vector3Like;
17
+ scale: Vector3Like;
18
+ };
19
+ /**
20
+ * What a scene object announces about itself.
21
+ *
22
+ * The engine only states facts here — that something moved, was selected, or
23
+ * was deselected. Whether any of it means something is for a listener to
24
+ * decide, which is what keeps the engine free of state knowledge.
25
+ *
26
+ * A finished asset load is not on this list. Fetching is a component's business,
27
+ * and a component says so itself — see {@link DIVEComponentEventMap}. A node used
28
+ * to announce it only because a component had no way to speak for itself, which
29
+ * also meant a component with no owner yet dropped the event silently.
30
+ *
31
+ * No event carries an id: whoever attached the listener knows which object it
32
+ * belongs to, and `event.target` is available for anyone who does not.
33
+ */
34
+ /** Carries nothing beyond the fact that it happened. */
35
+ type DIVEEntityBareEvent = object;
36
+ /** Which component joined or left. */
37
+ export type DIVENodeComponentEvent = {
38
+ component: DIVEComponent;
39
+ };
40
+ export type DIVEEntityEventMap = Object3DEventMap & {
41
+ 'object-transform': DIVEEntityTransformEvent;
42
+ 'object-select': DIVEEntityBareEvent;
43
+ 'object-deselect': DIVEEntityBareEvent;
44
+ componentadded: DIVENodeComponentEvent;
45
+ componentremoved: DIVENodeComponentEvent;
46
+ };
47
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './DIVEComponentEventMap.ts';
2
+ export * from './DIVEEntityEventMap.ts';
@@ -1,4 +1,4 @@
1
- import { GeometryTypeSchema } from './GeometryTypeSchema.ts';
1
+ import { DIVEGeometryType } from './DIVEGeometryType.ts';
2
2
  /**
3
3
  * Describes the shape of a primitive.
4
4
  *
@@ -7,9 +7,9 @@ import { GeometryTypeSchema } from './GeometryTypeSchema.ts';
7
7
  * radius from `width` alone and ignores the other two, while a box uses all
8
8
  * three.
9
9
  */
10
- export type GeometrySchema = {
11
- /** Picks the shape to build, see {@link GeometryTypeSchema}. */
12
- name: GeometryTypeSchema;
10
+ export type DIVEGeometry = {
11
+ /** Picks the shape to build, see {@link DIVEGeometryType}. */
12
+ name: DIVEGeometryType;
13
13
  width: number;
14
14
  height: number;
15
15
  depth: number;
@@ -4,4 +4,4 @@
4
4
  * `cube` and `box` build the same geometry. An unknown value is not an error,
5
5
  * it only warns and leaves the primitive without a mesh.
6
6
  */
7
- export type GeometryTypeSchema = 'cylinder' | 'sphere' | 'pyramid' | 'cube' | 'box' | 'cone' | 'wall' | 'plane';
7
+ export type DIVEGeometryType = 'cylinder' | 'sphere' | 'pyramid' | 'cube' | 'box' | 'cone' | 'wall' | 'plane';
@@ -0,0 +1,2 @@
1
+ export * from './DIVEGeometry.ts';
2
+ export * from './DIVEGeometryType.ts';
@@ -1,3 +1,5 @@
1
1
  export * from './components/index.ts';
2
+ export * from './events/index.ts';
2
3
  export * from './file/index.ts';
3
- export * from './schema/index.ts';
4
+ export * from './geometry/index.ts';
5
+ export * from './material/index.ts';
@@ -8,7 +8,7 @@ import { Texture } from 'three/webgpu';
8
8
  *
9
9
  * The `null` on the texture slots means "no texture", not "unchanged".
10
10
  */
11
- export type MaterialSchema = {
11
+ export type DIVEMaterial = {
12
12
  vertexColors: boolean;
13
13
  color: string | number;
14
14
  /** The base colour texture. */
@@ -0,0 +1 @@
1
+ export * from './DIVEMaterial.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/dive",
3
- "version": "3.1.0",
3
+ "version": "4.0.1",
4
4
  "description": "Shopware Spatial Framework",
5
5
  "type": "module",
6
6
  "main": "build/dive.cjs",
@@ -107,7 +107,7 @@
107
107
  "> 1%, not dead, not ie 11, not op_mini all"
108
108
  ],
109
109
  "dependencies": {
110
- "three": "^0.185.1",
110
+ "three": "^0.186.0",
111
111
  "@tweenjs/tween.js": "^25.0.0",
112
112
  "lodash": "^4.18.1",
113
113
  "occt-import-js": "^0.0.23"
@@ -119,7 +119,7 @@
119
119
  "@types/lodash": "^4.17.12",
120
120
  "@types/node": "^20.12.7",
121
121
  "@types/three": "^0.185.1",
122
- "@vitest/coverage-v8": "3.2.7",
122
+ "@vitest/coverage-v8": "^4.1.11",
123
123
  "acorn": "^8.14.1",
124
124
  "acorn-walk": "^8.3.4",
125
125
  "chokidar": "^3.6.0",
@@ -141,13 +141,14 @@
141
141
  "vite-plugin-dts": "^4.5.3",
142
142
  "vite-plugin-wasm": "^3.4.1",
143
143
  "vite-tsconfig-paths": "^5.1.4",
144
- "vitest": "^3.1.2"
144
+ "vitest": "^4.1.11"
145
145
  },
146
146
  "resolutions": {
147
+ "vite": "^6.2.1",
147
148
  "lodash": "4.18.1",
148
149
  "vite-plugin-dts/@microsoft/api-extractor/minimatch": "3.1.5",
149
150
  "minimatch/brace-expansion": "1.1.16",
150
- "fast-uri": "^3.1.5"
151
+ "fast-uri": "^3.1.7"
151
152
  },
152
153
  "scripts": {
153
154
  "build": "vite build",
@@ -1,70 +0,0 @@
1
- var i = Object.defineProperty;
2
- var f = (s, r, e) => r in s ? i(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
- var n = (s, r, e) => f(s, typeof r != "symbol" ? r + "" : r, e);
4
- import { Mesh as p } from "three/webgpu";
5
- import { GLTFExporter as c } from "three/examples/jsm/exporters/GLTFExporter.js";
6
- import { USDZExporter as x } from "three/examples/jsm/exporters/USDZExporter.js";
7
- import { F as u, P as o } from "./parse-error-DfOPyLWM.mjs";
8
- class E {
9
- constructor() {
10
- n(this, "_gltfExporter");
11
- n(this, "_usdzExporter");
12
- this._gltfExporter = new c(), this._usdzExporter = new x();
13
- }
14
- async export(r, e, t) {
15
- switch (this._computeNormals(r), e) {
16
- case "glb":
17
- return this._exportGlb(r, t);
18
- case "gltf":
19
- return this._exportGltf(r, t);
20
- case "usdz":
21
- return this._exportUsdz(
22
- r,
23
- t
24
- );
25
- default:
26
- throw new u(`Unsupported file type: ${e}`, e);
27
- }
28
- }
29
- async _exportGlb(r, e) {
30
- try {
31
- const t = await this._gltfExporter.parseAsync(r, {
32
- animations: r.animations.length > 0 ? r.animations : void 0,
33
- ...e,
34
- binary: !0
35
- });
36
- if (t instanceof ArrayBuffer)
37
- return t;
38
- throw new o("Failed to export GLB: expected ArrayBuffer");
39
- } catch (t) {
40
- throw t instanceof o ? t : new o("Failed to export GLB", t);
41
- }
42
- }
43
- async _exportGltf(r, e) {
44
- try {
45
- const t = await this._gltfExporter.parseAsync(r, {
46
- animations: r.animations || [],
47
- ...e,
48
- binary: !1
49
- }), a = JSON.stringify(t);
50
- return new TextEncoder().encode(a).buffer;
51
- } catch (t) {
52
- throw t instanceof o ? t : new o("Failed to export GLTF", t);
53
- }
54
- }
55
- async _exportUsdz(r, e) {
56
- try {
57
- return (await this._usdzExporter.parseAsync(r, e)).buffer;
58
- } catch (t) {
59
- throw t instanceof o ? t : new o("Failed to export USDZ", t);
60
- }
61
- }
62
- _computeNormals(r) {
63
- r.traverse((e) => {
64
- e instanceof p && e.geometry && (e.geometry.getAttribute("normal") || e.geometry.computeVertexNormals());
65
- });
66
- }
67
- }
68
- export {
69
- E as A
70
- };
@@ -1 +0,0 @@
1
- "use strict";var i=Object.defineProperty;var c=(o,r,t)=>r in o?i(o,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[r]=t;var n=(o,r,t)=>c(o,typeof r!="symbol"?r+"":r,t);const p=require("three/webgpu"),u=require("three/examples/jsm/exporters/GLTFExporter.js"),f=require("three/examples/jsm/exporters/USDZExporter.js"),s=require("./parse-error-Dy_EE4rL.cjs");class x{constructor(){n(this,"_gltfExporter");n(this,"_usdzExporter");this._gltfExporter=new u.GLTFExporter,this._usdzExporter=new f.USDZExporter}async export(r,t,e){switch(this._computeNormals(r),t){case"glb":return this._exportGlb(r,e);case"gltf":return this._exportGltf(r,e);case"usdz":return this._exportUsdz(r,e);default:throw new s.FileTypeError(`Unsupported file type: ${t}`,t)}}async _exportGlb(r,t){try{const e=await this._gltfExporter.parseAsync(r,{animations:r.animations.length>0?r.animations:void 0,...t,binary:!0});if(e instanceof ArrayBuffer)return e;throw new s.ParseError("Failed to export GLB: expected ArrayBuffer")}catch(e){throw e instanceof s.ParseError?e:new s.ParseError("Failed to export GLB",e)}}async _exportGltf(r,t){try{const e=await this._gltfExporter.parseAsync(r,{animations:r.animations||[],...t,binary:!1}),a=JSON.stringify(e);return new TextEncoder().encode(a).buffer}catch(e){throw e instanceof s.ParseError?e:new s.ParseError("Failed to export GLTF",e)}}async _exportUsdz(r,t){try{return(await this._usdzExporter.parseAsync(r,t)).buffer}catch(e){throw e instanceof s.ParseError?e:new s.ParseError("Failed to export USDZ",e)}}_computeNormals(r){r.traverse(t=>{t instanceof p.Mesh&&t.geometry&&(t.geometry.getAttribute("normal")||t.geometry.computeVertexNormals())})}}exports.AssetExporter=x;
@@ -1,10 +0,0 @@
1
- function a(e) {
2
- return e.entityType === "model";
3
- }
4
- function t(e) {
5
- return e.entityType === "camera";
6
- }
7
- export {
8
- a,
9
- t as i
10
- };
@@ -1 +0,0 @@
1
- "use strict";function a(e){return e.entityType==="model"}function t(e){return e.entityType==="camera"}exports.isCameraSchema=t;exports.isModelSchema=a;