@shopware-ag/dive 1.16.1 → 1.16.2

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 (35) hide show
  1. package/README.md +226 -32
  2. package/build/dive.cjs +14 -6
  3. package/build/dive.cjs.map +1 -1
  4. package/build/dive.d.cts +28 -2
  5. package/build/dive.d.ts +28 -2
  6. package/build/dive.js +14 -6
  7. package/build/dive.js.map +1 -1
  8. package/package.json +14 -6
  9. package/src/com/actions/camera/computeencompassingview.ts +1 -0
  10. package/src/com/actions/camera/getcameratransform.ts +1 -0
  11. package/src/com/actions/camera/movecamera.ts +1 -0
  12. package/src/com/actions/camera/resetcamera.ts +1 -0
  13. package/src/com/actions/camera/setcameralayer.ts +1 -0
  14. package/src/com/actions/camera/setcameratransform.ts +1 -0
  15. package/src/com/actions/camera/zoomcamera.ts +1 -0
  16. package/src/com/actions/index.ts +2 -2
  17. package/src/com/actions/media/generatemedia.ts +1 -0
  18. package/src/com/actions/object/addobject.ts +1 -0
  19. package/src/com/actions/object/deleteobject.ts +1 -0
  20. package/src/com/actions/object/deselectobject.ts +1 -0
  21. package/src/com/actions/object/getallobjects.ts +1 -0
  22. package/src/com/actions/object/getobjects.ts +1 -0
  23. package/src/com/actions/object/model/dropit.ts +1 -0
  24. package/src/com/actions/object/model/modelloaded.ts +1 -0
  25. package/src/com/actions/object/model/placeonfloor.ts +1 -0
  26. package/src/com/actions/object/selectobject.ts +1 -0
  27. package/src/com/actions/object/setparent.ts +1 -0
  28. package/src/com/actions/object/updateobject.ts +1 -0
  29. package/src/com/actions/scene/exportscene.ts +1 -0
  30. package/src/com/actions/scene/getallscenedata.ts +1 -0
  31. package/src/com/actions/scene/setbackground.ts +1 -0
  32. package/src/com/actions/scene/updatescene.ts +1 -0
  33. package/src/com/actions/toolbox/select/setgizmomode.ts +1 -0
  34. package/src/com/actions/toolbox/transform/setgizmovisible.ts +1 -0
  35. package/src/com/actions/toolbox/usetool.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware-ag/dive",
3
- "version": "1.16.1",
3
+ "version": "1.16.2",
4
4
  "description": "Shopware Spatial Framework",
5
5
  "type": "module",
6
6
  "main": "./build/dive.cjs",
@@ -49,18 +49,26 @@
49
49
  "prettier-plugin-multiline-arrays": "^3.0.6",
50
50
  "ts-jest": "^29.1.2",
51
51
  "ts-node": "^10.9.2",
52
+ "tsc": "^2.0.4",
52
53
  "tsup": "^8.0.2",
53
54
  "typescript": "^5.4.5",
54
55
  "typescript-eslint": "^7.7.1"
55
56
  },
56
57
  "scripts": {
57
- "build": "tsup && yarn genmd",
58
- "watch": "tsup --watch",
58
+ "build": "tsup",
59
+ "dev": "tsup --watch",
59
60
  "lint": "eslint",
60
- "prettier-check": "prettier --check .",
61
- "prettier-fix": "prettier --write .",
61
+ "lint:actions": "yarn lint:actions:transpile && yarn lint:actions:check && yarn lint:actions:cleanup",
62
+ "lint:actions:transpile": "yarn tsc --resolveJsonModule --esModuleInterop ci/lint/lint-actions.ts && mv ci/lint/lint-actions.js ci/lint/lint-actions.cjs",
63
+ "lint:actions:check": "yarn node ci/lint/lint-actions.cjs",
64
+ "lint:actions:cleanup": "node -e \"require('fs').unlinkSync('ci/lint/lint-actions.cjs')\"",
65
+ "prettier:check": "prettier --check .",
66
+ "prettier:fix": "prettier --write .",
62
67
  "unit": "jest",
63
68
  "coverage": "jest --coverage",
64
- "genmd": "node ./scripts/genmd.js"
69
+ "generate-readme": "yarn generate-readme:transpile && yarn generate-readme:write && yarn generate-readme:cleanup",
70
+ "generate-readme:transpile": "yarn tsc --resolveJsonModule --esModuleInterop ci/readme/generate-readme.ts && mv ci/readme/generate-readme.js ci/readme/generate-readme.cjs",
71
+ "generate-readme:write": "node ci/readme/generate-readme.cjs",
72
+ "generate-readme:cleanup": "node -e \"require('fs').unlinkSync('ci/readme/generate-readme.cjs')\""
65
73
  }
