@heliguy-xyz/splat-viewer 1.0.0-rc.25 → 1.0.0-rc.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/README.md +39 -0
  2. package/dist/web-component/splat-viewer.esm.js +601 -548
  3. package/dist/web-component/splat-viewer.esm.min.js +1 -1
  4. package/dist/web-component/splat-viewer.js +601 -548
  5. package/dist/web-component/splat-viewer.min.js +1 -1
  6. package/dist/web-component/types/web-component/SplatViewerCore.d.ts +1 -0
  7. package/dist/web-component/types/web-component/SplatViewerCore.d.ts.map +1 -1
  8. package/dist/web-component/types/web-component/SplatViewerElement.d.ts +2 -0
  9. package/dist/web-component/types/web-component/SplatViewerElement.d.ts.map +1 -1
  10. package/dist/web-component/types/web-component/types/attributes.d.ts +3 -0
  11. package/dist/web-component/types/web-component/types/attributes.d.ts.map +1 -1
  12. package/dist/web-component/types/web-component/types/core.d.ts +2 -0
  13. package/dist/web-component/types/web-component/types/core.d.ts.map +1 -1
  14. package/dist/web-component/types/web-component/utils/config.d.ts.map +1 -1
  15. package/dist/web-component/web-component/SplatViewerCore.d.ts +1 -0
  16. package/dist/web-component/web-component/SplatViewerCore.d.ts.map +1 -1
  17. package/dist/web-component/web-component/SplatViewerElement.d.ts +2 -0
  18. package/dist/web-component/web-component/SplatViewerElement.d.ts.map +1 -1
  19. package/dist/web-component/web-component/types/attributes.d.ts +3 -0
  20. package/dist/web-component/web-component/types/attributes.d.ts.map +1 -1
  21. package/dist/web-component/web-component/types/core.d.ts +2 -0
  22. package/dist/web-component/web-component/types/core.d.ts.map +1 -1
  23. package/dist/web-component/web-component/utils/config.d.ts.map +1 -1
  24. package/package.json +1 -1
package/README.md CHANGED
@@ -24,6 +24,7 @@ external dependencies.
24
24
  - 🔄 **Transform System**: Programmatically position, rotate, and scale models
25
25
  - 🎥 **Fly Camera Mode**: First-person WASD + mouse-look navigation with configurable controls
26
26
  - 🎨 **Scene Configuration**: Adjust FOV and background color with smooth animations
27
+ - 👁️ **Preview Mode**: Disable camera controls for product previews with programmatic rotation
27
28
  - 📡 **Comprehensive Events**: React to model lifecycle, transforms, camera changes, and more
28
29
  - 📘 **TypeScript Support**: Full type definitions for all APIs
29
30
 
@@ -161,6 +162,7 @@ declare namespace JSX {
161
162
  height?: string
162
163
  'auto-focus'?: boolean
163
164
  'enable-stats'?: boolean
165
+ 'preview-mode'?: boolean
164
166
  },
165
167
  HTMLElement
166
168
  >
@@ -220,6 +222,7 @@ onMounted(() => {
220
222
  - `auto-focus` - Auto-focus on load (default: true)
221
223
  - `enable-stats` - Show performance stats (default: false)
222
224
  - `max-splats` - Maximum splat count (default: 2000000)
225
+ - `preview-mode` - Disable camera controls for preview use (default: false)
223
226
 
224
227
  #### Camera Controls
225
228
 
@@ -235,6 +238,42 @@ onMounted(() => {
235
238
  - `navigation-cube-size` - Cube size in pixels (default: 120)
236
239
  - `navigation-cube-transition` - Camera transition duration in ms (default: 800)
237
240
 
241
+ ### Preview Mode
242
+
243
+ Preview mode disables all camera controls (mouse/touch interactions) while maintaining programmatic rotation capabilities. This is ideal for:
244
+
245
+ - Product configurators with UI-controlled rotation
246
+ - Model previews with custom control interfaces
247
+ - Embedded viewers where you want to control all interactions
248
+
249
+ **Usage:**
250
+
251
+ ```html
252
+ <splat-viewer src="model.splat" preview-mode></splat-viewer>
253
+ ```
254
+
255
+ **Features in Preview Mode:**
256
+ - ✅ Camera controls are completely disabled
257
+ - ✅ Model is automatically centered and framed on load
258
+ - ✅ Programmatic rotation via `setModelRotation()` API still works
259
+ - ✅ All other APIs remain functional (visibility, transforms, etc.)
260
+
261
+ **Example with Rotation Controls:**
262
+
263
+ ```javascript
264
+ const viewer = document.getElementById('viewer');
265
+
266
+ viewer.addEventListener('loaded', () => {
267
+ const models = viewer.getModels();
268
+ const modelId = models[0].id;
269
+
270
+ // Programmatically set rotation
271
+ viewer.setModelRotation(modelId, { x: 0, y: 45, z: 0 });
272
+ });
273
+ ```
274
+
275
+ See `examples/preview-mode.html` for a complete working example.
276
+
238
277
  ### Events
239
278
 
240
279
  #### Core Events