@liveroom-tech/react-immersive 5.2.0 → 6.0.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/LICENSE +10 -6
- package/README.md +106 -3856
- package/dist/binding-builder.css +1 -1
- package/dist/binding-builder.d.mts +5 -1
- package/dist/binding-builder.d.ts +5 -1
- package/dist/binding-builder.js +67 -17
- package/dist/binding-builder.mjs +1 -1
- package/dist/chunk-2JFUMJUP.mjs +1 -0
- package/dist/chunk-4JMJALRO.mjs +2 -0
- package/dist/chunk-OTSCPJWF.mjs +1 -0
- package/dist/chunk-P2JZ5Z7I.mjs +1 -0
- package/dist/chunk-UGPR4EPP.mjs +81 -0
- package/dist/chunk-V7WZUWJ5.mjs +1 -0
- package/dist/chunk-WWUWEPFK.mjs +3 -0
- package/dist/hosted.css +1 -1
- package/dist/hosted.d.mts +48 -19
- package/dist/hosted.d.ts +48 -19
- package/dist/hosted.js +66 -16
- package/dist/hosted.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +78 -12
- package/dist/index.d.ts +78 -12
- package/dist/index.js +65 -15
- package/dist/index.mjs +1 -1
- package/dist/{materialVariants-DnZe9eMC.d.mts → modelFileResolver-Co7j1tdQ.d.mts} +125 -27
- package/dist/{materialVariants-DnZe9eMC.d.ts → modelFileResolver-Co7j1tdQ.d.ts} +125 -27
- package/dist/modelViewerProps-BibuMND7.d.ts +1988 -0
- package/dist/modelViewerProps-Ce4-wb57.d.mts +1988 -0
- package/dist/{publicProps-tJuWZgT3.d.ts → publicProps-BaJHCDa_.d.mts} +7 -0
- package/dist/{publicProps-tJuWZgT3.d.mts → publicProps-CP18d_mt.d.ts} +7 -0
- package/dist/simple-model-viewer.d.mts +2 -4
- package/dist/simple-model-viewer.d.ts +2 -4
- package/dist/simple-model-viewer.js +3 -3
- package/dist/simple-model-viewer.mjs +1 -1
- package/dist/utils.d.mts +62 -4
- package/dist/utils.d.ts +62 -4
- package/dist/utils.js +2 -1
- package/dist/utils.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-4NLJSD3S.mjs +0 -1
- package/dist/chunk-B7REIGDG.mjs +0 -1
- package/dist/chunk-HYFJ5DYJ.mjs +0 -1
- package/dist/chunk-QC3NT76G.mjs +0 -3
- package/dist/chunk-SEESCGUS.mjs +0 -1
- package/dist/chunk-T3M3BQ7H.mjs +0 -32
- package/dist/chunk-ZPK67UG7.mjs +0 -1
- package/dist/modelInfo-BYebMPdZ.d.mts +0 -43
- package/dist/modelInfo-XfUQO7C_.d.ts +0 -43
- package/dist/modelViewerProps-CIZ2R_Fv.d.ts +0 -569
- package/dist/modelViewerProps-DoRiTZMn.d.mts +0 -569
- package/dist/rendererBackend-QwMzISTn.d.mts +0 -903
- package/dist/rendererBackend-QwMzISTn.d.ts +0 -903
package/dist/hosted.d.mts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { B as BindingBuilderProps } from './publicProps-
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
3
|
+
import { ag as ModelViewerProps, ao as ObjectBinding, aX as SceneConfig, aW as SceneComposition, ad as ModelViewerModelEntry } from './modelViewerProps-Ce4-wb57.mjs';
|
|
4
|
+
import { B as BindingBuilderProps } from './publicProps-BaJHCDa_.mjs';
|
|
5
5
|
import { Object3D } from 'three';
|
|
6
|
-
import
|
|
7
|
-
import './materialVariants-DnZe9eMC.mjs';
|
|
8
|
-
import './modelInfo-BYebMPdZ.mjs';
|
|
6
|
+
import './modelFileResolver-Co7j1tdQ.mjs';
|
|
9
7
|
import '@react-three/drei';
|
|
10
8
|
|
|
11
9
|
declare const TEXTURE_KEYS: readonly ["texture", "metalnessMap", "roughnessMap", "emissiveMap", "alphaMap", "normalMap", "bumpMap", "aoMap", "displacementMap", "clearcoatMap", "clearcoatRoughnessMap", "clearcoatNormalMap", "anisotropyMap", "transmissionMap", "thicknessMap", "sheenColorMap", "sheenRoughnessMap", "specularIntensityMap", "specularColorMap"];
|
|
@@ -23,6 +21,8 @@ type ProjectModelViewerProps = ModelViewerProps & {
|
|
|
23
21
|
* service, so this cannot approve a licence by itself.
|
|
24
22
|
*/
|
|
25
23
|
licenseValidationUrl?: string;
|
|
24
|
+
/** An explicit clear command, distinct from clicking empty canvas space. */
|
|
25
|
+
onSelectionClear?: () => void;
|
|
26
26
|
/** Reports transform-gizmo edit leases for collaborative hosts. */
|
|
27
27
|
onObjectEditLeaseChange?: (binding: ObjectBinding, editing: boolean) => void;
|
|
28
28
|
/** The loaded three.js scene, which the editor builds bindings from. */
|
|
@@ -40,11 +40,17 @@ type ProjectModelViewerProps = ModelViewerProps & {
|
|
|
40
40
|
* Receives a function that ends Move/Zoom mode the way a plain canvas click
|
|
41
41
|
* does, for the editor's own "Done positioning" button.
|
|
42
42
|
*/
|
|
43
|
-
endTexturePositioningRef?:
|
|
43
|
+
endTexturePositioningRef?: MutableRefObject<(() => void) | null>;
|
|
44
44
|
};
|
|
45
45
|
declare function ProjectModelViewer(props: ProjectModelViewerProps): react.JSX.Element;
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
/** Settings whose names or positions belong to a particular model. */
|
|
48
|
+
type ModelSettings = Pick<SceneConfig, "annotations" | "animations" | "measurements" | "selectionSets" | "sequences"> & {
|
|
49
|
+
activeVariants?: string[];
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Where a model's files are: what an upload returns. */
|
|
53
|
+
type BindingBuilderModelSource = {
|
|
48
54
|
url: string;
|
|
49
55
|
name?: string;
|
|
50
56
|
assetId?: string | null;
|
|
@@ -56,18 +62,33 @@ type BindingBuilderProjectModel = {
|
|
|
56
62
|
tilesetUrl?: string | null;
|
|
57
63
|
assetVersion?: string | null;
|
|
58
64
|
};
|
|
65
|
+
/** One model of a project. Its `url` identifies it within the project. */
|
|
66
|
+
type BindingBuilderProjectModel = BindingBuilderModelSource & {
|
|
67
|
+
objectBindings: Record<string, ObjectBinding>;
|
|
68
|
+
/** Files whose nodes were spliced into this model. */
|
|
69
|
+
mergeModels?: {
|
|
70
|
+
url: string;
|
|
71
|
+
assetId?: string | null;
|
|
72
|
+
namePrefix: string;
|
|
73
|
+
}[];
|
|
74
|
+
/** The scene settings that belong to this model, such as its annotations. */
|
|
75
|
+
modelSettings?: ModelSettings;
|
|
76
|
+
};
|
|
59
77
|
type BindingBuilderProject = {
|
|
60
78
|
id: string;
|
|
61
79
|
revision: number;
|
|
62
|
-
model
|
|
63
|
-
|
|
80
|
+
/** In display order. A removed model stays, marked deleted in `composition`. */
|
|
81
|
+
models: BindingBuilderProjectModel[];
|
|
82
|
+
/** Each model's placement, keyed by `url:<model url>`. */
|
|
83
|
+
composition: SceneComposition;
|
|
84
|
+
/** The settings all the models share. */
|
|
64
85
|
sceneConfig: SceneConfig;
|
|
65
86
|
};
|
|
66
87
|
type BindingBuilderProjectSnapshot = {
|
|
67
88
|
projectId: string;
|
|
68
89
|
baseRevision: number;
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
models: BindingBuilderProjectModel[];
|
|
91
|
+
composition: SceneComposition;
|
|
71
92
|
sceneConfig: SceneConfig;
|
|
72
93
|
};
|
|
73
94
|
type BindingBuilderProjectChangeOrigin = "local" | "remote";
|
|
@@ -101,18 +122,26 @@ type ProjectBindingBuilderProps = BindingBuilderProps & {
|
|
|
101
122
|
* Lets a hosted editor upload a selected model before it is loaded. Return
|
|
102
123
|
* the durable model URL/version that should be saved with the project.
|
|
103
124
|
*/
|
|
104
|
-
onModelUpload?: (file: File) => Promise<
|
|
125
|
+
onModelUpload?: (file: File) => Promise<BindingBuilderModelSource>;
|
|
126
|
+
/**
|
|
127
|
+
* Saves an image chosen in the editor and returns its durable URL. With a
|
|
128
|
+
* `project`, every image goes through this before it is reported.
|
|
129
|
+
*/
|
|
105
130
|
onTextureUpload?: (file: File, objectId: string) => Promise<string>;
|
|
106
131
|
/** Requests/releases a short collaborative lease around gizmo edits. */
|
|
107
132
|
onEditLeaseChange?: (featureId: string, editing: boolean) => void;
|
|
108
133
|
/**
|
|
109
|
-
* Whether
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* never appears with a `project`, which always has a model.
|
|
134
|
+
* Whether models may be replaced, added or removed. False hides those
|
|
135
|
+
* controls and ignores picked or dropped files; bindings and scene settings
|
|
136
|
+
* stay editable. Defaults to true.
|
|
113
137
|
*/
|
|
114
138
|
allowModelChange?: boolean;
|
|
115
139
|
};
|
|
116
|
-
declare function ProjectBindingBuilder({ licenseKey, licenseValidationUrl, dracoDecoderPath, ktx2TranscoderPath, meshopt, project, onProjectChange, projectChangeDebounceMs, onModelUpload, onTextureUpload, onEditLeaseChange, allowModelChange, }: ProjectBindingBuilderProps): react.JSX.Element;
|
|
140
|
+
declare function ProjectBindingBuilder({ licenseKey, licenseValidationUrl, arHandoff, mobileHandoffUrl, dracoDecoderPath, ktx2TranscoderPath, meshopt, project, onProjectChange, projectChangeDebounceMs, onModelUpload, onTextureUpload, onEditLeaseChange, allowModelChange, hideLicenseCheckingOverlay, }: ProjectBindingBuilderProps): react.JSX.Element;
|
|
141
|
+
|
|
142
|
+
/** A model's view of the scene: the shared settings plus its own. */
|
|
143
|
+
declare function sceneConfigForModel(sceneConfig: SceneConfig, model: BindingBuilderProjectModel): SceneConfig;
|
|
144
|
+
/** The models to hand ModelViewer, or undefined for a project of one. */
|
|
145
|
+
declare function viewerModelsFromProject(project: Pick<BindingBuilderProject, "models" | "composition" | "sceneConfig">): ModelViewerModelEntry[] | undefined;
|
|
117
146
|
|
|
118
|
-
export { type BindingBuilderProject, type BindingBuilderProjectChangeOrigin, type BindingBuilderProjectModel, type BindingBuilderProjectSnapshot, ProjectBindingBuilder, type ProjectBindingBuilderProps, ProjectModelViewer, type ProjectModelViewerProps };
|
|
147
|
+
export { type BindingBuilderModelSource, type BindingBuilderProject, type BindingBuilderProjectChangeOrigin, type BindingBuilderProjectModel, type BindingBuilderProjectSnapshot, ProjectBindingBuilder, type ProjectBindingBuilderProps, ProjectModelViewer, type ProjectModelViewerProps, sceneConfigForModel, viewerModelsFromProject };
|
package/dist/hosted.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { B as BindingBuilderProps } from './publicProps-
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
3
|
+
import { ag as ModelViewerProps, ao as ObjectBinding, aX as SceneConfig, aW as SceneComposition, ad as ModelViewerModelEntry } from './modelViewerProps-BibuMND7.js';
|
|
4
|
+
import { B as BindingBuilderProps } from './publicProps-CP18d_mt.js';
|
|
5
5
|
import { Object3D } from 'three';
|
|
6
|
-
import
|
|
7
|
-
import './materialVariants-DnZe9eMC.js';
|
|
8
|
-
import './modelInfo-XfUQO7C_.js';
|
|
6
|
+
import './modelFileResolver-Co7j1tdQ.js';
|
|
9
7
|
import '@react-three/drei';
|
|
10
8
|
|
|
11
9
|
declare const TEXTURE_KEYS: readonly ["texture", "metalnessMap", "roughnessMap", "emissiveMap", "alphaMap", "normalMap", "bumpMap", "aoMap", "displacementMap", "clearcoatMap", "clearcoatRoughnessMap", "clearcoatNormalMap", "anisotropyMap", "transmissionMap", "thicknessMap", "sheenColorMap", "sheenRoughnessMap", "specularIntensityMap", "specularColorMap"];
|
|
@@ -23,6 +21,8 @@ type ProjectModelViewerProps = ModelViewerProps & {
|
|
|
23
21
|
* service, so this cannot approve a licence by itself.
|
|
24
22
|
*/
|
|
25
23
|
licenseValidationUrl?: string;
|
|
24
|
+
/** An explicit clear command, distinct from clicking empty canvas space. */
|
|
25
|
+
onSelectionClear?: () => void;
|
|
26
26
|
/** Reports transform-gizmo edit leases for collaborative hosts. */
|
|
27
27
|
onObjectEditLeaseChange?: (binding: ObjectBinding, editing: boolean) => void;
|
|
28
28
|
/** The loaded three.js scene, which the editor builds bindings from. */
|
|
@@ -40,11 +40,17 @@ type ProjectModelViewerProps = ModelViewerProps & {
|
|
|
40
40
|
* Receives a function that ends Move/Zoom mode the way a plain canvas click
|
|
41
41
|
* does, for the editor's own "Done positioning" button.
|
|
42
42
|
*/
|
|
43
|
-
endTexturePositioningRef?:
|
|
43
|
+
endTexturePositioningRef?: MutableRefObject<(() => void) | null>;
|
|
44
44
|
};
|
|
45
45
|
declare function ProjectModelViewer(props: ProjectModelViewerProps): react.JSX.Element;
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
/** Settings whose names or positions belong to a particular model. */
|
|
48
|
+
type ModelSettings = Pick<SceneConfig, "annotations" | "animations" | "measurements" | "selectionSets" | "sequences"> & {
|
|
49
|
+
activeVariants?: string[];
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Where a model's files are: what an upload returns. */
|
|
53
|
+
type BindingBuilderModelSource = {
|
|
48
54
|
url: string;
|
|
49
55
|
name?: string;
|
|
50
56
|
assetId?: string | null;
|
|
@@ -56,18 +62,33 @@ type BindingBuilderProjectModel = {
|
|
|
56
62
|
tilesetUrl?: string | null;
|
|
57
63
|
assetVersion?: string | null;
|
|
58
64
|
};
|
|
65
|
+
/** One model of a project. Its `url` identifies it within the project. */
|
|
66
|
+
type BindingBuilderProjectModel = BindingBuilderModelSource & {
|
|
67
|
+
objectBindings: Record<string, ObjectBinding>;
|
|
68
|
+
/** Files whose nodes were spliced into this model. */
|
|
69
|
+
mergeModels?: {
|
|
70
|
+
url: string;
|
|
71
|
+
assetId?: string | null;
|
|
72
|
+
namePrefix: string;
|
|
73
|
+
}[];
|
|
74
|
+
/** The scene settings that belong to this model, such as its annotations. */
|
|
75
|
+
modelSettings?: ModelSettings;
|
|
76
|
+
};
|
|
59
77
|
type BindingBuilderProject = {
|
|
60
78
|
id: string;
|
|
61
79
|
revision: number;
|
|
62
|
-
model
|
|
63
|
-
|
|
80
|
+
/** In display order. A removed model stays, marked deleted in `composition`. */
|
|
81
|
+
models: BindingBuilderProjectModel[];
|
|
82
|
+
/** Each model's placement, keyed by `url:<model url>`. */
|
|
83
|
+
composition: SceneComposition;
|
|
84
|
+
/** The settings all the models share. */
|
|
64
85
|
sceneConfig: SceneConfig;
|
|
65
86
|
};
|
|
66
87
|
type BindingBuilderProjectSnapshot = {
|
|
67
88
|
projectId: string;
|
|
68
89
|
baseRevision: number;
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
models: BindingBuilderProjectModel[];
|
|
91
|
+
composition: SceneComposition;
|
|
71
92
|
sceneConfig: SceneConfig;
|
|
72
93
|
};
|
|
73
94
|
type BindingBuilderProjectChangeOrigin = "local" | "remote";
|
|
@@ -101,18 +122,26 @@ type ProjectBindingBuilderProps = BindingBuilderProps & {
|
|
|
101
122
|
* Lets a hosted editor upload a selected model before it is loaded. Return
|
|
102
123
|
* the durable model URL/version that should be saved with the project.
|
|
103
124
|
*/
|
|
104
|
-
onModelUpload?: (file: File) => Promise<
|
|
125
|
+
onModelUpload?: (file: File) => Promise<BindingBuilderModelSource>;
|
|
126
|
+
/**
|
|
127
|
+
* Saves an image chosen in the editor and returns its durable URL. With a
|
|
128
|
+
* `project`, every image goes through this before it is reported.
|
|
129
|
+
*/
|
|
105
130
|
onTextureUpload?: (file: File, objectId: string) => Promise<string>;
|
|
106
131
|
/** Requests/releases a short collaborative lease around gizmo edits. */
|
|
107
132
|
onEditLeaseChange?: (featureId: string, editing: boolean) => void;
|
|
108
133
|
/**
|
|
109
|
-
* Whether
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* never appears with a `project`, which always has a model.
|
|
134
|
+
* Whether models may be replaced, added or removed. False hides those
|
|
135
|
+
* controls and ignores picked or dropped files; bindings and scene settings
|
|
136
|
+
* stay editable. Defaults to true.
|
|
113
137
|
*/
|
|
114
138
|
allowModelChange?: boolean;
|
|
115
139
|
};
|
|
116
|
-
declare function ProjectBindingBuilder({ licenseKey, licenseValidationUrl, dracoDecoderPath, ktx2TranscoderPath, meshopt, project, onProjectChange, projectChangeDebounceMs, onModelUpload, onTextureUpload, onEditLeaseChange, allowModelChange, }: ProjectBindingBuilderProps): react.JSX.Element;
|
|
140
|
+
declare function ProjectBindingBuilder({ licenseKey, licenseValidationUrl, arHandoff, mobileHandoffUrl, dracoDecoderPath, ktx2TranscoderPath, meshopt, project, onProjectChange, projectChangeDebounceMs, onModelUpload, onTextureUpload, onEditLeaseChange, allowModelChange, hideLicenseCheckingOverlay, }: ProjectBindingBuilderProps): react.JSX.Element;
|
|
141
|
+
|
|
142
|
+
/** A model's view of the scene: the shared settings plus its own. */
|
|
143
|
+
declare function sceneConfigForModel(sceneConfig: SceneConfig, model: BindingBuilderProjectModel): SceneConfig;
|
|
144
|
+
/** The models to hand ModelViewer, or undefined for a project of one. */
|
|
145
|
+
declare function viewerModelsFromProject(project: Pick<BindingBuilderProject, "models" | "composition" | "sceneConfig">): ModelViewerModelEntry[] | undefined;
|
|
117
146
|
|
|
118
|
-
export { type BindingBuilderProject, type BindingBuilderProjectChangeOrigin, type BindingBuilderProjectModel, type BindingBuilderProjectSnapshot, ProjectBindingBuilder, type ProjectBindingBuilderProps, ProjectModelViewer, type ProjectModelViewerProps };
|
|
147
|
+
export { type BindingBuilderModelSource, type BindingBuilderProject, type BindingBuilderProjectChangeOrigin, type BindingBuilderProjectModel, type BindingBuilderProjectSnapshot, ProjectBindingBuilder, type ProjectBindingBuilderProps, ProjectModelViewer, type ProjectModelViewerProps, sceneConfigForModel, viewerModelsFromProject };
|