@caperjs/core 0.2.3 → 0.3.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/build/index.mjs +3 -1
- package/build/internal/discovery.mjs +1 -1
- package/build/internal/manifest.mjs +8 -3
- package/build/internal/validate.mjs +3 -1
- package/build/plugins/assetTypes.mjs +4 -4
- package/build/plugins/caperConfig.mjs +12 -5
- package/build/plugins/lists.mjs +29 -9
- package/cli/create.mjs +57 -6
- package/cli/create.test.mjs +36 -0
- package/cli/update.mjs +1 -1
- package/lib/{CaptionsPlugin-WPAcfAkx.js → CaptionsPlugin-BLbLl3WB.js} +3 -3
- package/lib/{CaptionsPlugin-WPAcfAkx.js.map → CaptionsPlugin-BLbLl3WB.js.map} +1 -1
- package/lib/{DataAdapter-DS-twowe.js → DataAdapter-aHSNM_26.js} +12 -7
- package/lib/DataAdapter-aHSNM_26.js.map +1 -0
- package/lib/{DebugRenderer-D1ryrRYx.js → DebugRenderer-8LjHtBzA.js} +2 -2
- package/lib/{DebugRenderer-D1ryrRYx.js.map → DebugRenderer-8LjHtBzA.js.map} +1 -1
- package/lib/{DevToolsPlugin-DH7zX7HU.js → DevToolsPlugin-Vrk6aOtS.js} +2 -2
- package/lib/{DevToolsPlugin-DH7zX7HU.js.map → DevToolsPlugin-Vrk6aOtS.js.map} +1 -1
- package/lib/{GSAPPlugin-BBtRjUqe.js → GSAPPlugin-Hm3F4zdg.js} +3 -3
- package/lib/{GSAPPlugin-BBtRjUqe.js.map → GSAPPlugin-Hm3F4zdg.js.map} +1 -1
- package/lib/{LayoutPlugin-Co6vcoV4.js → LayoutPlugin-Dpgeawfw.js} +4 -4
- package/lib/{LayoutPlugin-Co6vcoV4.js.map → LayoutPlugin-Dpgeawfw.js.map} +1 -1
- package/lib/{SpinePlugin-uN641Hmk.js → SpinePlugin-B08yAw1S.js} +690 -793
- package/lib/SpinePlugin-B08yAw1S.js.map +1 -0
- package/lib/{StatsPlugin-vZQRm6wh.js → StatsPlugin-D2Xa5j97.js} +5 -2
- package/lib/StatsPlugin-D2Xa5j97.js.map +1 -0
- package/lib/{VoiceOverPlugin-KlZdGj1G.js → VoiceOverPlugin-qtFlqpRn.js} +6 -5
- package/lib/VoiceOverPlugin-qtFlqpRn.js.map +1 -0
- package/lib/caper.mjs +37 -19
- package/lib/caper.mjs.map +1 -1
- package/lib/core/Application.d.ts +8 -3
- package/lib/core/Application.d.ts.map +1 -1
- package/lib/core/Application.test.d.ts +2 -0
- package/lib/core/Application.test.d.ts.map +1 -0
- package/lib/core/config.d.ts +6 -1
- package/lib/core/config.d.ts.map +1 -1
- package/lib/core/config.test.d.ts +2 -0
- package/lib/core/config.test.d.ts.map +1 -0
- package/lib/core/interfaces/IApplication.d.ts +6 -6
- package/lib/core/interfaces/IApplication.d.ts.map +1 -1
- package/lib/core/interfaces/ICoreSignals.d.ts +2 -1
- package/lib/core/interfaces/ICoreSignals.d.ts.map +1 -1
- package/lib/display/Camera.test.d.ts +2 -0
- package/lib/display/Camera.test.d.ts.map +1 -0
- package/lib/display/Entity.d.ts +2 -2
- package/lib/display/SceneTransition.test.d.ts +1 -0
- package/lib/display/SceneTransition.test.d.ts.map +1 -0
- package/lib/display/SpineAnimation.d.ts +3 -3
- package/lib/mixins/factory/methods.d.ts.map +1 -1
- package/lib/plugins/AssetsPlugin.d.ts.map +1 -1
- package/lib/plugins/AssetsPlugin.test.d.ts +2 -0
- package/lib/plugins/AssetsPlugin.test.d.ts.map +1 -0
- package/lib/plugins/DataAdapter.d.ts.map +1 -1
- package/lib/plugins/DataAdapter.test.d.ts +2 -0
- package/lib/plugins/DataAdapter.test.d.ts.map +1 -0
- package/lib/plugins/FullScreenPlugin.d.ts.map +1 -1
- package/lib/plugins/FullScreenPlugin.test.d.ts +2 -0
- package/lib/plugins/FullScreenPlugin.test.d.ts.map +1 -0
- package/lib/plugins/GSAPPlugin.d.ts +0 -2
- package/lib/plugins/GSAPPlugin.d.ts.map +1 -1
- package/lib/plugins/GSAPPlugin.test.d.ts +2 -0
- package/lib/plugins/GSAPPlugin.test.d.ts.map +1 -0
- package/lib/plugins/LookupPlugin.d.ts +6 -1
- package/lib/plugins/LookupPlugin.d.ts.map +1 -1
- package/lib/plugins/LookupPlugin.test.d.ts +2 -0
- package/lib/plugins/LookupPlugin.test.d.ts.map +1 -0
- package/lib/plugins/PopupManagerPlugin.d.ts.map +1 -1
- package/lib/plugins/PopupManagerPlugin.test.d.ts +1 -0
- package/lib/plugins/PopupManagerPlugin.test.d.ts.map +1 -0
- package/lib/plugins/SceneManagerPlugin.d.ts +1 -0
- package/lib/plugins/SceneManagerPlugin.d.ts.map +1 -1
- package/lib/plugins/SceneManagerPlugin.test.d.ts +2 -0
- package/lib/plugins/SceneManagerPlugin.test.d.ts.map +1 -0
- package/lib/plugins/StatsPlugin.d.ts +1 -0
- package/lib/plugins/StatsPlugin.d.ts.map +1 -1
- package/lib/plugins/WebEventsPlugin.d.ts.map +1 -1
- package/lib/plugins/actions/ActionsPlugin.test.d.ts +2 -0
- package/lib/plugins/actions/ActionsPlugin.test.d.ts.map +1 -0
- package/lib/plugins/audio/AudioChannel.d.ts.map +1 -1
- package/lib/plugins/audio/AudioManagerPlugin.d.ts.map +1 -1
- package/lib/plugins/audio/AudioManagerPlugin.test.d.ts +2 -0
- package/lib/plugins/audio/AudioManagerPlugin.test.d.ts.map +1 -0
- package/lib/plugins/audio/VoiceOverPlugin.d.ts.map +1 -1
- package/lib/plugins/captions/CaptionsPlugin.test.d.ts +2 -0
- package/lib/plugins/captions/CaptionsPlugin.test.d.ts.map +1 -0
- package/lib/plugins/focus/FocusManagerPlugin.d.ts.map +1 -1
- package/lib/plugins/focus/FocusManagerPlugin.test.d.ts +2 -0
- package/lib/plugins/focus/FocusManagerPlugin.test.d.ts.map +1 -0
- package/lib/plugins/input/AbstractControls.d.ts +5 -0
- package/lib/plugins/input/AbstractControls.d.ts.map +1 -1
- package/lib/plugins/input/Controls.test.d.ts +2 -0
- package/lib/plugins/input/Controls.test.d.ts.map +1 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts +5 -0
- package/lib/plugins/input/keyboard/KeyboardContols.d.ts.map +1 -1
- package/lib/plugins/input/touch/VirtualControls.d.ts +6 -0
- package/lib/plugins/input/touch/VirtualControls.d.ts.map +1 -1
- package/lib/plugins/input/touch/VirtualControls.test.d.ts +2 -0
- package/lib/plugins/input/touch/VirtualControls.test.d.ts.map +1 -0
- package/lib/{registries-BLrxALZ0.js → registries-m2vKTIih.js} +156 -101
- package/lib/registries-m2vKTIih.js.map +1 -0
- package/lib/store/Store.d.ts.map +1 -1
- package/lib/ui/Button.d.ts +8 -1
- package/lib/ui/Button.d.ts.map +1 -1
- package/lib/ui/Button.test.d.ts +2 -0
- package/lib/ui/Button.test.d.ts.map +1 -0
- package/lib/ui/UICanvas.d.ts +10 -1
- package/lib/ui/UICanvas.d.ts.map +1 -1
- package/lib/ui/UICanvas.test.d.ts +0 -1
- package/lib/ui/UICanvas.test.d.ts.map +1 -1
- package/lib/utils/color.d.ts.map +1 -1
- package/lib/utils/color.test.d.ts +2 -0
- package/lib/utils/color.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/core/Application.test.ts +168 -0
- package/src/core/Application.ts +37 -27
- package/src/core/config.test.ts +79 -0
- package/src/core/config.ts +28 -6
- package/src/core/interfaces/IApplication.ts +6 -6
- package/src/core/interfaces/ICoreSignals.ts +2 -0
- package/src/display/Camera.test.ts +40 -0
- package/src/display/Camera.ts +3 -3
- package/src/display/Entity.ts +2 -2
- package/src/display/SceneTransition.test.ts +58 -0
- package/src/display/SceneTransition.ts +1 -1
- package/src/display/SpineAnimation.ts +4 -4
- package/src/mixins/factory/methods.ts +0 -1
- package/src/plugins/AssetsPlugin.test.ts +48 -0
- package/src/plugins/AssetsPlugin.ts +3 -1
- package/src/plugins/DataAdapter.test.ts +32 -0
- package/src/plugins/DataAdapter.ts +5 -1
- package/src/plugins/FullScreenPlugin.test.ts +48 -0
- package/src/plugins/FullScreenPlugin.ts +5 -1
- package/src/plugins/GSAPPlugin.test.ts +31 -0
- package/src/plugins/GSAPPlugin.ts +1 -4
- package/src/plugins/LookupPlugin.test.ts +42 -0
- package/src/plugins/LookupPlugin.ts +15 -3
- package/src/plugins/PopupManagerPlugin.test.ts +53 -0
- package/src/plugins/PopupManagerPlugin.ts +5 -3
- package/src/plugins/SceneManagerPlugin.test.ts +76 -0
- package/src/plugins/SceneManagerPlugin.ts +21 -11
- package/src/plugins/StatsPlugin.ts +8 -0
- package/src/plugins/WebEventsPlugin.test.ts +32 -0
- package/src/plugins/WebEventsPlugin.ts +2 -0
- package/src/plugins/actions/ActionsPlugin.test.ts +68 -0
- package/src/plugins/actions/ActionsPlugin.ts +5 -5
- package/src/plugins/audio/AudioChannel.test.ts +19 -0
- package/src/plugins/audio/AudioChannel.ts +8 -1
- package/src/plugins/audio/AudioManagerPlugin.test.ts +41 -0
- package/src/plugins/audio/AudioManagerPlugin.ts +3 -2
- package/src/plugins/audio/VoiceOverPlugin.ts +1 -0
- package/src/plugins/captions/CaptionsPlugin.test.ts +40 -0
- package/src/plugins/captions/CaptionsPlugin.ts +1 -1
- package/src/plugins/focus/FocusManagerPlugin.test.ts +71 -0
- package/src/plugins/focus/FocusManagerPlugin.ts +7 -0
- package/src/plugins/input/AbstractControls.ts +6 -0
- package/src/plugins/input/Controls.test.ts +149 -0
- package/src/plugins/input/keyboard/KeyboardContols.ts +29 -5
- package/src/plugins/input/touch/VirtualControls.test.ts +38 -0
- package/src/plugins/input/touch/VirtualControls.ts +44 -10
- package/src/plugins/spine/SpinePlugin.ts +2 -2
- package/src/store/Store.test.ts +15 -0
- package/src/store/Store.ts +4 -1
- package/src/ui/Button.test.ts +248 -0
- package/src/ui/Button.ts +42 -10
- package/src/ui/UICanvas.test.ts +109 -6
- package/src/ui/UICanvas.ts +41 -3
- package/src/utils/color.test.ts +16 -0
- package/src/utils/color.ts +2 -1
- package/src/utils/platform.ts +1 -1
- package/src/version.ts +1 -1
- package/lib/DataAdapter-DS-twowe.js.map +0 -1
- package/lib/SpinePlugin-uN641Hmk.js.map +0 -1
- package/lib/StatsPlugin-vZQRm6wh.js.map +0 -1
- package/lib/VoiceOverPlugin-KlZdGj1G.js.map +0 -1
- package/lib/registries-BLrxALZ0.js.map +0 -1
|
@@ -325,62 +325,63 @@ function qe() {
|
|
|
325
325
|
//#endregion
|
|
326
326
|
//#region src/core/config.ts
|
|
327
327
|
async function Je(e) {
|
|
328
|
-
let t = Caper
|
|
328
|
+
let t = globalThis.Caper?.get?.("pluginsList") ?? [];
|
|
329
329
|
return e.map((e) => {
|
|
330
|
-
let n =
|
|
331
|
-
if (!
|
|
332
|
-
let
|
|
330
|
+
let n = Array.isArray(e) ? e[0] : e, r = t.find((e) => e.id === n);
|
|
331
|
+
if (!r) return S.warn(`Plugin ${e} not found`), null;
|
|
332
|
+
let i = e;
|
|
333
333
|
return {
|
|
334
|
-
id:
|
|
335
|
-
path:
|
|
336
|
-
module:
|
|
337
|
-
requires:
|
|
338
|
-
options:
|
|
339
|
-
autoLoad:
|
|
334
|
+
id: r.id,
|
|
335
|
+
path: r.path,
|
|
336
|
+
module: r.module,
|
|
337
|
+
requires: r.requires ?? [],
|
|
338
|
+
options: i[1]?.options,
|
|
339
|
+
autoLoad: i[1]?.autoLoad !== !1
|
|
340
340
|
};
|
|
341
341
|
}).filter(Boolean);
|
|
342
342
|
}
|
|
343
343
|
function Ye(e) {
|
|
344
344
|
return e;
|
|
345
345
|
}
|
|
346
|
-
function Xe(e) {
|
|
346
|
+
function Xe(e, t) {
|
|
347
347
|
if (e.length < 2) return e.slice();
|
|
348
|
-
let
|
|
349
|
-
for (let
|
|
350
|
-
let n = [];
|
|
351
|
-
for (let
|
|
352
|
-
from:
|
|
348
|
+
let n = /* @__PURE__ */ new Map();
|
|
349
|
+
for (let t of e) n.set(t.id, t);
|
|
350
|
+
let r = (e) => (e.requires ?? []).filter((e) => n.has(e) || !t?.has(e)), i = [];
|
|
351
|
+
for (let t of e) for (let e of r(t)) n.has(e) || i.push({
|
|
352
|
+
from: t.id,
|
|
353
353
|
required: e
|
|
354
354
|
});
|
|
355
|
-
if (
|
|
356
|
-
let e =
|
|
355
|
+
if (i.length > 0) {
|
|
356
|
+
let e = i.map((e) => ` - Plugin '${e.from}' requires '${e.required}' which is not registered.`), t = "\nAdd the missing plugin id(s) to plugins[] in caper.config.ts:\n " + [...new Set(i.map((e) => `'${e.required}'`))].join(", ");
|
|
357
357
|
throw Error(`Caper bootstrap failed:\n${e.join("\n")}${t}`);
|
|
358
358
|
}
|
|
359
|
-
let
|
|
360
|
-
e.forEach((e, t) =>
|
|
361
|
-
let
|
|
359
|
+
let a = /* @__PURE__ */ new Map();
|
|
360
|
+
e.forEach((e, t) => a.set(e.id, t));
|
|
361
|
+
let o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
362
362
|
for (let t of e) {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
363
|
+
let e = r(t);
|
|
364
|
+
o.set(t.id, e.length);
|
|
365
|
+
for (let n of e) s.has(n) || s.set(n, []), s.get(n).push(t.id);
|
|
366
|
+
}
|
|
367
|
+
let c = [];
|
|
368
|
+
for (let t of e) o.get(t.id) === 0 && c.push(t.id);
|
|
369
|
+
c.sort((e, t) => a.get(e) - a.get(t));
|
|
370
|
+
let l = [];
|
|
371
|
+
for (; c.length > 0;) {
|
|
372
|
+
let e = c.shift();
|
|
373
|
+
l.push(n.get(e));
|
|
374
|
+
for (let t of s.get(e) ?? []) if (o.set(t, o.get(t) - 1), o.get(t) === 0) {
|
|
375
|
+
let e = a.get(t), n = 0;
|
|
376
|
+
for (; n < c.length && a.get(c[n]) < e;) n++;
|
|
377
|
+
c.splice(n, 0, t);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (l.length !== e.length) {
|
|
381
|
+
let t = e.filter((e) => !l.includes(e)).map((e) => e.id), r = Ze(t, n);
|
|
382
|
+
throw Error(`Caper bootstrap failed: plugin dependency cycle detected: ${r.join(" → ")}\nPlugins involved: ${t.join(", ")}`);
|
|
383
|
+
}
|
|
384
|
+
return l;
|
|
384
385
|
}
|
|
385
386
|
function Ze(e, t) {
|
|
386
387
|
let n = /* @__PURE__ */ new Set(), r = [], i = new Set(e);
|
|
@@ -693,7 +694,7 @@ var O = /* @__PURE__ */ h(((e) => {
|
|
|
693
694
|
}
|
|
694
695
|
async save(e, t, n, r = !0) {
|
|
695
696
|
let i = [], a = [];
|
|
696
|
-
i = Array.isArray(e) ? e : [e], (
|
|
697
|
+
i = Array.isArray(e) ? e : [e], i.some((e) => e === "*" || e?.adapterId === "*") && (i = this.allAdapterIds());
|
|
697
698
|
for (let e = 0; e < i.length; e++) {
|
|
698
699
|
let o, s = !1;
|
|
699
700
|
if (typeof i[e] == "object") {
|
|
@@ -798,13 +799,13 @@ var M = class {
|
|
|
798
799
|
registerCoreFunctions() {
|
|
799
800
|
this.getCoreFunctions().forEach((e) => {
|
|
800
801
|
let t = e;
|
|
801
|
-
|
|
802
|
+
Vn[t] = this[e];
|
|
802
803
|
});
|
|
803
804
|
}
|
|
804
805
|
registerCoreSignals() {
|
|
805
806
|
this.getCoreSignals().forEach((e) => {
|
|
806
807
|
let t = e;
|
|
807
|
-
|
|
808
|
+
Bn[t] = this[e];
|
|
808
809
|
});
|
|
809
810
|
}
|
|
810
811
|
getCoreFunctions() {
|
|
@@ -866,7 +867,7 @@ var pt = class extends M {
|
|
|
866
867
|
async loadRequired() {
|
|
867
868
|
if (this._isLoadingRequired = !0, this._handleLoadStart(), this._handleLoadProgress(0), this._required && (this._required.assets && await t.load(N(this._required.assets), this._handleLoadProgress), this._required.bundles)) {
|
|
868
869
|
let e = this._required.bundles;
|
|
869
|
-
Array.isArray(e) || (e = [e]), e = e.filter((e) => !this._isBundleLoaded(e)), await t.loadBundle(
|
|
870
|
+
Array.isArray(e) || (e = [e]), e = e.filter((e) => !this._isBundleLoaded(e)), e.length && await t.loadBundle(e, this._handleLoadProgress);
|
|
870
871
|
}
|
|
871
872
|
return this._handleLoadComplete(), this._isLoadingRequired = !1, Promise.resolve();
|
|
872
873
|
}
|
|
@@ -1025,7 +1026,7 @@ var pt = class extends M {
|
|
|
1025
1026
|
document.addEventListener("fullscreenchange", this._onFullScreenChange), document.addEventListener("webkitfullscreenchange", this._onFullScreenChange), document.addEventListener("mozfullscreenchange", this._onFullScreenChange), document.addEventListener("msfullscreenchange", this._onFullScreenChange), document.addEventListener("fullscreenchange", this._onFullScreenChange);
|
|
1026
1027
|
}
|
|
1027
1028
|
destroy() {
|
|
1028
|
-
document.removeEventListener("fullscreenchange", this._onFullScreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullScreenChange), document.removeEventListener("mozfullscreenchange", this._onFullScreenChange), document.removeEventListener("msfullscreenchange", this._onFullScreenChange), document.removeEventListener("fullscreenchange", this._onFullScreenChange);
|
|
1029
|
+
document.removeEventListener("fullscreenchange", this._onFullScreenChange), document.removeEventListener("webkitfullscreenchange", this._onFullScreenChange), document.removeEventListener("mozfullscreenchange", this._onFullScreenChange), document.removeEventListener("msfullscreenchange", this._onFullScreenChange), document.removeEventListener("fullscreenchange", this._onFullScreenChange), super.destroy();
|
|
1029
1030
|
}
|
|
1030
1031
|
toggleFullScreen() {
|
|
1031
1032
|
this.setFullScreen(!this._isFullScreen);
|
|
@@ -1069,7 +1070,7 @@ var pt = class extends M {
|
|
|
1069
1070
|
document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen && document.mozCancelFullScreen();
|
|
1070
1071
|
}
|
|
1071
1072
|
_onFullScreenChange() {
|
|
1072
|
-
this.onFullScreenChange.emit(
|
|
1073
|
+
this._isFullScreen = this.isFullscreen, this.onFullScreenChange.emit(this._isFullScreen);
|
|
1073
1074
|
}
|
|
1074
1075
|
};
|
|
1075
1076
|
//#endregion
|
|
@@ -1178,7 +1179,8 @@ var ht = class extends M {
|
|
|
1178
1179
|
this._debug && S.warn(`Action ${e} is not defined`);
|
|
1179
1180
|
return;
|
|
1180
1181
|
}
|
|
1181
|
-
|
|
1182
|
+
let n = this._actions[e].context;
|
|
1183
|
+
if (Array.isArray(n) ? n.includes(this.context) : n === this.context || n === "*") {
|
|
1182
1184
|
let n = {
|
|
1183
1185
|
id: e,
|
|
1184
1186
|
context: this.context,
|
|
@@ -1578,7 +1580,11 @@ var L = {
|
|
|
1578
1580
|
restore() {
|
|
1579
1581
|
this.muted = this._muted, this.volume = this._volume;
|
|
1580
1582
|
}
|
|
1581
|
-
destroy() {
|
|
1583
|
+
destroy() {
|
|
1584
|
+
this._sounds.forEach((e) => {
|
|
1585
|
+
[...e].forEach((e) => e.destroy());
|
|
1586
|
+
}), this._sounds.clear();
|
|
1587
|
+
}
|
|
1582
1588
|
}, z = class {
|
|
1583
1589
|
constructor(e, t, n) {
|
|
1584
1590
|
this.id = e, this.channel = t, this.manager = n, this.onStart = new A(), this.onStop = new A(), this.onEnd = new A(), this.onPaused = new A(), this.onResumed = new A(), this.onProgress = new A(), this._volume = 1, this._muted = !1, this._isPlaying = !1, g(this), this.muted = this.channel.muted;
|
|
@@ -2834,7 +2840,7 @@ var en = class extends M {
|
|
|
2834
2840
|
destroy() {
|
|
2835
2841
|
this._channels.forEach((e) => {
|
|
2836
2842
|
e.destroy();
|
|
2837
|
-
}), this._channels.clear(), this.onSoundStarted.disconnectAll(), this.onSoundEnded.disconnectAll(), this.onMuted.disconnectAll(), this.onMasterVolumeChanged.disconnectAll(), this.onChannelVolumeChanged.disconnectAll(), super.destroy();
|
|
2843
|
+
}), this._channels.clear(), this.onSoundStarted.disconnectAll(), this.onSoundEnded.disconnectAll(), this.onMuted.disconnectAll(), this.onMasterVolumeChanged.disconnectAll(), this.onChannelVolumeChanged.disconnectAll(), this.onChannelMuted.disconnectAll(), super.destroy();
|
|
2838
2844
|
}
|
|
2839
2845
|
initialize(e, t) {
|
|
2840
2846
|
return J.disableAutoPause = !0, typeof t?.manifest == "object" && this.addAllFromManifest(t.manifest), Promise.resolve();
|
|
@@ -2988,17 +2994,17 @@ var en = class extends M {
|
|
|
2988
2994
|
load(e, t = "sfx", n) {
|
|
2989
2995
|
Array.isArray(e) || (e = [e]);
|
|
2990
2996
|
for (let r of e) {
|
|
2991
|
-
this._idMap.has(r) && (
|
|
2992
|
-
let
|
|
2993
|
-
if (
|
|
2997
|
+
this._idMap.has(r) && (r = this._idMap.get(r));
|
|
2998
|
+
let e = this._channels.get(t);
|
|
2999
|
+
if (e) {
|
|
2994
3000
|
r = this._verifySoundId(r);
|
|
2995
|
-
let
|
|
2996
|
-
|
|
3001
|
+
let t = J.find(r);
|
|
3002
|
+
t.options = {
|
|
2997
3003
|
...n,
|
|
2998
3004
|
autoPlay: !1
|
|
2999
3005
|
};
|
|
3000
|
-
let
|
|
3001
|
-
|
|
3006
|
+
let i = e.add(r, new z(r, e, this));
|
|
3007
|
+
i.media = t.instances[0], i.pause();
|
|
3002
3008
|
} else throw Error(`Channel ${t} does not exist.`);
|
|
3003
3009
|
}
|
|
3004
3010
|
}
|
|
@@ -3043,7 +3049,7 @@ var en = class extends M {
|
|
|
3043
3049
|
if (r ||= (e = n + ".mp3", t.get(e)), r ||= (e = n + ".ogg", t.get(e)), r ||= (e = n + ".wav", t.get(e)), r) this._findAndAddFromManifest(e, r);
|
|
3044
3050
|
else throw Error(`Sound with ID ${e} does not exist.`);
|
|
3045
3051
|
}
|
|
3046
|
-
return this._idMap.set(
|
|
3052
|
+
return this._idMap.set(n, e), e;
|
|
3047
3053
|
}
|
|
3048
3054
|
_findAndAddFromManifest(e, t) {
|
|
3049
3055
|
let n = this.app.manifest;
|
|
@@ -3391,7 +3397,7 @@ var en = class extends M {
|
|
|
3391
3397
|
globalThis.document.addEventListener("mousemove", this._handleGlobalMouseMove), globalThis.document.addEventListener("pointerdown", this._handleGlobalPointerDown);
|
|
3392
3398
|
}
|
|
3393
3399
|
_removeGlobalListeners() {
|
|
3394
|
-
globalThis.document.removeEventListener("mousemove", this._handleGlobalMouseMove), globalThis.document.removeEventListener("pointerdown", this._handleGlobalPointerDown);
|
|
3400
|
+
globalThis.document.removeEventListener("mousemove", this._handleGlobalMouseMove), globalThis.document.removeEventListener("pointerdown", this._handleGlobalPointerDown), window.removeEventListener("keydown", this._onKeyDown, !1), globalThis.removeEventListener("keydown", this._onKeyDown, !1), globalThis.removeEventListener("keyup", this._onKeyUp, !1), globalThis.document.removeEventListener("mousemove", this._onMouseMove, !0);
|
|
3395
3401
|
}
|
|
3396
3402
|
_handleGlobalMouseMove() {
|
|
3397
3403
|
this._enabled && this._active && this.deactivate();
|
|
@@ -3653,16 +3659,17 @@ var pn = class {
|
|
|
3653
3659
|
initialize(e) {
|
|
3654
3660
|
this.scheme = e;
|
|
3655
3661
|
}
|
|
3662
|
+
destroy() {}
|
|
3656
3663
|
}, mn = class extends Z(pn) {
|
|
3657
3664
|
constructor() {
|
|
3658
|
-
super(), this._keyCombinations = [], this._singleDownKeys = /* @__PURE__ */ new Set(), this._keyCombinationsMap = /* @__PURE__ */ new Map(), this._activeDownKeys = /* @__PURE__ */ new Map(), this._activeUpKeys = /* @__PURE__ */ new Map(), g(this);
|
|
3665
|
+
super(), this._keyCombinations = [], this._singleDownKeys = /* @__PURE__ */ new Set(), this._keyCombinationsMap = /* @__PURE__ */ new Map(), this._activeDownKeys = /* @__PURE__ */ new Map(), this._activeUpKeys = /* @__PURE__ */ new Map(), this._warnedMissingActions = /* @__PURE__ */ new Set(), g(this);
|
|
3659
3666
|
}
|
|
3660
3667
|
get app() {
|
|
3661
3668
|
return $.getInstance();
|
|
3662
3669
|
}
|
|
3663
3670
|
isActionActive(e) {
|
|
3664
3671
|
let t = this.scheme.down?.[e] ?? null;
|
|
3665
|
-
return t ? Array.isArray(t) ?
|
|
3672
|
+
return t ? Array.isArray(t) ? t.some((e) => this._isInputActive(e)) : this._isInputActive(t) : !1;
|
|
3666
3673
|
}
|
|
3667
3674
|
initialize(e) {
|
|
3668
3675
|
super.initialize(e), this._keyDownMap = e.down || {}, this._keyUpMap = e.up || {}, this._sortActions();
|
|
@@ -3670,12 +3677,25 @@ var pn = class {
|
|
|
3670
3677
|
connect() {
|
|
3671
3678
|
this.addSignalConnection(this.app.signal.onActionContextChanged.connect(this._handleContextChanged), this.app.keyboard.onKeyDown().connect(this._handleKeyDown), this.app.keyboard.onKeyUp().connect(this._handleKeyUp)), this._handleContextChanged(), this.app.ticker.add(this._update);
|
|
3672
3679
|
}
|
|
3680
|
+
destroy() {
|
|
3681
|
+
this.app.ticker.remove(this._update), super.destroy();
|
|
3682
|
+
}
|
|
3683
|
+
_isInputActive(e) {
|
|
3684
|
+
return e.includes("+") ? e.split("+").every((e) => this._singleDownKeys.has(e)) : this._singleDownKeys.has(e);
|
|
3685
|
+
}
|
|
3686
|
+
_warnMissingAction(e) {
|
|
3687
|
+
this._warnedMissingActions.has(e) || (this._warnedMissingActions.add(e), S.warn(`KeyboardControls: scheme references unknown action "${e}"`));
|
|
3688
|
+
}
|
|
3673
3689
|
_sortActions() {
|
|
3674
3690
|
let e = this.app.actionsPlugin.getActions();
|
|
3675
3691
|
this._keyCombinations = [], this._keyCombinationsMap.clear(), this._activeDownKeys.clear(), this._activeUpKeys.clear();
|
|
3676
3692
|
let t = Object.keys(this._keyDownMap);
|
|
3677
3693
|
t.forEach((t) => {
|
|
3678
3694
|
let n = this._keyDownMap[t], r = e[t];
|
|
3695
|
+
if (!r) {
|
|
3696
|
+
this._warnMissingAction(t);
|
|
3697
|
+
return;
|
|
3698
|
+
}
|
|
3679
3699
|
if (r.context !== "*" && r.context !== this.app.actionContext && !r.context.includes(this.app.actionContext)) return;
|
|
3680
3700
|
let i = n;
|
|
3681
3701
|
i && (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
@@ -3741,7 +3761,7 @@ var pn = class {
|
|
|
3741
3761
|
}
|
|
3742
3762
|
}, hn = class extends Z(pn) {
|
|
3743
3763
|
constructor() {
|
|
3744
|
-
super(), this._buttons = /* @__PURE__ */ new Set(), this._combinations = [], this._singleDownButtons = /* @__PURE__ */ new Set(), this._activeJoystickDirections = /* @__PURE__ */ new Map(), this._activeButtonDownIds = /* @__PURE__ */ new Map(), this._activeButtonUpIds = /* @__PURE__ */ new Map(), this._combinationsMap = /* @__PURE__ */ new Map(), g(this);
|
|
3764
|
+
super(), this._buttons = /* @__PURE__ */ new Set(), this._combinations = [], this._singleDownButtons = /* @__PURE__ */ new Set(), this._activeJoystickDirections = /* @__PURE__ */ new Map(), this._activeButtonDownIds = /* @__PURE__ */ new Map(), this._activeButtonUpIds = /* @__PURE__ */ new Map(), this._combinationsMap = /* @__PURE__ */ new Map(), this._buttonConnections = /* @__PURE__ */ new Map(), this._warnedMissingActions = /* @__PURE__ */ new Set(), g(this);
|
|
3745
3765
|
}
|
|
3746
3766
|
get joystick() {
|
|
3747
3767
|
return this._joystick;
|
|
@@ -3753,32 +3773,52 @@ var pn = class {
|
|
|
3753
3773
|
return $.getInstance();
|
|
3754
3774
|
}
|
|
3755
3775
|
addButton(e) {
|
|
3756
|
-
!e || this._buttons.has(e)
|
|
3776
|
+
if (!e || this._buttons.has(e)) return;
|
|
3777
|
+
let t = [
|
|
3778
|
+
e.onDown.connect(() => this._handleButtonDown(e)),
|
|
3779
|
+
e.onUp.connect(() => this._handleButtonUp(e)),
|
|
3780
|
+
e.onUpOutside.connect(() => this._handleButtonUp(e)),
|
|
3781
|
+
e.onDestroy.connect(() => this.removeButton(e))
|
|
3782
|
+
];
|
|
3783
|
+
this.addSignalConnection(...t), this._buttonConnections.set(e, t), this._buttons.add(e);
|
|
3757
3784
|
}
|
|
3758
3785
|
removeButton(e) {
|
|
3759
|
-
!e || !this._buttons.has(e) || (
|
|
3786
|
+
!e || !this._buttons.has(e) || (this._buttonConnections.get(e)?.forEach((e) => e.disconnect()), this._buttonConnections.delete(e), this._singleDownButtons.delete(e.id), this._buttons.delete(e));
|
|
3760
3787
|
}
|
|
3761
3788
|
initialize(e) {
|
|
3762
|
-
super.initialize(e), this._buttonDownMap = e.down || {}, this._buttonUpMap = e.up || {}, this._joystickMap = e.joystick || {}, this.app.signal.onActionContextChanged.connect(this._sortActions), this._sortActions();
|
|
3789
|
+
super.initialize(e), this._buttonDownMap = e.down || {}, this._buttonUpMap = e.up || {}, this._joystickMap = e.joystick || {}, this.addSignalConnection(this.app.signal.onActionContextChanged.connect(this._sortActions)), this._sortActions();
|
|
3763
3790
|
}
|
|
3764
3791
|
connect() {
|
|
3765
3792
|
this.app.ticker.add(this._update);
|
|
3766
3793
|
}
|
|
3794
|
+
destroy() {
|
|
3795
|
+
this.app.ticker.remove(this._update), super.destroy();
|
|
3796
|
+
}
|
|
3767
3797
|
isActionActive(e) {
|
|
3768
3798
|
let t = this.scheme.down?.[e] ?? null;
|
|
3769
|
-
if (t) return Array.isArray(t) ? this.
|
|
3799
|
+
if (t) return Array.isArray(t) ? t.some((e) => this._isInputActive(e)) : this._isInputActive(t);
|
|
3770
3800
|
{
|
|
3771
3801
|
let t = this.scheme.joystick?.[e] ?? null;
|
|
3772
3802
|
if (this._joystick && t) return Array.isArray(t) ? t.includes(this._joystick.direction) : t === this._joystick?.direction;
|
|
3773
3803
|
}
|
|
3774
3804
|
return !1;
|
|
3775
3805
|
}
|
|
3806
|
+
_isInputActive(e) {
|
|
3807
|
+
return e.includes("+") ? e.split("+").every((e) => this._singleDownButtons.has(e) || this._joystick?.direction === e) : this._singleDownButtons.has(e);
|
|
3808
|
+
}
|
|
3809
|
+
_warnMissingAction(e) {
|
|
3810
|
+
this._warnedMissingActions.has(e) || (this._warnedMissingActions.add(e), S.warn(`VirtualControls: scheme references unknown action "${e}"`));
|
|
3811
|
+
}
|
|
3776
3812
|
_sortActions() {
|
|
3777
3813
|
let e = this.app.actionsPlugin.getActions();
|
|
3778
3814
|
this._combinations = [], this._combinationsMap.clear(), this._activeJoystickDirections.clear(), this._activeButtonDownIds.clear(), this._activeButtonUpIds.clear();
|
|
3779
3815
|
let t = Object.keys(this._buttonDownMap);
|
|
3780
3816
|
t.forEach((t) => {
|
|
3781
3817
|
let n = this._buttonDownMap[t], r = e[t];
|
|
3818
|
+
if (!r) {
|
|
3819
|
+
this._warnMissingAction(t);
|
|
3820
|
+
return;
|
|
3821
|
+
}
|
|
3782
3822
|
if (r.context !== "*" && r.context !== this.app.actionContext && !r.context.includes(this.app.actionContext)) return;
|
|
3783
3823
|
let i = n;
|
|
3784
3824
|
i && (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
@@ -3789,6 +3829,10 @@ var pn = class {
|
|
|
3789
3829
|
}));
|
|
3790
3830
|
}), this._combinations.sort((e, t) => t.length - e.length), t = Object.keys(this._buttonUpMap), t.forEach((t) => {
|
|
3791
3831
|
let n = this._buttonUpMap[t], r = e[t];
|
|
3832
|
+
if (!r) {
|
|
3833
|
+
this._warnMissingAction(t);
|
|
3834
|
+
return;
|
|
3835
|
+
}
|
|
3792
3836
|
r.context !== "*" && r.context !== this.app.actionContext && !r.context.includes(this.app.actionContext) || this._activeButtonUpIds.set(n, t);
|
|
3793
3837
|
}), Object.keys(this._joystickMap).forEach((e) => {
|
|
3794
3838
|
let t = this._joystickMap[e];
|
|
@@ -4211,9 +4255,8 @@ var Sn = [
|
|
|
4211
4255
|
});
|
|
4212
4256
|
}
|
|
4213
4257
|
removeAllPopups(e = !1) {
|
|
4214
|
-
e
|
|
4215
|
-
|
|
4216
|
-
}) : (this._activePopups.clear(), this.view.removeChildren());
|
|
4258
|
+
if (e) for (let e of [...this._activePopups.keys()]) this.hidePopup(e);
|
|
4259
|
+
else this._activePopups.clear(), this.view.removeChildren();
|
|
4217
4260
|
}
|
|
4218
4261
|
getCoreFunctions() {
|
|
4219
4262
|
return [
|
|
@@ -4380,7 +4423,9 @@ var Sn = [
|
|
|
4380
4423
|
setDefaultLoadMethod(e) {
|
|
4381
4424
|
this._defaultLoadMethod = e;
|
|
4382
4425
|
}
|
|
4383
|
-
destroy() {
|
|
4426
|
+
destroy() {
|
|
4427
|
+
window.removeEventListener("hashchange", this._onHashChange), this._debugMenu?.parentElement?.removeChild(this._debugMenu), super.destroy();
|
|
4428
|
+
}
|
|
4384
4429
|
async initialize(e, t) {
|
|
4385
4430
|
if (this._debugVisible = this.app.config?.showSceneDebugMenu === !0 || v && this.app.config?.showSceneDebugMenu !== !1, this._useHash = t.config?.useHash === !0 || this._debugVisible, this.view.sortableChildren = !0, this.list = (Caper.get("sceneList") || []).filter((e) => e.active !== !1), this.groupOrder = t.config?.sceneGroupOrder || [], (this._debugVisible || this._useHash) && (this.defaultScene = this.getSceneFromHash() || ""), !this.splash) {
|
|
4386
4431
|
this.splash = {
|
|
@@ -4394,7 +4439,7 @@ var Sn = [
|
|
|
4394
4439
|
};
|
|
4395
4440
|
e.view && (this.splash.view = typeof e.view == "function" ? new e.view() : e.view), this.splash.preload = e.preload;
|
|
4396
4441
|
}
|
|
4397
|
-
return this.defaultScene = this.defaultScene || t.config?.defaultScene || this.list?.[0]?.id, !this.transition && t.config?.sceneTransition && (this.transition = typeof t.config.sceneTransition == "function" ? new t.config.sceneTransition() : t.config.sceneTransition), this._defaultLoadMethod = t.config.defaultSceneLoadMethod || "immediate", this._debugVisible && this._createDebugMenu(), this._useHash && this._listenForHashChange(), this.app.onPause.connect(this._onPause, "highest"), this.app.onResume.connect(this._onResume, "highest"), Promise.resolve(void 0);
|
|
4442
|
+
return this.defaultScene = this.defaultScene || t.config?.defaultScene || this.list?.[0]?.id, !this.transition && t.config?.sceneTransition && (this.transition = typeof t.config.sceneTransition == "function" ? new t.config.sceneTransition() : t.config.sceneTransition), this._defaultLoadMethod = t.config.defaultSceneLoadMethod || "immediate", this._debugVisible && this._createDebugMenu(), this._useHash && this._listenForHashChange(), this.addSignalConnection(this.app.onPause.connect(this._onPause, "highest"), this.app.onResume.connect(this._onResume, "highest")), Promise.resolve(void 0);
|
|
4398
4443
|
}
|
|
4399
4444
|
_onPause(e) {
|
|
4400
4445
|
this.currentScene.onPause(e);
|
|
@@ -4451,10 +4496,11 @@ var Sn = [
|
|
|
4451
4496
|
return ["loadScene"];
|
|
4452
4497
|
}
|
|
4453
4498
|
_listenForHashChange() {
|
|
4454
|
-
window.addEventListener("hashchange",
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4499
|
+
window.addEventListener("hashchange", this._onHashChange);
|
|
4500
|
+
}
|
|
4501
|
+
_onHashChange() {
|
|
4502
|
+
let e = this.getSceneFromHash();
|
|
4503
|
+
e && this.loadScene(e);
|
|
4458
4504
|
}
|
|
4459
4505
|
async _createCurrentScene() {
|
|
4460
4506
|
let e = this.list.find((e) => e.id === this._currentSceneId), t;
|
|
@@ -4549,7 +4595,7 @@ var Sn = [
|
|
|
4549
4595
|
}
|
|
4550
4596
|
let t = e.target.value;
|
|
4551
4597
|
t && (window.location.hash = t.toLowerCase());
|
|
4552
|
-
}), this.onSceneChangeStart.connect(this._disableDebugMenu), this.onSceneChangeComplete.connect(this._enableDebugMenu);
|
|
4598
|
+
}), this.addSignalConnection(this.onSceneChangeStart.connect(this._disableDebugMenu), this.onSceneChangeComplete.connect(this._enableDebugMenu));
|
|
4553
4599
|
}
|
|
4554
4600
|
_enableDebugMenu() {
|
|
4555
4601
|
this._debugMenu?.querySelector("select")?.removeAttribute("disabled");
|
|
@@ -4743,7 +4789,7 @@ var jn = class {
|
|
|
4743
4789
|
document.addEventListener("visibilitychange", this._onVisibilityChanged, !1), window.addEventListener("pagehide", this._onPageHide, !1), window.addEventListener("pageshow", this._onPageShow, !1), window.addEventListener("resize", this._onResize), document.addEventListener("fullscreenchange", this._onResize), window.addEventListener("orientationchange", this._onOrientationChanged), window.visualViewport?.addEventListener("resize", this._onVisualViewportResize);
|
|
4744
4790
|
}
|
|
4745
4791
|
destroy() {
|
|
4746
|
-
document.removeEventListener("visibilitychange", this._onVisibilityChanged, !1), window.removeEventListener("resize", this._onResize), document.removeEventListener("fullscreenchange", this._onResize), window.removeEventListener("pagehide", this._onPageHide, !1), window.removeEventListener("pageshow", this._onPageShow, !1), window.visualViewport?.removeEventListener("resize", this._onVisualViewportResize);
|
|
4792
|
+
document.removeEventListener("visibilitychange", this._onVisibilityChanged, !1), window.removeEventListener("resize", this._onResize), document.removeEventListener("fullscreenchange", this._onResize), window.removeEventListener("pagehide", this._onPageHide, !1), window.removeEventListener("pageshow", this._onPageShow, !1), window.removeEventListener("orientationchange", this._onOrientationChanged), window.visualViewport?.removeEventListener("resize", this._onVisualViewportResize), super.destroy();
|
|
4747
4793
|
}
|
|
4748
4794
|
getCoreSignals() {
|
|
4749
4795
|
return ["onVisibilityChanged", "onOrientationChanged"];
|
|
@@ -4790,7 +4836,7 @@ var jn = class {
|
|
|
4790
4836
|
constructor(...e) {
|
|
4791
4837
|
super(...e), this.name = "lookup", this.pathToContainer = /* @__PURE__ */ new Map(), this.containerToPath = /* @__PURE__ */ new Map();
|
|
4792
4838
|
}
|
|
4793
|
-
|
|
4839
|
+
getCoreFunctions() {
|
|
4794
4840
|
return [
|
|
4795
4841
|
"getChildAtPath",
|
|
4796
4842
|
"getPathForChild",
|
|
@@ -4800,7 +4846,10 @@ var jn = class {
|
|
|
4800
4846
|
];
|
|
4801
4847
|
}
|
|
4802
4848
|
async initialize() {
|
|
4803
|
-
Q.onGlobalChildAdded.connect(this.onChildAdded), Q.onGlobalChildRemoved.connect(this.onChildRemoved);
|
|
4849
|
+
this.addSignalConnection(Q.onGlobalChildAdded.connect(this.onChildAdded), Q.onGlobalChildRemoved.connect(this.onChildRemoved));
|
|
4850
|
+
}
|
|
4851
|
+
destroy() {
|
|
4852
|
+
this.pathToContainer.clear(), this.containerToPath.clear(), super.destroy();
|
|
4804
4853
|
}
|
|
4805
4854
|
getChildAtPath(e) {
|
|
4806
4855
|
return this.pathToContainer.get(e);
|
|
@@ -4978,6 +5027,11 @@ var Ln = {
|
|
|
4978
5027
|
defaultSceneLoadMethod: "immediate",
|
|
4979
5028
|
assets: { manifest: "./assets.json" }
|
|
4980
5029
|
}, Rn = {
|
|
5030
|
+
pauseAudio: !0,
|
|
5031
|
+
pauseAnimations: !0,
|
|
5032
|
+
pauseTicker: !0,
|
|
5033
|
+
pauseTimers: !0
|
|
5034
|
+
}, zn = {
|
|
4981
5035
|
pauseAudio: !1,
|
|
4982
5036
|
pauseAnimations: !1,
|
|
4983
5037
|
pauseTicker: !1,
|
|
@@ -5003,9 +5057,9 @@ var Ln = {
|
|
|
5003
5057
|
}
|
|
5004
5058
|
pause(e) {
|
|
5005
5059
|
this._paused = !0, this._pauseConfig = {
|
|
5006
|
-
...Rn,
|
|
5060
|
+
...e ? zn : Rn,
|
|
5007
5061
|
...e
|
|
5008
|
-
},
|
|
5062
|
+
}, this._pauseConfig.pauseAudio && this.audio.pause(), this._pauseConfig.pauseAnimations && p?.globalTimeline?.pause(), this._pauseConfig.pauseTicker && this.ticker.stop(), this._pauseConfig.pauseTimers && this.timers.pauseAllTimers(), this._pauseConfig.pauseOther && this._pauseConfig.pauseOther.forEach((e) => {
|
|
5009
5063
|
typeof e?.pause == "function" && e.pause();
|
|
5010
5064
|
}), this.onPause.emit(this._pauseConfig);
|
|
5011
5065
|
}
|
|
@@ -5018,7 +5072,7 @@ var Ln = {
|
|
|
5018
5072
|
this._paused = !this._paused, this._paused ? this.pause(e) : this.resume();
|
|
5019
5073
|
}
|
|
5020
5074
|
constructor() {
|
|
5021
|
-
super(), this.onPause = new A(), this.onResume = new A(), this.onResize = new A(), this.onPluginError = new A(), this.onPwaInstallAvailable = new A(), this.onPwaUpdateAvailable = new A(), this._plugins = /* @__PURE__ */ new Map(), this.
|
|
5075
|
+
super(), this.onPause = new A(), this.onResume = new A(), this.onResize = new A(), this.onPluginError = new A(), this.onPwaInstallAvailable = new A(), this.onPwaUpdateAvailable = new A(), this._plugins = /* @__PURE__ */ new Map(), this._env = {
|
|
5022
5076
|
BASE_URL: "/",
|
|
5023
5077
|
DEV: !1,
|
|
5024
5078
|
MODE: "production",
|
|
@@ -5170,19 +5224,20 @@ var Ln = {
|
|
|
5170
5224
|
return "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
5171
5225
|
}
|
|
5172
5226
|
get signal() {
|
|
5173
|
-
return
|
|
5227
|
+
return Bn;
|
|
5174
5228
|
}
|
|
5175
5229
|
get signals() {
|
|
5176
5230
|
return this.signal;
|
|
5177
5231
|
}
|
|
5178
5232
|
get func() {
|
|
5179
|
-
return
|
|
5233
|
+
return Vn;
|
|
5180
5234
|
}
|
|
5181
5235
|
get exec() {
|
|
5182
5236
|
return this.func;
|
|
5183
5237
|
}
|
|
5184
5238
|
get views() {
|
|
5185
|
-
|
|
5239
|
+
let e = [this.scenes.view, this.popups.view];
|
|
5240
|
+
return this.scenes.splash.view && e.push(this.scenes.splash.view), this.scenes.transition && e.push(this.scenes.transition), this.captions?.view && e.push(this.captions.view), e;
|
|
5186
5241
|
}
|
|
5187
5242
|
static getInstance() {
|
|
5188
5243
|
return r.instance || S.warn("Application not created yet"), r.instance;
|
|
@@ -5190,7 +5245,7 @@ var Ln = {
|
|
|
5190
5245
|
destroy(e, t) {
|
|
5191
5246
|
this._plugins.forEach((e) => {
|
|
5192
5247
|
e.destroy();
|
|
5193
|
-
}), this.store
|
|
5248
|
+
}), this.store?.destroy(), super.destroy(e, t);
|
|
5194
5249
|
}
|
|
5195
5250
|
setContainer(e) {
|
|
5196
5251
|
r.containerElement = e;
|
|
@@ -5206,7 +5261,7 @@ var Ln = {
|
|
|
5206
5261
|
...this.config.defaultTextStyle
|
|
5207
5262
|
}), this.config.defaultDropShadow && (l.defaultDropShadow = this.config.defaultDropShadow), t) t.appendChild(this.canvas), this.setContainer(t);
|
|
5208
5263
|
else throw Error("No element found to append the view to.");
|
|
5209
|
-
return await this.registerDefaultPlugins(), v && this.getPlugin("DevToolsPlugin").initializeDevTools(this), this.signals.onLoadRequiredComplete.connectOnce(this.requiredAssetsLoaded), await this._setup(), this.plugins = await Je(this.config.plugins || []), await this.registerPlugins(), await this.setup(), await this.loadDefaultScene(), this.renderer.canvas.focus(), this.config.container && this.config.container.classList.add("loaded"),
|
|
5264
|
+
return await this.registerDefaultPlugins(), v && this.getPlugin("DevToolsPlugin").initializeDevTools(this), this.signals.onLoadRequiredComplete.connectOnce(this.requiredAssetsLoaded), await this._setup(), this.plugins = await Je(this.config.plugins || []), await this.registerPlugins(), await this.setup(), await this.loadDefaultScene(), this.renderer.canvas.focus(), this.config.container && this.config.container.classList.add("loaded"), r.instance;
|
|
5210
5265
|
}
|
|
5211
5266
|
getPlugin(e, t = !1) {
|
|
5212
5267
|
let n = this._plugins.get(e);
|
|
@@ -5262,7 +5317,7 @@ var Ln = {
|
|
|
5262
5317
|
this.sendAction(e, t);
|
|
5263
5318
|
}
|
|
5264
5319
|
isActionActive(e) {
|
|
5265
|
-
return this.
|
|
5320
|
+
return this.input.isActionActive(e);
|
|
5266
5321
|
}
|
|
5267
5322
|
get data() {
|
|
5268
5323
|
return this.getPlugin("data");
|
|
@@ -5277,23 +5332,23 @@ var Ln = {
|
|
|
5277
5332
|
let { id: t } = e;
|
|
5278
5333
|
this._appName = t, v && await this.loadPlugin({
|
|
5279
5334
|
id: "DevToolsPlugin",
|
|
5280
|
-
module: () => import("./DevToolsPlugin-
|
|
5335
|
+
module: () => import("./DevToolsPlugin-Vrk6aOtS.js"),
|
|
5281
5336
|
namedExport: "DevToolsPlugin"
|
|
5282
5337
|
}), e.useLayout && await this.loadPlugin({
|
|
5283
5338
|
id: "LayoutPlugin",
|
|
5284
|
-
module: () => import("./LayoutPlugin-
|
|
5339
|
+
module: () => import("./LayoutPlugin-Dpgeawfw.js"),
|
|
5285
5340
|
namedExport: "LayoutPlugin"
|
|
5286
5341
|
}), await this.loadPlugin({
|
|
5287
5342
|
id: "GSAPPlugin",
|
|
5288
|
-
module: () => import("./GSAPPlugin-
|
|
5343
|
+
module: () => import("./GSAPPlugin-Hm3F4zdg.js"),
|
|
5289
5344
|
namedExport: "GSAPPlugin"
|
|
5290
5345
|
}), e.useSpine && await this.loadPlugin({
|
|
5291
5346
|
id: "SpinePlugin",
|
|
5292
|
-
module: () => import("./SpinePlugin-
|
|
5347
|
+
module: () => import("./SpinePlugin-B08yAw1S.js"),
|
|
5293
5348
|
namedExport: "SpinePlugin"
|
|
5294
5349
|
}), this.config.useStore && (this._store = new st(), this._store.initialize(this), await this.loadPlugin({
|
|
5295
5350
|
id: "data",
|
|
5296
|
-
module: () => import("./DataAdapter-
|
|
5351
|
+
module: () => import("./DataAdapter-aHSNM_26.js").then((e) => e.n),
|
|
5297
5352
|
namedExport: "DataAdapter",
|
|
5298
5353
|
options: this.config.data
|
|
5299
5354
|
}));
|
|
@@ -5322,23 +5377,23 @@ var Ln = {
|
|
|
5322
5377
|
}
|
|
5323
5378
|
(this.config.showStats === !0 || v && this.config.showStats !== !1) && await this.loadPlugin({
|
|
5324
5379
|
id: "stats",
|
|
5325
|
-
module: () => import("./StatsPlugin-
|
|
5380
|
+
module: () => import("./StatsPlugin-D2Xa5j97.js"),
|
|
5326
5381
|
namedExport: "StatsPlugin"
|
|
5327
5382
|
}), this.config.useVoiceover && (await this.loadPlugin({
|
|
5328
5383
|
id: "voiceover",
|
|
5329
|
-
module: () => import("./VoiceOverPlugin-
|
|
5384
|
+
module: () => import("./VoiceOverPlugin-qtFlqpRn.js"),
|
|
5330
5385
|
namedExport: "VoiceOverPlugin",
|
|
5331
5386
|
options: this.config.voiceover || void 0
|
|
5332
5387
|
}), await this.loadPlugin({
|
|
5333
5388
|
id: "captions",
|
|
5334
|
-
module: () => import("./CaptionsPlugin-
|
|
5389
|
+
module: () => import("./CaptionsPlugin-BLbLl3WB.js"),
|
|
5335
5390
|
namedExport: "CaptionsPlugin",
|
|
5336
5391
|
options: this.config.captions || void 0
|
|
5337
5392
|
}));
|
|
5338
5393
|
}
|
|
5339
5394
|
async registerPlugins() {
|
|
5340
5395
|
if (!this.plugins?.length) return;
|
|
5341
|
-
let e = Xe(this.plugins);
|
|
5396
|
+
let e = Xe(this.plugins, new Set(this._plugins.keys()));
|
|
5342
5397
|
for (let t of e) t.autoLoad && await this.loadPlugin(t);
|
|
5343
5398
|
}
|
|
5344
5399
|
async requiredAssetsLoaded() {}
|
|
@@ -5367,8 +5422,8 @@ var Ln = {
|
|
|
5367
5422
|
_addSplash() {
|
|
5368
5423
|
this.scenes.splash.view && (this.scenes.splash.view.label = "Splash", this.stage.addChild(this.scenes.splash.view));
|
|
5369
5424
|
}
|
|
5370
|
-
},
|
|
5425
|
+
}, Bn = {}, Vn = {};
|
|
5371
5426
|
//#endregion
|
|
5372
|
-
export { Le as $, jt as A, _ as At, mt as B, me as Bt, ln as C, xe as Ct, en as D, S as Dt, tn as E, C as Et, xt as F, ve as Ft, st as G, M as H, h as Ht, bt as I, he as It, D as J, A as K, gt as L, de as Lt, _t as M, ye as Mt, vt as N, g as Nt, z as O, y as Ot, yt as P, ge as Pt, qe as Q, ht as R, fe as Rt, fn as S, Ce as St, rn as T, Se as Tt, j as U, se as Ut, pt as V, ue as Vt, lt as W, le as Wt, Je as X, Ye as Y, Xe as Z, gn as _, Oe as _t, Nn as a, Ve as at, Z as b, E as bt, An as c, Be as ct, wn as d, Pe as dt, Re as et, Q as f, Ne as ft, vn as g, ke as gt, bn as h, je as ht, Pn as i, Ge as it, L as j, v as jt, Mt as k, be as kt, On as l, Ie as lt, xn as m, Ae as mt,
|
|
5427
|
+
export { Le as $, jt as A, _ as At, mt as B, me as Bt, ln as C, xe as Ct, en as D, S as Dt, tn as E, C as Et, xt as F, ve as Ft, st as G, M as H, h as Ht, bt as I, he as It, D as J, A as K, gt as L, de as Lt, _t as M, ye as Mt, vt as N, g as Nt, z as O, y as Ot, yt as P, ge as Pt, qe as Q, ht as R, fe as Rt, fn as S, Ce as St, rn as T, Se as Tt, j as U, se as Ut, pt as V, ue as Vt, lt as W, le as Wt, Je as X, Ye as Y, Xe as Z, gn as _, Oe as _t, Nn as a, Ve as at, Z as b, E as bt, An as c, Be as ct, wn as d, Pe as dt, Re as et, Q as f, Ne as ft, vn as g, ke as gt, bn as h, je as ht, Pn as i, Ge as it, L as j, v as jt, Mt as k, be as kt, On as l, Ie as lt, xn as m, Ae as mt, Bn as n, We as nt, jn as o, Ke as ot, Sn as p, Me as pt, k as q, $ as r, He as rt, Mn as s, ze as st, Vn as t, Ue as tt, En as u, Fe as ut, hn as v, De as vt, sn as w, w as wt, X as x, we as xt, mn as y, Ee as yt, P as z, pe as zt };
|
|
5373
5428
|
|
|
5374
|
-
//# sourceMappingURL=registries-
|
|
5429
|
+
//# sourceMappingURL=registries-m2vKTIih.js.map
|