@caperjs/core 0.7.1 → 0.7.3
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/assetpack.mjs +35 -3
- package/build/defaults.mjs +39 -1
- package/build/index.mjs +13 -2
- package/build/internal/outputMarker.mjs +52 -0
- package/cli/doctor.mjs +205 -2
- package/cli/doctor.test.mjs +522 -1
- package/cli/native.mjs +825 -0
- package/cli/native.test.mjs +1071 -0
- package/cli.mjs +4 -0
- package/extras/css/fullscreen.css +8 -0
- package/extras/llms.txt +27 -0
- package/extras/skills/caper/SKILL.md +1 -0
- package/lib/{CaptionsPlugin-BoMkCsJO.js → CaptionsPlugin-COrofpHN.js} +2 -2
- package/lib/{CaptionsPlugin-BoMkCsJO.js.map → CaptionsPlugin-COrofpHN.js.map} +1 -1
- package/lib/{DataAdapter-DHWHuN-y.js → DataAdapter-T-22-_D1.js} +2 -2
- package/lib/{DataAdapter-DHWHuN-y.js.map → DataAdapter-T-22-_D1.js.map} +1 -1
- package/lib/{DebugRenderer-9a3mO9kX.js → DebugRenderer-ZN692Pbg.js} +4 -4
- package/lib/{DebugRenderer-9a3mO9kX.js.map → DebugRenderer-ZN692Pbg.js.map} +1 -1
- package/lib/{DevToolsPlugin-TkcBq1js.js → DevToolsPlugin-CQXFoj1T.js} +3 -3
- package/lib/{DevToolsPlugin-TkcBq1js.js.map → DevToolsPlugin-CQXFoj1T.js.map} +1 -1
- package/lib/{GSAPPlugin-DLOiVK_m.js → GSAPPlugin-CNkncyXS.js} +2 -2
- package/lib/{GSAPPlugin-DLOiVK_m.js.map → GSAPPlugin-CNkncyXS.js.map} +1 -1
- package/lib/{LayoutPlugin-CEPcr4GU.js → LayoutPlugin-BuJgr9bd.js} +26 -26
- package/lib/{LayoutPlugin-CEPcr4GU.js.map → LayoutPlugin-BuJgr9bd.js.map} +1 -1
- package/lib/{ScreenDebugPlugin-CiT0viiF.js → ScreenDebugPlugin-kz9Mr6j1.js} +2 -2
- package/lib/{ScreenDebugPlugin-CiT0viiF.js.map → ScreenDebugPlugin-kz9Mr6j1.js.map} +1 -1
- package/lib/{SpinePlugin-kyeWILtF.js → SpinePlugin-DDzD-Qxd.js} +1099 -877
- package/lib/SpinePlugin-DDzD-Qxd.js.map +1 -0
- package/lib/{StatsPlugin-5So44eOq.js → StatsPlugin-tyFGzVjy.js} +2 -2
- package/lib/{StatsPlugin-5So44eOq.js.map → StatsPlugin-tyFGzVjy.js.map} +1 -1
- package/lib/{VoiceOverPlugin--QoLj6pc.js → VoiceOverPlugin-rTNz_9eb.js} +2 -2
- package/lib/{VoiceOverPlugin--QoLj6pc.js.map → VoiceOverPlugin-rTNz_9eb.js.map} +1 -1
- package/lib/caper.mjs +109 -109
- package/lib/caper.mjs.map +1 -1
- package/lib/{const-GLIgV4ZV.js → const-BClauBNo.js} +107 -97
- package/lib/const-BClauBNo.js.map +1 -0
- package/lib/plugins/FullScreenPlugin.d.ts +65 -0
- package/lib/plugins/FullScreenPlugin.d.ts.map +1 -1
- package/lib/plugins/spine/SpinePlugin.d.ts.map +1 -1
- package/lib/plugins/spine/SpinePlugin.test.d.ts +2 -0
- package/lib/plugins/spine/SpinePlugin.test.d.ts.map +1 -0
- package/lib/{registries-C5yiKJ6v.js → registries-DmNGVLAi.js} +489 -446
- package/lib/registries-DmNGVLAi.js.map +1 -0
- package/lib/ui/Button.d.ts.map +1 -1
- package/lib/ui/UICanvas.d.ts +10 -2
- package/lib/ui/UICanvas.d.ts.map +1 -1
- package/lib/utils/platform.d.ts +5 -0
- package/lib/utils/platform.d.ts.map +1 -1
- package/lib/utils/platform.test.d.ts +2 -0
- package/lib/utils/platform.test.d.ts.map +1 -0
- package/lib/utils/types.d.ts +1 -1
- package/lib/utils/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/plugins/FullScreenPlugin.test.ts +138 -0
- package/src/plugins/FullScreenPlugin.ts +132 -0
- package/src/plugins/spine/SpinePlugin.test.ts +31 -0
- package/src/plugins/spine/SpinePlugin.ts +9 -2
- package/src/ui/Button.test.ts +22 -0
- package/src/ui/Button.ts +7 -0
- package/src/ui/UICanvas.test.ts +23 -1
- package/src/ui/UICanvas.ts +22 -3
- package/src/utils/platform.test.ts +20 -0
- package/src/utils/platform.ts +6 -0
- package/src/utils/types.ts +5 -1
- package/src/version.ts +2 -2
- package/lib/SpinePlugin-kyeWILtF.js.map +0 -1
- package/lib/const-GLIgV4ZV.js.map +0 -1
- package/lib/registries-C5yiKJ6v.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ft as e, Gt as t, S as n, X as r, bt as i, ct as a, ft as o, g as s, h as c, ht as l, kt as u, m as d, p as f, pt as p, q as m, r as h, vt as ee, xt as te, yt as ne } from "./registries-
|
|
1
|
+
import { Ft as e, Gt as t, S as n, X as r, bt as i, ct as a, ft as o, g as s, h as c, ht as l, kt as u, m as d, p as f, pt as p, q as m, r as h, vt as ee, xt as te, yt as ne } from "./registries-DmNGVLAi.js";
|
|
2
2
|
import { t as g } from "./padding-1kHDpGlQ.js";
|
|
3
|
-
import { AnimatedSprite as re, Assets as _, BitmapText as v, Graphics as y, HTMLText as ie, ParticleContainer as
|
|
3
|
+
import { AnimatedSprite as re, Assets as _, BitmapText as v, Graphics as y, HTMLText as ie, ParticleContainer as ae, Sprite as b, Text as x, Texture as oe, TilingSprite as se } from "pixi.js";
|
|
4
4
|
import { gsap as S } from "gsap";
|
|
5
5
|
//#region src/utils/debug.ts
|
|
6
6
|
var C = {
|
|
@@ -50,24 +50,24 @@ function ce() {
|
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/utils/number.ts
|
|
53
|
-
function
|
|
53
|
+
function A(e, t = 0) {
|
|
54
54
|
return e.toString().padStart(t, "0");
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/display/ParticleContainer.ts
|
|
58
|
-
var
|
|
58
|
+
var j = [
|
|
59
59
|
"autoResize",
|
|
60
60
|
"autoUpdate",
|
|
61
61
|
"priority"
|
|
62
|
-
],
|
|
62
|
+
], le = {
|
|
63
63
|
autoResize: !0,
|
|
64
64
|
autoUpdate: !0,
|
|
65
65
|
priority: 0
|
|
66
|
-
},
|
|
66
|
+
}, ue = class extends c(n(ae)) {
|
|
67
67
|
constructor(t = {}) {
|
|
68
68
|
super(t);
|
|
69
69
|
let { autoResize: n, autoUpdate: r, priority: i } = {
|
|
70
|
-
...
|
|
70
|
+
...le,
|
|
71
71
|
...t
|
|
72
72
|
};
|
|
73
73
|
e(this), this._initLifecycle({
|
|
@@ -78,24 +78,24 @@ var A = [
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
update(e) {
|
|
81
|
-
|
|
81
|
+
ae.prototype.update.call(this);
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, de = class extends y {
|
|
84
84
|
constructor(e) {
|
|
85
85
|
super(typeof e == "string" ? _.get(e) : e);
|
|
86
86
|
let t = this.getLocalBounds();
|
|
87
87
|
this.pivot.set((t.x + t.width) / 2, (t.y + t.height) / 2);
|
|
88
88
|
}
|
|
89
|
-
},
|
|
90
|
-
function
|
|
89
|
+
}, M;
|
|
90
|
+
function N(e, t) {
|
|
91
91
|
for (let n in e) try {
|
|
92
92
|
t[n] = e[n];
|
|
93
93
|
} catch (e) {
|
|
94
94
|
u.warn(`Error setting property ${n}`, e);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (!
|
|
97
|
+
function P() {
|
|
98
|
+
if (!M) {
|
|
99
99
|
let e = new y();
|
|
100
100
|
e.rect(0, 0, 100, 100), e.fill({ color: 16711680 }), e.stroke({
|
|
101
101
|
color: 16777215,
|
|
@@ -105,14 +105,14 @@ function N() {
|
|
|
105
105
|
color: 16777215,
|
|
106
106
|
width: 2,
|
|
107
107
|
alignment: .5
|
|
108
|
-
}),
|
|
108
|
+
}), M = h.getInstance().renderer.generateTexture(e), e.destroy();
|
|
109
109
|
}
|
|
110
|
-
return
|
|
110
|
+
return M;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function F(e) {
|
|
113
113
|
let t, n = e?.asset, r = n, i = e?.sheet;
|
|
114
114
|
if (n instanceof oe) t = n;
|
|
115
|
-
else if (!i || i?.length === 0) _.cache.has(r) ? t = _.get(r) : _.get(r) ? t = _.get(r).texture : (u.error("Asset \"" + n + "\" not loaded into Pixi cache"), t =
|
|
115
|
+
else if (!i || i?.length === 0) _.cache.has(r) ? t = _.get(r) : _.get(r) ? t = _.get(r).texture : (u.error("Asset \"" + n + "\" not loaded into Pixi cache"), t = P());
|
|
116
116
|
else if (_.get(i)) {
|
|
117
117
|
let e = _.get(i), a = e.textures;
|
|
118
118
|
if (a !== void 0) if (a.hasOwnProperty(r)) t = a[r];
|
|
@@ -121,17 +121,17 @@ function P(e) {
|
|
|
121
121
|
t = n.textures[r];
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
|
-
t === void 0 && (u.error("Asset \"" + n + "\" not found inside spritesheet \"" + n + "' or any of its linked sheets"), t =
|
|
125
|
-
} else u.error("Asset \"" + n + "\" not found inside spritesheet \"" + i + "'"), t =
|
|
126
|
-
else u.error("Spritesheet \"" + i + "\" loaded but textures arent?!"), t =
|
|
127
|
-
} else return u.error("Spritesheet \"" + i + "\" not loaded into Pixi cache"),
|
|
128
|
-
return t || new
|
|
124
|
+
t === void 0 && (u.error("Asset \"" + n + "\" not found inside spritesheet \"" + n + "' or any of its linked sheets"), t = P());
|
|
125
|
+
} else u.error("Asset \"" + n + "\" not found inside spritesheet \"" + i + "'"), t = P();
|
|
126
|
+
else u.error("Spritesheet \"" + i + "\" loaded but textures arent?!"), t = P();
|
|
127
|
+
} else return u.error("Spritesheet \"" + i + "\" not loaded into Pixi cache"), P();
|
|
128
|
+
return t || new b().texture;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function I(e, t) {
|
|
131
131
|
let n = a(e.position, !1, e.x, e.y);
|
|
132
132
|
t.x = n.x, t.y = n.y;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function L(e, t) {
|
|
135
135
|
if (!e) return;
|
|
136
136
|
if (e.scale === void 0) {
|
|
137
137
|
if (e.scaleX === void 0 && e.scaleY === void 0) return;
|
|
@@ -140,13 +140,13 @@ function I(e, t) {
|
|
|
140
140
|
let n = a(e.scale, !1, e.scaleX, e.scaleY);
|
|
141
141
|
t.scale.set(n.x, n.y);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function R(e, t) {
|
|
144
144
|
if (e !== void 0) {
|
|
145
145
|
let n = a(e);
|
|
146
146
|
t.anchor.set(n.x, n.y);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function z(e, t) {
|
|
150
150
|
if (e !== void 0) {
|
|
151
151
|
let n = a(e);
|
|
152
152
|
t.pivot.set(n.x, n.y);
|
|
@@ -154,7 +154,7 @@ function R(e, t) {
|
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
156
|
//#region src/display/AnimatedSprite.ts
|
|
157
|
-
var
|
|
157
|
+
var B = class t extends re {
|
|
158
158
|
constructor(n) {
|
|
159
159
|
let r = n?.animations ?? {}, i = n?.animation ?? Object.keys(r)[0], a = r[i], o = n?.sheet, s = n?.texturePrefix || "", c = n?.zeroPad, l = n?.startIndex ?? 0;
|
|
160
160
|
super(t.generateTexturesFromProps(i, a, s, o, c, l), n?.autoUpdate !== !1), this.config = n, this.onAnimationChange = new m(), this.onAnimationStart = new m(), this.onAnimationStop = new m(), this.onAnimationLoop = new m(), this.onAnimationComplete = new m(), this.onAnimationFrameChange = new m(), this.defaultTexturePrefix = "", this._paused = !1, this._isReversed = !1, e(this), this.defaultSheet = o, this.defaultTexturePrefix = s, this.defaultZeroPad = c, this._generateAnimations(), this.currentAnimation = this.defaultAnimation = i, this.autoPlay = n?.autoPlay ?? !0, this.loop = n?.loop ?? !0, this.updateAnchor = n?.updateAnchor ?? !1, this.animationSpeed = this.defaultAnimationSpeed = n?.animationSpeed ?? 1, this.on("added", this._added);
|
|
@@ -178,11 +178,11 @@ var z = class t extends re {
|
|
|
178
178
|
let o = [], s = "", c = t?.sheet ?? r;
|
|
179
179
|
if (t?.numFrames > 1) {
|
|
180
180
|
let r = t?.startIndex ?? a ?? 0;
|
|
181
|
-
for (let a = r; a < r + t?.numFrames; a++) s = `${n}${t?.texturePrefix ?? e}${
|
|
181
|
+
for (let a = r; a < r + t?.numFrames; a++) s = `${n}${t?.texturePrefix ?? e}${A(a, t?.zeroPad ?? i)}`, o.push(F({
|
|
182
182
|
asset: s,
|
|
183
183
|
sheet: c
|
|
184
184
|
}));
|
|
185
|
-
} else s = `${n}${t?.texturePrefix ?? e}`, o.push(
|
|
185
|
+
} else s = `${n}${t?.texturePrefix ?? e}`, o.push(F({
|
|
186
186
|
asset: s,
|
|
187
187
|
sheet: c
|
|
188
188
|
}));
|
|
@@ -234,7 +234,7 @@ var z = class t extends re {
|
|
|
234
234
|
this.onAnimationFrameChange.emit();
|
|
235
235
|
}, this.autoPlay && this.play();
|
|
236
236
|
}
|
|
237
|
-
},
|
|
237
|
+
}, fe = c(n(s())), V = class extends fe {
|
|
238
238
|
get animationNames() {
|
|
239
239
|
return this.spine.state.data.skeletonData.animations.map((e) => e.name);
|
|
240
240
|
}
|
|
@@ -302,7 +302,7 @@ var z = class t extends re {
|
|
|
302
302
|
};
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/mixins/focus.ts
|
|
305
|
-
function
|
|
305
|
+
function H(e) {
|
|
306
306
|
return class extends e {
|
|
307
307
|
constructor(...e) {
|
|
308
308
|
super(...e), this.isFocused = !1, this.isKeyDown = !1, this.focusEnabled = !0, this.tabIndex = 0, this.accessible = !1, this.accessibleType = "button", this.accessibleTitle = "Focusable", this.accessibleHint = "Press enter to focus", this.accessiblePointerEvents = "auto", this.accessibleChildren = !0, this.onFocus = new m(), this.onFocusIn = new m(), this.onFocusOut = new m(), this.onBlur = new m(), this._eventsDisabled = !1, this.eventMode = "static", this.on("mouseover", this._onMouseOver), this.on("mousedown", this._onMouseDown), this.on("click", this._handleClick), this.on("tap", this._handleClick);
|
|
@@ -347,10 +347,10 @@ function V(e) {
|
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
|
-
|
|
350
|
+
H.INITTED = !1;
|
|
351
351
|
//#endregion
|
|
352
352
|
//#region src/mixins/interaction.ts
|
|
353
|
-
function
|
|
353
|
+
function pe(e) {
|
|
354
354
|
return class extends e {
|
|
355
355
|
constructor(...e) {
|
|
356
356
|
super(...e), this._signals = /* @__PURE__ */ new Map(), this._emitSignal = this._emitSignal.bind(this), this.eventMode = "static";
|
|
@@ -384,7 +384,7 @@ var U = [
|
|
|
384
384
|
"enabled",
|
|
385
385
|
"layout",
|
|
386
386
|
"textLabel"
|
|
387
|
-
], me =
|
|
387
|
+
], me = H(pe(n(s()))), W = class extends me {
|
|
388
388
|
get textLabel() {
|
|
389
389
|
return this._textLabel;
|
|
390
390
|
}
|
|
@@ -495,7 +495,9 @@ var U = [
|
|
|
495
495
|
}), this.onUp.emit(), this._pointerId = void 0);
|
|
496
496
|
}
|
|
497
497
|
handleClick(e) {
|
|
498
|
-
this._enabled && (e?.pointerId !== void 0 && !this.isDown || e !== void 0 && e === this._lastClickEvent || (this._lastClickEvent = e,
|
|
498
|
+
this._enabled && (e?.pointerId !== void 0 && !this.isDown || e !== void 0 && e === this._lastClickEvent || (this._lastClickEvent = e, queueMicrotask(() => {
|
|
499
|
+
this._lastClickEvent = void 0;
|
|
500
|
+
}), this.isDown = !1, this.onClick.emit(), this.config.sounds?.click && this.app.audio.play(this.config.sounds.click, "sfx"), this.config.actions?.click && this._doAction(this.config.actions.click)));
|
|
499
501
|
}
|
|
500
502
|
handlePointerUpOutside(e) {
|
|
501
503
|
if (e.pointerId !== this._pointerId) return;
|
|
@@ -808,7 +810,7 @@ var _e = [
|
|
|
808
810
|
warning: 15844367,
|
|
809
811
|
error: 15158332
|
|
810
812
|
}
|
|
811
|
-
},
|
|
813
|
+
}, ve = class extends n(f) {
|
|
812
814
|
set toaster(e) {
|
|
813
815
|
this._toaster = e;
|
|
814
816
|
}
|
|
@@ -914,7 +916,7 @@ var _e = [
|
|
|
914
916
|
destroy() {
|
|
915
917
|
this.isHiding = !0, this.closeTimeout &&= (clearTimeout(this.closeTimeout), void 0), S.killTweensOf(this), this.timeline &&= (this.timeline.kill(), void 0), !this.destroyed && !this.isHiding && this.onToastClosed.emit(), super.destroy({ children: !0 });
|
|
916
918
|
}
|
|
917
|
-
},
|
|
919
|
+
}, ye = {
|
|
918
920
|
position: "bottom right",
|
|
919
921
|
maxToasts: 5,
|
|
920
922
|
spacing: 10,
|
|
@@ -924,7 +926,7 @@ var _e = [
|
|
|
924
926
|
},
|
|
925
927
|
stackDirection: "up",
|
|
926
928
|
animationSpeed: 1
|
|
927
|
-
},
|
|
929
|
+
}, be = class extends n(f) {
|
|
928
930
|
get size() {
|
|
929
931
|
return this.toasts.length;
|
|
930
932
|
}
|
|
@@ -951,7 +953,7 @@ var _e = [
|
|
|
951
953
|
}
|
|
952
954
|
constructor(e = {}, t = {}) {
|
|
953
955
|
super({ autoResize: !0 }), this.onToastAdded = new m(), this.onToastRemoved = new m(), this.onAllToastsRemoved = new m(), this.toasts = [], this.config = {
|
|
954
|
-
...
|
|
956
|
+
...ye,
|
|
955
957
|
...e
|
|
956
958
|
}, this.defaultToastConfig = { ...t }, this.initialize(), this.resize();
|
|
957
959
|
}
|
|
@@ -983,7 +985,7 @@ var _e = [
|
|
|
983
985
|
...e.closeButton ?? {}
|
|
984
986
|
} : K.closeButton
|
|
985
987
|
});
|
|
986
|
-
let n = new (e.class ??
|
|
988
|
+
let n = new (e.class ?? ve)(e);
|
|
987
989
|
return n.toaster = this, this.container.addChild(n), this.toasts.push(n), this.positionToast(n, this.toasts.length - 1, !1), n.onToastClosed.connectOnce(() => this.removeToast(n)), this.positionToasts(), this.onToastAdded.emit(n), n.show();
|
|
988
990
|
}
|
|
989
991
|
async hideAll() {
|
|
@@ -1051,20 +1053,20 @@ var _e = [
|
|
|
1051
1053
|
S.killTweensOf(e);
|
|
1052
1054
|
}), this.hideAll(), this.toasts = [], super.destroy({ children: !0 });
|
|
1053
1055
|
}
|
|
1054
|
-
},
|
|
1056
|
+
}, q = [
|
|
1055
1057
|
"debug",
|
|
1056
1058
|
"padding",
|
|
1057
1059
|
"size",
|
|
1058
1060
|
"useAppSize",
|
|
1059
1061
|
"useSafeArea",
|
|
1060
1062
|
"layout"
|
|
1061
|
-
],
|
|
1063
|
+
], xe = {
|
|
1062
1064
|
top: 0,
|
|
1063
1065
|
right: 0,
|
|
1064
1066
|
bottom: 0,
|
|
1065
1067
|
left: 0
|
|
1066
1068
|
};
|
|
1067
|
-
function
|
|
1069
|
+
function Se(e, t) {
|
|
1068
1070
|
return {
|
|
1069
1071
|
top: e.top + t.top,
|
|
1070
1072
|
right: e.right + t.right,
|
|
@@ -1072,11 +1074,19 @@ function xe(e, t) {
|
|
|
1072
1074
|
left: e.left + t.left
|
|
1073
1075
|
};
|
|
1074
1076
|
}
|
|
1075
|
-
|
|
1077
|
+
function Ce(e, t) {
|
|
1078
|
+
return t === !0 ? { ...e } : t === !1 ? { ...xe } : {
|
|
1079
|
+
top: t.top === !1 ? 0 : e.top,
|
|
1080
|
+
right: t.right === !1 ? 0 : e.right,
|
|
1081
|
+
bottom: t.bottom === !1 ? 0 : e.bottom,
|
|
1082
|
+
left: t.left === !1 ? 0 : e.left
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
var we = {
|
|
1076
1086
|
flexGrow: 0,
|
|
1077
1087
|
flexShrink: 0,
|
|
1078
1088
|
autoLayoutChildren: !0
|
|
1079
|
-
},
|
|
1089
|
+
}, Te = n(s()), J = class t extends Te {
|
|
1080
1090
|
constructor(t) {
|
|
1081
1091
|
if (super(), this.settingsMap = /* @__PURE__ */ new Map(), this._childMap = /* @__PURE__ */ new Map(), this._debugGraphics = null, this._debugLabel = null, this._regionLabels = [], this._disableAddChildError = !1, this._bindings = [], this._canvasChildren = [], this.removeChildren = (e, t) => super.removeChildren(e, t), this.removeChildAt = (e) => super.removeChildAt(e), this.addChildAt = (e, t) => {
|
|
1082
1092
|
throw Error("UICanvas: Do not call addChildAt() directly. Use addElement(child, { align }) instead.\nExample: uiCanvas.addElement(myChild, { align: 'top right' })");
|
|
@@ -1094,9 +1104,9 @@ var Se = {
|
|
|
1094
1104
|
useSafeArea: t.useSafeArea ?? !0,
|
|
1095
1105
|
autoLayoutChildren: t.autoLayoutChildren ?? !0
|
|
1096
1106
|
}, t.layout ? typeof t.layout == "boolean" ? this.config.layout = t.layout : this.config.layout = {
|
|
1097
|
-
...
|
|
1107
|
+
...we,
|
|
1098
1108
|
...t.layout
|
|
1099
|
-
} : this.config.layout = { ...
|
|
1109
|
+
} : this.config.layout = { ...we }, this.config.useAppSize && (this.config.size = this.app.size), this.layout = {
|
|
1100
1110
|
width: this.config.size.width,
|
|
1101
1111
|
height: this.config.size.height,
|
|
1102
1112
|
flexDirection: "column",
|
|
@@ -1227,7 +1237,7 @@ var Se = {
|
|
|
1227
1237
|
this.config.padding = g(e), this._applyPadding(), this._updateLayout();
|
|
1228
1238
|
}
|
|
1229
1239
|
_applyPadding() {
|
|
1230
|
-
let e =
|
|
1240
|
+
let e = Se(this.config.padding, Ce(this.app.safeArea, this.config.useSafeArea));
|
|
1231
1241
|
this.layout = {
|
|
1232
1242
|
paddingLeft: e.left,
|
|
1233
1243
|
paddingTop: e.top,
|
|
@@ -1408,42 +1418,42 @@ var Se = {
|
|
|
1408
1418
|
});
|
|
1409
1419
|
}
|
|
1410
1420
|
}, Y = null;
|
|
1411
|
-
function
|
|
1421
|
+
function Ee() {
|
|
1412
1422
|
if (Y) return Y;
|
|
1413
1423
|
Y = /* @__PURE__ */ new Map();
|
|
1414
1424
|
let e = globalThis.Caper?.get?.("entityList") ?? [];
|
|
1415
1425
|
for (let t of e) t.active !== !1 && typeof t.module == "function" && t.module.prototype && Y.set(t.id, t.module);
|
|
1416
1426
|
return Y;
|
|
1417
1427
|
}
|
|
1418
|
-
function
|
|
1419
|
-
return
|
|
1428
|
+
function De(e) {
|
|
1429
|
+
return Ee().get(e);
|
|
1420
1430
|
}
|
|
1421
|
-
function
|
|
1422
|
-
return [...
|
|
1431
|
+
function Oe() {
|
|
1432
|
+
return [...Ee().keys()];
|
|
1423
1433
|
}
|
|
1424
1434
|
//#endregion
|
|
1425
1435
|
//#region src/mixins/factory/ui-registry.ts
|
|
1426
1436
|
var X = null;
|
|
1427
|
-
function
|
|
1437
|
+
function ke() {
|
|
1428
1438
|
if (X) return X;
|
|
1429
1439
|
X = /* @__PURE__ */ new Map();
|
|
1430
1440
|
let e = globalThis.Caper?.get?.("uiList") ?? [];
|
|
1431
1441
|
for (let t of e) t.active !== !1 && typeof t.module == "function" && t.module.prototype && X.set(t.id, t.module);
|
|
1432
1442
|
return X;
|
|
1433
1443
|
}
|
|
1434
|
-
function
|
|
1435
|
-
return
|
|
1444
|
+
function Ae(e) {
|
|
1445
|
+
return ke().get(e);
|
|
1436
1446
|
}
|
|
1437
|
-
function
|
|
1438
|
-
return [...
|
|
1447
|
+
function je() {
|
|
1448
|
+
return [...ke().keys()];
|
|
1439
1449
|
}
|
|
1440
1450
|
//#endregion
|
|
1441
1451
|
//#region src/mixins/factory/schema.ts
|
|
1442
|
-
var
|
|
1452
|
+
var Me = [
|
|
1443
1453
|
"position",
|
|
1444
1454
|
"scale",
|
|
1445
1455
|
"pivot"
|
|
1446
|
-
],
|
|
1456
|
+
], Ne = [
|
|
1447
1457
|
"position",
|
|
1448
1458
|
"x",
|
|
1449
1459
|
"y",
|
|
@@ -1454,25 +1464,25 @@ var je = [
|
|
|
1454
1464
|
"anchor"
|
|
1455
1465
|
];
|
|
1456
1466
|
function Z(e) {
|
|
1457
|
-
let t = e.applies ??
|
|
1467
|
+
let t = e.applies ?? Me, n = t.includes("position"), r = t.includes("scale"), i = t.includes("pivot"), a = t.includes("anchor"), s = [...Ne, ...e.exclude ?? []];
|
|
1458
1468
|
return (t) => {
|
|
1459
1469
|
let c = e.build(t);
|
|
1460
1470
|
if (t == null) return c;
|
|
1461
1471
|
let l = t;
|
|
1462
|
-
return n &&
|
|
1472
|
+
return n && I({
|
|
1463
1473
|
position: l.position,
|
|
1464
1474
|
x: l.x,
|
|
1465
1475
|
y: l.y
|
|
1466
|
-
}, c), r &&
|
|
1476
|
+
}, c), r && L({
|
|
1467
1477
|
scale: l.scale,
|
|
1468
1478
|
scaleX: l.scaleX,
|
|
1469
1479
|
scaleY: l.scaleY
|
|
1470
|
-
}, c), i &&
|
|
1480
|
+
}, c), i && z(l.pivot, c), a && R(l.anchor, c), N(o(s, l), c), c;
|
|
1471
1481
|
};
|
|
1472
1482
|
}
|
|
1473
1483
|
//#endregion
|
|
1474
1484
|
//#region src/mixins/factory/const.ts
|
|
1475
|
-
var
|
|
1485
|
+
var Pe = /* @__PURE__ */ t({ defaultFactoryMethods: () => $ }), Q = [
|
|
1476
1486
|
"text",
|
|
1477
1487
|
"roundPixels",
|
|
1478
1488
|
"resolution",
|
|
@@ -1483,15 +1493,15 @@ var Ne = /* @__PURE__ */ t({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1483
1493
|
existing: (e, t) => {
|
|
1484
1494
|
if (!t) return e;
|
|
1485
1495
|
let { position: n, x: r, y: i, pivot: a, scale: o, scaleX: s, scaleY: c, ...l } = t;
|
|
1486
|
-
return
|
|
1496
|
+
return I({
|
|
1487
1497
|
position: n,
|
|
1488
1498
|
x: r,
|
|
1489
1499
|
y: i
|
|
1490
|
-
}, e),
|
|
1500
|
+
}, e), L({
|
|
1491
1501
|
scale: o,
|
|
1492
1502
|
scaleX: s,
|
|
1493
1503
|
scaleY: c
|
|
1494
|
-
}, e),
|
|
1504
|
+
}, e), z(a, e), N(l, e), e;
|
|
1495
1505
|
},
|
|
1496
1506
|
container: Z({
|
|
1497
1507
|
build: (e) => new f(e ? p(e, d) : void 0),
|
|
@@ -1503,17 +1513,17 @@ var Ne = /* @__PURE__ */ t({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1503
1513
|
exclude: d
|
|
1504
1514
|
}),
|
|
1505
1515
|
particleContainer: Z({
|
|
1506
|
-
build: (e) => new
|
|
1516
|
+
build: (e) => new ue(e ? p(e, j) : void 0),
|
|
1507
1517
|
applies: [
|
|
1508
1518
|
"position",
|
|
1509
1519
|
"scale",
|
|
1510
1520
|
"pivot"
|
|
1511
1521
|
],
|
|
1512
|
-
exclude:
|
|
1522
|
+
exclude: j
|
|
1513
1523
|
}),
|
|
1514
|
-
texture:
|
|
1524
|
+
texture: F,
|
|
1515
1525
|
sprite: Z({
|
|
1516
|
-
build: (e) => new
|
|
1526
|
+
build: (e) => new b(e ? F(e) : void 0),
|
|
1517
1527
|
applies: [
|
|
1518
1528
|
"position",
|
|
1519
1529
|
"scale",
|
|
@@ -1523,7 +1533,7 @@ var Ne = /* @__PURE__ */ t({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1523
1533
|
exclude: ["asset", "sheet"]
|
|
1524
1534
|
}),
|
|
1525
1535
|
tilingSprite: Z({
|
|
1526
|
-
build: (e) => new se(e ?
|
|
1536
|
+
build: (e) => new se(e ? F(e) : void 0),
|
|
1527
1537
|
applies: [
|
|
1528
1538
|
"position",
|
|
1529
1539
|
"scale",
|
|
@@ -1533,7 +1543,7 @@ var Ne = /* @__PURE__ */ t({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1533
1543
|
exclude: ["asset", "sheet"]
|
|
1534
1544
|
}),
|
|
1535
1545
|
animatedSprite: Z({
|
|
1536
|
-
build: (e) => new
|
|
1546
|
+
build: (e) => new B(e),
|
|
1537
1547
|
applies: [
|
|
1538
1548
|
"position",
|
|
1539
1549
|
"scale",
|
|
@@ -1562,16 +1572,16 @@ var Ne = /* @__PURE__ */ t({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1562
1572
|
]
|
|
1563
1573
|
}),
|
|
1564
1574
|
svg(e) {
|
|
1565
|
-
let t = new
|
|
1566
|
-
return delete l.ctx,
|
|
1575
|
+
let t = new de(e.ctx), { position: n, x: r, y: i, pivot: a, scale: o, scaleX: s, scaleY: c, ...l } = e;
|
|
1576
|
+
return delete l.ctx, I({
|
|
1567
1577
|
position: n,
|
|
1568
1578
|
x: r,
|
|
1569
1579
|
y: i
|
|
1570
|
-
}, t),
|
|
1580
|
+
}, t), L({
|
|
1571
1581
|
scale: o,
|
|
1572
1582
|
scaleX: s,
|
|
1573
1583
|
scaleY: c
|
|
1574
|
-
}, t),
|
|
1584
|
+
}, t), z(a, t), N(l, t), t;
|
|
1575
1585
|
},
|
|
1576
1586
|
text: Z({
|
|
1577
1587
|
build: (e) => new x(e ? {
|
|
@@ -1639,13 +1649,13 @@ var Ne = /* @__PURE__ */ t({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1639
1649
|
exclude: _e
|
|
1640
1650
|
}),
|
|
1641
1651
|
uiCanvas: Z({
|
|
1642
|
-
build: (e) => new
|
|
1652
|
+
build: (e) => new J(e ? p(e, q) : {}),
|
|
1643
1653
|
applies: [
|
|
1644
1654
|
"position",
|
|
1645
1655
|
"scale",
|
|
1646
1656
|
"pivot"
|
|
1647
1657
|
],
|
|
1648
|
-
exclude:
|
|
1658
|
+
exclude: q
|
|
1649
1659
|
}),
|
|
1650
1660
|
spine: Z({
|
|
1651
1661
|
build: (e) => {
|
|
@@ -1675,65 +1685,65 @@ var Ne = /* @__PURE__ */ t({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1675
1685
|
]
|
|
1676
1686
|
}),
|
|
1677
1687
|
spineAnimation: (e) => {
|
|
1678
|
-
let t = new
|
|
1688
|
+
let t = new V(e);
|
|
1679
1689
|
if (!e) return t;
|
|
1680
1690
|
let { position: n, x: r, y: i, anchor: a, pivot: o, scale: s, scaleX: c, scaleY: l, ...u } = e;
|
|
1681
|
-
return
|
|
1691
|
+
return I({
|
|
1682
1692
|
position: n,
|
|
1683
1693
|
x: r,
|
|
1684
1694
|
y: i
|
|
1685
|
-
}, t),
|
|
1695
|
+
}, t), L({
|
|
1686
1696
|
scale: s,
|
|
1687
1697
|
scaleX: c,
|
|
1688
1698
|
scaleY: l
|
|
1689
|
-
}, t),
|
|
1699
|
+
}, t), R(a, t), z(o, t), N(u, t), t;
|
|
1690
1700
|
},
|
|
1691
|
-
toaster: (e, t = {}) => new
|
|
1701
|
+
toaster: (e, t = {}) => new be(e, t),
|
|
1692
1702
|
entity: (e, t) => {
|
|
1693
|
-
let n =
|
|
1703
|
+
let n = De(e);
|
|
1694
1704
|
if (!n) {
|
|
1695
|
-
let t =
|
|
1705
|
+
let t = Oe();
|
|
1696
1706
|
throw Error(`[caper] Unknown entity id '${String(e)}'. Known: ${t.length > 0 ? t.map((e) => `'${e}'`).join(", ") : "(none — discovery may have failed)"}`);
|
|
1697
1707
|
}
|
|
1698
1708
|
let r = new n(t);
|
|
1699
1709
|
if (t) {
|
|
1700
1710
|
let { position: e, x: n, y: i, pivot: a, scale: o, scaleX: s, scaleY: c, alpha: l, visible: u } = t;
|
|
1701
|
-
|
|
1711
|
+
I({
|
|
1702
1712
|
position: e,
|
|
1703
1713
|
x: n,
|
|
1704
1714
|
y: i
|
|
1705
|
-
}, r),
|
|
1715
|
+
}, r), L({
|
|
1706
1716
|
scale: o,
|
|
1707
1717
|
scaleX: s,
|
|
1708
1718
|
scaleY: c
|
|
1709
|
-
}, r),
|
|
1719
|
+
}, r), z(a, r), l !== void 0 && (r.alpha = l), u !== void 0 && (r.visible = u);
|
|
1710
1720
|
}
|
|
1711
1721
|
return r;
|
|
1712
1722
|
},
|
|
1713
1723
|
ui: (e, t) => {
|
|
1714
|
-
let n =
|
|
1724
|
+
let n = Ae(e);
|
|
1715
1725
|
if (!n) {
|
|
1716
|
-
let t =
|
|
1726
|
+
let t = je();
|
|
1717
1727
|
throw Error(`[caper] Unknown ui id '${String(e)}'. Known: ${t.length > 0 ? t.map((e) => `'${e}'`).join(", ") : "(none — discovery may have failed)"}`);
|
|
1718
1728
|
}
|
|
1719
1729
|
let r = new n(t);
|
|
1720
1730
|
if (t) {
|
|
1721
1731
|
let { position: e, x: n, y: i, pivot: a, scale: o, scaleX: s, scaleY: c, alpha: l, visible: u } = t;
|
|
1722
|
-
|
|
1732
|
+
I({
|
|
1723
1733
|
position: e,
|
|
1724
1734
|
x: n,
|
|
1725
1735
|
y: i
|
|
1726
|
-
}, r),
|
|
1736
|
+
}, r), L({
|
|
1727
1737
|
scale: o,
|
|
1728
1738
|
scaleX: s,
|
|
1729
1739
|
scaleY: c
|
|
1730
|
-
}, r),
|
|
1740
|
+
}, r), z(a, r), l !== void 0 && (r.alpha = l), u !== void 0 && (r.visible = u);
|
|
1731
1741
|
}
|
|
1732
1742
|
return r;
|
|
1733
1743
|
}
|
|
1734
1744
|
};
|
|
1735
1745
|
r($);
|
|
1736
1746
|
//#endregion
|
|
1737
|
-
export {
|
|
1747
|
+
export { j as A, z as C, N as D, F as E, E as F, ce as I, O as L, w as M, C as N, de as O, T as P, k as R, R as S, L as T, pe as _, J as a, B as b, Ce as c, K as d, G as f, U as g, W as h, Oe as i, A as j, ue as k, be as l, ge as m, $ as n, q as o, _e as p, je as r, Se as s, Pe as t, ve as u, H as v, I as w, P as x, V as y };
|
|
1738
1748
|
|
|
1739
|
-
//# sourceMappingURL=const-
|
|
1749
|
+
//# sourceMappingURL=const-BClauBNo.js.map
|