@liveroom-tech/react-immersive 4.2.7 → 4.2.9

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/dist/index.d.mts CHANGED
@@ -3,8 +3,8 @@ import { ComponentProps, ReactNode, MutableRefObject } from 'react';
3
3
  import { CameraControls } from '@react-three/drei';
4
4
  import { Object3D, WebGLRenderer, Scene, Camera, Box3, Material } from 'three';
5
5
  import { XRStore } from '@react-three/xr';
6
- import { x as SceneConfig, f as ObjectBinding, V as ViewerCameraState, e as ObjectActionEvent, u as SceneAnnotationMarker, o as ObjectBindingTarget, m as ObjectBindingPatch, B as BindingEdit, j as ObjectBindingMaterial, q as ObjectBindingTextureSlot, p as ObjectBindingTextureChannel, r as ObjectBindingTransform, z as SceneConfigPatch, E as SceneLight, F as SceneLightAttachment, g as ObjectBindingAction } from './utils-BUwXD_DX.mjs';
7
- export { A as AnimationAction, a as AnimationActionEffect, b as AnimationLoopMode, C as CameraAction, c as CameraActionEffect, D as DEFAULT_SCENE_CONFIG, M as MATERIAL_BLENDING_MODES, d as MATERIAL_SIDES, O as ObjectActionEffect, h as ObjectBindingActionId, i as ObjectBindingKey, k as ObjectBindingMaterialBlendingMode, l as ObjectBindingMaterialSide, n as ObjectBindingSelector, s as ObjectBindingsActionEffect, S as SceneAnimationClipConfig, t as SceneAnimationConfig, v as SceneCinematicConfig, w as SceneCinematicWaypoint, y as SceneConfigActionEffect, G as SceneLightType, H as SceneModelRenderer, I as VisibilityActionEffect, J as defineObjectBindings, K as material, L as patchBindings, N as patchSceneConfig, P as selectBindingKeys, Q as selectBindings } from './utils-BUwXD_DX.mjs';
6
+ import { x as SceneConfig, f as ObjectBinding, V as ViewerCameraState, e as ObjectActionEvent, u as SceneAnnotationMarker, o as ObjectBindingTarget, m as ObjectBindingPatch, B as BindingEdit, j as ObjectBindingMaterial, q as ObjectBindingTextureSlot, p as ObjectBindingTextureChannel, r as ObjectBindingTransform, z as SceneConfigPatch, E as SceneLight, F as SceneLightAttachment, g as ObjectBindingAction } from './utils-BkdZxLFF.mjs';
7
+ export { A as AnimationAction, a as AnimationActionEffect, b as AnimationLoopMode, C as CameraAction, c as CameraActionEffect, D as DEFAULT_SCENE_CONFIG, M as MATERIAL_BLENDING_MODES, d as MATERIAL_SIDES, O as ObjectActionEffect, h as ObjectBindingActionId, i as ObjectBindingKey, k as ObjectBindingMaterialBlendingMode, l as ObjectBindingMaterialSide, n as ObjectBindingSelector, s as ObjectBindingsActionEffect, S as SceneAnimationClipConfig, t as SceneAnimationConfig, v as SceneCinematicConfig, w as SceneCinematicWaypoint, y as SceneConfigActionEffect, G as SceneLightType, H as SceneModelRenderer, I as VisibilityActionEffect, J as defineObjectBindings, K as material, L as patchBindings, N as patchSceneConfig, P as selectBindingKeys, Q as selectBindings } from './utils-BkdZxLFF.mjs';
8
8
  import { Canvas } from '@react-three/fiber';
9
9
  import { PresetsType } from '@react-three/drei/helpers/environment-assets';
10
10
 
