@liveroom-tech/react-immersive 5.3.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.
Files changed (50) hide show
  1. package/dist/binding-builder.css +1 -1
  2. package/dist/binding-builder.d.mts +5 -1
  3. package/dist/binding-builder.d.ts +5 -1
  4. package/dist/binding-builder.js +23 -20
  5. package/dist/binding-builder.mjs +1 -1
  6. package/dist/chunk-2JFUMJUP.mjs +1 -0
  7. package/dist/chunk-4JMJALRO.mjs +2 -0
  8. package/dist/chunk-OTSCPJWF.mjs +1 -0
  9. package/dist/chunk-P2JZ5Z7I.mjs +1 -0
  10. package/dist/chunk-UGPR4EPP.mjs +81 -0
  11. package/dist/chunk-V7WZUWJ5.mjs +1 -0
  12. package/dist/chunk-WWUWEPFK.mjs +3 -0
  13. package/dist/hosted.css +1 -1
  14. package/dist/hosted.d.mts +44 -17
  15. package/dist/hosted.d.ts +44 -17
  16. package/dist/hosted.js +22 -19
  17. package/dist/hosted.mjs +1 -1
  18. package/dist/index.css +1 -1
  19. package/dist/index.d.mts +70 -12
  20. package/dist/index.d.ts +70 -12
  21. package/dist/index.js +21 -18
  22. package/dist/index.mjs +1 -1
  23. package/dist/{materialVariants-DjTuiWmN.d.mts → modelFileResolver-Co7j1tdQ.d.mts} +122 -29
  24. package/dist/{materialVariants-DjTuiWmN.d.ts → modelFileResolver-Co7j1tdQ.d.ts} +122 -29
  25. package/dist/modelViewerProps-BibuMND7.d.ts +1988 -0
  26. package/dist/modelViewerProps-Ce4-wb57.d.mts +1988 -0
  27. package/dist/{publicProps-tJuWZgT3.d.ts → publicProps-BaJHCDa_.d.mts} +7 -0
  28. package/dist/{publicProps-tJuWZgT3.d.mts → publicProps-CP18d_mt.d.ts} +7 -0
  29. package/dist/simple-model-viewer.d.mts +2 -4
  30. package/dist/simple-model-viewer.d.ts +2 -4
  31. package/dist/simple-model-viewer.js +3 -3
  32. package/dist/simple-model-viewer.mjs +1 -1
  33. package/dist/utils.d.mts +62 -4
  34. package/dist/utils.d.ts +62 -4
  35. package/dist/utils.js +2 -1
  36. package/dist/utils.mjs +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-4FDMYUGT.mjs +0 -3
  39. package/dist/chunk-CV4E7DOO.mjs +0 -79
  40. package/dist/chunk-F4WT3HEK.mjs +0 -1
  41. package/dist/chunk-FPJZDEON.mjs +0 -1
  42. package/dist/chunk-JHKMRMJH.mjs +0 -1
  43. package/dist/chunk-TW2M4UXT.mjs +0 -1
  44. package/dist/chunk-W24UP6NM.mjs +0 -1
  45. package/dist/modelInfo-BQ5UZu95.d.ts +0 -43
  46. package/dist/modelInfo-CcYpydB7.d.mts +0 -43
  47. package/dist/modelViewerProps-BalkRDni.d.ts +0 -618
  48. package/dist/modelViewerProps-DdsJDRB7.d.mts +0 -618
  49. package/dist/rendererBackend-C_Jb4_Jy.d.mts +0 -917
  50. package/dist/rendererBackend-C_Jb4_Jy.d.ts +0 -917
package/dist/hosted.d.mts CHANGED
@@ -1,11 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { MutableRefObject } from 'react';
3
- import { o as ObjectBinding, a1 as SceneConfig } from './rendererBackend-C_Jb4_Jy.mjs';
4
- import { B as BindingBuilderProps } from './publicProps-tJuWZgT3.mjs';
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 { n as ModelViewerProps } from './modelViewerProps-DdsJDRB7.mjs';
7
- import './materialVariants-DjTuiWmN.mjs';
8
- import './modelInfo-CcYpydB7.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"];
@@ -46,7 +44,13 @@ type ProjectModelViewerProps = ModelViewerProps & {
46
44
  };
47
45
  declare function ProjectModelViewer(props: ProjectModelViewerProps): react.JSX.Element;
48
46
 
