@caperjs/core 0.7.2 → 0.7.4
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 +1 -1
- package/build/internal/buildFlags.mjs +63 -18
- package/build/internal/schema.mjs +53 -0
- package/build/plugins/pwa.mjs +13 -7
- package/cli/doctor.mjs +53 -2
- package/cli/doctor.test.mjs +80 -1
- package/cli/native.mjs +126 -15
- package/cli/native.test.mjs +219 -3
- package/extras/llms.txt +35 -3
- package/lib/{CaptionsPlugin-COrofpHN.js → CaptionsPlugin-CAgQBcA1.js} +7 -7
- package/lib/{CaptionsPlugin-COrofpHN.js.map → CaptionsPlugin-CAgQBcA1.js.map} +1 -1
- package/lib/{DataAdapter-T-22-_D1.js → DataAdapter-CbyqWMo-.js} +5 -5
- package/lib/{DataAdapter-T-22-_D1.js.map → DataAdapter-CbyqWMo-.js.map} +1 -1
- package/lib/{DebugRenderer-ZN692Pbg.js → DebugRenderer-Bdkpyyt6.js} +2 -2
- package/lib/{DebugRenderer-ZN692Pbg.js.map → DebugRenderer-Bdkpyyt6.js.map} +1 -1
- package/lib/{DevToolsPlugin-CQXFoj1T.js → DevToolsPlugin-Cq5HHN9K.js} +2 -2
- package/lib/{DevToolsPlugin-CQXFoj1T.js.map → DevToolsPlugin-Cq5HHN9K.js.map} +1 -1
- package/lib/{GSAPPlugin-CNkncyXS.js → GSAPPlugin-D-ujhVYo.js} +2 -2
- package/lib/{GSAPPlugin-CNkncyXS.js.map → GSAPPlugin-D-ujhVYo.js.map} +1 -1
- package/lib/{LayoutPlugin-BuJgr9bd.js → LayoutPlugin-DqbwBm-X.js} +4 -4
- package/lib/{LayoutPlugin-BuJgr9bd.js.map → LayoutPlugin-DqbwBm-X.js.map} +1 -1
- package/lib/{ScreenDebugPlugin-kz9Mr6j1.js → ScreenDebugPlugin-CyT8UxEa.js} +3 -3
- package/lib/{ScreenDebugPlugin-kz9Mr6j1.js.map → ScreenDebugPlugin-CyT8UxEa.js.map} +1 -1
- package/lib/{SpinePlugin-DDzD-Qxd.js → SpinePlugin-DyXJyA3x.js} +2 -2
- package/lib/{SpinePlugin-DDzD-Qxd.js.map → SpinePlugin-DyXJyA3x.js.map} +1 -1
- package/lib/{StatsPlugin-tyFGzVjy.js → StatsPlugin-CEhgzWby.js} +4 -4
- package/lib/{StatsPlugin-tyFGzVjy.js.map → StatsPlugin-CEhgzWby.js.map} +1 -1
- package/lib/{VoiceOverPlugin-rTNz_9eb.js → VoiceOverPlugin-CSpNZjpJ.js} +2 -2
- package/lib/{VoiceOverPlugin-rTNz_9eb.js.map → VoiceOverPlugin-CSpNZjpJ.js.map} +1 -1
- package/lib/caper.mjs +126 -129
- package/lib/caper.mjs.map +1 -1
- package/lib/{const-Cj14a5U2.js → const-Bca54QyV.js} +235 -227
- package/lib/{const-Cj14a5U2.js.map → const-Bca54QyV.js.map} +1 -1
- package/lib/core/Application.d.ts +4 -0
- package/lib/core/Application.d.ts.map +1 -1
- package/lib/core/interfaces/IApplicationOptions.d.ts +21 -0
- package/lib/core/interfaces/IApplicationOptions.d.ts.map +1 -1
- package/lib/plugins/OrientationPlugin.d.ts +57 -0
- package/lib/plugins/OrientationPlugin.d.ts.map +1 -0
- package/lib/plugins/OrientationPlugin.test.d.ts +2 -0
- package/lib/plugins/OrientationPlugin.test.d.ts.map +1 -0
- package/lib/plugins/defaults.d.ts.map +1 -1
- package/lib/plugins/index.d.ts +1 -0
- package/lib/plugins/index.d.ts.map +1 -1
- package/lib/{registries-DmNGVLAi.js → registries-C1nPl8B3.js} +593 -502
- package/lib/registries-C1nPl8B3.js.map +1 -0
- package/lib/ui/UICanvas.d.ts +10 -2
- package/lib/ui/UICanvas.d.ts.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/orientation.d.ts +44 -0
- package/lib/utils/orientation.test.d.ts +2 -0
- package/lib/utils/orientation.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/core/Application.ts +10 -0
- package/src/core/interfaces/IApplicationOptions.ts +21 -0
- package/src/plugins/OrientationPlugin.test.ts +252 -0
- package/src/plugins/OrientationPlugin.ts +178 -0
- package/src/plugins/defaults.ts +6 -0
- package/src/plugins/index.ts +1 -0
- package/src/ui/UICanvas.test.ts +23 -1
- package/src/ui/UICanvas.ts +22 -3
- package/src/utils/index.ts +1 -0
- package/src/utils/orientation.d.ts +44 -0
- package/src/utils/orientation.js +37 -0
- package/src/utils/orientation.test.ts +30 -0
- package/src/version.ts +1 -1
- package/lib/registries-DmNGVLAi.js.map +0 -1
package/lib/caper.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as ee,
|
|
2
|
-
import { A as
|
|
3
|
-
import { n as
|
|
4
|
-
import { r as
|
|
5
|
-
import { t as
|
|
6
|
-
import { CanvasTextMetrics as
|
|
7
|
-
import { gsap as
|
|
1
|
+
import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as ee, Gt as te, H as ne, Ht as re, I as ie, It as ae, J as oe, Jt as se, K as ce, Kt as le, L as p, Lt as ue, M as de, Mt as fe, N as pe, Nt as me, O as he, Ot as ge, P as _e, Pt as ve, Q as ye, Qt as be, R as xe, Rt as m, S as h, St as Se, T as Ce, Tt as we, U as Te, Ut as Ee, V as De, Vt as Oe, W as ke, Wt as g, X as _, Xt as v, Y as y, Yt as Ae, Z as je, Zt as Me, _ as b, _t as x, a as Ne, at as S, b as Pe, bt as Fe, c as Ie, ct as C, d as Le, dt as Re, et as ze, f as Be, ft as Ve, g as He, gt as w, h as Ue, ht as We, i as Ge, it as Ke, j as qe, jt as Je, k as Ye, kt as Xe, l as Ze, lt as Qe, m as $e, mt as et, n as tt, nt, o as rt, ot as it, p as T, pt as at, q as ot, qt as st, r as E, rt as D, s as ct, st as lt, t as ut, tt as dt, u as ft, ut as pt, v as mt, vt as ht, w as O, wt as gt, x as _t, xt as vt, y as yt, yt as bt, z as xt, zt as St } from "./registries-C1nPl8B3.js";
|
|
2
|
+
import { A as Ct, C as wt, D as Tt, E as Et, F as Dt, I as Ot, L as kt, M as At, N as jt, O as Mt, P as Nt, R as Pt, S as Ft, T as It, _ as k, a as Lt, b as Rt, c as zt, d as Bt, f as Vt, g as Ht, h as Ut, i as Wt, j as Gt, k as Kt, l as qt, m as Jt, n as Yt, o as Xt, p as Zt, r as Qt, s as $t, u as en, v as A, w as tn, x as nn, y as rn } from "./const-Bca54QyV.js";
|
|
3
|
+
import { n as an, t as j } from "./padding-1kHDpGlQ.js";
|
|
4
|
+
import { r as on, t as sn } from "./DataAdapter-CbyqWMo-.js";
|
|
5
|
+
import { t as cn } from "./ScreenDebugPlugin-CyT8UxEa.js";
|
|
6
|
+
import { CanvasTextMetrics as M, Container as ln, Graphics as N, Point as P, Polygon as un, Rectangle as dn, Sprite as fn, Texture as F } from "pixi.js";
|
|
7
|
+
import { gsap as I } from "gsap";
|
|
8
8
|
//#region src/utils/array.ts
|
|
9
|
-
function
|
|
9
|
+
function pn(e) {
|
|
10
10
|
let t, n;
|
|
11
|
-
for (let r = 0; r < e.length; ++r) n =
|
|
11
|
+
for (let r = 0; r < e.length; ++r) n = v(0, e.length), t = e[r], e[r] = e[n], e[n] = t;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return e[
|
|
13
|
+
function mn(e) {
|
|
14
|
+
return e[v(0, e.length)];
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/utils/canvas.ts
|
|
18
|
-
function
|
|
18
|
+
function hn(e) {
|
|
19
19
|
let t = e.getContext("webgl");
|
|
20
20
|
if (t) {
|
|
21
21
|
let e = t.getExtension("WEBGL_lose_context");
|
|
@@ -26,13 +26,13 @@ function ln(e) {
|
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/utils/color.ts
|
|
29
|
-
function
|
|
29
|
+
function gn(e) {
|
|
30
30
|
return `#${e.toString(16)}`;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function _n(e) {
|
|
33
33
|
return parseInt(e.replace(/^#/, ""), 16);
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var vn = class e {
|
|
36
36
|
static {
|
|
37
37
|
this.WHITE = new e(255, 255, 255);
|
|
38
38
|
}
|
|
@@ -100,91 +100,88 @@ var fn = class e {
|
|
|
100
100
|
};
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region src/utils/define.ts
|
|
103
|
-
function
|
|
103
|
+
function yn(e) {
|
|
104
104
|
return e;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function bn(e) {
|
|
107
107
|
return e;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function xn(e) {
|
|
110
110
|
return e;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Sn(e) {
|
|
113
113
|
return e;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Cn(e) {
|
|
116
116
|
return e;
|
|
117
117
|
}
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/utils/pixi.ts
|
|
120
|
-
function
|
|
120
|
+
function wn(e, t) {
|
|
121
121
|
e.parent && e.parent.worldTransform.apply(e.position, e.position), t.worldTransform.applyInverse(e.position, e.position), e.parent?.removeChild(e), t.addChild(e);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Tn(e) {
|
|
124
124
|
return Math.sqrt(e.width * e.width + e.height * e.height);
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function En(e) {
|
|
127
127
|
let t = e.parent;
|
|
128
128
|
t && (t.removeChild(e), t.addChild(e));
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Dn(e) {
|
|
131
131
|
let t = e.parent;
|
|
132
132
|
t && (t.removeChild(e), t.addChildAt(e, 0));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
if (e instanceof
|
|
134
|
+
function On(e, t) {
|
|
135
|
+
if (e instanceof un) {
|
|
136
136
|
for (let n = 0; n < e.points.length; n += 2) e.points[n] += t.x, e.points[n + 1] += t.y;
|
|
137
137
|
return e;
|
|
138
138
|
} else return e.x += t.x, e.y += t.y, e;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function kn(e, t) {
|
|
141
141
|
return e.x += t.x, e.y += t.y, e;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function L(e, t, n = "width") {
|
|
144
144
|
let r = n === "width" ? "y" : "x", i = n === "width" ? "x" : "y";
|
|
145
145
|
e[n] = t, e.scale[r] = e.scale[i];
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
147
|
+
function R(e, t) {
|
|
148
|
+
L(e, t, "width");
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function z(e, t) {
|
|
151
|
+
L(e, t, "height");
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function An(e, t, n = "width") {
|
|
154
154
|
let r;
|
|
155
155
|
r = t?.width && t?.height ? {
|
|
156
156
|
x: t.width,
|
|
157
157
|
y: t.height
|
|
158
|
-
} :
|
|
158
|
+
} : w(t), n === "width" ? (R(e, r.x), e.height < r.y && z(e, r.y)) : (z(e, r.y), e.width < r.x && R(e, r.x));
|
|
159
159
|
}
|
|
160
160
|
//#endregion
|
|
161
|
-
//#region src/utils/platform.ts
|
|
162
|
-
var Tn = typeof window < "u" ? window.devicePixelRatio > 1 || window.matchMedia && window.matchMedia("(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)").matches : !1, L = typeof window < "u" ? "ontouchstart" in window || navigator.maxTouchPoints > 0 : !1, En = typeof window < "u" ? "__TAURI_INTERNALS__" in window : !1, R = M.any, z = M.android.device, Dn = M.apple.device;
|
|
163
|
-
//#endregion
|
|
164
161
|
//#region src/utils/rect.ts
|
|
165
|
-
function
|
|
162
|
+
function jn(e, t) {
|
|
166
163
|
return e.x += t.x, e.y += t.y, e;
|
|
167
164
|
}
|
|
168
|
-
function
|
|
169
|
-
return t === void 0 && (t = new
|
|
165
|
+
function Mn(e, t) {
|
|
166
|
+
return t === void 0 && (t = new P()), t.set(e.x + e.width * .5, e.y + e.height * .5), t;
|
|
170
167
|
}
|
|
171
|
-
function
|
|
168
|
+
function Nn(e, t) {
|
|
172
169
|
return e.x *= t, e.y *= t, e.width *= t, e.height *= t, e;
|
|
173
170
|
}
|
|
174
|
-
function
|
|
175
|
-
return t === void 0 && (t = new
|
|
171
|
+
function Pn(e, t) {
|
|
172
|
+
return t === void 0 && (t = new P()), t.set(e.width, e.height), t;
|
|
176
173
|
}
|
|
177
174
|
//#endregion
|
|
178
175
|
//#region src/utils/set.ts
|
|
179
|
-
function
|
|
176
|
+
function Fn(e, t) {
|
|
180
177
|
let n = /* @__PURE__ */ new Set();
|
|
181
178
|
for (let r of e) t(r) && n.add(r);
|
|
182
179
|
return n;
|
|
183
180
|
}
|
|
184
|
-
function
|
|
181
|
+
function In(e) {
|
|
185
182
|
return e?.values().next().value;
|
|
186
183
|
}
|
|
187
|
-
function
|
|
184
|
+
function Ln(e) {
|
|
188
185
|
let t;
|
|
189
186
|
for (let n of e) t = n;
|
|
190
187
|
return t;
|
|
@@ -192,11 +189,11 @@ function Pn(e) {
|
|
|
192
189
|
//#endregion
|
|
193
190
|
//#region src/utils/text.ts
|
|
194
191
|
function B(e, t) {
|
|
195
|
-
let n =
|
|
192
|
+
let n = M.measureText(e.text, e.style), r = n.lines, i = n.lineHeight, a = e.toLocal(new P(t.pageX, t.pageY)), o = 0, s = Infinity, c = 0;
|
|
196
193
|
for (let t = 0; t < r.length; t++) {
|
|
197
194
|
let n = r[t];
|
|
198
195
|
for (let r = 0; r <= n.length; r++) {
|
|
199
|
-
let l = n.substring(0, r), u =
|
|
196
|
+
let l = n.substring(0, r), u = M.measureText(l, e.style).width, d = t * i, f = Math.hypot(u - a.x, d - a.y);
|
|
200
197
|
f < s && (s = f, o = c + r);
|
|
201
198
|
}
|
|
202
199
|
c += n.length;
|
|
@@ -205,35 +202,35 @@ function B(e, t) {
|
|
|
205
202
|
}
|
|
206
203
|
//#endregion
|
|
207
204
|
//#region src/version.ts
|
|
208
|
-
var V = "0.7.
|
|
205
|
+
var V = "0.7.4", H = "8.22.0", Rn = " ........ ..... ............ ............. ........... \n ............. ....... ................ ............. .............. \n .............. ......... ............... ............. .............. \n ..... ........... .............. ............ .............. \n ..... ...... ...... .............. ............. ............. \n .............. ...... ..... ............ ............. ..... ...... \n ................... ..... ..... ............. ..... ....... \n ................ .......... ............. ..... ..... ";
|
|
209
206
|
function U() {
|
|
210
|
-
let e = `\n${
|
|
207
|
+
let e = `\n${Rn}\n\n v${V} | %cPixi.js v${H} %c| %chttps://github.com/anthonysapp/caper\n\n`;
|
|
211
208
|
console.log(e, "color: #E91E63; font-weight: 600;", "color: inherit;", "color: #00BCD4; text-decoration: underline;");
|
|
212
209
|
}
|
|
213
210
|
//#endregion
|
|
214
211
|
//#region src/webgl-check.ts
|
|
215
|
-
function
|
|
212
|
+
function zn() {
|
|
216
213
|
if (typeof document > "u") return;
|
|
217
214
|
let e = document.createElement("canvas");
|
|
218
215
|
e.getContext("webgl") || e.getContext("experimental-webgl") || console.error("Your browser does not support WebGL.");
|
|
219
216
|
}
|
|
220
217
|
//#endregion
|
|
221
218
|
//#region src/plugins/actions/methods.ts
|
|
222
|
-
function
|
|
223
|
-
return e ??
|
|
219
|
+
function Bn(e) {
|
|
220
|
+
return e ?? p;
|
|
224
221
|
}
|
|
225
|
-
function
|
|
222
|
+
function Vn(e, t, n = !0) {
|
|
226
223
|
return n && (t = {
|
|
227
|
-
...
|
|
224
|
+
...r,
|
|
228
225
|
...t
|
|
229
226
|
}), t;
|
|
230
227
|
}
|
|
231
|
-
function
|
|
228
|
+
function Hn(e) {
|
|
232
229
|
return e || [];
|
|
233
230
|
}
|
|
234
231
|
//#endregion
|
|
235
232
|
//#region src/plugins/breakpoints/methods.ts
|
|
236
|
-
function
|
|
233
|
+
function Un(e) {
|
|
237
234
|
return {
|
|
238
235
|
tiers: e.tiers,
|
|
239
236
|
modes: e.modes ?? {}
|
|
@@ -243,7 +240,7 @@ function Bn(e) {
|
|
|
243
240
|
//#region src/plugins/input/touch/constants.ts
|
|
244
241
|
var W = /* @__PURE__ */ function(e) {
|
|
245
242
|
return e.None = "none", e.Left = "left", e.Top = "top", e.Bottom = "bottom", e.Right = "right", e.TopLeft = "top_left", e.TopRight = "top_right", e.BottomLeft = "bottom_left", e.BottomRight = "bottom_right", e;
|
|
246
|
-
}({}),
|
|
243
|
+
}({}), Wn = [
|
|
247
244
|
W.None,
|
|
248
245
|
W.Left,
|
|
249
246
|
W.Top,
|
|
@@ -256,20 +253,20 @@ var W = /* @__PURE__ */ function(e) {
|
|
|
256
253
|
];
|
|
257
254
|
//#endregion
|
|
258
255
|
//#region src/plugins/input/methods.ts
|
|
259
|
-
function
|
|
256
|
+
function Gn(e, t, n) {
|
|
260
257
|
return n || [];
|
|
261
258
|
}
|
|
262
259
|
//#endregion
|
|
263
260
|
//#region src/core/globals.ts
|
|
264
|
-
var G = 200,
|
|
265
|
-
function
|
|
261
|
+
var G = 200, Kn = "CaperApplication";
|
|
262
|
+
function qn() {
|
|
266
263
|
try {
|
|
267
264
|
return globalThis.Caper?.__dev === !0;
|
|
268
265
|
} catch {
|
|
269
266
|
return !1;
|
|
270
267
|
}
|
|
271
268
|
}
|
|
272
|
-
function
|
|
269
|
+
function Jn() {
|
|
273
270
|
try {
|
|
274
271
|
return !1;
|
|
275
272
|
} catch {
|
|
@@ -299,13 +296,13 @@ function q() {
|
|
|
299
296
|
return a.promise;
|
|
300
297
|
}), t;
|
|
301
298
|
}
|
|
302
|
-
function
|
|
299
|
+
function Yn() {
|
|
303
300
|
q();
|
|
304
301
|
}
|
|
305
302
|
function J(e) {
|
|
306
|
-
return e.config?.id ||
|
|
303
|
+
return e.config?.id || Kn;
|
|
307
304
|
}
|
|
308
|
-
function
|
|
305
|
+
function Xn(e) {
|
|
309
306
|
let t = J(e), n = [], r, i = [], a = (e) => {
|
|
310
307
|
n.push(e), n.length > G && n.splice(0, n.length - G);
|
|
311
308
|
}, o = () => r ? r() : void 0, s = (e) => {
|
|
@@ -379,8 +376,8 @@ function qn(e) {
|
|
|
379
376
|
}
|
|
380
377
|
function Y(e) {
|
|
381
378
|
let t = q(), n = J(e);
|
|
382
|
-
if (t.apps.set(n, e), t.app = e,
|
|
383
|
-
let r =
|
|
379
|
+
if (t.apps.set(n, e), t.app = e, qn() || e.config?.automation === !0 || Jn()) {
|
|
380
|
+
let r = Xn(e);
|
|
384
381
|
t.automation[n] = r, e.automation = r;
|
|
385
382
|
}
|
|
386
383
|
}
|
|
@@ -394,21 +391,21 @@ function X(e) {
|
|
|
394
391
|
}
|
|
395
392
|
//#endregion
|
|
396
393
|
//#region src/core/create.ts
|
|
397
|
-
var
|
|
394
|
+
var Zn = "caper-game-container";
|
|
398
395
|
function Z(e) {
|
|
399
396
|
let t = document.createElement("div");
|
|
400
397
|
return t.setAttribute("id", e), document.body.appendChild(t), t;
|
|
401
398
|
}
|
|
402
|
-
async function
|
|
399
|
+
async function Qn() {
|
|
403
400
|
return new Promise((e) => {
|
|
404
401
|
document.readyState === "complete" || document.readyState === "interactive" ? e(!0) : document.addEventListener("DOMContentLoaded", () => {
|
|
405
402
|
e(!0);
|
|
406
403
|
});
|
|
407
404
|
});
|
|
408
405
|
}
|
|
409
|
-
async function
|
|
410
|
-
let { defaultFactoryMethods: r } = await import("./const-
|
|
411
|
-
|
|
406
|
+
async function $n(e = { id: "CaperApplication" }, t = Zn, n = !0) {
|
|
407
|
+
let { defaultFactoryMethods: r } = await import("./const-Bca54QyV.js").then((e) => e.t);
|
|
408
|
+
ye(r), await Qn(), zn(), n && U();
|
|
412
409
|
let i = null;
|
|
413
410
|
if (typeof t == "string" ? (i = document.getElementById(t), i ||= Z(t)) : t instanceof HTMLElement ? i = t : t === window && (i = document.body), !i) throw Error("You passed in a DOM Element, but none was found. If you instead pass in a string, a container will be created for you, using the string for its id.");
|
|
414
411
|
e.resizeToContainer && (e.resizeTo = i), e.useLayout && (e.layout = {
|
|
@@ -417,7 +414,7 @@ async function Yn(e = { id: "CaperApplication" }, t = Jn, n = !0) {
|
|
|
417
414
|
debugModificationCount: 0,
|
|
418
415
|
throttle: 100
|
|
419
416
|
}), e.container = i;
|
|
420
|
-
let a = new (e.application ||
|
|
417
|
+
let a = new (e.application || E)();
|
|
421
418
|
return await a.initialize(e, i), e.useLayout && (a.stage.layout = {
|
|
422
419
|
position: "absolute",
|
|
423
420
|
width: "100%",
|
|
@@ -426,11 +423,11 @@ async function Yn(e = { id: "CaperApplication" }, t = Jn, n = !0) {
|
|
|
426
423
|
}
|
|
427
424
|
//#endregion
|
|
428
425
|
//#region src/display/Entity.ts
|
|
429
|
-
var
|
|
426
|
+
var er = class extends T {
|
|
430
427
|
constructor(e) {
|
|
431
428
|
super(), this.props = e ?? {};
|
|
432
429
|
}
|
|
433
|
-
},
|
|
430
|
+
}, tr = class extends T {
|
|
434
431
|
get animationContext() {
|
|
435
432
|
return this._animationContext ?? `__scene_${this.id}`;
|
|
436
433
|
}
|
|
@@ -465,7 +462,7 @@ var Xn = class extends S {
|
|
|
465
462
|
}
|
|
466
463
|
onPause(e) {}
|
|
467
464
|
onResume(e) {}
|
|
468
|
-
},
|
|
465
|
+
}, nr = class extends T {
|
|
469
466
|
get active() {
|
|
470
467
|
return this._active;
|
|
471
468
|
}
|
|
@@ -506,9 +503,9 @@ var Xn = class extends S {
|
|
|
506
503
|
_update(e) {
|
|
507
504
|
this.active && this.initialized && this.update(e);
|
|
508
505
|
}
|
|
509
|
-
},
|
|
506
|
+
}, rr = class extends ln {
|
|
510
507
|
constructor(e) {
|
|
511
|
-
return super({ isRenderGroup: !0 }), this.config = e, this.onZoom = new
|
|
508
|
+
return super({ isRenderGroup: !0 }), this.config = e, this.onZoom = new y(), this.onZoomComplete = new y(), this.minX = 0, this.minY = 0, this._zooming = !1, this._zoomLerp = .1, this._targetPivot = new P(0, 0), this._targetScale = new P(1, 1), this._lerp = 0, this._target = null, this._followOffset = new P(0, 0), g(this), e && (this.container = e.container, this.addChild(this.container), e.minX && (this.minX = e.minX), e.maxX && (this.maxX = e.maxX), e.minY && (this.minY = e.minY), this.viewportWidth = e.viewportWidth ?? this.app.size.width, this.viewportHeight = e.viewportHeight ?? this.app.size.height, this.worldWidth = e.worldWidth ?? this.viewportWidth, this.worldHeight = e.worldHeight ?? this.viewportHeight, this.maxX = e.maxX ?? this.worldWidth - this.viewportWidth, this.maxY = e.maxY ?? this.worldHeight - this.viewportHeight), this._targetPivot.set(this.viewportWidth * .5, this.viewportHeight * .5), e.target && (this.target = e.target), this._lerp = 1, this.update(), e.lerp && (this.lerp = e.lerp), this;
|
|
512
509
|
}
|
|
513
510
|
get zooming() {
|
|
514
511
|
return this._zooming;
|
|
@@ -539,10 +536,10 @@ var Xn = class extends S {
|
|
|
539
536
|
return this._followOffset;
|
|
540
537
|
}
|
|
541
538
|
set followOffset(e) {
|
|
542
|
-
this._followOffset =
|
|
539
|
+
this._followOffset = w(e, !0);
|
|
543
540
|
}
|
|
544
541
|
get app() {
|
|
545
|
-
return
|
|
542
|
+
return E.getInstance();
|
|
546
543
|
}
|
|
547
544
|
follow(e, t) {
|
|
548
545
|
t ||= {
|
|
@@ -579,12 +576,12 @@ var Xn = class extends S {
|
|
|
579
576
|
} else this.pivot.set(this._targetPivot.x, this._targetPivot.y);
|
|
580
577
|
this.position.set(this.viewportWidth / 2, this.viewportHeight / 2);
|
|
581
578
|
}
|
|
582
|
-
},
|
|
579
|
+
}, ir = class {
|
|
583
580
|
constructor(e, t) {
|
|
584
|
-
this.camera = e, this.interactiveArea = t, this.dragging = !1, this.previousPointerPosition = null,
|
|
581
|
+
this.camera = e, this.interactiveArea = t, this.dragging = !1, this.previousPointerPosition = null, g(this), this.camera = e, this.interactiveArea = t, this.app.keyboard.onKeyDown().connect(this.handleKeyDown), this.interactiveArea.on("pointerdown", this.onPointerDown.bind(this)), this.interactiveArea.on("pointermove", this.onPointerMove.bind(this)), this.app.stage.on("pointerup", this.onPointerUp.bind(this)), this.app.stage.on("pointerupoutside", this.onPointerUp.bind(this)), this.interactiveArea.on("touchstart", this.onPointerDown.bind(this)), this.interactiveArea.on("touchmove", this.onPointerMove.bind(this)), this.interactiveArea.on("touchend", this.onPointerUp.bind(this));
|
|
585
582
|
}
|
|
586
583
|
get app() {
|
|
587
|
-
return
|
|
584
|
+
return E.getInstance();
|
|
588
585
|
}
|
|
589
586
|
destroy() {
|
|
590
587
|
this.interactiveArea.removeAllListeners(), this.app.stage.off("pointerup", this.onPointerUp.bind(this)), this.app.stage.off("pointerupoutside", this.onPointerUp.bind(this));
|
|
@@ -624,15 +621,15 @@ var Xn = class extends S {
|
|
|
624
621
|
this.dragging = !1, this.previousPointerPosition = null;
|
|
625
622
|
}
|
|
626
623
|
getEventPosition(e) {
|
|
627
|
-
return e instanceof TouchEvent ? new
|
|
624
|
+
return e instanceof TouchEvent ? new P(e.touches[0].clientX, e.touches[0].clientY) : new P(e.clientX, e.clientY);
|
|
628
625
|
}
|
|
629
|
-
},
|
|
626
|
+
}, ar = [
|
|
630
627
|
"text",
|
|
631
628
|
"anchor",
|
|
632
629
|
"roundPixels",
|
|
633
630
|
"style",
|
|
634
631
|
"pivot"
|
|
635
|
-
],
|
|
632
|
+
], Q = {
|
|
636
633
|
value: "",
|
|
637
634
|
type: "text",
|
|
638
635
|
fixed: !0,
|
|
@@ -671,32 +668,32 @@ var Xn = class extends S {
|
|
|
671
668
|
scale: 1,
|
|
672
669
|
marginTop: 60
|
|
673
670
|
}
|
|
674
|
-
},
|
|
671
|
+
}, or = [
|
|
675
672
|
"text",
|
|
676
673
|
"password",
|
|
677
674
|
"number",
|
|
678
675
|
"email",
|
|
679
676
|
"tel",
|
|
680
677
|
"url"
|
|
681
|
-
],
|
|
678
|
+
], sr = class e extends A(k(O(T))) {
|
|
682
679
|
constructor(e, t = !1, n = null) {
|
|
683
680
|
if (super({
|
|
684
681
|
autoUpdate: !0,
|
|
685
682
|
autoResize: !t
|
|
686
|
-
}), this.isClone = t, this.clone = n, this.onEnter = new
|
|
687
|
-
|
|
683
|
+
}), this.isClone = t, this.clone = n, this.onEnter = new y(), this.onChange = new y(), this.onError = new y(), this._lastWidth = 0, this._lastHeight = 0, this._placeholderPositioned = !1, this._placeholderAnimating = !1, this._caretPosition = -1, this._value = "", this.options = {
|
|
684
|
+
...Q,
|
|
688
685
|
...e,
|
|
689
686
|
style: {
|
|
690
|
-
|
|
687
|
+
...Q.style,
|
|
691
688
|
...e?.style ?? {}
|
|
692
689
|
},
|
|
693
|
-
padding:
|
|
690
|
+
padding: j(e.padding ?? Q.padding),
|
|
694
691
|
bg: {
|
|
695
|
-
|
|
692
|
+
...Q.bg,
|
|
696
693
|
...e.bg ?? {}
|
|
697
694
|
},
|
|
698
695
|
focusOverlay: {
|
|
699
|
-
|
|
696
|
+
...Q.focusOverlay,
|
|
700
697
|
...e.focusOverlay ?? {}
|
|
701
698
|
}
|
|
702
699
|
}, this.options.layout && typeof this.options.layout == "object" ? this.layout = { ...this.options.layout } : this.layout = { transformOrigin: "top left" }, this.options.placeholder || (this.options.placeholder = { color: Number(this.options.style?.fill) }), this._inner = this.add.container({ layout: {
|
|
@@ -723,7 +720,7 @@ var Xn = class extends S {
|
|
|
723
720
|
width: "100%",
|
|
724
721
|
height: "100%"
|
|
725
722
|
}
|
|
726
|
-
}), this._placeholderContainer.eventMode = "none", this.addSelection(), this.addCaret(), this.addInput(), this.addPlaceholder(), this.placeholder.text = this.options.placeholder.text || `Enter ${this.options.type}`, this.input.eventMode = this.placeholder.eventMode = "none",
|
|
723
|
+
}), this._placeholderContainer.eventMode = "none", this.addSelection(), this.addCaret(), this.addInput(), this.addPlaceholder(), this.placeholder.text = this.options.placeholder.text || `Enter ${this.options.type}`, this.input.eventMode = this.placeholder.eventMode = "none", C && this.addSignalConnection(this.onInteraction("pointertap").connect(this.handleClick, -1)), this.addSignalConnection(this.onInteraction("click").connect(this.handleClick, -1)), this.options.fixed) {
|
|
727
724
|
let e = this.isClone ? this.clone?.options?.focusOverlay?.scale ?? 1 : 1;
|
|
728
725
|
this._mask = this._inner.add.graphics().rect(0, 0, this.bg.width * e - this.options.padding.left - this.options.padding.right, this.bg.height * e - this.options.padding.top - this.options.padding.bottom).fill({ color: 0 }), this._inputContainer.mask = this._mask;
|
|
729
726
|
}
|
|
@@ -825,7 +822,7 @@ var Xn = class extends S {
|
|
|
825
822
|
if (this.placeholder.visible = !0, !this.isClone && this._placeholderPositioned && !this._placeholderAnimating) {
|
|
826
823
|
this._placeholderAnimating = !0;
|
|
827
824
|
let e = this.input.x, t = this.input.y;
|
|
828
|
-
this.options.placeholder.animationOnType ? this.addAnimation([
|
|
825
|
+
this.options.placeholder.animationOnType ? this.addAnimation([I.to(this.placeholder, {
|
|
829
826
|
x: e,
|
|
830
827
|
y: t,
|
|
831
828
|
tint: 16777215,
|
|
@@ -836,7 +833,7 @@ var Xn = class extends S {
|
|
|
836
833
|
onComplete: () => {
|
|
837
834
|
this._placeholderPositioned = !1, this._placeholderAnimating = !1;
|
|
838
835
|
}
|
|
839
|
-
}),
|
|
836
|
+
}), I.to(this.placeholder.scale, {
|
|
840
837
|
x: 1,
|
|
841
838
|
y: 1,
|
|
842
839
|
duration: this.options.placeholder.animationOnType.duration || .4,
|
|
@@ -857,11 +854,11 @@ var Xn = class extends S {
|
|
|
857
854
|
break;
|
|
858
855
|
}
|
|
859
856
|
if (this.options.placeholder.offsetOnType) {
|
|
860
|
-
let n =
|
|
857
|
+
let n = w(this.options.placeholder.offsetOnType);
|
|
861
858
|
e += n.x, t += n.y;
|
|
862
859
|
}
|
|
863
860
|
if (this.options.placeholder.animationOnType) {
|
|
864
|
-
if (this.addAnimation(
|
|
861
|
+
if (this.addAnimation(I.to(this.placeholder, {
|
|
865
862
|
x: e,
|
|
866
863
|
y: t,
|
|
867
864
|
duration: this.options.placeholder.animationOnType.duration || .4,
|
|
@@ -870,8 +867,8 @@ var Xn = class extends S {
|
|
|
870
867
|
alpha: this.options.placeholder.animationOnType.alpha ?? this.options.placeholder.alpha ?? 1,
|
|
871
868
|
overwrite: !0
|
|
872
869
|
})), this.options.placeholder.scaleOnType) {
|
|
873
|
-
let e =
|
|
874
|
-
this.addAnimation(
|
|
870
|
+
let e = w(this.options.placeholder.scaleOnType);
|
|
871
|
+
this.addAnimation(I.to(this.placeholder.scale, {
|
|
875
872
|
x: e.x,
|
|
876
873
|
y: e.y,
|
|
877
874
|
duration: this.options.placeholder.animationOnType.duration || .4,
|
|
@@ -917,7 +914,7 @@ var Xn = class extends S {
|
|
|
917
914
|
}
|
|
918
915
|
addCaret() {
|
|
919
916
|
this.caret = this._inputContainer.add.sprite({
|
|
920
|
-
asset:
|
|
917
|
+
asset: F.WHITE,
|
|
921
918
|
width: 3,
|
|
922
919
|
height: 10,
|
|
923
920
|
tint: this.options.caret.color ?? 0,
|
|
@@ -958,9 +955,9 @@ var Xn = class extends S {
|
|
|
958
955
|
this.domElement = this.clone.domElement, this._addDomElementListeners();
|
|
959
956
|
return;
|
|
960
957
|
}
|
|
961
|
-
clearTimeout(this._focusTimer), clearTimeout(this._pointerDownTimer), this.domElement = document.createElement("input"), this.domElement.type = "text", this.options.type &&
|
|
958
|
+
clearTimeout(this._focusTimer), clearTimeout(this._pointerDownTimer), this.domElement = document.createElement("input"), this.domElement.type = "text", this.options.type && or.includes(this.options.type) && (this.domElement.type = this.options.type), this.options.pattern && (this.domElement.pattern = this.options.pattern), this.options.regex && (this._regex = this.options.regex);
|
|
962
959
|
let t = this.getGlobalPosition(), n = this.getBounds();
|
|
963
|
-
n.x = t.x, n.y = t.y, n.width = this.width - this.options.padding.left, this.domElement.style.position = "fixed", this.domElement.style.border = "none", this.domElement.style.outline = "none", this.domElement.style.left =
|
|
960
|
+
n.x = t.x, n.y = t.y, n.width = this.width - this.options.padding.left, this.domElement.style.position = "fixed", this.domElement.style.border = "none", this.domElement.style.outline = "none", this.domElement.style.left = D ? "0" : `${n.left}px`, this.domElement.style.top = D ? "0" : `${n.top}px`, this.domElement.style.width = `${n.width}px`, this.domElement.style.height = `${n.height}px`, this.domElement.style.padding = "0", this.options.debug ? this.domElement.style.opacity = "0.8" : this.domElement.style.opacity = "0.0000001", this.app.canvas.parentElement?.appendChild(this.domElement), this.domElement.value = this.value, this.domElement.setAttribute("placeholder", this.options?.placeholder?.text ?? ""), this.options?.maxLength && this.domElement.setAttribute("maxLength", this.options.maxLength.toString()), this._addDomElementListeners(), this._focusDomElement(e);
|
|
964
961
|
}
|
|
965
962
|
destroyDomElement() {
|
|
966
963
|
this.isClone || (this.domElement &&= (this._removeDomElementListeners(), this.domElement.remove(), this.domElement.parentNode && this.domElement.parentNode.removeChild(this.domElement), null));
|
|
@@ -972,7 +969,7 @@ var Xn = class extends S {
|
|
|
972
969
|
this.cursorAnimation?.kill(), this.caret.visible = !1;
|
|
973
970
|
}
|
|
974
971
|
blinkCaret() {
|
|
975
|
-
this.cursorAnimation && this.cursorAnimation.kill(), this.cursorAnimation =
|
|
972
|
+
this.cursorAnimation && this.cursorAnimation.kill(), this.cursorAnimation = I.fromTo(this.caret, { alpha: 0 }, {
|
|
976
973
|
duration: .5,
|
|
977
974
|
alpha: 1,
|
|
978
975
|
yoyo: !0,
|
|
@@ -1005,15 +1002,15 @@ var Xn = class extends S {
|
|
|
1005
1002
|
let n = Array.isArray(this.options.focusOverlay.activeFilter), r = !1;
|
|
1006
1003
|
if (n) {
|
|
1007
1004
|
let e = this.options.focusOverlay.activeFilter;
|
|
1008
|
-
(
|
|
1005
|
+
(S && e.includes("mobile") || C && e.includes("touch") || !S && !C && e.includes("desktop")) && (r = !0);
|
|
1009
1006
|
} else r = typeof this.options.focusOverlay.activeFilter == "function" ? this.options.focusOverlay.activeFilter() : t;
|
|
1010
1007
|
if (r) {
|
|
1011
1008
|
let t = structuredClone(this.options), n = this.options.focusOverlay?.scale || 1;
|
|
1012
1009
|
t.focusOverlay = { activeFilter: !1 };
|
|
1013
|
-
let r = Number(t.style?.fontSize ||
|
|
1010
|
+
let r = Number(t.style?.fontSize || Q.style?.fontSize || 20) * n;
|
|
1014
1011
|
if (t.style ||= {}, t.style.fontSize = r, t.padding && (t.padding.left *= n, t.padding.top *= n, t.padding.right *= n, t.padding.bottom *= n), t.bg?.radius && (t.bg.radius *= n), t.bg?.stroke?.width && (t.bg.stroke.width *= n), t.minWidth && (t.minWidth *= n, t.minWidth > this.app.size.width && (t.minWidth = this.app.size.width - (t.bg?.stroke?.width ? t.bg.stroke.width * 2 + 20 : 20))), this.options.focusOverlay?.backing?.active) {
|
|
1015
1012
|
let e = this.make.sprite({
|
|
1016
|
-
asset:
|
|
1013
|
+
asset: F.WHITE,
|
|
1017
1014
|
tint: this.options.focusOverlay.backing.options?.color ?? 0,
|
|
1018
1015
|
alpha: this.options.focusOverlay.backing.options?.alpha ?? .8,
|
|
1019
1016
|
width: this.app.size.width,
|
|
@@ -1028,12 +1025,12 @@ var Xn = class extends S {
|
|
|
1028
1025
|
}
|
|
1029
1026
|
}
|
|
1030
1027
|
_showCloneOverlay() {
|
|
1031
|
-
this.cloneOverlay.pivot.y = -20, this.addAnimation(
|
|
1028
|
+
this.cloneOverlay.pivot.y = -20, this.addAnimation(I.to(this.cloneOverlay, {
|
|
1032
1029
|
duration: .5,
|
|
1033
1030
|
alpha: .8,
|
|
1034
1031
|
ease: "sine.out",
|
|
1035
1032
|
delay: .1
|
|
1036
|
-
})), this.addAnimation(
|
|
1033
|
+
})), this.addAnimation(I.to(this.cloneOverlay.pivot, {
|
|
1037
1034
|
duration: .5,
|
|
1038
1035
|
y: 0,
|
|
1039
1036
|
ease: "sine.out",
|
|
@@ -1066,15 +1063,15 @@ var Xn = class extends S {
|
|
|
1066
1063
|
}
|
|
1067
1064
|
_updateCaretAndSelection() {
|
|
1068
1065
|
if (!this.domElement) {
|
|
1069
|
-
|
|
1066
|
+
m.warn(this.label, "No dom element");
|
|
1070
1067
|
return;
|
|
1071
1068
|
}
|
|
1072
1069
|
let e = this.domElement.selectionStart || 0, t = this.domElement.selectionEnd || -1, n = this.domElement.selectionDirection, r = "", i = this.options.type === "password" ? this.input.text : this._value;
|
|
1073
|
-
if (t === void 0) r = i.substring(0, e), this._caretPosition =
|
|
1070
|
+
if (t === void 0) r = i.substring(0, e), this._caretPosition = M.measureText(r, this.input.style).width, this._selectionRect = null;
|
|
1074
1071
|
else {
|
|
1075
1072
|
r = i.substring(e > t ? t : e, e > t ? e : t);
|
|
1076
|
-
let a = i.substring(0, e > t ? t : e), o =
|
|
1077
|
-
this._selectionRect = new
|
|
1073
|
+
let a = i.substring(0, e > t ? t : e), o = M.measureText(a, this.input.style), s = M.measureText(r, this.input.style);
|
|
1074
|
+
this._selectionRect = new dn(o.width, 0, s.width, this.input.height), this._caretPosition = n === "backward" ? this._selectionRect.left : this._selectionRect.left + this._selectionRect.width;
|
|
1078
1075
|
}
|
|
1079
1076
|
}
|
|
1080
1077
|
_handleDomElementChange(e) {
|
|
@@ -1093,17 +1090,17 @@ var Xn = class extends S {
|
|
|
1093
1090
|
let e = this._inputContainer.getBounds();
|
|
1094
1091
|
return e.width = this._lastWidth, e.height = this._lastHeight, e;
|
|
1095
1092
|
}
|
|
1096
|
-
},
|
|
1093
|
+
}, cr = class extends T {
|
|
1097
1094
|
constructor(e) {
|
|
1098
|
-
if (super(), this.onChange = new
|
|
1095
|
+
if (super(), this.onChange = new y(), this.onStart = new y(), this.onEnd = new y(), this.onDestroy = new y(), this.outerRadius = 0, this.innerRadius = 0, this.innerAlphaStandby = .5, this.dragging = !1, this.pointData = new P(), this.direction = W.None, this.settings = Object.assign({
|
|
1099
1096
|
outerScale: 1,
|
|
1100
1097
|
innerScale: 1
|
|
1101
1098
|
}, e), !this.settings.outer) {
|
|
1102
|
-
let e = new
|
|
1099
|
+
let e = new N();
|
|
1103
1100
|
e.circle(0, 0, 60).fill({ color: 0 }), e.alpha = .5, this.settings.outer = e;
|
|
1104
1101
|
}
|
|
1105
1102
|
if (!this.settings.inner) {
|
|
1106
|
-
let e = new
|
|
1103
|
+
let e = new N();
|
|
1107
1104
|
e.circle(0, 0, 35).fill({ color: 0 }), e.alpha = this.innerAlphaStandby, this.settings.inner = e;
|
|
1108
1105
|
}
|
|
1109
1106
|
this.threshold = this.settings.threshold ?? .01, this.initialize();
|
|
@@ -1113,7 +1110,7 @@ var Xn = class extends S {
|
|
|
1113
1110
|
}
|
|
1114
1111
|
handleDragMove(e) {
|
|
1115
1112
|
if (!this.dragging || e.pointerId !== this._pointerId) return;
|
|
1116
|
-
let t = this.toLocal(e.global), n = t.x - this.startPosition.x, r = t.y - this.startPosition.y, i = new
|
|
1113
|
+
let t = this.toLocal(e.global), n = t.x - this.startPosition.x, r = t.y - this.startPosition.y, i = new P(0, 0), a = 0, o = W.None;
|
|
1117
1114
|
if (n == 0 && r == 0) {
|
|
1118
1115
|
this.direction = o;
|
|
1119
1116
|
return;
|
|
@@ -1163,22 +1160,22 @@ var Xn = class extends S {
|
|
|
1163
1160
|
let t = Math.atan2(e.y, e.x);
|
|
1164
1161
|
return t >= -Math.PI / 8 && t < 0 || t >= 0 && t < Math.PI / 8 ? W.Right : t >= Math.PI / 8 && t < 3 * Math.PI / 8 ? W.BottomRight : t >= 3 * Math.PI / 8 && t < 5 * Math.PI / 8 ? W.Bottom : t >= 5 * Math.PI / 8 && t < 7 * Math.PI / 8 ? W.BottomLeft : t >= 7 * Math.PI / 8 && t < Math.PI || t >= -Math.PI && t < -7 * Math.PI / 8 ? W.Left : t >= -7 * Math.PI / 8 && t < -5 * Math.PI / 8 ? W.TopLeft : t >= -5 * Math.PI / 8 && t < -3 * Math.PI / 8 ? W.Top : W.TopRight;
|
|
1165
1162
|
}
|
|
1166
|
-
},
|
|
1163
|
+
}, lr = {
|
|
1167
1164
|
color: 0,
|
|
1168
1165
|
alpha: .75
|
|
1169
|
-
},
|
|
1166
|
+
}, $ = {
|
|
1170
1167
|
backing: !0,
|
|
1171
1168
|
closeOnEscape: !0,
|
|
1172
1169
|
closeOnPointerDownOutside: !0,
|
|
1173
1170
|
actionContext: "popup"
|
|
1174
|
-
},
|
|
1171
|
+
}, ur = class e extends T {
|
|
1175
1172
|
get actionContext() {
|
|
1176
1173
|
return this.config.actionContext;
|
|
1177
1174
|
}
|
|
1178
1175
|
constructor(e, t = {}) {
|
|
1179
1176
|
super(), this.id = e, this.isShowing = !1, this._storedActionContext = void 0, this.config = Object.assign({
|
|
1180
1177
|
id: e,
|
|
1181
|
-
|
|
1178
|
+
...$
|
|
1182
1179
|
}, t), this._initialize();
|
|
1183
1180
|
}
|
|
1184
1181
|
get data() {
|
|
@@ -1187,7 +1184,7 @@ var Xn = class extends S {
|
|
|
1187
1184
|
static makeBacking(e, t) {
|
|
1188
1185
|
let n = {};
|
|
1189
1186
|
typeof e == "object" && (n = e);
|
|
1190
|
-
let r = Object.assign({ ...
|
|
1187
|
+
let r = Object.assign({ ...lr }, n), i = new fn(F.WHITE);
|
|
1191
1188
|
return i.anchor.set(.5), i.alpha = r.alpha, i.tint = r.color, i.width = t.width, i.height = t.height, i;
|
|
1192
1189
|
}
|
|
1193
1190
|
initialize() {}
|
|
@@ -1221,15 +1218,15 @@ var Xn = class extends S {
|
|
|
1221
1218
|
this.app.focus.addFocusLayer(this.id, !1), this.config.backing && (this.backing = this.add.existing(e.makeBacking(this.config.backing, this.app.size)), this.backing.eventMode = "static", this.config.closeOnPointerDownOutside && (this.backing.once("click", this.close), this.backing.once("tap", this.close))), this.view = this.add.container(), this.view.eventMode = "static";
|
|
1222
1219
|
}
|
|
1223
1220
|
setActionContext() {
|
|
1224
|
-
this.actionContext && (this.app.actionContext = this.actionContext,
|
|
1221
|
+
this.actionContext && (this.app.actionContext = this.actionContext, m.log("Popup", "Setting action context", this.app.actionContext));
|
|
1225
1222
|
}
|
|
1226
1223
|
storeActionContext() {
|
|
1227
|
-
this._storedActionContext = this.app.actionContext,
|
|
1224
|
+
this._storedActionContext = this.app.actionContext, m.log("Popup", "Storing action context", this._storedActionContext);
|
|
1228
1225
|
}
|
|
1229
1226
|
restoreActionContext() {
|
|
1230
|
-
this._storedActionContext && (
|
|
1227
|
+
this._storedActionContext && (m.log("Popup", "Restoring action context", this._storedActionContext), this.app.actionContext = this._storedActionContext), this._storedActionContext = void 0;
|
|
1231
1228
|
}
|
|
1232
|
-
},
|
|
1233
|
-
export {
|
|
1229
|
+
}, dr = _.Collector, fr = _.CollectorArray, pr = _.CollectorLast, mr = _.CollectorUntil0, hr = _.CollectorWhile0, gr = _.SignalConnections;
|
|
1230
|
+
export { De as ActionsPlugin, b as Animated, Rt as AnimatedSprite, E as Application, ee as AssetsPlugin, pe as AudioChannel, de as AudioInstance, qe as AudioManagerPlugin, _e as BreakpointPlugin, Ut as Button, Ht as ButtonConfigKeys, rr as Camera, ir as CameraController, ue as CaperEvent, dr as Collector, fr as CollectorArray, pr as CollectorLast, mr as CollectorUntil0, hr as CollectorWhile0, vn as Color, T as Container, $e as ContainerConfigKeys, _t as Controls, sn as DataAdapter, At as DebugAlpha, jt as DebugColors, ie as DefaultActionContexts, p as DefaultActionContextsArray, xe as DefaultActions, xt as DefaultButtonIds, er as Entity, He as Factory, Vt as FlexContainer, Zt as FlexContainerConfigKeys, Ye as FocusManagerPlugin, t as FocusOutliner, A as Focusable, ke as FullScreenPlugin, s as GesturePlugin, sr as Input, Ce as InputControllerTypes, Pe as InputPlugin, k as Interactive, Wn as JOYSTICK_DIRECTIONS, cr as Joystick, W as JoystickDirection, a as KeyboardControls, ne as KeyboardPlugin, m as Logger, Ge as LookupPlugin, mt as ORIENTATION_OVERLAY_TEXT, yt as OrientationPlugin, Kt as ParticleContainer, Ct as ParticleContainerConfigKeys, ce as Plugin, ur as Popup, Be as PopupManagerPlugin, fe as Queue, Le as ResizerPlugin, tr as Scene, Ze as SceneManagerPlugin, nr as SceneTransition, cn as ScreenDebugPlugin, y as Signal, gr as SignalConnections, rn as SpineAnimation, oe as Store, Mt as Svg, ar as TextPropsKeys, rt as Timer, ct as TimerPlugin, en as Toast, qt as Toaster, h as TouchControls, h as VirtualControls, Lt as UICanvas, Xt as UICanvasConfigKeys, Ne as WebEventsPlugin, Ue as WithLifecycle, O as WithSignals, Qe as add, pt as addToPoint, g as bindAllMethods, te as bindMethods, st as bool, St as capitalize, i as capitalizeWords, Mn as center, le as checkAndInvokeMethod, we as clamp, $t as computeEffectivePadding, ut as coreFunctionRegistry, tt as coreSignalRegistry, $n as create, Z as createContainer, Nt as createDebugGraphics, Dt as createDebugLabel, ot as createFactoryMethods, me as createQueue, o as debounce, Fe as deepMerge, r as defaultActionsList, d as defaultBreakpoints, Yt as defaultFactoryMethods, he as defaultGestureOptions, Bt as defaultToastConfig, Vn as defineActions, Un as defineBreakpoints, Hn as defineButtons, e as defineConfig, Bn as defineContexts, Gn as defineControls, on as defineData, Sn as defineEntity, bn as definePlugin, xn as definePopup, yn as defineScene, Cn as defineUI, ve as delay, hn as destroyCanvas, Re as distance, Ve as distanceSq, j as ensurePadding, Oe as env, Fn as filterSet, In as firstFromSet, se as floatBetween, Ae as floatBetweenPoint, Ie as formatTime, ze as generatePluginList, Ot as getDebugRegistry, Je as getDynamicModuleFromImportListItem, nn as getErrorTexture, c as getFirstMapEntry, ge as getLastMapEntry, B as getNearestCharacterIndex, Xe as getNextMapEntry, nt as getOrientation, n as getPreviousMapEntry, mn as getRandomElement, Wt as getRegisteredEntityIds, Qt as getRegisteredUIIds, Gt as getZeroPaddedNumber, l as i18nPlugin, Yn as installCaperGlobal, v as intBetween, Me as intBetweenPoint, D as isAndroid, re as isDev, Ke as isIos, S as isMobile, Ee as isProduction, f as isPromise, it as isRetina, je as isStorageCapable, lt as isTauri, Jt as isText, C as isTouch, Ln as lastFromSet, u as lerp, at as lerpPoint, et as magnitude, We as multiply, Te as normalizeKey, Tn as objectDiagonal, jn as offset, On as offsetShape, kn as offsetSimpleShape, vt as omitKeys, H as pixiVersion, Se as pluck, be as randomUUID, wn as reParent, Y as registerCaperApp, kt as registerDebug, Ft as resolveAnchor, bt as resolveOrientation, an as resolvePadding, wt as resolvePivot, w as resolvePointLike, tn as resolvePosition, zt as resolveSafeArea, It as resolveScale, gt as resolveSizeLike, Et as resolveTexture, Tt as resolveUnknownKeys, U as sayHello, Nn as scale, z as scaleToHeight, An as scaleToSize, R as scaleToWidth, L as scaleUniform, Dn as sendToBack, En as sendToFront, ft as shouldEnableScreenDebug, pn as shuffle, X as signalCaperReady, Pn as size, dt as sortPluginsByRequires, x as subtract, ht as subtractFromPoint, gn as toHex, _n as toRgb, Pt as unregisterDebug, V as version, ae as wait };
|
|
1234
1231
|
|
|
1235
1232
|
//# sourceMappingURL=caper.mjs.map
|