@liveroom-tech/react-immersive 5.1.0 → 5.2.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 +486 -57
- package/dist/binding-builder.css +1 -1
- package/dist/binding-builder.js +17 -13
- package/dist/binding-builder.mjs +1 -1
- package/dist/chunk-4NLJSD3S.mjs +1 -0
- package/dist/chunk-B7REIGDG.mjs +1 -0
- package/dist/{chunk-WN6GMMHF.mjs → chunk-HYFJ5DYJ.mjs} +1 -1
- package/dist/chunk-QC3NT76G.mjs +3 -0
- package/dist/chunk-T3M3BQ7H.mjs +32 -0
- package/dist/chunk-ZPK67UG7.mjs +1 -0
- package/dist/hosted.css +1 -1
- package/dist/hosted.d.mts +4 -3
- package/dist/hosted.d.ts +4 -3
- package/dist/hosted.js +16 -12
- package/dist/hosted.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +39 -8
- package/dist/index.d.ts +39 -8
- package/dist/index.js +14 -10
- package/dist/index.mjs +1 -1
- package/dist/materialVariants-DnZe9eMC.d.mts +309 -0
- package/dist/materialVariants-DnZe9eMC.d.ts +309 -0
- package/dist/modelInfo-BYebMPdZ.d.mts +43 -0
- package/dist/modelInfo-XfUQO7C_.d.ts +43 -0
- package/dist/{ModelViewer-Bj-KjiDL.d.mts → modelViewerProps-CIZ2R_Fv.d.ts} +82 -10
- package/dist/{ModelViewer-BkQ73y6N.d.ts → modelViewerProps-DoRiTZMn.d.mts} +82 -10
- package/dist/{objectCatalog-BIeXURoq.d.ts → rendererBackend-QwMzISTn.d.mts} +32 -4
- package/dist/{objectCatalog-BIeXURoq.d.mts → rendererBackend-QwMzISTn.d.ts} +32 -4
- package/dist/simple-model-viewer.css +1 -1
- package/dist/simple-model-viewer.d.mts +32 -4
- package/dist/simple-model-viewer.d.ts +32 -4
- package/dist/simple-model-viewer.js +3 -3
- package/dist/simple-model-viewer.mjs +1 -1
- package/dist/utils.d.mts +5 -4
- package/dist/utils.d.ts +5 -4
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-32WCLPTZ.mjs +0 -1
- package/dist/chunk-CSGNL4XU.mjs +0 -3
- package/dist/chunk-F2ILTIPG.mjs +0 -28
- package/dist/chunk-V6GALFL5.mjs +0 -1
- package/dist/modelInfo-DnkmTGMd.d.mts +0 -23
- package/dist/modelInfo-DnkmTGMd.d.ts +0 -23
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/** Built-in viewer text. Override only the keys your application needs. */
|
|
2
|
+
declare const DEFAULT_MODEL_VIEWER_LABELS: {
|
|
3
|
+
readonly verifyingLicense: "Verifying License";
|
|
4
|
+
readonly checkingYourLicenseKey: "Checking your license key...";
|
|
5
|
+
readonly invalidLicense: "Invalid License";
|
|
6
|
+
readonly licenseHasBeenRevokedOrHasExpired: "License has been revoked or has expired";
|
|
7
|
+
readonly failedToLoadPleaseContactTheSiteAdministrator: "Failed to load. Please contact the site administrator.";
|
|
8
|
+
readonly contextRestoringTitle: "Reloading viewer…";
|
|
9
|
+
readonly contextLostTitle: "3D view interrupted";
|
|
10
|
+
readonly contextRestoringMessage: "Rebuilding the 3D view. Please wait…";
|
|
11
|
+
readonly contextLostMessage: "The graphics connection was interrupted. The viewer will rebuild when it returns, or you can reload it now.";
|
|
12
|
+
readonly reloadViewer: "Reload viewer";
|
|
13
|
+
readonly texturePositioningHint: "Drag to move · Scroll to zoom · Click elsewhere to finish";
|
|
14
|
+
readonly texturePositioningStartHint: "Double-click to move or zoom";
|
|
15
|
+
readonly dismiss: "Dismiss";
|
|
16
|
+
readonly missingUVsAreShownInMagenta: "Missing UVs are shown in magenta.";
|
|
17
|
+
readonly viewThisModelInARWithAppleQuickLook: "View this model in AR with Apple Quick Look";
|
|
18
|
+
readonly viewInAR: "View in AR";
|
|
19
|
+
readonly openThisExperienceOnAPhoneForAR: "Open this experience on a phone for AR";
|
|
20
|
+
readonly openOnPhone: "Open on phone";
|
|
21
|
+
readonly viewThisModelInYourSpace: "View this model in your space";
|
|
22
|
+
readonly viewThisModelInVR: "View this model in VR";
|
|
23
|
+
readonly closePhoneHandoff: "Close phone handoff";
|
|
24
|
+
readonly arScanCode: "Scan the code and choose AR.";
|
|
25
|
+
readonly qrCodeToOpenThisModelOnAPhone: "QR code to open this model on a phone";
|
|
26
|
+
readonly disableUVChecker: "Disable UV checker";
|
|
27
|
+
readonly enableUVChecker: "Enable UV checker";
|
|
28
|
+
readonly explodedView: "Exploded view";
|
|
29
|
+
readonly explodeAmount: "Explode amount";
|
|
30
|
+
readonly removeSectionCut: "Remove section cut";
|
|
31
|
+
readonly sectionCut: "Section cut";
|
|
32
|
+
readonly sectionAxis: "Section axis";
|
|
33
|
+
readonly sectionPosition: "Section position";
|
|
34
|
+
readonly keepTheOtherSide: "Keep the other side";
|
|
35
|
+
readonly pauseCinematic: "Pause cinematic";
|
|
36
|
+
readonly playCinematic: "Play cinematic";
|
|
37
|
+
readonly stopCinematicAndResetCamera: "Stop cinematic and reset camera";
|
|
38
|
+
readonly cancel: "Cancel";
|
|
39
|
+
readonly annotationCategories: "Annotation categories";
|
|
40
|
+
readonly annotations: "Annotations";
|
|
41
|
+
readonly all: "All";
|
|
42
|
+
readonly uncategorized: "Uncategorized";
|
|
43
|
+
readonly decalDragHint: "Drag the decal on the object. Release to save; Escape to cancel.";
|
|
44
|
+
readonly showAll: "Show all";
|
|
45
|
+
readonly materialVariants: "Material variants";
|
|
46
|
+
readonly startGuidedTour: "Start guided tour";
|
|
47
|
+
readonly guidedTour: "Guided Tour";
|
|
48
|
+
readonly previousAnnotation: "Previous annotation";
|
|
49
|
+
readonly previous: "Prev";
|
|
50
|
+
readonly stopGuidedTour: "Stop guided tour";
|
|
51
|
+
readonly nextAnnotation: "Next annotation";
|
|
52
|
+
readonly next: "Next";
|
|
53
|
+
readonly exitFullscreen: "Exit fullscreen";
|
|
54
|
+
readonly enterFullscreen: "Enter fullscreen";
|
|
55
|
+
readonly resetCameraView: "Reset camera view";
|
|
56
|
+
readonly orbitControl: "Orbit Control";
|
|
57
|
+
readonly pointLock: "Point Lock";
|
|
58
|
+
readonly cameraController: "Camera controller";
|
|
59
|
+
readonly cameraControllerSettings: "Camera controller settings";
|
|
60
|
+
readonly downloadGLB: "Download GLB";
|
|
61
|
+
readonly downloadPNG: "Download PNG";
|
|
62
|
+
readonly downloadUVLayout: "Download UV Layout";
|
|
63
|
+
readonly videoFormat: "Video format";
|
|
64
|
+
readonly auto: "Auto";
|
|
65
|
+
readonly recordTurntableVideo: "Record turntable video";
|
|
66
|
+
readonly recordCinematicVideo: "Record cinematic video";
|
|
67
|
+
readonly videoUnsupported: "Video recording is not supported in this browser.";
|
|
68
|
+
readonly downloadOptions: "Download options";
|
|
69
|
+
readonly exporting: "Exporting…";
|
|
70
|
+
readonly download: "Download";
|
|
71
|
+
readonly annotationTitlePlaceholder: "Title *";
|
|
72
|
+
readonly description: "Description";
|
|
73
|
+
readonly ok: "OK";
|
|
74
|
+
readonly arRelocate: "Relocate";
|
|
75
|
+
readonly tapToPlace: "Tap to place";
|
|
76
|
+
readonly closeAnnotation: "Close annotation";
|
|
77
|
+
readonly learnMore: "Learn more";
|
|
78
|
+
readonly stopMeasuring: "Stop measuring";
|
|
79
|
+
readonly startMeasuring: "Start measuring";
|
|
80
|
+
readonly toggleBoundingDimensions: "Toggle bounding dimensions";
|
|
81
|
+
readonly measurementTool: "Measurement tool";
|
|
82
|
+
readonly distance: "Distance";
|
|
83
|
+
readonly angle: "Angle";
|
|
84
|
+
readonly area: "Area";
|
|
85
|
+
readonly pointToPlane: "Point to plane";
|
|
86
|
+
readonly measurementSnapping: "Measurement snapping";
|
|
87
|
+
readonly noSnapping: "No snapping";
|
|
88
|
+
readonly snapAuto: "Snap: auto";
|
|
89
|
+
readonly snapVertex: "Snap: vertex";
|
|
90
|
+
readonly snapEdge: "Snap: edge";
|
|
91
|
+
readonly undoMeasurementPoint: "Undo measurement point";
|
|
92
|
+
readonly clearMeasurements: "Clear measurements";
|
|
93
|
+
readonly finishArea: "Finish area";
|
|
94
|
+
readonly openSceneObjectsPanel: "Open scene objects panel";
|
|
95
|
+
readonly sceneObjects: "SCENE OBJECTS";
|
|
96
|
+
readonly searchNodesLabels: "Search nodes, labels";
|
|
97
|
+
readonly closeSceneObjectsPanel: "Close scene objects panel";
|
|
98
|
+
readonly objectNavigator: "Objects in the 3D view";
|
|
99
|
+
readonly compareBefore: "Before";
|
|
100
|
+
readonly compareAfter: "After";
|
|
101
|
+
readonly compareDivider: "Comparison divider";
|
|
102
|
+
readonly viewIn3D: "View in 3D";
|
|
103
|
+
readonly objectNavigatorHint: "Arrow keys browse · Enter selects · Esc clears";
|
|
104
|
+
readonly selectionCleared: "Selection cleared";
|
|
105
|
+
readonly cameraKeyboardHelp: "3D view. Arrow keys orbit, Shift with Up or Down zooms, and W, A, S, D, Space and C move the camera.";
|
|
106
|
+
readonly isolate: "Isolate";
|
|
107
|
+
readonly hide: "Hide";
|
|
108
|
+
readonly show: "Show";
|
|
109
|
+
readonly closePanel: "Close panel";
|
|
110
|
+
readonly actions: "Actions";
|
|
111
|
+
readonly openPanel: "Open panel";
|
|
112
|
+
readonly close: "Close";
|
|
113
|
+
readonly position: "Position";
|
|
114
|
+
readonly decalNudgeHint: "Click to fine-tune · Hold to move";
|
|
115
|
+
readonly decalNudgeControls: "Move decal in small steps";
|
|
116
|
+
readonly text: "Text";
|
|
117
|
+
readonly yourText: "Your text";
|
|
118
|
+
readonly textToAdd: "Text to add";
|
|
119
|
+
readonly textColour: "Text colour";
|
|
120
|
+
readonly addText: "Add text";
|
|
121
|
+
readonly image: "Image";
|
|
122
|
+
readonly chooseImage: "Choose image";
|
|
123
|
+
readonly imageToAdd: "Image to add";
|
|
124
|
+
readonly added: "Added";
|
|
125
|
+
readonly colour: "Colour";
|
|
126
|
+
readonly size: "Size";
|
|
127
|
+
readonly turn: "Turn";
|
|
128
|
+
readonly rotation: "Rotation";
|
|
129
|
+
readonly dragTheDecalAcrossTheObjectsSurface: "Drag the decal across the object's surface";
|
|
130
|
+
readonly move: "Move";
|
|
131
|
+
readonly remove: "Remove";
|
|
132
|
+
readonly noneAddedYet: "None added yet";
|
|
133
|
+
readonly done: "Done";
|
|
134
|
+
readonly moveForward: "Move forward";
|
|
135
|
+
readonly moveLeft: "Move left";
|
|
136
|
+
readonly moveRight: "Move right";
|
|
137
|
+
readonly moveBackward: "Move backward";
|
|
138
|
+
readonly sceneSettings: "Scene Settings";
|
|
139
|
+
readonly background: "Background";
|
|
140
|
+
readonly backgroundColor: "Background Color";
|
|
141
|
+
readonly environment: "Environment";
|
|
142
|
+
readonly autoRotate: "Auto Rotate";
|
|
143
|
+
readonly lighting: "Lighting";
|
|
144
|
+
readonly exposure: "Exposure";
|
|
145
|
+
readonly ambientLightIntensity: "Ambient Light Intensity";
|
|
146
|
+
readonly ambientLightColor: "Ambient Light Color";
|
|
147
|
+
readonly directLightIntensity: "Direct Light Intensity";
|
|
148
|
+
readonly directLightColor: "Direct Light Color";
|
|
149
|
+
readonly searchObjects: "Search objects";
|
|
150
|
+
readonly uploadedModel: "Uploaded model";
|
|
151
|
+
readonly clear: "Clear";
|
|
152
|
+
readonly chooseModel: "Choose model";
|
|
153
|
+
readonly loadingModel: "Loading model...";
|
|
154
|
+
readonly releaseToLoadYourModel: "Release to load your model";
|
|
155
|
+
readonly arFindSurface: "Move your device over a flat surface";
|
|
156
|
+
readonly arReleaseToPlace: "Release to place";
|
|
157
|
+
readonly arGestureHint: "Pinch to resize · Twist to rotate";
|
|
158
|
+
readonly angleFirstArmHint: "Pick the first arm";
|
|
159
|
+
readonly angleVertexHint: "Pick the angle's vertex";
|
|
160
|
+
readonly angleSecondArmHint: "Pick the second arm";
|
|
161
|
+
readonly angleNewHint: "Pick a point to start a new angle";
|
|
162
|
+
readonly areaNewHint: "Pick a point to start a new area";
|
|
163
|
+
readonly areaCornersHint: "Pick polygon corners in order, then Finish area";
|
|
164
|
+
readonly pointToPlaneFaceHint: "Pick the reference face";
|
|
165
|
+
readonly pointToPlanePointHint: "Pick a point to measure its perpendicular distance";
|
|
166
|
+
readonly pointToPlaneNewHint: "Pick a face to start a new measurement";
|
|
167
|
+
readonly distanceHint: "Pick points on the model to measure distances";
|
|
168
|
+
readonly visibleEntries: "{count} visible entries";
|
|
169
|
+
readonly objectCount: "{count} objects";
|
|
170
|
+
readonly annotationMarker: "Annotation {id}: {title}";
|
|
171
|
+
readonly recordingVideo: "Recording video · {progress}%";
|
|
172
|
+
readonly isolatedObjects: "Isolated: {count} objects";
|
|
173
|
+
readonly largeModelWarning: "Very large model ({millions}M triangles) — it may render and move slowly on this device, and click/hover selection on the model is disabled. Use the objects panel to select parts.";
|
|
174
|
+
readonly preparingLargeModel: "Preparing large model ({millions}M triangles) — the first display can take a while on this device...";
|
|
175
|
+
readonly enterAR: "Enter AR";
|
|
176
|
+
readonly enterVR: "Enter VR";
|
|
177
|
+
readonly decalImage: "Image {index}";
|
|
178
|
+
readonly decalText: "Text {index}";
|
|
179
|
+
readonly decalAdded: "{count} added";
|
|
180
|
+
readonly up: "up";
|
|
181
|
+
readonly down: "down";
|
|
182
|
+
readonly left: "left";
|
|
183
|
+
readonly right: "right";
|
|
184
|
+
readonly moveDecal: "Move decal {direction}";
|
|
185
|
+
readonly moveDecalOnSurface: "Move {direction} on the visible surface";
|
|
186
|
+
readonly showAllObject: "Show all {name}";
|
|
187
|
+
readonly isolateObject: "Isolate {name}";
|
|
188
|
+
readonly isolatedObject: "Isolated: {name}";
|
|
189
|
+
readonly hideObject: "Hide {name}";
|
|
190
|
+
readonly showObject: "Show {name}";
|
|
191
|
+
readonly objectSelected: "{name} selected";
|
|
192
|
+
readonly objectNavigatorPosition: "{position} of {count}";
|
|
193
|
+
readonly compareDividerValue: "{before} {percent}%, {after} {rest}%";
|
|
194
|
+
readonly bindingMismatchOne: "1 object binding doesn't match this model";
|
|
195
|
+
readonly bindingMismatchMany: "{count} object bindings don't match this model";
|
|
196
|
+
readonly simpleLargeModelWarning: "Very large model detected ({millions}M triangles) — it may render and move slowly on this device, and click/hover selection on the model is disabled. Use the scene objects panel to select parts.";
|
|
197
|
+
readonly dropModelHint: "Drag and drop {formats} here";
|
|
198
|
+
readonly loadErrorTitle: "This model couldn't be loaded";
|
|
199
|
+
readonly loadErrorNotFound: "Nothing was found at this address ({status}). Check that modelUrl points to the file.";
|
|
200
|
+
readonly loadErrorDenied: "The server refused access to the file ({status}). Check that the file is public, or that a signed URL hasn't expired.";
|
|
201
|
+
readonly loadErrorStatus: "The server responded with {status} when the file was requested.";
|
|
202
|
+
readonly loadErrorNetwork: "The download was blocked or failed. Check that the URL is correct and, if the file is on another domain, that its server allows cross-origin requests (CORS) from this site.";
|
|
203
|
+
readonly loadErrorHtml: "The server sent back a web page instead of a model. There's probably no file at this path: many servers answer a missing file with their index.html.";
|
|
204
|
+
readonly loadErrorInvalidFile: "The file couldn't be read as {format}. Check that it's a valid {format} file.";
|
|
205
|
+
readonly loadErrorInvalidExplicitFormat: "The file couldn't be read as {format}. Check that it's a valid {format} file and that modelFormat matches it.";
|
|
206
|
+
readonly loadErrorMissingFormat: "The file couldn't be read as {format}. The URL has no file extension, so set modelFormat to the file's format.";
|
|
207
|
+
readonly loadErrorPointCloud: "This PLY file is a point cloud: it has points but no faces, and the viewer shows meshes. Turn it into a mesh first, for example with MeshLab or Blender.";
|
|
208
|
+
readonly measurementReferenceFaceRequired: "Pick a triangle face to define the reference plane.";
|
|
209
|
+
readonly measurementTooManyPoints: "Finish or clear this measurement before adding more points.";
|
|
210
|
+
readonly measurementAngleDistinct: "Pick a point away from the angle's vertex.";
|
|
211
|
+
readonly areaMinimumPoints: "Pick at least three points to finish the area.";
|
|
212
|
+
readonly areaDistinctPoints: "Area points must be distinct.";
|
|
213
|
+
readonly areaStraightLine: "Area points must not lie on one straight line.";
|
|
214
|
+
readonly areaNotPlanar: "Area points must lie on one plane.";
|
|
215
|
+
readonly areaEdgesCross: "Area edges must not cross or touch each other.";
|
|
216
|
+
readonly areaZero: "The polygon has no measurable area.";
|
|
217
|
+
readonly decalSurfaceMissing: "Could not find a surface on this object for the decal.";
|
|
218
|
+
readonly decalDirectionMissing: "No visible surface in that direction. Try another arrow or rotate the view.";
|
|
219
|
+
readonly fullscreenExitFailed: "Could not exit fullscreen. Press Escape to exit.";
|
|
220
|
+
readonly fullscreenEnterFailed: "Could not enter fullscreen. Check your browser or iframe fullscreen permissions and try again.";
|
|
221
|
+
readonly uvCoordinatesMissing: "This model does not contain UV coordinates.";
|
|
222
|
+
readonly uvExportFailed: "Could not create the UV layout archive.";
|
|
223
|
+
readonly videoExportFailed: "Could not export the video.";
|
|
224
|
+
readonly videoNotReady: "Viewer not ready for video export.";
|
|
225
|
+
readonly videoExitXR: "Exit the XR session before recording a video.";
|
|
226
|
+
readonly videoAlreadyRecording: "A video export is already in progress.";
|
|
227
|
+
readonly videoPathRequired: "Enable a cinematic camera path before recording it.";
|
|
228
|
+
readonly videoDurationInvalid: "Video duration must be greater than 0 and at most 300 seconds.";
|
|
229
|
+
readonly videoFrameRateInvalid: "Video frame rate must be between 1 and 60.";
|
|
230
|
+
readonly videoBitrateInvalid: "Video bitrate must be a positive number.";
|
|
231
|
+
readonly videoContextLost: "Video export stopped because the WebGL context was lost.";
|
|
232
|
+
readonly videoTimedOut: "Video export timed out. Keep the viewer tab visible while recording.";
|
|
233
|
+
readonly videoEncodingFailed: "The browser could not encode the video.";
|
|
234
|
+
readonly videoEmpty: "The browser produced an empty video.";
|
|
235
|
+
readonly videoDidNotStart: "Video recording did not start.";
|
|
236
|
+
readonly videoWebMUnsupported: "Video recording as WEBM is not supported in this browser.";
|
|
237
|
+
readonly videoMP4Unsupported: "Video recording as MP4 is not supported in this browser.";
|
|
238
|
+
readonly videoGIFUnsupported: "Video recording as GIF is not supported in this browser.";
|
|
239
|
+
readonly videoGifWidthInvalid: "GIF width must be a whole number of pixels from 16 to 4096.";
|
|
240
|
+
readonly environmentApartment: "apartment";
|
|
241
|
+
readonly environmentCity: "city";
|
|
242
|
+
readonly environmentDawn: "dawn";
|
|
243
|
+
readonly environmentForest: "forest";
|
|
244
|
+
readonly environmentLobby: "lobby";
|
|
245
|
+
readonly environmentNight: "night";
|
|
246
|
+
readonly environmentPark: "park";
|
|
247
|
+
readonly environmentStudio: "studio";
|
|
248
|
+
readonly environmentSunset: "sunset";
|
|
249
|
+
readonly environmentWarehouse: "warehouse";
|
|
250
|
+
readonly color: "Color";
|
|
251
|
+
readonly material: "Material";
|
|
252
|
+
readonly texturePreview: "texture preview";
|
|
253
|
+
readonly noTextureApplied: "No texture applied";
|
|
254
|
+
readonly noTextureCoordinates: "This part has no texture coordinates, so an image can't be placed on it.";
|
|
255
|
+
readonly replaceImage: "Replace image";
|
|
256
|
+
readonly uploadImage: "Upload image";
|
|
257
|
+
readonly removeTexture: "Remove texture";
|
|
258
|
+
readonly texturePosition: "Texture position";
|
|
259
|
+
readonly offsetX: "Offset X";
|
|
260
|
+
readonly offsetY: "Offset Y";
|
|
261
|
+
readonly confirmTexturePosition: "Confirm this texture position and exit positioning mode";
|
|
262
|
+
readonly donePositioning: "Done positioning";
|
|
263
|
+
readonly textureOffsetHint: "Double-click the object in the preview to drag its texture directly (scroll to zoom), or edit its offset numerically.";
|
|
264
|
+
readonly actionToggleLight: "Toggle Light";
|
|
265
|
+
readonly actionChangeLightColor: "Change Light Color";
|
|
266
|
+
readonly actionSetBrightness: "Set Brightness";
|
|
267
|
+
readonly actionChangeColor: "Change Color";
|
|
268
|
+
readonly actionChangeMaterial: "Change Material";
|
|
269
|
+
readonly actionToggleVisibility: "Toggle Visibility";
|
|
270
|
+
};
|
|
271
|
+
type ModelViewerLabelKey = keyof typeof DEFAULT_MODEL_VIEWER_LABELS;
|
|
272
|
+
/** Plain-text overrides; dynamic labels use named {placeholders}. */
|
|
273
|
+
type ModelViewerLabels = Partial<Record<ModelViewerLabelKey, string>>;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Whether the viewer cuts motion that starts on its own: `"user"` follows the
|
|
277
|
+
* visitor's `prefers-reduced-motion` setting, `"always"` and `"never"` override
|
|
278
|
+
* it.
|
|
279
|
+
*/
|
|
280
|
+
type ReducedMotionSetting = "user" | "always" | "never";
|
|
281
|
+
|
|
282
|
+
/** One choice in a row of material variants. */
|
|
283
|
+
type MaterialVariantOption = {
|
|
284
|
+
/** The variant's name, as `sceneConfig.model.activeVariants` lists it. */
|
|
285
|
+
name: string;
|
|
286
|
+
/** The name without its group, for display: "Red" for "Paint: Red". */
|
|
287
|
+
label: string;
|
|
288
|
+
/**
|
|
289
|
+
* The colour of the variant's main material, as a CSS colour, when that
|
|
290
|
+
* material is a plain colour rather than a texture.
|
|
291
|
+
*/
|
|
292
|
+
swatch?: string;
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* Variants that take turns: choosing one replaces the group's other choice.
|
|
296
|
+
* Variants in different groups combine, like a paint colour and a wheel style.
|
|
297
|
+
*/
|
|
298
|
+
type MaterialVariantGroup = {
|
|
299
|
+
/** "Paint" for variants named "Paint: Red" or "Paint / Red"; null otherwise. */
|
|
300
|
+
name: string | null;
|
|
301
|
+
variants: MaterialVariantOption[];
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* The active variants after choosing `name`: it replaces any other variant of
|
|
305
|
+
* its group, so a paint colour swaps for another while the wheels stay.
|
|
306
|
+
*/
|
|
307
|
+
declare function chooseMaterialVariant(activeVariants: readonly string[], name: string, groups: readonly MaterialVariantGroup[]): string[];
|
|
308
|
+
|
|
309
|
+
export { DEFAULT_MODEL_VIEWER_LABELS as D, type MaterialVariantGroup as M, type ReducedMotionSetting as R, type MaterialVariantOption as a, type ModelViewerLabelKey as b, type ModelViewerLabels as c, chooseMaterialVariant as d };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { M as MaterialVariantGroup } from './materialVariants-DnZe9eMC.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* When a viewer starts its 3D view on its own. `"lazy"` waits until it's on
|
|
5
|
+
* or near the screen and shares the page's live 3D views with the other lazy
|
|
6
|
+
* viewers, so a page of viewers stays within the browser's limit. `"eager"`
|
|
7
|
+
* starts at once and keeps its view.
|
|
8
|
+
*/
|
|
9
|
+
type ViewerLoading = "lazy" | "eager";
|
|
10
|
+
/**
|
|
11
|
+
* Whether the 3D view starts on its own (`"auto"`) or waits on the poster
|
|
12
|
+
* until the visitor asks for it with a "View in 3D" button (`"interaction"`).
|
|
13
|
+
*/
|
|
14
|
+
type ViewerReveal = "auto" | "interaction";
|
|
15
|
+
|
|
16
|
+
type ModelFormat = "glb" | "gltf" | "obj" | "fbx" | "usdz" | "stl" | "ply";
|
|
17
|
+
|
|
18
|
+
type ViewerModelBounds = {
|
|
19
|
+
min: [number, number, number];
|
|
20
|
+
max: [number, number, number];
|
|
21
|
+
center: [number, number, number];
|
|
22
|
+
size: [number, number, number];
|
|
23
|
+
};
|
|
24
|
+
/** What `onModelLoaded` reports about a model that finished loading. */
|
|
25
|
+
type ViewerModelInfo = {
|
|
26
|
+
/** Bounds in world space, where the viewer placed the model. */
|
|
27
|
+
bounds: ViewerModelBounds;
|
|
28
|
+
/** Number of meshes in the loaded scene. */
|
|
29
|
+
objectCount: number;
|
|
30
|
+
/**
|
|
31
|
+
* Names of the glTF material variants (KHR_materials_variants) the model
|
|
32
|
+
* offers, in file order; empty when it has none. Show them by setting
|
|
33
|
+
* `sceneConfig.model.activeVariants`.
|
|
34
|
+
*/
|
|
35
|
+
materialVariants: string[];
|
|
36
|
+
/**
|
|
37
|
+
* The same variants as option groups, with their display labels and
|
|
38
|
+
* swatches. One variant from each group can show at once.
|
|
39
|
+
*/
|
|
40
|
+
materialVariantGroups: MaterialVariantGroup[];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type { ModelFormat as M, ViewerLoading as V, ViewerModelBounds as a, ViewerModelInfo as b, ViewerReveal as c };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { M as MaterialVariantGroup } from './materialVariants-DnZe9eMC.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* When a viewer starts its 3D view on its own. `"lazy"` waits until it's on
|
|
5
|
+
* or near the screen and shares the page's live 3D views with the other lazy
|
|
6
|
+
* viewers, so a page of viewers stays within the browser's limit. `"eager"`
|
|
7
|
+
* starts at once and keeps its view.
|
|
8
|
+
*/
|
|
9
|
+
type ViewerLoading = "lazy" | "eager";
|
|
10
|
+
/**
|
|
11
|
+
* Whether the 3D view starts on its own (`"auto"`) or waits on the poster
|
|
12
|
+
* until the visitor asks for it with a "View in 3D" button (`"interaction"`).
|
|
13
|
+
*/
|
|
14
|
+
type ViewerReveal = "auto" | "interaction";
|
|
15
|
+
|
|
16
|
+
type ModelFormat = "glb" | "gltf" | "obj" | "fbx" | "usdz" | "stl" | "ply";
|
|
17
|
+
|
|
18
|
+
type ViewerModelBounds = {
|
|
19
|
+
min: [number, number, number];
|
|
20
|
+
max: [number, number, number];
|
|
21
|
+
center: [number, number, number];
|
|
22
|
+
size: [number, number, number];
|
|
23
|
+
};
|
|
24
|
+
/** What `onModelLoaded` reports about a model that finished loading. */
|
|
25
|
+
type ViewerModelInfo = {
|
|
26
|
+
/** Bounds in world space, where the viewer placed the model. */
|
|
27
|
+
bounds: ViewerModelBounds;
|
|
28
|
+
/** Number of meshes in the loaded scene. */
|
|
29
|
+
objectCount: number;
|
|
30
|
+
/**
|
|
31
|
+
* Names of the glTF material variants (KHR_materials_variants) the model
|
|
32
|
+
* offers, in file order; empty when it has none. Show them by setting
|
|
33
|
+
* `sceneConfig.model.activeVariants`.
|
|
34
|
+
*/
|
|
35
|
+
materialVariants: string[];
|
|
36
|
+
/**
|
|
37
|
+
* The same variants as option groups, with their display labels and
|
|
38
|
+
* swatches. One variant from each group can show at once.
|
|
39
|
+
*/
|
|
40
|
+
materialVariantGroups: MaterialVariantGroup[];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type { ModelFormat as M, ViewerLoading as V, ViewerModelBounds as a, ViewerModelInfo as b, ViewerReveal as c };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { M as ModelFormat,
|
|
2
|
+
import { R as ReducedMotionSetting, c as ModelViewerLabels } from './materialVariants-DnZe9eMC.js';
|
|
3
|
+
import { V as ViewerLoading, c as ViewerReveal, M as ModelFormat, b as ViewerModelInfo } from './modelInfo-XfUQO7C_.js';
|
|
4
|
+
import { r as ObjectBindingDecal, Q as ObjectSurfacePoint, o as ObjectBinding, S as RendererBackend, ap as ViewerCameraState, Y as SceneAnnotationMarker, ar as ViewerObjectInfo, P as ObjectPointerEvent, n as ObjectActionEvent, e as AnimationControls, ao as ViewerCameraConfig, a1 as SceneConfig, aq as ViewerIsolation } from './rendererBackend-QwMzISTn.js';
|
|
4
5
|
import { CameraControls } from '@react-three/drei';
|
|
5
6
|
import { Object3D } from 'three';
|
|
6
7
|
|
|
@@ -19,11 +20,15 @@ type ViewerEngagementEvent = {
|
|
|
19
20
|
objectId: string;
|
|
20
21
|
objectKey: string;
|
|
21
22
|
label?: string;
|
|
22
|
-
source: "canvas" | "panel";
|
|
23
|
+
source: "canvas" | "panel" | "keyboard";
|
|
23
24
|
} | {
|
|
24
25
|
type: "variant-chosen";
|
|
26
|
+
/** The variant chosen; null when a group's choice was cleared. */
|
|
25
27
|
variant: string | null;
|
|
28
|
+
/** The group's previous choice. */
|
|
26
29
|
previousVariant: string | null;
|
|
30
|
+
/** The option group's name; null for a group without one. */
|
|
31
|
+
group: string | null;
|
|
27
32
|
} | {
|
|
28
33
|
type: "ar-started";
|
|
29
34
|
} | {
|
|
@@ -107,10 +112,17 @@ type ModelViewerUiOptions = {
|
|
|
107
112
|
annotationNavigation?: boolean;
|
|
108
113
|
/** Show an annotation's details when its marker is hovered. Default `false`. */
|
|
109
114
|
annotationOnHover?: boolean;
|
|
115
|
+
/** Category filter chips. Default `true` when annotations have categories. */
|
|
116
|
+
annotationFilters?: boolean;
|
|
110
117
|
/** Highlight objects under the pointer. Default `true`. */
|
|
111
118
|
highlightOnHover?: boolean;
|
|
112
|
-
/**
|
|
119
|
+
/** Swatch rows for the model's glTF material variants, one per option group. Default `true`. */
|
|
113
120
|
materialVariants?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* A tab stop for moving through and selecting objects with the keyboard,
|
|
123
|
+
* shown only while it has focus. Default `true`.
|
|
124
|
+
*/
|
|
125
|
+
objectNavigator?: boolean;
|
|
114
126
|
};
|
|
115
127
|
/**
|
|
116
128
|
* Takes over parts of texture positioning (`texturePositioning`). Fields left
|
|
@@ -151,13 +163,19 @@ type ModelViewerControlsOptions = {
|
|
|
151
163
|
enabled?: boolean;
|
|
152
164
|
/** Move the camera with the keyboard while the canvas has focus. Default `false`. */
|
|
153
165
|
keyboard?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Cut motion the viewer starts on its own (auto-rotate, cinematic autoplay,
|
|
168
|
+
* camera glides). `"user"` follows the visitor's reduced-motion setting.
|
|
169
|
+
* Default `"user"`.
|
|
170
|
+
*/
|
|
171
|
+
reducedMotion?: ReducedMotionSetting;
|
|
154
172
|
/** Allow zooming. Default `true`. */
|
|
155
173
|
zoom?: boolean;
|
|
156
174
|
/** Zoom to an object when it's selected. Default `true`. */
|
|
157
175
|
zoomOnSelect?: boolean;
|
|
158
176
|
/** Turn the model slowly; a number sets the speed (1 is normal). Default `false`. */
|
|
159
177
|
autoRotate?: boolean | number;
|
|
160
|
-
/** Re-frame the model when the viewer is resized. Default `true`. */
|
|
178
|
+
/** Re-frame the model, or the selected object it zoomed to, when the viewer is resized. Default `true`. */
|
|
161
179
|
refitOnResize?: boolean;
|
|
162
180
|
/** Distance, angle and pan limits for the camera. */
|
|
163
181
|
limits?: CameraLimits;
|
|
@@ -175,6 +193,12 @@ type ModelViewerPerfOptions = {
|
|
|
175
193
|
profile?: PerformanceProfile;
|
|
176
194
|
/** Needed for Download PNG and captureImage; costs GPU time. Default `false`. */
|
|
177
195
|
preserveDrawingBuffer?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Draw with three's WebGPU renderer where the browser has WebGPU, WebGL
|
|
198
|
+
* elsewhere. Leaves out post-processing effects, contact shadows and WebXR.
|
|
199
|
+
* Default `false`.
|
|
200
|
+
*/
|
|
201
|
+
webgpu?: boolean;
|
|
178
202
|
};
|
|
179
203
|
type ModelViewerTilesOptions = {
|
|
180
204
|
/** A 3D Tiles `tileset.json` to stream instead of loading `modelUrl` whole. */
|
|
@@ -256,14 +280,25 @@ type CaptureImageOptions = {
|
|
|
256
280
|
type CaptureVideoOptions = {
|
|
257
281
|
/** Defaults to cinematic when a path is enabled, otherwise turntable. */
|
|
258
282
|
mode?: "cinematic" | "turntable";
|
|
259
|
-
/**
|
|
260
|
-
|
|
261
|
-
|
|
283
|
+
/**
|
|
284
|
+
* Auto prefers WebM, then MP4. `"gif"` makes an animated GIF that loops
|
|
285
|
+
* forever. Explicit formats reject if unsupported.
|
|
286
|
+
*/
|
|
287
|
+
format?: "auto" | "webm" | "mp4" | "gif";
|
|
288
|
+
/**
|
|
289
|
+
* Seconds per pass, in (0, 300]. Defaults to path timing, or an orbit of
|
|
290
|
+
* 24s (8s for a GIF).
|
|
291
|
+
*/
|
|
262
292
|
duration?: number;
|
|
263
|
-
/** Capture frame rate, from 1 to 60. Default 30. */
|
|
293
|
+
/** Capture frame rate, from 1 to 60. Default 30 (15 for a GIF). */
|
|
264
294
|
fps?: number;
|
|
265
|
-
/** Encoder target bitrate in bits per second. Default 8,000,000. */
|
|
295
|
+
/** Encoder target bitrate in bits per second. Default 8,000,000. Not used for GIFs. */
|
|
266
296
|
videoBitsPerSecond?: number;
|
|
297
|
+
/**
|
|
298
|
+
* GIF width in pixels, from 16 to 4096; the height follows the canvas. Never
|
|
299
|
+
* wider than the canvas. Default 480.
|
|
300
|
+
*/
|
|
301
|
+
gifWidth?: number;
|
|
267
302
|
/** Aborting discards the recording and restores the viewer. */
|
|
268
303
|
signal?: AbortSignal;
|
|
269
304
|
};
|
|
@@ -297,6 +332,11 @@ type ViewerReadyState = {
|
|
|
297
332
|
/** Records one cinematic pass or turntable revolution as a video Blob. */
|
|
298
333
|
captureVideo: (options?: CaptureVideoOptions) => Promise<Blob>;
|
|
299
334
|
invalidate: () => void;
|
|
335
|
+
/**
|
|
336
|
+
* The renderer drawing the viewer: "webgpu" only when ModelViewer's
|
|
337
|
+
* `webgpu` asked for it and the browser has WebGPU.
|
|
338
|
+
*/
|
|
339
|
+
rendererBackend: RendererBackend;
|
|
300
340
|
/**
|
|
301
341
|
* The live three.js scene, camera-controls instance, and model nodes, for
|
|
302
342
|
* integrations the rest of the API doesn't cover. Their shapes are those
|
|
@@ -351,7 +391,27 @@ type CustomSceneObjectsPanelProps = {
|
|
|
351
391
|
onHover?: (binding: ObjectBinding | null) => void;
|
|
352
392
|
};
|
|
353
393
|
type ModelViewerProps = GroupedModelViewerProps & {
|
|
394
|
+
/** Plain-text overrides for built-in UI labels. Missing keys use English. */
|
|
395
|
+
labels?: ModelViewerLabels;
|
|
354
396
|
modelUrl: string;
|
|
397
|
+
/**
|
|
398
|
+
* An image shown in the viewer's place until its 3D view is drawn: a render
|
|
399
|
+
* or photo of the model, best framed as the viewer frames it. Fitted inside
|
|
400
|
+
* the viewer; set the CSS variable `--ri-poster-fit: cover` to fill it.
|
|
401
|
+
*/
|
|
402
|
+
poster?: string;
|
|
403
|
+
/**
|
|
404
|
+
* `"lazy"` (default) starts the 3D view when the viewer is on or near the
|
|
405
|
+
* screen. When the page needs room for viewers in view, one scrolled away
|
|
406
|
+
* from goes back to a picture of itself, and comes back as it was. `"eager"`
|
|
407
|
+
* starts at once and keeps its view.
|
|
408
|
+
*/
|
|
409
|
+
loading?: ViewerLoading;
|
|
410
|
+
/**
|
|
411
|
+
* `"interaction"` keeps the poster, with a "View in 3D" button, until the
|
|
412
|
+
* visitor asks for the 3D view. Default `"auto"`.
|
|
413
|
+
*/
|
|
414
|
+
reveal?: ViewerReveal;
|
|
355
415
|
/** Optional 3D Tiles manifest used instead of loading `modelUrl` monolithically. */
|
|
356
416
|
tilesetUrl?: string | null;
|
|
357
417
|
/** Screen-space error target for streamed 3D Tiles. Lower is sharper. */
|
|
@@ -442,10 +502,18 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
442
502
|
objectTransformSpace?: ObjectTransformSpace;
|
|
443
503
|
/** Enables canvas-focused camera shortcuts. Disabled by default. */
|
|
444
504
|
enableKeyboardNavigation?: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* Cuts motion the viewer starts on its own: auto-rotate and cinematic
|
|
507
|
+
* autoplay don't start, and camera moves jump instead of gliding. `"user"`
|
|
508
|
+
* (default) follows the visitor's `prefers-reduced-motion` setting;
|
|
509
|
+
* `"always"` and `"never"` override it.
|
|
510
|
+
*/
|
|
511
|
+
reducedMotion?: ReducedMotionSetting;
|
|
445
512
|
refitOnResize?: boolean;
|
|
446
513
|
renderMode?: "always" | "demand";
|
|
447
514
|
maxDpr?: number;
|
|
448
515
|
preserveDrawingBuffer?: boolean;
|
|
516
|
+
webgpu?: boolean;
|
|
449
517
|
performanceProfile?: PerformanceProfile;
|
|
450
518
|
dracoDecoderPath?: string | false;
|
|
451
519
|
ktx2TranscoderPath?: string | false;
|
|
@@ -458,6 +526,7 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
458
526
|
showIsolateControls?: boolean;
|
|
459
527
|
showSectionTools?: boolean;
|
|
460
528
|
showMaterialVariants?: boolean;
|
|
529
|
+
showObjectNavigator?: boolean;
|
|
461
530
|
cinematic?: boolean | CinematicConfig;
|
|
462
531
|
measurementUnit?: string;
|
|
463
532
|
enableXR?: boolean;
|
|
@@ -466,6 +535,9 @@ type ModelViewerProps = GroupedModelViewerProps & {
|
|
|
466
535
|
mobileHandoffUrl?: string;
|
|
467
536
|
showAnnotationNavigation?: boolean;
|
|
468
537
|
showAnnotationOnHover?: boolean;
|
|
538
|
+
showAnnotationFilters?: boolean;
|
|
539
|
+
annotationCategories?: string[] | null;
|
|
540
|
+
onAnnotationCategoriesChange?: (categories: string[] | null) => void;
|
|
469
541
|
onSceneConfigChange?: (config: SceneConfig) => void;
|
|
470
542
|
showViewGizmo?: boolean;
|
|
471
543
|
/**
|