@shopware-ag/dive 2.0.1-beta.0 → 2.0.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.
- package/build/chunks/{SelectTool-BRKko7uz.cjs → SelectTool-BAXTVyWs.cjs} +1 -1
- package/build/chunks/{SelectTool-mTRiZYaC.mjs → SelectTool-Bd8cC9nb.mjs} +15 -15
- package/build/chunks/{package-BvoZkrge.mjs → package-BHjZWYD6.mjs} +1 -1
- package/build/chunks/{package-BFpY3sIj.cjs → package-JHvTSNgQ.cjs} +1 -1
- package/build/dive.cjs +2 -2
- package/build/dive.mjs +471 -565
- package/build/src/components/floor/Floor.d.ts +2 -2
- package/build/src/components/grid/Grid.d.ts +1 -1
- package/build/src/components/light/AmbientLight.d.ts +3 -3
- package/build/src/components/light/PointLight.d.ts +3 -3
- package/build/src/components/light/SceneLight.d.ts +3 -3
- package/build/src/components/model/Model.d.ts +7 -4
- package/build/src/components/node/Node.d.ts +2 -2
- package/build/src/components/primitive/Primitive.d.ts +3 -3
- package/build/src/components/root/Root.d.ts +19 -29
- package/build/src/core/Dive.d.ts +4 -4
- package/build/src/engine/Engine.d.ts +2 -6
- package/build/src/engine/scene/Scene.d.ts +4 -22
- package/build/src/modules/asset/draco/README.md +32 -0
- package/build/src/modules/asset/draco/draco_decoder.js +33 -0
- package/build/src/modules/asset/draco/draco_decoder.wasm +0 -0
- package/build/src/modules/asset/draco/draco_encoder.js +33 -0
- package/build/src/modules/asset/draco/draco_wasm_wrapper.js +116 -0
- package/build/src/modules/asset/draco/gltf/draco_decoder.js +33 -0
- package/build/src/modules/asset/draco/gltf/draco_decoder.wasm +0 -0
- package/build/src/modules/asset/draco/gltf/draco_encoder.js +33 -0
- package/build/src/modules/asset/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/build/src/modules/asset/loader/AssetLoader.cjs +3 -2
- package/build/src/modules/asset/loader/AssetLoader.mjs +1274 -1039
- package/build/src/modules/state/State.cjs +9 -9
- package/build/src/modules/state/State.mjs +579 -554
- package/build/src/modules/state/actions/camera/movecamera.d.ts +2 -2
- package/build/src/modules/state/actions/object/addobject.d.ts +1 -1
- package/build/src/modules/state/actions/object/deleteobject.d.ts +2 -2
- package/build/src/modules/state/actions/object/deselectobject.d.ts +2 -2
- package/build/src/modules/state/actions/object/dropit.d.ts +2 -2
- package/build/src/modules/state/actions/object/getobjects.d.ts +2 -2
- package/build/src/modules/state/actions/object/placeonfloor.d.ts +2 -2
- package/build/src/modules/state/actions/object/selectobject.d.ts +2 -2
- package/build/src/modules/state/actions/object/setparent.d.ts +2 -2
- package/build/src/modules/state/actions/object/updateobject.d.ts +2 -2
- package/build/src/modules/state/actions/scene/getallscenedata.d.ts +1 -1
- package/build/src/modules/state/types/COMEntity.d.ts +5 -0
- package/build/src/modules/state/types/COMGroup.d.ts +1 -0
- package/build/src/modules/state/types/COMLight.d.ts +18 -2
- package/build/src/modules/state/types/COMModel.d.ts +1 -0
- package/build/src/modules/state/types/COMPov.d.ts +1 -0
- package/build/src/modules/state/types/COMPrimitive.d.ts +1 -0
- package/build/src/modules/toolbox/Toolbox.cjs +1 -1
- package/build/src/modules/toolbox/Toolbox.mjs +1 -1
- package/build/src/types/SceneObjects.d.ts +3 -1
- package/package.json +2 -1
|
@@ -10,7 +10,7 @@ export declare const MoveCameraAction: new (payload: {
|
|
|
10
10
|
id: string;
|
|
11
11
|
locked: boolean;
|
|
12
12
|
duration: number;
|
|
13
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
13
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered" | "controller" | "getAnimationSystem">) => Action<{
|
|
14
14
|
position: Vector3Like;
|
|
15
15
|
target: Vector3Like;
|
|
16
16
|
locked: boolean;
|
|
@@ -19,7 +19,7 @@ export declare const MoveCameraAction: new (payload: {
|
|
|
19
19
|
id: string;
|
|
20
20
|
locked: boolean;
|
|
21
21
|
duration: number;
|
|
22
|
-
}, Pick<ActionDependencies, "
|
|
22
|
+
}, Pick<ActionDependencies, "engine" | "registered" | "controller" | "getAnimationSystem">, Promise<{
|
|
23
23
|
stop: () => void;
|
|
24
24
|
}>>;
|
|
25
25
|
declare global {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '../action.ts';
|
|
2
2
|
import { ActionDependencies, COMEntity } from '../../types/index.ts';
|
|
3
|
-
export declare const AddObjectAction: new (payload: COMEntity, dependencies: Pick<ActionDependencies, "
|
|
3
|
+
export declare const AddObjectAction: new (payload: COMEntity, dependencies: Pick<ActionDependencies, "engine" | "registered">) => Action<COMEntity, Pick<ActionDependencies, "engine" | "registered">, void>;
|
|
4
4
|
declare global {
|
|
5
5
|
interface ActionTypes {
|
|
6
6
|
ADD_OBJECT: typeof AddObjectAction;
|
|
@@ -2,9 +2,9 @@ import { Action } from '../action.ts';
|
|
|
2
2
|
import { ActionDependencies, COMEntity } from '../../types/index.ts';
|
|
3
3
|
export declare const DeleteObjectAction: new (payload: Partial<COMEntity> & {
|
|
4
4
|
id: string;
|
|
5
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
5
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered">) => Action<Partial<COMEntity> & {
|
|
6
6
|
id: string;
|
|
7
|
-
}, Pick<ActionDependencies, "
|
|
7
|
+
}, Pick<ActionDependencies, "engine" | "registered">, void>;
|
|
8
8
|
declare global {
|
|
9
9
|
interface ActionTypes {
|
|
10
10
|
DELETE_OBJECT: typeof DeleteObjectAction;
|
|
@@ -2,9 +2,9 @@ import { Action } from '../action.ts';
|
|
|
2
2
|
import { ActionDependencies, COMEntity } from '../../types/index.ts';
|
|
3
3
|
export declare const DeselectObjectAction: new (payload: Partial<COMEntity> & {
|
|
4
4
|
id: string;
|
|
5
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
5
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered" | "getToolbox">) => Action<Partial<COMEntity> & {
|
|
6
6
|
id: string;
|
|
7
|
-
}, Pick<ActionDependencies, "
|
|
7
|
+
}, Pick<ActionDependencies, "engine" | "registered" | "getToolbox">, Promise<void>>;
|
|
8
8
|
declare global {
|
|
9
9
|
interface ActionTypes {
|
|
10
10
|
DESELECT_OBJECT: typeof DeselectObjectAction;
|
|
@@ -2,9 +2,9 @@ import { Action } from '../action.ts';
|
|
|
2
2
|
import { ActionDependencies } from '../../types/index.ts';
|
|
3
3
|
export declare const DropItAction: new (payload: {
|
|
4
4
|
id: string;
|
|
5
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
5
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered">) => Action<{
|
|
6
6
|
id: string;
|
|
7
|
-
}, Pick<ActionDependencies, "
|
|
7
|
+
}, Pick<ActionDependencies, "engine" | "registered">, void>;
|
|
8
8
|
declare global {
|
|
9
9
|
interface ActionTypes {
|
|
10
10
|
DROP_IT: typeof DropItAction;
|
|
@@ -2,9 +2,9 @@ import { Action } from '../action.ts';
|
|
|
2
2
|
import { ActionDependencies, COMEntity } from '../../types/index.ts';
|
|
3
3
|
export declare const GetObjectsAction: new (payload: {
|
|
4
4
|
ids: string[];
|
|
5
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
5
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered">) => Action<{
|
|
6
6
|
ids: string[];
|
|
7
|
-
}, Pick<ActionDependencies, "
|
|
7
|
+
}, Pick<ActionDependencies, "engine" | "registered">, COMEntity[]>;
|
|
8
8
|
declare global {
|
|
9
9
|
interface ActionTypes {
|
|
10
10
|
GET_OBJECTS: typeof GetObjectsAction;
|
|
@@ -2,9 +2,9 @@ import { Action } from '../action.ts';
|
|
|
2
2
|
import { ActionDependencies } from '../../types/index.ts';
|
|
3
3
|
export declare const PlaceOnFloorAction: new (payload: {
|
|
4
4
|
id: string;
|
|
5
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
5
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered">) => Action<{
|
|
6
6
|
id: string;
|
|
7
|
-
}, Pick<ActionDependencies, "
|
|
7
|
+
}, Pick<ActionDependencies, "engine" | "registered">, void>;
|
|
8
8
|
declare global {
|
|
9
9
|
interface ActionTypes {
|
|
10
10
|
PLACE_ON_FLOOR: typeof PlaceOnFloorAction;
|
|
@@ -2,9 +2,9 @@ import { Action } from '../action.ts';
|
|
|
2
2
|
import { ActionDependencies, COMEntity } from '../../types/index.ts';
|
|
3
3
|
export declare const SelectObjectAction: new (payload: Partial<COMEntity> & {
|
|
4
4
|
id: string;
|
|
5
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
5
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered" | "getToolbox">) => Action<Partial<COMEntity> & {
|
|
6
6
|
id: string;
|
|
7
|
-
}, Pick<ActionDependencies, "
|
|
7
|
+
}, Pick<ActionDependencies, "engine" | "registered" | "getToolbox">, Promise<void>>;
|
|
8
8
|
declare global {
|
|
9
9
|
interface ActionTypes {
|
|
10
10
|
SELECT_OBJECT: typeof SelectObjectAction;
|
|
@@ -7,14 +7,14 @@ export declare const SetParentAction: new (payload: {
|
|
|
7
7
|
parent: (Partial<COMEntity> & {
|
|
8
8
|
id: string;
|
|
9
9
|
}) | null;
|
|
10
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
10
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered">) => Action<{
|
|
11
11
|
object: Partial<COMEntity> & {
|
|
12
12
|
id: string;
|
|
13
13
|
};
|
|
14
14
|
parent: (Partial<COMEntity> & {
|
|
15
15
|
id: string;
|
|
16
16
|
}) | null;
|
|
17
|
-
}, Pick<ActionDependencies, "
|
|
17
|
+
}, Pick<ActionDependencies, "engine" | "registered">, void>;
|
|
18
18
|
declare global {
|
|
19
19
|
interface ActionTypes {
|
|
20
20
|
SET_PARENT: typeof SetParentAction;
|
|
@@ -2,9 +2,9 @@ import { Action } from '../action.ts';
|
|
|
2
2
|
import { ActionDependencies, COMEntity } from '../../types/index.ts';
|
|
3
3
|
export declare const UpdateObjectAction: new (payload: Partial<COMEntity> & {
|
|
4
4
|
id: string;
|
|
5
|
-
}, dependencies: Pick<ActionDependencies, "
|
|
5
|
+
}, dependencies: Pick<ActionDependencies, "engine" | "registered">) => Action<Partial<COMEntity> & {
|
|
6
6
|
id: string;
|
|
7
|
-
}, Pick<ActionDependencies, "
|
|
7
|
+
}, Pick<ActionDependencies, "engine" | "registered">, void>;
|
|
8
8
|
declare global {
|
|
9
9
|
interface ActionTypes {
|
|
10
10
|
UPDATE_OBJECT: typeof UpdateObjectAction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Action } from '../action.ts';
|
|
2
2
|
import { ActionDependencies } from '../../types/index.ts';
|
|
3
3
|
import { DIVESceneData } from '../../../../types/index.ts';
|
|
4
|
-
export declare const GetAllSceneDataAction: new (payload: object, dependencies: Pick<ActionDependencies, "
|
|
4
|
+
export declare const GetAllSceneDataAction: new (payload: object, dependencies: Pick<ActionDependencies, "engine" | "registered" | "controller">) => Action<object, Pick<ActionDependencies, "engine" | "registered" | "controller">, DIVESceneData>;
|
|
5
5
|
declare global {
|
|
6
6
|
interface ActionTypes {
|
|
7
7
|
GET_ALL_SCENE_DATA: typeof GetAllSceneDataAction;
|
|
@@ -3,4 +3,9 @@ import { COMLight } from './COMLight.ts';
|
|
|
3
3
|
import { COMModel } from './COMModel.ts';
|
|
4
4
|
import { COMPrimitive } from './COMPrimitive.ts';
|
|
5
5
|
import { COMGroup } from './COMGroup.ts';
|
|
6
|
+
export type COMMinimal<T extends COMEntity> = T extends COMEntity ? {
|
|
7
|
+
id: string;
|
|
8
|
+
entityType: T['entityType'];
|
|
9
|
+
} : never;
|
|
10
|
+
export type COMPartial<T extends COMEntity | void = void> = T extends COMEntity ? COMMinimal<T> & Partial<T> : COMMinimal<COMEntity> & Partial<COMEntity>;
|
|
6
11
|
export type COMEntity = COMPov | COMLight | COMModel | COMPrimitive | COMGroup;
|
|
@@ -3,6 +3,7 @@ import { COMBaseEntity } from './COMBaseEntity.ts';
|
|
|
3
3
|
import { COMEntity } from './COMEntity.ts';
|
|
4
4
|
export declare function isCOMGroup(entity: COMEntity): entity is COMGroup;
|
|
5
5
|
export type COMGroup = COMBaseEntity & {
|
|
6
|
+
entityType: 'group';
|
|
6
7
|
position: Vector3Like;
|
|
7
8
|
rotation: Vector3Like;
|
|
8
9
|
scale: Vector3Like;
|
|
@@ -2,11 +2,27 @@ import { Vector3Like } from 'three';
|
|
|
2
2
|
import { COMBaseEntity } from './COMBaseEntity.ts';
|
|
3
3
|
import { COMEntity } from './COMEntity.ts';
|
|
4
4
|
export declare function isCOMLight(entity: COMEntity): entity is COMLight;
|
|
5
|
-
export type
|
|
6
|
-
type:
|
|
5
|
+
export type COMBaseLight = COMBaseEntity & {
|
|
6
|
+
type: LightType;
|
|
7
7
|
intensity: number;
|
|
8
8
|
color: string | number;
|
|
9
9
|
enabled: boolean;
|
|
10
10
|
position?: Vector3Like;
|
|
11
11
|
rotation?: Vector3Like;
|
|
12
12
|
};
|
|
13
|
+
export type COMAmbientLight = COMBaseLight & {
|
|
14
|
+
entityType: 'light';
|
|
15
|
+
type: 'ambient';
|
|
16
|
+
};
|
|
17
|
+
export type COMPointLight = COMBaseLight & {
|
|
18
|
+
entityType: 'light';
|
|
19
|
+
type: 'point';
|
|
20
|
+
position: Vector3Like;
|
|
21
|
+
};
|
|
22
|
+
export type COMSceneLight = COMBaseLight & {
|
|
23
|
+
entityType: 'light';
|
|
24
|
+
type: 'scene';
|
|
25
|
+
};
|
|
26
|
+
type LightType = 'ambient' | 'point' | 'scene';
|
|
27
|
+
export type COMLight = COMAmbientLight | COMPointLight | COMSceneLight;
|
|
28
|
+
export {};
|
|
@@ -4,6 +4,7 @@ import { COMBaseEntity } from './COMBaseEntity.ts';
|
|
|
4
4
|
import { COMEntity } from './COMEntity.ts';
|
|
5
5
|
export declare function isCOMModel(entity: COMEntity): entity is COMModel;
|
|
6
6
|
export type COMModel = COMBaseEntity & {
|
|
7
|
+
entityType: 'model';
|
|
7
8
|
uri: string;
|
|
8
9
|
position: Vector3Like;
|
|
9
10
|
rotation: Vector3Like;
|
|
@@ -3,6 +3,7 @@ import { COMBaseEntity } from './COMBaseEntity.ts';
|
|
|
3
3
|
import { COMEntity } from './COMEntity.ts';
|
|
4
4
|
export declare function isCOMPov(entity: COMEntity): entity is COMPov;
|
|
5
5
|
export type COMPov = COMBaseEntity & {
|
|
6
|
+
entityType: 'pov';
|
|
6
7
|
position: Vector3Like;
|
|
7
8
|
target: Vector3Like;
|
|
8
9
|
locked?: boolean;
|
|
@@ -5,6 +5,7 @@ import { COMMaterial } from './COMMaterial.ts';
|
|
|
5
5
|
import { COMEntity } from './COMEntity.ts';
|
|
6
6
|
export declare function isCOMPrimitive(entity: COMEntity): entity is COMPrimitive;
|
|
7
7
|
export type COMPrimitive = COMBaseEntity & {
|
|
8
|
+
entityType: 'primitive';
|
|
8
9
|
position: Vector3Like;
|
|
9
10
|
rotation: Vector3Like;
|
|
10
11
|
scale: Vector3Like;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var s=(t,e,o)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var i=(t,e,o)=>s(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../chunks/SelectTool-
|
|
1
|
+
"use strict";var l=Object.defineProperty;var s=(t,e,o)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var i=(t,e,o)=>s(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../chunks/SelectTool-BAXTVyWs.cjs");class n{constructor(e,o){i(this,"_scene");i(this,"_controller");i(this,"_activeTool");i(this,"_selectTool");this._scene=e,this._controller=o,this._selectTool=null,this._activeTool=null}get selectTool(){return this._selectTool||(this._selectTool=new r.DIVESelectTool(this._scene,this._controller)),this._selectTool}Dispose(){this.removeEventListeners()}GetActiveTool(){return this._activeTool}UseTool(e){var o;switch((o=this._activeTool)==null||o.Deactivate(),e){case"select":{this.addEventListeners(),this.selectTool.Activate(),this._activeTool=this.selectTool;break}case"none":{this.removeEventListeners(),this._activeTool=null;break}default:console.warn(`DIVEToolBox.UseTool: Unknown tool: ${e}`)}}SetGizmoMode(e){this.selectTool.SetGizmoMode(e)}SetGizmoVisibility(e){this.selectTool.SetGizmoVisibility(e)}SetGizmoScaleLinked(e){this.selectTool.SetGizmoScaleLinked(e)}onPointerMove(e){var o;(o=this._activeTool)==null||o.onPointerMove(e)}onPointerDown(e){var o;(o=this._activeTool)==null||o.onPointerDown(e)}onPointerUp(e){var o;(o=this._activeTool)==null||o.onPointerUp(e)}onWheel(e){var o;(o=this._activeTool)==null||o.onWheel(e)}addEventListeners(){this._controller.domElement.addEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.addEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.addEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.addEventListener("wheel",e=>this.onWheel(e))}removeEventListeners(){this._controller.domElement.removeEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.removeEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.removeEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.removeEventListener("wheel",e=>this.onWheel(e))}}i(n,"DefaultTool","select");exports.Toolbox=n;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var n = Object.defineProperty;
|
|
2
2
|
var l = (t, e, o) => e in t ? n(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
3
|
var i = (t, e, o) => l(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
-
import { D as s } from "../../../chunks/SelectTool-
|
|
4
|
+
import { D as s } from "../../../chunks/SelectTool-Bd8cC9nb.mjs";
|
|
5
5
|
class r {
|
|
6
6
|
constructor(e, o) {
|
|
7
7
|
i(this, "_scene");
|
|
@@ -4,4 +4,6 @@ import { DIVEPointLight } from '../components/light/PointLight.ts';
|
|
|
4
4
|
import { DIVESceneLight } from '../components/light/SceneLight.ts';
|
|
5
5
|
import { DIVEModel } from '../components/model/Model.ts';
|
|
6
6
|
import { DIVEPrimitive } from '../components/primitive/Primitive.ts';
|
|
7
|
-
|
|
7
|
+
import { COMEntityType } from '../modules/state/types/index.ts';
|
|
8
|
+
export type DIVESceneObject<T extends COMEntityType | void = void> = T extends 'model' ? DIVEModel : T extends 'group' ? DIVEGroup : T extends 'primitive' ? DIVEPrimitive : T extends 'light' ? DIVELight : DIVEModel | DIVEGroup | DIVEPrimitive | DIVELight;
|
|
9
|
+
export type DIVELight = DIVEAmbientLight | DIVEPointLight | DIVESceneLight;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopware-ag/dive",
|
|
3
|
-
"version": "2.0.1-beta.
|
|
3
|
+
"version": "2.0.1-beta.1",
|
|
4
4
|
"description": "Shopware Spatial Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/dive.cjs",
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
"magic-string": "^0.30.17",
|
|
102
102
|
"prettier": "^3.3.3",
|
|
103
103
|
"prettier-plugin-multiline-arrays": "^3.0.6",
|
|
104
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
104
105
|
"ts-jest": "^29.1.2",
|
|
105
106
|
"ts-morph": "^25.0.1",
|
|
106
107
|
"ts-node": "^10.9.2",
|