@liveroom-tech/react-immersive 3.0.0 → 4.0.1

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,339 +3,11 @@ import { ComponentProps, ReactNode, MutableRefObject } from 'react';
3
3
  import { CameraControls } from '@react-three/drei';
4
4
  import { Object3D, WebGLRenderer, Scene, Camera } 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
8
  import { Canvas } from '@react-three/fiber';
7
9
  import { PresetsType } from '@react-three/drei/helpers/environment-assets';
8
10
 
9
- declare const LIGHT_TYPES: readonly ["none", "directional", "point", "hemisphere"];
10
- type SceneLightType = (typeof LIGHT_TYPES)[number];
11
- type SceneLightAttachment = {
12
- /** Binding key, binding id, modelObjectId, or raw model node name. */
13
- objectId: string;
14
- /** Local-space offset from the attached model object. */
15
- offset: [number, number, number];
16
- };
17
- type SceneLight = {
18
- id: string;
19
- type: SceneLightType;
20
- color: string;
21
- intensity: number;
22
- position: [number, number, number];
23
- /** Point-light range. Zero means no distance limit. */
24
- distance?: number;
25
- /** Point-light physically correct decay. */
26
- decay?: number;
27
- attachedToCamera: boolean;
28
- /** Follow a model object instead of using the world-space position. */
29
- attachment?: SceneLightAttachment;
30
- castShadow: boolean;
31
- shadowBias: number;
32
- visible: boolean;
33
- };
34
- type SceneLightingConfig = {
35
- ambient: {
36
- intensity: number;
37
- color: string;
38
- };
39
- lights: SceneLight[];
40
- };
41
- declare const SCENE_MODEL_RENDERERS: readonly ["pbr", "matcap", "uv-checker"];
42
- type SceneModelRenderer = (typeof SCENE_MODEL_RENDERERS)[number];
43
- type SceneModelConfig = {
44
- rotation: [number, number, number];
45
- showAdvancedRotation: boolean;
46
- renderer: SceneModelRenderer;
47
- shading: "lit" | "unlit" | "normals";
48
- };
49
- type SceneCameraConfig = {
50
- fieldOfView: number;
51
- showAdvancedSettings: boolean;
52
- };
53
- type SceneShadowConfig = {
54
- enabled: boolean;
55
- mapSize: number;
56
- bias: number;
57
- normalBias: number;
58
- radius: number;
59
- };
60
- declare const ENVIRONMENT_PRESETS: readonly ["apartment", "city", "dawn", "forest", "lobby", "night", "park", "studio", "sunset", "warehouse"];
61
- type EnvironmentPreset = (typeof ENVIRONMENT_PRESETS)[number];
62
- type SceneEnvironmentConfig = {
63
- source: "preset" | "custom";
64
- preset: EnvironmentPreset;
65
- customEnvironmentUrl: string;
66
- intensity: number;
67
- rotation: number;
68
- shadowLight: {
69
- enabled: boolean;
70
- intensity: number;
71
- bias: number;
72
- };
73
- };
74
- type SceneWireframeConfig = {
75
- enabled: boolean;
76
- color: string;
77
- opacity: number;
78
- };
79
- type SceneBackgroundConfig = {
80
- enabled: boolean;
81
- type: "environment" | "image" | "color";
82
- color: string;
83
- imageUrl: string;
84
- };
85
- type SceneGroundShadowConfig = {
86
- enabled: boolean;
87
- mode: "shadowCatcher" | "bakedAO";
88
- intensity: number;
89
- borderFade: number;
90
- height: number;
91
- size: number;
92
- };
93
- declare const ANIMATION_LOOP_MODES: readonly ["repeat", "once"];
94
- type AnimationLoopMode = (typeof ANIMATION_LOOP_MODES)[number];
95
- type SceneAnimationClipConfig = {
96
- sourceName: string;
97
- displayName: string;
98
- hidden: boolean;
99
- loopMode: AnimationLoopMode;
100
- speed: number;
101
- };
102
- type SceneAnimationConfig = {
103
- clips: SceneAnimationClipConfig[];
104
- autoplayClip: string | null;
105
- };
106
- declare const GLITCH_MODES: readonly ["sporadic", "constantMild", "constantWild"];
107
- type GlitchModeName = (typeof GLITCH_MODES)[number];
108
- declare const RAMP_TYPES: readonly ["linear", "radial", "mirroredLinear"];
109
- type RampTypeName = (typeof RAMP_TYPES)[number];
110
- declare const KERNEL_SIZE_NAMES: readonly ["verySmall", "small", "medium", "large", "veryLarge", "huge"];
111
- type KernelSizeName = (typeof KERNEL_SIZE_NAMES)[number];
112
- type ScenePostProcessingConfig = {
113
- autofocus: {
114
- enabled: boolean;
115
- focusDistance: number;
116
- focusRange: number;
117
- focalLength: number;
118
- bokehScale: number;
119
- target: [number, number, number];
120
- mouse: boolean;
121
- debug: number;
122
- manual: boolean;
123
- smoothTime: number;
124
- };
125
- toneMapping: {
126
- enabled: boolean;
127
- mode: "linear" | "reinhard" | "aces";
128
- exposure: number;
129
- resolution: number;
130
- whitePoint: number;
131
- middleGrey: number;
132
- minLuminance: number;
133
- averageLuminance: number;
134
- adaptationRate: number;
135
- };
136
- brightnessContrast: {
137
- enabled: boolean;
138
- brightness: number;
139
- contrast: number;
140
- };
141
- hueSaturation: {
142
- enabled: boolean;
143
- hue: number;
144
- saturation: number;
145
- };
146
- colorAverage: {
147
- enabled: boolean;
148
- };
149
- dotScreen: {
150
- enabled: boolean;
151
- angle: number;
152
- scale: number;
153
- };
154
- glitch: {
155
- enabled: boolean;
156
- mode: GlitchModeName;
157
- delay: [number, number];
158
- duration: [number, number];
159
- strength: [number, number];
160
- chromaticAberrationOffset: [number, number];
161
- columns: number;
162
- ratio: number;
163
- };
164
- ssao: {
165
- enabled: boolean;
166
- samples: number;
167
- rings: number;
168
- intensity: number;
169
- radius: number;
170
- bias: number;
171
- luminanceInfluence: number;
172
- fade: number;
173
- minRadiusScale: number;
174
- worldDistanceThreshold: number;
175
- worldDistanceFalloff: number;
176
- worldProximityThreshold: number;
177
- worldProximityFalloff: number;
178
- };
179
- bloom: {
180
- enabled: boolean;
181
- intensity: number;
182
- luminanceThreshold: number;
183
- luminanceSmoothing: number;
184
- mipmapBlur: boolean;
185
- radius: number;
186
- levels: number;
187
- };
188
- godRays: {
189
- enabled: boolean;
190
- sunPosition: [number, number, number];
191
- samples: number;
192
- density: number;
193
- decay: number;
194
- weight: number;
195
- exposure: number;
196
- clampMax: number;
197
- blur: boolean;
198
- kernelSize: KernelSizeName;
199
- };
200
- grid: {
201
- enabled: boolean;
202
- scale: number;
203
- lineWidth: number;
204
- };
205
- noise: {
206
- enabled: boolean;
207
- opacity: number;
208
- premultiply: boolean;
209
- };
210
- depthOfField: {
211
- enabled: boolean;
212
- focusDistance: number;
213
- focusRange: number;
214
- focalLength: number;
215
- bokehScale: number;
216
- };
217
- chromaticAberration: {
218
- enabled: boolean;
219
- offsetX: number;
220
- offsetY: number;
221
- radialModulation: boolean;
222
- modulationOffset: number;
223
- };
224
- lensflare: {
225
- enabled: boolean;
226
- lensPosition: [number, number, number];
227
- smoothTime: number;
228
- glareSize: number;
229
- flareSize: number;
230
- flareSpeed: number;
231
- flareShape: number;
232
- animated: boolean;
233
- anamorphic: boolean;
234
- colorGain: string;
235
- haloScale: number;
236
- secondaryGhosts: boolean;
237
- aditionalStreaks: boolean;
238
- ghostScale: number;
239
- opacity: number;
240
- starBurst: boolean;
241
- };
242
- vignette: {
243
- enabled: boolean;
244
- offset: number;
245
- darkness: number;
246
- eskil: boolean;
247
- };
248
- smaa: {
249
- enabled: boolean;
250
- };
251
- sepia: {
252
- enabled: boolean;
253
- intensity: number;
254
- };
255
- scanline: {
256
- enabled: boolean;
257
- density: number;
258
- };
259
- pixelation: {
260
- enabled: boolean;
261
- granularity: number;
262
- };
263
- outline: {
264
- enabled: boolean;
265
- selectionLayer: number;
266
- edgeStrength: number;
267
- pulseSpeed: number;
268
- visibleEdgeColor: string;
269
- hiddenEdgeColor: string;
270
- kernelSize: KernelSizeName;
271
- blur: boolean;
272
- xRay: boolean;
273
- };
274
- selectiveBloom: {
275
- enabled: boolean;
276
- selectionLayer: number;
277
- intensity: number;
278
- luminanceThreshold: number;
279
- luminanceSmoothing: number;
280
- kernelSize: KernelSizeName;
281
- mipmapBlur: boolean;
282
- inverted: boolean;
283
- ignoreBackground: boolean;
284
- };
285
- ramp: {
286
- enabled: boolean;
287
- rampType: RampTypeName;
288
- rampStart: [number, number];
289
- rampEnd: [number, number];
290
- startColor: string;
291
- endColor: string;
292
- opacity?: number;
293
- rampBias: number;
294
- rampGain: number;
295
- rampMask: boolean;
296
- rampInvert: boolean;
297
- };
298
- };
299
- type SceneAnnotationMarker = {
300
- id: number;
301
- worldPosition: [number, number, number];
302
- localPosition: [number, number, number];
303
- worldNormal?: [number, number, number];
304
- anchorNodeName?: string;
305
- anchorLocalPosition?: [number, number, number];
306
- title: string;
307
- description: string;
308
- };
309
- type SceneCinematicWaypoint = {
310
- position: [number, number, number];
311
- target: [number, number, number];
312
- azimuthAngle?: number;
313
- polarAngle?: number;
314
- segmentDuration?: number;
315
- };
316
- type SceneCinematicConfig = {
317
- enabled: boolean;
318
- waypoints: SceneCinematicWaypoint[];
319
- duration?: number;
320
- loop: boolean;
321
- autoPlay: boolean;
322
- };
323
- type SceneConfig = {
324
- model: SceneModelConfig;
325
- camera: SceneCameraConfig;
326
- lighting: SceneLightingConfig;
327
- wireframe: SceneWireframeConfig;
328
- shadows: SceneShadowConfig;
329
- environment: SceneEnvironmentConfig;
330
- background: SceneBackgroundConfig;
331
- groundShadows: SceneGroundShadowConfig;
332
- postProcessing: ScenePostProcessingConfig;
333
- animations: SceneAnimationConfig;
334
- annotations: SceneAnnotationMarker[];
335
- cinematic?: SceneCinematicConfig;
336
- };
337
- declare const DEFAULT_SCENE_CONFIG: SceneConfig;
338
-
339
11
  type CanvasCamera = ComponentProps<typeof Canvas>["camera"];
