@liveroom-tech/react-immersive 4.3.0 → 5.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 (46) hide show
  1. package/README.md +697 -83
  2. package/dist/ModelViewer-CbbJT85n.d.mts +448 -0
  3. package/dist/ModelViewer-DOexHkJC.d.ts +448 -0
  4. package/dist/binding-builder.css +1 -0
  5. package/dist/binding-builder.d.mts +6 -0
  6. package/dist/binding-builder.d.ts +6 -0
  7. package/dist/binding-builder.js +3694 -0
  8. package/dist/binding-builder.mjs +1 -0
  9. package/dist/chunk-7EW6JZ46.mjs +27 -0
  10. package/dist/chunk-BGYK4Y2Y.mjs +1 -0
  11. package/dist/chunk-MMO7KCYU.mjs +3 -0
  12. package/dist/chunk-NVY7N7CU.mjs +3 -0
  13. package/dist/chunk-SEESCGUS.mjs +1 -0
  14. package/dist/chunk-WFEYRUZC.mjs +1 -0
  15. package/dist/chunk-XTLSAYAQ.mjs +1 -0
  16. package/dist/hosted.css +1 -1
  17. package/dist/hosted.d.mts +33 -13
  18. package/dist/hosted.d.ts +33 -13
  19. package/dist/hosted.js +11 -8
  20. package/dist/hosted.mjs +1 -1
  21. package/dist/index.css +1 -1
  22. package/dist/index.d.mts +107 -83
  23. package/dist/index.d.ts +107 -83
  24. package/dist/index.js +11 -8
  25. package/dist/index.mjs +1 -1
  26. package/dist/modelInfo-CEmmvVCH.d.mts +17 -0
  27. package/dist/modelInfo-CEmmvVCH.d.ts +17 -0
  28. package/dist/{objectBinding-CBRYMYk6.d.ts → objectCatalog-5W8n5xNQ.d.mts} +55 -3
  29. package/dist/{objectBinding-CBRYMYk6.d.mts → objectCatalog-5W8n5xNQ.d.ts} +55 -3
  30. package/dist/publicProps-tJuWZgT3.d.mts +12 -0
  31. package/dist/publicProps-tJuWZgT3.d.ts +12 -0
  32. package/dist/simple-model-viewer.css +1 -0
  33. package/dist/simple-model-viewer.d.mts +38 -0
  34. package/dist/simple-model-viewer.d.ts +38 -0
  35. package/dist/simple-model-viewer.js +3666 -0
  36. package/dist/simple-model-viewer.mjs +1 -0
  37. package/dist/utils.d.mts +49 -3
  38. package/dist/utils.d.ts +49 -3
  39. package/dist/utils.js +1 -1
  40. package/dist/utils.mjs +1 -1
  41. package/package.json +28 -18
  42. package/dist/chunk-7X37KAPE.mjs +0 -1
  43. package/dist/chunk-GYB4BOVW.mjs +0 -26
  44. package/dist/chunk-K7DMBJBJ.mjs +0 -1
  45. package/dist/publicProps-BST1E8an.d.mts +0 -349
  46. package/dist/publicProps-Bv3_PCP0.d.ts +0 -349
package/dist/hosted.d.ts CHANGED
@@ -1,18 +1,21 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { f as ObjectBinding, v as SceneConfig } from './objectBinding-CBRYMYk6.js';
3
- import { g as ModelViewerProps, B as BindingBuilderProps } from './publicProps-Bv3_PCP0.js';
4
- import 'react';
1
+ import * as react from 'react';
2
+ import { RefObject } from 'react';
3
+ import { g as ObjectBinding, J as SceneConfig } from './objectCatalog-5W8n5xNQ.js';
4
+ import { B as BindingBuilderProps } from './publicProps-tJuWZgT3.js';
5
+ import { n as ModelViewerProps } from './ModelViewer-DOexHkJC.js';
6
+ import { Object3D } from 'three';
7
+ import './modelInfo-CEmmvVCH.js';
5
8
  import '@react-three/drei';
6
- import 'three';
7
- import '@react-three/xr';
8
- import '@react-three/fiber';
9
+
10
+ declare const TEXTURE_KEYS: readonly ["texture", "metalnessMap", "roughnessMap", "emissiveMap", "alphaMap", "normalMap", "bumpMap", "aoMap", "displacementMap", "clearcoatMap", "clearcoatRoughnessMap", "clearcoatNormalMap", "anisotropyMap", "transmissionMap", "thicknessMap", "sheenColorMap", "sheenRoughnessMap", "specularIntensityMap", "specularColorMap"];
11
+ type MaterialTextureKey = (typeof TEXTURE_KEYS)[number];
9
12
 
