softbox 4.1.3 → 4.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/dist/index.d.cts CHANGED
@@ -412,9 +412,24 @@ export declare interface SimpleViewerOptions {
412
412
  pathTracing?: PathTracingOptions;
413
413
  renderer?: RendererOptions;
414
414
  rendering?: RenderingOptions;
415
+ /** Called when a model finishes loading (each load, including replacements). */
415
416
  onLoad?: () => void;
417
+ /**
418
+ * Download progress for URL-loaded models as a 0–1 fraction. Only called
419
+ * when the server reports a total size (Content-Length).
420
+ */
416
421
  onProgress?: (progress: number) => void;
422
+ /**
423
+ * Called on viewer construction/initialization failures (e.g. WebGL
424
+ * unavailable) and on model load errors. The built-in overlay shows an
425
+ * error state either way; use this to render your own affordance or report.
426
+ */
417
427
  onError?: (error: Error) => void;
428
+ /**
429
+ * @deprecated Never functional since the 3.x architecture rewrite — the
430
+ * render loop is fully managed (turntable/animations/path tracing drive it).
431
+ * Ignored; will be removed in 5.0.
432
+ */
418
433
  animationLoop?: ((time: number) => void) | null;
419
434
  replaceWithScreenshotOnComplete?: boolean;
420
435
  /**
@@ -572,6 +587,12 @@ declare interface ViewerEventMap_2<TObject, TCamera, TControls, THandle> {
572
587
  'model:loading': {
573
588
  url: string;
574
589
  };
590
+ /** Download progress for URL loads; emitted only when the server reports a total size. */
591
+ 'model:progress': {
592
+ url: string;
593
+ loaded: number;
594
+ total: number;
595
+ };
575
596
  'model:loaded': {
576
597
  model: TObject;
577
598
  loadTime: number;
package/dist/index.d.ts CHANGED
@@ -412,9 +412,24 @@ export declare interface SimpleViewerOptions {
412
412
  pathTracing?: PathTracingOptions;
413
413
  renderer?: RendererOptions;
414
414
  rendering?: RenderingOptions;
415
+ /** Called when a model finishes loading (each load, including replacements). */
415
416
  onLoad?: () => void;
417
+ /**
418
+ * Download progress for URL-loaded models as a 0–1 fraction. Only called
419
+ * when the server reports a total size (Content-Length).
420
+ */
416
421
  onProgress?: (progress: number) => void;
422
+ /**
423
+ * Called on viewer construction/initialization failures (e.g. WebGL
424
+ * unavailable) and on model load errors. The built-in overlay shows an
425
+ * error state either way; use this to render your own affordance or report.
426
+ */
417
427
  onError?: (error: Error) => void;
428
+ /**
429
+ * @deprecated Never functional since the 3.x architecture rewrite — the
430
+ * render loop is fully managed (turntable/animations/path tracing drive it).
431
+ * Ignored; will be removed in 5.0.
432
+ */
418
433
  animationLoop?: ((time: number) => void) | null;
419
434
  replaceWithScreenshotOnComplete?: boolean;
420
435
  /**
@@ -572,6 +587,12 @@ declare interface ViewerEventMap_2<TObject, TCamera, TControls, THandle> {
572
587
  'model:loading': {
573
588
  url: string;
574
589
  };
590
+ /** Download progress for URL loads; emitted only when the server reports a total size. */
591
+ 'model:progress': {
592
+ url: string;
593
+ loaded: number;
594
+ total: number;
595
+ };
575
596
  'model:loaded': {
576
597
  model: TObject;
577
598
  loadTime: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-8qG5NSaZ.cjs");exports.ControlType=e.ControlType;exports.ErrorCode=e.ErrorCode;exports.Hotspot=e.Hotspot;exports.SimpleViewer=e.SimpleViewerWrapper;exports.ThreeViewerError=e.ThreeViewerError;exports.TypedEventEmitter=e.TypedEventEmitter;exports.VIEWER_PRESETS=e.VIEWER_PRESETS;exports.defaultOptions=e.defaultOptions;exports.resolvePreset=e.resolvePreset;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BBIH_9cu.cjs");exports.ControlType=e.ControlType;exports.ErrorCode=e.ErrorCode;exports.Hotspot=e.Hotspot;exports.SimpleViewer=e.SimpleViewerWrapper;exports.ThreeViewerError=e.ThreeViewerError;exports.TypedEventEmitter=e.TypedEventEmitter;exports.VIEWER_PRESETS=e.VIEWER_PRESETS;exports.defaultOptions=e.defaultOptions;exports.resolvePreset=e.resolvePreset;
@@ -1,4 +1,4 @@
1
- import { e as s, E as o, H as a, f as t, d as E, T as i, V as p, i as T, r as d } from "./index-Ckn3VxIa.js";
1
+ import { e as s, E as o, H as a, f as t, d as E, T as i, V as p, i as T, r as d } from "./index-B0k0_Cfm.js";
2
2
  export {
3
3
  s as ControlType,
4
4
  o as ErrorCode,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "softbox",
3
3
  "private": false,
4
- "version": "4.1.3",
4
+ "version": "4.2.0",
5
5
  "homepage": "https://leming.github.io/softbox/",
6
6
  "type": "module",
7
7
  "description": "Batteries-included React 3D viewer — any GLB looks studio-shot in one line",