canvasengine 2.0.0-rc.3 → 2.0.0-rc.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/dist/engine/signal.d.ts.map +1 -1
- package/dist/hooks/useProps.d.ts.map +1 -1
- package/dist/index.global.js +8 -8
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +128 -111
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/signal.ts +24 -0
- package/src/hooks/useProps.ts +31 -1
package/dist/index.js
CHANGED
|
@@ -6209,7 +6209,7 @@ function _s(e) {
|
|
|
6209
6209
|
timeupdate: null,
|
|
6210
6210
|
volumechange: null,
|
|
6211
6211
|
waiting: null
|
|
6212
|
-
}, n = N(null), { play: r, loop: i, muted: a } =
|
|
6212
|
+
}, n = N(null), { play: r, loop: i, muted: a } = Xu(e)({
|
|
6213
6213
|
play: {
|
|
6214
6214
|
type: Boolean,
|
|
6215
6215
|
default: !0
|
|
@@ -6226,7 +6226,7 @@ function _s(e) {
|
|
|
6226
6226
|
return I(() => {
|
|
6227
6227
|
let e = n(), t = r();
|
|
6228
6228
|
e && t !== void 0 && (t ? e.play() : e.pause()), e && i() && (e.loop = i()), e && a() && (e.muted = a());
|
|
6229
|
-
}),
|
|
6229
|
+
}), Vu(() => () => {
|
|
6230
6230
|
for (let e in t) t[e] && n().removeEventListener(e, t[e]);
|
|
6231
6231
|
}), Z(gs, {
|
|
6232
6232
|
...e,
|
|
@@ -13548,7 +13548,7 @@ var Eu = (e) => V("DOMSprite", e), J = /* @__PURE__ */ function(e) {
|
|
|
13548
13548
|
return e.Normal = "normal", e.Hover = "hover", e.Pressed = "pressed", e.Disabled = "disabled", e;
|
|
13549
13549
|
}({});
|
|
13550
13550
|
function Du(e) {
|
|
13551
|
-
let t = N(J.Normal), n = N(!1), r = N(!1), { text: i, disabled: a, width: o, height: s, style: c, shape: l, controlName: u } =
|
|
13551
|
+
let t = N(J.Normal), n = N(!1), r = N(!1), { text: i, disabled: a, width: o, height: s, style: c, shape: l, controlName: u } = Xu(e)({
|
|
13552
13552
|
text: {
|
|
13553
13553
|
type: String,
|
|
13554
13554
|
default: ""
|
|
@@ -14103,15 +14103,24 @@ A("focusNavigation", class extends k {
|
|
|
14103
14103
|
return this.focusedElementSignal;
|
|
14104
14104
|
}
|
|
14105
14105
|
});
|
|
14106
|
-
var Au = (e) => V("Navigation", e), ju = Au, Mu = "__canvasEngineHotProps", Nu = "__canvasEngineUpdateHotProps", Pu = "__canvasEngineDefinePropsSignals", Fu = null, Iu = null, Lu = null, Ru = () => {
|
|
14106
|
+
var Au = (e) => V("Navigation", e), ju = Au, Mu = "__canvasEngineHotProps", Nu = "__canvasEngineUpdateHotProps", Pu = "__canvasEngineDefinePropsSignals", Fu = null, Iu = null, Lu = null, Ru = (e) => {
|
|
14107
|
+
let t = e?.__canvasEngineCallableSignalValue;
|
|
14108
|
+
return t ? t() : P(e) ? e() : e;
|
|
14109
|
+
}, zu = (e, t) => {
|
|
14110
|
+
let n = e[Pu], r = t[Pu];
|
|
14111
|
+
!n || !r || Object.entries(r).forEach(([e, t]) => {
|
|
14112
|
+
let r = n[e];
|
|
14113
|
+
r && typeof r.set == "function" && r.set(Ru(t));
|
|
14114
|
+
});
|
|
14115
|
+
}, Bu = () => {
|
|
14107
14116
|
let e = globalThis;
|
|
14108
14117
|
return e.__CANVAS_ENGINE_HOT_COMPONENTS__ ||= /* @__PURE__ */ new Map(), e.__CANVAS_ENGINE_HOT_COMPONENTS__;
|
|
14109
14118
|
};
|
|
14110
|
-
function
|
|
14119
|
+
function Vu(e) {
|
|
14111
14120
|
Lu?.(e);
|
|
14112
14121
|
}
|
|
14113
|
-
function
|
|
14114
|
-
|
|
14122
|
+
function Hu(e) {
|
|
14123
|
+
Vu((t) => {
|
|
14115
14124
|
let { context: n } = t.props, r;
|
|
14116
14125
|
return n.tick && (r = n.tick.observable.subscribe(({ value: n }) => {
|
|
14117
14126
|
z(t) || e(n, t);
|
|
@@ -14120,15 +14129,15 @@ function Bu(e) {
|
|
|
14120
14129
|
};
|
|
14121
14130
|
});
|
|
14122
14131
|
}
|
|
14123
|
-
function
|
|
14132
|
+
function Uu(e, t = {}, n) {
|
|
14124
14133
|
n[0] instanceof Array && (n = n[0]);
|
|
14125
14134
|
let r;
|
|
14126
|
-
return r = Array.isArray(e) ? e.length === 1 ? e[0] :
|
|
14135
|
+
return r = Array.isArray(e) ? e.length === 1 ? e[0] : Uu(eo, {}, e) : "tag" in e || e instanceof T ? e : Wu(e, {
|
|
14127
14136
|
...t,
|
|
14128
14137
|
children: n
|
|
14129
14138
|
}), r ||= {}, t?.dependencies && (r.props = r.props || {}, r.props.dependencies = t.dependencies), r;
|
|
14130
14139
|
}
|
|
14131
|
-
function
|
|
14140
|
+
function Wu(e, t) {
|
|
14132
14141
|
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = null;
|
|
14133
14142
|
Fu = (e) => {
|
|
14134
14143
|
n.add(e);
|
|
@@ -14153,8 +14162,8 @@ function Hu(e, t) {
|
|
|
14153
14162
|
o(e), e?.props?.isRoot && r.forEach((t) => t(e));
|
|
14154
14163
|
}) : a instanceof T ? (a.effectSubscriptions = [...Array.from(n), ...a.effectSubscriptions ?? []], a.effectMounts = [...Array.from(r), ...a.effectMounts ?? []], i && (a[Pu] = i)) : o(a), a;
|
|
14155
14164
|
}
|
|
14156
|
-
function
|
|
14157
|
-
let n =
|
|
14165
|
+
function Gu(e, t) {
|
|
14166
|
+
let n = Bu(), r = n.get(e);
|
|
14158
14167
|
return r ? (r.component = t, r.updates.next()) : (r = {
|
|
14159
14168
|
component: t,
|
|
14160
14169
|
updates: new ct()
|
|
@@ -14163,11 +14172,11 @@ function Uu(e, t) {
|
|
|
14163
14172
|
let i = !1, a = null, o = (e, t) => {
|
|
14164
14173
|
if (e.tag !== t.tag) return !1;
|
|
14165
14174
|
let n = { ...t.props };
|
|
14166
|
-
return e.props.context && (n.context = e.props.context), e.props.children && !t.props.children && (n.children = e.props.children), e.props = n, e.propObservables = t.propObservables, e.componentInstance.onUpdate?.(n), Object.entries(e.directives).forEach(([t, r]) => {
|
|
14175
|
+
return e.props.context && (n.context = e.props.context), e.props.children && !t.props.children && (n.children = e.props.children), zu(e, t), e.props = n, e.propObservables = t.propObservables, e.componentInstance.onUpdate?.(n), Object.entries(e.directives).forEach(([t, r]) => {
|
|
14167
14176
|
t in n && r.onUpdate?.(n[t], e);
|
|
14168
14177
|
}), t.propSubscriptions?.forEach((e) => e.unsubscribe()), t.effectSubscriptions?.forEach((e) => e.unsubscribe()), t.effectUnmounts?.forEach((e) => e?.()), !0;
|
|
14169
14178
|
}, s = (n = !1) => {
|
|
14170
|
-
let s =
|
|
14179
|
+
let s = Wu(r.component, t), c = (t) => {
|
|
14171
14180
|
if (!i) {
|
|
14172
14181
|
if (n && a && t && o(a, t)) {
|
|
14173
14182
|
e.next({ elements: [a] });
|
|
@@ -14190,12 +14199,12 @@ function Uu(e, t) {
|
|
|
14190
14199
|
}), r.wrapper;
|
|
14191
14200
|
}
|
|
14192
14201
|
function Z(e, t = {}, ...n) {
|
|
14193
|
-
return t?.dependencies ? !t.dependencies.some(vn) && t.dependencies.every((e) => P(e) ? e() !== void 0 : e !== void 0) ?
|
|
14202
|
+
return t?.dependencies ? !t.dependencies.some(vn) && t.dependencies.every((e) => P(e) ? e() !== void 0 : e !== void 0) ? Uu(e, t, n) : new T((r) => {
|
|
14194
14203
|
Wa(t.dependencies).then(() => {
|
|
14195
|
-
let i =
|
|
14204
|
+
let i = Uu(e, t, n);
|
|
14196
14205
|
r.next(i);
|
|
14197
14206
|
});
|
|
14198
|
-
}) :
|
|
14207
|
+
}) : Uu(e, t, n);
|
|
14199
14208
|
}
|
|
14200
14209
|
//#endregion
|
|
14201
14210
|
//#region src/hooks/useProps.ts
|
|
@@ -14208,37 +14217,45 @@ var Q = (e, t = {}) => {
|
|
|
14208
14217
|
}
|
|
14209
14218
|
for (let e in t) e in n || (n[e] = Ma(t[e]) ? N(t[e]) : t[e]);
|
|
14210
14219
|
return n;
|
|
14211
|
-
},
|
|
14220
|
+
}, Ku = "__canvasEngineCallableSignalValue", qu = (e) => {
|
|
14221
|
+
let t = N(e), n = (...e) => t()(...e);
|
|
14222
|
+
return n[Ku] = t, n.set = t.set, n.freeze = t.freeze, n.unfreeze = t.unfreeze, n.mutate = t.mutate, n.update = t.update, n.observable = t.observable, n._subject = t._subject, Object.defineProperty(n, "_isFrozen", {
|
|
14223
|
+
get: () => t._isFrozen,
|
|
14224
|
+
set: (e) => {
|
|
14225
|
+
t._isFrozen = e;
|
|
14226
|
+
}
|
|
14227
|
+
}), n;
|
|
14228
|
+
}, Ju = (e) => P(e) || kl(e) ? e : typeof e == "function" ? qu(e) : N(e), Yu = (e) => {
|
|
14212
14229
|
let t = {};
|
|
14213
|
-
for (let n in e) t[n] =
|
|
14230
|
+
for (let n in e) t[n] = Ju(e[n]);
|
|
14214
14231
|
return t;
|
|
14215
|
-
},
|
|
14232
|
+
}, Xu = (e) => (t) => {
|
|
14216
14233
|
let n = P(e) ? e() : e, r = {};
|
|
14217
14234
|
for (let e in t) {
|
|
14218
14235
|
let i = t[e], a = n[e], o;
|
|
14219
|
-
if (typeof i == "function")
|
|
14220
|
-
else if (Array.isArray(i))
|
|
14236
|
+
if (typeof i == "function") Zu(e, a, [i]), o = a;
|
|
14237
|
+
else if (Array.isArray(i)) Zu(e, a, i), o = a;
|
|
14221
14238
|
else if (i && typeof i == "object") {
|
|
14222
14239
|
if (i.required && a === void 0) throw Error(`Missing required prop: ${e}`);
|
|
14223
|
-
if (i.type &&
|
|
14240
|
+
if (i.type && Zu(e, a, Array.isArray(i.type) ? i.type : [i.type]), i.validator && !i.validator(a, n)) throw Error(`Invalid prop: custom validation failed for prop "${e}"`);
|
|
14224
14241
|
o = a === void 0 && "default" in i ? typeof i.default == "function" ? i.default(n) : i.default : a;
|
|
14225
14242
|
}
|
|
14226
|
-
r[e] =
|
|
14243
|
+
r[e] = Ju(o);
|
|
14227
14244
|
}
|
|
14228
14245
|
let i = {
|
|
14229
|
-
...
|
|
14246
|
+
...Yu(n),
|
|
14230
14247
|
...r
|
|
14231
14248
|
};
|
|
14232
14249
|
return Iu?.(i), i;
|
|
14233
14250
|
};
|
|
14234
|
-
function
|
|
14251
|
+
function Zu(e, t, n) {
|
|
14235
14252
|
if (t == null) return;
|
|
14236
14253
|
let r = P(t) ? t() : t;
|
|
14237
14254
|
if (!n.some((e) => e === Number ? typeof r == "number" : e === String ? typeof r == "string" : e === Boolean ? typeof r == "boolean" : e === Function ? typeof r == "function" : e === Object ? typeof r == "object" : e === Array ? Array.isArray(r) : e === null ? r === null : r instanceof e)) throw Error(`Invalid prop: type check failed for prop "${e}". Expected ${n.map((e) => e.name).join(" or ")}`);
|
|
14238
14255
|
}
|
|
14239
14256
|
//#endregion
|
|
14240
14257
|
//#region src/directives/ViewportFollow.ts
|
|
14241
|
-
var
|
|
14258
|
+
var Qu = class extends k {
|
|
14242
14259
|
onInit(e) {}
|
|
14243
14260
|
onMount(e) {
|
|
14244
14261
|
this.onUpdate(e.props.viewportFollow, e);
|
|
@@ -14269,10 +14286,10 @@ var Ju = class extends k {
|
|
|
14269
14286
|
t && n && n.plugins.remove("follow");
|
|
14270
14287
|
}
|
|
14271
14288
|
};
|
|
14272
|
-
A("viewportFollow",
|
|
14289
|
+
A("viewportFollow", Qu);
|
|
14273
14290
|
//#endregion
|
|
14274
14291
|
//#region src/directives/Sound.ts
|
|
14275
|
-
var
|
|
14292
|
+
var $u = [
|
|
14276
14293
|
"load",
|
|
14277
14294
|
"loaderror",
|
|
14278
14295
|
"playerror",
|
|
@@ -14286,7 +14303,7 @@ var Yu = [
|
|
|
14286
14303
|
"seek",
|
|
14287
14304
|
"fade",
|
|
14288
14305
|
"unlock"
|
|
14289
|
-
],
|
|
14306
|
+
], ed = class extends k {
|
|
14290
14307
|
constructor(...e) {
|
|
14291
14308
|
super(...e), this.sounds = [], this.eventsFn = [], this.maxVolume = 1, this.maxDistance = 100;
|
|
14292
14309
|
}
|
|
@@ -14303,7 +14320,7 @@ var Yu = [
|
|
|
14303
14320
|
loop: o,
|
|
14304
14321
|
volume: s
|
|
14305
14322
|
});
|
|
14306
|
-
for (let e of
|
|
14323
|
+
for (let e of $u) {
|
|
14307
14324
|
if (!r[e]) continue;
|
|
14308
14325
|
let n = r[e];
|
|
14309
14326
|
this.eventsFn.push(n), t.on(e, n);
|
|
@@ -14331,13 +14348,13 @@ var Yu = [
|
|
|
14331
14348
|
onDestroy() {
|
|
14332
14349
|
this.sounds.forEach((e) => {
|
|
14333
14350
|
e.stop();
|
|
14334
|
-
for (let t of
|
|
14351
|
+
for (let t of $u) {
|
|
14335
14352
|
let n = this.eventsFn.find((e) => e === this.eventsFn[t]);
|
|
14336
14353
|
n && e.off(t, n);
|
|
14337
14354
|
}
|
|
14338
14355
|
}), this.sounds = [], this.eventsFn = [], this.tickSubscription?.unsubscribe();
|
|
14339
14356
|
}
|
|
14340
|
-
},
|
|
14357
|
+
}, td = class extends k {
|
|
14341
14358
|
onMount(e) {
|
|
14342
14359
|
e.props.context.soundListenerPosition = e.propObservables?.soundListenerPosition;
|
|
14343
14360
|
}
|
|
@@ -14345,15 +14362,15 @@ var Yu = [
|
|
|
14345
14362
|
onUpdate(e) {}
|
|
14346
14363
|
onDestroy() {}
|
|
14347
14364
|
};
|
|
14348
|
-
A("sound",
|
|
14365
|
+
A("sound", ed), A("soundListenerPosition", td);
|
|
14349
14366
|
//#endregion
|
|
14350
14367
|
//#region src/hooks/addContext.ts
|
|
14351
|
-
var
|
|
14368
|
+
var nd = (e, t, n) => {
|
|
14352
14369
|
e.props.context = {
|
|
14353
14370
|
...e.props.context ?? {},
|
|
14354
14371
|
[t]: n
|
|
14355
14372
|
};
|
|
14356
|
-
},
|
|
14373
|
+
}, rd = class extends k {
|
|
14357
14374
|
constructor(...e) {
|
|
14358
14375
|
super(...e), this.elementRef = null;
|
|
14359
14376
|
}
|
|
@@ -14361,13 +14378,13 @@ var Qu = (e, t, n) => {
|
|
|
14361
14378
|
this.elementRef = e;
|
|
14362
14379
|
}
|
|
14363
14380
|
onMount(e) {
|
|
14364
|
-
|
|
14381
|
+
nd(e, "drop", e);
|
|
14365
14382
|
}
|
|
14366
14383
|
onUpdate() {}
|
|
14367
14384
|
onDestroy() {
|
|
14368
14385
|
this.elementRef = null;
|
|
14369
14386
|
}
|
|
14370
|
-
},
|
|
14387
|
+
}, id = class extends k {
|
|
14371
14388
|
constructor(...e) {
|
|
14372
14389
|
super(...e), this.elementRef = null, this.stageRef = null, this.offsetInParent = new y(), this.isDragging = !1, this.viewport = null, this.animationFrameId = null, this.lastPointerPosition = new y(), this.pressedKeys = /* @__PURE__ */ new Set(), this.pointerIsDown = !1, this.onDragMoveHandler = () => {}, this.onDragEndHandler = () => {}, this.onDragStartHandler = () => {}, this.onKeyDownHandler = () => {}, this.onKeyUpHandler = () => {}, this.subscriptions = [];
|
|
14373
14390
|
}
|
|
@@ -14462,10 +14479,10 @@ var Qu = (e, t, n) => {
|
|
|
14462
14479
|
e && e.off("pointerdown", this.onDragStartHandler), this.stageRef && (this.stageRef.off("pointermove", this.onDragMoveHandler), this.stageRef.off("pointerup", this.onDragEndHandler), this.stageRef.off("pointerupoutside", this.onDragEndHandler)), window.removeEventListener("keydown", this.onKeyDownHandler), window.removeEventListener("keyup", this.onKeyUpHandler), this.stageRef = null, this.viewport = null, this.pressedKeys.clear(), this.pointerIsDown = !1;
|
|
14463
14480
|
}
|
|
14464
14481
|
};
|
|
14465
|
-
A("drag",
|
|
14482
|
+
A("drag", id), A("drop", rd);
|
|
14466
14483
|
//#endregion
|
|
14467
14484
|
//#region src/directives/Transition.ts
|
|
14468
|
-
var
|
|
14485
|
+
var ad = class extends k {
|
|
14469
14486
|
onInit(e) {}
|
|
14470
14487
|
onMount(e) {
|
|
14471
14488
|
let { image: t } = e.props.transition, n = new x(C.from(t));
|
|
@@ -14485,10 +14502,10 @@ var td = class extends k {
|
|
|
14485
14502
|
onUpdate(e) {}
|
|
14486
14503
|
onDestroy() {}
|
|
14487
14504
|
};
|
|
14488
|
-
A("transition",
|
|
14505
|
+
A("transition", ad);
|
|
14489
14506
|
//#endregion
|
|
14490
14507
|
//#region src/directives/Shake.ts
|
|
14491
|
-
var
|
|
14508
|
+
var od = class extends k {
|
|
14492
14509
|
constructor(...e) {
|
|
14493
14510
|
super(...e), this.elementRef = null, this.originalPosition = new y(), this.progressSignal = null, this.shakeSubscription = null, this.positionEffect = null, this.currentShakeConfig = null;
|
|
14494
14511
|
}
|
|
@@ -14547,10 +14564,10 @@ var nd = class extends k {
|
|
|
14547
14564
|
this.shakeSubscription &&= (this.shakeSubscription.unsubscribe(), null), this.elementRef = null;
|
|
14548
14565
|
}
|
|
14549
14566
|
};
|
|
14550
|
-
A("shake",
|
|
14567
|
+
A("shake", od);
|
|
14551
14568
|
//#endregion
|
|
14552
14569
|
//#region src/directives/Flash.ts
|
|
14553
|
-
var
|
|
14570
|
+
var sd = class extends k {
|
|
14554
14571
|
constructor(...e) {
|
|
14555
14572
|
super(...e), this.elementRef = null, this.progressSignal = null, this.flashSubscription = null, this.alphaEffect = null, this.tintEffect = null, this.originalAlpha = 1, this.originalTint = 16777215, this.currentFlashConfig = null;
|
|
14556
14573
|
}
|
|
@@ -14635,10 +14652,10 @@ var rd = class extends k {
|
|
|
14635
14652
|
this.flashSubscription &&= null, this.elementRef = null;
|
|
14636
14653
|
}
|
|
14637
14654
|
};
|
|
14638
|
-
A("flash",
|
|
14655
|
+
A("flash", sd);
|
|
14639
14656
|
//#endregion
|
|
14640
14657
|
//#region src/directives/FogVisibility.ts
|
|
14641
|
-
var
|
|
14658
|
+
var cd = (e, t, n) => Math.max(t, Math.min(n, e)), ld = class extends k {
|
|
14642
14659
|
constructor(...e) {
|
|
14643
14660
|
super(...e), this.elementRef = null, this.tickSubscription = null, this.sampleAccumulatorMs = 0, this.managesAlpha = !1;
|
|
14644
14661
|
}
|
|
@@ -14667,7 +14684,7 @@ var id = (e, t, n) => Math.max(t, Math.min(n, e)), ad = class extends k {
|
|
|
14667
14684
|
return e == null ? t : P(e) ? e() ?? t : e;
|
|
14668
14685
|
}
|
|
14669
14686
|
readOptions() {
|
|
14670
|
-
let e = this.elementRef?.props?.fogVisibility, t = e?.value ?? e ?? {}, n = this.resolveSignalValue(t.controller, null), r = this.resolveSignalValue(t.mode, "visible"), i =
|
|
14687
|
+
let e = this.elementRef?.props?.fogVisibility, t = e?.value ?? e ?? {}, n = this.resolveSignalValue(t.controller, null), r = this.resolveSignalValue(t.mode, "visible"), i = cd(Number(this.resolveSignalValue(t.threshold, .65)), 0, 1), a = this.resolveSignalValue(t.hideAs, "visible"), o = cd(Number(this.resolveSignalValue(t.hiddenAlpha, 0)), 0, 1), s = cd(Number(this.resolveSignalValue(t.sampleHz, 30)), 1, 240), c = t.point ? this.resolveSignalValue(t.point, void 0) : void 0;
|
|
14671
14688
|
return {
|
|
14672
14689
|
controller: n && typeof n == "object" ? n : null,
|
|
14673
14690
|
mode: r,
|
|
@@ -14684,7 +14701,7 @@ var id = (e, t, n) => Math.max(t, Math.min(n, e)), ad = class extends k {
|
|
|
14684
14701
|
}
|
|
14685
14702
|
readBaseAlpha() {
|
|
14686
14703
|
let e = this.elementRef?.propObservables?.alpha ?? this.elementRef?.props?.alpha, t = Number(this.resolveSignalValue(e, 1));
|
|
14687
|
-
return Number.isFinite(t) ?
|
|
14704
|
+
return Number.isFinite(t) ? cd(t, 0, 1) : 1;
|
|
14688
14705
|
}
|
|
14689
14706
|
samplePoint(e) {
|
|
14690
14707
|
if (e.point && typeof e.point == "object") {
|
|
@@ -14728,15 +14745,15 @@ var id = (e, t, n) => Math.max(t, Math.min(n, e)), ad = class extends k {
|
|
|
14728
14745
|
t.visible = r && s, this.managesAlpha &&= (t.alpha = i, !1);
|
|
14729
14746
|
}
|
|
14730
14747
|
};
|
|
14731
|
-
A("fogVisibility",
|
|
14748
|
+
A("fogVisibility", ld);
|
|
14732
14749
|
//#endregion
|
|
14733
14750
|
//#region ../../node_modules/.pnpm/pixi-filters@6.1.5_pixi.js@8.9.2/node_modules/pixi-filters/lib/defaults/default2.mjs
|
|
14734
|
-
var
|
|
14751
|
+
var ud = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n", dd = "struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n };\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n \n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n );\n}", fd = "precision highp float;\nin vec2 vTextureCoord;\nout vec4 finalColor;\n\nuniform sampler2D uTexture;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\n\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = ${ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vTextureCoord.x + uThickness.x * cos(angle);\n displacedPos.y = vTextureCoord.y + uThickness.y * sin(angle);\n displacedColor = texture(uTexture, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture(uTexture, vTextureCoord);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vTextureCoord.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n finalColor = contentColor + outlineColor;\n}\n", pd = "struct OutlineUniforms {\n uThickness:vec2<f32>,\n uColor:vec3<f32>,\n uAlpha:f32,\n uAngleStep:f32,\n uKnockout:f32,\n};\n\nstruct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n\n@group(0) @binding(1) var uTexture: texture_2d<f32>; \n@group(0) @binding(2) var uSampler: sampler;\n@group(1) @binding(0) var<uniform> outlineUniforms : OutlineUniforms;\n\n@fragment\nfn mainFragment(\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n) -> @location(0) vec4<f32> {\n let sourceColor: vec4<f32> = textureSample(uTexture, uSampler, uv);\n let contentColor: vec4<f32> = sourceColor * (1. - outlineUniforms.uKnockout);\n \n let outlineAlpha: f32 = outlineUniforms.uAlpha * outlineMaxAlphaAtPos(uv) * (1. - sourceColor.a);\n let outlineColor: vec4<f32> = vec4<f32>(vec3<f32>(outlineUniforms.uColor) * outlineAlpha, outlineAlpha);\n \n return contentColor + outlineColor;\n}\n\nfn outlineMaxAlphaAtPos(uv: vec2<f32>) -> f32 {\n let thickness = outlineUniforms.uThickness;\n\n if (thickness.x == 0. || thickness.y == 0.) {\n return 0.;\n }\n \n let angleStep = outlineUniforms.uAngleStep;\n\n var displacedColor: vec4<f32>;\n var displacedPos: vec2<f32>;\n\n var maxAlpha: f32 = 0.;\n var displaced: vec2<f32>;\n var curColor: vec4<f32>;\n\n for (var angle = 0.; angle <= DOUBLE_PI; angle += angleStep)\n {\n displaced.x = uv.x + thickness.x * cos(angle);\n displaced.y = uv.y + thickness.y * sin(angle);\n curColor = textureSample(uTexture, uSampler, clamp(displaced, gfu.uInputClamp.xy, gfu.uInputClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n\n return maxAlpha;\n}\n\nconst DOUBLE_PI: f32 = 3.14159265358979323846264 * 2.;", md = Object.defineProperty, hd = (e, t, n) => t in e ? md(e, t, {
|
|
14735
14752
|
enumerable: !0,
|
|
14736
14753
|
configurable: !0,
|
|
14737
14754
|
writable: !0,
|
|
14738
14755
|
value: n
|
|
14739
|
-
}) : e[t] = n,
|
|
14756
|
+
}) : e[t] = n, gd = (e, t, n) => (hd(e, typeof t == "symbol" ? t : t + "", n), n), _d = class e extends l {
|
|
14740
14757
|
constructor(...t) {
|
|
14741
14758
|
let n = t[0] ?? {};
|
|
14742
14759
|
typeof n == "number" && (re("6.0.0", "OutlineFilter constructor params are now options object. See params: { thickness, color, quality, alpha, knockout }"), n = { thickness: n }, t[1] !== void 0 && (n.color = t[1]), t[2] !== void 0 && (n.quality = t[2]), t[3] !== void 0 && (n.alpha = t[3]), t[4] !== void 0 && (n.knockout = t[4])), n = {
|
|
@@ -14745,16 +14762,16 @@ var od = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize
|
|
|
14745
14762
|
};
|
|
14746
14763
|
let r = n.quality ?? .1, a = f.from({
|
|
14747
14764
|
vertex: {
|
|
14748
|
-
source:
|
|
14765
|
+
source: dd,
|
|
14749
14766
|
entryPoint: "mainVertex"
|
|
14750
14767
|
},
|
|
14751
14768
|
fragment: {
|
|
14752
|
-
source:
|
|
14769
|
+
source: pd,
|
|
14753
14770
|
entryPoint: "mainFragment"
|
|
14754
14771
|
}
|
|
14755
14772
|
}), o = d.from({
|
|
14756
|
-
vertex:
|
|
14757
|
-
fragment:
|
|
14773
|
+
vertex: ud,
|
|
14774
|
+
fragment: fd.replace(/\$\{ANGLE_STEP\}/, e.getAngleStep(r).toFixed(7)),
|
|
14758
14775
|
name: "outline-filter"
|
|
14759
14776
|
});
|
|
14760
14777
|
super({
|
|
@@ -14782,7 +14799,7 @@ var od = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize
|
|
|
14782
14799
|
type: "f32"
|
|
14783
14800
|
}
|
|
14784
14801
|
} }
|
|
14785
|
-
}),
|
|
14802
|
+
}), gd(this, "uniforms"), gd(this, "_thickness"), gd(this, "_quality"), gd(this, "_color"), this.uniforms = this.resources.outlineUniforms.uniforms, this.uniforms.uAngleStep = e.getAngleStep(r), this._color = new i(), this.color = n.color ?? 0, Object.assign(this, n);
|
|
14786
14803
|
}
|
|
14787
14804
|
apply(e, t, n, r) {
|
|
14788
14805
|
this.uniforms.uThickness[0] = this.thickness / t.source.width, this.uniforms.uThickness[1] = this.thickness / t.source.height, e.applyFilter(this, t, n, r);
|
|
@@ -14823,25 +14840,25 @@ var od = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize
|
|
|
14823
14840
|
this.uniforms.uKnockout = +!!e;
|
|
14824
14841
|
}
|
|
14825
14842
|
};
|
|
14826
|
-
|
|
14843
|
+
gd(_d, "DEFAULT_OPTIONS", {
|
|
14827
14844
|
thickness: 1,
|
|
14828
14845
|
color: 0,
|
|
14829
14846
|
alpha: 1,
|
|
14830
14847
|
quality: .1,
|
|
14831
14848
|
knockout: !1
|
|
14832
|
-
}),
|
|
14833
|
-
var
|
|
14849
|
+
}), gd(_d, "MIN_SAMPLES", 1), gd(_d, "MAX_SAMPLES", 100);
|
|
14850
|
+
var vd = _d, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, yd = (e) => {
|
|
14834
14851
|
if (e !== void 0) return P(e) ? e() : e;
|
|
14835
|
-
},
|
|
14852
|
+
}, bd = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], xd = (e) => {
|
|
14836
14853
|
let t = e.filters;
|
|
14837
14854
|
return t ? Array.isArray(t) ? [...t] : [t] : [];
|
|
14838
|
-
},
|
|
14855
|
+
}, Sd = (e, t) => {
|
|
14839
14856
|
e.filters = t.length > 0 ? t : [];
|
|
14840
|
-
},
|
|
14841
|
-
let t =
|
|
14857
|
+
}, Cd = (e) => {
|
|
14858
|
+
let t = yd(e);
|
|
14842
14859
|
return L(t) ? t.componentInstance ?? null : t instanceof a || t && typeof t == "object" && typeof t.getBounds == "function" ? t : null;
|
|
14843
|
-
},
|
|
14844
|
-
let n =
|
|
14860
|
+
}, wd = (e) => new b(e?.x ?? 0, e?.y ?? 0, e?.width ?? 0, e?.height ?? 0), Td = (e, t = "bounds") => {
|
|
14861
|
+
let n = wd(typeof e.getBounds == "function" ? e.getBounds() : {
|
|
14845
14862
|
x: e.x ?? 0,
|
|
14846
14863
|
y: e.y ?? 0,
|
|
14847
14864
|
width: e.width ?? 0,
|
|
@@ -14850,21 +14867,21 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
|
|
|
14850
14867
|
if (t !== "hitbox" || !e.hitbox) return n;
|
|
14851
14868
|
let r = e.hitbox;
|
|
14852
14869
|
return new b(n.x + Math.max(0, (n.width - r.w) / 2), n.y + Math.max(0, n.height - r.h), r.w, r.h);
|
|
14853
|
-
},
|
|
14870
|
+
}, Ed = (e, t) => {
|
|
14854
14871
|
let n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height), o = i - n, s = a - r;
|
|
14855
14872
|
return o <= 0 || s <= 0 ? null : new b(n, r, o, s);
|
|
14856
|
-
},
|
|
14873
|
+
}, Dd = (e, t) => {
|
|
14857
14874
|
e.rect(t.x, t.y, t.width, t.height), e.fill(16777215);
|
|
14858
|
-
},
|
|
14875
|
+
}, Od = (e, t) => {
|
|
14859
14876
|
t.parent !== e.parent && (t.parent && t.parent.removeChild(t), e.parent?.addChild(t));
|
|
14860
|
-
},
|
|
14877
|
+
}, kd = (e, t, n = !1) => {
|
|
14861
14878
|
e && (typeof e.setMask == "function" ? (t ?? (e.mask = null), e.setMask({
|
|
14862
14879
|
mask: t ?? null,
|
|
14863
14880
|
inverse: n
|
|
14864
14881
|
})) : e.mask = t ?? null);
|
|
14865
|
-
},
|
|
14866
|
-
|
|
14867
|
-
},
|
|
14882
|
+
}, Ad = (e, t) => {
|
|
14883
|
+
kd(e, t ?? null);
|
|
14884
|
+
}, jd = (e, t) => {
|
|
14868
14885
|
let n = {
|
|
14869
14886
|
x: t.x ?? t.position?.x ?? 0,
|
|
14870
14887
|
y: t.y ?? t.position?.y ?? 0
|
|
@@ -14879,11 +14896,11 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
|
|
|
14879
14896
|
x: 0,
|
|
14880
14897
|
y: 0
|
|
14881
14898
|
}), e.rotation = t.rotation ?? 0;
|
|
14882
|
-
},
|
|
14883
|
-
|
|
14899
|
+
}, Md = (e, t, n) => {
|
|
14900
|
+
jd(e, t);
|
|
14884
14901
|
let r = t.texture?.orig?.width ?? t.texture?.width ?? t.width ?? n.width, i = t.texture?.orig?.height ?? t.texture?.height ?? t.height ?? n.height, a = t.width || r || 1, o = t.height || i || 1, s = t.anchor?.x ?? 0, c = t.anchor?.y ?? 0;
|
|
14885
|
-
|
|
14886
|
-
},
|
|
14902
|
+
Dd(e, new b(-s * r + n.x * r / a, -c * i + n.y * i / o, n.width * r / a, n.height * i / o));
|
|
14903
|
+
}, Nd = class extends k {
|
|
14887
14904
|
constructor(...e) {
|
|
14888
14905
|
super(...e), this.elementRef = null, this.filter = null, this.updateEffect = null;
|
|
14889
14906
|
}
|
|
@@ -14902,7 +14919,7 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
|
|
|
14902
14919
|
this.removeFilter(), this.updateEffect?.subscription.unsubscribe(), this.updateEffect = null, this.elementRef = null;
|
|
14903
14920
|
}
|
|
14904
14921
|
get props() {
|
|
14905
|
-
let e =
|
|
14922
|
+
let e = yd(this.elementRef?.props.outline);
|
|
14906
14923
|
return e === !0 ? {} : e === !1 ? { enabled: !1 } : e ?? {};
|
|
14907
14924
|
}
|
|
14908
14925
|
apply() {
|
|
@@ -14913,18 +14930,18 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
|
|
|
14913
14930
|
this.removeFilter();
|
|
14914
14931
|
return;
|
|
14915
14932
|
}
|
|
14916
|
-
this.filter || (this.filter = new
|
|
14933
|
+
this.filter || (this.filter = new vd({
|
|
14917
14934
|
thickness: $(t.thickness, 1),
|
|
14918
14935
|
color: $(t.color, 16777215),
|
|
14919
14936
|
quality: $(t.quality, .1),
|
|
14920
14937
|
alpha: $(t.alpha, 1)
|
|
14921
|
-
}),
|
|
14938
|
+
}), Sd(e, [...xd(e), this.filter])), this.filter.thickness = $(t.thickness, 1), this.filter.color = $(t.color, 16777215), this.filter.quality = $(t.quality, .1), this.filter.alpha = $(t.alpha, 1);
|
|
14922
14939
|
}
|
|
14923
14940
|
removeFilter() {
|
|
14924
14941
|
let e = this.elementRef?.componentInstance;
|
|
14925
|
-
!e || !this.filter || (
|
|
14942
|
+
!e || !this.filter || (Sd(e, xd(e).filter((e) => e !== this.filter)), this.filter = null);
|
|
14926
14943
|
}
|
|
14927
|
-
},
|
|
14944
|
+
}, Pd = class extends k {
|
|
14928
14945
|
constructor(...e) {
|
|
14929
14946
|
super(...e), this.elementRef = null, this.maskGraphics = null, this.previousMask = null, this.tickSubscription = null, this.updateEffect = null;
|
|
14930
14947
|
}
|
|
@@ -14943,28 +14960,28 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
|
|
|
14943
14960
|
}
|
|
14944
14961
|
onDestroy() {
|
|
14945
14962
|
let e = this.elementRef?.componentInstance;
|
|
14946
|
-
e && this.maskGraphics &&
|
|
14963
|
+
e && this.maskGraphics && Ad(e, this.previousMask), this.maskGraphics?.parent && this.maskGraphics.parent.removeChild(this.maskGraphics), this.maskGraphics?.destroy(), this.maskGraphics = null, this.previousMask = null, this.tickSubscription?.unsubscribe(), this.tickSubscription = null, this.updateEffect?.subscription.unsubscribe(), this.updateEffect = null, this.elementRef = null;
|
|
14947
14964
|
}
|
|
14948
14965
|
get props() {
|
|
14949
|
-
return
|
|
14966
|
+
return yd(this.elementRef?.props.clip) ?? null;
|
|
14950
14967
|
}
|
|
14951
14968
|
apply() {
|
|
14952
14969
|
let e = this.elementRef?.componentInstance, t = this.props;
|
|
14953
14970
|
if (!e || !e.parent || !t?.shape) return;
|
|
14954
14971
|
if (!$(t.enabled, !0)) {
|
|
14955
|
-
this.maskGraphics && (
|
|
14972
|
+
this.maskGraphics && (Ad(e, this.previousMask), this.maskGraphics.clear());
|
|
14956
14973
|
return;
|
|
14957
14974
|
}
|
|
14958
|
-
this.maskGraphics || (this.maskGraphics = new p(), this.previousMask = e.mask ?? null),
|
|
14975
|
+
this.maskGraphics || (this.maskGraphics = new p(), this.previousMask = e.mask ?? null), Od(e, this.maskGraphics), this.maskGraphics.clear();
|
|
14959
14976
|
let n = t.shape;
|
|
14960
14977
|
if (n.type === "rect") {
|
|
14961
14978
|
let t = new b($(n.x, 0), $(n.y, 0), $(n.width, 0), $(n.height, 0));
|
|
14962
|
-
|
|
14979
|
+
Md(this.maskGraphics, e, t);
|
|
14963
14980
|
}
|
|
14964
14981
|
let r = $(t.mode, "keep") === "hide";
|
|
14965
|
-
|
|
14982
|
+
kd(e, this.maskGraphics, r);
|
|
14966
14983
|
}
|
|
14967
|
-
},
|
|
14984
|
+
}, Fd = class extends k {
|
|
14968
14985
|
constructor(...e) {
|
|
14969
14986
|
super(...e), this.elementRef = null, this.maskGraphics = null, this.ghostSprite = null, this.tickSubscription = null, this.updateEffect = null;
|
|
14970
14987
|
}
|
|
@@ -14982,10 +14999,10 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
|
|
|
14982
14999
|
this.apply();
|
|
14983
15000
|
}
|
|
14984
15001
|
onDestroy() {
|
|
14985
|
-
|
|
15002
|
+
Ad(this.ghostSprite, null), this.ghostSprite?.parent && this.ghostSprite.parent.removeChild(this.ghostSprite), this.ghostSprite?.destroy(), this.maskGraphics?.parent && this.maskGraphics.parent.removeChild(this.maskGraphics), this.maskGraphics?.destroy(), this.maskGraphics = null, this.ghostSprite = null, this.tickSubscription?.unsubscribe(), this.tickSubscription = null, this.updateEffect?.subscription.unsubscribe(), this.updateEffect = null, this.elementRef = null;
|
|
14986
15003
|
}
|
|
14987
15004
|
get props() {
|
|
14988
|
-
return
|
|
15005
|
+
return yd(this.elementRef?.props.occlusion) ?? null;
|
|
14989
15006
|
}
|
|
14990
15007
|
apply() {
|
|
14991
15008
|
let e = this.elementRef?.componentInstance, t = this.props;
|
|
@@ -14998,13 +15015,13 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
|
|
|
14998
15015
|
if (!e.texture) return;
|
|
14999
15016
|
this.maskGraphics = new p(), this.ghostSprite = new x(e.texture);
|
|
15000
15017
|
}
|
|
15001
|
-
|
|
15002
|
-
let n = $(t.bounds, "bounds"), r = $(t.padding, 0), i =
|
|
15003
|
-
for (let s of
|
|
15004
|
-
let t =
|
|
15018
|
+
Od(e, this.maskGraphics), this.ghostSprite.parent !== e.parent && (this.ghostSprite.parent && this.ghostSprite.parent.removeChild(this.ghostSprite), e.parent?.addChild(this.ghostSprite)), this.maskGraphics.clear(), this.ghostSprite.texture = e.texture, this.ghostSprite.width = e.width, this.ghostSprite.height = e.height, this.ghostSprite.visible = !1, this.ghostSprite.alpha = $(t.alpha, .35), jd(this.ghostSprite, e), e.anchor && this.ghostSprite.anchor && this.ghostSprite.anchor.copyFrom(e.anchor);
|
|
15019
|
+
let n = $(t.bounds, "bounds"), r = $(t.padding, 0), i = Td(e, n), a = !1, o = e.zIndex ?? 0;
|
|
15020
|
+
for (let s of bd(yd(t.obstacles))) {
|
|
15021
|
+
let t = Cd(s);
|
|
15005
15022
|
if (!t) continue;
|
|
15006
15023
|
o = Math.max(o, t.zIndex ?? 0);
|
|
15007
|
-
let c =
|
|
15024
|
+
let c = Ed(i, Td(t, n));
|
|
15008
15025
|
if (!c) continue;
|
|
15009
15026
|
a = !0;
|
|
15010
15027
|
let l = e.parent?.toLocal?.({
|
|
@@ -15014,15 +15031,15 @@ var md = pd, $ = (e, t) => e === void 0 ? t : P(e) ? e() : e, hd = (e) => {
|
|
|
15014
15031
|
x: c.x - r,
|
|
15015
15032
|
y: c.y - r
|
|
15016
15033
|
};
|
|
15017
|
-
|
|
15034
|
+
Dd(this.maskGraphics, new b(l.x, l.y, c.width + r * 2, c.height + r * 2));
|
|
15018
15035
|
}
|
|
15019
|
-
a ? (this.ghostSprite.visible = !0, this.ghostSprite.zIndex = $(t.zIndex, o + 1),
|
|
15036
|
+
a ? (this.ghostSprite.visible = !0, this.ghostSprite.zIndex = $(t.zIndex, o + 1), kd(this.ghostSprite, this.maskGraphics, !1)) : (this.ghostSprite.visible = !1, Ad(this.ghostSprite, null));
|
|
15020
15037
|
}
|
|
15021
15038
|
};
|
|
15022
|
-
A("outline",
|
|
15039
|
+
A("outline", Nd), A("clip", Pd), A("occlusion", Fd);
|
|
15023
15040
|
//#endregion
|
|
15024
15041
|
//#region src/engine/bootstrap.ts
|
|
15025
|
-
var
|
|
15042
|
+
var Id = async (e, n, r) => {
|
|
15026
15043
|
let { components: i, autoRegister: a, enableLayout: o, ...s } = r ?? {};
|
|
15027
15044
|
o !== !1 && await import("./dist-BOOc43Qm.js"), i ? (a !== !1 && Ha(), Object.entries(i).forEach(([e, t]) => {
|
|
15028
15045
|
R(e, t);
|
|
@@ -15067,13 +15084,13 @@ var Md = async (e, n, r) => {
|
|
|
15067
15084
|
};
|
|
15068
15085
|
//#endregion
|
|
15069
15086
|
//#region src/hooks/useFocus.ts
|
|
15070
|
-
function
|
|
15087
|
+
function Ld(e) {
|
|
15071
15088
|
return X.getCurrentIndexSignal(e);
|
|
15072
15089
|
}
|
|
15073
|
-
function
|
|
15090
|
+
function Rd(e) {
|
|
15074
15091
|
return X.getFocusedElementSignal(e);
|
|
15075
15092
|
}
|
|
15076
|
-
function
|
|
15093
|
+
function zd(e, t) {
|
|
15077
15094
|
let n = X.getCurrentIndexSignal(e), r = X.getFocusedElementSignal(e);
|
|
15078
15095
|
if (!n || !r) return console.warn(`FocusContainer with id "${e}" not found`), () => {};
|
|
15079
15096
|
let i = I(() => {
|
|
@@ -15085,7 +15102,7 @@ function Fd(e, t) {
|
|
|
15085
15102
|
}
|
|
15086
15103
|
//#endregion
|
|
15087
15104
|
//#region src/utils/Ease.ts
|
|
15088
|
-
var
|
|
15105
|
+
var Bd = {
|
|
15089
15106
|
linear: Mi,
|
|
15090
15107
|
easeIn: Ni,
|
|
15091
15108
|
easeInOut: Fi,
|
|
@@ -15100,7 +15117,7 @@ var Id = {
|
|
|
15100
15117
|
bounceIn: qi,
|
|
15101
15118
|
bounceInOut: Ji,
|
|
15102
15119
|
bounceOut: Ki
|
|
15103
|
-
},
|
|
15120
|
+
}, Vd = class {
|
|
15104
15121
|
constructor(e, t, n, r, i, a, s = 0) {
|
|
15105
15122
|
this.x0 = e, this.y0 = t, this.x1 = n, this.y1 = r, this.x2 = i, this.y2 = a, this.focalPoint = s, this.gradient = null, this.texture = null, this.size = 600, this.size = e;
|
|
15106
15123
|
let c = this.size * .5;
|
|
@@ -15128,7 +15145,7 @@ var Id = {
|
|
|
15128
15145
|
};
|
|
15129
15146
|
//#endregion
|
|
15130
15147
|
//#region src/utils/tabindex.ts
|
|
15131
|
-
function
|
|
15148
|
+
function Hd(e) {
|
|
15132
15149
|
if ("count" in e) {
|
|
15133
15150
|
let t = e.count();
|
|
15134
15151
|
if (!Number.isFinite(t) || t <= 0) return null;
|
|
@@ -15146,7 +15163,7 @@ function Rd(e) {
|
|
|
15146
15163
|
size: n - t + 1
|
|
15147
15164
|
};
|
|
15148
15165
|
}
|
|
15149
|
-
function
|
|
15166
|
+
function Ud(e, t, n, r) {
|
|
15150
15167
|
if (r === "clamp") return Math.min(n.max, Math.max(n.min, e));
|
|
15151
15168
|
if (r === "none") return e < n.min || e > n.max ? t : e;
|
|
15152
15169
|
let i = n.size;
|
|
@@ -15154,11 +15171,11 @@ function zd(e, t, n, r) {
|
|
|
15154
15171
|
let a = ((e - n.min) % i + i) % i;
|
|
15155
15172
|
return n.min + a;
|
|
15156
15173
|
}
|
|
15157
|
-
function
|
|
15174
|
+
function Wd(e, t, n = "wrap") {
|
|
15158
15175
|
let r = (r) => {
|
|
15159
|
-
let i = e(), a =
|
|
15176
|
+
let i = e(), a = Hd(t);
|
|
15160
15177
|
if (!a) return;
|
|
15161
|
-
let o =
|
|
15178
|
+
let o = Ud(r, i, a, n);
|
|
15162
15179
|
o !== i && e.set(o);
|
|
15163
15180
|
};
|
|
15164
15181
|
return {
|
|
@@ -15167,7 +15184,7 @@ function Bd(e, t, n = "wrap") {
|
|
|
15167
15184
|
};
|
|
15168
15185
|
}
|
|
15169
15186
|
//#endregion
|
|
15170
|
-
var
|
|
15171
|
-
export { ir as ArraySubject, Du as Button, J as ButtonState, Qa as Canvas, ao as Circle,
|
|
15187
|
+
var Gd = fs.Howler;
|
|
15188
|
+
export { ir as ArraySubject, Du as Button, J as ButtonState, Qa as Canvas, ao as Circle, Pd as Clip, eo as Container, jn as ControlsBase, Ja as ControlsDirective, wu as DOMContainer, Cu as DOMElement, Eu as DOMSprite, U as DisplayObject, id as Drag, rd as Drop, Xa as EVENTS, Bd as Easing, oo as Ellipse, sd as Flash, Au as FocusContainer, ku as FocusManager, ld as FogVisibility, Qn as GamepadControls, to as Graphics, fs as Howl, Gd as Howler, Mn as Input, Ou as Joystick, er as JoystickControls, Fn as KeyboardControls, fo as Mesh, ju as Navigation, bu as NineSliceSprite, or as ObjectSubject, Fd as Occlusion, Nd as Outline, ds as ParticlesEmitter, Vd as RadialGradient, io as Rect, po as Scene, Ya as Scheduler, od as Shake, ed as Sound, gs as Sprite, co as Svg, Nl as Text, Pl as TilingSprite, ad as Transition, so as Triangle, mn as Utils, _s as Video, yu as Viewport, Qu as ViewportFollow, Da as animatedSequence, Ea as animatedSignal, Id as bootstrapCanvas, Ua as checkDependencies, F as computed, qa as cond, V as createComponent, Gu as createHotComponent, Wd as createTabindexNavigator, Iu as currentDefinePropsTracker, Fu as currentSubscriptionsTracker, B as destroyElement, I as effect, X as focusManager, Z as h, Ta as isAnimatedSignal, ar as isArraySubject, lr as isComputed, L as isElement, z as isElementFrozen, sr as isObjectSubject, Kt as isObservable, Ma as isPrimitive, P as isSignal, kl as isTrigger, ur as linkedSignal, Ka as loop, Vu as mount, Lu as mountTracker, jl as on, Ha as registerAllComponents, R as registerComponent, N as signal, Hu as tick, Al as trigger, dr as untracked, Xu as useDefineProps, zd as useFocusChange, Ld as useFocusIndex, Rd as useFocusedElement, Q as useProps, Wa as waitForDependencies };
|
|
15172
15189
|
|
|
15173
15190
|
//# sourceMappingURL=index.js.map
|