@viji-dev/core 0.3.17 → 0.3.19
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/{essentia-wasm.web-6nI8GVgc.js → essentia-wasm.web-C7QoUtrj.js} +2 -2
- package/dist/{essentia-wasm.web-6nI8GVgc.js.map → essentia-wasm.web-C7QoUtrj.js.map} +1 -1
- package/dist/{index-DSNSJDmw.js → index-BKGarA3m.js} +34 -9
- package/dist/index-BKGarA3m.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/index-DSNSJDmw.js.map +0 -1
|
@@ -7,9 +7,10 @@ class VijiCoreError extends Error {
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
class IFrameManager {
|
|
10
|
-
constructor(hostContainer, initialResolution) {
|
|
10
|
+
constructor(hostContainer, initialResolution, visible = true) {
|
|
11
11
|
this.hostContainer = hostContainer;
|
|
12
12
|
this.isHeadless = !hostContainer;
|
|
13
|
+
this.initiallyVisible = visible;
|
|
13
14
|
if (typeof initialResolution === "object") {
|
|
14
15
|
this.explicitResolution = initialResolution;
|
|
15
16
|
} else if (typeof initialResolution === "number") {
|
|
@@ -49,6 +50,7 @@ class IFrameManager {
|
|
|
49
50
|
activeTouchIds = /* @__PURE__ */ new Set();
|
|
50
51
|
// Device sensor support
|
|
51
52
|
deviceSensorCallback = null;
|
|
53
|
+
initiallyVisible;
|
|
52
54
|
/**
|
|
53
55
|
* Creates a secure IFrame with proper sandbox attributes
|
|
54
56
|
*/
|
|
@@ -71,7 +73,8 @@ class IFrameManager {
|
|
|
71
73
|
document.body.appendChild(hiddenContainer);
|
|
72
74
|
hiddenContainer.appendChild(iframe);
|
|
73
75
|
} else {
|
|
74
|
-
|
|
76
|
+
const visibility = this.initiallyVisible ? "" : "visibility:hidden;";
|
|
77
|
+
iframe.style.cssText = `width:100%;height:100%;border:none;display:block;${visibility}`;
|
|
75
78
|
this.hostContainer.appendChild(iframe);
|
|
76
79
|
}
|
|
77
80
|
const iframeContent = this.generateIFrameHTML();
|
|
@@ -286,6 +289,16 @@ class IFrameManager {
|
|
|
286
289
|
get element() {
|
|
287
290
|
return this.iframe;
|
|
288
291
|
}
|
|
292
|
+
show() {
|
|
293
|
+
if (this.iframe && !this.isHeadless) {
|
|
294
|
+
this.iframe.style.visibility = "visible";
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
hide() {
|
|
298
|
+
if (this.iframe && !this.isHeadless) {
|
|
299
|
+
this.iframe.style.visibility = "hidden";
|
|
300
|
+
}
|
|
301
|
+
}
|
|
289
302
|
/**
|
|
290
303
|
* Generates the HTML content for the secure IFrame
|
|
291
304
|
*/
|
|
@@ -1900,7 +1913,7 @@ class EssentiaOnsetDetection {
|
|
|
1900
1913
|
this.initPromise = (async () => {
|
|
1901
1914
|
try {
|
|
1902
1915
|
const essentiaModule = await import("./essentia.js-core.es-DnrJE0uR.js");
|
|
1903
|
-
const wasmModule = await import("./essentia-wasm.web-
|
|
1916
|
+
const wasmModule = await import("./essentia-wasm.web-C7QoUtrj.js").then((n) => n.e);
|
|
1904
1917
|
const EssentiaClass = essentiaModule.Essentia || essentiaModule.default?.Essentia || essentiaModule.default;
|
|
1905
1918
|
let WASMModule = wasmModule.default || wasmModule.EssentiaWASM || wasmModule.default?.EssentiaWASM;
|
|
1906
1919
|
if (!WASMModule) {
|
|
@@ -14636,7 +14649,6 @@ class VijiCore {
|
|
|
14636
14649
|
* Enable auto-capture with optional format (internal, called by linkFrameSources)
|
|
14637
14650
|
*/
|
|
14638
14651
|
enableAutoCapture(format) {
|
|
14639
|
-
if (this.autoCaptureEnabled) return;
|
|
14640
14652
|
this.autoCaptureEnabled = true;
|
|
14641
14653
|
if (this.workerManager) {
|
|
14642
14654
|
this.workerManager.postMessage("enable-auto-capture", {
|
|
@@ -14695,6 +14707,21 @@ class VijiCore {
|
|
|
14695
14707
|
getDebugMode() {
|
|
14696
14708
|
return this.debugMode;
|
|
14697
14709
|
}
|
|
14710
|
+
/**
|
|
14711
|
+
* Show the core's iframe (make it visible in the host container).
|
|
14712
|
+
* No-op for headless cores.
|
|
14713
|
+
*/
|
|
14714
|
+
show() {
|
|
14715
|
+
this.iframeManager?.show();
|
|
14716
|
+
}
|
|
14717
|
+
/**
|
|
14718
|
+
* Hide the core's iframe (keep rendering but invisible).
|
|
14719
|
+
* Useful for create-in-background, reveal-when-ready patterns.
|
|
14720
|
+
* No-op for headless cores.
|
|
14721
|
+
*/
|
|
14722
|
+
hide() {
|
|
14723
|
+
this.iframeManager?.hide();
|
|
14724
|
+
}
|
|
14698
14725
|
/**
|
|
14699
14726
|
* Select audio analysis backend
|
|
14700
14727
|
*/
|
|
@@ -14720,12 +14747,10 @@ class VijiCore {
|
|
|
14720
14747
|
}
|
|
14721
14748
|
this.isInitializing = true;
|
|
14722
14749
|
this.debugLog(`Starting VijiCore initialization... (${this.instanceId})`);
|
|
14723
|
-
if (this.config.hostContainer) {
|
|
14724
|
-
this.config.hostContainer.innerHTML = "";
|
|
14725
|
-
}
|
|
14726
14750
|
this.iframeManager = new IFrameManager(
|
|
14727
14751
|
this.config.hostContainer || null,
|
|
14728
|
-
this.config.resolution
|
|
14752
|
+
this.config.resolution,
|
|
14753
|
+
this.config.visible ?? true
|
|
14729
14754
|
);
|
|
14730
14755
|
await this.iframeManager.createSecureIFrame();
|
|
14731
14756
|
const offscreenCanvas = await this.createCanvasWithRetry();
|
|
@@ -16292,4 +16317,4 @@ export {
|
|
|
16292
16317
|
VijiCoreError as b,
|
|
16293
16318
|
getDefaultExportFromCjs as g
|
|
16294
16319
|
};
|
|
16295
|
-
//# sourceMappingURL=index-
|
|
16320
|
+
//# sourceMappingURL=index-BKGarA3m.js.map
|