10
13
  /**
11
14
  * The full viewer's props: the public ones plus those only Liveroom's project
12
15
  * editor passes, through the "/hosted" entry. The published ModelViewer
13
16
  * (PublicModelViewer.tsx) drops the rest; publicProps.ts lists them.
14
17
  */
15
- type HostedModelViewerProps = ModelViewerProps & {
18
+ type ProjectModelViewerProps = ModelViewerProps & {
16
19
  /**
17
20
  * Validates the licence against this deployment's own API rather than the
18
21
  * licence service. The response must carry a grant signed by the licence
@@ -21,8 +24,24 @@ type HostedModelViewerProps = ModelViewerProps & {
21
24
  licenseValidationUrl?: string;
22
25
  /** Reports transform-gizmo edit leases for collaborative hosts. */
23
26
  onObjectEditLeaseChange?: (binding: ObjectBinding, editing: boolean) => void;
27
+ /** The loaded three.js scene, which the editor builds bindings from. */
28
+ onSceneLoaded?: (scene: Object3D) => void;
29
+ /**
30
+ * Reports the object and texture slot being repositioned in Move/Zoom mode
31
+ * (double-click a textured object), or null once it ends, so the editor's
32
+ * texture fields know positioning is live.
33
+ */
34
+ onTexturePositioningChange?: (target: {
35
+ objectKey: string;
36
+ textureKey: MaterialTextureKey;
37
+ } | null) => void;
38
+ /**
39
+ * Receives a function that ends Move/Zoom mode the way a plain canvas click
40
+ * does, for the editor's own "Done positioning" button.
41
+ */
42
+ endTexturePositioningRef?: RefObject<(() => void) | null>;
24
43
  };
25
- declare function HostedModelViewer(props: HostedModelViewerProps): react_jsx_runtime.JSX.Element;
44
+ declare function ProjectModelViewer(props: ProjectModelViewerProps): react.JSX.Element;
26
45
 
27
46
  type BindingBuilderProjectModel = {
28
47
  url: string;
@@ -55,9 +74,9 @@ type BindingBuilderProjectChangeOrigin = "local" | "remote";
55
74
  /**
56
75
  * The full editor's props: the public ones plus those only Liveroom's project
57
76
  * editor passes, through the "/hosted" entry. The published BindingBuilder
58
- * (PublicBindingBuilder.tsx) neither declares nor forwards the rest.
77
+ * (BindingBuilder.tsx) neither declares nor forwards the rest.
59
78
  */
60
- type HostedBindingBuilderProps = BindingBuilderProps & {
79
+ type ProjectBindingBuilderProps = BindingBuilderProps & {
61
80
  /**
62
81
  * Validates the licence against this deployment's own API rather than the
63
82
  * licence service, so the public demo licence works on local and preview
@@ -82,6 +101,7 @@ type HostedBindingBuilderProps = BindingBuilderProps & {
82
101
  * the durable model URL/version that should be saved with the project.
83
102
  */
84
103
  onModelUpload?: (file: File) => Promise<BindingBuilderProject["model"]>;
104
+ onTextureUpload?: (file: File, objectId: string) => Promise<string>;
85
105
  /** Requests/releases a short collaborative lease around gizmo edits. */
86
106
  onEditLeaseChange?: (featureId: string, editing: boolean) => void;
87
107
  /**
@@ -92,6 +112,6 @@ type HostedBindingBuilderProps = BindingBuilderProps & {
92
112
  */
93
113
  allowModelChange?: boolean;
94
114
  };
95
- declare function HostedBindingBuilder({ licenseKey, licenseValidationUrl, dracoDecoderPath, ktx2TranscoderPath, meshopt, project, onProjectChange, projectChangeDebounceMs, onModelUpload, onEditLeaseChange, allowModelChange, }: HostedBindingBuilderProps): react_jsx_runtime.JSX.Element;
115
+ declare function ProjectBindingBuilder({ licenseKey, licenseValidationUrl, dracoDecoderPath, ktx2TranscoderPath, meshopt, project, onProjectChange, projectChangeDebounceMs, onModelUpload, onTextureUpload, onEditLeaseChange, allowModelChange, }: ProjectBindingBuilderProps): react.JSX.Element;
96
116
 
97
- export { type BindingBuilderProject, type BindingBuilderProjectChangeOrigin, type BindingBuilderProjectModel, type BindingBuilderProjectSnapshot, HostedBindingBuilder, type HostedBindingBuilderProps, HostedModelViewer, type HostedModelViewerProps };
117
+ export { type BindingBuilderProject, type BindingBuilderProjectChangeOrigin, type BindingBuilderProjectModel, type BindingBuilderProjectSnapshot, ProjectBindingBuilder, type ProjectBindingBuilderProps, ProjectModelViewer, type ProjectModelViewerProps };