49
- type BindingBuilderProjectModel = {
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 = {
50
54
  url: string;
51
55
  name?: string;
52
56
  assetId?: string | null;
@@ -58,18 +62,33 @@ type BindingBuilderProjectModel = {
58
62
  tilesetUrl?: string | null;
59
63
  assetVersion?: string | null;
60
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
+ };
61
77
  type BindingBuilderProject = {
62
78
  id: string;
63
79
  revision: number;
64
- model: BindingBuilderProjectModel;
65
- objectBindings: Record<string, ObjectBinding>;
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. */
66
85
  sceneConfig: SceneConfig;
67
86
  };
68
87
  type BindingBuilderProjectSnapshot = {
69
88
  projectId: string;
70
89
  baseRevision: number;
71
- model: BindingBuilderProjectModel;
72
- objectBindings: Record<string, ObjectBinding>;
90
+ models: BindingBuilderProjectModel[];
91
+ composition: SceneComposition;
73
92
  sceneConfig: SceneConfig;
74
93
  };
75
94
  type BindingBuilderProjectChangeOrigin = "local" | "remote";
@@ -103,18 +122,26 @@ type ProjectBindingBuilderProps = BindingBuilderProps & {
103
122
  * Lets a hosted editor upload a selected model before it is loaded. Return
104
123
  * the durable model URL/version that should be saved with the project.
105
124
  */
106
- onModelUpload?: (file: File) => Promise<BindingBuilderProject["model"]>;
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
+ */
107
130
  onTextureUpload?: (file: File, objectId: string) => Promise<string>;
108
131
  /** Requests/releases a short collaborative lease around gizmo edits. */
109
132
  onEditLeaseChange?: (featureId: string, editing: boolean) => void;
110
133
  /**
111
- * Whether the model itself may be replaced or removed. False hides the
112
- * Remove model and Upload controls and ignores picked or dropped files;
113
- * bindings and scene settings stay editable. Defaults to true. Remove model
114
- * 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.
115
137
  */
116
138
  allowModelChange?: boolean;
117
139
  };
118
- 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;
119
146
 
120
- 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
2
  import { MutableRefObject } from 'react';
3
- import { o as ObjectBinding, a1 as SceneConfig } from './rendererBackend-C_Jb4_Jy.js';
4
- import { B as BindingBuilderProps } from './publicProps-tJuWZgT3.js';
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 { n as ModelViewerProps } from './modelViewerProps-BalkRDni.js';
7
- import './materialVariants-DjTuiWmN.js';
8
- import './modelInfo-BQ5UZu95.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"];
@@ -46,7 +44,13 @@ type ProjectModelViewerProps = ModelViewerProps & {
46
44
  };
47
45
  declare function ProjectModelViewer(props: ProjectModelViewerProps): react.JSX.Element;
48
46
 
49
- type BindingBuilderProjectModel = {
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 = {
50
54
  url: string;
51
55
  name?: string;
52
56
  assetId?: string | null;
@@ -58,18 +62,33 @@ type BindingBuilderProjectModel = {
58
62
  tilesetUrl?: string | null;
59
63
  assetVersion?: string | null;
60
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
+ };
61
77
  type BindingBuilderProject = {
62
78
  id: string;
63
79
  revision: number;
64
- model: BindingBuilderProjectModel;
65
- objectBindings: Record<string, ObjectBinding>;
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. */
66
85
  sceneConfig: SceneConfig;
67
86
  };
68
87
  type BindingBuilderProjectSnapshot = {
69
88
  projectId: string;
70
89
  baseRevision: number;
71
- model: BindingBuilderProjectModel;
72
- objectBindings: Record<string, ObjectBinding>;
90
+ models: BindingBuilderProjectModel[];
91
+ composition: SceneComposition;
73
92
  sceneConfig: SceneConfig;
74
93
  };
75
94
  type BindingBuilderProjectChangeOrigin = "local" | "remote";
@@ -103,18 +122,26 @@ type ProjectBindingBuilderProps = BindingBuilderProps & {
103
122
  * Lets a hosted editor upload a selected model before it is loaded. Return
104
123
  * the durable model URL/version that should be saved with the project.
105
124
  */
106
- onModelUpload?: (file: File) => Promise<BindingBuilderProject["model"]>;
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
+ */
107
130
  onTextureUpload?: (file: File, objectId: string) => Promise<string>;
108
131
  /** Requests/releases a short collaborative lease around gizmo edits. */
109
132
  onEditLeaseChange?: (featureId: string, editing: boolean) => void;
110
133
  /**
111
- * Whether the model itself may be replaced or removed. False hides the
112
- * Remove model and Upload controls and ignores picked or dropped files;
113
- * bindings and scene settings stay editable. Defaults to true. Remove model
114
- * 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.
115
137
  */
116
138
  allowModelChange?: boolean;
117
139
  };
118
- 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;
119
146
 
120
- 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 };