@liveroom-tech/react-immersive 5.0.2 → 5.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/README.md +580 -38
- package/dist/{ModelViewer-DOexHkJC.d.ts → ModelViewer-Bj-KjiDL.d.mts} +91 -42
- package/dist/{ModelViewer-CbbJT85n.d.mts → ModelViewer-BkQ73y6N.d.ts} +91 -42
- package/dist/binding-builder.css +1 -1
- package/dist/binding-builder.js +13 -12
- package/dist/binding-builder.mjs +1 -1
- package/dist/chunk-32WCLPTZ.mjs +1 -0
- package/dist/chunk-CSGNL4XU.mjs +3 -0
- package/dist/chunk-F2ILTIPG.mjs +28 -0
- package/dist/chunk-V6GALFL5.mjs +1 -0
- package/dist/chunk-WN6GMMHF.mjs +1 -0
- package/dist/hosted.css +1 -1
- package/dist/hosted.d.mts +3 -3
- package/dist/hosted.d.ts +3 -3
- package/dist/hosted.js +12 -11
- package/dist/hosted.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +54 -10
- package/dist/index.d.ts +54 -10
- package/dist/index.js +11 -10
- package/dist/index.mjs +1 -1
- package/dist/{modelInfo-CEmmvVCH.d.mts → modelInfo-DnkmTGMd.d.mts} +6 -0
- package/dist/{modelInfo-CEmmvVCH.d.ts → modelInfo-DnkmTGMd.d.ts} +6 -0
- package/dist/{objectCatalog-5W8n5xNQ.d.ts → objectCatalog-BIeXURoq.d.mts} +276 -5
- package/dist/{objectCatalog-5W8n5xNQ.d.mts → objectCatalog-BIeXURoq.d.ts} +276 -5
- package/dist/simple-model-viewer.d.mts +2 -2
- package/dist/simple-model-viewer.d.ts +2 -2
- package/dist/simple-model-viewer.js +3 -3
- package/dist/simple-model-viewer.mjs +1 -1
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-3GX7DOGS.mjs +0 -3
- package/dist/chunk-AH5NAZWX.mjs +0 -27
- package/dist/chunk-BGYK4Y2Y.mjs +0 -1
- package/dist/chunk-WFEYRUZC.mjs +0 -1
- package/dist/chunk-XTLSAYAQ.mjs +0 -1
|
@@ -1,9 +1,52 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { M as ModelFormat, a as ViewerModelInfo } from './modelInfo-
|
|
2
|
+
import { r as ObjectBindingDecal, Q as ObjectSurfacePoint, o as ObjectBinding, al as ViewerCameraState, U as SceneAnnotationMarker, n as ObjectActionEvent, an as ViewerObjectInfo, P as ObjectPointerEvent, e as AnimationControls, ak as ViewerCameraConfig, Z as SceneConfig, am as ViewerIsolation } from './objectCatalog-BIeXURoq.mjs';
|
|
3
|
+
import { M as ModelFormat, a as ViewerModelInfo } from './modelInfo-DnkmTGMd.mjs';
|
|
4
4
|
import { CameraControls } from '@react-three/drei';
|
|
5
5
|
import { Object3D } from 'three';
|
|
6
6
|
|
|
7
|
+
/** Engagement from deliberate viewer interactions, with model/session context. */
|
|
8
|
+
type ViewerEngagementEvent = {
|
|
9
|
+
/** Ephemeral identifier for this viewer/model session; no persistent storage. */
|
|
10
|
+
sessionId: string;
|
|
11
|
+
/** ISO timestamp of the event. */
|
|
12
|
+
timestamp: string;
|
|
13
|
+
/** Milliseconds since tracking started for this model. */
|
|
14
|
+
elapsedMs: number;
|
|
15
|
+
modelUrl: string;
|
|
16
|
+
tilesetUrl: string | null;
|
|
17
|
+
} & ({
|
|
18
|
+
type: "part-viewed";
|
|
19
|
+
objectId: string;
|
|
20
|
+
objectKey: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
source: "canvas" | "panel";
|
|
23
|
+
} | {
|
|
24
|
+
type: "variant-chosen";
|
|
25
|
+
variant: string | null;
|
|
26
|
+
previousVariant: string | null;
|
|
27
|
+
} | {
|
|
28
|
+
type: "ar-started";
|
|
29
|
+
} | {
|
|
30
|
+
type: "ar-ended";
|
|
31
|
+
durationMs: number;
|
|
32
|
+
reason: "session-ended" | "interrupted";
|
|
33
|
+
} | {
|
|
34
|
+
type: "ar-launch-requested";
|
|
35
|
+
channel: "quick-look" | "mobile-handoff";
|
|
36
|
+
} | {
|
|
37
|
+
type: "tour-started";
|
|
38
|
+
annotationCount: number;
|
|
39
|
+
} | {
|
|
40
|
+
type: "tour-completed";
|
|
41
|
+
annotationCount: number;
|
|
42
|
+
durationMs: number;
|
|
43
|
+
} | {
|
|
44
|
+
type: "tour-stopped";
|
|
45
|
+
annotationCount: number;
|
|
46
|
+
durationMs: number;
|
|
47
|
+
reason: "stopped" | "restarted" | "annotations-changed" | "interrupted";
|
|
48
|
+
});
|
|
49
|
+
|
|
7
50
|
type CameraLimits = {
|
|
8
51
|
/** Closest the camera can get to its target, in scene units. Default 0. */
|
|
9
52
|
minDistance?: number;
|
|
@@ -49,6 +92,8 @@ type ModelViewerUiOptions = {
|
|
|
49
92
|
download?: boolean | string;
|
|
50
93
|
/** The reset-view button. Default `true`. */
|
|
51
94
|
reset?: boolean;
|
|
95
|
+
/** The viewer fullscreen toggle in the action bar. Default `false`. */
|
|
96
|
+
fullscreen?: boolean;
|
|
52
97
|
/** The loading overlay and load-error message. Default `true`. */
|
|
53
98
|
loadingOverlay?: boolean;
|
|
54
99
|
/** The axis gizmo in the top-right corner. Default `false`. */
|
|
@@ -64,6 +109,8 @@ type ModelViewerUiOptions = {
|
|
|
64
109
|
annotationOnHover?: boolean;
|
|
65
110
|
/** Highlight objects under the pointer. Default `true`. */
|
|
66
111
|
highlightOnHover?: boolean;
|
|
112
|
+
/** Buttons for the model's glTF material variants, when it has more than one. Default `true`. */
|
|
113
|
+
materialVariants?: boolean;
|
|
67
114
|
};
|
|
68
115
|
/**
|
|
69
116
|
* Takes over parts of texture positioning (`texturePositioning`). Fields left
|
|
@@ -92,6 +139,10 @@ type ModelViewerToolsOptions = {
|
|
|
92
139
|
uvChecker?: boolean;
|
|
93
140
|
/** The exploded-view slider. Default `false`. */
|
|
94
141
|
explode?: boolean;
|
|
142
|
+
/** The section-cut tool, to cut the model open along an axis. Default `false`. */
|
|
143
|
+
section?: boolean;
|
|
144
|
+
/** Isolate buttons in the scene objects panel, and a "Show all" pill. Default `false`. */
|
|
145
|
+
isolate?: boolean;
|
|
95
146
|
/** Texture offset, rotation and Move/Zoom for textured objects. Default `false`. */
|
|
96
147
|
texturePositioning?: boolean | TexturePositioningControls;
|
|
97
148
|
};
|
|
@@ -168,6 +219,13 @@ type GroupedModelViewerProps = {
|
|
|
168
219
|
/** What each preset sets. Props that aren't listed keep their defaults. */
|
|
169
220
|
declare const MODEL_VIEWER_PRESETS: Readonly<Record<ModelViewerPreset, Readonly<Partial<ModelViewerProps>>>>;
|
|
170
221
|
|
|
222
|
+
type DecalMoveTarget = {
|
|
223
|
+
objectId: string;
|
|
224
|
+
decal: ObjectBindingDecal;
|
|
225
|
+
onCommit: (surface: ObjectSurfacePoint) => void;
|
|
226
|
+
onCancel: () => void;
|
|
227
|
+
};
|
|
228
|
+
|
|
171
229
|
type CameraControllerType = "orbit" | "pointerLock";
|
|
172
230
|
|
|
173
231
|
type CinematicWaypoint = {
|
|
@@ -195,6 +253,21 @@ type CaptureImageOptions = {
|
|
|
195
253
|
transparent?: boolean;
|
|
196
254
|
};
|
|
197
255
|
|
|
256
|
+
type CaptureVideoOptions = {
|
|
257
|
+
/** Defaults to cinematic when a path is enabled, otherwise turntable. */
|
|
258
|
+
mode?: "cinematic" | "turntable";
|
|
259
|
+
/** Auto prefers WebM, then MP4. Explicit formats reject if unsupported. */
|
|
260
|
+
format?: "auto" | "webm" | "mp4";
|
|
261
|
+
/** Seconds per pass, in (0, 300]. Defaults to path timing or a 24s orbit. */
|
|
262
|
+
duration?: number;
|
|
263
|
+
/** Capture frame rate, from 1 to 60. Default 30. */
|
|
264
|
+
fps?: number;
|
|
265
|
+
/** Encoder target bitrate in bits per second. Default 8,000,000. */
|
|
266
|
+
videoBitsPerSecond?: number;
|
|
267
|
+
/** Aborting discards the recording and restores the viewer. */
|
|
268
|
+
signal?: AbortSignal;
|
|
269
|
+
};
|
|
270
|
+
|
|
198
271
|
type ViewerCameraPreset = {
|
|
199
272
|
position: [number, number, number];
|
|
200
273
|
target: [number, number, number];
|
|
@@ -221,6 +294,8 @@ type ViewerReadyState = {
|
|
|
221
294
|
objectBindings: Record<string, ObjectBinding>;
|
|
222
295
|
homeCameraState: HomeCameraState | null;
|
|
223
296
|
captureImage: (options?: CaptureImageOptions) => Promise<string>;
|
|
297
|
+
/** Records one cinematic pass or turntable revolution as a video Blob. */
|
|
298
|
+
captureVideo: (options?: CaptureVideoOptions) => Promise<Blob>;
|
|
224
299
|
invalidate: () => void;
|
|
225
300
|
/**
|
|
226
301
|
* The live three.js scene, camera-controls instance, and model nodes, for
|
|
@@ -257,45 +332,6 @@ type ViewerCameraProps = {
|
|
|
257
332
|
};
|
|
258
333
|
declare function useViewerCamera(options?: UseViewerCameraOptions): ViewerCameraProps;
|
|
259
334
|
|
|
260
|
-
type AnimationClipInfo = {
|
|
261
|
-
sourceName: string;
|
|
262
|
-
duration: number;
|
|
263
|
-
};
|
|
264
|
-
type AnimationPlaybackState = {
|
|
265
|
-
currentClip: string | null;
|
|
266
|
-
isPlaying: boolean;
|
|
267
|
-
speed: number;
|
|
268
|
-
time: number;
|
|
269
|
-
duration: number;
|
|
270
|
-
};
|
|
271
|
-
type AnimationControls = {
|
|
272
|
-
clips: string[];
|
|
273
|
-
clipDetails?: AnimationClipInfo[];
|
|
274
|
-
play: (clipName: string) => void;
|
|
275
|
-
pause: () => void;
|
|
276
|
-
stop: () => void;
|
|
277
|
-
setSpeed: (speed: number) => void;
|
|
278
|
-
seek?: (time: number) => void;
|
|
279
|
-
getState?: () => AnimationPlaybackState;
|
|
280
|
-
subscribe?: (listener: (state: AnimationPlaybackState) => void) => () => void;
|
|
281
|
-
};
|
|
282
|
-
type ViewerAnimationsProps = {
|
|
283
|
-
clips: string[];
|
|
284
|
-
clipDetails: AnimationClipInfo[];
|
|
285
|
-
currentClip: string | null;
|
|
286
|
-
isPlaying: boolean;
|
|
287
|
-
speed: number;
|
|
288
|
-
time: number;
|
|
289
|
-
duration: number;
|
|
290
|
-
play: (clipName: string) => void;
|
|
291
|
-
pause: () => void;
|
|
292
|
-
stop: () => void;
|
|
293
|
-
setSpeed: (speed: number) => void;
|
|
294
|
-
seek: (time: number) => void;
|
|
295
|
-
handleAnimationsReady: (controls: AnimationControls) => void;
|
|
296
|
-
};
|
|
297
|
-
declare function useViewerAnimations(): ViewerAnimationsProps;
|
|
298
|
-
|
|
299
335
|
type ObjectTransformSpace = "local" | "world";
|
|
300
336
|
|
|
301
337
|
type AnnotationMarker = SceneAnnotationMarker & {
|
|
@@ -354,6 +390,8 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
354
390
|
* open your own menu at `clientX`/`clientY`. A right-drag still pans.
|
|
355
391
|
*/
|
|
356
392
|
onObjectContextMenu?: (event: ObjectPointerEvent) => void;
|
|
393
|
+
/** Editor preview: grab this decal and drag it over its object's surface. */
|
|
394
|
+
decalMove?: DecalMoveTarget | null;
|
|
357
395
|
/** The model finished loading: its bounds and mesh count. */
|
|
358
396
|
onModelLoaded?: (model: ViewerModelInfo) => void;
|
|
359
397
|
onLoadError?: (error: unknown) => void;
|
|
@@ -362,6 +400,10 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
362
400
|
cameraControllerType?: CameraControllerType;
|
|
363
401
|
onAction?: (event: ObjectActionEvent) => void;
|
|
364
402
|
onHiddenObjectsChange?: (next: Record<string, boolean>) => void;
|
|
403
|
+
/** Opt-in interaction analytics; no telemetry is sent by the viewer. */
|
|
404
|
+
onEngagement?: (event: ViewerEngagementEvent) => void | Promise<void>;
|
|
405
|
+
/** Log engagement events in the developer console. Default `false`. */
|
|
406
|
+
debugEngagement?: boolean;
|
|
365
407
|
/** The camera moved. Fires often while the user orbits, pans or zooms. */
|
|
366
408
|
onCameraChange?: (state: ViewerCameraState) => void;
|
|
367
409
|
onViewerReady?: (viewer: ViewerReadyState) => void;
|
|
@@ -381,6 +423,8 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
381
423
|
showDownloadButton?: boolean;
|
|
382
424
|
downloadFilename?: string;
|
|
383
425
|
showResetButton?: boolean;
|
|
426
|
+
/** Fullscreen action button; grouped form: `ui.fullscreen`. Default `false`. */
|
|
427
|
+
showFullscreenButton?: boolean;
|
|
384
428
|
showLoadingOverlay?: boolean;
|
|
385
429
|
showMouseController?: boolean;
|
|
386
430
|
mouseControllerPosition?: MouseControllerPosition;
|
|
@@ -409,6 +453,11 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
409
453
|
showMeasureTools?: boolean;
|
|
410
454
|
showUvCheckerButton?: boolean;
|
|
411
455
|
showExplodeControls?: boolean;
|
|
456
|
+
isolation?: ViewerIsolation | null;
|
|
457
|
+
onIsolationChange?: (isolation: ViewerIsolation | null) => void;
|
|
458
|
+
showIsolateControls?: boolean;
|
|
459
|
+
showSectionTools?: boolean;
|
|
460
|
+
showMaterialVariants?: boolean;
|
|
412
461
|
cinematic?: boolean | CinematicConfig;
|
|
413
462
|
measurementUnit?: string;
|
|
414
463
|
enableXR?: boolean;
|
|
@@ -445,4 +494,4 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
445
494
|
texturePositioning?: boolean | TexturePositioningControls;
|
|
446
495
|
};
|
|
447
496
|
|
|
448
|
-
export { type
|
|
497
|
+
export { type AnnotationMarker as A, type CameraControllerType as C, type DecalMoveTarget as D, type GroupedModelViewerProps as G, type HomeCameraState as H, MODEL_VIEWER_PRESETS as M, type ObjectTransformSpace as O, type PerformanceProfile as P, type TexturePositioningControls as T, type UseViewerCameraOptions as U, type ViewerCameraPreset as V, type XRScaleMode as X, type CameraLimits as a, type CaptureImageOptions as b, type CaptureVideoOptions as c, type CinematicConfig as d, type CinematicWaypoint as e, type CustomObjectBindingDataPanelProps as f, type CustomSceneObjectsPanelProps as g, type ModelViewerControlsOptions as h, type ModelViewerDecoderOptions as i, type ModelViewerPerfOptions as j, type ModelViewerPreset as k, type ModelViewerProps as l, type ModelViewerTilesOptions as m, type ModelViewerToolsOptions as n, type ModelViewerUiOptions as o, type ModelViewerXrOptions as p, type MouseControllerPosition as q, type ViewerCameraProps as r, type ViewerEngagementEvent as s, type ViewerReadyState as t, useViewerCamera as u };
|
|
@@ -1,9 +1,52 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { M as ModelFormat, a as ViewerModelInfo } from './modelInfo-
|
|
2
|
+
import { r as ObjectBindingDecal, Q as ObjectSurfacePoint, o as ObjectBinding, al as ViewerCameraState, U as SceneAnnotationMarker, n as ObjectActionEvent, an as ViewerObjectInfo, P as ObjectPointerEvent, e as AnimationControls, ak as ViewerCameraConfig, Z as SceneConfig, am as ViewerIsolation } from './objectCatalog-BIeXURoq.js';
|
|
3
|
+
import { M as ModelFormat, a as ViewerModelInfo } from './modelInfo-DnkmTGMd.js';
|
|
4
4
|
import { CameraControls } from '@react-three/drei';
|
|
5
5
|
import { Object3D } from 'three';
|
|
6
6
|
|
|
7
|
+
/** Engagement from deliberate viewer interactions, with model/session context. */
|
|
8
|
+
type ViewerEngagementEvent = {
|
|
9
|
+
/** Ephemeral identifier for this viewer/model session; no persistent storage. */
|
|
10
|
+
sessionId: string;
|
|
11
|
+
/** ISO timestamp of the event. */
|
|
12
|
+
timestamp: string;
|
|
13
|
+
/** Milliseconds since tracking started for this model. */
|
|
14
|
+
elapsedMs: number;
|
|
15
|
+
modelUrl: string;
|
|
16
|
+
tilesetUrl: string | null;
|
|
17
|
+
} & ({
|
|
18
|
+
type: "part-viewed";
|
|
19
|
+
objectId: string;
|
|
20
|
+
objectKey: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
source: "canvas" | "panel";
|
|
23
|
+
} | {
|
|
24
|
+
type: "variant-chosen";
|
|
25
|
+
variant: string | null;
|
|
26
|
+
previousVariant: string | null;
|
|
27
|
+
} | {
|
|
28
|
+
type: "ar-started";
|
|
29
|
+
} | {
|
|
30
|
+
type: "ar-ended";
|
|
31
|
+
durationMs: number;
|
|
32
|
+
reason: "session-ended" | "interrupted";
|
|
33
|
+
} | {
|
|
34
|
+
type: "ar-launch-requested";
|
|
35
|
+
channel: "quick-look" | "mobile-handoff";
|
|
36
|
+
} | {
|
|
37
|
+
type: "tour-started";
|
|
38
|
+
annotationCount: number;
|
|
39
|
+
} | {
|
|
40
|
+
type: "tour-completed";
|
|
41
|
+
annotationCount: number;
|
|
42
|
+
durationMs: number;
|
|
43
|
+
} | {
|
|
44
|
+
type: "tour-stopped";
|
|
45
|
+
annotationCount: number;
|
|
46
|
+
durationMs: number;
|
|
47
|
+
reason: "stopped" | "restarted" | "annotations-changed" | "interrupted";
|
|
48
|
+
});
|
|
49
|
+
|
|
7
50
|
type CameraLimits = {
|
|
8
51
|
/** Closest the camera can get to its target, in scene units. Default 0. */
|
|
9
52
|
minDistance?: number;
|
|
@@ -49,6 +92,8 @@ type ModelViewerUiOptions = {
|
|
|
49
92
|
download?: boolean | string;
|
|
50
93
|
/** The reset-view button. Default `true`. */
|
|
51
94
|
reset?: boolean;
|
|
95
|
+
/** The viewer fullscreen toggle in the action bar. Default `false`. */
|
|
96
|
+
fullscreen?: boolean;
|
|
52
97
|
/** The loading overlay and load-error message. Default `true`. */
|
|
53
98
|
loadingOverlay?: boolean;
|
|
54
99
|
/** The axis gizmo in the top-right corner. Default `false`. */
|
|
@@ -64,6 +109,8 @@ type ModelViewerUiOptions = {
|
|
|
64
109
|
annotationOnHover?: boolean;
|
|
65
110
|
/** Highlight objects under the pointer. Default `true`. */
|
|
66
111
|
highlightOnHover?: boolean;
|
|
112
|
+
/** Buttons for the model's glTF material variants, when it has more than one. Default `true`. */
|
|
113
|
+
materialVariants?: boolean;
|
|
67
114
|
};
|
|
68
115
|
/**
|
|
69
116
|
* Takes over parts of texture positioning (`texturePositioning`). Fields left
|
|
@@ -92,6 +139,10 @@ type ModelViewerToolsOptions = {
|
|
|
92
139
|
uvChecker?: boolean;
|
|
93
140
|
/** The exploded-view slider. Default `false`. */
|
|
94
141
|
explode?: boolean;
|
|
142
|
+
/** The section-cut tool, to cut the model open along an axis. Default `false`. */
|
|
143
|
+
section?: boolean;
|
|
144
|
+
/** Isolate buttons in the scene objects panel, and a "Show all" pill. Default `false`. */
|
|
145
|
+
isolate?: boolean;
|
|
95
146
|
/** Texture offset, rotation and Move/Zoom for textured objects. Default `false`. */
|
|
96
147
|
texturePositioning?: boolean | TexturePositioningControls;
|
|
97
148
|
};
|
|
@@ -168,6 +219,13 @@ type GroupedModelViewerProps = {
|
|
|
168
219
|
/** What each preset sets. Props that aren't listed keep their defaults. */
|
|
169
220
|
declare const MODEL_VIEWER_PRESETS: Readonly<Record<ModelViewerPreset, Readonly<Partial<ModelViewerProps>>>>;
|
|
170
221
|
|
|
222
|
+
type DecalMoveTarget = {
|
|
223
|
+
objectId: string;
|
|
224
|
+
decal: ObjectBindingDecal;
|
|
225
|
+
onCommit: (surface: ObjectSurfacePoint) => void;
|
|
226
|
+
onCancel: () => void;
|
|
227
|
+
};
|
|
228
|
+
|
|
171
229
|
type CameraControllerType = "orbit" | "pointerLock";
|
|
172
230
|
|
|
173
231
|
type CinematicWaypoint = {
|
|
@@ -195,6 +253,21 @@ type CaptureImageOptions = {
|
|
|
195
253
|
transparent?: boolean;
|
|
196
254
|
};
|
|
197
255
|
|
|
256
|
+
type CaptureVideoOptions = {
|
|
257
|
+
/** Defaults to cinematic when a path is enabled, otherwise turntable. */
|
|
258
|
+
mode?: "cinematic" | "turntable";
|
|
259
|
+
/** Auto prefers WebM, then MP4. Explicit formats reject if unsupported. */
|
|
260
|
+
format?: "auto" | "webm" | "mp4";
|
|
261
|
+
/** Seconds per pass, in (0, 300]. Defaults to path timing or a 24s orbit. */
|
|
262
|
+
duration?: number;
|
|
263
|
+
/** Capture frame rate, from 1 to 60. Default 30. */
|
|
264
|
+
fps?: number;
|
|
265
|
+
/** Encoder target bitrate in bits per second. Default 8,000,000. */
|
|
266
|
+
videoBitsPerSecond?: number;
|
|
267
|
+
/** Aborting discards the recording and restores the viewer. */
|
|
268
|
+
signal?: AbortSignal;
|
|
269
|
+
};
|
|
270
|
+
|
|
198
271
|
type ViewerCameraPreset = {
|
|
199
272
|
position: [number, number, number];
|
|
200
273
|
target: [number, number, number];
|
|
@@ -221,6 +294,8 @@ type ViewerReadyState = {
|
|
|
221
294
|
objectBindings: Record<string, ObjectBinding>;
|
|
222
295
|
homeCameraState: HomeCameraState | null;
|
|
223
296
|
captureImage: (options?: CaptureImageOptions) => Promise<string>;
|
|
297
|
+
/** Records one cinematic pass or turntable revolution as a video Blob. */
|
|
298
|
+
captureVideo: (options?: CaptureVideoOptions) => Promise<Blob>;
|
|
224
299
|
invalidate: () => void;
|
|
225
300
|
/**
|
|
226
301
|
* The live three.js scene, camera-controls instance, and model nodes, for
|
|
@@ -257,45 +332,6 @@ type ViewerCameraProps = {
|
|
|
257
332
|
};
|
|
258
333
|
declare function useViewerCamera(options?: UseViewerCameraOptions): ViewerCameraProps;
|
|
259
334
|
|
|
260
|
-
type AnimationClipInfo = {
|
|
261
|
-
sourceName: string;
|
|
262
|
-
duration: number;
|
|
263
|
-
};
|
|
264
|
-
type AnimationPlaybackState = {
|
|
265
|
-
currentClip: string | null;
|
|
266
|
-
isPlaying: boolean;
|
|
267
|
-
speed: number;
|
|
268
|
-
time: number;
|
|
269
|
-
duration: number;
|
|
270
|
-
};
|
|
271
|
-
type AnimationControls = {
|
|
272
|
-
clips: string[];
|
|
273
|
-
clipDetails?: AnimationClipInfo[];
|
|
274
|
-
play: (clipName: string) => void;
|
|
275
|
-
pause: () => void;
|
|
276
|
-
stop: () => void;
|
|
277
|
-
setSpeed: (speed: number) => void;
|
|
278
|
-
seek?: (time: number) => void;
|
|
279
|
-
getState?: () => AnimationPlaybackState;
|
|
280
|
-
subscribe?: (listener: (state: AnimationPlaybackState) => void) => () => void;
|
|
281
|
-
};
|
|
282
|
-
type ViewerAnimationsProps = {
|
|
283
|
-
clips: string[];
|
|
284
|
-
clipDetails: AnimationClipInfo[];
|
|
285
|
-
currentClip: string | null;
|
|
286
|
-
isPlaying: boolean;
|
|
287
|
-
speed: number;
|
|
288
|
-
time: number;
|
|
289
|
-
duration: number;
|
|
290
|
-
play: (clipName: string) => void;
|
|
291
|
-
pause: () => void;
|
|
292
|
-
stop: () => void;
|
|
293
|
-
setSpeed: (speed: number) => void;
|
|
294
|
-
seek: (time: number) => void;
|
|
295
|
-
handleAnimationsReady: (controls: AnimationControls) => void;
|
|
296
|
-
};
|
|
297
|
-
declare function useViewerAnimations(): ViewerAnimationsProps;
|
|
298
|
-
|
|
299
335
|
type ObjectTransformSpace = "local" | "world";
|
|
300
336
|
|
|
301
337
|
type AnnotationMarker = SceneAnnotationMarker & {
|
|
@@ -354,6 +390,8 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
354
390
|
* open your own menu at `clientX`/`clientY`. A right-drag still pans.
|
|
355
391
|
*/
|
|
356
392
|
onObjectContextMenu?: (event: ObjectPointerEvent) => void;
|
|
393
|
+
/** Editor preview: grab this decal and drag it over its object's surface. */
|
|
394
|
+
decalMove?: DecalMoveTarget | null;
|
|
357
395
|
/** The model finished loading: its bounds and mesh count. */
|
|
358
396
|
onModelLoaded?: (model: ViewerModelInfo) => void;
|
|
359
397
|
onLoadError?: (error: unknown) => void;
|
|
@@ -362,6 +400,10 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
362
400
|
cameraControllerType?: CameraControllerType;
|
|
363
401
|
onAction?: (event: ObjectActionEvent) => void;
|
|
364
402
|
onHiddenObjectsChange?: (next: Record<string, boolean>) => void;
|
|
403
|
+
/** Opt-in interaction analytics; no telemetry is sent by the viewer. */
|
|
404
|
+
onEngagement?: (event: ViewerEngagementEvent) => void | Promise<void>;
|
|
405
|
+
/** Log engagement events in the developer console. Default `false`. */
|
|
406
|
+
debugEngagement?: boolean;
|
|
365
407
|
/** The camera moved. Fires often while the user orbits, pans or zooms. */
|
|
366
408
|
onCameraChange?: (state: ViewerCameraState) => void;
|
|
367
409
|
onViewerReady?: (viewer: ViewerReadyState) => void;
|
|
@@ -381,6 +423,8 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
381
423
|
showDownloadButton?: boolean;
|
|
382
424
|
downloadFilename?: string;
|
|
383
425
|
showResetButton?: boolean;
|
|
426
|
+
/** Fullscreen action button; grouped form: `ui.fullscreen`. Default `false`. */
|
|
427
|
+
showFullscreenButton?: boolean;
|
|
384
428
|
showLoadingOverlay?: boolean;
|
|
385
429
|
showMouseController?: boolean;
|
|
386
430
|
mouseControllerPosition?: MouseControllerPosition;
|
|
@@ -409,6 +453,11 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
409
453
|
showMeasureTools?: boolean;
|
|
410
454
|
showUvCheckerButton?: boolean;
|
|
411
455
|
showExplodeControls?: boolean;
|
|
456
|
+
isolation?: ViewerIsolation | null;
|
|
457
|
+
onIsolationChange?: (isolation: ViewerIsolation | null) => void;
|
|
458
|
+
showIsolateControls?: boolean;
|
|
459
|
+
showSectionTools?: boolean;
|
|
460
|
+
showMaterialVariants?: boolean;
|
|
412
461
|
cinematic?: boolean | CinematicConfig;
|
|
413
462
|
measurementUnit?: string;
|
|
414
463
|
enableXR?: boolean;
|
|
@@ -445,4 +494,4 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
445
494
|
texturePositioning?: boolean | TexturePositioningControls;
|
|
446
495
|
};
|
|
447
496
|
|
|
448
|
-
export { type
|
|
497
|
+
export { type AnnotationMarker as A, type CameraControllerType as C, type DecalMoveTarget as D, type GroupedModelViewerProps as G, type HomeCameraState as H, MODEL_VIEWER_PRESETS as M, type ObjectTransformSpace as O, type PerformanceProfile as P, type TexturePositioningControls as T, type UseViewerCameraOptions as U, type ViewerCameraPreset as V, type XRScaleMode as X, type CameraLimits as a, type CaptureImageOptions as b, type CaptureVideoOptions as c, type CinematicConfig as d, type CinematicWaypoint as e, type CustomObjectBindingDataPanelProps as f, type CustomSceneObjectsPanelProps as g, type ModelViewerControlsOptions as h, type ModelViewerDecoderOptions as i, type ModelViewerPerfOptions as j, type ModelViewerPreset as k, type ModelViewerProps as l, type ModelViewerTilesOptions as m, type ModelViewerToolsOptions as n, type ModelViewerUiOptions as o, type ModelViewerXrOptions as p, type MouseControllerPosition as q, type ViewerCameraProps as r, type ViewerEngagementEvent as s, type ViewerReadyState as t, useViewerCamera as u };
|