@viji-dev/core 0.8.10 → 0.8.12
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/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global-p5.d.ts +1 -1
- package/dist/artist-global.d.ts +1 -1
- package/dist/assets/{viji.worker-BPZz310Z.js → viji.worker-dW7fkaOy.js} +509 -427
- package/dist/docs-api.js +2 -2
- package/dist/{essentia-wasm.web-C4eP4VfK.js → essentia-wasm.web-BAkt7bza.js} +2 -2
- package/dist/{index-zNlv_Ytu.js → index-DYUAz0BO.js} +18 -8
- package/dist/index.d.ts +25 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/docs-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as kn } from "./index-
|
|
1
|
+
import { g as kn } from "./index-DYUAz0BO.js";
|
|
2
2
|
function jn(Oe, ot) {
|
|
3
3
|
for (var ve = 0; ve < ot.length; ve++) {
|
|
4
4
|
const Z = ot[ve];
|
|
@@ -3374,4 +3374,4 @@ const xn = /* @__PURE__ */ kn(yi), Ln = /* @__PURE__ */ jn({
|
|
|
3374
3374
|
export {
|
|
3375
3375
|
Ln as e
|
|
3376
3376
|
};
|
|
3377
|
-
//# sourceMappingURL=essentia-wasm.web-
|
|
3377
|
+
//# sourceMappingURL=essentia-wasm.web-BAkt7bza.js.map
|
|
@@ -458,9 +458,10 @@ class DB {
|
|
|
458
458
|
* - `*` for any CORS-friendly URL (MediaPipe model CDN, artist
|
|
459
459
|
* data, public CDNs). The `*` wildcard only matches network
|
|
460
460
|
* schemes per CSP spec, so `blob:` and `data:` must be listed
|
|
461
|
-
* explicitly
|
|
462
|
-
*
|
|
463
|
-
*
|
|
461
|
+
* explicitly so artists can `fetch()` blobs they construct
|
|
462
|
+
* themselves. (MediaPipe's WASM binary is no longer blob-fetched:
|
|
463
|
+
* the cv-tasks worker serves it from memory via a fetch shim, since
|
|
464
|
+
* WebKit refuses `fetch()` of an opaque `blob:null` URL.)
|
|
464
465
|
* img-src/media-src/font-src *
|
|
465
466
|
* - artists can load any CORS-friendly resource. blob:/data:
|
|
466
467
|
* included so artists can render their own constructed blobs.
|
|
@@ -536,7 +537,7 @@ class DB {
|
|
|
536
537
|
}
|
|
537
538
|
}
|
|
538
539
|
}
|
|
539
|
-
const hB = "" + new URL("assets/viji.worker-
|
|
540
|
+
const hB = "" + new URL("assets/viji.worker-dW7fkaOy.js", import.meta.url).href, RB = new URL("assets/wasm/vision_wasm_internal.js", import.meta.url).href, wB = new URL("assets/wasm/vision_wasm_internal.wasm", import.meta.url).href, sB = new URL("assets/wasm/vision_wasm_nosimd_internal.js", import.meta.url).href, FB = new URL("assets/wasm/vision_wasm_nosimd_internal.wasm", import.meta.url).href;
|
|
540
541
|
class kB {
|
|
541
542
|
constructor(A, B, I) {
|
|
542
543
|
this.iframeManager = A, this.sceneCode = B, this.init = I;
|
|
@@ -1523,7 +1524,7 @@ class lB {
|
|
|
1523
1524
|
if (!this.isInitialized)
|
|
1524
1525
|
return this.initPromise ? this.initPromise : (this.initPromise = (async () => {
|
|
1525
1526
|
try {
|
|
1526
|
-
const A = await import("./essentia.js-core.es-CC_3Ap1i.js"), B = await import("./essentia-wasm.web-
|
|
1527
|
+
const A = await import("./essentia.js-core.es-CC_3Ap1i.js"), B = await import("./essentia-wasm.web-BAkt7bza.js").then((g) => g.e), I = A.Essentia || A.default?.Essentia || A.default;
|
|
1527
1528
|
let Q = B.default || B.EssentiaWASM || B.default?.EssentiaWASM;
|
|
1528
1529
|
if (!Q)
|
|
1529
1530
|
throw new Error("WASM module not found - check essentia-wasm.web.js export");
|
|
@@ -7017,6 +7018,8 @@ class K {
|
|
|
7017
7018
|
sceneRenderer = "native";
|
|
7018
7019
|
sceneCapabilities;
|
|
7019
7020
|
sceneP5CanvasMode;
|
|
7021
|
+
// The runtime-locked canvas context, reported by the worker once it locks.
|
|
7022
|
+
sceneContextType;
|
|
7020
7023
|
parametersInitialized = !1;
|
|
7021
7024
|
// Event listeners for parameter system
|
|
7022
7025
|
parameterListeners = /* @__PURE__ */ new Map();
|
|
@@ -7300,7 +7303,7 @@ class K {
|
|
|
7300
7303
|
}), this.workerManager.onMessage("performance-warning", (A) => {
|
|
7301
7304
|
console.warn("Performance warning:", A);
|
|
7302
7305
|
}), this.workerManager.onMessage("performance-update", (A) => {
|
|
7303
|
-
A.effectiveRefreshRate !== void 0 && (this.stats.frameRate.effectiveRefreshRate = A.effectiveRefreshRate, this.stats.frameRate.mode = A.frameRateMode, this.stats.frameRate.screenRefreshRate = A.screenRefreshRate), A.cv !== void 0 && (this.stats.cv = A.cv), A.frames !== void 0 && (this.stats.frames = A.frames, this.stats.timing = A.timing, this.stats.capabilities = A.capabilities, this.firePerformanceSnapshot());
|
|
7306
|
+
A.effectiveRefreshRate !== void 0 && (this.stats.frameRate.effectiveRefreshRate = A.effectiveRefreshRate, this.stats.frameRate.mode = A.frameRateMode, this.stats.frameRate.screenRefreshRate = A.screenRefreshRate), A.cv !== void 0 && (this.stats.cv = A.cv), A.contextType !== void 0 && (this.sceneContextType = A.contextType), A.frames !== void 0 && (this.stats.frames = A.frames, this.stats.timing = A.timing, this.stats.capabilities = A.capabilities, this.firePerformanceSnapshot());
|
|
7304
7307
|
}), this.workerManager.onMessage("capability-transition", (A) => {
|
|
7305
7308
|
this.fireCapabilityTransition(A);
|
|
7306
7309
|
}), this.workerManager.onMessage("parameters-defined", (A) => {
|
|
@@ -7540,6 +7543,7 @@ class K {
|
|
|
7540
7543
|
return {
|
|
7541
7544
|
renderer: this.sceneRenderer,
|
|
7542
7545
|
...this.sceneP5CanvasMode !== void 0 && { p5CanvasMode: this.sceneP5CanvasMode },
|
|
7546
|
+
...this.sceneContextType !== void 0 && { contextType: this.sceneContextType },
|
|
7543
7547
|
capabilities: this.sceneCapabilities,
|
|
7544
7548
|
parameterCount: this.parameterValues.size,
|
|
7545
7549
|
parameterCounts: A,
|
|
@@ -8596,6 +8600,12 @@ class K {
|
|
|
8596
8600
|
* `getImageData()` (raster flush) for 2D-canvas scenes, so `gpuMs` is
|
|
8597
8601
|
* populated for both (`null` only with no drawable context).
|
|
8598
8602
|
*
|
|
8603
|
+
* WebKit (Safari/iOS) caveat: the 2D `getImageData` fence forces a full-canvas
|
|
8604
|
+
* readback that is pathologically slow there, so 2D `gpuMs` is unreliable on
|
|
8605
|
+
* WebKit and self-disables to `null` if it blows a per-frame budget (so the
|
|
8606
|
+
* run can't hang). Prefer steady-state `frameIntervalMs` for 2D raster cost on
|
|
8607
|
+
* WebKit. The WebGL fence is unaffected.
|
|
8608
|
+
*
|
|
8599
8609
|
* Use only on a scene NOT serving as a live compositor source/mixer —
|
|
8600
8610
|
* the per-frame fence would stutter the mixer output (enforced below).
|
|
8601
8611
|
* In-session `frameIntervalMs` includes the fence stall (session-relative);
|
|
@@ -8771,7 +8781,7 @@ function DI(h) {
|
|
|
8771
8781
|
expectedVersion: 1
|
|
8772
8782
|
} : typeof A.senderTime != "number" ? { code: "invalid-field", details: "senderTime must be a number", field: "senderTime" } : null;
|
|
8773
8783
|
}
|
|
8774
|
-
const hI = "0.8.
|
|
8784
|
+
const hI = "0.8.11";
|
|
8775
8785
|
export {
|
|
8776
8786
|
yA as A,
|
|
8777
8787
|
hI as V,
|
|
@@ -8779,4 +8789,4 @@ export {
|
|
|
8779
8789
|
S as b,
|
|
8780
8790
|
PB as g
|
|
8781
8791
|
};
|
|
8782
|
-
//# sourceMappingURL=index-
|
|
8792
|
+
//# sourceMappingURL=index-DYUAz0BO.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -754,6 +754,12 @@ declare interface ButtonParameter {
|
|
|
754
754
|
category: ParameterCategory;
|
|
755
755
|
}
|
|
756
756
|
|
|
757
|
+
/**
|
|
758
|
+
* The canvas rendering context a scene actually locked. Detected at runtime
|
|
759
|
+
* (authoritative) once the context is acquired. See {@link SceneData.contextType}.
|
|
760
|
+
*/
|
|
761
|
+
export declare type CanvasContextType = '2d' | 'webgl' | 'webgl2';
|
|
762
|
+
|
|
757
763
|
/**
|
|
758
764
|
* An immediate edge in a capability's consumed-meaningfully state, delivered
|
|
759
765
|
* via `onCapabilityTransition`. Fires the instant the bit flips, independent
|
|
@@ -1260,8 +1266,10 @@ export declare interface FramePerfSample {
|
|
|
1260
1266
|
* Fence-accurate downstream frame time in ms, or `null` when unavailable.
|
|
1261
1267
|
* Always `null` in steady state. Populated only by `runFencedBenchmark()`:
|
|
1262
1268
|
* WebGL scenes via `gl.finish()` (GPU drain), 2D-canvas scenes via
|
|
1263
|
-
* `getImageData()` (raster flush). `null`
|
|
1264
|
-
*
|
|
1269
|
+
* `getImageData()` (raster flush). `null` when there is no drawable context or
|
|
1270
|
+
* readback fails. Note: 2D `gpuMs` is unreliable on WebKit (the `getImageData`
|
|
1271
|
+
* readback is pathologically slow there and self-disables to `null`) — use
|
|
1272
|
+
* `frameIntervalMs` for 2D raster cost on WebKit.
|
|
1265
1273
|
*/
|
|
1266
1274
|
gpuMs: number | null;
|
|
1267
1275
|
/** Interval since the previous rendered frame (ms). Session-relative under benchmark. */
|
|
@@ -1989,6 +1997,13 @@ export declare interface SceneData {
|
|
|
1989
1997
|
renderer: RendererType;
|
|
1990
1998
|
/** P5 canvas mode; present only when `renderer` is `'p5'`. */
|
|
1991
1999
|
p5CanvasMode?: P5CanvasMode;
|
|
2000
|
+
/**
|
|
2001
|
+
* The canvas context the scene actually locked (`'2d'` / `'webgl'` /
|
|
2002
|
+
* `'webgl2'`), detected at runtime. Present once the context locks (first
|
|
2003
|
+
* render); `undefined` before that. Authoritative — Core locks the context,
|
|
2004
|
+
* so this is exact even for native scenes with dynamic `useContext`.
|
|
2005
|
+
*/
|
|
2006
|
+
contextType?: CanvasContextType;
|
|
1992
2007
|
/** Capabilities the scene's code declares it uses (inclusive-biased). */
|
|
1993
2008
|
capabilities: SceneCapabilities;
|
|
1994
2009
|
/** Total number of parameters the scene defines. */
|
|
@@ -2659,7 +2674,7 @@ declare type TrackingState = 'TRACKING' | 'LOCKED' | 'BREAKDOWN' | 'LOST';
|
|
|
2659
2674
|
/** Returned by `on*` listener registration calls; invoke to unsubscribe. */
|
|
2660
2675
|
export declare type Unsubscribe = () => void;
|
|
2661
2676
|
|
|
2662
|
-
export declare const VERSION = "0.8.
|
|
2677
|
+
export declare const VERSION = "0.8.11";
|
|
2663
2678
|
|
|
2664
2679
|
/**
|
|
2665
2680
|
* Real-time video API: drawable frame, dimensions, and the source-side
|
|
@@ -3060,6 +3075,7 @@ export declare class VijiCore {
|
|
|
3060
3075
|
private sceneRenderer;
|
|
3061
3076
|
private sceneCapabilities;
|
|
3062
3077
|
private sceneP5CanvasMode?;
|
|
3078
|
+
private sceneContextType?;
|
|
3063
3079
|
private parametersInitialized;
|
|
3064
3080
|
private parameterListeners;
|
|
3065
3081
|
private parameterDefinedListeners;
|
|
@@ -3878,6 +3894,12 @@ export declare class VijiCore {
|
|
|
3878
3894
|
* `getImageData()` (raster flush) for 2D-canvas scenes, so `gpuMs` is
|
|
3879
3895
|
* populated for both (`null` only with no drawable context).
|
|
3880
3896
|
*
|
|
3897
|
+
* WebKit (Safari/iOS) caveat: the 2D `getImageData` fence forces a full-canvas
|
|
3898
|
+
* readback that is pathologically slow there, so 2D `gpuMs` is unreliable on
|
|
3899
|
+
* WebKit and self-disables to `null` if it blows a per-frame budget (so the
|
|
3900
|
+
* run can't hang). Prefer steady-state `frameIntervalMs` for 2D raster cost on
|
|
3901
|
+
* WebKit. The WebGL fence is unaffected.
|
|
3902
|
+
*
|
|
3881
3903
|
* Use only on a scene NOT serving as a live compositor source/mixer —
|
|
3882
3904
|
* the per-frame fence would stutter the mixer output (enforced below).
|
|
3883
3905
|
* In-session `frameIntervalMs` includes the fence stall (session-relative);
|
package/dist/index.js
CHANGED