@@ -36,6 +36,19 @@ declare function Viewer({ children, camera, backgroundColor, shadows, sceneConfi
36
36
 
37
37
  type PerformanceProfile = "auto" | "high" | "low";
38
38
 
39
+ type CameraLimits = {
40
+ minDistance?: number;
41
+ maxDistance?: number;
42
+ minPolarAngle?: number;
43
+ maxPolarAngle?: number;
44
+ minAzimuthAngle?: number;
45
+ maxAzimuthAngle?: number;
46
+ panBoundary?: [min: [number, number, number], max: [number, number, number]];
47
+ boundaryEnclosesCamera?: boolean;
48
+ boundaryFriction?: number;
49
+ };
50
+ type CameraControllerType = "orbit" | "pointerLock";
51
+
39
52
  type GltfDecoderConfig = {
40
53
  dracoDecoderPath?: string | false;
41
54
  ktx2TranscoderPath?: string | false;
@@ -268,6 +281,9 @@ type ModelViewerProps = {
268
281
  onObjectEditLeaseChange?: (binding: ObjectBinding, editing: boolean) => void;
269
282
  onModelLoaded?: (scene: Object3D) => void;
270
283
  onLoadError?: (error: unknown) => void;
284
+ onProgress?: (event: ProgressEvent) => void;
285
+ onCameraControllerChange?: (controller: CameraControllerType) => void;
286
+ cameraControllerType?: CameraControllerType;
271
287
  onAction?: (event: ObjectActionEvent) => void;
272
288
  onHiddenObjectsChange?: (next: Record<string, boolean>) => void;
273
289
  onCameraChange?: (camera: Camera, controls: CameraControls) => void;
@@ -279,6 +295,7 @@ type ModelViewerProps = {
279
295
  onActiveAnnotationChange?: (annotation: AnnotationMarker | null) => void;
280
296
  lights?: ReactNode;
281
297
  camera?: ViewerCamera;
298
+ cameraLimits?: CameraLimits;
282
299
  backgroundColor?: string;
283
300
  shadows?: boolean;
284
301
  showObjectBindingDataPanel?: boolean;
@@ -326,8 +343,10 @@ type ModelViewerProps = {
326
343
  showAnnotationOnHover?: boolean;
327
344
  onSceneConfigChange?: (config: SceneConfig) => void;
328
345
  showViewGizmo?: boolean;
346
+ autoRotate?: boolean;
347
+ autoRotateSpeed?: number;
329
348
  };
330
- declare function ModelViewer({ modelUrl, tilesetUrl, tilesErrorTarget, tilesCacheSize, onObjectCatalog, modelFormat, licenseKey, licenseValidationUrl, objectBindings, selectedObject, panelHoveredObject, onObjectBindingsChange, onObjectSelect, onObjectHover, onObjectEditLeaseChange, onModelLoaded, onLoadError, onAction, onHiddenObjectsChange, onCameraChange, onViewerReady, onTextureUpload, onAnimationsReady, onAnnotationsChange, activeAnnotation: controlledActiveAnnotation, onActiveAnnotationChange, lights, camera, backgroundColor, shadows, showObjectBindingDataPanel, customObjectBindingDataPanel, customSceneObjectsPanel, showSceneObjectsPanel, showDownloadButton, downloadFilename, showResetButton, showLoadingOverlay, showMouseController, mouseControllerPosition, mouseControllerOpacity, moveSensitivity, zoomSensitivity, sceneConfig, onSceneConfigChange, disableZoom, zoomOnSelected, highlightOnHover, enableCameraControls, onAutoFit, refitOnResize, renderMode, maxDpr, preserveDrawingBuffer, performanceProfile, dracoDecoderPath, ktx2TranscoderPath, meshopt, showMeasureTools, showUvCheckerButton, showExplodeControls, cinematic, measurementUnit, enableXR, usdzUrl, arScaleMode, mobileHandoffUrl, showAnnotationNavigation, showAnnotationOnHover, moveModeEnabled, objectTransformSpace, enableKeyboardNavigation, showViewGizmo, }: ModelViewerProps): react_jsx_runtime.JSX.Element;
349
+ declare function ModelViewer({ modelUrl, tilesetUrl, tilesErrorTarget, tilesCacheSize, onObjectCatalog, modelFormat, licenseKey, licenseValidationUrl, objectBindings, selectedObject, panelHoveredObject, onObjectBindingsChange, onObjectSelect, onObjectHover, onObjectEditLeaseChange, onModelLoaded, onLoadError, onProgress, onCameraControllerChange, cameraControllerType, onAction, onHiddenObjectsChange, onCameraChange, onViewerReady, onTextureUpload, onAnimationsReady, onAnnotationsChange, activeAnnotation: controlledActiveAnnotation, onActiveAnnotationChange, lights, camera, cameraLimits, backgroundColor, shadows, showObjectBindingDataPanel, customObjectBindingDataPanel, customSceneObjectsPanel, showSceneObjectsPanel, showDownloadButton, downloadFilename, showResetButton, showLoadingOverlay, showMouseController, mouseControllerPosition, mouseControllerOpacity, moveSensitivity, zoomSensitivity, sceneConfig, onSceneConfigChange, disableZoom, zoomOnSelected, highlightOnHover, enableCameraControls, onAutoFit, refitOnResize, renderMode, maxDpr, preserveDrawingBuffer, performanceProfile, dracoDecoderPath, ktx2TranscoderPath, meshopt, showMeasureTools, showUvCheckerButton, showExplodeControls, cinematic, measurementUnit, enableXR, usdzUrl, arScaleMode, mobileHandoffUrl, showAnnotationNavigation, showAnnotationOnHover, moveModeEnabled, objectTransformSpace, enableKeyboardNavigation, showViewGizmo, autoRotate, autoRotateSpeed, }: ModelViewerProps): react_jsx_runtime.JSX.Element;
331
350
 
332
351
  type BindingBuilderProjectModel = {
333
352
  url: string;
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ import { ComponentProps, ReactNode, MutableRefObject } from 'react';
3
3
  import { CameraControls } from '@react-three/drei';
4
4
  import { Object3D, WebGLRenderer, Scene, Camera, Box3, Material } from 'three';
5
5
  import { XRStore } from '@react-three/xr';
6
- import { x as SceneConfig, f as ObjectBinding, V as ViewerCameraState, e as ObjectActionEvent, u as SceneAnnotationMarker, o as ObjectBindingTarget, m as ObjectBindingPatch, B as BindingEdit, j as ObjectBindingMaterial, q as ObjectBindingTextureSlot, p as ObjectBindingTextureChannel, r as ObjectBindingTransform, z as SceneConfigPatch, E as SceneLight, F as SceneLightAttachment, g as ObjectBindingAction } from './utils-BUwXD_DX.js';
7
- export { A as AnimationAction, a as AnimationActionEffect, b as AnimationLoopMode, C as CameraAction, c as CameraActionEffect, D as DEFAULT_SCENE_CONFIG, M as MATERIAL_BLENDING_MODES, d as MATERIAL_SIDES, O as ObjectActionEffect, h as ObjectBindingActionId, i as ObjectBindingKey, k as ObjectBindingMaterialBlendingMode, l as ObjectBindingMaterialSide, n as ObjectBindingSelector, s as ObjectBindingsActionEffect, S as SceneAnimationClipConfig, t as SceneAnimationConfig, v as SceneCinematicConfig, w as SceneCinematicWaypoint, y as SceneConfigActionEffect, G as SceneLightType, H as SceneModelRenderer, I as VisibilityActionEffect, J as defineObjectBindings, K as material, L as patchBindings, N as patchSceneConfig, P as selectBindingKeys, Q as selectBindings } from './utils-BUwXD_DX.js';
6
+ import { x as SceneConfig, f as ObjectBinding, V as ViewerCameraState, e as ObjectActionEvent, u as SceneAnnotationMarker, o as ObjectBindingTarget, m as ObjectBindingPatch, B as BindingEdit, j as ObjectBindingMaterial, q as ObjectBindingTextureSlot, p as ObjectBindingTextureChannel, r as ObjectBindingTransform, z as SceneConfigPatch, E as SceneLight, F as SceneLightAttachment, g as ObjectBindingAction } from './utils-BkdZxLFF.js';
7
+ export { A as AnimationAction, a as AnimationActionEffect, b as AnimationLoopMode, C as CameraAction, c as CameraActionEffect, D as DEFAULT_SCENE_CONFIG, M as MATERIAL_BLENDING_MODES, d as MATERIAL_SIDES, O as ObjectActionEffect, h as ObjectBindingActionId, i as ObjectBindingKey, k as ObjectBindingMaterialBlendingMode, l as ObjectBindingMaterialSide, n as ObjectBindingSelector, s as ObjectBindingsActionEffect, S as SceneAnimationClipConfig, t as SceneAnimationConfig, v as SceneCinematicConfig, w as SceneCinematicWaypoint, y as SceneConfigActionEffect, G as SceneLightType, H as SceneModelRenderer, I as VisibilityActionEffect, J as defineObjectBindings, K as material, L as patchBindings, N as patchSceneConfig, P as selectBindingKeys, Q as selectBindings } from './utils-BkdZxLFF.js';
8
8
  import { Canvas } from '@react-three/fiber';
9
9
  import { PresetsType } from '@react-three/drei/helpers/environment-assets';
10
10
 
@@ -36,6 +36,19 @@ declare function Viewer({ children, camera, backgroundColor, shadows, sceneConfi
36
36
 
37
37
  type PerformanceProfile = "auto" | "high" | "low";
38
38
 
39
+ type CameraLimits = {
40
+ minDistance?: number;
41
+ maxDistance?: number;
42
+ minPolarAngle?: number;
43
+ maxPolarAngle?: number;
44
+ minAzimuthAngle?: number;
45
+ maxAzimuthAngle?: number;
46
+ panBoundary?: [min: [number, number, number], max: [number, number, number]];
47
+ boundaryEnclosesCamera?: boolean;
48
+ boundaryFriction?: number;
49
+ };
50
+ type CameraControllerType = "orbit" | "pointerLock";
51
+
39
52
  type GltfDecoderConfig = {
40
53
  dracoDecoderPath?: string | false;
41
54
  ktx2TranscoderPath?: string | false;
@@ -268,6 +281,9 @@ type ModelViewerProps = {
268
281
  onObjectEditLeaseChange?: (binding: ObjectBinding, editing: boolean) => void;
269
282
  onModelLoaded?: (scene: Object3D) => void;
270
283
  onLoadError?: (error: unknown) => void;
284
+ onProgress?: (event: ProgressEvent) => void;
285
+ onCameraControllerChange?: (controller: CameraControllerType) => void;
286
+ cameraControllerType?: CameraControllerType;
271
287
  onAction?: (event: ObjectActionEvent) => void;
272
288
  onHiddenObjectsChange?: (next: Record<string, boolean>) => void;
273
289
  onCameraChange?: (camera: Camera, controls: CameraControls) => void;
@@ -279,6 +295,7 @@ type ModelViewerProps = {
279
295
  onActiveAnnotationChange?: (annotation: AnnotationMarker | null) => void;
280
296
  lights?: ReactNode;
281
297
  camera?: ViewerCamera;
298
+ cameraLimits?: CameraLimits;
282
299
  backgroundColor?: string;
283
300
  shadows?: boolean;
284
301
  showObjectBindingDataPanel?: boolean;
@@ -326,8 +343,10 @@ type ModelViewerProps = {
326
343
  showAnnotationOnHover?: boolean;
327
344
  onSceneConfigChange?: (config: SceneConfig) => void;
328
345
  showViewGizmo?: boolean;
346
+ autoRotate?: boolean;
347
+ autoRotateSpeed?: number;
329
348
  };
330
- declare function ModelViewer({ modelUrl, tilesetUrl, tilesErrorTarget, tilesCacheSize, onObjectCatalog, modelFormat, licenseKey, licenseValidationUrl, objectBindings, selectedObject, panelHoveredObject, onObjectBindingsChange, onObjectSelect, onObjectHover, onObjectEditLeaseChange, onModelLoaded, onLoadError, onAction, onHiddenObjectsChange, onCameraChange, onViewerReady, onTextureUpload, onAnimationsReady, onAnnotationsChange, activeAnnotation: controlledActiveAnnotation, onActiveAnnotationChange, lights, camera, backgroundColor, shadows, showObjectBindingDataPanel, customObjectBindingDataPanel, customSceneObjectsPanel, showSceneObjectsPanel, showDownloadButton, downloadFilename, showResetButton, showLoadingOverlay, showMouseController, mouseControllerPosition, mouseControllerOpacity, moveSensitivity, zoomSensitivity, sceneConfig, onSceneConfigChange, disableZoom, zoomOnSelected, highlightOnHover, enableCameraControls, onAutoFit, refitOnResize, renderMode, maxDpr, preserveDrawingBuffer, performanceProfile, dracoDecoderPath, ktx2TranscoderPath, meshopt, showMeasureTools, showUvCheckerButton, showExplodeControls, cinematic, measurementUnit, enableXR, usdzUrl, arScaleMode, mobileHandoffUrl, showAnnotationNavigation, showAnnotationOnHover, moveModeEnabled, objectTransformSpace, enableKeyboardNavigation, showViewGizmo, }: ModelViewerProps): react_jsx_runtime.JSX.Element;
349
+ declare function ModelViewer({ modelUrl, tilesetUrl, tilesErrorTarget, tilesCacheSize, onObjectCatalog, modelFormat, licenseKey, licenseValidationUrl, objectBindings, selectedObject, panelHoveredObject, onObjectBindingsChange, onObjectSelect, onObjectHover, onObjectEditLeaseChange, onModelLoaded, onLoadError, onProgress, onCameraControllerChange, cameraControllerType, onAction, onHiddenObjectsChange, onCameraChange, onViewerReady, onTextureUpload, onAnimationsReady, onAnnotationsChange, activeAnnotation: controlledActiveAnnotation, onActiveAnnotationChange, lights, camera, cameraLimits, backgroundColor, shadows, showObjectBindingDataPanel, customObjectBindingDataPanel, customSceneObjectsPanel, showSceneObjectsPanel, showDownloadButton, downloadFilename, showResetButton, showLoadingOverlay, showMouseController, mouseControllerPosition, mouseControllerOpacity, moveSensitivity, zoomSensitivity, sceneConfig, onSceneConfigChange, disableZoom, zoomOnSelected, highlightOnHover, enableCameraControls, onAutoFit, refitOnResize, renderMode, maxDpr, preserveDrawingBuffer, performanceProfile, dracoDecoderPath, ktx2TranscoderPath, meshopt, showMeasureTools, showUvCheckerButton, showExplodeControls, cinematic, measurementUnit, enableXR, usdzUrl, arScaleMode, mobileHandoffUrl, showAnnotationNavigation, showAnnotationOnHover, moveModeEnabled, objectTransformSpace, enableKeyboardNavigation, showViewGizmo, autoRotate, autoRotateSpeed, }: ModelViewerProps): react_jsx_runtime.JSX.Element;
331
350
 
332
351
  type BindingBuilderProjectModel = {
333
352
  url: string;