66
74
  }
@@ -1,6 +1,7 @@
1
1
  import { Vector3Like } from 'three';
2
2
 
3
3
  export default interface COMPUTE_ENCOMPASSING_VIEW {
4
+ DESCRIPTION: 'Calculates the camera position and target to view the whole scene. (experimental)';
4
5
  PAYLOAD: object;
5
6
  RETURN: {
6
7
  position: Vector3Like;
@@ -1,6 +1,7 @@
1
1
  import { Vector3Like } from 'three';
2
2
 
3
3
  export default interface GET_CAMERA_TRANSFORM {
4
+ DESCRIPTION: 'Returns the current camera position and target.';
4
5
  PAYLOAD: object;
5
6
  RETURN: {
6
7
  position: Vector3Like;
@@ -1,6 +1,7 @@
1
1
  import { Vector3Like } from 'three';
2
2
 
3
3
  export default interface MOVE_CAMERA {
4
+ DESCRIPTION: 'Moves the camera to a new position and target.';
4
5
  PAYLOAD:
5
6
  | {
6
7
  position: Vector3Like;
@@ -1,4 +1,5 @@
1
1
  export default interface RESET_CAMERA {
2
+ DESCRIPTION: 'Reset the camera to its initial position and rotation.';
2
3
  PAYLOAD: { duration: number };
3
4
  RETURN: boolean;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  export default interface SET_CAMERA_LAYER {
2
+ DESCRIPTION: 'Sets the camera layer to a certain layer.';
2
3
  PAYLOAD: { layer: 'LIVE' | 'EDITOR' };
3
4
  RETURN: boolean;
4
5
  }
@@ -1,6 +1,7 @@
1
1
  import { Vector3Like } from 'three';
2
2
 
3
3
  export default interface SET_CAMERA_TRANSFORM {
4
+ DESCRIPTION: 'Sets the camera position and target.';
4
5
  PAYLOAD: {
5
6
  position: Vector3Like;
6
7
  target: Vector3Like;
@@ -1,4 +1,5 @@
1
1
  export default interface ZOOM_CAMERA {
2
+ DESCRIPTION: 'Zooms the camera in or out by a certain amount.';
2
3
  PAYLOAD: { direction: 'IN' | 'OUT'; by: number };
3
4
  RETURN: boolean;
4
5
  }
@@ -25,7 +25,7 @@ import USE_TOOL from './toolbox/usetool.ts';
25
25
  import SET_PARENT from './object/setparent.ts';
26
26
  import EXPORT_SCENE from './scene/exportscene.ts';
27
27
 
28
- export type Actions = {
28
+ export interface Actions {
29
29
  GET_ALL_SCENE_DATA: GET_ALL_SCENE_DATA;
30
30
  GET_ALL_OBJECTS: GET_ALL_OBJECTS;
31
31
  GET_OBJECTS: GET_OBJECTS;
@@ -52,4 +52,4 @@ export type Actions = {
52
52
  GENERATE_MEDIA: GENERATE_MEDIA;
53
53
  SET_PARENT: SET_PARENT;
54
54
  EXPORT_SCENE: EXPORT_SCENE;
55
- };
55
+ }
@@ -1,6 +1,7 @@
1
1
  import { Vector3Like } from 'three';
2
2
 
3
3
  export default interface GENERATE_MEDIA {
4
+ DESCRIPTION: 'Generates a screenshot, stores it in a Blob and writes the URL into the payload.';
4
5
  PAYLOAD: (
5
6
  | {
6
7
  position: Vector3Like;
@@ -1,6 +1,7 @@
1
1
  import { COMEntity } from '../../types';
2
2
 
3
3
  export default interface ADD_OBJECT {
4
+ DESCRIPTION: 'Adds an object to the scene.';
4
5
  PAYLOAD: COMEntity;
5
6
  RETURN: boolean;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { COMEntity } from '../../types';
2
2
 
3
3
  export default interface DELETE_OBJECT {
4
+ DESCRIPTION: 'Deletes an object from the scene.';
4
5
  PAYLOAD: Partial<COMEntity> & { id: string };
5
6
  RETURN: boolean;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { COMEntity } from '../../types';
2
2
 
3
3
  export default interface DESELECT_OBJECT {
4
+ DESCRIPTION: 'Deselects an existing object.';
4
5
  PAYLOAD: Partial<COMEntity> & { id: string };
5
6
  RETURN: boolean;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { COMEntity } from '../../types';
2
2
 
3
3
  export default interface GET_ALL_OBJECTS {
4
+ readonly DESCRIPTION: 'Retrieves all objects in the scene.';
4
5
  PAYLOAD: Map<string, COMEntity>;
5
6
  RETURN: Map<string, COMEntity>;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { COMEntity } from '../../types';
2
2
 
3
3
  export default interface GET_OBJECTS {
4
+ DESCRIPTION: 'Returns a list of objects of given IDs.';
4
5
  PAYLOAD: { ids: string[] };
5
6
  RETURN: COMEntity[];
6
7
  }
@@ -1,4 +1,5 @@
1
1
  export default interface DROP_IT {
2
+ DESCRIPTION: 'Places an object on top of an underlying object or the floor.';
2
3
  PAYLOAD: { id: string };
3
4
  RETURN: boolean;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  export default interface MODEL_LOADED {
2
+ DESCRIPTION: 'Is triggered when a model is loaded.';
2
3
  PAYLOAD: { id: string };
3
4
  RETURN: boolean;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  export default interface PLACE_ON_FLOOR {
2
+ DESCRIPTION: 'Places an object on the floor.';
2
3
  PAYLOAD: { id: string };
3
4
  RETURN: boolean;
4
5
  }
@@ -1,6 +1,7 @@
1
1
  import { COMEntity } from '../../types';
2
2
 
3
3
  export default interface SELECT_OBJECT {
4
+ DESCRIPTION: 'Selects an existing object.';
4
5
  PAYLOAD: Partial<COMEntity> & { id: string };
5
6
  RETURN: boolean;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { type COMEntity } from '../../types';
2
2
 
3
3
  export default interface SET_PARENT {
4
+ DESCRIPTION: 'Attach an object to another object.';
4
5
  PAYLOAD: {
5
6
  object: Partial<COMEntity> & { id: string };
6
7
  parent: (Partial<COMEntity> & { id: string }) | null;
@@ -1,6 +1,7 @@
1
1
  import { COMEntity } from '../../types';
2
2
 
3
3
  export default interface UPDATE_OBJECT {
4
+ DESCRIPTION: 'Updates an existing object.';
4
5
  PAYLOAD: Partial<COMEntity> & { id: string };
5
6
  RETURN: boolean;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { type DIVESceneFileType } from '../../../types';
2
2
 
3
3
  export default interface EXPORT_SCENE {
4
+ DESCRIPTION: 'Exports the current scene to a blob and returns the URL.';
4
5
  PAYLOAD: { type: keyof DIVESceneFileType };
5
6
  RETURN: Promise<string | null>;
6
7
  }
@@ -24,6 +24,7 @@ type SceneData = {
24
24
  };
25
25
 
26
26
  export default interface GET_ALL_SCENE_DATA {
27
+ DESCRIPTION: 'Retrieves all current scene data.';
27
28
  PAYLOAD: object;
28
29
  RETURN: SceneData;
29
30
  }
@@ -1,4 +1,5 @@
1
1
  export default interface SET_BACKGROUND {
2
+ DESCRIPTION: 'Set the background color of the scene.';
2
3
  PAYLOAD: { color: string | number };
3
4
  RETURN: boolean;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  export default interface UPDATE_SCENE {
2
+ DESCRIPTION: 'Updates global scene data.';
2
3
  PAYLOAD: {
3
4
  name?: string;
4
5
  backgroundColor?: string | number;
@@ -1,4 +1,5 @@
1
1
  export default interface SET_GIZMO_MODE {
2
+ DESCRIPTION: "Sets the gizmo's mode.";
2
3
  PAYLOAD: { mode: 'translate' | 'rotate' | 'scale' };
3
4
  RETURN: boolean;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  export default interface SET_GIZMO_VISIBILITY {
2
+ DESCRIPTION: "Sets the gizmo's visibility.";
2
3
  PAYLOAD: boolean;
3
4
  RETURN: boolean;
4
5
  }
@@ -1,6 +1,7 @@
1
1
  import { type ToolType } from '../../../toolbox/Toolbox';
2
2
 
3
3
  export default interface USE_TOOL {
4
+ DESCRIPTION: 'Activates a specific tool from the toolbox.';
4
5
  PAYLOAD: { tool: ToolType };
5
6
  RETURN: boolean;
6
7
  }