@shopware-ag/dive 3.0.11 → 3.1.0
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/{AssetCache-DOB996Vk.mjs → AssetCache-C3YXhbaX.mjs} +1 -1
- package/build/chunks/{AssetCache-MtISiPD2.cjs → AssetCache-xpY_N7Yp.cjs} +1 -1
- package/build/chunks/{AssetExporter-DLL_vJae.mjs → AssetExporter-C5MScs9S.mjs} +4 -1
- package/build/chunks/{AssetLoader-B1n3KGOu.cjs → AssetLoader-CRxLq0AL.cjs} +1 -1
- package/build/chunks/{AssetLoader-BY5D3Cvc.mjs → AssetLoader-MfH5d_Rr.mjs} +6 -15
- package/build/chunks/{PovSchema-DWWvr_ED.mjs → CameraSchema-cgY5WBGW.mjs} +4 -4
- package/build/chunks/CameraSchema-twxH-72N.cjs +1 -0
- package/build/chunks/{FileTypes-DMTSUCcK.cjs → FileTypes-Cgyf8ocm.cjs} +2 -2
- package/build/chunks/{FileTypes-DYtXCJQV.mjs → FileTypes-DiYB3WBp.mjs} +208 -183
- package/build/chunks/SpriteText-2lCRglsw.cjs +1 -0
- package/build/chunks/SpriteText-C_CQPvUn.mjs +50 -0
- package/build/chunks/{isFileTypeSupported-C-hfGk-7.mjs → isFileTypeSupported-9h8lrIuG.mjs} +1 -1
- package/build/chunks/{isFileTypeSupported-xoGjHFuz.cjs → isFileTypeSupported-BBU39V4u.cjs} +1 -1
- package/build/components/boundingbox/BoundingBox.d.ts +9 -5
- package/build/components/index.d.ts +1 -0
- package/build/components/root/Root.d.ts +2 -2
- package/build/components/spritetext/SpriteText.d.ts +27 -0
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +36 -37
- package/build/engine/Dive.d.ts +6 -0
- package/build/engine/environment/Environment.d.ts +8 -0
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +2 -2
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetexporter/index.mjs +1 -1
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +2 -2
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orbitcontroller/src/OrbitController.d.ts +1 -1
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.mjs +4 -4
- package/build/plugins/quickview/index.cjs +1 -1
- package/build/plugins/quickview/index.mjs +49 -19
- package/build/plugins/quickview/src/QuickView.d.ts +12 -8
- package/build/plugins/quickview/src/state/QuickViewState.d.ts +4 -0
- package/build/plugins/quickview/src/uri/QuickViewUri.d.ts +3 -0
- package/build/plugins/quickview/types/index.d.ts +18 -0
- package/build/plugins/state/index.cjs +13 -13
- package/build/plugins/state/index.mjs +2343 -2168
- package/build/plugins/state/src/actions/index.d.ts +1 -0
- package/build/plugins/state/src/actions/object/addobject.d.ts +1 -1
- package/build/plugins/state/src/actions/object/updateobject.d.ts +1 -1
- package/build/plugins/state/src/actions/renderer/startrender.d.ts +1 -1
- package/build/plugins/state/src/actions/scene/getallscenedata.d.ts +5 -2
- package/build/plugins/state/src/actions/state/getstate.d.ts +8 -0
- package/build/plugins/state/src/actions/state/index.d.ts +2 -0
- package/build/plugins/state/src/actions/state/setstate.d.ts +8 -0
- package/build/plugins/state/types/StateData.d.ts +18 -0
- package/build/plugins/state/types/StateSceneData.d.ts +5 -19
- package/build/plugins/state/types/index.d.ts +1 -0
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +4 -13
- package/build/types/schema/BaseEntitySchema.d.ts +17 -0
- package/build/types/schema/CameraSchema.d.ts +18 -0
- package/build/types/schema/EntitySchema.d.ts +13 -3
- package/build/types/schema/EntityTypeSchema.d.ts +9 -1
- package/build/types/schema/GeometrySchema.d.ts +9 -0
- package/build/types/schema/GeometryTypeSchema.d.ts +6 -0
- package/build/types/schema/GroupSchema.d.ts +7 -0
- package/build/types/schema/LightSchema.d.ts +16 -0
- package/build/types/schema/MaterialSchema.d.ts +10 -0
- package/build/types/schema/ModelSchema.d.ts +16 -0
- package/build/types/schema/PrimitiveSchema.d.ts +5 -0
- package/build/types/schema/index.d.ts +1 -1
- package/package.json +8 -9
- package/build/chunks/PovSchema-Co9FznEz.cjs +0 -1
- package/build/types/schema/PovSchema.d.ts +0 -10
|
@@ -1,25 +1,55 @@
|
|
|
1
|
-
import { D as
|
|
1
|
+
import { D as l, b as u, O as w, c as d } from "../../chunks/FileTypes-DiYB3WBp.mjs";
|
|
2
2
|
import "three/webgpu";
|
|
3
3
|
import "three/examples/jsm/loaders/HDRLoader.js";
|
|
4
4
|
import "three/tsl";
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
i.
|
|
20
|
-
}
|
|
5
|
+
const m = async (a, e) => {
|
|
6
|
+
try {
|
|
7
|
+
const i = new l({ ...e, autoStart: !1 });
|
|
8
|
+
i.mainView.camera.position.set(0, 1, 2);
|
|
9
|
+
const o = await new u().setFromURL(a);
|
|
10
|
+
i.scene.root.add(o), o.placeOnFloor();
|
|
11
|
+
const t = new w(
|
|
12
|
+
i.mainView.camera,
|
|
13
|
+
i.mainView.canvas
|
|
14
|
+
);
|
|
15
|
+
i.clock.addTicker(t);
|
|
16
|
+
const r = Object.assign(i, { orbitController: t, model: o }), c = i.disposeAsync.bind(i);
|
|
17
|
+
return r.disposeAsync = async () => {
|
|
18
|
+
t.dispose(), await c();
|
|
19
|
+
}, ((e == null ? void 0 : e.autoStart) ?? !0) && (await i.startAsync(), t.focusObject(o)), r;
|
|
20
|
+
} catch (i) {
|
|
21
|
+
return console.error("Failed to initialize QuickView:", i), Promise.reject(i);
|
|
22
|
+
}
|
|
23
|
+
}, p = async (a, e) => {
|
|
24
|
+
try {
|
|
25
|
+
const i = new l({ ...e, autoStart: !1 });
|
|
26
|
+
i.mainView.camera.position.set(0, 1, 2);
|
|
27
|
+
const o = new w(
|
|
28
|
+
i.mainView.camera,
|
|
29
|
+
i.mainView.canvas
|
|
30
|
+
);
|
|
31
|
+
i.clock.addTicker(o);
|
|
32
|
+
const t = new (await import("../state/index.mjs")).State(
|
|
33
|
+
i,
|
|
34
|
+
o
|
|
35
|
+
), r = Object.assign(i, { orbitController: o, state: t }), c = i.disposeAsync.bind(i);
|
|
36
|
+
r.disposeAsync = async () => {
|
|
37
|
+
o.dispose(), t.destroyInstance(), await c();
|
|
38
|
+
};
|
|
39
|
+
const n = (await t.performAction("SET_STATE", a)).filter(
|
|
40
|
+
(s) => "isDIVEModel" in s || "isDIVEPrimitive" in s
|
|
41
|
+
);
|
|
42
|
+
return n.length > 0 && o.focusObject(n), ((e == null ? void 0 : e.autoStart) ?? !0) && await i.startAsync(), r;
|
|
43
|
+
} catch (i) {
|
|
44
|
+
return console.error("Failed to initialize QuickView:", i), Promise.reject(i);
|
|
45
|
+
}
|
|
46
|
+
}, D = {
|
|
47
|
+
...d
|
|
21
48
|
};
|
|
49
|
+
function S(a, e) {
|
|
50
|
+
return typeof a == "string" ? m(a, e) : p(a, e);
|
|
51
|
+
}
|
|
22
52
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
53
|
+
S as QuickView,
|
|
54
|
+
D as QuickViewDefaultSettings
|
|
25
55
|
};
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { QuickViewSettings } from '../types/index.ts';
|
|
1
|
+
import { StateData } from '../../state/index.ts';
|
|
2
|
+
import { QuickViewWithModel, QuickViewWithState, QuickViewSettings } from '../types/index.ts';
|
|
4
3
|
export declare const QuickViewDefaultSettings: Omit<Required<QuickViewSettings>, 'hdr'>;
|
|
5
|
-
export type QuickView = DIVE & {
|
|
6
|
-
orbitController: OrbitController;
|
|
7
|
-
model: DIVEModel;
|
|
8
|
-
};
|
|
9
4
|
/**
|
|
5
|
+
* Creates a QuickView from a model URI.
|
|
10
6
|
*
|
|
11
7
|
* @param uri - The URI of the 3D model to display in QuickView
|
|
12
8
|
* @param settings - The settings for the QuickView
|
|
13
9
|
* @returns The DIVE instance with the orbit controller and hdr environment - { ...DIVE, orbitController: OrbitController, hdr: HDREnvironment }
|
|
14
10
|
*/
|
|
15
|
-
export declare
|
|
11
|
+
export declare function QuickView(uri: string, settings?: Partial<QuickViewSettings>): Promise<QuickViewWithModel>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a QuickView from scene state.
|
|
14
|
+
*
|
|
15
|
+
* @param state - The scene data to display in QuickView
|
|
16
|
+
* @param settings - The settings for the QuickView
|
|
17
|
+
* @returns The DIVE instance with the orbit controller and hdr environment - { ...DIVE, orbitController: OrbitController, hdr: HDREnvironment }
|
|
18
|
+
*/
|
|
19
|
+
export declare function QuickView(state: StateData, settings?: Partial<QuickViewSettings>): Promise<QuickViewWithState>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { StateData } from '../../../state/index.ts';
|
|
2
|
+
import { QuickViewSettings } from '../../types/QuickViewSettings.ts';
|
|
3
|
+
import { QuickViewWithState } from '../../types/index.ts';
|
|
4
|
+
export declare const QuickViewState: (sceneData: StateData, settings?: Partial<QuickViewSettings>) => Promise<QuickViewWithState>;
|
|
@@ -1 +1,19 @@
|
|
|
1
|
+
import { DIVE, DIVEModel } from '../../../index.ts';
|
|
2
|
+
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
3
|
+
import { State } from '../../state/index.ts';
|
|
1
4
|
export * from './QuickViewSettings.ts';
|
|
5
|
+
/** A QuickView built from a single model URI. */
|
|
6
|
+
export type QuickViewWithModel = DIVE & {
|
|
7
|
+
orbitController: OrbitController;
|
|
8
|
+
model: DIVEModel;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A QuickView built from scene state.
|
|
12
|
+
*
|
|
13
|
+
* Carries no single `model`, because a scene state describes any number of
|
|
14
|
+
* objects. The State instance is exposed so the scene can be driven further.
|
|
15
|
+
*/
|
|
16
|
+
export type QuickViewWithState = DIVE & {
|
|
17
|
+
orbitController: OrbitController;
|
|
18
|
+
state: State;
|
|
19
|
+
};
|