@caperjs/core 0.4.0 → 0.5.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.d.mts +29 -0
- package/build/internal/manifest.mjs +2 -2
- package/build/internal/validate.mjs +2 -1
- package/build/plugins/assetTypes.mjs +0 -6
- package/build/plugins/caperConfig.mjs +5 -3
- package/build/plugins/lists.mjs +0 -15
- package/lib/{CaptionsPlugin-cSJj-R9M.js → CaptionsPlugin-CDbGZrN9.js} +11 -11
- package/lib/CaptionsPlugin-CDbGZrN9.js.map +1 -0
- package/lib/{DataAdapter-D2tc6hx9.js → DataAdapter-BTlNzWqg.js} +2 -2
- package/lib/{DataAdapter-D2tc6hx9.js.map → DataAdapter-BTlNzWqg.js.map} +1 -1
- package/lib/{DebugRenderer-CGUKy6Fy.js → DebugRenderer-eSVpon4c.js} +2 -2
- package/lib/{DebugRenderer-CGUKy6Fy.js.map → DebugRenderer-eSVpon4c.js.map} +1 -1
- package/lib/{DevToolsPlugin-B8GX3H9b.js → DevToolsPlugin-Ci6r9j-m.js} +2 -2
- package/lib/{DevToolsPlugin-B8GX3H9b.js.map → DevToolsPlugin-Ci6r9j-m.js.map} +1 -1
- package/lib/{GSAPPlugin-Br9AjuTD.js → GSAPPlugin-C8zo-fyt.js} +2 -2
- package/lib/{GSAPPlugin-Br9AjuTD.js.map → GSAPPlugin-C8zo-fyt.js.map} +1 -1
- package/lib/{LayoutPlugin-BX3OP7pw.js → LayoutPlugin-Cs2lcXKb.js} +4 -4
- package/lib/{LayoutPlugin-BX3OP7pw.js.map → LayoutPlugin-Cs2lcXKb.js.map} +1 -1
- package/lib/{SpinePlugin-C-JDdXpf.js → SpinePlugin-CLgSXBQm.js} +2 -2
- package/lib/{SpinePlugin-C-JDdXpf.js.map → SpinePlugin-CLgSXBQm.js.map} +1 -1
- package/lib/{StatsPlugin-yJlJtoQ2.js → StatsPlugin-D_90U3BG.js} +4 -4
- package/lib/{StatsPlugin-yJlJtoQ2.js.map → StatsPlugin-D_90U3BG.js.map} +1 -1
- package/lib/{VoiceOverPlugin-DjSZp4Ko.js → VoiceOverPlugin-CAE1dtOw.js} +33 -33
- package/lib/{VoiceOverPlugin-DjSZp4Ko.js.map → VoiceOverPlugin-CAE1dtOw.js.map} +1 -1
- package/lib/caper.mjs +87 -87
- package/lib/caper.mjs.map +1 -1
- package/lib/{const-C3sxeYhl.js → const-BTDpIdRO.js} +192 -199
- package/lib/const-BTDpIdRO.js.map +1 -0
- package/lib/display/Container.d.ts +1 -28
- package/lib/display/Container.d.ts.map +1 -1
- package/lib/display/ParticleContainer.d.ts +20 -29
- package/lib/display/ParticleContainer.d.ts.map +1 -1
- package/lib/display/ParticleContainer.test.d.ts +2 -0
- package/lib/display/ParticleContainer.test.d.ts.map +1 -0
- package/lib/display/SpineAnimation.d.ts +1 -2
- package/lib/display/SpineAnimation.d.ts.map +1 -1
- package/lib/display/SpineAnimation.test.d.ts +1 -0
- package/lib/display/SpineAnimation.test.d.ts.map +1 -0
- package/lib/mixins/factory/const.d.ts.map +1 -1
- package/lib/mixins/focus.d.ts.map +1 -1
- package/lib/mixins/index.d.ts +1 -0
- package/lib/mixins/index.d.ts.map +1 -1
- package/lib/mixins/lifecycle.d.ts +56 -0
- package/lib/mixins/lifecycle.d.ts.map +1 -0
- package/lib/plugins/FullScreenPlugin.d.ts.map +1 -1
- package/lib/plugins/KeyboardPlugin.d.ts.map +1 -1
- package/lib/plugins/Plugin.d.ts.map +1 -1
- package/lib/plugins/WebEventsPlugin.d.ts +1 -0
- package/lib/plugins/WebEventsPlugin.d.ts.map +1 -1
- package/lib/plugins/audio/AudioInstance.d.ts +3 -3
- package/lib/plugins/audio/AudioInstance.d.ts.map +1 -1
- package/lib/plugins/captions/CaptionsRenderer.d.ts.map +1 -1
- package/lib/plugins/focus/FocusManagerPlugin.d.ts.map +1 -1
- package/lib/{registries-BfV-VF7a.js → registries-nN_hU44y.js} +109 -77
- package/lib/registries-nN_hU44y.js.map +1 -0
- package/lib/utils/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/core/Application.ts +2 -2
- package/src/display/Container.ts +5 -72
- package/src/display/ParticleContainer.test.ts +127 -0
- package/src/display/ParticleContainer.ts +28 -62
- package/src/display/SpineAnimation.test.ts +79 -0
- package/src/display/SpineAnimation.ts +4 -6
- package/src/mixins/factory/const.ts +2 -1
- package/src/mixins/focus.ts +0 -2
- package/src/mixins/index.ts +4 -0
- package/src/mixins/lifecycle.ts +160 -0
- package/src/plugins/DataAdapter.ts +1 -1
- package/src/plugins/FullScreenPlugin.test.ts +9 -0
- package/src/plugins/FullScreenPlugin.ts +0 -1
- package/src/plugins/KeyboardPlugin.ts +0 -1
- package/src/plugins/Plugin.ts +0 -2
- package/src/plugins/TimerPlugin.ts +1 -1
- package/src/plugins/WebEventsPlugin.test.ts +13 -0
- package/src/plugins/WebEventsPlugin.ts +12 -1
- package/src/plugins/audio/AudioInstance.ts +2 -2
- package/src/plugins/captions/CaptionsPlugin.test.ts +48 -3
- package/src/plugins/captions/CaptionsPlugin.ts +5 -5
- package/src/plugins/captions/CaptionsRenderer.ts +0 -1
- package/src/plugins/focus/FocusManagerPlugin.ts +0 -1
- package/src/ui/Input.ts +2 -2
- package/src/utils/types.ts +0 -1
- package/src/version.ts +1 -1
- package/lib/CaptionsPlugin-cSJj-R9M.js.map +0 -1
- package/lib/const-C3sxeYhl.js.map +0 -1
- package/lib/registries-BfV-VF7a.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { AnimatedSprite as
|
|
1
|
+
import { K as e, Ot as t, Pt as n, Wt as r, Y as i, _t as a, bt as o, dt as s, f as c, ft as l, h as u, m as d, mt as f, p, r as m, st as h, vt as ee, x as g, yt as te } from "./registries-nN_hU44y.js";
|
|
2
|
+
import { t as _ } from "./padding-1kHDpGlQ.js";
|
|
3
|
+
import { AnimatedSprite as ne, Assets as v, BitmapText as y, Graphics as b, HTMLText as re, ParticleContainer as ie, Sprite as ae, 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 = {
|
|
@@ -17,7 +17,7 @@ var C = {
|
|
|
17
17
|
crosshair: .5
|
|
18
18
|
};
|
|
19
19
|
function T(e) {
|
|
20
|
-
let t = new
|
|
20
|
+
let t = new b();
|
|
21
21
|
return t.eventMode = "none", t.interactiveChildren = !1, t.layout = !1, t.label = e ?? "DebugGraphics", t;
|
|
22
22
|
}
|
|
23
23
|
function E(e, t = C.bounds) {
|
|
@@ -45,7 +45,7 @@ function O(e, t, n) {
|
|
|
45
45
|
function k(e) {
|
|
46
46
|
D.delete(e);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function ce() {
|
|
49
49
|
return D;
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
@@ -55,52 +55,48 @@ function A(e, t = 0) {
|
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/display/ParticleContainer.ts
|
|
58
|
-
var j = [
|
|
58
|
+
var j = [
|
|
59
|
+
"autoResize",
|
|
60
|
+
"autoUpdate",
|
|
61
|
+
"priority"
|
|
62
|
+
], le = {
|
|
63
|
+
autoResize: !0,
|
|
59
64
|
autoUpdate: !0,
|
|
60
65
|
priority: 0
|
|
61
|
-
},
|
|
62
|
-
static {
|
|
63
|
-
this.__caper_method_binding_root = !0;
|
|
64
|
-
}
|
|
66
|
+
}, ue = class extends d(g(ie)) {
|
|
65
67
|
constructor(e = {}) {
|
|
66
|
-
super(e)
|
|
67
|
-
|
|
68
|
+
super(e);
|
|
69
|
+
let { autoResize: t, autoUpdate: r, priority: i } = {
|
|
70
|
+
...le,
|
|
68
71
|
...e
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
added() {}
|
|
77
|
-
destroy(e) {
|
|
78
|
-
this.__config.autoUpdate && this.app.ticker.remove(this.update, this), this.onDestroy.emit(), super.destroy(e);
|
|
79
|
-
}
|
|
80
|
-
removed() {}
|
|
81
|
-
_added() {
|
|
82
|
-
this.__config.autoUpdate && this.app.ticker.add(this.update, this, this.__config.priority), this.added();
|
|
72
|
+
};
|
|
73
|
+
n(this), this._initLifecycle({
|
|
74
|
+
autoResize: t,
|
|
75
|
+
autoUpdate: r,
|
|
76
|
+
resizePriority: i,
|
|
77
|
+
updatePriority: i
|
|
78
|
+
});
|
|
83
79
|
}
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
update(e) {
|
|
81
|
+
ie.prototype.update.call(this);
|
|
86
82
|
}
|
|
87
|
-
},
|
|
83
|
+
}, de = class extends b {
|
|
88
84
|
constructor(e) {
|
|
89
|
-
super(typeof e == "string" ?
|
|
85
|
+
super(typeof e == "string" ? v.get(e) : e);
|
|
90
86
|
let t = this.getLocalBounds();
|
|
91
87
|
this.pivot.set((t.x + t.width) / 2, (t.y + t.height) / 2);
|
|
92
88
|
}
|
|
93
89
|
}, M;
|
|
94
|
-
function N(
|
|
95
|
-
for (let r in
|
|
96
|
-
n[r] =
|
|
97
|
-
} catch (
|
|
98
|
-
|
|
90
|
+
function N(e, n) {
|
|
91
|
+
for (let r in e) try {
|
|
92
|
+
n[r] = e[r];
|
|
93
|
+
} catch (e) {
|
|
94
|
+
t.warn(`Error setting property ${r}`, e);
|
|
99
95
|
}
|
|
100
96
|
}
|
|
101
97
|
function P() {
|
|
102
98
|
if (!M) {
|
|
103
|
-
let e = new
|
|
99
|
+
let e = new b();
|
|
104
100
|
e.rect(0, 0, 100, 100), e.fill({ color: 16711680 }), e.stroke({
|
|
105
101
|
color: 16777215,
|
|
106
102
|
width: 1,
|
|
@@ -113,26 +109,26 @@ function P() {
|
|
|
113
109
|
}
|
|
114
110
|
return M;
|
|
115
111
|
}
|
|
116
|
-
function F(
|
|
117
|
-
let n, r =
|
|
118
|
-
if (r instanceof
|
|
119
|
-
else if (!a || a?.length === 0)
|
|
120
|
-
else if (
|
|
121
|
-
let
|
|
112
|
+
function F(e) {
|
|
113
|
+
let n, r = e?.asset, i = r, a = e?.sheet;
|
|
114
|
+
if (r instanceof oe) n = r;
|
|
115
|
+
else if (!a || a?.length === 0) v.cache.has(i) ? n = v.get(i) : v.get(i) ? n = v.get(i).texture : (t.error("Asset \"" + r + "\" not loaded into Pixi cache"), n = P());
|
|
116
|
+
else if (v.get(a)) {
|
|
117
|
+
let e = v.get(a), o = e.textures;
|
|
122
118
|
if (o !== void 0) if (o.hasOwnProperty(i)) n = o[i];
|
|
123
|
-
else if (
|
|
124
|
-
for (let
|
|
125
|
-
n =
|
|
119
|
+
else if (e.linkedSheets !== void 0 && e.linkedSheets.length > 0) {
|
|
120
|
+
for (let t of e.linkedSheets) if (t.textures !== void 0 && t.textures.hasOwnProperty(i)) {
|
|
121
|
+
n = t.textures[i];
|
|
126
122
|
break;
|
|
127
123
|
}
|
|
128
|
-
n === void 0 && (
|
|
129
|
-
} else
|
|
130
|
-
else
|
|
131
|
-
} else return
|
|
132
|
-
return n || new
|
|
124
|
+
n === void 0 && (t.error("Asset \"" + r + "\" not found inside spritesheet \"" + r + "' or any of its linked sheets"), n = P());
|
|
125
|
+
} else t.error("Asset \"" + r + "\" not found inside spritesheet \"" + a + "'"), n = P();
|
|
126
|
+
else t.error("Spritesheet \"" + a + "\" loaded but textures arent?!"), n = P();
|
|
127
|
+
} else return t.error("Spritesheet \"" + a + "\" not loaded into Pixi cache"), P();
|
|
128
|
+
return n || new ae().texture;
|
|
133
129
|
}
|
|
134
130
|
function I(e, t) {
|
|
135
|
-
let n =
|
|
131
|
+
let n = h(e.position, !1, e.x, e.y);
|
|
136
132
|
t.x = n.x, t.y = n.y;
|
|
137
133
|
}
|
|
138
134
|
function L(e, t) {
|
|
@@ -141,27 +137,27 @@ function L(e, t) {
|
|
|
141
137
|
if (e.scaleX === void 0 && e.scaleY === void 0) return;
|
|
142
138
|
e.scaleX === void 0 && (e.scaleX = 1), e.scaleY === void 0 && (e.scaleY = 1);
|
|
143
139
|
}
|
|
144
|
-
let n =
|
|
140
|
+
let n = h(e.scale, !1, e.scaleX, e.scaleY);
|
|
145
141
|
t.scale.set(n.x, n.y);
|
|
146
142
|
}
|
|
147
143
|
function R(e, t) {
|
|
148
144
|
if (e !== void 0) {
|
|
149
|
-
let n =
|
|
145
|
+
let n = h(e);
|
|
150
146
|
t.anchor.set(n.x, n.y);
|
|
151
147
|
}
|
|
152
148
|
}
|
|
153
149
|
function z(e, t) {
|
|
154
150
|
if (e !== void 0) {
|
|
155
|
-
let n =
|
|
151
|
+
let n = h(e);
|
|
156
152
|
t.pivot.set(n.x, n.y);
|
|
157
153
|
}
|
|
158
154
|
}
|
|
159
155
|
//#endregion
|
|
160
156
|
//#region src/display/AnimatedSprite.ts
|
|
161
|
-
var B = class
|
|
162
|
-
constructor(
|
|
163
|
-
let i =
|
|
164
|
-
super(
|
|
157
|
+
var B = class t extends ne {
|
|
158
|
+
constructor(r) {
|
|
159
|
+
let i = r?.animations ?? {}, a = r?.animation ?? Object.keys(i)[0], o = i[a], s = r?.sheet, c = r?.texturePrefix || "", l = r?.zeroPad, u = r?.startIndex ?? 0;
|
|
160
|
+
super(t.generateTexturesFromProps(a, o, c, s, l, u), r?.autoUpdate !== !1), this.config = r, this.onAnimationChange = new e(), this.onAnimationStart = new e(), this.onAnimationStop = new e(), this.onAnimationLoop = new e(), this.onAnimationComplete = new e(), this.onAnimationFrameChange = new e(), this.defaultTexturePrefix = "", this._paused = !1, this._isReversed = !1, n(this), this.defaultSheet = s, this.defaultTexturePrefix = c, this.defaultZeroPad = l, this._generateAnimations(), this.currentAnimation = this.defaultAnimation = a, this.autoPlay = r?.autoPlay ?? !0, this.loop = r?.loop ?? !0, this.updateAnchor = r?.updateAnchor ?? !1, this.animationSpeed = this.defaultAnimationSpeed = r?.animationSpeed ?? 1, this.on("added", this._added);
|
|
165
161
|
}
|
|
166
162
|
get paused() {
|
|
167
163
|
return this._paused;
|
|
@@ -208,11 +204,11 @@ var B = class e extends re {
|
|
|
208
204
|
super.stop(), this.onAnimationStop?.emit();
|
|
209
205
|
}
|
|
210
206
|
nextAnimation() {
|
|
211
|
-
let e = te(this._animations, this.currentAnimation) ??
|
|
207
|
+
let e = te(this._animations, this.currentAnimation) ?? a(this._animations);
|
|
212
208
|
e && this.setAnimation(e[0]);
|
|
213
209
|
}
|
|
214
210
|
previousAnimation() {
|
|
215
|
-
let e =
|
|
211
|
+
let e = o(this._animations, this.currentAnimation) ?? ee(this._animations);
|
|
216
212
|
e && this.setAnimation(e[0]);
|
|
217
213
|
}
|
|
218
214
|
update(e) {
|
|
@@ -220,12 +216,12 @@ var B = class e extends re {
|
|
|
220
216
|
}
|
|
221
217
|
_generateAnimations() {
|
|
222
218
|
this._animations = /* @__PURE__ */ new Map();
|
|
223
|
-
let
|
|
224
|
-
if (
|
|
225
|
-
for (let [n, r] of Object.entries(
|
|
226
|
-
if (this.config?.reversible) for (let [n, r] of Object.entries(
|
|
227
|
-
let
|
|
228
|
-
|
|
219
|
+
let e = this.config?.animations ?? {};
|
|
220
|
+
if (e) {
|
|
221
|
+
for (let [n, r] of Object.entries(e)) this._animations.set(n, t.generateTexturesFromProps(n, r, this.defaultTexturePrefix, this.defaultSheet, this.defaultZeroPad));
|
|
222
|
+
if (this.config?.reversible) for (let [n, r] of Object.entries(e)) {
|
|
223
|
+
let e = t.generateTexturesFromProps(n, r, this.defaultTexturePrefix, this.defaultSheet, this.defaultZeroPad);
|
|
224
|
+
e.reverse(), this._animations.set(`${n}_reverse`, e);
|
|
229
225
|
}
|
|
230
226
|
}
|
|
231
227
|
}
|
|
@@ -238,10 +234,7 @@ var B = class e extends re {
|
|
|
238
234
|
this.onAnimationFrameChange.emit();
|
|
239
235
|
}, this.autoPlay && this.play();
|
|
240
236
|
}
|
|
241
|
-
},
|
|
242
|
-
get app() {
|
|
243
|
-
return m.getInstance();
|
|
244
|
-
}
|
|
237
|
+
}, fe = d(g(u())), V = class extends fe {
|
|
245
238
|
get animationNames() {
|
|
246
239
|
return this.spine.state.data.skeletonData.animations.map((e) => e.name);
|
|
247
240
|
}
|
|
@@ -251,17 +244,17 @@ var B = class e extends re {
|
|
|
251
244
|
get elapsedAnimationTime() {
|
|
252
245
|
return this.currentEntry ? this.currentEntry.trackTime : -1;
|
|
253
246
|
}
|
|
254
|
-
constructor(
|
|
255
|
-
super(), this.onAnimationComplete = new
|
|
256
|
-
let
|
|
257
|
-
if (typeof
|
|
258
|
-
let e =
|
|
259
|
-
e !== ".json" && e !== ".skel" ? e = ".json" :
|
|
260
|
-
skeleton:
|
|
261
|
-
atlas:
|
|
247
|
+
constructor(t) {
|
|
248
|
+
super(), this.onAnimationComplete = new e(), this.onAnimationStart = new e(), this.onAnimationInterrupt = new e(), this.onAnimationDispose = new e(), this.onAnimationEnd = new e(), this.onAnimationEvent = new e(), this.onPaused = new e(), this.onResumed = new e(), n(this), this._initLifecycle();
|
|
249
|
+
let r = t?.data, i = "";
|
|
250
|
+
if (typeof r == "string") {
|
|
251
|
+
let e = r.slice(-5);
|
|
252
|
+
e !== ".json" && e !== ".skel" ? e = ".json" : r = r.substring(0, r.length - 5), i = {
|
|
253
|
+
skeleton: r + e,
|
|
254
|
+
atlas: r + ".atlas"
|
|
262
255
|
};
|
|
263
256
|
}
|
|
264
|
-
this.spine = window.Spine.from(i), this.add.existing(this.spine),
|
|
257
|
+
this.spine = window.Spine.from(i), this.add.existing(this.spine), t && (t.autoUpdate !== void 0 && (this.spine.autoUpdate = t.autoUpdate), t.animationName && this.setAnimation(t.animationName, t.loop, t.trackIndex ?? 0)), this.addSignalConnection(this.app.actions("toggle_pause").connect(this.togglePause)), t?.paused && this.pause(), this._stateListener = {
|
|
265
258
|
start: this._handleAnimationStart,
|
|
266
259
|
interrupt: this._handleAnimationInterrupt,
|
|
267
260
|
dispose: this._handleAnimationDispose,
|
|
@@ -309,10 +302,10 @@ var B = class e extends re {
|
|
|
309
302
|
};
|
|
310
303
|
//#endregion
|
|
311
304
|
//#region src/mixins/focus.ts
|
|
312
|
-
function H(
|
|
313
|
-
return class extends
|
|
314
|
-
constructor(...
|
|
315
|
-
super(...
|
|
305
|
+
function H(t) {
|
|
306
|
+
return class extends t {
|
|
307
|
+
constructor(...t) {
|
|
308
|
+
super(...t), 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 e(), this.onFocusIn = new e(), this.onFocusOut = new e(), this.onBlur = new e(), 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);
|
|
316
309
|
}
|
|
317
310
|
get app() {
|
|
318
311
|
return m.getInstance();
|
|
@@ -357,17 +350,17 @@ function H(e) {
|
|
|
357
350
|
H.INITTED = !1;
|
|
358
351
|
//#endregion
|
|
359
352
|
//#region src/mixins/interaction.ts
|
|
360
|
-
function
|
|
361
|
-
return class extends
|
|
353
|
+
function pe(t) {
|
|
354
|
+
return class extends t {
|
|
362
355
|
constructor(...e) {
|
|
363
356
|
super(...e), this._signals = /* @__PURE__ */ new Map(), this._emitSignal = this._emitSignal.bind(this), this.eventMode = "static";
|
|
364
357
|
}
|
|
365
|
-
onInteraction(
|
|
366
|
-
if (!this._signals.has(
|
|
367
|
-
let n = new
|
|
368
|
-
this._signals.set(
|
|
358
|
+
onInteraction(t) {
|
|
359
|
+
if (!this._signals.has(t)) {
|
|
360
|
+
let n = new e();
|
|
361
|
+
this._signals.set(t, n), this.on(t, this._emitSignal);
|
|
369
362
|
}
|
|
370
|
-
return this._signals.get(
|
|
363
|
+
return this._signals.get(t);
|
|
371
364
|
}
|
|
372
365
|
destroy(e) {
|
|
373
366
|
for (let e of this._signals.keys()) this.off(e, this._emitSignal);
|
|
@@ -381,7 +374,7 @@ function U(e) {
|
|
|
381
374
|
}
|
|
382
375
|
//#endregion
|
|
383
376
|
//#region src/ui/Button.ts
|
|
384
|
-
var
|
|
377
|
+
var U = [
|
|
385
378
|
"textures",
|
|
386
379
|
"sounds",
|
|
387
380
|
"actions",
|
|
@@ -391,22 +384,22 @@ var W = [
|
|
|
391
384
|
"enabled",
|
|
392
385
|
"layout",
|
|
393
386
|
"textLabel"
|
|
394
|
-
],
|
|
387
|
+
], me = H(pe(g(u()))), W = class extends me {
|
|
395
388
|
get textLabel() {
|
|
396
389
|
return this._textLabel;
|
|
397
390
|
}
|
|
398
|
-
constructor(
|
|
399
|
-
super(), this.onDown = new
|
|
391
|
+
constructor(t) {
|
|
392
|
+
super(), this.onDown = new e(), this.onUp = new e(), this.onUpOutside = new e(), this.onOut = new e(), this.onOver = new e(), this.onClick = new e(), this.onEnabled = new e(), this.onDisabled = new e(), this.onKeyboardEvent = new e(), this.onDestroy = new e(), this._isDownCallbacks = /* @__PURE__ */ new Map(), this._isDownListenerAdded = !1, n(this), this.config = Object.assign({
|
|
400
393
|
id: "button",
|
|
401
394
|
textures: { default: "" },
|
|
402
395
|
sheet: void 0,
|
|
403
396
|
enabled: !0,
|
|
404
397
|
cursor: "default",
|
|
405
398
|
disabledCursor: "not-allowed"
|
|
406
|
-
},
|
|
399
|
+
}, t), this.id = this.config.id, t.layout === void 0 ? this.layout = !1 : this.layout = t.layout, this.view = this.add.sprite({
|
|
407
400
|
asset: this.config.textures.default,
|
|
408
401
|
sheet: this.config.sheet ?? void 0
|
|
409
|
-
}), this.cursor = this.config.cursor, this.enabled =
|
|
402
|
+
}), this.cursor = this.config.cursor, this.enabled = t.enabled !== !1, this.layout?.style.transformOrigin !== "top left" && (this.layout = { transformOrigin: "top left" }, this.app.renderer.layout && this.app.renderer.layout.update(this)), this.config.textLabel && this.addLabel(this.config.textLabel), this.addSignalConnection(this.onInteraction("pointerover").connect(this.handlePointerOver, -1), this.onInteraction("pointerout").connect(this.handlePointerOut, -1), this.onInteraction("pointerup").connect(this.handlePointerUp, -1), this.onInteraction("click").connect(this.handleClick, -1), this.onInteraction("tap").connect(this.handleClick, -1), this.onInteraction("pointerdown").connect(this.handlePointerDown, -1)), this.on("removed", this._resetPressState);
|
|
410
403
|
}
|
|
411
404
|
set enabled(e) {
|
|
412
405
|
this._enabled !== e && (this._enabled = e, this.cursor = this._enabled ? this.config.cursor : this.config.disabledCursor, this.focusEnabled = e, this._enabled ? (this.view.texture = this.make.texture({
|
|
@@ -421,7 +414,7 @@ var W = [
|
|
|
421
414
|
window.removeEventListener("pointerup", this.handlePointerUpOutside), this.off("pointerupoutside", this.handlePointerUpOutside), this.isDown = !1, this._pointerId = void 0;
|
|
422
415
|
}
|
|
423
416
|
addLabel(e) {
|
|
424
|
-
if (e instanceof x || e instanceof
|
|
417
|
+
if (e instanceof x || e instanceof re || e instanceof y) e.anchor.set(.5, .5), this._textLabel = this.add.existing(e), this._textLabel.layout = !1;
|
|
425
418
|
else switch (e.anchor = .5, e.type) {
|
|
426
419
|
case "bitmap":
|
|
427
420
|
this._textLabel = this.add.bitmapText({
|
|
@@ -523,22 +516,22 @@ var W = [
|
|
|
523
516
|
e();
|
|
524
517
|
});
|
|
525
518
|
}
|
|
526
|
-
},
|
|
527
|
-
function
|
|
528
|
-
return e instanceof x || e instanceof
|
|
519
|
+
}, he = g(u());
|
|
520
|
+
function ge(e) {
|
|
521
|
+
return e instanceof x || e instanceof y;
|
|
529
522
|
}
|
|
530
|
-
var
|
|
523
|
+
var _e = [
|
|
531
524
|
"bindTo",
|
|
532
525
|
"bindToAppSize",
|
|
533
526
|
"autoLayoutChildren",
|
|
534
527
|
"debug"
|
|
535
|
-
],
|
|
536
|
-
constructor(
|
|
537
|
-
if (super(), this.onLayoutComplete = new
|
|
538
|
-
|
|
528
|
+
], G = class extends he {
|
|
529
|
+
constructor(t = {}) {
|
|
530
|
+
if (super(), this.onLayoutComplete = new e(), this._debugGraphics = null, this._debugLabel = null, !this.app.config.useLayout) throw Error("You must set useLayout to true in your app config to use FlexContainer");
|
|
531
|
+
n(this), this.config = {
|
|
539
532
|
autoLayoutChildren: !0,
|
|
540
|
-
...
|
|
541
|
-
}, this.layout = this.createLayout(
|
|
533
|
+
...t
|
|
534
|
+
}, this.layout = this.createLayout(t), this.on("added", this.handleAdded), this.on("childAdded", this.handleChildAdded), this.on("childRemoved", this.handleChildRemoved), this.config.bindToAppSize && this.app.onResize.connect(this.handleResize), this.config.bindTo && "on" in this.config.bindTo && this.config.bindTo.on("layout", this.handleBindToResize);
|
|
542
535
|
}
|
|
543
536
|
createLayout(e) {
|
|
544
537
|
e?.layout === !0 && (e.layout = {});
|
|
@@ -552,7 +545,7 @@ var he = [
|
|
|
552
545
|
this.app.ticker.addOnce(this.updateLayout);
|
|
553
546
|
}
|
|
554
547
|
handleChildAdded(e) {
|
|
555
|
-
this.config.autoLayoutChildren && (e.layout ?
|
|
548
|
+
this.config.autoLayoutChildren && (e.layout ? ge(e) && !e.layout?.style?.isLeaf && (e.layout = { isLeaf: !0 }) : e.layout = { isLeaf: !0 }), c.childAdded(e), e.on("layout", this._updateLayout), this._updateLayout();
|
|
556
549
|
}
|
|
557
550
|
handleChildRemoved(e) {
|
|
558
551
|
e.off("layout", this._updateLayout), c.childRemoved(e), this._updateLayout();
|
|
@@ -777,7 +770,7 @@ var he = [
|
|
|
777
770
|
destroy() {
|
|
778
771
|
this.config.debug && k(`FlexContainer:${this.uid}`), this._debugGraphics &&= (this._debugGraphics.destroy(), null), this._debugLabel &&= (this._debugLabel.destroy(), null), this.off("added", this.handleAdded), this.off("childAdded", this.handleChildAdded), this.off("childRemoved", this.handleChildRemoved), this.config.bindToAppSize && this.app.onResize.disconnect(this.handleResize), this.config.bindTo && "off" in this.config.bindTo && this.config.bindTo.off("layout", this.handleBindToResize), super.destroy();
|
|
779
772
|
}
|
|
780
|
-
},
|
|
773
|
+
}, K = {
|
|
781
774
|
type: "info",
|
|
782
775
|
duration: 3e3,
|
|
783
776
|
width: 300,
|
|
@@ -815,7 +808,7 @@ var he = [
|
|
|
815
808
|
warning: 15844367,
|
|
816
809
|
error: 15158332
|
|
817
810
|
}
|
|
818
|
-
},
|
|
811
|
+
}, ve = class extends g(c) {
|
|
819
812
|
set toaster(e) {
|
|
820
813
|
this._toaster = e;
|
|
821
814
|
}
|
|
@@ -825,10 +818,10 @@ var he = [
|
|
|
825
818
|
set text(e) {
|
|
826
819
|
this.textDisplay.text = e, this.alignText();
|
|
827
820
|
}
|
|
828
|
-
constructor(
|
|
829
|
-
super(), this.onToastClosed = new
|
|
830
|
-
...
|
|
831
|
-
...
|
|
821
|
+
constructor(t = {}) {
|
|
822
|
+
super(), this.onToastClosed = new e(), this.isHiding = !1, this.config = {
|
|
823
|
+
...K,
|
|
824
|
+
...t
|
|
832
825
|
}, this.initialize();
|
|
833
826
|
}
|
|
834
827
|
initialize() {
|
|
@@ -839,7 +832,7 @@ var he = [
|
|
|
839
832
|
color: this.config.backgroundColor,
|
|
840
833
|
alpha: this.config.backgroundAlpha
|
|
841
834
|
}), this.config.type) {
|
|
842
|
-
let e = new
|
|
835
|
+
let e = new b().roundRect(0, 0, this.config.width, this.config.height, this.config.cornerRadius).fill({ color: 16777215 }), t = this.view.add.graphics().rect(0, 0, this.config.colorBarWidth, this.config.height).fill({ color: this.config.textColors[this.config.type] });
|
|
843
836
|
t.mask = e, this.view.addChild(e), this.view.addChild(t);
|
|
844
837
|
}
|
|
845
838
|
this.config.closeButton?.show && this.addCloseButton();
|
|
@@ -847,7 +840,7 @@ var he = [
|
|
|
847
840
|
this.textDisplay = this.view.add.text({
|
|
848
841
|
text: this.config.message,
|
|
849
842
|
style: {
|
|
850
|
-
...
|
|
843
|
+
...K.style,
|
|
851
844
|
...this.config.style,
|
|
852
845
|
wordWrapWidth: this.config.style?.wordWrapWidth ?? this.config.width - e - t
|
|
853
846
|
},
|
|
@@ -856,7 +849,7 @@ var he = [
|
|
|
856
849
|
}), this.alignText(), this.view.pivot.set(this.config.width * .5, this.config.height * .5), this.view.position.set(this.config.width * .5, this.config.height * .5), this.alpha = 0, this.addChild(this.view);
|
|
857
850
|
}
|
|
858
851
|
addCloseButton() {
|
|
859
|
-
let e = this.config.closeButton?.class ||
|
|
852
|
+
let e = this.config.closeButton?.class || W, t = this.config.closeButton?.size ?? 12, n = this.config.closeButton?.offset ?? 4, r = this.config.closeButton?.position ?? "top right";
|
|
860
853
|
this.closeButton = this.view.add.existing(new e({ cursor: "pointer" }));
|
|
861
854
|
let i = r === "top right" ? this.config.width - t * .5 - n : t * .5 + n, a = t * .5 + n;
|
|
862
855
|
this.closeButton.position.set(i, a), this.closeButton.onClick.connect(() => {
|
|
@@ -921,7 +914,7 @@ var he = [
|
|
|
921
914
|
destroy() {
|
|
922
915
|
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 });
|
|
923
916
|
}
|
|
924
|
-
},
|
|
917
|
+
}, ye = {
|
|
925
918
|
position: "bottom right",
|
|
926
919
|
maxToasts: 5,
|
|
927
920
|
spacing: 10,
|
|
@@ -931,7 +924,7 @@ var he = [
|
|
|
931
924
|
},
|
|
932
925
|
stackDirection: "up",
|
|
933
926
|
animationSpeed: 1
|
|
934
|
-
},
|
|
927
|
+
}, be = class extends g(c) {
|
|
935
928
|
get size() {
|
|
936
929
|
return this.toasts.length;
|
|
937
930
|
}
|
|
@@ -956,10 +949,10 @@ var he = [
|
|
|
956
949
|
get toastConfig() {
|
|
957
950
|
return this.defaultToastConfig ?? {};
|
|
958
951
|
}
|
|
959
|
-
constructor(
|
|
960
|
-
super({ autoResize: !0 }), this.onToastAdded = new
|
|
961
|
-
...
|
|
962
|
-
...
|
|
952
|
+
constructor(t = {}, n = {}) {
|
|
953
|
+
super({ autoResize: !0 }), this.onToastAdded = new e(), this.onToastRemoved = new e(), this.onAllToastsRemoved = new e(), this.toasts = [], this.config = {
|
|
954
|
+
...ye,
|
|
955
|
+
...t
|
|
963
956
|
}, this.defaultToastConfig = { ...n }, this.initialize(), this.resize();
|
|
964
957
|
}
|
|
965
958
|
initialize() {
|
|
@@ -980,7 +973,7 @@ var he = [
|
|
|
980
973
|
textColors: this.defaultToastConfig.textColors || e.textColors ? {
|
|
981
974
|
...this.defaultToastConfig.textColors ?? {},
|
|
982
975
|
...e.textColors ?? {}
|
|
983
|
-
} :
|
|
976
|
+
} : K.textColors,
|
|
984
977
|
shadow: this.defaultToastConfig.shadow || e.shadow ? {
|
|
985
978
|
...this.defaultToastConfig.shadow ?? {},
|
|
986
979
|
...e.shadow ?? {}
|
|
@@ -988,9 +981,9 @@ var he = [
|
|
|
988
981
|
closeButton: this.defaultToastConfig.closeButton || e.closeButton ? {
|
|
989
982
|
...this.defaultToastConfig.closeButton ?? {},
|
|
990
983
|
...e.closeButton ?? {}
|
|
991
|
-
} :
|
|
984
|
+
} : K.closeButton
|
|
992
985
|
});
|
|
993
|
-
let n = new (e.class ??
|
|
986
|
+
let n = new (e.class ?? ve)(e);
|
|
994
987
|
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();
|
|
995
988
|
}
|
|
996
989
|
async hideAll() {
|
|
@@ -1058,20 +1051,20 @@ var he = [
|
|
|
1058
1051
|
S.killTweensOf(e);
|
|
1059
1052
|
}), this.hideAll(), this.toasts = [], super.destroy({ children: !0 });
|
|
1060
1053
|
}
|
|
1061
|
-
},
|
|
1054
|
+
}, q = [
|
|
1062
1055
|
"debug",
|
|
1063
1056
|
"padding",
|
|
1064
1057
|
"size",
|
|
1065
1058
|
"useAppSize",
|
|
1066
1059
|
"useSafeArea",
|
|
1067
1060
|
"layout"
|
|
1068
|
-
],
|
|
1061
|
+
], xe = {
|
|
1069
1062
|
top: 0,
|
|
1070
1063
|
right: 0,
|
|
1071
1064
|
bottom: 0,
|
|
1072
1065
|
left: 0
|
|
1073
1066
|
};
|
|
1074
|
-
function
|
|
1067
|
+
function Se(e, t) {
|
|
1075
1068
|
return {
|
|
1076
1069
|
top: e.top + t.top,
|
|
1077
1070
|
right: e.right + t.right,
|
|
@@ -1079,31 +1072,31 @@ function be(e, t) {
|
|
|
1079
1072
|
left: e.left + t.left
|
|
1080
1073
|
};
|
|
1081
1074
|
}
|
|
1082
|
-
var
|
|
1075
|
+
var Ce = {
|
|
1083
1076
|
flexGrow: 0,
|
|
1084
1077
|
flexShrink: 0,
|
|
1085
1078
|
autoLayoutChildren: !0
|
|
1086
|
-
},
|
|
1079
|
+
}, we = g(u()), J = class e extends we {
|
|
1087
1080
|
constructor(e) {
|
|
1088
1081
|
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) => {
|
|
1089
1082
|
throw Error("UICanvas: Do not call addChildAt() directly. Use addElement(child, { align }) instead.\nExample: uiCanvas.addElement(myChild, { align: 'top right' })");
|
|
1090
1083
|
}, this.setChildIndex = (e, t) => {
|
|
1091
1084
|
throw Error("UICanvas: Do not call setChildIndex() directly. Use reorderElement(child, index), bringToFront(child), or sendToBack(child) instead.\nExample: uiCanvas.reorderElement(myChild, 0)");
|
|
1092
1085
|
}, this.getChildIndex = (e) => super.getChildIndex(e), this.getChildAt = (e) => super.getChildAt(e), !this.app.config.useLayout) throw Error("You must set useLayout to true in your app config to use UICanvas");
|
|
1093
|
-
|
|
1086
|
+
n(this), this._positionContainers = /* @__PURE__ */ new Map(), this.config = {
|
|
1094
1087
|
debug: e.debug === !0,
|
|
1095
|
-
padding:
|
|
1088
|
+
padding: _(e?.padding ?? 0),
|
|
1096
1089
|
size: e.size === void 0 ? {
|
|
1097
1090
|
width: 0,
|
|
1098
1091
|
height: 0
|
|
1099
|
-
} :
|
|
1092
|
+
} : f(e.size),
|
|
1100
1093
|
useAppSize: e.useAppSize === !0,
|
|
1101
1094
|
useSafeArea: e.useSafeArea ?? !0,
|
|
1102
1095
|
autoLayoutChildren: e.autoLayoutChildren ?? !0
|
|
1103
1096
|
}, e.layout ? typeof e.layout == "boolean" ? this.config.layout = e.layout : this.config.layout = {
|
|
1104
|
-
...
|
|
1097
|
+
...Ce,
|
|
1105
1098
|
...e.layout
|
|
1106
|
-
} : this.config.layout = { ...
|
|
1099
|
+
} : this.config.layout = { ...Ce }, this.config.useAppSize && (this.config.size = this.app.size), this.layout = {
|
|
1107
1100
|
width: this.config.size.width,
|
|
1108
1101
|
height: this.config.size.height,
|
|
1109
1102
|
flexDirection: "column",
|
|
@@ -1225,16 +1218,16 @@ var xe = {
|
|
|
1225
1218
|
this.config.size = e === void 0 ? {
|
|
1226
1219
|
width: 0,
|
|
1227
1220
|
height: 0
|
|
1228
|
-
} :
|
|
1221
|
+
} : f(e), this.layout = {
|
|
1229
1222
|
width: this.config.size.width,
|
|
1230
1223
|
height: this.config.size.height
|
|
1231
1224
|
}, this.updateLayout();
|
|
1232
1225
|
}
|
|
1233
1226
|
set padding(e) {
|
|
1234
|
-
this.config.padding =
|
|
1227
|
+
this.config.padding = _(e), this._applyPadding(), this._updateLayout();
|
|
1235
1228
|
}
|
|
1236
1229
|
_applyPadding() {
|
|
1237
|
-
let e =
|
|
1230
|
+
let e = Se(this.config.padding, this.config.useSafeArea ? this.app.safeArea : xe);
|
|
1238
1231
|
this.layout = {
|
|
1239
1232
|
paddingLeft: e.left,
|
|
1240
1233
|
paddingTop: e.top,
|
|
@@ -1243,7 +1236,7 @@ var xe = {
|
|
|
1243
1236
|
};
|
|
1244
1237
|
}
|
|
1245
1238
|
static isFlexContainer(e) {
|
|
1246
|
-
return e instanceof
|
|
1239
|
+
return e instanceof G;
|
|
1247
1240
|
}
|
|
1248
1241
|
addChild(...e) {
|
|
1249
1242
|
if (this._disableAddChildError) return super.addChild(...e);
|
|
@@ -1298,15 +1291,15 @@ var xe = {
|
|
|
1298
1291
|
}
|
|
1299
1292
|
addElement(n, r) {
|
|
1300
1293
|
let i = r?.align ?? "top left", a = this._positionContainers.get(i);
|
|
1301
|
-
return a ? (
|
|
1294
|
+
return a ? (e.isFlexContainer(n) && this.addSignalConnection(n.onLayoutComplete.connect(this._updateLayout)), this.settingsMap.set(n, {
|
|
1302
1295
|
align: i,
|
|
1303
|
-
padding: r?.padding ?
|
|
1296
|
+
padding: r?.padding ? _(r.padding) : {
|
|
1304
1297
|
top: 0,
|
|
1305
1298
|
left: 0,
|
|
1306
1299
|
bottom: 0,
|
|
1307
1300
|
right: 0
|
|
1308
1301
|
}
|
|
1309
|
-
}), this._childMap.set(n, a), this._canvasChildren = Array.from(this._childMap.keys()), a.add.existing(n), this._childAdded(n), n) : (
|
|
1302
|
+
}), this._childMap.set(n, a), this._canvasChildren = Array.from(this._childMap.keys()), a.add.existing(n), this._childAdded(n), n) : (t.error(`UICanvas:: Invalid position "${i}" for element`), n);
|
|
1310
1303
|
}
|
|
1311
1304
|
removeElement(e) {
|
|
1312
1305
|
let t = this._childMap.get(e);
|
|
@@ -1415,42 +1408,42 @@ var xe = {
|
|
|
1415
1408
|
});
|
|
1416
1409
|
}
|
|
1417
1410
|
}, Y = null;
|
|
1418
|
-
function
|
|
1411
|
+
function Te() {
|
|
1419
1412
|
if (Y) return Y;
|
|
1420
1413
|
Y = /* @__PURE__ */ new Map();
|
|
1421
1414
|
let e = globalThis.Caper?.get?.("entityList") ?? [];
|
|
1422
1415
|
for (let t of e) t.active !== !1 && typeof t.module == "function" && t.module.prototype && Y.set(t.id, t.module);
|
|
1423
1416
|
return Y;
|
|
1424
1417
|
}
|
|
1425
|
-
function
|
|
1426
|
-
return
|
|
1418
|
+
function Ee(e) {
|
|
1419
|
+
return Te().get(e);
|
|
1427
1420
|
}
|
|
1428
|
-
function
|
|
1429
|
-
return [...
|
|
1421
|
+
function De() {
|
|
1422
|
+
return [...Te().keys()];
|
|
1430
1423
|
}
|
|
1431
1424
|
//#endregion
|
|
1432
1425
|
//#region src/mixins/factory/ui-registry.ts
|
|
1433
1426
|
var X = null;
|
|
1434
|
-
function
|
|
1427
|
+
function Oe() {
|
|
1435
1428
|
if (X) return X;
|
|
1436
1429
|
X = /* @__PURE__ */ new Map();
|
|
1437
1430
|
let e = globalThis.Caper?.get?.("uiList") ?? [];
|
|
1438
1431
|
for (let t of e) t.active !== !1 && typeof t.module == "function" && t.module.prototype && X.set(t.id, t.module);
|
|
1439
1432
|
return X;
|
|
1440
1433
|
}
|
|
1441
|
-
function
|
|
1442
|
-
return
|
|
1434
|
+
function ke(e) {
|
|
1435
|
+
return Oe().get(e);
|
|
1443
1436
|
}
|
|
1444
|
-
function
|
|
1445
|
-
return [...
|
|
1437
|
+
function Ae() {
|
|
1438
|
+
return [...Oe().keys()];
|
|
1446
1439
|
}
|
|
1447
1440
|
//#endregion
|
|
1448
1441
|
//#region src/mixins/factory/schema.ts
|
|
1449
|
-
var
|
|
1442
|
+
var je = [
|
|
1450
1443
|
"position",
|
|
1451
1444
|
"scale",
|
|
1452
1445
|
"pivot"
|
|
1453
|
-
],
|
|
1446
|
+
], Me = [
|
|
1454
1447
|
"position",
|
|
1455
1448
|
"x",
|
|
1456
1449
|
"y",
|
|
@@ -1461,25 +1454,25 @@ var Ae = [
|
|
|
1461
1454
|
"anchor"
|
|
1462
1455
|
];
|
|
1463
1456
|
function Z(e) {
|
|
1464
|
-
let t = e.applies ??
|
|
1457
|
+
let t = e.applies ?? je, n = t.includes("position"), r = t.includes("scale"), i = t.includes("pivot"), a = t.includes("anchor"), o = [...Me, ...e.exclude ?? []];
|
|
1465
1458
|
return (t) => {
|
|
1466
|
-
let
|
|
1467
|
-
if (t == null) return
|
|
1468
|
-
let
|
|
1459
|
+
let c = e.build(t);
|
|
1460
|
+
if (t == null) return c;
|
|
1461
|
+
let l = t;
|
|
1469
1462
|
return n && I({
|
|
1470
|
-
position:
|
|
1471
|
-
x:
|
|
1472
|
-
y:
|
|
1473
|
-
},
|
|
1474
|
-
scale:
|
|
1475
|
-
scaleX:
|
|
1476
|
-
scaleY:
|
|
1477
|
-
},
|
|
1463
|
+
position: l.position,
|
|
1464
|
+
x: l.x,
|
|
1465
|
+
y: l.y
|
|
1466
|
+
}, c), r && L({
|
|
1467
|
+
scale: l.scale,
|
|
1468
|
+
scaleX: l.scaleX,
|
|
1469
|
+
scaleY: l.scaleY
|
|
1470
|
+
}, c), i && z(l.pivot, c), a && R(l.anchor, c), N(s(o, l), c), c;
|
|
1478
1471
|
};
|
|
1479
1472
|
}
|
|
1480
1473
|
//#endregion
|
|
1481
1474
|
//#region src/mixins/factory/const.ts
|
|
1482
|
-
var
|
|
1475
|
+
var Ne = /* @__PURE__ */ r({ defaultFactoryMethods: () => $ }), Q = [
|
|
1483
1476
|
"text",
|
|
1484
1477
|
"roundPixels",
|
|
1485
1478
|
"resolution",
|
|
@@ -1501,16 +1494,16 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1501
1494
|
}, e), z(a, e), N(l, e), e;
|
|
1502
1495
|
},
|
|
1503
1496
|
container: Z({
|
|
1504
|
-
build: (e) => new c(e ?
|
|
1497
|
+
build: (e) => new c(e ? l(e, p) : void 0),
|
|
1505
1498
|
applies: [
|
|
1506
1499
|
"position",
|
|
1507
1500
|
"scale",
|
|
1508
1501
|
"pivot"
|
|
1509
1502
|
],
|
|
1510
|
-
exclude:
|
|
1503
|
+
exclude: p
|
|
1511
1504
|
}),
|
|
1512
1505
|
particleContainer: Z({
|
|
1513
|
-
build: (e) => new
|
|
1506
|
+
build: (e) => new ue(e ? l(e, j) : void 0),
|
|
1514
1507
|
applies: [
|
|
1515
1508
|
"position",
|
|
1516
1509
|
"scale",
|
|
@@ -1520,7 +1513,7 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1520
1513
|
}),
|
|
1521
1514
|
texture: F,
|
|
1522
1515
|
sprite: Z({
|
|
1523
|
-
build: (e) => new
|
|
1516
|
+
build: (e) => new ae(e ? F(e) : void 0),
|
|
1524
1517
|
applies: [
|
|
1525
1518
|
"position",
|
|
1526
1519
|
"scale",
|
|
@@ -1530,7 +1523,7 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1530
1523
|
exclude: ["asset", "sheet"]
|
|
1531
1524
|
}),
|
|
1532
1525
|
tilingSprite: Z({
|
|
1533
|
-
build: (e) => new
|
|
1526
|
+
build: (e) => new se(e ? F(e) : void 0),
|
|
1534
1527
|
applies: [
|
|
1535
1528
|
"position",
|
|
1536
1529
|
"scale",
|
|
@@ -1561,7 +1554,7 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1561
1554
|
]
|
|
1562
1555
|
}),
|
|
1563
1556
|
graphics: Z({
|
|
1564
|
-
build: (e) => new
|
|
1557
|
+
build: (e) => new b(),
|
|
1565
1558
|
applies: [
|
|
1566
1559
|
"position",
|
|
1567
1560
|
"scale",
|
|
@@ -1569,8 +1562,8 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1569
1562
|
]
|
|
1570
1563
|
}),
|
|
1571
1564
|
svg(e) {
|
|
1572
|
-
let t = new
|
|
1573
|
-
return I({
|
|
1565
|
+
let t = new de(e.ctx), { position: n, x: r, y: i, pivot: a, scale: o, scaleX: s, scaleY: c, ...l } = e;
|
|
1566
|
+
return delete l.ctx, I({
|
|
1574
1567
|
position: n,
|
|
1575
1568
|
x: r,
|
|
1576
1569
|
y: i
|
|
@@ -1578,7 +1571,7 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1578
1571
|
scale: o,
|
|
1579
1572
|
scaleX: s,
|
|
1580
1573
|
scaleY: c
|
|
1581
|
-
}, t), z(a, t), N(
|
|
1574
|
+
}, t), z(a, t), N(l, t), t;
|
|
1582
1575
|
},
|
|
1583
1576
|
text: Z({
|
|
1584
1577
|
build: (e) => new x(e ? {
|
|
@@ -1586,8 +1579,8 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1586
1579
|
roundPixels: e.roundPixels,
|
|
1587
1580
|
resolution: e.resolution,
|
|
1588
1581
|
style: e.style,
|
|
1589
|
-
anchor: e.anchor ?
|
|
1590
|
-
pivot: e.pivot ?
|
|
1582
|
+
anchor: e.anchor ? h(e.anchor, !0) : void 0,
|
|
1583
|
+
pivot: e.pivot ? h(e.pivot, !0) : void 0
|
|
1591
1584
|
} : {}),
|
|
1592
1585
|
applies: [
|
|
1593
1586
|
"position",
|
|
@@ -1597,13 +1590,13 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1597
1590
|
exclude: [...Q]
|
|
1598
1591
|
}),
|
|
1599
1592
|
htmlText: Z({
|
|
1600
|
-
build: (e) => new
|
|
1593
|
+
build: (e) => new re(e ? {
|
|
1601
1594
|
text: e.text,
|
|
1602
1595
|
roundPixels: e.roundPixels,
|
|
1603
1596
|
resolution: e.resolution,
|
|
1604
1597
|
style: e.style,
|
|
1605
|
-
anchor: e.anchor ?
|
|
1606
|
-
pivot: e.pivot ?
|
|
1598
|
+
anchor: e.anchor ? h(e.anchor, !0) : void 0,
|
|
1599
|
+
pivot: e.pivot ? h(e.pivot, !0) : void 0
|
|
1607
1600
|
} : {}),
|
|
1608
1601
|
applies: [
|
|
1609
1602
|
"position",
|
|
@@ -1613,12 +1606,12 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1613
1606
|
exclude: [...Q]
|
|
1614
1607
|
}),
|
|
1615
1608
|
bitmapText: Z({
|
|
1616
|
-
build: (e) => new
|
|
1609
|
+
build: (e) => new y(e ? {
|
|
1617
1610
|
text: e.text,
|
|
1618
1611
|
roundPixels: e.roundPixels,
|
|
1619
1612
|
style: e.style,
|
|
1620
|
-
anchor: e.anchor ?
|
|
1621
|
-
pivot: e.pivot ?
|
|
1613
|
+
anchor: e.anchor ? h(e.anchor, !0) : void 0,
|
|
1614
|
+
pivot: e.pivot ? h(e.pivot, !0) : void 0
|
|
1622
1615
|
} : {}),
|
|
1623
1616
|
applies: [
|
|
1624
1617
|
"position",
|
|
@@ -1628,31 +1621,31 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1628
1621
|
exclude: [...Q]
|
|
1629
1622
|
}),
|
|
1630
1623
|
button: Z({
|
|
1631
|
-
build: (e) => new
|
|
1624
|
+
build: (e) => new W(e ? l(e, U) : void 0),
|
|
1632
1625
|
applies: [
|
|
1633
1626
|
"position",
|
|
1634
1627
|
"scale",
|
|
1635
1628
|
"pivot"
|
|
1636
1629
|
],
|
|
1637
|
-
exclude:
|
|
1630
|
+
exclude: U
|
|
1638
1631
|
}),
|
|
1639
1632
|
flexContainer: Z({
|
|
1640
|
-
build: (e) => new
|
|
1633
|
+
build: (e) => new G(e),
|
|
1641
1634
|
applies: [
|
|
1642
1635
|
"position",
|
|
1643
1636
|
"scale",
|
|
1644
1637
|
"pivot"
|
|
1645
1638
|
],
|
|
1646
|
-
exclude:
|
|
1639
|
+
exclude: _e
|
|
1647
1640
|
}),
|
|
1648
1641
|
uiCanvas: Z({
|
|
1649
|
-
build: (e) => new
|
|
1642
|
+
build: (e) => new J(e ? l(e, q) : {}),
|
|
1650
1643
|
applies: [
|
|
1651
1644
|
"position",
|
|
1652
1645
|
"scale",
|
|
1653
1646
|
"pivot"
|
|
1654
1647
|
],
|
|
1655
|
-
exclude:
|
|
1648
|
+
exclude: q
|
|
1656
1649
|
}),
|
|
1657
1650
|
spine: Z({
|
|
1658
1651
|
build: (e) => {
|
|
@@ -1695,11 +1688,11 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1695
1688
|
scaleY: l
|
|
1696
1689
|
}, t), R(a, t), z(o, t), N(u, t), t;
|
|
1697
1690
|
},
|
|
1698
|
-
toaster: (e, t = {}) => new
|
|
1691
|
+
toaster: (e, t = {}) => new be(e, t),
|
|
1699
1692
|
entity: (e, t) => {
|
|
1700
|
-
let n =
|
|
1693
|
+
let n = Ee(e);
|
|
1701
1694
|
if (!n) {
|
|
1702
|
-
let t =
|
|
1695
|
+
let t = De();
|
|
1703
1696
|
throw Error(`[caper] Unknown entity id '${String(e)}'. Known: ${t.length > 0 ? t.map((e) => `'${e}'`).join(", ") : "(none — discovery may have failed)"}`);
|
|
1704
1697
|
}
|
|
1705
1698
|
let r = new n(t);
|
|
@@ -1718,9 +1711,9 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1718
1711
|
return r;
|
|
1719
1712
|
},
|
|
1720
1713
|
ui: (e, t) => {
|
|
1721
|
-
let n =
|
|
1714
|
+
let n = ke(e);
|
|
1722
1715
|
if (!n) {
|
|
1723
|
-
let t =
|
|
1716
|
+
let t = Ae();
|
|
1724
1717
|
throw Error(`[caper] Unknown ui id '${String(e)}'. Known: ${t.length > 0 ? t.map((e) => `'${e}'`).join(", ") : "(none — discovery may have failed)"}`);
|
|
1725
1718
|
}
|
|
1726
1719
|
let r = new n(t);
|
|
@@ -1739,8 +1732,8 @@ var Me = /* @__PURE__ */ i({ defaultFactoryMethods: () => $ }), Q = [
|
|
|
1739
1732
|
return r;
|
|
1740
1733
|
}
|
|
1741
1734
|
};
|
|
1742
|
-
|
|
1735
|
+
i($);
|
|
1743
1736
|
//#endregion
|
|
1744
|
-
export { A, I as C,
|
|
1737
|
+
export { A, I as C, de as D, N as E, ce as F, O as I, k as L, C as M, T as N, ue as O, E as P, z as S, F as T, H as _, J as a, P as b, be as c, G as d, _e as f, pe as g, U as h, De as i, w as j, j as k, ve as l, W as m, $ as n, q as o, ge as p, Ae as r, Se as s, Ne as t, K as u, V as v, L as w, R as x, B as y };
|
|
1745
1738
|
|
|
1746
|
-
//# sourceMappingURL=const-
|
|
1739
|
+
//# sourceMappingURL=const-BTDpIdRO.js.map
|