340
12
 
341
13
  type RendererCapture = {
@@ -357,12 +29,15 @@ type Props = {
357
29
  maxDpr?: number;
358
30
  xrStore?: XRStore | null;
359
31
  rendererCaptureRef?: MutableRefObject<RendererCapture | null>;
32
+ preserveDrawingBuffer?: boolean;
360
33
  reduceGpuLoad?: boolean;
361
34
  };
362
- declare function Viewer({ children, camera, backgroundColor, shadows, sceneConfig, selectedObjectRef, hoveredObjectRef, highlightOnHover, renderMode, maxDpr, xrStore, rendererCaptureRef, reduceGpuLoad, }: Props): react_jsx_runtime.JSX.Element;
35
+ declare function Viewer({ children, camera, backgroundColor, shadows, sceneConfig, selectedObjectRef, hoveredObjectRef, highlightOnHover, renderMode, maxDpr, xrStore, rendererCaptureRef, preserveDrawingBuffer, reduceGpuLoad, }: Props): react_jsx_runtime.JSX.Element;
363
36
 
364
37
  type PerformanceProfile = "auto" | "high" | "low";
365
38
 
39
+ type ModelFormat = "glb" | "gltf" | "obj" | "fbx" | "usdz";
40
+
366
41
  type XRScaleMode = "normalized" | "real-world";
367
42
 
368
43
  type CinematicWaypoint = {
@@ -387,14 +62,6 @@ type CaptureImageOptions = {
387
62
  transparent?: boolean;
388
63
  };
389
64
 
390
- type ViewerCameraState = {
391
- position: [number, number, number];
392
- target: [number, number, number];
393
- fov: number | null;
394
- zoom: number;
395
- azimuthAngle?: number;
396
- polarAngle?: number;
397
- };
398
65
  type ViewerCameraPreset = {
399
66
  position: [number, number, number];
400
67
  target: [number, number, number];
@@ -444,213 +111,6 @@ type ViewerCameraProps = {
444
111
  };
445
112
  declare function useViewerCamera(options?: UseViewerCameraOptions): ViewerCameraProps;
446
113
 
447
- type DeepPartial<T> = T extends readonly unknown[] ? T : T extends object ? {
448
- [K in keyof T]?: DeepPartial<T[K]>;
449
- } : T;
450
-
451
- type ObjectBindingSelector = {
452
- group: string;
453
- } | {
454
- tag: string;
455
- } | {
456
- type: ObjectBindingType;
457
- };
458
- type ObjectBindingTarget = string | readonly string[] | ObjectBindingSelector;
459
- /**
460
- * Resolves IDs and selectors to binding-map keys in stable record order.
461
- * Explicit ID arrays keep their supplied order. Duplicate matches are removed.
462
- */
463
- declare function selectBindingKeys(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget): string[];
464
- /** Selects bindings by ID, group, tag, or binding type. */
465
- declare function selectBindings(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget): ObjectBinding[];
466
-
467
- type ObjectBindingPatch = DeepPartial<ObjectBinding>;
468
- type BindingEdit = {
469
- ids: ObjectBindingTarget;
470
- patch: ObjectBindingPatch;
471
- };
472
- /**
473
- * Applies field-level patches to object bindings and returns the updated
474
- * record. Pure — nothing is mutated, and the original reference comes back
475
- * untouched when no id matched, so React can skip the re-render.
476
- *
477
- * Ids resolve the same way everywhere else in the library: binding key first,
478
- * then `binding.id`, then `binding.modelObjectId`.
479
- */
480
- declare function patchBindings(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget, patch: ObjectBindingPatch): Record<string, ObjectBinding>;
481
- declare function patchBindings(bindings: Record<string, ObjectBinding>, edits: BindingEdit[]): Record<string, ObjectBinding>;
482
- /** Shorthand for the common `{ style: { material: … } }` nesting. */
483
- declare function material(value: ObjectBindingMaterial): ObjectBindingPatch;
484
-
485
- type SceneConfigPatch = DeepPartial<SceneConfig>;
486
- /**
487
- * Applies a nested scene-config patch without mutating either input. Objects
488
- * are merged recursively, while arrays and tuples are replaced wholesale.
489
- */
490
- declare function patchSceneConfig(sceneConfig: SceneConfig, patch: SceneConfigPatch): SceneConfig;
491
-
492
- type ObjectBindingsActionEffect = {
493
- target: ObjectBindingTarget;
494
- objectBindings: ObjectBindingPatch;
495
- };
496
- type SceneConfigActionEffect = {
497
- sceneConfig: SceneConfigPatch;
498
- };
499
- type VisibilityActionEffect = {
500
- target: ObjectBindingTarget;
501
- visibility: "show" | "hide" | "toggle";
502
- };
503
- type CameraAction = {
504
- type: "focus-object";
505
- objectId?: string;
506
- } | {
507
- type: "fit-scene";
508
- } | {
509
- type: "reset";
510
- } | {
511
- type: "set-target";
512
- target: [number, number, number];
513
- transition?: boolean;
514
- } | {
515
- type: "set-state";
516
- state: ViewerCameraState;
517
- transition?: boolean;
518
- };
519
- type CameraActionEffect = {
520
- camera: CameraAction;
521
- };
522
- type AnimationAction = {
523
- type: "play";
524
- clip: string;
525
- } | {
526
- type: "pause";
527
- } | {
528
- type: "stop";
529
- } | {
530
- type: "set-speed";
531
- speed: number;
532
- } | {
533
- type: "seek";
534
- time: number;
535
- };
536
- type AnimationActionEffect = {
537
- animation: AnimationAction;
538
- };
539
- type ObjectActionEffect = ObjectBindingsActionEffect | SceneConfigActionEffect | VisibilityActionEffect | CameraActionEffect | AnimationActionEffect;
540
-
541
- type ObjectBindingAction = {
542
- id: "change-color" | "apply-texture" | "toggle-visibility" | string;
543
- label: string;
544
- type: "command";
545
- effects?: ObjectActionEffect[];
546
- };
547
- type ObjectBindingType = "body" | "other" | "glass" | "windshield" | "rear-windshield" | "window" | "sunroof" | "wheel" | "rim" | "tire" | "brake-caliper" | "brake-disc" | "suspension" | "spring" | "shock-absorber" | "axle" | "control-arm" | "interior" | "seat" | "headrest" | "seatbelt" | "dashboard" | "steering-wheel" | "gear-shift" | "center-console" | "armrest" | "door-panel" | "carpet" | "headliner" | "sun-visor" | "pedal" | "instrument-cluster" | "infotainment" | "glove-box" | "engine" | "gearbox" | "radiator" | "battery" | "fuel-tank" | "air-filter" | "intercooler" | "alternator" | "turbo" | "light" | "headlight" | "taillight" | "fog-light" | "indicator" | "daytime-running-light" | "interior-light" | "ambient-light" | "floor" | "floor-tile" | "floor-board" | "floor-mat" | "ceiling" | "ceiling-tile" | "wall" | "wall-tile" | "wall-panel" | "wall-trim" | "baseboard" | "crown-molding" | "column" | "pillar" | "beam" | "arch" | "stairs" | "step" | "railing" | "balustrade" | "window-frame" | "window-sill" | "blind" | "curtain" | "shutter" | "door" | "door-frame" | "door-knob" | "furniture" | "sofa" | "armchair" | "ottoman" | "bed" | "headboard" | "mattress" | "nightstand" | "dresser" | "wardrobe" | "closet" | "shelf" | "bookcase" | "desk" | "office-chair" | "dining-table" | "dining-chair" | "bar-stool" | "bench" | "cabinet" | "sideboard" | "coffee-table" | "side-table" | "tv-stand" | "kitchen-island" | "countertop" | "sink" | "bathtub" | "shower" | "toilet" | "vanity" | "decor" | "rug" | "cushion" | "throw" | "curtain-rod" | "artwork" | "mirror" | "vase" | "plant" | "pot" | "candle" | "frame" | "sculpture" | "clock" | "lamp" | "floor-lamp" | "table-lamp" | "pendant-light" | "chandelier" | "sconce" | "ceiling-fan" | "electronics" | "tv" | "monitor" | "speaker" | "soundbar" | "projector" | "remote" | "console" | "router" | "smart-hub" | "thermostat" | "appliance" | "refrigerator" | "oven" | "microwave" | "dishwasher" | "washing-machine" | "dryer" | "air-conditioner" | "heater" | "ventilation" | "root" | "bone" | "joint" | "socket" | "pivot" | "head" | "face" | "eye" | "eyelid" | "eyebrow" | "mouth" | "teeth" | "tongue" | "ear" | "nose" | "hair" | "beard" | "neck" | "torso" | "chest" | "abdomen" | "back" | "shoulder" | "upper-arm" | "forearm" | "hand" | "finger" | "thumb" | "hip" | "thigh" | "shin" | "foot" | "toe" | "tail" | "wing" | "tentacle" | "clothing" | "hat" | "helmet" | "visor" | "mask" | "goggles" | "glasses" | "jacket" | "shirt" | "pants" | "skirt" | "shoes" | "boots" | "gloves" | "belt" | "watch" | "bag" | "backpack" | "jewelry" | "necklace" | "ring" | "armor" | "chest-plate" | "pauldron" | "gauntlet" | "greave" | "shield" | "weapon" | "blade" | "edge" | "tip" | "guard" | "grip" | "pommel" | "barrel" | "stock" | "scope" | "trigger" | "magazine" | "muzzle" | "gear" | "piston" | "lever" | "valve" | "pump" | "motor" | "rotor" | "blade-prop" | "nozzle" | "pipe" | "tube" | "cable" | "wire" | "connector" | "panel" | "hatch" | "vent" | "antenna" | "sensor" | "camera" | "screen" | "dial" | "button" | "knob" | "switch" | "gauge" | "terrain" | "ground" | "rock" | "cliff" | "water" | "ocean" | "river" | "lake" | "wave" | "foam" | "sky" | "cloud" | "sun" | "moon" | "star" | "fog" | "foliage" | "tree" | "branch" | "leaf" | "grass" | "bush" | "flower" | "soil" | "sand" | "snow" | "ice" | "facade" | "foundation" | "roof-structure" | "chimney" | "balcony" | "porch" | "pathway" | "fence" | "gate" | "wall-exterior";
548
- type ObjectBindingStatus = "normal" | "hidden" | "selected" | "disabled";
549
- type ObjectBindingTextureSlot = {
550
- path: string;
551
- };
552
- type ObjectBindingTextureChannel = "baseColor" | "metalness" | "roughness" | "emissive" | "alpha" | "normal" | "bump" | "ao" | "displacement" | "clearcoat" | "clearcoatRoughness" | "clearcoatNormal" | "anisotropy" | "transmission" | "thickness" | "sheenColor" | "sheenRoughness" | "specularIntensity" | "specularColor";
553
- type ObjectBindingTransform = {
554
- /** Local-space position in model units. */
555
- position?: [number, number, number];
556
- /** Local-space Euler rotation in radians. */
557
- rotation?: [number, number, number];
558
- /** Local-space scale. */
559
- scale?: [number, number, number];
560
- };
561
- declare const MATERIAL_SIDES: readonly ["front", "back", "double"];
562
- type ObjectBindingMaterialSide = (typeof MATERIAL_SIDES)[number];
563
- declare const MATERIAL_BLENDING_MODES: readonly ["normal", "additive"];
564
- type ObjectBindingMaterialBlendingMode = (typeof MATERIAL_BLENDING_MODES)[number];
565
- type ObjectBindingMaterial = {
566
- texture?: ObjectBindingTextureSlot;
567
- baseColor?: string;
568
- metalness?: number;
569
- metalnessMap?: ObjectBindingTextureSlot;
570
- roughness?: number;
571
- roughnessMap?: ObjectBindingTextureSlot;
572
- emissive?: string;
573
- emissiveIntensity?: number;
574
- emissiveMap?: ObjectBindingTextureSlot;
575
- opacity?: number;
576
- alphaMap?: ObjectBindingTextureSlot;
577
- alphaTest?: number;
578
- alphaHash?: boolean;
579
- dithering?: boolean;
580
- blendingMode?: ObjectBindingMaterialBlendingMode;
581
- side?: ObjectBindingMaterialSide;
582
- normalMap?: ObjectBindingTextureSlot;
583
- normalScale?: number;
584
- flipNormalY?: boolean;
585
- bumpMap?: ObjectBindingTextureSlot;
586
- bumpScale?: number;
587
- aoMap?: ObjectBindingTextureSlot;
588
- aoMapIntensity?: number;
589
- displacementMap?: ObjectBindingTextureSlot;
590
- displacementScale?: number;
591
- displacementBias?: number;
592
- clearcoat?: number;
593
- clearcoatMap?: ObjectBindingTextureSlot;
594
- clearcoatRoughness?: number;
595
- clearcoatRoughnessMap?: ObjectBindingTextureSlot;
596
- clearcoatNormalMap?: ObjectBindingTextureSlot;
597
- clearcoatNormalScale?: number;
598
- flipClearcoatNormalY?: boolean;
599
- sheen?: number;
600
- sheenColor?: string;
601
- sheenColorMap?: ObjectBindingTextureSlot;
602
- sheenRoughness?: number;
603
- sheenRoughnessMap?: ObjectBindingTextureSlot;
604
- anisotropy?: number;
605
- anisotropyRotation?: number;
606
- anisotropyMap?: ObjectBindingTextureSlot;
607
- transmission?: number;
608
- transmissionMap?: ObjectBindingTextureSlot;
609
- thickness?: number;
610
- thicknessMap?: ObjectBindingTextureSlot;
611
- attenuationColor?: string;
612
- attenuationDistance?: number;
613
- reflectivity?: number;
614
- specularIntensity?: number;
615
- specularIntensityMap?: ObjectBindingTextureSlot;
616
- specularColor?: string;
617
- specularColorMap?: ObjectBindingTextureSlot;
618
- };
619
- type ObjectBindingCameraState = {
620
- position?: [number, number, number];
621
- target?: [number, number, number];
622
- fov?: number;
623
- zoom?: number;
624
- };
625
- type ObjectBindingStyle = {
626
- material?: ObjectBindingMaterial;
627
- };
628
- type ObjectBinding = {
629
- id: string;
630
- type: ObjectBindingType;
631
- modelObjectId: string;
632
- label?: string;
633
- group?: string;
634
- tags?: string[];
635
- status?: ObjectBindingStatus;
636
- visible?: boolean;
637
- selectable?: boolean;
638
- hoverable?: boolean;
639
- transform?: ObjectBindingTransform;
640
- style?: ObjectBindingStyle;
641
- actions?: ObjectBindingAction[];
642
- metrics?: Record<string, number>;
643
- metadata?: Record<string, unknown>;
644
- cameraState?: ObjectBindingCameraState;
645
- };
646
- type ObjectActionEvent = {
647
- objectId: string;
648
- action: ObjectBindingAction;
649
- binding?: ObjectBinding;
650
- screenX?: number;
651
- screenY?: number;
652
- };
653
-
654
114
  type AnimationClipInfo = {
655
115
  sourceName: string;
656
116
  duration: number;
@@ -690,6 +150,8 @@ type ViewerAnimationsProps = {
690
150
  };
691
151
  declare function useViewerAnimations(): ViewerAnimationsProps;
692
152
 
153
+ type ObjectTransformSpace = "local" | "world";
154
+
693
155
  type ViewerCamera = React.ComponentProps<typeof Viewer>["camera"];
694
156
  type AnnotationMarker = SceneAnnotationMarker & {
695
157
  markerId?: string;
@@ -709,13 +171,25 @@ type CustomSceneObjectsPanelProps = {
709
171
  };
710
172
  type ModelViewerProps = {
711
173
  modelUrl: string;
174
+ /** Optional 3D Tiles manifest used instead of loading `modelUrl` monolithically. */
175
+ tilesetUrl?: string | null;
176
+ /** Screen-space error target for streamed 3D Tiles. Lower is sharper. */
177
+ tilesErrorTarget?: number;
178
+ /** Maximum number of parsed tiles retained by the client cache. */
179
+ tilesCacheSize?: number;
180
+ /** Explicit format for extensionless or signed model URLs. */
181
+ modelFormat?: ModelFormat;
712
182
  licenseKey: string;
183
+ /** Trusted validation endpoint override for first-party/self-hosted consoles. */
184
+ licenseValidationUrl?: string;
713
185
  objectBindings: Record<string, ObjectBinding>;
714
186
  selectedObject?: ObjectBinding | null;
715
187
  panelHoveredObject?: ObjectBinding | null;
716
188
  onObjectBindingsChange?: (next: Record<string, ObjectBinding>) => void;
717
189
  onObjectSelect?: (binding: ObjectBinding | null) => void;
718
190
  onObjectHover?: (binding: ObjectBinding | null) => void;
191
+ /** Reports transform-gizmo edit leases for collaborative hosts. */
192
+ onObjectEditLeaseChange?: (binding: ObjectBinding, editing: boolean) => void;
719
193
  onModelLoaded?: (scene: Object3D) => void;
720
194
  onLoadError?: (error: unknown) => void;
721
195
  onAction?: (event: ObjectActionEvent) => void;
@@ -749,9 +223,16 @@ type ModelViewerProps = {
749
223
  zoomOnSelected?: boolean;
750
224
  highlightOnHover?: boolean;
751
225
  onAutoFit?: () => Promise<boolean>;
226
+ enableCameraControls?: boolean;
227
+ moveModeEnabled?: boolean;
228
+ /** Aligns PivotControls to the scene or to the selected object. */
229
+ objectTransformSpace?: ObjectTransformSpace;
230
+ /** Enables canvas-focused camera shortcuts. Disabled by default. */
231
+ enableKeyboardNavigation?: boolean;
752
232
  refitOnResize?: boolean;
753
233
  renderMode?: "always" | "demand";
754
234
  maxDpr?: number;
235
+ preserveDrawingBuffer?: boolean;
755
236
  performanceProfile?: PerformanceProfile;
756
237
  dracoDecoderPath?: string | false;
757
238
  ktx2TranscoderPath?: string | false;
@@ -768,15 +249,80 @@ type ModelViewerProps = {
768
249
  showAnnotationNavigation?: boolean;
769
250
  showAnnotationOnHover?: boolean;
770
251
  onSceneConfigChange?: (config: SceneConfig) => void;
252
+ showViewGizmo?: boolean;
253
+ };
254
+ declare function ModelViewer({ modelUrl, tilesetUrl, tilesErrorTarget, tilesCacheSize, 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;
255
+
256
+ type BindingBuilderProjectModel = {
257
+ url: string;
258
+ name?: string;
259
+ assetId?: string | null;
260
+ /**
261
+ * Optional streamable model manifest. The current viewer uses `url`; large
262
+ * model renderers can use this value without changing the saved project
263
+ * shape.
264
+ */
265
+ tilesetUrl?: string | null;
266
+ assetVersion?: string | null;
267
+ };
268
+ type BindingBuilderProject = {
269
+ id: string;
270
+ revision: number;
271
+ model: BindingBuilderProjectModel;
272
+ objectBindings: Record<string, ObjectBinding>;
273
+ sceneConfig: SceneConfig;
274
+ };
275
+ type BindingBuilderProjectSnapshot = {
276
+ projectId: string;
277
+ baseRevision: number;
278
+ model: BindingBuilderProjectModel;
279
+ objectBindings: Record<string, ObjectBinding>;
280
+ sceneConfig: SceneConfig;
771
281
  };
772
- declare function ModelViewer({ modelUrl, licenseKey, objectBindings, selectedObject, panelHoveredObject, onObjectBindingsChange, onObjectSelect, onObjectHover, 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, onAutoFit, refitOnResize, renderMode, maxDpr, performanceProfile, dracoDecoderPath, ktx2TranscoderPath, meshopt, showMeasureTools, showUvCheckerButton, showExplodeControls, cinematic, measurementUnit, enableXR, usdzUrl, arScaleMode, mobileHandoffUrl, showAnnotationNavigation, showAnnotationOnHover, }: ModelViewerProps): react_jsx_runtime.JSX.Element;
282
+ type BindingBuilderProjectChangeOrigin = "local" | "remote";
773
283
 
774
- declare function BindingBuilder({ licenseKey }: {
284
+ type BindingBuilderProps = {
775
285
  licenseKey: string;
776
- }): react_jsx_runtime.JSX.Element;
286
+ /** Trusted validation endpoint override for first-party/self-hosted consoles. */
287
+ licenseValidationUrl?: string;
288
+ /** Directory containing the DRACO decoder files, or false. */
289
+ dracoDecoderPath?: string | false;
290
+ /** Directory containing the Basis/KTX2 transcoder files, or false. */
291
+ ktx2TranscoderPath?: string | false;
292
+ /** Enable the bundled Meshopt decoder. Defaults to true. */
293
+ meshopt?: boolean;
294
+ /**
295
+ * Optional server-backed project. When supplied, the editor hydrates from
296
+ * this snapshot and applies newer revisions without remounting.
297
+ */
298
+ project?: BindingBuilderProject | null;
299
+ /**
300
+ * Reports debounced, serializable editor snapshots. Persistence and
301
+ * collaboration transports remain owned by the host application.
302
+ */
303
+ onProjectChange?: (snapshot: BindingBuilderProjectSnapshot, origin: BindingBuilderProjectChangeOrigin) => void;
304
+ /** Delay before reporting local project changes. Defaults to 350ms. */
305
+ projectChangeDebounceMs?: number;
306
+ /**
307
+ * Lets a hosted editor upload a selected model before it is loaded. Return
308
+ * the durable model URL/version that should be saved with the project.
309
+ */
310
+ onModelUpload?: (file: File) => Promise<BindingBuilderProject["model"]>;
311
+ /** Requests/releases a short collaborative lease around gizmo edits. */
312
+ onEditLeaseChange?: (featureId: string, editing: boolean) => void;
313
+ };
314
+ declare function BindingBuilder({ licenseKey, licenseValidationUrl, dracoDecoderPath, ktx2TranscoderPath, meshopt, project, onProjectChange, projectChangeDebounceMs, onModelUpload, onEditLeaseChange, }: BindingBuilderProps): react_jsx_runtime.JSX.Element;
777
315
 
778
316
  type SimpleModelViewerProps = {
779
317
  modelUrl: string;
318
+ /** Explicit format for extensionless or signed model URLs. */
319
+ modelFormat?: ModelFormat;
320
+ /** Directory containing the DRACO decoder files, or false. */
321
+ dracoDecoderPath?: string | false;
322
+ /** Directory containing the Basis/KTX2 transcoder files, or false. */
323
+ ktx2TranscoderPath?: string | false;
324
+ /** Enable the bundled Meshopt decoder. Defaults to true. */
325
+ meshopt?: boolean;
780
326
  backgroundColor?: string;
781
327
  showSceneObjectsPanel?: boolean;
782
328
  showSceneSettingsPanel?: boolean;
@@ -796,7 +342,7 @@ type SimpleModelViewerProps = {
796
342
  onModelLoaded?: (scene: Object3D) => void;
797
343
  onLoadError?: (error: unknown) => void;
798
344
  };
799
- declare function SimpleModelViewer({ modelUrl, backgroundColor, showSceneObjectsPanel, showSceneSettingsPanel, enableModelUpload, zoomOnSelected, highlightOnHover, showLoadingOverlay, refitOnResize, backgroundEnabled, autoRotate, envPreset, exposure, ambientIntensity, ambientColor, directionalIntensity, directionalColor, onModelLoaded, onLoadError, }: SimpleModelViewerProps): react_jsx_runtime.JSX.Element;
345
+ declare function SimpleModelViewer({ modelUrl, modelFormat, dracoDecoderPath, ktx2TranscoderPath, meshopt, backgroundColor, showSceneObjectsPanel, showSceneSettingsPanel, enableModelUpload, zoomOnSelected, highlightOnHover, showLoadingOverlay, refitOnResize, backgroundEnabled, autoRotate, envPreset, exposure, ambientIntensity, ambientColor, directionalIntensity, directionalColor, onModelLoaded, onLoadError, }: SimpleModelViewerProps): react_jsx_runtime.JSX.Element;
800
346
 
801
347
  type ViewerSelectionProps = {
802
348
  selectedObjectBinding: ObjectBinding | null;
@@ -847,20 +393,6 @@ type ObjectBindingsController = {
847
393
  */
848
394
  declare function useObjectBindings(initialBindings: Record<string, ObjectBinding> | (() => Record<string, ObjectBinding>)): ObjectBindingsController;
849
395
 
850
- /**
851
- * Validates an object-bindings literal while preserving its exact keys and
852
- * literal values for TypeScript autocomplete and derived union types.
853
- *
854
- * This is an identity function at runtime.
855
- */
856
- declare function defineObjectBindings<const TBindings extends Record<string, ObjectBinding>>(bindings: TBindings): TBindings;
857
- /** Binding-map keys preserved by defineObjectBindings. */
858
- type ObjectBindingKey<TBindings extends Record<string, ObjectBinding>> = Extract<keyof TBindings, string>;
859
- /** Action ids declared on one binding in a defined bindings map. */
860
- type ObjectBindingActionId<TBindings extends Record<string, ObjectBinding>, TKey extends ObjectBindingKey<TBindings>> = TBindings[TKey]["actions"] extends readonly (infer TAction)[] ? TAction extends {
861
- id: infer TId extends string;
862
- } ? TId : never : never;
863
-
864
396
  type SceneConfigUpdate = SceneConfigPatch | ((current: SceneConfig) => SceneConfigPatch);
865
397
  type SceneConfigController = {
866
398
  sceneConfig: SceneConfig;
@@ -1098,4 +630,4 @@ type ShareableViewerStateProps = {
1098
630
  };
1099
631
  declare function useShareableViewerState({ cameraState, setCameraState, objectBindings, onObjectBindingsChange, selectedObjectBinding, setSelectedObjectBinding, paramKey, debounceMs, autoSync, }: UseShareableViewerStateOptions): ShareableViewerStateProps;
1100
632
 
1101
- export { type AnimationAction, type AnimationActionEffect, type AnimationClipInfo, type AnimationControls, type AnimationLoopMode, type AnimationPlaybackState, BindingBuilder, type BindingEdit, type CameraAction, type CameraActionEffect, type CaptureImageOptions, type CinematicConfig, type CinematicWaypoint, type CustomObjectBindingDataPanelProps, type CustomSceneObjectsPanelProps, DEFAULT_SCENE_CONFIG, type HiddenObjectsState, type HomeCameraState, MATERIAL_BLENDING_MODES, MATERIAL_SIDES, ModelViewer, type ModelViewerProps, type ObjectActionEffect, type ObjectActionEvent, type ObjectBinding, type ObjectBindingAction, type ObjectBindingActionId, type ObjectBindingKey, type ObjectBindingMaterial, type ObjectBindingMaterialBlendingMode, type ObjectBindingMaterialSide, type ObjectBindingPatch, type ObjectBindingSelector, type ObjectBindingTarget, type ObjectBindingTextureChannel, type ObjectBindingTextureSlot, type ObjectBindingTransform, type ObjectBindingsActionEffect, type ObjectBindingsController, type RuntimeMaterialPatch, type RuntimeMaterialRanges, type RuntimePointLightOptions, type RuntimePointLightPatch, type RuntimeTransformPatch, type RuntimeTransformRanges, type SceneAnimationClipConfig, type SceneAnimationConfig, type SceneCinematicConfig, type SceneCinematicWaypoint, type SceneConfig, type SceneConfigActionEffect, type SceneConfigController, type SceneConfigPatch, type SceneConfigUpdate, type SceneLight, type SceneLightAttachment, type SceneLightInput, type SceneLightPatch, type SceneLightType, type SceneLightsController, type SceneModelRenderer, SimpleModelViewer, type SimpleModelViewerProps, type UseViewerCameraOptions, type UseViewerEffectsOptions, type ViewerActionAnimationController, type ViewerActionBindingsController, type ViewerActionCameraController, type ViewerActionSceneController, type ViewerActionsOptions, type ViewerActionsProps, type ViewerAnimationsProps, type ViewerCameraPreset, type ViewerCameraProps, type ViewerCameraState, type ViewerConnectionController, type ViewerEffectChannels, type ViewerEffectEasing, type ViewerEffectRange, type ViewerEffectTarget, type ViewerEffectsController, type ViewerFlickerOptions, type ViewerLightEffectChannel, type ViewerMaterialEffectChannel, type ViewerModelBounds, type ViewerModelProps, type ViewerPulseOptions, type ViewerReadyConsumer, type ViewerReadyHandler, type ViewerReadyState, type ViewerSelectionProps, type ViewerTimelineOptions, type ViewerTimelineStep, type ViewerTransformEffectChannel, type ViewerTransitionOptions, type ViewerVector3, type VisibilityActionEffect, type XRScaleMode, defineObjectBindings, material, patchBindings, patchSceneConfig, selectBindingKeys, selectBindings, useObjectBinding, useObjectBindingIds, useObjectBindings, useSceneConfig, useShareableViewerState, useViewerActions, useViewerAnimations, useViewerCamera, useViewerConnection, useViewerEffects, useViewerHover, useViewerModel, useViewerSelection };
633
+ export { type AnimationClipInfo, type AnimationControls, type AnimationPlaybackState, BindingBuilder, type BindingBuilderProject, type BindingBuilderProjectChangeOrigin, type BindingBuilderProjectModel, type BindingBuilderProjectSnapshot, type BindingBuilderProps, BindingEdit, type CaptureImageOptions, type CinematicConfig, type CinematicWaypoint, type CustomObjectBindingDataPanelProps, type CustomSceneObjectsPanelProps, type HiddenObjectsState, type HomeCameraState, type ModelFormat, ModelViewer, type ModelViewerProps, ObjectActionEvent, ObjectBinding, ObjectBindingAction, ObjectBindingMaterial, ObjectBindingPatch, ObjectBindingTarget, ObjectBindingTextureChannel, ObjectBindingTextureSlot, ObjectBindingTransform, type ObjectBindingsController, type ObjectTransformSpace, type RuntimeMaterialPatch, type RuntimeMaterialRanges, type RuntimePointLightOptions, type RuntimePointLightPatch, type RuntimeTransformPatch, type RuntimeTransformRanges, SceneConfig, type SceneConfigController, SceneConfigPatch, type SceneConfigUpdate, SceneLight, SceneLightAttachment, type SceneLightInput, type SceneLightPatch, type SceneLightsController, SimpleModelViewer, type SimpleModelViewerProps, type UseViewerCameraOptions, type UseViewerEffectsOptions, type ViewerActionAnimationController, type ViewerActionBindingsController, type ViewerActionCameraController, type ViewerActionSceneController, type ViewerActionsOptions, type ViewerActionsProps, type ViewerAnimationsProps, type ViewerCameraPreset, type ViewerCameraProps, ViewerCameraState, type ViewerConnectionController, type ViewerEffectChannels, type ViewerEffectEasing, type ViewerEffectRange, type ViewerEffectTarget, type ViewerEffectsController, type ViewerFlickerOptions, type ViewerLightEffectChannel, type ViewerMaterialEffectChannel, type ViewerModelBounds, type ViewerModelProps, type ViewerPulseOptions, type ViewerReadyConsumer, type ViewerReadyHandler, type ViewerReadyState, type ViewerSelectionProps, type ViewerTimelineOptions, type ViewerTimelineStep, type ViewerTransformEffectChannel, type ViewerTransitionOptions, type ViewerVector3, type XRScaleMode, useObjectBinding, useObjectBindingIds, useObjectBindings, useSceneConfig, useShareableViewerState, useViewerActions, useViewerAnimations, useViewerCamera, useViewerConnection, useViewerEffects, useViewerHover, useViewerModel, useViewerSelection };