@displayxr/inline3d 1.37.1 → 1.39.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/model.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  import type { CursorOptions } from './cursor-depth.js';
5
5
  import type { SceneViewer, SubjectBounds, OrbitPose } from './viewer.js';
6
- import type { FirstWovenResult, ViewerEaseOption } from './index.js';
6
+ import type { FirstWovenResult, RectCoverOption, ViewerEaseOption } from './index.js';
7
7
  import type { PlayCanvasSplatViewer, SplatCameraPose, SplatFrameInfo } from './splat.js';
8
8
 
9
9
  export interface ModelOptions {
@@ -164,6 +164,13 @@ export interface ModelOptions {
164
164
  observe?: Element;
165
165
  /** Forwarded to the core window: see `TileOptions.firstWovenHoldMs`. */
166
166
  firstWovenHoldMs?: number;
167
+ /**
168
+ * The SDK's cover across a move or resize of this canvas (see `TileOptions.rectCover`).
169
+ * **Default `'auto'` here** (the core default is `'off'`): a solid cover showing the last frame,
170
+ * raised when the canvas's size, dpr or page position changes and cut when `rewoven()` settles.
171
+ * Pass `'off'` if the page runs its own cover.
172
+ */
173
+ rectCover?: RectCoverOption;
167
174
  }
168
175
 
169
176
  /** What {@link addModel} returns — the same shape as addSplat's handle. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@displayxr/inline3d",
3
- "version": "1.37.1",
3
+ "version": "1.39.0",
4
4
  "description": "Turn any HTML <canvas> into a 3D window on a spatial display, inside an ordinary web page, for the DisplayXR Browser. Dependency-free; progressive enhancement (falls back to plain 2D everywhere else).",
5
5
  "type": "module",
6
6
  "types": "./index.d.ts",
@@ -176,6 +176,7 @@
176
176
  "test:e2e": "node test/e2e/call-element.e2e.mjs",
177
177
  "test:e2e:camera": "node test/e2e/camera.e2e.mjs",
178
178
  "test:e2e:cursor": "node test/e2e/cursor-depth.e2e.mjs",
179
+ "test:e2e:samples-panel": "node test/e2e/samples-panel.e2e.mjs",
179
180
  "api:check": "node tools/api-surface.mjs --check",
180
181
  "api:update": "node tools/api-surface.mjs --update",
181
182
  "check:snippets": "node tools/check-snippets.mjs",
package/splat.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  import type { CursorOptions } from './cursor-depth.js';
5
5
  import type { SceneViewer, SubjectBounds, OrbitPose } from './viewer.js';
6
- import type { FirstWovenResult, ViewerEaseOption, DisplayMetrics } from './index.js';
6
+ import type { FirstWovenResult, RectCoverOption, ViewerEaseOption, DisplayMetrics } from './index.js';
7
7
 
8
8
  /**
9
9
  * The knobs behind `SplatOptions.perf`. Every one is a Spark 2.1.0 setting except `alphaRadius`,
@@ -515,6 +515,13 @@ export interface SplatOptions {
515
515
  observe?: Element;
516
516
  /** Forwarded to the core window: see `TileOptions.firstWovenHoldMs`. */
517
517
  firstWovenHoldMs?: number;
518
+ /**
519
+ * The SDK's cover across a move or resize of this canvas (see `TileOptions.rectCover`).
520
+ * **Default `'auto'` here** (the core default is `'off'`): a solid cover showing the last frame,
521
+ * raised when the canvas's size, dpr or page position changes and cut when `rewoven()` settles.
522
+ * Pass `'off'` if the page runs its own cover.
523
+ */
524
+ rectCover?: RectCoverOption;
518
525
  /**
519
526
  * Who owns the camera. `'viewer'` (the default): the SDK's orbit, idle spin, auto-fit and focus
520
527
  * gestures. `'page'` (`engine: 'playcanvas'` only; throws on Spark): the page drives the camera
@@ -1045,6 +1052,10 @@ export interface SplatHandle {
1045
1052
  * finished; rejects if the new asset cannot be loaded (the current one stays on screen).
1046
1053
  */
1047
1054
  setSource(src: string | Blob | ArrayBuffer | Uint8Array | SplatPreparedSource, opts?: SplatSourceOptions): Promise<SplatHandle>;
1055
+ /** End a running setSource transition now (its end state at once); no-op when none runs. PlayCanvas backend. */
1056
+ finishSwap?(): SplatHandle;
1057
+ /** The core tile's rewoven(): resolves once the canvas is woven again after a rect move. */
1058
+ rewoven?(): Promise<{ woven: boolean; reason?: string }>;
1048
1059
  /**
1049
1060
  * PlayCanvas backend only — throws on Spark. Fetch, decode and upload `src` now, in the
1050
1061
  * background (the SDK's own passes in idle periods; the engine's end-of-load unpack runs when
@@ -1231,6 +1242,17 @@ export interface SplatHandle {
1231
1242
  * `{ woven: false, reason: 'unsupported' }` at once where there is no inline-3D session.
1232
1243
  */
1233
1244
  readonly firstWoven: Promise<FirstWovenResult>;
1245
+ /**
1246
+ * The core window's `TileHandle.rewoven()`: `firstWoven` measured from now. Cover the canvas
1247
+ * across a rect change (moved into a box, fullscreen, a layout resize) and release when this
1248
+ * settles. Same result shape; `{ woven: false, reason: 'unsupported' }` without a session.
1249
+ */
1250
+ rewoven(): Promise<FirstWovenResult>;
1251
+ /**
1252
+ * End a running `setSource` transition now (the new asset at its end state, in this task).
1253
+ * No-op when none runs. For a page that leaves a scene mid-crossfade on a shared canvas.
1254
+ */
1255
+ finishSwap(): SplatHandle;
1234
1256
  }
1235
1257
 
1236
1258
  /**