modern-canvas 0.20.1 → 0.21.1
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/index.js +288 -291
- package/dist/scene/2d/element/Element2DChart.d.ts +16 -17
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -6307,17 +6307,39 @@ var Hi = class extends J {
|
|
|
6307
6307
|
O([_(), D("design:type", Object)], Hi.prototype, "fillWithShape", void 0);
|
|
6308
6308
|
//#endregion
|
|
6309
6309
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6310
|
-
var Ui
|
|
6311
|
-
|
|
6312
|
-
"
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6310
|
+
var Ui;
|
|
6311
|
+
function Wi() {
|
|
6312
|
+
return Ui ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), Ui;
|
|
6313
|
+
}
|
|
6314
|
+
function Gi(e) {
|
|
6315
|
+
if (!e) return { show: !1 };
|
|
6316
|
+
switch (e) {
|
|
6317
|
+
case "bottom": return {
|
|
6318
|
+
show: !0,
|
|
6319
|
+
bottom: 8
|
|
6320
|
+
};
|
|
6321
|
+
case "left": return {
|
|
6322
|
+
show: !0,
|
|
6323
|
+
left: 8,
|
|
6324
|
+
orient: "vertical"
|
|
6325
|
+
};
|
|
6326
|
+
case "right": return {
|
|
6327
|
+
show: !0,
|
|
6328
|
+
right: 8,
|
|
6329
|
+
orient: "vertical"
|
|
6330
|
+
};
|
|
6331
|
+
default: return {
|
|
6332
|
+
show: !0,
|
|
6333
|
+
top: 8
|
|
6334
|
+
};
|
|
6335
|
+
}
|
|
6336
|
+
}
|
|
6337
|
+
var Y = class extends C {
|
|
6319
6338
|
_parent;
|
|
6320
|
-
|
|
6339
|
+
_instance;
|
|
6340
|
+
_container;
|
|
6341
|
+
_texture;
|
|
6342
|
+
_node;
|
|
6321
6343
|
_dirty = !1;
|
|
6322
6344
|
_scheduled = !1;
|
|
6323
6345
|
constructor(e) {
|
|
@@ -6349,139 +6371,110 @@ var Ui = [
|
|
|
6349
6371
|
isValid() {
|
|
6350
6372
|
return !!(this.enabled && this.series.some((e) => e.values.length));
|
|
6351
6373
|
}
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
}
|
|
6355
|
-
_clear() {
|
|
6356
|
-
for (let e of this._nodes) this._parent.removeChild(e), e.destroy();
|
|
6357
|
-
this._nodes.length = 0;
|
|
6358
|
-
}
|
|
6359
|
-
_add(e) {
|
|
6360
|
-
let t = z.parse({
|
|
6361
|
-
is: "Element2D",
|
|
6362
|
-
...e
|
|
6363
|
-
}, "Element2D");
|
|
6364
|
-
this._parent.appendChild(t, "back"), this._nodes.push(t);
|
|
6365
|
-
}
|
|
6366
|
-
_range() {
|
|
6367
|
-
let e = Infinity, t = -Infinity;
|
|
6368
|
-
for (let n of this.series) for (let r of n.values) e = Math.min(e, r), t = Math.max(t, r);
|
|
6369
|
-
Number.isFinite(e) || (e = 0, t = 1);
|
|
6370
|
-
let n = this.valueAxis?.min ?? Math.min(0, e), r = this.valueAxis?.max ?? t;
|
|
6371
|
-
return r <= n && (r = n + 1), [n, r];
|
|
6372
|
-
}
|
|
6373
|
-
update() {
|
|
6374
|
-
if (this._dirty = !1, this._clear(), !this.isValid()) {
|
|
6375
|
-
this._parent.requestDraw();
|
|
6376
|
-
return;
|
|
6377
|
-
}
|
|
6374
|
+
async update() {
|
|
6375
|
+
this._dirty = !1;
|
|
6378
6376
|
let { width: e, height: t } = this._parent.size;
|
|
6379
|
-
if (!e || !t) {
|
|
6380
|
-
this._parent.requestDraw();
|
|
6377
|
+
if (!this.isValid() || !e || !t) {
|
|
6378
|
+
this._teardown(), this._parent.requestDraw();
|
|
6381
6379
|
return;
|
|
6382
6380
|
}
|
|
6383
|
-
let n =
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
break;
|
|
6388
|
-
case "line":
|
|
6389
|
-
case "area":
|
|
6390
|
-
this._drawLines(e, t, n, r, i, a, this.type === "area");
|
|
6391
|
-
break;
|
|
6392
|
-
case "pie":
|
|
6393
|
-
case "doughnut":
|
|
6394
|
-
this._drawPie(e, t, n, r, i, a, this.type === "doughnut");
|
|
6395
|
-
break;
|
|
6396
|
-
case "column":
|
|
6397
|
-
this._drawBars(n, r, i, a, !1);
|
|
6398
|
-
break;
|
|
6399
|
-
default: break;
|
|
6400
|
-
}
|
|
6401
|
-
this._parent.requestDraw();
|
|
6402
|
-
}
|
|
6403
|
-
_drawBars(e, t, n, r, i) {
|
|
6404
|
-
let [a, o] = this._range(), s = o - a, c = Math.max(this.categories.length, ...this.series.map((e) => e.values.length), 1), l = this.series.length || 1, u = (i ? r : n) / c, d = u * .8 / l, f = u * .2 / 2;
|
|
6405
|
-
for (let o = 0; o < this.series.length; o++) {
|
|
6406
|
-
let c = this.series[o], l = this._color(o, c);
|
|
6407
|
-
for (let p = 0; p < c.values.length; p++) {
|
|
6408
|
-
let m = (c.values[p] - a) / s, h = Math.max(m * (i ? n : r), 0), g = p * u + f + o * d, ee = i ? {
|
|
6409
|
-
left: e,
|
|
6410
|
-
top: t + g,
|
|
6411
|
-
width: h,
|
|
6412
|
-
height: d
|
|
6413
|
-
} : {
|
|
6414
|
-
left: e + g,
|
|
6415
|
-
top: t + r - h,
|
|
6416
|
-
width: d,
|
|
6417
|
-
height: h
|
|
6418
|
-
};
|
|
6419
|
-
this._add({
|
|
6420
|
-
style: ee,
|
|
6421
|
-
background: { color: l }
|
|
6422
|
-
});
|
|
6423
|
-
}
|
|
6381
|
+
let n = await Wi();
|
|
6382
|
+
if (!n) {
|
|
6383
|
+
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)");
|
|
6384
|
+
return;
|
|
6424
6385
|
}
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
let g = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e} ${t}"><path d="${h}"/></svg>`;
|
|
6434
|
-
this._add({
|
|
6435
|
-
style: {
|
|
6436
|
-
left: 0,
|
|
6437
|
-
top: 0,
|
|
6386
|
+
if (!(this.destroyed || !this.isValid())) {
|
|
6387
|
+
if (!this._instance) {
|
|
6388
|
+
if (typeof document > "u") {
|
|
6389
|
+
console.warn("[modern-canvas] echarts chart rendering requires a DOM environment");
|
|
6390
|
+
return;
|
|
6391
|
+
}
|
|
6392
|
+
this._container = document.createElement("div"), this._instance = n.init(this._container, void 0, {
|
|
6393
|
+
renderer: "canvas",
|
|
6438
6394
|
width: e,
|
|
6439
6395
|
height: t
|
|
6440
|
-
},
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6396
|
+
}), this._instance.on("finished", () => {
|
|
6397
|
+
this._texture?.requestUpdate("source"), this._parent.requestDraw();
|
|
6398
|
+
});
|
|
6399
|
+
}
|
|
6400
|
+
if (this._instance.resize({
|
|
6401
|
+
width: e,
|
|
6402
|
+
height: t
|
|
6403
|
+
}), this._instance.setOption(this._toOption(), !0), !this._texture) {
|
|
6404
|
+
let n = this._container.querySelector("canvas");
|
|
6405
|
+
if (!n) return;
|
|
6406
|
+
this._texture = new rr({
|
|
6407
|
+
source: n,
|
|
6408
|
+
pixelRatio: 1
|
|
6409
|
+
});
|
|
6410
|
+
let r = z.parse({
|
|
6411
|
+
is: "TextureRect2D",
|
|
6412
|
+
style: {
|
|
6413
|
+
left: 0,
|
|
6414
|
+
top: 0,
|
|
6415
|
+
width: e,
|
|
6416
|
+
height: t
|
|
6447
6417
|
}
|
|
6448
|
-
}
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
});
|
|
6418
|
+
}, "Element2D");
|
|
6419
|
+
r.texture = this._texture, this._node = r, this._parent.appendChild(r, "back");
|
|
6420
|
+
}
|
|
6421
|
+
this._node?.size.set(e, t), this._texture?.requestUpdate("source"), this._parent.requestDraw();
|
|
6453
6422
|
}
|
|
6454
6423
|
}
|
|
6455
|
-
|
|
6456
|
-
let
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
this.
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
});
|
|
6424
|
+
_toOption() {
|
|
6425
|
+
let { type: e, categories: t } = this, n = e === "pie" || e === "doughnut", r = e === "bar", i = this.grouping === "stacked" || this.grouping === "percentStacked", a = {
|
|
6426
|
+
title: this.title ? {
|
|
6427
|
+
text: this.title,
|
|
6428
|
+
left: "center"
|
|
6429
|
+
} : void 0,
|
|
6430
|
+
legend: Gi(this.legend),
|
|
6431
|
+
tooltip: {}
|
|
6432
|
+
};
|
|
6433
|
+
if (n) {
|
|
6434
|
+
let n = this.series[0];
|
|
6435
|
+
return a.series = [{
|
|
6436
|
+
type: "pie",
|
|
6437
|
+
radius: e === "doughnut" ? ["45%", "70%"] : "70%",
|
|
6438
|
+
data: (n?.values ?? []).map((e, n) => ({
|
|
6439
|
+
value: e,
|
|
6440
|
+
name: t[n] ?? String(n)
|
|
6441
|
+
}))
|
|
6442
|
+
}], a;
|
|
6475
6443
|
}
|
|
6444
|
+
let o = {
|
|
6445
|
+
type: "value",
|
|
6446
|
+
show: this.valueAxis?.visible !== !1,
|
|
6447
|
+
name: this.valueAxis?.title,
|
|
6448
|
+
min: this.valueAxis?.min,
|
|
6449
|
+
max: this.valueAxis?.max
|
|
6450
|
+
}, s = {
|
|
6451
|
+
type: "category",
|
|
6452
|
+
data: t,
|
|
6453
|
+
show: this.categoryAxis?.visible !== !1,
|
|
6454
|
+
name: this.categoryAxis?.title
|
|
6455
|
+
};
|
|
6456
|
+
a.xAxis = r ? o : s, a.yAxis = r ? s : o;
|
|
6457
|
+
let c = e === "column" || e === "bar" ? "bar" : e === "area" ? "line" : e;
|
|
6458
|
+
return a.series = this.series.map((t) => ({
|
|
6459
|
+
name: t.name,
|
|
6460
|
+
type: c,
|
|
6461
|
+
data: e === "scatter" && t.xValues ? t.values.map((e, n) => [t.xValues[n], e]) : t.values,
|
|
6462
|
+
stack: i ? "total" : void 0,
|
|
6463
|
+
areaStyle: e === "area" ? {} : void 0,
|
|
6464
|
+
itemStyle: t.color ? { color: t.color } : void 0
|
|
6465
|
+
})), a;
|
|
6466
|
+
}
|
|
6467
|
+
_teardown() {
|
|
6468
|
+
this._instance?.dispose(), this._instance = void 0, this._container = void 0, this._texture = void 0, this._node &&= (this._parent.removeChild(this._node), this._node.destroy(), void 0);
|
|
6476
6469
|
}
|
|
6477
6470
|
_destroy() {
|
|
6478
|
-
this.
|
|
6471
|
+
this._teardown();
|
|
6479
6472
|
}
|
|
6480
6473
|
};
|
|
6481
6474
|
O([_({ fallback: !0 }), D("design:type", Boolean)], Y.prototype, "enabled", void 0), O([_({ fallback: "column" }), D("design:type", Object)], Y.prototype, "type", void 0), O([_(), D("design:type", Object)], Y.prototype, "grouping", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], Y.prototype, "categories", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], Y.prototype, "series", void 0), O([_(), D("design:type", Object)], Y.prototype, "title", void 0), O([_(), D("design:type", Object)], Y.prototype, "legend", void 0), O([_(), D("design:type", Object)], Y.prototype, "categoryAxis", void 0), O([_(), D("design:type", Object)], Y.prototype, "valueAxis", void 0);
|
|
6482
6475
|
//#endregion
|
|
6483
6476
|
//#region src/scene/2d/element/Element2DConnection.ts
|
|
6484
|
-
var
|
|
6477
|
+
var Ki = class extends C {
|
|
6485
6478
|
_parent;
|
|
6486
6479
|
_routeSig;
|
|
6487
6480
|
_routePath;
|
|
@@ -6519,7 +6512,7 @@ var Gi = class extends C {
|
|
|
6519
6512
|
y: Math.sin(n.ang)
|
|
6520
6513
|
}, {
|
|
6521
6514
|
point: e,
|
|
6522
|
-
dir:
|
|
6515
|
+
dir: qi(r, t.globalRotation)
|
|
6523
6516
|
};
|
|
6524
6517
|
}
|
|
6525
6518
|
}
|
|
@@ -6536,8 +6529,8 @@ var Gi = class extends C {
|
|
|
6536
6529
|
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Rr(this.mode, e ?? t, t ?? e)), this._routePath;
|
|
6537
6530
|
}
|
|
6538
6531
|
};
|
|
6539
|
-
O([_(), D("design:type", Object)],
|
|
6540
|
-
function
|
|
6532
|
+
O([_(), D("design:type", Object)], Ki.prototype, "start", void 0), O([_(), D("design:type", Object)], Ki.prototype, "end", void 0), O([_({ fallback: "straight" }), D("design:type", Object)], Ki.prototype, "mode", void 0);
|
|
6533
|
+
function qi(e, t) {
|
|
6541
6534
|
if (!t) return e;
|
|
6542
6535
|
let n = Math.cos(t), r = Math.sin(t);
|
|
6543
6536
|
return {
|
|
@@ -6547,7 +6540,7 @@ function Ki(e, t) {
|
|
|
6547
6540
|
}
|
|
6548
6541
|
//#endregion
|
|
6549
6542
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6550
|
-
var
|
|
6543
|
+
var Ji = class extends J {
|
|
6551
6544
|
setProperties(e) {
|
|
6552
6545
|
return super._setProperties(d(e) ? void 0 : g(e));
|
|
6553
6546
|
}
|
|
@@ -6559,10 +6552,10 @@ var qi = class extends J {
|
|
|
6559
6552
|
}
|
|
6560
6553
|
}
|
|
6561
6554
|
};
|
|
6562
|
-
O([_(), D("design:type", Object)],
|
|
6555
|
+
O([_(), D("design:type", Object)], Ji.prototype, "fillWithShape", void 0);
|
|
6563
6556
|
//#endregion
|
|
6564
6557
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6565
|
-
var
|
|
6558
|
+
var Yi = class extends J {
|
|
6566
6559
|
setProperties(e) {
|
|
6567
6560
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6568
6561
|
}
|
|
@@ -6590,10 +6583,10 @@ var Ji = class extends J {
|
|
|
6590
6583
|
}) });
|
|
6591
6584
|
}
|
|
6592
6585
|
};
|
|
6593
|
-
O([_(), D("design:type", Object)],
|
|
6586
|
+
O([_(), D("design:type", Object)], Yi.prototype, "color", void 0), O([_(), D("design:type", Object)], Yi.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", Object)], Yi.prototype, "style", void 0), O([_({ fallback: "butt" }), D("design:type", Object)], Yi.prototype, "lineCap", void 0), O([_({ fallback: "miter" }), D("design:type", Object)], Yi.prototype, "lineJoin", void 0);
|
|
6594
6587
|
//#endregion
|
|
6595
6588
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
6596
|
-
var
|
|
6589
|
+
var Xi = class extends C {
|
|
6597
6590
|
_parent;
|
|
6598
6591
|
constructor(e) {
|
|
6599
6592
|
super(), this._parent = e;
|
|
@@ -6617,10 +6610,10 @@ var Yi = class extends C {
|
|
|
6617
6610
|
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new gi({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
6618
6611
|
}
|
|
6619
6612
|
};
|
|
6620
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6613
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], Xi.prototype, "enabled", void 0), O([_({ fallback: "#000000FF" }), D("design:type", Object)], Xi.prototype, "color", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Xi.prototype, "blur", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Xi.prototype, "offsetY", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Xi.prototype, "offsetX", void 0);
|
|
6621
6614
|
//#endregion
|
|
6622
6615
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
6623
|
-
var
|
|
6616
|
+
var Zi = class extends C {
|
|
6624
6617
|
_parent;
|
|
6625
6618
|
_path2DSet = new le();
|
|
6626
6619
|
_localPath;
|
|
@@ -6718,24 +6711,24 @@ var Xi = class extends C {
|
|
|
6718
6711
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
6719
6712
|
}
|
|
6720
6713
|
};
|
|
6721
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6714
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], Zi.prototype, "enabled", void 0), O([_(), D("design:type", Object)], Zi.prototype, "preset", void 0), O([_(), D("design:type", Object)], Zi.prototype, "svg", void 0), O([_(), D("design:type", Object)], Zi.prototype, "viewBox", void 0), O([_(), D("design:type", Object)], Zi.prototype, "paths", void 0), O([_(), D("design:type", Object)], Zi.prototype, "connectionPoints", void 0);
|
|
6722
6715
|
//#endregion
|
|
6723
6716
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
6724
|
-
var
|
|
6717
|
+
var Qi = class extends w {
|
|
6725
6718
|
constructor(e) {
|
|
6726
6719
|
super(), this.setProperties(e);
|
|
6727
6720
|
}
|
|
6728
|
-
},
|
|
6721
|
+
}, $i = {
|
|
6729
6722
|
...o(),
|
|
6730
6723
|
left: 0,
|
|
6731
6724
|
top: 0,
|
|
6732
6725
|
width: 0,
|
|
6733
6726
|
height: 0
|
|
6734
6727
|
};
|
|
6735
|
-
for (let e in
|
|
6728
|
+
for (let e in $i) i(Qi, e, { fallback: $i[e] });
|
|
6736
6729
|
//#endregion
|
|
6737
6730
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
6738
|
-
var
|
|
6731
|
+
var ea = 100, ta = 40, na = class extends C {
|
|
6739
6732
|
_parent;
|
|
6740
6733
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
6741
6734
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -6766,10 +6759,10 @@ var $i = 100, ea = 40, ta = class extends C {
|
|
|
6766
6759
|
return !!(this.enabled && this.cells.length);
|
|
6767
6760
|
}
|
|
6768
6761
|
get gridWidth() {
|
|
6769
|
-
return this.columns.reduce((e, t) => e + (t.width ||
|
|
6762
|
+
return this.columns.reduce((e, t) => e + (t.width || ea), 0);
|
|
6770
6763
|
}
|
|
6771
6764
|
get gridHeight() {
|
|
6772
|
-
return this.rows.reduce((e, t) => e + (t.height ||
|
|
6765
|
+
return this.rows.reduce((e, t) => e + (t.height || ta), 0);
|
|
6773
6766
|
}
|
|
6774
6767
|
update() {
|
|
6775
6768
|
if (this._dirty = !1, !this.isValid()) {
|
|
@@ -6779,9 +6772,9 @@ var $i = 100, ea = 40, ta = class extends C {
|
|
|
6779
6772
|
let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
|
|
6780
6773
|
for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
|
|
6781
6774
|
let a = [0];
|
|
6782
|
-
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width ||
|
|
6775
|
+
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || ea));
|
|
6783
6776
|
let o = [0];
|
|
6784
|
-
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height ||
|
|
6777
|
+
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || ta));
|
|
6785
6778
|
this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
|
|
6786
6779
|
let s = /* @__PURE__ */ new Set();
|
|
6787
6780
|
for (let e of n) {
|
|
@@ -6818,10 +6811,10 @@ var $i = 100, ea = 40, ta = class extends C {
|
|
|
6818
6811
|
this._clearCells();
|
|
6819
6812
|
}
|
|
6820
6813
|
};
|
|
6821
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6814
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], na.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], na.prototype, "columns", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], na.prototype, "rows", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], na.prototype, "cells", void 0);
|
|
6822
6815
|
//#endregion
|
|
6823
6816
|
//#region src/scene/2d/element/Element2DText.ts
|
|
6824
|
-
var
|
|
6817
|
+
var ra, X = class extends C {
|
|
6825
6818
|
_parent;
|
|
6826
6819
|
base;
|
|
6827
6820
|
get textContent() {
|
|
@@ -6974,7 +6967,7 @@ var na, X = class extends C {
|
|
|
6974
6967
|
}
|
|
6975
6968
|
process(e) {}
|
|
6976
6969
|
};
|
|
6977
|
-
O([_({ fallback: !0 }), D("design:type", Object)], X.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], X.prototype, "content", void 0), O([_({ alias: "_parent.style.json" }), D("design:type", Object)], X.prototype, "style", void 0), O([_(), D("design:type", Object)], X.prototype, "effects", void 0), O([_(), D("design:type", Object)], X.prototype, "fill", void 0), O([_(), D("design:type", Object)], X.prototype, "outline", void 0), O([_({ alias: "base.measureDom" }), D("design:type", typeof (
|
|
6970
|
+
O([_({ fallback: !0 }), D("design:type", Object)], X.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], X.prototype, "content", void 0), O([_({ alias: "_parent.style.json" }), D("design:type", Object)], X.prototype, "style", void 0), O([_(), D("design:type", Object)], X.prototype, "effects", void 0), O([_(), D("design:type", Object)], X.prototype, "fill", void 0), O([_(), D("design:type", Object)], X.prototype, "outline", void 0), O([_({ alias: "base.measureDom" }), D("design:type", typeof (ra = typeof HTMLElement < "u" && HTMLElement) == "function" ? ra : Object)], X.prototype, "measureDom", void 0), O([_({ alias: "base.fonts" }), D("design:type", Object)], X.prototype, "fonts", void 0), O([_({ fallback: "auto" }), D("design:type", Object)], X.prototype, "drawMode", void 0);
|
|
6978
6971
|
//#endregion
|
|
6979
6972
|
//#region src/scene/2d/element/Flexbox.ts
|
|
6980
6973
|
var Z = {
|
|
@@ -6987,7 +6980,7 @@ var Z = {
|
|
|
6987
6980
|
horizontal: 6,
|
|
6988
6981
|
vertical: 7,
|
|
6989
6982
|
all: 8
|
|
6990
|
-
},
|
|
6983
|
+
}, ia = {
|
|
6991
6984
|
column: 0,
|
|
6992
6985
|
row: 1,
|
|
6993
6986
|
all: 2
|
|
@@ -7001,42 +6994,42 @@ var Z = {
|
|
|
7001
6994
|
"space-between": 6,
|
|
7002
6995
|
"space-around": 7,
|
|
7003
6996
|
"space-evenly": 8
|
|
7004
|
-
},
|
|
6997
|
+
}, aa = {
|
|
7005
6998
|
flex: 0,
|
|
7006
6999
|
none: 1,
|
|
7007
7000
|
contents: 2
|
|
7008
|
-
},
|
|
7001
|
+
}, oa = {
|
|
7009
7002
|
inherit: 0,
|
|
7010
7003
|
ltr: 1,
|
|
7011
7004
|
rtl: 2
|
|
7012
|
-
},
|
|
7005
|
+
}, sa = {
|
|
7013
7006
|
column: 0,
|
|
7014
7007
|
"column-reverse": 1,
|
|
7015
7008
|
row: 2,
|
|
7016
7009
|
"row-reverse": 3
|
|
7017
|
-
},
|
|
7010
|
+
}, ca = {
|
|
7018
7011
|
"no-wrap": 0,
|
|
7019
7012
|
wrap: 1,
|
|
7020
7013
|
"Wrap-reverse": 2
|
|
7021
|
-
},
|
|
7014
|
+
}, la = {
|
|
7022
7015
|
"flex-start": 0,
|
|
7023
7016
|
center: 1,
|
|
7024
7017
|
"flex-end": 2,
|
|
7025
7018
|
"space-between": 3,
|
|
7026
7019
|
"space-around": 4,
|
|
7027
7020
|
"space-evenly": 5
|
|
7028
|
-
},
|
|
7021
|
+
}, ua = {
|
|
7029
7022
|
visible: 0,
|
|
7030
7023
|
hidden: 1,
|
|
7031
7024
|
scroll: 2
|
|
7032
|
-
},
|
|
7025
|
+
}, da = {
|
|
7033
7026
|
static: 0,
|
|
7034
7027
|
relative: 1,
|
|
7035
7028
|
absolute: 2
|
|
7036
|
-
},
|
|
7029
|
+
}, fa = {
|
|
7037
7030
|
"border-box": 0,
|
|
7038
7031
|
"content-box": 1
|
|
7039
|
-
},
|
|
7032
|
+
}, pa = class e {
|
|
7040
7033
|
_parent;
|
|
7041
7034
|
static _yoga;
|
|
7042
7035
|
static async load() {
|
|
@@ -7048,14 +7041,14 @@ var Z = {
|
|
|
7048
7041
|
this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
|
|
7049
7042
|
}
|
|
7050
7043
|
_addChild(e, t) {
|
|
7051
|
-
if (e instanceof
|
|
7044
|
+
if (e instanceof ya && e.flexbox.node && this.node) {
|
|
7052
7045
|
this.node.insertChild(e.flexbox.node, t);
|
|
7053
7046
|
let n = e.style.getProperties();
|
|
7054
7047
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7055
7048
|
}
|
|
7056
7049
|
}
|
|
7057
7050
|
_removeChild(e, t) {
|
|
7058
|
-
e instanceof
|
|
7051
|
+
e instanceof ya && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7059
7052
|
}
|
|
7060
7053
|
updateStyleProperty(e, t) {
|
|
7061
7054
|
let n = this.node;
|
|
@@ -7089,10 +7082,10 @@ var Z = {
|
|
|
7089
7082
|
n.setBorder(Z.all, this._parent.style.borderWidth);
|
|
7090
7083
|
break;
|
|
7091
7084
|
case "direction":
|
|
7092
|
-
n.setDirection(t ?
|
|
7085
|
+
n.setDirection(t ? oa[t] ?? oa.inherit : oa.inherit);
|
|
7093
7086
|
break;
|
|
7094
7087
|
case "display":
|
|
7095
|
-
n.setDisplay(t ?
|
|
7088
|
+
n.setDisplay(t ? aa[t] ?? aa.flex : aa.flex);
|
|
7096
7089
|
break;
|
|
7097
7090
|
case "flex":
|
|
7098
7091
|
n.setFlex(t);
|
|
@@ -7101,7 +7094,7 @@ var Z = {
|
|
|
7101
7094
|
n.setFlexBasis(t);
|
|
7102
7095
|
break;
|
|
7103
7096
|
case "flexDirection":
|
|
7104
|
-
n.setFlexDirection(t ?
|
|
7097
|
+
n.setFlexDirection(t ? sa[t] ?? sa.row : sa.row);
|
|
7105
7098
|
break;
|
|
7106
7099
|
case "flexGrow":
|
|
7107
7100
|
n.setFlexGrow(t);
|
|
@@ -7110,16 +7103,16 @@ var Z = {
|
|
|
7110
7103
|
n.setFlexShrink(t);
|
|
7111
7104
|
break;
|
|
7112
7105
|
case "flexWrap":
|
|
7113
|
-
n.setFlexWrap(t ?
|
|
7106
|
+
n.setFlexWrap(t ? ca[t] ?? ca.wrap : ca.wrap);
|
|
7114
7107
|
break;
|
|
7115
7108
|
case "height":
|
|
7116
7109
|
n.setHeight(t);
|
|
7117
7110
|
break;
|
|
7118
7111
|
case "justifyContent":
|
|
7119
|
-
n.setJustifyContent(t ?
|
|
7112
|
+
n.setJustifyContent(t ? la[t] ?? la["flex-start"] : la["flex-start"]);
|
|
7120
7113
|
break;
|
|
7121
7114
|
case "gap":
|
|
7122
|
-
t !== void 0 && n.setGap(
|
|
7115
|
+
t !== void 0 && n.setGap(ia.all, t);
|
|
7123
7116
|
break;
|
|
7124
7117
|
case "marginTop":
|
|
7125
7118
|
n.setMargin(Z.top, t);
|
|
@@ -7149,7 +7142,7 @@ var Z = {
|
|
|
7149
7142
|
n.setMinWidth(t);
|
|
7150
7143
|
break;
|
|
7151
7144
|
case "overflow":
|
|
7152
|
-
n.setOverflow(t ?
|
|
7145
|
+
n.setOverflow(t ? ua[t] ?? ua.visible : ua.visible);
|
|
7153
7146
|
break;
|
|
7154
7147
|
case "paddingTop":
|
|
7155
7148
|
n.setPadding(Z.top, t);
|
|
@@ -7179,10 +7172,10 @@ var Z = {
|
|
|
7179
7172
|
n.setPosition(Z.right, t);
|
|
7180
7173
|
break;
|
|
7181
7174
|
case "position":
|
|
7182
|
-
n.setPositionType(t ?
|
|
7175
|
+
n.setPositionType(t ? da[t] ?? da.relative : da.relative);
|
|
7183
7176
|
break;
|
|
7184
7177
|
case "boxSizing":
|
|
7185
|
-
n.setBoxSizing(t ?
|
|
7178
|
+
n.setBoxSizing(t ? fa[t] ?? fa["content-box"] : fa["content-box"]);
|
|
7186
7179
|
break;
|
|
7187
7180
|
case "width":
|
|
7188
7181
|
n.setWidth(t);
|
|
@@ -7193,7 +7186,7 @@ var Z = {
|
|
|
7193
7186
|
}
|
|
7194
7187
|
update() {
|
|
7195
7188
|
let e = this._parent, t = this.node;
|
|
7196
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
7189
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, oa.ltr), t.hasNewLayout())) {
|
|
7197
7190
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7198
7191
|
(!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
|
|
7199
7192
|
}
|
|
@@ -7201,13 +7194,13 @@ var Z = {
|
|
|
7201
7194
|
destroy() {
|
|
7202
7195
|
this.node?.free(), this.node = void 0;
|
|
7203
7196
|
}
|
|
7204
|
-
},
|
|
7197
|
+
}, ma, ha = new Set(Object.keys(a())), ga = new Set(Object.keys(s())), _a = new y(), va = [
|
|
7205
7198
|
[0, 0],
|
|
7206
7199
|
[1, 0],
|
|
7207
7200
|
[1, 1],
|
|
7208
7201
|
[0, 1]
|
|
7209
|
-
],
|
|
7210
|
-
flexbox = new
|
|
7202
|
+
], ya = class extends Pr {
|
|
7203
|
+
flexbox = new pa(this);
|
|
7211
7204
|
aabb = new mt();
|
|
7212
7205
|
globalAabb = new mt();
|
|
7213
7206
|
_parentGlobalDisplay;
|
|
@@ -7220,7 +7213,7 @@ var Z = {
|
|
|
7220
7213
|
});
|
|
7221
7214
|
_allowPointerEvents = !0;
|
|
7222
7215
|
_overflowHidden = !1;
|
|
7223
|
-
_style = new
|
|
7216
|
+
_style = new Qi().on("updateProperty", (...e) => {
|
|
7224
7217
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
7225
7218
|
});
|
|
7226
7219
|
get style() {
|
|
@@ -7241,7 +7234,7 @@ var Z = {
|
|
|
7241
7234
|
set background(e) {
|
|
7242
7235
|
this._background.resetProperties().setProperties(e);
|
|
7243
7236
|
}
|
|
7244
|
-
_shape = new
|
|
7237
|
+
_shape = new Zi(this);
|
|
7245
7238
|
get shape() {
|
|
7246
7239
|
return this._shape;
|
|
7247
7240
|
}
|
|
@@ -7255,14 +7248,14 @@ var Z = {
|
|
|
7255
7248
|
set fill(e) {
|
|
7256
7249
|
this._fill.resetProperties().setProperties(e);
|
|
7257
7250
|
}
|
|
7258
|
-
_outline = new
|
|
7251
|
+
_outline = new Yi(this);
|
|
7259
7252
|
get outline() {
|
|
7260
7253
|
return this._outline;
|
|
7261
7254
|
}
|
|
7262
7255
|
set outline(e) {
|
|
7263
7256
|
this._outline.resetProperties().setProperties(e);
|
|
7264
7257
|
}
|
|
7265
|
-
_foreground = new
|
|
7258
|
+
_foreground = new Ji(this);
|
|
7266
7259
|
get foreground() {
|
|
7267
7260
|
return this._foreground;
|
|
7268
7261
|
}
|
|
@@ -7276,21 +7269,21 @@ var Z = {
|
|
|
7276
7269
|
set text(e) {
|
|
7277
7270
|
this._text.resetProperties().setProperties(e);
|
|
7278
7271
|
}
|
|
7279
|
-
_shadow = new
|
|
7272
|
+
_shadow = new Xi(this);
|
|
7280
7273
|
get shadow() {
|
|
7281
7274
|
return this._shadow;
|
|
7282
7275
|
}
|
|
7283
7276
|
set shadow(e) {
|
|
7284
7277
|
this._shadow.resetProperties().setProperties(e);
|
|
7285
7278
|
}
|
|
7286
|
-
_connection = new
|
|
7279
|
+
_connection = new Ki(this);
|
|
7287
7280
|
get connection() {
|
|
7288
7281
|
return this._connection;
|
|
7289
7282
|
}
|
|
7290
7283
|
set connection(e) {
|
|
7291
7284
|
this._connection.resetProperties().setProperties(e);
|
|
7292
7285
|
}
|
|
7293
|
-
_table = new
|
|
7286
|
+
_table = new na(this);
|
|
7294
7287
|
get table() {
|
|
7295
7288
|
return this._table;
|
|
7296
7289
|
}
|
|
@@ -7447,7 +7440,7 @@ var Z = {
|
|
|
7447
7440
|
this.requestDraw();
|
|
7448
7441
|
break;
|
|
7449
7442
|
}
|
|
7450
|
-
if ((
|
|
7443
|
+
if ((ga.has(e) || ha.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
7451
7444
|
else switch (e) {
|
|
7452
7445
|
case "left":
|
|
7453
7446
|
this.position.x = Number(t);
|
|
@@ -7487,10 +7480,10 @@ var Z = {
|
|
|
7487
7480
|
}
|
|
7488
7481
|
_intersectsViewport(e) {
|
|
7489
7482
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7490
|
-
for (let [e, c] of
|
|
7483
|
+
for (let [e, c] of va) t.applyAffineInverse({
|
|
7491
7484
|
x: e * n,
|
|
7492
7485
|
y: c * r
|
|
7493
|
-
},
|
|
7486
|
+
}, _a), i = Math.min(i, _a.x), a = Math.max(a, _a.x), o = Math.min(o, _a.y), s = Math.max(s, _a.y);
|
|
7494
7487
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7495
7488
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7496
7489
|
}
|
|
@@ -7590,10 +7583,10 @@ var Z = {
|
|
|
7590
7583
|
super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
7591
7584
|
}
|
|
7592
7585
|
};
|
|
7593
|
-
|
|
7586
|
+
ya = O([x("Element2D"), D("design:paramtypes", [typeof (ma = typeof Partial < "u" && Partial) == "function" ? ma : Object, Array])], ya);
|
|
7594
7587
|
//#endregion
|
|
7595
7588
|
//#region src/scene/2d/TextureRect2D.ts
|
|
7596
|
-
var
|
|
7589
|
+
var ba, xa = class extends ya {
|
|
7597
7590
|
texture;
|
|
7598
7591
|
constructor(e, t = []) {
|
|
7599
7592
|
super(), this.setProperties(e).append(t);
|
|
@@ -7607,7 +7600,11 @@ var ya = class extends va {
|
|
|
7607
7600
|
} });
|
|
7608
7601
|
}
|
|
7609
7602
|
}
|
|
7610
|
-
}
|
|
7603
|
+
};
|
|
7604
|
+
xa = O([x("TextureRect2D"), D("design:paramtypes", [typeof (ba = typeof Partial < "u" && Partial) == "function" ? ba : Object, Array])], xa);
|
|
7605
|
+
//#endregion
|
|
7606
|
+
//#region src/scene/2d/Lottie2D.ts
|
|
7607
|
+
var Sa, Ca = class extends xa {
|
|
7611
7608
|
texture = new rr();
|
|
7612
7609
|
animation;
|
|
7613
7610
|
_lastTime = NaN;
|
|
@@ -7638,10 +7635,10 @@ var ya = class extends va {
|
|
|
7638
7635
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
7639
7636
|
}
|
|
7640
7637
|
};
|
|
7641
|
-
O([_({ fallback: "" }), D("design:type", String)],
|
|
7638
|
+
O([_({ fallback: "" }), D("design:type", String)], Ca.prototype, "src", void 0), Ca = O([x("Lottie2D"), D("design:paramtypes", [typeof (Sa = typeof Partial < "u" && Partial) == "function" ? Sa : Object, Array])], Ca);
|
|
7642
7639
|
//#endregion
|
|
7643
7640
|
//#region src/scene/2d/TransformRect2D.ts
|
|
7644
|
-
var
|
|
7641
|
+
var wa = class extends ya {
|
|
7645
7642
|
constructor(e, t = []) {
|
|
7646
7643
|
super(), this.setProperties(e).append(t);
|
|
7647
7644
|
}
|
|
@@ -7664,10 +7661,10 @@ var Sa = class extends va {
|
|
|
7664
7661
|
this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
|
|
7665
7662
|
}
|
|
7666
7663
|
};
|
|
7667
|
-
O([_({ fallback: 6 }), D("design:type", Number)],
|
|
7664
|
+
O([_({ fallback: 6 }), D("design:type", Number)], wa.prototype, "handleSize", void 0);
|
|
7668
7665
|
//#endregion
|
|
7669
7666
|
//#region src/scene/2d/Video2D.ts
|
|
7670
|
-
var
|
|
7667
|
+
var Ta, Ea = class extends xa {
|
|
7671
7668
|
get videoDuration() {
|
|
7672
7669
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
7673
7670
|
}
|
|
@@ -7707,11 +7704,11 @@ var Ca, wa = class extends ya {
|
|
|
7707
7704
|
super._process(e), this._updateVideoCurrentTime();
|
|
7708
7705
|
}
|
|
7709
7706
|
};
|
|
7710
|
-
O([_({ fallback: "" }), D("design:type", String)],
|
|
7707
|
+
O([_({ fallback: "" }), D("design:type", String)], Ea.prototype, "src", void 0), Ea = O([x("Video2D"), D("design:paramtypes", [typeof (Ta = typeof Partial < "u" && Partial) == "function" ? Ta : Object, Array])], Ea);
|
|
7711
7708
|
//#endregion
|
|
7712
7709
|
//#region src/scene/animation/Animation.ts
|
|
7713
|
-
var
|
|
7714
|
-
function
|
|
7710
|
+
var Da, Oa = (e) => e, ka = Na(.25, .1, .25, 1), Aa = Na(.42, 0, 1, 1), ja = Na(0, 0, .58, 1), Ma = Na(.42, 0, .58, 1);
|
|
7711
|
+
function Na(e, t, n, r) {
|
|
7715
7712
|
let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
|
|
7716
7713
|
function m(e) {
|
|
7717
7714
|
let t = e, n, r;
|
|
@@ -7731,13 +7728,13 @@ function ja(e, t, n, r) {
|
|
|
7731
7728
|
}
|
|
7732
7729
|
return (e) => p(m(e));
|
|
7733
7730
|
}
|
|
7734
|
-
var
|
|
7735
|
-
linear:
|
|
7736
|
-
ease:
|
|
7737
|
-
easeIn:
|
|
7738
|
-
easeOut:
|
|
7739
|
-
easeInOut:
|
|
7740
|
-
},
|
|
7731
|
+
var Pa = {
|
|
7732
|
+
linear: Oa,
|
|
7733
|
+
ease: ka,
|
|
7734
|
+
easeIn: Aa,
|
|
7735
|
+
easeOut: ja,
|
|
7736
|
+
easeInOut: Ma
|
|
7737
|
+
}, Fa = class extends B {
|
|
7741
7738
|
_keyframes = [];
|
|
7742
7739
|
_isFirstUpdatePosition = !1;
|
|
7743
7740
|
_cachedProps = new t();
|
|
@@ -7772,7 +7769,7 @@ var Ma = {
|
|
|
7772
7769
|
e = [this.getParent()].filter(Boolean);
|
|
7773
7770
|
break;
|
|
7774
7771
|
}
|
|
7775
|
-
return e.filter((e) => e instanceof
|
|
7772
|
+
return e.filter((e) => e instanceof ya);
|
|
7776
7773
|
}
|
|
7777
7774
|
_updateKeyframes() {
|
|
7778
7775
|
let e = [], t = this.keyframes;
|
|
@@ -7820,10 +7817,10 @@ var Ma = {
|
|
|
7820
7817
|
});
|
|
7821
7818
|
}
|
|
7822
7819
|
_parseEasing(e) {
|
|
7823
|
-
if (!e) return
|
|
7824
|
-
if (e in
|
|
7820
|
+
if (!e) return Pa.linear;
|
|
7821
|
+
if (e in Pa) return Pa[e];
|
|
7825
7822
|
let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
|
|
7826
|
-
return
|
|
7823
|
+
return Na(t[0], t[1], t[2], t[3]);
|
|
7827
7824
|
}
|
|
7828
7825
|
_parseKeyframes(e, t) {
|
|
7829
7826
|
let n, r = this._keyframes;
|
|
@@ -7901,14 +7898,14 @@ var Ma = {
|
|
|
7901
7898
|
});
|
|
7902
7899
|
}
|
|
7903
7900
|
};
|
|
7904
|
-
O([_({ fallback: "parent" }), D("design:type", Object)],
|
|
7901
|
+
O([_({ fallback: "parent" }), D("design:type", Object)], Fa.prototype, "effectMode", void 0), O([_({ default: () => [] }), D("design:type", Array)], Fa.prototype, "keyframes", void 0), O([_(), D("design:type", Object)], Fa.prototype, "easing", void 0), Fa = O([x("Animation", {
|
|
7905
7902
|
renderMode: "disabled",
|
|
7906
7903
|
processSortMode: "parent-before",
|
|
7907
7904
|
duration: 2e3
|
|
7908
|
-
}), D("design:paramtypes", [typeof (
|
|
7905
|
+
}), D("design:paramtypes", [typeof (Da = typeof Partial < "u" && Partial) == "function" ? Da : Object, Array])], Fa);
|
|
7909
7906
|
//#endregion
|
|
7910
7907
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
7911
|
-
var
|
|
7908
|
+
var Ia = class t extends e {
|
|
7912
7909
|
static _instance;
|
|
7913
7910
|
static get instance() {
|
|
7914
7911
|
return this._instance ||= new t(), this._instance;
|
|
@@ -7938,7 +7935,7 @@ var Pa = class t extends e {
|
|
|
7938
7935
|
togglePause() {
|
|
7939
7936
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
7940
7937
|
}
|
|
7941
|
-
},
|
|
7938
|
+
}, La = class t extends e {
|
|
7942
7939
|
static PADDING = .1;
|
|
7943
7940
|
_source = null;
|
|
7944
7941
|
_audio = null;
|
|
@@ -8065,7 +8062,7 @@ var Pa = class t extends e {
|
|
|
8065
8062
|
let e = this._source;
|
|
8066
8063
|
e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
|
|
8067
8064
|
}
|
|
8068
|
-
},
|
|
8065
|
+
}, Ra = class {
|
|
8069
8066
|
parent;
|
|
8070
8067
|
source = new globalThis.Audio();
|
|
8071
8068
|
_src = "";
|
|
@@ -8082,7 +8079,7 @@ var Pa = class t extends e {
|
|
|
8082
8079
|
return !!this.source && this.source.readyState === 4;
|
|
8083
8080
|
}
|
|
8084
8081
|
get context() {
|
|
8085
|
-
return
|
|
8082
|
+
return Ia.instance;
|
|
8086
8083
|
}
|
|
8087
8084
|
constructor(e) {
|
|
8088
8085
|
this.parent = e;
|
|
@@ -8093,9 +8090,9 @@ var Pa = class t extends e {
|
|
|
8093
8090
|
});
|
|
8094
8091
|
}
|
|
8095
8092
|
createSound() {
|
|
8096
|
-
return new
|
|
8093
|
+
return new La();
|
|
8097
8094
|
}
|
|
8098
|
-
},
|
|
8095
|
+
}, za = class extends e {
|
|
8099
8096
|
_input;
|
|
8100
8097
|
_output;
|
|
8101
8098
|
_processers = [];
|
|
@@ -8117,7 +8114,7 @@ var Pa = class t extends e {
|
|
|
8117
8114
|
get destination() {
|
|
8118
8115
|
return this._input;
|
|
8119
8116
|
}
|
|
8120
|
-
},
|
|
8117
|
+
}, Ba = class {
|
|
8121
8118
|
destination;
|
|
8122
8119
|
source;
|
|
8123
8120
|
constructor(e, t = null) {
|
|
@@ -8132,21 +8129,21 @@ var Pa = class t extends e {
|
|
|
8132
8129
|
};
|
|
8133
8130
|
//#endregion
|
|
8134
8131
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8135
|
-
function
|
|
8132
|
+
function Va() {
|
|
8136
8133
|
if (ze) return new AudioContext();
|
|
8137
8134
|
if (Be) {
|
|
8138
8135
|
let e = globalThis.webkitAudioContext;
|
|
8139
8136
|
return new e();
|
|
8140
8137
|
} else throw Error("Failed to createAudioContext");
|
|
8141
8138
|
}
|
|
8142
|
-
function
|
|
8139
|
+
function Ha(e, t, n) {
|
|
8143
8140
|
if (Ve) return new OfflineAudioContext(e, t, n);
|
|
8144
8141
|
if (He) {
|
|
8145
8142
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8146
8143
|
return new r(e, t, n);
|
|
8147
8144
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8148
8145
|
}
|
|
8149
|
-
var
|
|
8146
|
+
var Ua = class e extends za {
|
|
8150
8147
|
static _instance;
|
|
8151
8148
|
static get instance() {
|
|
8152
8149
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8187,7 +8184,7 @@ var Va = class e extends La {
|
|
|
8187
8184
|
_compressor;
|
|
8188
8185
|
_analyser;
|
|
8189
8186
|
constructor() {
|
|
8190
|
-
let e =
|
|
8187
|
+
let e = Va(), t = Ha(1, 2, Ve ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8191
8188
|
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (Ie || Le), We && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
|
|
8192
8189
|
}
|
|
8193
8190
|
_onFocus() {
|
|
@@ -8228,7 +8225,7 @@ var Va = class e extends La {
|
|
|
8228
8225
|
setParamValue(e, t) {
|
|
8229
8226
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8230
8227
|
}
|
|
8231
|
-
},
|
|
8228
|
+
}, Wa = class extends e {
|
|
8232
8229
|
_audio = null;
|
|
8233
8230
|
_sourceNode = null;
|
|
8234
8231
|
_gain = null;
|
|
@@ -8361,7 +8358,7 @@ var Va = class e extends La {
|
|
|
8361
8358
|
destroy() {
|
|
8362
8359
|
super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
|
|
8363
8360
|
}
|
|
8364
|
-
},
|
|
8361
|
+
}, Ga = class extends za {
|
|
8365
8362
|
parent;
|
|
8366
8363
|
_sourceBuffer;
|
|
8367
8364
|
_sourceNode;
|
|
@@ -8369,7 +8366,7 @@ var Va = class e extends La {
|
|
|
8369
8366
|
gain;
|
|
8370
8367
|
analyser;
|
|
8371
8368
|
get context() {
|
|
8372
|
-
return
|
|
8369
|
+
return Ua.instance;
|
|
8373
8370
|
}
|
|
8374
8371
|
get isPlayable() {
|
|
8375
8372
|
return !!this._sourceNode.buffer;
|
|
@@ -8384,8 +8381,8 @@ var Va = class e extends La {
|
|
|
8384
8381
|
this._sourceNode.buffer = e;
|
|
8385
8382
|
}
|
|
8386
8383
|
constructor(e) {
|
|
8387
|
-
let t =
|
|
8388
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8384
|
+
let t = Ua.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8385
|
+
n.connect(i), i.connect(r), r.connect(Ua.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
8389
8386
|
}
|
|
8390
8387
|
async load() {
|
|
8391
8388
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -8398,7 +8395,7 @@ var Va = class e extends La {
|
|
|
8398
8395
|
});
|
|
8399
8396
|
}
|
|
8400
8397
|
_decode(e) {
|
|
8401
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8398
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : Ua.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
8402
8399
|
}
|
|
8403
8400
|
cloneSource() {
|
|
8404
8401
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -8408,15 +8405,15 @@ var Va = class e extends La {
|
|
|
8408
8405
|
};
|
|
8409
8406
|
}
|
|
8410
8407
|
createSound() {
|
|
8411
|
-
return new
|
|
8408
|
+
return new Wa();
|
|
8412
8409
|
}
|
|
8413
|
-
},
|
|
8410
|
+
}, Ka, qa = class extends B {
|
|
8414
8411
|
static {
|
|
8415
|
-
|
|
8412
|
+
Ka = this;
|
|
8416
8413
|
}
|
|
8417
8414
|
static _soundPool = [];
|
|
8418
8415
|
_sounds = [];
|
|
8419
|
-
_platformAudio = Ue ? new
|
|
8416
|
+
_platformAudio = Ue ? new Ga(this) : new Ra(this);
|
|
8420
8417
|
get platformAudio() {
|
|
8421
8418
|
return this._platformAudio;
|
|
8422
8419
|
}
|
|
@@ -8509,7 +8506,7 @@ var Va = class e extends La {
|
|
|
8509
8506
|
this._sounds.length = 0;
|
|
8510
8507
|
}
|
|
8511
8508
|
_createSound() {
|
|
8512
|
-
return
|
|
8509
|
+
return Ka._soundPool.length > 0 ? Ka._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
8513
8510
|
}
|
|
8514
8511
|
refresh() {
|
|
8515
8512
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -8525,7 +8522,7 @@ var Va = class e extends La {
|
|
|
8525
8522
|
this._recycleSound(e);
|
|
8526
8523
|
};
|
|
8527
8524
|
_recycleSound(e) {
|
|
8528
|
-
e.destroy(),
|
|
8525
|
+
e.destroy(), Ka._soundPool.includes(e) || Ka._soundPool.push(e);
|
|
8529
8526
|
}
|
|
8530
8527
|
_prevTime = 0;
|
|
8531
8528
|
_timer = 0;
|
|
@@ -8541,10 +8538,10 @@ var Va = class e extends La {
|
|
|
8541
8538
|
}, 100);
|
|
8542
8539
|
}
|
|
8543
8540
|
};
|
|
8544
|
-
|
|
8541
|
+
qa = Ka = O([x("Audio"), D("design:paramtypes", [Object])], qa);
|
|
8545
8542
|
//#endregion
|
|
8546
8543
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
8547
|
-
var
|
|
8544
|
+
var Ja = class extends Pr {}, Ya, Xa = class extends ya {
|
|
8548
8545
|
_audioBuffer;
|
|
8549
8546
|
_src = (() => {
|
|
8550
8547
|
let e = tt();
|
|
@@ -8568,7 +8565,7 @@ var Ka = class extends Pr {}, qa, Ja = class extends va {
|
|
|
8568
8565
|
}
|
|
8569
8566
|
}
|
|
8570
8567
|
async _loadSrc(e) {
|
|
8571
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
8568
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ua.decode(e)).then((e) => {
|
|
8572
8569
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
8573
8570
|
});
|
|
8574
8571
|
}
|
|
@@ -8603,12 +8600,12 @@ var Ka = class extends Pr {}, qa, Ja = class extends va {
|
|
|
8603
8600
|
this.syncTexture(), super._process(e);
|
|
8604
8601
|
}
|
|
8605
8602
|
};
|
|
8606
|
-
O([_(), D("design:type", Object)],
|
|
8603
|
+
O([_(), D("design:type", Object)], Xa.prototype, "src", void 0), O([_({ fallback: 0 }), D("design:type", Number)], Xa.prototype, "gap", void 0), O([_({ fallback: "#000000" }), D("design:type", String)], Xa.prototype, "color", void 0), Xa = O([x("AudioWaveform"), D("design:paramtypes", [typeof (Ya = typeof Partial < "u" && Partial) == "function" ? Ya : Object])], Xa);
|
|
8607
8604
|
//#endregion
|
|
8608
8605
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
8609
|
-
var
|
|
8606
|
+
var Za, Qa = class extends Mr {
|
|
8610
8607
|
static {
|
|
8611
|
-
|
|
8608
|
+
Za = this;
|
|
8612
8609
|
}
|
|
8613
8610
|
blur = 10;
|
|
8614
8611
|
quality = 10;
|
|
@@ -8627,7 +8624,7 @@ var Ya, Xa = class extends Mr {
|
|
|
8627
8624
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
8628
8625
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
8629
8626
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
8630
|
-
I.draw(e,
|
|
8627
|
+
I.draw(e, Za.material, {
|
|
8631
8628
|
sampler: r,
|
|
8632
8629
|
progress: i,
|
|
8633
8630
|
...t
|
|
@@ -8635,31 +8632,31 @@ var Ya, Xa = class extends Mr {
|
|
|
8635
8632
|
});
|
|
8636
8633
|
}
|
|
8637
8634
|
};
|
|
8638
|
-
|
|
8635
|
+
Qa = Za = O([x("KawaseTransition")], Qa);
|
|
8639
8636
|
//#endregion
|
|
8640
8637
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
8641
|
-
var
|
|
8638
|
+
var $a, eo = class extends Mr {
|
|
8642
8639
|
static {
|
|
8643
|
-
|
|
8640
|
+
$a = this;
|
|
8644
8641
|
}
|
|
8645
8642
|
static material = new F({ gl: {
|
|
8646
8643
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8647
8644
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
|
|
8648
8645
|
} });
|
|
8649
8646
|
apply(e) {
|
|
8650
|
-
I.draw(e,
|
|
8647
|
+
I.draw(e, $a.material, {
|
|
8651
8648
|
previous: 0,
|
|
8652
8649
|
next: 1,
|
|
8653
8650
|
progress: this.currentTimeProgress
|
|
8654
8651
|
});
|
|
8655
8652
|
}
|
|
8656
8653
|
};
|
|
8657
|
-
|
|
8654
|
+
eo = $a = O([x("LeftEraseTransition")], eo);
|
|
8658
8655
|
//#endregion
|
|
8659
8656
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
8660
|
-
var
|
|
8657
|
+
var to, no = class extends Mr {
|
|
8661
8658
|
static {
|
|
8662
|
-
|
|
8659
|
+
to = this;
|
|
8663
8660
|
}
|
|
8664
8661
|
blur = 100;
|
|
8665
8662
|
gradientBlur = 600;
|
|
@@ -8671,7 +8668,7 @@ var $a, eo = class extends Mr {
|
|
|
8671
8668
|
let n = this.currentTimeProgress, r, i;
|
|
8672
8669
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8673
8670
|
let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
|
|
8674
|
-
I.draw(e,
|
|
8671
|
+
I.draw(e, to.material, {
|
|
8675
8672
|
sampler: r,
|
|
8676
8673
|
progress: i,
|
|
8677
8674
|
blur: this.blur,
|
|
@@ -8680,7 +8677,7 @@ var $a, eo = class extends Mr {
|
|
|
8680
8677
|
end: c,
|
|
8681
8678
|
delta: [u / f, d / f],
|
|
8682
8679
|
texSize: l
|
|
8683
|
-
}), I.draw(e,
|
|
8680
|
+
}), I.draw(e, to.material, {
|
|
8684
8681
|
sampler: r,
|
|
8685
8682
|
progress: i,
|
|
8686
8683
|
blur: this.blur,
|
|
@@ -8692,12 +8689,12 @@ var $a, eo = class extends Mr {
|
|
|
8692
8689
|
});
|
|
8693
8690
|
}
|
|
8694
8691
|
};
|
|
8695
|
-
|
|
8692
|
+
no = to = O([x("TiltShiftTransition")], no);
|
|
8696
8693
|
//#endregion
|
|
8697
8694
|
//#region src/scene/transitions/TwistTransition.ts
|
|
8698
|
-
var
|
|
8695
|
+
var ro, io = class extends Mr {
|
|
8699
8696
|
static {
|
|
8700
|
-
|
|
8697
|
+
ro = this;
|
|
8701
8698
|
}
|
|
8702
8699
|
radius;
|
|
8703
8700
|
angle = 4;
|
|
@@ -8711,7 +8708,7 @@ var to, no = class extends Mr {
|
|
|
8711
8708
|
let n = this.currentTimeProgress, r, i;
|
|
8712
8709
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8713
8710
|
let a = t.width, o = t.height;
|
|
8714
|
-
I.draw(e,
|
|
8711
|
+
I.draw(e, ro.material, {
|
|
8715
8712
|
sampler: r,
|
|
8716
8713
|
progress: i,
|
|
8717
8714
|
filterArea: [
|
|
@@ -8727,10 +8724,10 @@ var to, no = class extends Mr {
|
|
|
8727
8724
|
});
|
|
8728
8725
|
}
|
|
8729
8726
|
};
|
|
8730
|
-
|
|
8727
|
+
io = ro = O([x("TwistTransition")], io);
|
|
8731
8728
|
//#endregion
|
|
8732
8729
|
//#region src/asset/loaders/GifLoader.ts
|
|
8733
|
-
var
|
|
8730
|
+
var ao = class extends Rn {
|
|
8734
8731
|
install(e) {
|
|
8735
8732
|
let t = async (t) => {
|
|
8736
8733
|
let { decodeFrames: n } = await import("modern-gif");
|
|
@@ -8747,14 +8744,14 @@ var ro = class extends Rn {
|
|
|
8747
8744
|
e.register(n, t);
|
|
8748
8745
|
}), e.gif = this, this;
|
|
8749
8746
|
}
|
|
8750
|
-
},
|
|
8747
|
+
}, oo = class extends Rn {
|
|
8751
8748
|
install(e) {
|
|
8752
8749
|
let t = async (e) => JSON.parse(await e.text());
|
|
8753
8750
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
8754
8751
|
e.register(n, t);
|
|
8755
8752
|
}), e.json = this, this;
|
|
8756
8753
|
}
|
|
8757
|
-
},
|
|
8754
|
+
}, so = class extends Rn {
|
|
8758
8755
|
install(e) {
|
|
8759
8756
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
8760
8757
|
container: null,
|
|
@@ -8765,12 +8762,12 @@ var ro = class extends Rn {
|
|
|
8765
8762
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
8766
8763
|
}), e.lottie = this, this;
|
|
8767
8764
|
}
|
|
8768
|
-
},
|
|
8765
|
+
}, co = class extends Rn {
|
|
8769
8766
|
install(e) {
|
|
8770
8767
|
let t = async (e) => e.text();
|
|
8771
8768
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
8772
8769
|
}
|
|
8773
|
-
},
|
|
8770
|
+
}, lo = class extends Rn {
|
|
8774
8771
|
install(e) {
|
|
8775
8772
|
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new R({
|
|
8776
8773
|
source: e,
|
|
@@ -8794,11 +8791,11 @@ var ro = class extends Rn {
|
|
|
8794
8791
|
e.register(n, t);
|
|
8795
8792
|
}), e.texture = this, this;
|
|
8796
8793
|
}
|
|
8797
|
-
},
|
|
8794
|
+
}, uo = class extends Rn {
|
|
8798
8795
|
install(e) {
|
|
8799
8796
|
return this.load = (t) => e.awaitBy(() => new cr(t).load()), e.video = this, this;
|
|
8800
8797
|
}
|
|
8801
|
-
},
|
|
8798
|
+
}, fo = Object.entries({
|
|
8802
8799
|
"font/woff": ["woff"],
|
|
8803
8800
|
"font/ttf": ["ttf"],
|
|
8804
8801
|
"font/otf": ["otf"],
|
|
@@ -8814,31 +8811,31 @@ var ro = class extends Rn {
|
|
|
8814
8811
|
"image/webp": ["webp"],
|
|
8815
8812
|
"application/json": ["json"]
|
|
8816
8813
|
});
|
|
8817
|
-
function
|
|
8818
|
-
for (let [t, n] of
|
|
8814
|
+
function po(e) {
|
|
8815
|
+
for (let [t, n] of fo) if (n.includes(e)) return t;
|
|
8819
8816
|
}
|
|
8820
|
-
function
|
|
8817
|
+
function mo(e) {
|
|
8821
8818
|
let t;
|
|
8822
8819
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
8823
8820
|
else if (e.startsWith("http")) {
|
|
8824
8821
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
8825
|
-
n && (t =
|
|
8822
|
+
n && (t = po(n));
|
|
8826
8823
|
}
|
|
8827
8824
|
return t;
|
|
8828
8825
|
}
|
|
8829
8826
|
//#endregion
|
|
8830
8827
|
//#region src/asset/Assets.ts
|
|
8831
|
-
var
|
|
8828
|
+
var ho = "WeakRef" in globalThis, go = class extends e {
|
|
8832
8829
|
defaultHandler = (e) => e;
|
|
8833
8830
|
_handlers = /* @__PURE__ */ new Map();
|
|
8834
8831
|
_handleing = /* @__PURE__ */ new Map();
|
|
8835
8832
|
_handled = /* @__PURE__ */ new Map();
|
|
8836
|
-
_gc =
|
|
8833
|
+
_gc = ho ? new FinalizationRegistry((e) => {
|
|
8837
8834
|
let t = this.get(e);
|
|
8838
8835
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
8839
8836
|
}) : void 0;
|
|
8840
8837
|
constructor() {
|
|
8841
|
-
super(),
|
|
8838
|
+
super(), ho || S.on(this.gc.bind(this), { sort: 2 });
|
|
8842
8839
|
}
|
|
8843
8840
|
use(e) {
|
|
8844
8841
|
return e.install(this), this;
|
|
@@ -8887,11 +8884,11 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
8887
8884
|
}
|
|
8888
8885
|
get(e) {
|
|
8889
8886
|
let t = this._handled.get(e);
|
|
8890
|
-
return
|
|
8887
|
+
return ho && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
8891
8888
|
}
|
|
8892
8889
|
set(e, t) {
|
|
8893
8890
|
let n = t;
|
|
8894
|
-
|
|
8891
|
+
ho && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
8895
8892
|
}
|
|
8896
8893
|
async awaitBy(e) {
|
|
8897
8894
|
let t = e(), n = c();
|
|
@@ -8906,7 +8903,7 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
8906
8903
|
return this._handleing.set(e, r), r;
|
|
8907
8904
|
}
|
|
8908
8905
|
async load(e, t) {
|
|
8909
|
-
let n = await this.loadBy(e), r =
|
|
8906
|
+
let n = await this.loadBy(e), r = mo(e);
|
|
8910
8907
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
8911
8908
|
}
|
|
8912
8909
|
async waitUntilLoad() {
|
|
@@ -8920,14 +8917,14 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
8920
8917
|
n && "destroy" in n && n.destroy();
|
|
8921
8918
|
}), this._handled.clear();
|
|
8922
8919
|
}
|
|
8923
|
-
}, $ = new
|
|
8920
|
+
}, $ = new go().use(new zn()).use(new ao()).use(new oo()).use(new so()).use(new co()).use(new lo()).use(new uo()), _o = {
|
|
8924
8921
|
alpha: !0,
|
|
8925
8922
|
stencil: !0,
|
|
8926
8923
|
antialias: !1,
|
|
8927
8924
|
premultipliedAlpha: !0,
|
|
8928
8925
|
preserveDrawingBuffer: !1,
|
|
8929
8926
|
powerPreference: "default"
|
|
8930
|
-
},
|
|
8927
|
+
}, vo = class extends Ar {
|
|
8931
8928
|
renderer;
|
|
8932
8929
|
get view() {
|
|
8933
8930
|
return this.renderer.view;
|
|
@@ -8960,12 +8957,12 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
8960
8957
|
constructor(e = {}) {
|
|
8961
8958
|
let { view: t, width: n, height: r, pixelRatio: i = Ke, autoResize: a, data: o } = e;
|
|
8962
8959
|
super(), this.renderer = new Ln(t, {
|
|
8963
|
-
alpha:
|
|
8964
|
-
stencil:
|
|
8965
|
-
antialias:
|
|
8966
|
-
premultipliedAlpha:
|
|
8967
|
-
preserveDrawingBuffer:
|
|
8968
|
-
powerPreference:
|
|
8960
|
+
alpha: _o.alpha ?? e.alpha,
|
|
8961
|
+
stencil: _o.stencil ?? e.stencil,
|
|
8962
|
+
antialias: _o.antialias ?? e.antialias,
|
|
8963
|
+
premultipliedAlpha: _o.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
8964
|
+
preserveDrawingBuffer: _o.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
8965
|
+
powerPreference: _o.powerPreference ?? e.powerPreference
|
|
8969
8966
|
}), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
|
|
8970
8967
|
}
|
|
8971
8968
|
_updateProperty(e, t, n) {
|
|
@@ -9048,22 +9045,22 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
9048
9045
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9049
9046
|
}
|
|
9050
9047
|
};
|
|
9051
|
-
O([_({ fallback: !1 }), D("design:type", Boolean)],
|
|
9048
|
+
O([_({ fallback: !1 }), D("design:type", Boolean)], vo.prototype, "autoResize", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], vo.prototype, "autoStart", void 0);
|
|
9052
9049
|
//#endregion
|
|
9053
9050
|
//#region src/render.ts
|
|
9054
|
-
var
|
|
9055
|
-
function
|
|
9056
|
-
return
|
|
9051
|
+
var yo, bo = [], xo = !1;
|
|
9052
|
+
function So() {
|
|
9053
|
+
return yo ??= new vo({
|
|
9057
9054
|
pixelRatio: 1,
|
|
9058
9055
|
width: 1,
|
|
9059
9056
|
height: 1,
|
|
9060
9057
|
preserveDrawingBuffer: !0
|
|
9061
9058
|
});
|
|
9062
9059
|
}
|
|
9063
|
-
async function
|
|
9064
|
-
if (!
|
|
9065
|
-
for (
|
|
9066
|
-
let t =
|
|
9060
|
+
async function Co(e = 100) {
|
|
9061
|
+
if (!xo) {
|
|
9062
|
+
for (xo = !0; bo.length;) {
|
|
9063
|
+
let t = bo.shift();
|
|
9067
9064
|
if (t) try {
|
|
9068
9065
|
await t();
|
|
9069
9066
|
} catch (e) {
|
|
@@ -9071,11 +9068,11 @@ async function xo(e = 100) {
|
|
|
9071
9068
|
}
|
|
9072
9069
|
else await new Promise((t) => setTimeout(t, e));
|
|
9073
9070
|
}
|
|
9074
|
-
|
|
9071
|
+
xo = !1;
|
|
9075
9072
|
}
|
|
9076
9073
|
}
|
|
9077
|
-
async function
|
|
9078
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f =
|
|
9074
|
+
async function wo(e) {
|
|
9075
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = So();
|
|
9079
9076
|
if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resize(u, d, !0), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitAndRender(), o.length) {
|
|
9080
9077
|
let e = o.length, t = o[e - 1];
|
|
9081
9078
|
for (let n = 0; n < e; n++) {
|
|
@@ -9093,15 +9090,15 @@ async function So(e) {
|
|
|
9093
9090
|
toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
|
|
9094
9091
|
};
|
|
9095
9092
|
}
|
|
9096
|
-
async function
|
|
9093
|
+
async function To(e) {
|
|
9097
9094
|
return new Promise((t) => {
|
|
9098
|
-
|
|
9095
|
+
bo.push(async () => t(await wo(e).then((e) => e.toCanvas2D()))), Co();
|
|
9099
9096
|
});
|
|
9100
9097
|
}
|
|
9101
|
-
async function
|
|
9098
|
+
async function Eo(e) {
|
|
9102
9099
|
return new Promise((t) => {
|
|
9103
|
-
|
|
9100
|
+
bo.push(async () => t(await wo(e).then((e) => e.pixels))), Co();
|
|
9104
9101
|
});
|
|
9105
9102
|
}
|
|
9106
9103
|
//#endregion
|
|
9107
|
-
export { mt as Aabb2D, nr as AnimatedTexture,
|
|
9104
|
+
export { mt as Aabb2D, nr as AnimatedTexture, Fa as Animation, go as Assets, qa as Audio, za as AudioPipeline, Ba as AudioProcessor, Ja as AudioSpectrum, Xa as AudioWaveform, k as BufferUsage, Ir as Camera2D, ur as CanvasContext, Cr as CanvasItem, rr as CanvasTexture, T as Color, U as ColorAdjustEffect, Yr as ColorFilterEffect, vt as ColorMatrix, $r as ColorOverlayEffect, ni as ColorRemoveEffect, oi as ColorReplaceEffect, ir as ColorTexture, C as CoreObject, ht as DEG_TO_RAD, Ke as DEVICE_PIXEL_RATIO, W as DrawboardEffect, gi as DropShadowEffect, H as Effect, $n as EffectMaterial, ya as Element2D, Hi as Element2DBackground, Y as Element2DChart, Ki as Element2DConnection, J as Element2DFill, Ji as Element2DForeground, Yi as Element2DOutline, Xi as Element2DShadow, Zi as Element2DShape, Qi as Element2DStyle, na as Element2DTable, X as Element2DText, yi as EmbossEffect, vo as Engine, pa as Flexbox, zn as FontLoader, pi as GaussianBlurEffect, Wn as Geometry, ao as GifLoader, on as GlBatch2DSystem, tn as GlBlendMode, Ct as GlBuffer, jt as GlBufferSystem, St as GlBufferTarget, un as GlMaskSystem, Ut as GlProgram, mn as GlRenderTarget, hn as GlRenderTargetSystem, Qt as GlShaderSystem, rn as GlState, an as GlStateSystem, fn as GlStencilSystem, A as GlSystem, pn as GlViewportSystem, G as GlitchEffect, K as GodrayEffect, ar as GradientTexture, Ra as HTMLAudio, Ia as HTMLAudioContext, La as HTMLSound, We as IN_BROWSER, Ge as IN_MAC_OS, Vn as IndexBuffer, ft as Input, ot as InputEvent, oo as JsonLoader, Oi as KawaseBlurEffect, Qa as KawaseTransition, st as KeyboardInputEvent, eo as LeftEraseTransition, Rn as Loader, Ca as Lottie2D, so as LottieLoader, xt as MainLoop, ji as MaskEffect, F as Material, fr as Meta, ct as MouseInputEvent, z as Node, Pr as Node2D, yt as Obb2D, q as OutlineEffect, ye as PI, be as PI_2, Li as PixelateEffect, or as PixelsTexture, lt as PointerInputEvent, bt as Projection2D, qn as QuadGeometry, I as QuadUvGeometry, gt as RAD_TO_DEG, pt as RefCounted, L as RenderTarget, Tt as Renderer, w as Resource, ze as SUPPORTS_AUDIO_CONTEXT, Le as SUPPORTS_CLICK_EVENTS, Re as SUPPORTS_CREATE_IMAGE_BITMAP, je as SUPPORTS_IMAGE_BITMAP, Fe as SUPPORTS_MOUSE_EVENTS, Ve as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Ne as SUPPORTS_POINTER_EVENTS, Me as SUPPORTS_RESIZE_OBSERVER, Ie as SUPPORTS_TOUCH_EVENTS, Ae as SUPPORTS_WEBGL2, Be as SUPPORTS_WEBKIT_AUDIO_CONTEXT, He as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ue as SUPPORTS_WEB_AUDIO, Pe as SUPPORTS_WHEEL_EVENTS, Ar as SceneTree, co as TextLoader, R as Texture2D, lo as TextureLoader, xa as TextureRect2D, S as Ticker, no as TiltShiftTransition, Or as Timeline, B as TimelineNode, wa as TransformRect2D, Mr as Transition, io as TwistTransition, Dt as UniformGroup, tr as UvGeometry, er as UvMaterial, P as VertexAttribute, N as VertexBuffer, Ea as Video2D, uo as VideoLoader, cr as VideoTexture, V as Viewport, lr as ViewportTexture, Ga as WebAudio, Ua as WebAudioContext, Ln as WebGLRenderer, Wa as WebSound, ut as WheelInputEvent, kr as Window, Bi as ZoomBlurEffect, Q as alignMap, $ as assets, Lr as axisDir, fa as boxSizingMap, _t as clamp, Di as clampFrag, tt as createHTMLCanvas, At as createIdFromString, _e as createNode, rt as crossOrigin, Na as cubicBezier, x as customNode, ge as customNodes, _o as defaultOptions, nt as determineCrossOrigin, oa as directionMap, aa as displayMap, ka as ease, Aa as easeIn, Ma as easeInOut, ja as easeOut, Z as edgeMap, sa as flexDirectionMap, ca as flexWrapMap, Ei as frag, et as getCanvasFactory, Te as getDefaultCssPropertyValue, So as getRenderEngine, ia as gutterMap, at as instanceId, Xe as isCanvasElement, qe as isElementNode, Ye as isImageElement, xe as isPow2, Je as isVideoElement, Ze as isWebgl2, la as justifyMap, E as lerp, Oa as linear, cn as log2, nn as mapGlBlendModes, sn as nextPow2, ve as nextTick, ua as overflowMap, Ur as parseCssFilter, De as parseCssFunctions, Ee as parseCssProperty, Wr as parseCssTransformOrigin, da as positionTypeMap, To as render, Eo as renderPixels, xr as resetBatchPool, Rr as routeConnection, $e as setCanvasFactory, dn as stencilModeMap, Pa as timingFunctions };
|