modern-canvas 0.20.1 → 0.21.2
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 +284 -292
- package/dist/scene/2d/element/Element2DChart.d.ts +17 -17
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -6307,17 +6307,38 @@ 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;
|
|
6321
6342
|
_dirty = !1;
|
|
6322
6343
|
_scheduled = !1;
|
|
6323
6344
|
constructor(e) {
|
|
@@ -6349,139 +6370,110 @@ var Ui = [
|
|
|
6349
6370
|
isValid() {
|
|
6350
6371
|
return !!(this.enabled && this.series.some((e) => e.values.length));
|
|
6351
6372
|
}
|
|
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
|
-
}
|
|
6373
|
+
async update() {
|
|
6374
|
+
this._dirty = !1;
|
|
6378
6375
|
let { width: e, height: t } = this._parent.size;
|
|
6379
|
-
if (!e || !t) {
|
|
6380
|
-
this._parent.requestDraw();
|
|
6376
|
+
if (!this.isValid() || !e || !t) {
|
|
6377
|
+
this._teardown(), this._parent.requestDraw();
|
|
6381
6378
|
return;
|
|
6382
6379
|
}
|
|
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;
|
|
6380
|
+
let n = await Wi();
|
|
6381
|
+
if (!n) {
|
|
6382
|
+
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)");
|
|
6383
|
+
return;
|
|
6400
6384
|
}
|
|
6401
|
-
this.
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
}
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
this.
|
|
6420
|
-
|
|
6421
|
-
|
|
6385
|
+
if (!(this.destroyed || !this.isValid())) {
|
|
6386
|
+
if (!this._instance) {
|
|
6387
|
+
if (typeof document > "u") {
|
|
6388
|
+
console.warn("[modern-canvas] echarts chart rendering requires a DOM environment");
|
|
6389
|
+
return;
|
|
6390
|
+
}
|
|
6391
|
+
this._container = document.createElement("div"), this._instance = n.init(this._container, void 0, {
|
|
6392
|
+
renderer: "canvas",
|
|
6393
|
+
width: e,
|
|
6394
|
+
height: t
|
|
6395
|
+
}), this._instance.on("finished", () => {
|
|
6396
|
+
this._texture?.requestUpdate("source"), this._parent.requestDraw();
|
|
6397
|
+
});
|
|
6398
|
+
}
|
|
6399
|
+
if (this._instance.resize({
|
|
6400
|
+
width: e,
|
|
6401
|
+
height: t
|
|
6402
|
+
}), this._instance.setOption(this._toOption(), !0), !this._texture) {
|
|
6403
|
+
let e = this._container.querySelector("canvas");
|
|
6404
|
+
if (!e) return;
|
|
6405
|
+
this._texture = new rr({
|
|
6406
|
+
source: e,
|
|
6407
|
+
pixelRatio: 1
|
|
6422
6408
|
});
|
|
6423
6409
|
}
|
|
6410
|
+
this._texture.requestUpdate("source"), this._parent.requestDraw();
|
|
6424
6411
|
}
|
|
6425
6412
|
}
|
|
6426
|
-
|
|
6427
|
-
let
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
style: {
|
|
6436
|
-
left: 0,
|
|
6437
|
-
top: 0,
|
|
6438
|
-
width: e,
|
|
6439
|
-
height: t
|
|
6440
|
-
},
|
|
6441
|
-
shape: { svg: g },
|
|
6442
|
-
...o ? {
|
|
6443
|
-
fill: { color: p },
|
|
6444
|
-
outline: {
|
|
6445
|
-
color: p,
|
|
6446
|
-
width: 2
|
|
6447
|
-
}
|
|
6448
|
-
} : { outline: {
|
|
6449
|
-
color: p,
|
|
6450
|
-
width: 2
|
|
6451
|
-
} }
|
|
6452
|
-
});
|
|
6453
|
-
}
|
|
6413
|
+
draw() {
|
|
6414
|
+
let e = this._texture;
|
|
6415
|
+
if (!e?.isValid()) return;
|
|
6416
|
+
let { width: t, height: n } = this._parent.size, r = this._parent.context;
|
|
6417
|
+
this._parent.shape.draw(!0), r.fillStyle = e;
|
|
6418
|
+
let { a: i, c: a, tx: o, b: s, d: c, ty: l } = new v().scale(1 / t, 1 / n), u, d;
|
|
6419
|
+
r.fill({ transformUv: (e, t) => {
|
|
6420
|
+
u = e[t], d = e[t + 1], e[t] = i * u + a * d + o, e[t + 1] = s * u + c * d + l;
|
|
6421
|
+
} });
|
|
6454
6422
|
}
|
|
6455
|
-
|
|
6456
|
-
let
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
this.
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
});
|
|
6423
|
+
_toOption() {
|
|
6424
|
+
let { type: e, categories: t } = this, n = e === "pie" || e === "doughnut", r = e === "bar", i = this.grouping === "stacked" || this.grouping === "percentStacked", a = {
|
|
6425
|
+
title: this.title ? {
|
|
6426
|
+
text: this.title,
|
|
6427
|
+
left: "center"
|
|
6428
|
+
} : void 0,
|
|
6429
|
+
legend: Gi(this.legend),
|
|
6430
|
+
tooltip: {}
|
|
6431
|
+
};
|
|
6432
|
+
if (n) {
|
|
6433
|
+
let n = this.series[0];
|
|
6434
|
+
return a.series = [{
|
|
6435
|
+
type: "pie",
|
|
6436
|
+
radius: e === "doughnut" ? ["45%", "70%"] : "70%",
|
|
6437
|
+
data: (n?.values ?? []).map((e, n) => ({
|
|
6438
|
+
value: e,
|
|
6439
|
+
name: t[n] ?? String(n)
|
|
6440
|
+
}))
|
|
6441
|
+
}], a;
|
|
6475
6442
|
}
|
|
6443
|
+
let o = {
|
|
6444
|
+
type: "value",
|
|
6445
|
+
show: this.valueAxis?.visible !== !1,
|
|
6446
|
+
name: this.valueAxis?.title,
|
|
6447
|
+
min: this.valueAxis?.min,
|
|
6448
|
+
max: this.valueAxis?.max
|
|
6449
|
+
}, s = {
|
|
6450
|
+
type: "category",
|
|
6451
|
+
data: t,
|
|
6452
|
+
show: this.categoryAxis?.visible !== !1,
|
|
6453
|
+
name: this.categoryAxis?.title
|
|
6454
|
+
};
|
|
6455
|
+
a.xAxis = r ? o : s, a.yAxis = r ? s : o;
|
|
6456
|
+
let c = e === "column" || e === "bar" ? "bar" : e === "area" ? "line" : e;
|
|
6457
|
+
return a.series = this.series.map((t) => ({
|
|
6458
|
+
name: t.name,
|
|
6459
|
+
type: c,
|
|
6460
|
+
data: e === "scatter" && t.xValues ? t.values.map((e, n) => [t.xValues[n], e]) : t.values,
|
|
6461
|
+
stack: i ? "total" : void 0,
|
|
6462
|
+
areaStyle: e === "area" ? {} : void 0,
|
|
6463
|
+
itemStyle: t.color ? { color: t.color } : void 0
|
|
6464
|
+
})), a;
|
|
6465
|
+
}
|
|
6466
|
+
_teardown() {
|
|
6467
|
+
this._instance?.dispose(), this._instance = void 0, this._container = void 0, this._texture = void 0;
|
|
6476
6468
|
}
|
|
6477
6469
|
_destroy() {
|
|
6478
|
-
this.
|
|
6470
|
+
this._teardown();
|
|
6479
6471
|
}
|
|
6480
6472
|
};
|
|
6481
6473
|
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
6474
|
//#endregion
|
|
6483
6475
|
//#region src/scene/2d/element/Element2DConnection.ts
|
|
6484
|
-
var
|
|
6476
|
+
var Ki = class extends C {
|
|
6485
6477
|
_parent;
|
|
6486
6478
|
_routeSig;
|
|
6487
6479
|
_routePath;
|
|
@@ -6519,7 +6511,7 @@ var Gi = class extends C {
|
|
|
6519
6511
|
y: Math.sin(n.ang)
|
|
6520
6512
|
}, {
|
|
6521
6513
|
point: e,
|
|
6522
|
-
dir:
|
|
6514
|
+
dir: qi(r, t.globalRotation)
|
|
6523
6515
|
};
|
|
6524
6516
|
}
|
|
6525
6517
|
}
|
|
@@ -6536,8 +6528,8 @@ var Gi = class extends C {
|
|
|
6536
6528
|
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Rr(this.mode, e ?? t, t ?? e)), this._routePath;
|
|
6537
6529
|
}
|
|
6538
6530
|
};
|
|
6539
|
-
O([_(), D("design:type", Object)],
|
|
6540
|
-
function
|
|
6531
|
+
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);
|
|
6532
|
+
function qi(e, t) {
|
|
6541
6533
|
if (!t) return e;
|
|
6542
6534
|
let n = Math.cos(t), r = Math.sin(t);
|
|
6543
6535
|
return {
|
|
@@ -6547,7 +6539,7 @@ function Ki(e, t) {
|
|
|
6547
6539
|
}
|
|
6548
6540
|
//#endregion
|
|
6549
6541
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6550
|
-
var
|
|
6542
|
+
var Ji = class extends J {
|
|
6551
6543
|
setProperties(e) {
|
|
6552
6544
|
return super._setProperties(d(e) ? void 0 : g(e));
|
|
6553
6545
|
}
|
|
@@ -6559,10 +6551,10 @@ var qi = class extends J {
|
|
|
6559
6551
|
}
|
|
6560
6552
|
}
|
|
6561
6553
|
};
|
|
6562
|
-
O([_(), D("design:type", Object)],
|
|
6554
|
+
O([_(), D("design:type", Object)], Ji.prototype, "fillWithShape", void 0);
|
|
6563
6555
|
//#endregion
|
|
6564
6556
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6565
|
-
var
|
|
6557
|
+
var Yi = class extends J {
|
|
6566
6558
|
setProperties(e) {
|
|
6567
6559
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6568
6560
|
}
|
|
@@ -6590,10 +6582,10 @@ var Ji = class extends J {
|
|
|
6590
6582
|
}) });
|
|
6591
6583
|
}
|
|
6592
6584
|
};
|
|
6593
|
-
O([_(), D("design:type", Object)],
|
|
6585
|
+
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
6586
|
//#endregion
|
|
6595
6587
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
6596
|
-
var
|
|
6588
|
+
var Xi = class extends C {
|
|
6597
6589
|
_parent;
|
|
6598
6590
|
constructor(e) {
|
|
6599
6591
|
super(), this._parent = e;
|
|
@@ -6617,10 +6609,10 @@ var Yi = class extends C {
|
|
|
6617
6609
|
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
6610
|
}
|
|
6619
6611
|
};
|
|
6620
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6612
|
+
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
6613
|
//#endregion
|
|
6622
6614
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
6623
|
-
var
|
|
6615
|
+
var Zi = class extends C {
|
|
6624
6616
|
_parent;
|
|
6625
6617
|
_path2DSet = new le();
|
|
6626
6618
|
_localPath;
|
|
@@ -6718,24 +6710,24 @@ var Xi = class extends C {
|
|
|
6718
6710
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
6719
6711
|
}
|
|
6720
6712
|
};
|
|
6721
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6713
|
+
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
6714
|
//#endregion
|
|
6723
6715
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
6724
|
-
var
|
|
6716
|
+
var Qi = class extends w {
|
|
6725
6717
|
constructor(e) {
|
|
6726
6718
|
super(), this.setProperties(e);
|
|
6727
6719
|
}
|
|
6728
|
-
},
|
|
6720
|
+
}, $i = {
|
|
6729
6721
|
...o(),
|
|
6730
6722
|
left: 0,
|
|
6731
6723
|
top: 0,
|
|
6732
6724
|
width: 0,
|
|
6733
6725
|
height: 0
|
|
6734
6726
|
};
|
|
6735
|
-
for (let e in
|
|
6727
|
+
for (let e in $i) i(Qi, e, { fallback: $i[e] });
|
|
6736
6728
|
//#endregion
|
|
6737
6729
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
6738
|
-
var
|
|
6730
|
+
var ea = 100, ta = 40, na = class extends C {
|
|
6739
6731
|
_parent;
|
|
6740
6732
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
6741
6733
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -6766,10 +6758,10 @@ var $i = 100, ea = 40, ta = class extends C {
|
|
|
6766
6758
|
return !!(this.enabled && this.cells.length);
|
|
6767
6759
|
}
|
|
6768
6760
|
get gridWidth() {
|
|
6769
|
-
return this.columns.reduce((e, t) => e + (t.width ||
|
|
6761
|
+
return this.columns.reduce((e, t) => e + (t.width || ea), 0);
|
|
6770
6762
|
}
|
|
6771
6763
|
get gridHeight() {
|
|
6772
|
-
return this.rows.reduce((e, t) => e + (t.height ||
|
|
6764
|
+
return this.rows.reduce((e, t) => e + (t.height || ta), 0);
|
|
6773
6765
|
}
|
|
6774
6766
|
update() {
|
|
6775
6767
|
if (this._dirty = !1, !this.isValid()) {
|
|
@@ -6779,9 +6771,9 @@ var $i = 100, ea = 40, ta = class extends C {
|
|
|
6779
6771
|
let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
|
|
6780
6772
|
for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
|
|
6781
6773
|
let a = [0];
|
|
6782
|
-
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width ||
|
|
6774
|
+
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || ea));
|
|
6783
6775
|
let o = [0];
|
|
6784
|
-
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height ||
|
|
6776
|
+
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || ta));
|
|
6785
6777
|
this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
|
|
6786
6778
|
let s = /* @__PURE__ */ new Set();
|
|
6787
6779
|
for (let e of n) {
|
|
@@ -6818,10 +6810,10 @@ var $i = 100, ea = 40, ta = class extends C {
|
|
|
6818
6810
|
this._clearCells();
|
|
6819
6811
|
}
|
|
6820
6812
|
};
|
|
6821
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6813
|
+
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
6814
|
//#endregion
|
|
6823
6815
|
//#region src/scene/2d/element/Element2DText.ts
|
|
6824
|
-
var
|
|
6816
|
+
var ra, X = class extends C {
|
|
6825
6817
|
_parent;
|
|
6826
6818
|
base;
|
|
6827
6819
|
get textContent() {
|
|
@@ -6974,7 +6966,7 @@ var na, X = class extends C {
|
|
|
6974
6966
|
}
|
|
6975
6967
|
process(e) {}
|
|
6976
6968
|
};
|
|
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 (
|
|
6969
|
+
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
6970
|
//#endregion
|
|
6979
6971
|
//#region src/scene/2d/element/Flexbox.ts
|
|
6980
6972
|
var Z = {
|
|
@@ -6987,7 +6979,7 @@ var Z = {
|
|
|
6987
6979
|
horizontal: 6,
|
|
6988
6980
|
vertical: 7,
|
|
6989
6981
|
all: 8
|
|
6990
|
-
},
|
|
6982
|
+
}, ia = {
|
|
6991
6983
|
column: 0,
|
|
6992
6984
|
row: 1,
|
|
6993
6985
|
all: 2
|
|
@@ -7001,42 +6993,42 @@ var Z = {
|
|
|
7001
6993
|
"space-between": 6,
|
|
7002
6994
|
"space-around": 7,
|
|
7003
6995
|
"space-evenly": 8
|
|
7004
|
-
},
|
|
6996
|
+
}, aa = {
|
|
7005
6997
|
flex: 0,
|
|
7006
6998
|
none: 1,
|
|
7007
6999
|
contents: 2
|
|
7008
|
-
},
|
|
7000
|
+
}, oa = {
|
|
7009
7001
|
inherit: 0,
|
|
7010
7002
|
ltr: 1,
|
|
7011
7003
|
rtl: 2
|
|
7012
|
-
},
|
|
7004
|
+
}, sa = {
|
|
7013
7005
|
column: 0,
|
|
7014
7006
|
"column-reverse": 1,
|
|
7015
7007
|
row: 2,
|
|
7016
7008
|
"row-reverse": 3
|
|
7017
|
-
},
|
|
7009
|
+
}, ca = {
|
|
7018
7010
|
"no-wrap": 0,
|
|
7019
7011
|
wrap: 1,
|
|
7020
7012
|
"Wrap-reverse": 2
|
|
7021
|
-
},
|
|
7013
|
+
}, la = {
|
|
7022
7014
|
"flex-start": 0,
|
|
7023
7015
|
center: 1,
|
|
7024
7016
|
"flex-end": 2,
|
|
7025
7017
|
"space-between": 3,
|
|
7026
7018
|
"space-around": 4,
|
|
7027
7019
|
"space-evenly": 5
|
|
7028
|
-
},
|
|
7020
|
+
}, ua = {
|
|
7029
7021
|
visible: 0,
|
|
7030
7022
|
hidden: 1,
|
|
7031
7023
|
scroll: 2
|
|
7032
|
-
},
|
|
7024
|
+
}, da = {
|
|
7033
7025
|
static: 0,
|
|
7034
7026
|
relative: 1,
|
|
7035
7027
|
absolute: 2
|
|
7036
|
-
},
|
|
7028
|
+
}, fa = {
|
|
7037
7029
|
"border-box": 0,
|
|
7038
7030
|
"content-box": 1
|
|
7039
|
-
},
|
|
7031
|
+
}, pa = class e {
|
|
7040
7032
|
_parent;
|
|
7041
7033
|
static _yoga;
|
|
7042
7034
|
static async load() {
|
|
@@ -7048,14 +7040,14 @@ var Z = {
|
|
|
7048
7040
|
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
7041
|
}
|
|
7050
7042
|
_addChild(e, t) {
|
|
7051
|
-
if (e instanceof
|
|
7043
|
+
if (e instanceof ya && e.flexbox.node && this.node) {
|
|
7052
7044
|
this.node.insertChild(e.flexbox.node, t);
|
|
7053
7045
|
let n = e.style.getProperties();
|
|
7054
7046
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7055
7047
|
}
|
|
7056
7048
|
}
|
|
7057
7049
|
_removeChild(e, t) {
|
|
7058
|
-
e instanceof
|
|
7050
|
+
e instanceof ya && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7059
7051
|
}
|
|
7060
7052
|
updateStyleProperty(e, t) {
|
|
7061
7053
|
let n = this.node;
|
|
@@ -7089,10 +7081,10 @@ var Z = {
|
|
|
7089
7081
|
n.setBorder(Z.all, this._parent.style.borderWidth);
|
|
7090
7082
|
break;
|
|
7091
7083
|
case "direction":
|
|
7092
|
-
n.setDirection(t ?
|
|
7084
|
+
n.setDirection(t ? oa[t] ?? oa.inherit : oa.inherit);
|
|
7093
7085
|
break;
|
|
7094
7086
|
case "display":
|
|
7095
|
-
n.setDisplay(t ?
|
|
7087
|
+
n.setDisplay(t ? aa[t] ?? aa.flex : aa.flex);
|
|
7096
7088
|
break;
|
|
7097
7089
|
case "flex":
|
|
7098
7090
|
n.setFlex(t);
|
|
@@ -7101,7 +7093,7 @@ var Z = {
|
|
|
7101
7093
|
n.setFlexBasis(t);
|
|
7102
7094
|
break;
|
|
7103
7095
|
case "flexDirection":
|
|
7104
|
-
n.setFlexDirection(t ?
|
|
7096
|
+
n.setFlexDirection(t ? sa[t] ?? sa.row : sa.row);
|
|
7105
7097
|
break;
|
|
7106
7098
|
case "flexGrow":
|
|
7107
7099
|
n.setFlexGrow(t);
|
|
@@ -7110,16 +7102,16 @@ var Z = {
|
|
|
7110
7102
|
n.setFlexShrink(t);
|
|
7111
7103
|
break;
|
|
7112
7104
|
case "flexWrap":
|
|
7113
|
-
n.setFlexWrap(t ?
|
|
7105
|
+
n.setFlexWrap(t ? ca[t] ?? ca.wrap : ca.wrap);
|
|
7114
7106
|
break;
|
|
7115
7107
|
case "height":
|
|
7116
7108
|
n.setHeight(t);
|
|
7117
7109
|
break;
|
|
7118
7110
|
case "justifyContent":
|
|
7119
|
-
n.setJustifyContent(t ?
|
|
7111
|
+
n.setJustifyContent(t ? la[t] ?? la["flex-start"] : la["flex-start"]);
|
|
7120
7112
|
break;
|
|
7121
7113
|
case "gap":
|
|
7122
|
-
t !== void 0 && n.setGap(
|
|
7114
|
+
t !== void 0 && n.setGap(ia.all, t);
|
|
7123
7115
|
break;
|
|
7124
7116
|
case "marginTop":
|
|
7125
7117
|
n.setMargin(Z.top, t);
|
|
@@ -7149,7 +7141,7 @@ var Z = {
|
|
|
7149
7141
|
n.setMinWidth(t);
|
|
7150
7142
|
break;
|
|
7151
7143
|
case "overflow":
|
|
7152
|
-
n.setOverflow(t ?
|
|
7144
|
+
n.setOverflow(t ? ua[t] ?? ua.visible : ua.visible);
|
|
7153
7145
|
break;
|
|
7154
7146
|
case "paddingTop":
|
|
7155
7147
|
n.setPadding(Z.top, t);
|
|
@@ -7179,10 +7171,10 @@ var Z = {
|
|
|
7179
7171
|
n.setPosition(Z.right, t);
|
|
7180
7172
|
break;
|
|
7181
7173
|
case "position":
|
|
7182
|
-
n.setPositionType(t ?
|
|
7174
|
+
n.setPositionType(t ? da[t] ?? da.relative : da.relative);
|
|
7183
7175
|
break;
|
|
7184
7176
|
case "boxSizing":
|
|
7185
|
-
n.setBoxSizing(t ?
|
|
7177
|
+
n.setBoxSizing(t ? fa[t] ?? fa["content-box"] : fa["content-box"]);
|
|
7186
7178
|
break;
|
|
7187
7179
|
case "width":
|
|
7188
7180
|
n.setWidth(t);
|
|
@@ -7193,7 +7185,7 @@ var Z = {
|
|
|
7193
7185
|
}
|
|
7194
7186
|
update() {
|
|
7195
7187
|
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,
|
|
7188
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, oa.ltr), t.hasNewLayout())) {
|
|
7197
7189
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7198
7190
|
(!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
7191
|
}
|
|
@@ -7201,13 +7193,13 @@ var Z = {
|
|
|
7201
7193
|
destroy() {
|
|
7202
7194
|
this.node?.free(), this.node = void 0;
|
|
7203
7195
|
}
|
|
7204
|
-
},
|
|
7196
|
+
}, ma, ha = new Set(Object.keys(a())), ga = new Set(Object.keys(s())), _a = new y(), va = [
|
|
7205
7197
|
[0, 0],
|
|
7206
7198
|
[1, 0],
|
|
7207
7199
|
[1, 1],
|
|
7208
7200
|
[0, 1]
|
|
7209
|
-
],
|
|
7210
|
-
flexbox = new
|
|
7201
|
+
], ya = class extends Pr {
|
|
7202
|
+
flexbox = new pa(this);
|
|
7211
7203
|
aabb = new mt();
|
|
7212
7204
|
globalAabb = new mt();
|
|
7213
7205
|
_parentGlobalDisplay;
|
|
@@ -7220,7 +7212,7 @@ var Z = {
|
|
|
7220
7212
|
});
|
|
7221
7213
|
_allowPointerEvents = !0;
|
|
7222
7214
|
_overflowHidden = !1;
|
|
7223
|
-
_style = new
|
|
7215
|
+
_style = new Qi().on("updateProperty", (...e) => {
|
|
7224
7216
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
7225
7217
|
});
|
|
7226
7218
|
get style() {
|
|
@@ -7241,7 +7233,7 @@ var Z = {
|
|
|
7241
7233
|
set background(e) {
|
|
7242
7234
|
this._background.resetProperties().setProperties(e);
|
|
7243
7235
|
}
|
|
7244
|
-
_shape = new
|
|
7236
|
+
_shape = new Zi(this);
|
|
7245
7237
|
get shape() {
|
|
7246
7238
|
return this._shape;
|
|
7247
7239
|
}
|
|
@@ -7255,14 +7247,14 @@ var Z = {
|
|
|
7255
7247
|
set fill(e) {
|
|
7256
7248
|
this._fill.resetProperties().setProperties(e);
|
|
7257
7249
|
}
|
|
7258
|
-
_outline = new
|
|
7250
|
+
_outline = new Yi(this);
|
|
7259
7251
|
get outline() {
|
|
7260
7252
|
return this._outline;
|
|
7261
7253
|
}
|
|
7262
7254
|
set outline(e) {
|
|
7263
7255
|
this._outline.resetProperties().setProperties(e);
|
|
7264
7256
|
}
|
|
7265
|
-
_foreground = new
|
|
7257
|
+
_foreground = new Ji(this);
|
|
7266
7258
|
get foreground() {
|
|
7267
7259
|
return this._foreground;
|
|
7268
7260
|
}
|
|
@@ -7276,21 +7268,21 @@ var Z = {
|
|
|
7276
7268
|
set text(e) {
|
|
7277
7269
|
this._text.resetProperties().setProperties(e);
|
|
7278
7270
|
}
|
|
7279
|
-
_shadow = new
|
|
7271
|
+
_shadow = new Xi(this);
|
|
7280
7272
|
get shadow() {
|
|
7281
7273
|
return this._shadow;
|
|
7282
7274
|
}
|
|
7283
7275
|
set shadow(e) {
|
|
7284
7276
|
this._shadow.resetProperties().setProperties(e);
|
|
7285
7277
|
}
|
|
7286
|
-
_connection = new
|
|
7278
|
+
_connection = new Ki(this);
|
|
7287
7279
|
get connection() {
|
|
7288
7280
|
return this._connection;
|
|
7289
7281
|
}
|
|
7290
7282
|
set connection(e) {
|
|
7291
7283
|
this._connection.resetProperties().setProperties(e);
|
|
7292
7284
|
}
|
|
7293
|
-
_table = new
|
|
7285
|
+
_table = new na(this);
|
|
7294
7286
|
get table() {
|
|
7295
7287
|
return this._table;
|
|
7296
7288
|
}
|
|
@@ -7447,7 +7439,7 @@ var Z = {
|
|
|
7447
7439
|
this.requestDraw();
|
|
7448
7440
|
break;
|
|
7449
7441
|
}
|
|
7450
|
-
if ((
|
|
7442
|
+
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
7443
|
else switch (e) {
|
|
7452
7444
|
case "left":
|
|
7453
7445
|
this.position.x = Number(t);
|
|
@@ -7487,10 +7479,10 @@ var Z = {
|
|
|
7487
7479
|
}
|
|
7488
7480
|
_intersectsViewport(e) {
|
|
7489
7481
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7490
|
-
for (let [e, c] of
|
|
7482
|
+
for (let [e, c] of va) t.applyAffineInverse({
|
|
7491
7483
|
x: e * n,
|
|
7492
7484
|
y: c * r
|
|
7493
|
-
},
|
|
7485
|
+
}, _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
7486
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7495
7487
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7496
7488
|
}
|
|
@@ -7539,7 +7531,7 @@ var Z = {
|
|
|
7539
7531
|
return new yt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
|
|
7540
7532
|
}
|
|
7541
7533
|
_draw() {
|
|
7542
|
-
super._draw(), this._background.isValid() && (this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && this._text.draw(), this._drawContent();
|
|
7534
|
+
super._draw(), this._background.isValid() && (this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && this._text.draw(), this._chart.isValid() && this._chart.draw(), this._drawContent();
|
|
7543
7535
|
}
|
|
7544
7536
|
_drawContent() {}
|
|
7545
7537
|
input(e, t) {
|
|
@@ -7590,10 +7582,10 @@ var Z = {
|
|
|
7590
7582
|
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
7583
|
}
|
|
7592
7584
|
};
|
|
7593
|
-
|
|
7585
|
+
ya = O([x("Element2D"), D("design:paramtypes", [typeof (ma = typeof Partial < "u" && Partial) == "function" ? ma : Object, Array])], ya);
|
|
7594
7586
|
//#endregion
|
|
7595
7587
|
//#region src/scene/2d/TextureRect2D.ts
|
|
7596
|
-
var
|
|
7588
|
+
var ba = class extends ya {
|
|
7597
7589
|
texture;
|
|
7598
7590
|
constructor(e, t = []) {
|
|
7599
7591
|
super(), this.setProperties(e).append(t);
|
|
@@ -7607,7 +7599,7 @@ var ya = class extends va {
|
|
|
7607
7599
|
} });
|
|
7608
7600
|
}
|
|
7609
7601
|
}
|
|
7610
|
-
},
|
|
7602
|
+
}, xa, Sa = class extends ba {
|
|
7611
7603
|
texture = new rr();
|
|
7612
7604
|
animation;
|
|
7613
7605
|
_lastTime = NaN;
|
|
@@ -7638,10 +7630,10 @@ var ya = class extends va {
|
|
|
7638
7630
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
7639
7631
|
}
|
|
7640
7632
|
};
|
|
7641
|
-
O([_({ fallback: "" }), D("design:type", String)],
|
|
7633
|
+
O([_({ fallback: "" }), D("design:type", String)], Sa.prototype, "src", void 0), Sa = O([x("Lottie2D"), D("design:paramtypes", [typeof (xa = typeof Partial < "u" && Partial) == "function" ? xa : Object, Array])], Sa);
|
|
7642
7634
|
//#endregion
|
|
7643
7635
|
//#region src/scene/2d/TransformRect2D.ts
|
|
7644
|
-
var
|
|
7636
|
+
var Ca = class extends ya {
|
|
7645
7637
|
constructor(e, t = []) {
|
|
7646
7638
|
super(), this.setProperties(e).append(t);
|
|
7647
7639
|
}
|
|
@@ -7664,10 +7656,10 @@ var Sa = class extends va {
|
|
|
7664
7656
|
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
7657
|
}
|
|
7666
7658
|
};
|
|
7667
|
-
O([_({ fallback: 6 }), D("design:type", Number)],
|
|
7659
|
+
O([_({ fallback: 6 }), D("design:type", Number)], Ca.prototype, "handleSize", void 0);
|
|
7668
7660
|
//#endregion
|
|
7669
7661
|
//#region src/scene/2d/Video2D.ts
|
|
7670
|
-
var
|
|
7662
|
+
var wa, Ta = class extends ba {
|
|
7671
7663
|
get videoDuration() {
|
|
7672
7664
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
7673
7665
|
}
|
|
@@ -7707,11 +7699,11 @@ var Ca, wa = class extends ya {
|
|
|
7707
7699
|
super._process(e), this._updateVideoCurrentTime();
|
|
7708
7700
|
}
|
|
7709
7701
|
};
|
|
7710
|
-
O([_({ fallback: "" }), D("design:type", String)],
|
|
7702
|
+
O([_({ fallback: "" }), D("design:type", String)], Ta.prototype, "src", void 0), Ta = O([x("Video2D"), D("design:paramtypes", [typeof (wa = typeof Partial < "u" && Partial) == "function" ? wa : Object, Array])], Ta);
|
|
7711
7703
|
//#endregion
|
|
7712
7704
|
//#region src/scene/animation/Animation.ts
|
|
7713
|
-
var
|
|
7714
|
-
function
|
|
7705
|
+
var Ea, Da = (e) => e, Oa = Ma(.25, .1, .25, 1), ka = Ma(.42, 0, 1, 1), Aa = Ma(0, 0, .58, 1), ja = Ma(.42, 0, .58, 1);
|
|
7706
|
+
function Ma(e, t, n, r) {
|
|
7715
7707
|
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
7708
|
function m(e) {
|
|
7717
7709
|
let t = e, n, r;
|
|
@@ -7731,13 +7723,13 @@ function ja(e, t, n, r) {
|
|
|
7731
7723
|
}
|
|
7732
7724
|
return (e) => p(m(e));
|
|
7733
7725
|
}
|
|
7734
|
-
var
|
|
7735
|
-
linear:
|
|
7736
|
-
ease:
|
|
7737
|
-
easeIn:
|
|
7738
|
-
easeOut:
|
|
7739
|
-
easeInOut:
|
|
7740
|
-
},
|
|
7726
|
+
var Na = {
|
|
7727
|
+
linear: Da,
|
|
7728
|
+
ease: Oa,
|
|
7729
|
+
easeIn: ka,
|
|
7730
|
+
easeOut: Aa,
|
|
7731
|
+
easeInOut: ja
|
|
7732
|
+
}, Pa = class extends B {
|
|
7741
7733
|
_keyframes = [];
|
|
7742
7734
|
_isFirstUpdatePosition = !1;
|
|
7743
7735
|
_cachedProps = new t();
|
|
@@ -7772,7 +7764,7 @@ var Ma = {
|
|
|
7772
7764
|
e = [this.getParent()].filter(Boolean);
|
|
7773
7765
|
break;
|
|
7774
7766
|
}
|
|
7775
|
-
return e.filter((e) => e instanceof
|
|
7767
|
+
return e.filter((e) => e instanceof ya);
|
|
7776
7768
|
}
|
|
7777
7769
|
_updateKeyframes() {
|
|
7778
7770
|
let e = [], t = this.keyframes;
|
|
@@ -7820,10 +7812,10 @@ var Ma = {
|
|
|
7820
7812
|
});
|
|
7821
7813
|
}
|
|
7822
7814
|
_parseEasing(e) {
|
|
7823
|
-
if (!e) return
|
|
7824
|
-
if (e in
|
|
7815
|
+
if (!e) return Na.linear;
|
|
7816
|
+
if (e in Na) return Na[e];
|
|
7825
7817
|
let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
|
|
7826
|
-
return
|
|
7818
|
+
return Ma(t[0], t[1], t[2], t[3]);
|
|
7827
7819
|
}
|
|
7828
7820
|
_parseKeyframes(e, t) {
|
|
7829
7821
|
let n, r = this._keyframes;
|
|
@@ -7901,14 +7893,14 @@ var Ma = {
|
|
|
7901
7893
|
});
|
|
7902
7894
|
}
|
|
7903
7895
|
};
|
|
7904
|
-
O([_({ fallback: "parent" }), D("design:type", Object)],
|
|
7896
|
+
O([_({ fallback: "parent" }), D("design:type", Object)], Pa.prototype, "effectMode", void 0), O([_({ default: () => [] }), D("design:type", Array)], Pa.prototype, "keyframes", void 0), O([_(), D("design:type", Object)], Pa.prototype, "easing", void 0), Pa = O([x("Animation", {
|
|
7905
7897
|
renderMode: "disabled",
|
|
7906
7898
|
processSortMode: "parent-before",
|
|
7907
7899
|
duration: 2e3
|
|
7908
|
-
}), D("design:paramtypes", [typeof (
|
|
7900
|
+
}), D("design:paramtypes", [typeof (Ea = typeof Partial < "u" && Partial) == "function" ? Ea : Object, Array])], Pa);
|
|
7909
7901
|
//#endregion
|
|
7910
7902
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
7911
|
-
var
|
|
7903
|
+
var Fa = class t extends e {
|
|
7912
7904
|
static _instance;
|
|
7913
7905
|
static get instance() {
|
|
7914
7906
|
return this._instance ||= new t(), this._instance;
|
|
@@ -7938,7 +7930,7 @@ var Pa = class t extends e {
|
|
|
7938
7930
|
togglePause() {
|
|
7939
7931
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
7940
7932
|
}
|
|
7941
|
-
},
|
|
7933
|
+
}, Ia = class t extends e {
|
|
7942
7934
|
static PADDING = .1;
|
|
7943
7935
|
_source = null;
|
|
7944
7936
|
_audio = null;
|
|
@@ -8065,7 +8057,7 @@ var Pa = class t extends e {
|
|
|
8065
8057
|
let e = this._source;
|
|
8066
8058
|
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
8059
|
}
|
|
8068
|
-
},
|
|
8060
|
+
}, La = class {
|
|
8069
8061
|
parent;
|
|
8070
8062
|
source = new globalThis.Audio();
|
|
8071
8063
|
_src = "";
|
|
@@ -8082,7 +8074,7 @@ var Pa = class t extends e {
|
|
|
8082
8074
|
return !!this.source && this.source.readyState === 4;
|
|
8083
8075
|
}
|
|
8084
8076
|
get context() {
|
|
8085
|
-
return
|
|
8077
|
+
return Fa.instance;
|
|
8086
8078
|
}
|
|
8087
8079
|
constructor(e) {
|
|
8088
8080
|
this.parent = e;
|
|
@@ -8093,9 +8085,9 @@ var Pa = class t extends e {
|
|
|
8093
8085
|
});
|
|
8094
8086
|
}
|
|
8095
8087
|
createSound() {
|
|
8096
|
-
return new
|
|
8088
|
+
return new Ia();
|
|
8097
8089
|
}
|
|
8098
|
-
},
|
|
8090
|
+
}, Ra = class extends e {
|
|
8099
8091
|
_input;
|
|
8100
8092
|
_output;
|
|
8101
8093
|
_processers = [];
|
|
@@ -8117,7 +8109,7 @@ var Pa = class t extends e {
|
|
|
8117
8109
|
get destination() {
|
|
8118
8110
|
return this._input;
|
|
8119
8111
|
}
|
|
8120
|
-
},
|
|
8112
|
+
}, za = class {
|
|
8121
8113
|
destination;
|
|
8122
8114
|
source;
|
|
8123
8115
|
constructor(e, t = null) {
|
|
@@ -8132,21 +8124,21 @@ var Pa = class t extends e {
|
|
|
8132
8124
|
};
|
|
8133
8125
|
//#endregion
|
|
8134
8126
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8135
|
-
function
|
|
8127
|
+
function Ba() {
|
|
8136
8128
|
if (ze) return new AudioContext();
|
|
8137
8129
|
if (Be) {
|
|
8138
8130
|
let e = globalThis.webkitAudioContext;
|
|
8139
8131
|
return new e();
|
|
8140
8132
|
} else throw Error("Failed to createAudioContext");
|
|
8141
8133
|
}
|
|
8142
|
-
function
|
|
8134
|
+
function Va(e, t, n) {
|
|
8143
8135
|
if (Ve) return new OfflineAudioContext(e, t, n);
|
|
8144
8136
|
if (He) {
|
|
8145
8137
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8146
8138
|
return new r(e, t, n);
|
|
8147
8139
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8148
8140
|
}
|
|
8149
|
-
var
|
|
8141
|
+
var Ha = class e extends Ra {
|
|
8150
8142
|
static _instance;
|
|
8151
8143
|
static get instance() {
|
|
8152
8144
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8187,7 +8179,7 @@ var Va = class e extends La {
|
|
|
8187
8179
|
_compressor;
|
|
8188
8180
|
_analyser;
|
|
8189
8181
|
constructor() {
|
|
8190
|
-
let e =
|
|
8182
|
+
let e = Ba(), t = Va(1, 2, Ve ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8191
8183
|
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
8184
|
}
|
|
8193
8185
|
_onFocus() {
|
|
@@ -8228,7 +8220,7 @@ var Va = class e extends La {
|
|
|
8228
8220
|
setParamValue(e, t) {
|
|
8229
8221
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8230
8222
|
}
|
|
8231
|
-
},
|
|
8223
|
+
}, Ua = class extends e {
|
|
8232
8224
|
_audio = null;
|
|
8233
8225
|
_sourceNode = null;
|
|
8234
8226
|
_gain = null;
|
|
@@ -8361,7 +8353,7 @@ var Va = class e extends La {
|
|
|
8361
8353
|
destroy() {
|
|
8362
8354
|
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
8355
|
}
|
|
8364
|
-
},
|
|
8356
|
+
}, Wa = class extends Ra {
|
|
8365
8357
|
parent;
|
|
8366
8358
|
_sourceBuffer;
|
|
8367
8359
|
_sourceNode;
|
|
@@ -8369,7 +8361,7 @@ var Va = class e extends La {
|
|
|
8369
8361
|
gain;
|
|
8370
8362
|
analyser;
|
|
8371
8363
|
get context() {
|
|
8372
|
-
return
|
|
8364
|
+
return Ha.instance;
|
|
8373
8365
|
}
|
|
8374
8366
|
get isPlayable() {
|
|
8375
8367
|
return !!this._sourceNode.buffer;
|
|
@@ -8384,8 +8376,8 @@ var Va = class e extends La {
|
|
|
8384
8376
|
this._sourceNode.buffer = e;
|
|
8385
8377
|
}
|
|
8386
8378
|
constructor(e) {
|
|
8387
|
-
let t =
|
|
8388
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8379
|
+
let t = Ha.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8380
|
+
n.connect(i), i.connect(r), r.connect(Ha.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
8389
8381
|
}
|
|
8390
8382
|
async load() {
|
|
8391
8383
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -8398,7 +8390,7 @@ var Va = class e extends La {
|
|
|
8398
8390
|
});
|
|
8399
8391
|
}
|
|
8400
8392
|
_decode(e) {
|
|
8401
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8393
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : Ha.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
8402
8394
|
}
|
|
8403
8395
|
cloneSource() {
|
|
8404
8396
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -8408,15 +8400,15 @@ var Va = class e extends La {
|
|
|
8408
8400
|
};
|
|
8409
8401
|
}
|
|
8410
8402
|
createSound() {
|
|
8411
|
-
return new
|
|
8403
|
+
return new Ua();
|
|
8412
8404
|
}
|
|
8413
|
-
},
|
|
8405
|
+
}, Ga, Ka = class extends B {
|
|
8414
8406
|
static {
|
|
8415
|
-
|
|
8407
|
+
Ga = this;
|
|
8416
8408
|
}
|
|
8417
8409
|
static _soundPool = [];
|
|
8418
8410
|
_sounds = [];
|
|
8419
|
-
_platformAudio = Ue ? new
|
|
8411
|
+
_platformAudio = Ue ? new Wa(this) : new La(this);
|
|
8420
8412
|
get platformAudio() {
|
|
8421
8413
|
return this._platformAudio;
|
|
8422
8414
|
}
|
|
@@ -8509,7 +8501,7 @@ var Va = class e extends La {
|
|
|
8509
8501
|
this._sounds.length = 0;
|
|
8510
8502
|
}
|
|
8511
8503
|
_createSound() {
|
|
8512
|
-
return
|
|
8504
|
+
return Ga._soundPool.length > 0 ? Ga._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
8513
8505
|
}
|
|
8514
8506
|
refresh() {
|
|
8515
8507
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -8525,7 +8517,7 @@ var Va = class e extends La {
|
|
|
8525
8517
|
this._recycleSound(e);
|
|
8526
8518
|
};
|
|
8527
8519
|
_recycleSound(e) {
|
|
8528
|
-
e.destroy(),
|
|
8520
|
+
e.destroy(), Ga._soundPool.includes(e) || Ga._soundPool.push(e);
|
|
8529
8521
|
}
|
|
8530
8522
|
_prevTime = 0;
|
|
8531
8523
|
_timer = 0;
|
|
@@ -8541,10 +8533,10 @@ var Va = class e extends La {
|
|
|
8541
8533
|
}, 100);
|
|
8542
8534
|
}
|
|
8543
8535
|
};
|
|
8544
|
-
|
|
8536
|
+
Ka = Ga = O([x("Audio"), D("design:paramtypes", [Object])], Ka);
|
|
8545
8537
|
//#endregion
|
|
8546
8538
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
8547
|
-
var
|
|
8539
|
+
var qa = class extends Pr {}, Ja, Ya = class extends ya {
|
|
8548
8540
|
_audioBuffer;
|
|
8549
8541
|
_src = (() => {
|
|
8550
8542
|
let e = tt();
|
|
@@ -8568,7 +8560,7 @@ var Ka = class extends Pr {}, qa, Ja = class extends va {
|
|
|
8568
8560
|
}
|
|
8569
8561
|
}
|
|
8570
8562
|
async _loadSrc(e) {
|
|
8571
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
8563
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ha.decode(e)).then((e) => {
|
|
8572
8564
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
8573
8565
|
});
|
|
8574
8566
|
}
|
|
@@ -8603,12 +8595,12 @@ var Ka = class extends Pr {}, qa, Ja = class extends va {
|
|
|
8603
8595
|
this.syncTexture(), super._process(e);
|
|
8604
8596
|
}
|
|
8605
8597
|
};
|
|
8606
|
-
O([_(), D("design:type", Object)],
|
|
8598
|
+
O([_(), D("design:type", Object)], Ya.prototype, "src", void 0), O([_({ fallback: 0 }), D("design:type", Number)], Ya.prototype, "gap", void 0), O([_({ fallback: "#000000" }), D("design:type", String)], Ya.prototype, "color", void 0), Ya = O([x("AudioWaveform"), D("design:paramtypes", [typeof (Ja = typeof Partial < "u" && Partial) == "function" ? Ja : Object])], Ya);
|
|
8607
8599
|
//#endregion
|
|
8608
8600
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
8609
|
-
var
|
|
8601
|
+
var Xa, Za = class extends Mr {
|
|
8610
8602
|
static {
|
|
8611
|
-
|
|
8603
|
+
Xa = this;
|
|
8612
8604
|
}
|
|
8613
8605
|
blur = 10;
|
|
8614
8606
|
quality = 10;
|
|
@@ -8627,7 +8619,7 @@ var Ya, Xa = class extends Mr {
|
|
|
8627
8619
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
8628
8620
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
8629
8621
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
8630
|
-
I.draw(e,
|
|
8622
|
+
I.draw(e, Xa.material, {
|
|
8631
8623
|
sampler: r,
|
|
8632
8624
|
progress: i,
|
|
8633
8625
|
...t
|
|
@@ -8635,31 +8627,31 @@ var Ya, Xa = class extends Mr {
|
|
|
8635
8627
|
});
|
|
8636
8628
|
}
|
|
8637
8629
|
};
|
|
8638
|
-
|
|
8630
|
+
Za = Xa = O([x("KawaseTransition")], Za);
|
|
8639
8631
|
//#endregion
|
|
8640
8632
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
8641
|
-
var
|
|
8633
|
+
var Qa, $a = class extends Mr {
|
|
8642
8634
|
static {
|
|
8643
|
-
|
|
8635
|
+
Qa = this;
|
|
8644
8636
|
}
|
|
8645
8637
|
static material = new F({ gl: {
|
|
8646
8638
|
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
8639
|
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
8640
|
} });
|
|
8649
8641
|
apply(e) {
|
|
8650
|
-
I.draw(e,
|
|
8642
|
+
I.draw(e, Qa.material, {
|
|
8651
8643
|
previous: 0,
|
|
8652
8644
|
next: 1,
|
|
8653
8645
|
progress: this.currentTimeProgress
|
|
8654
8646
|
});
|
|
8655
8647
|
}
|
|
8656
8648
|
};
|
|
8657
|
-
|
|
8649
|
+
$a = Qa = O([x("LeftEraseTransition")], $a);
|
|
8658
8650
|
//#endregion
|
|
8659
8651
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
8660
|
-
var
|
|
8652
|
+
var eo, to = class extends Mr {
|
|
8661
8653
|
static {
|
|
8662
|
-
|
|
8654
|
+
eo = this;
|
|
8663
8655
|
}
|
|
8664
8656
|
blur = 100;
|
|
8665
8657
|
gradientBlur = 600;
|
|
@@ -8671,7 +8663,7 @@ var $a, eo = class extends Mr {
|
|
|
8671
8663
|
let n = this.currentTimeProgress, r, i;
|
|
8672
8664
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8673
8665
|
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,
|
|
8666
|
+
I.draw(e, eo.material, {
|
|
8675
8667
|
sampler: r,
|
|
8676
8668
|
progress: i,
|
|
8677
8669
|
blur: this.blur,
|
|
@@ -8680,7 +8672,7 @@ var $a, eo = class extends Mr {
|
|
|
8680
8672
|
end: c,
|
|
8681
8673
|
delta: [u / f, d / f],
|
|
8682
8674
|
texSize: l
|
|
8683
|
-
}), I.draw(e,
|
|
8675
|
+
}), I.draw(e, eo.material, {
|
|
8684
8676
|
sampler: r,
|
|
8685
8677
|
progress: i,
|
|
8686
8678
|
blur: this.blur,
|
|
@@ -8692,12 +8684,12 @@ var $a, eo = class extends Mr {
|
|
|
8692
8684
|
});
|
|
8693
8685
|
}
|
|
8694
8686
|
};
|
|
8695
|
-
|
|
8687
|
+
to = eo = O([x("TiltShiftTransition")], to);
|
|
8696
8688
|
//#endregion
|
|
8697
8689
|
//#region src/scene/transitions/TwistTransition.ts
|
|
8698
|
-
var
|
|
8690
|
+
var no, ro = class extends Mr {
|
|
8699
8691
|
static {
|
|
8700
|
-
|
|
8692
|
+
no = this;
|
|
8701
8693
|
}
|
|
8702
8694
|
radius;
|
|
8703
8695
|
angle = 4;
|
|
@@ -8711,7 +8703,7 @@ var to, no = class extends Mr {
|
|
|
8711
8703
|
let n = this.currentTimeProgress, r, i;
|
|
8712
8704
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8713
8705
|
let a = t.width, o = t.height;
|
|
8714
|
-
I.draw(e,
|
|
8706
|
+
I.draw(e, no.material, {
|
|
8715
8707
|
sampler: r,
|
|
8716
8708
|
progress: i,
|
|
8717
8709
|
filterArea: [
|
|
@@ -8727,10 +8719,10 @@ var to, no = class extends Mr {
|
|
|
8727
8719
|
});
|
|
8728
8720
|
}
|
|
8729
8721
|
};
|
|
8730
|
-
|
|
8722
|
+
ro = no = O([x("TwistTransition")], ro);
|
|
8731
8723
|
//#endregion
|
|
8732
8724
|
//#region src/asset/loaders/GifLoader.ts
|
|
8733
|
-
var
|
|
8725
|
+
var io = class extends Rn {
|
|
8734
8726
|
install(e) {
|
|
8735
8727
|
let t = async (t) => {
|
|
8736
8728
|
let { decodeFrames: n } = await import("modern-gif");
|
|
@@ -8747,14 +8739,14 @@ var ro = class extends Rn {
|
|
|
8747
8739
|
e.register(n, t);
|
|
8748
8740
|
}), e.gif = this, this;
|
|
8749
8741
|
}
|
|
8750
|
-
},
|
|
8742
|
+
}, ao = class extends Rn {
|
|
8751
8743
|
install(e) {
|
|
8752
8744
|
let t = async (e) => JSON.parse(await e.text());
|
|
8753
8745
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
8754
8746
|
e.register(n, t);
|
|
8755
8747
|
}), e.json = this, this;
|
|
8756
8748
|
}
|
|
8757
|
-
},
|
|
8749
|
+
}, oo = class extends Rn {
|
|
8758
8750
|
install(e) {
|
|
8759
8751
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
8760
8752
|
container: null,
|
|
@@ -8765,12 +8757,12 @@ var ro = class extends Rn {
|
|
|
8765
8757
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
8766
8758
|
}), e.lottie = this, this;
|
|
8767
8759
|
}
|
|
8768
|
-
},
|
|
8760
|
+
}, so = class extends Rn {
|
|
8769
8761
|
install(e) {
|
|
8770
8762
|
let t = async (e) => e.text();
|
|
8771
8763
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
8772
8764
|
}
|
|
8773
|
-
},
|
|
8765
|
+
}, co = class extends Rn {
|
|
8774
8766
|
install(e) {
|
|
8775
8767
|
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new R({
|
|
8776
8768
|
source: e,
|
|
@@ -8794,11 +8786,11 @@ var ro = class extends Rn {
|
|
|
8794
8786
|
e.register(n, t);
|
|
8795
8787
|
}), e.texture = this, this;
|
|
8796
8788
|
}
|
|
8797
|
-
},
|
|
8789
|
+
}, lo = class extends Rn {
|
|
8798
8790
|
install(e) {
|
|
8799
8791
|
return this.load = (t) => e.awaitBy(() => new cr(t).load()), e.video = this, this;
|
|
8800
8792
|
}
|
|
8801
|
-
},
|
|
8793
|
+
}, uo = Object.entries({
|
|
8802
8794
|
"font/woff": ["woff"],
|
|
8803
8795
|
"font/ttf": ["ttf"],
|
|
8804
8796
|
"font/otf": ["otf"],
|
|
@@ -8814,31 +8806,31 @@ var ro = class extends Rn {
|
|
|
8814
8806
|
"image/webp": ["webp"],
|
|
8815
8807
|
"application/json": ["json"]
|
|
8816
8808
|
});
|
|
8817
|
-
function uo(e) {
|
|
8818
|
-
for (let [t, n] of lo) if (n.includes(e)) return t;
|
|
8819
|
-
}
|
|
8820
8809
|
function fo(e) {
|
|
8810
|
+
for (let [t, n] of uo) if (n.includes(e)) return t;
|
|
8811
|
+
}
|
|
8812
|
+
function po(e) {
|
|
8821
8813
|
let t;
|
|
8822
8814
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
8823
8815
|
else if (e.startsWith("http")) {
|
|
8824
8816
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
8825
|
-
n && (t =
|
|
8817
|
+
n && (t = fo(n));
|
|
8826
8818
|
}
|
|
8827
8819
|
return t;
|
|
8828
8820
|
}
|
|
8829
8821
|
//#endregion
|
|
8830
8822
|
//#region src/asset/Assets.ts
|
|
8831
|
-
var
|
|
8823
|
+
var mo = "WeakRef" in globalThis, ho = class extends e {
|
|
8832
8824
|
defaultHandler = (e) => e;
|
|
8833
8825
|
_handlers = /* @__PURE__ */ new Map();
|
|
8834
8826
|
_handleing = /* @__PURE__ */ new Map();
|
|
8835
8827
|
_handled = /* @__PURE__ */ new Map();
|
|
8836
|
-
_gc =
|
|
8828
|
+
_gc = mo ? new FinalizationRegistry((e) => {
|
|
8837
8829
|
let t = this.get(e);
|
|
8838
8830
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
8839
8831
|
}) : void 0;
|
|
8840
8832
|
constructor() {
|
|
8841
|
-
super(),
|
|
8833
|
+
super(), mo || S.on(this.gc.bind(this), { sort: 2 });
|
|
8842
8834
|
}
|
|
8843
8835
|
use(e) {
|
|
8844
8836
|
return e.install(this), this;
|
|
@@ -8887,11 +8879,11 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
8887
8879
|
}
|
|
8888
8880
|
get(e) {
|
|
8889
8881
|
let t = this._handled.get(e);
|
|
8890
|
-
return
|
|
8882
|
+
return mo && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
8891
8883
|
}
|
|
8892
8884
|
set(e, t) {
|
|
8893
8885
|
let n = t;
|
|
8894
|
-
|
|
8886
|
+
mo && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
8895
8887
|
}
|
|
8896
8888
|
async awaitBy(e) {
|
|
8897
8889
|
let t = e(), n = c();
|
|
@@ -8906,7 +8898,7 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
8906
8898
|
return this._handleing.set(e, r), r;
|
|
8907
8899
|
}
|
|
8908
8900
|
async load(e, t) {
|
|
8909
|
-
let n = await this.loadBy(e), r =
|
|
8901
|
+
let n = await this.loadBy(e), r = po(e);
|
|
8910
8902
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
8911
8903
|
}
|
|
8912
8904
|
async waitUntilLoad() {
|
|
@@ -8920,14 +8912,14 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
8920
8912
|
n && "destroy" in n && n.destroy();
|
|
8921
8913
|
}), this._handled.clear();
|
|
8922
8914
|
}
|
|
8923
|
-
}, $ = new
|
|
8915
|
+
}, $ = new ho().use(new zn()).use(new io()).use(new ao()).use(new oo()).use(new so()).use(new co()).use(new lo()), go = {
|
|
8924
8916
|
alpha: !0,
|
|
8925
8917
|
stencil: !0,
|
|
8926
8918
|
antialias: !1,
|
|
8927
8919
|
premultipliedAlpha: !0,
|
|
8928
8920
|
preserveDrawingBuffer: !1,
|
|
8929
8921
|
powerPreference: "default"
|
|
8930
|
-
},
|
|
8922
|
+
}, _o = class extends Ar {
|
|
8931
8923
|
renderer;
|
|
8932
8924
|
get view() {
|
|
8933
8925
|
return this.renderer.view;
|
|
@@ -8960,12 +8952,12 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
8960
8952
|
constructor(e = {}) {
|
|
8961
8953
|
let { view: t, width: n, height: r, pixelRatio: i = Ke, autoResize: a, data: o } = e;
|
|
8962
8954
|
super(), this.renderer = new Ln(t, {
|
|
8963
|
-
alpha:
|
|
8964
|
-
stencil:
|
|
8965
|
-
antialias:
|
|
8966
|
-
premultipliedAlpha:
|
|
8967
|
-
preserveDrawingBuffer:
|
|
8968
|
-
powerPreference:
|
|
8955
|
+
alpha: go.alpha ?? e.alpha,
|
|
8956
|
+
stencil: go.stencil ?? e.stencil,
|
|
8957
|
+
antialias: go.antialias ?? e.antialias,
|
|
8958
|
+
premultipliedAlpha: go.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
8959
|
+
preserveDrawingBuffer: go.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
8960
|
+
powerPreference: go.powerPreference ?? e.powerPreference
|
|
8969
8961
|
}), 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
8962
|
}
|
|
8971
8963
|
_updateProperty(e, t, n) {
|
|
@@ -9048,22 +9040,22 @@ var po = "WeakRef" in globalThis, mo = class extends e {
|
|
|
9048
9040
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9049
9041
|
}
|
|
9050
9042
|
};
|
|
9051
|
-
O([_({ fallback: !1 }), D("design:type", Boolean)],
|
|
9043
|
+
O([_({ fallback: !1 }), D("design:type", Boolean)], _o.prototype, "autoResize", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], _o.prototype, "autoStart", void 0);
|
|
9052
9044
|
//#endregion
|
|
9053
9045
|
//#region src/render.ts
|
|
9054
|
-
var
|
|
9055
|
-
function
|
|
9056
|
-
return
|
|
9046
|
+
var vo, yo = [], bo = !1;
|
|
9047
|
+
function xo() {
|
|
9048
|
+
return vo ??= new _o({
|
|
9057
9049
|
pixelRatio: 1,
|
|
9058
9050
|
width: 1,
|
|
9059
9051
|
height: 1,
|
|
9060
9052
|
preserveDrawingBuffer: !0
|
|
9061
9053
|
});
|
|
9062
9054
|
}
|
|
9063
|
-
async function
|
|
9064
|
-
if (!
|
|
9065
|
-
for (
|
|
9066
|
-
let t =
|
|
9055
|
+
async function So(e = 100) {
|
|
9056
|
+
if (!bo) {
|
|
9057
|
+
for (bo = !0; yo.length;) {
|
|
9058
|
+
let t = yo.shift();
|
|
9067
9059
|
if (t) try {
|
|
9068
9060
|
await t();
|
|
9069
9061
|
} catch (e) {
|
|
@@ -9071,11 +9063,11 @@ async function xo(e = 100) {
|
|
|
9071
9063
|
}
|
|
9072
9064
|
else await new Promise((t) => setTimeout(t, e));
|
|
9073
9065
|
}
|
|
9074
|
-
|
|
9066
|
+
bo = !1;
|
|
9075
9067
|
}
|
|
9076
9068
|
}
|
|
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 =
|
|
9069
|
+
async function Co(e) {
|
|
9070
|
+
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 = xo();
|
|
9079
9071
|
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
9072
|
let e = o.length, t = o[e - 1];
|
|
9081
9073
|
for (let n = 0; n < e; n++) {
|
|
@@ -9093,15 +9085,15 @@ async function So(e) {
|
|
|
9093
9085
|
toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
|
|
9094
9086
|
};
|
|
9095
9087
|
}
|
|
9096
|
-
async function
|
|
9088
|
+
async function wo(e) {
|
|
9097
9089
|
return new Promise((t) => {
|
|
9098
|
-
|
|
9090
|
+
yo.push(async () => t(await Co(e).then((e) => e.toCanvas2D()))), So();
|
|
9099
9091
|
});
|
|
9100
9092
|
}
|
|
9101
|
-
async function
|
|
9093
|
+
async function To(e) {
|
|
9102
9094
|
return new Promise((t) => {
|
|
9103
|
-
|
|
9095
|
+
yo.push(async () => t(await Co(e).then((e) => e.pixels))), So();
|
|
9104
9096
|
});
|
|
9105
9097
|
}
|
|
9106
9098
|
//#endregion
|
|
9107
|
-
export { mt as Aabb2D, nr as AnimatedTexture,
|
|
9099
|
+
export { mt as Aabb2D, nr as AnimatedTexture, Pa as Animation, ho as Assets, Ka as Audio, Ra as AudioPipeline, za as AudioProcessor, qa as AudioSpectrum, Ya 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, _o as Engine, pa as Flexbox, zn as FontLoader, pi as GaussianBlurEffect, Wn as Geometry, io 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, La as HTMLAudio, Fa as HTMLAudioContext, Ia as HTMLSound, We as IN_BROWSER, Ge as IN_MAC_OS, Vn as IndexBuffer, ft as Input, ot as InputEvent, ao as JsonLoader, Oi as KawaseBlurEffect, Za as KawaseTransition, st as KeyboardInputEvent, $a as LeftEraseTransition, Rn as Loader, Sa as Lottie2D, oo 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, so as TextLoader, R as Texture2D, co as TextureLoader, ba as TextureRect2D, S as Ticker, to as TiltShiftTransition, Or as Timeline, B as TimelineNode, Ca as TransformRect2D, Mr as Transition, ro as TwistTransition, Dt as UniformGroup, tr as UvGeometry, er as UvMaterial, P as VertexAttribute, N as VertexBuffer, Ta as Video2D, lo as VideoLoader, cr as VideoTexture, V as Viewport, lr as ViewportTexture, Wa as WebAudio, Ha as WebAudioContext, Ln as WebGLRenderer, Ua 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, Ma as cubicBezier, x as customNode, ge as customNodes, go as defaultOptions, nt as determineCrossOrigin, oa as directionMap, aa as displayMap, Oa as ease, ka as easeIn, ja as easeInOut, Aa as easeOut, Z as edgeMap, sa as flexDirectionMap, ca as flexWrapMap, Ei as frag, et as getCanvasFactory, Te as getDefaultCssPropertyValue, xo 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, Da 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, wo as render, To as renderPixels, xr as resetBatchPool, Rr as routeConnection, $e as setCanvasFactory, dn as stencilModeMap, Na as timingFunctions };
|