modern-canvas 0.21.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +357 -303
- package/dist/scene/effects/DrawboardEffect.d.ts +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5318,38 +5318,74 @@ function Br(e, t, n) {
|
|
|
5318
5318
|
}, u = [{
|
|
5319
5319
|
x: r.x,
|
|
5320
5320
|
y: r.y
|
|
5321
|
-
}, c]
|
|
5322
|
-
|
|
5323
|
-
let e = (c.x + l.x) / 2;
|
|
5324
|
-
u.push({
|
|
5325
|
-
x: e,
|
|
5326
|
-
y: c.y
|
|
5327
|
-
}, {
|
|
5328
|
-
x: e,
|
|
5329
|
-
y: l.y
|
|
5330
|
-
});
|
|
5331
|
-
} else if (!d && !f) {
|
|
5332
|
-
let e = (c.y + l.y) / 2;
|
|
5333
|
-
u.push({
|
|
5334
|
-
x: c.x,
|
|
5335
|
-
y: e
|
|
5336
|
-
}, {
|
|
5337
|
-
x: l.x,
|
|
5338
|
-
y: e
|
|
5339
|
-
});
|
|
5340
|
-
} else d ? u.push({
|
|
5341
|
-
x: l.x,
|
|
5342
|
-
y: c.y
|
|
5343
|
-
}) : u.push({
|
|
5344
|
-
x: c.x,
|
|
5345
|
-
y: l.y
|
|
5346
|
-
});
|
|
5347
|
-
return u.push(l, {
|
|
5321
|
+
}, c];
|
|
5322
|
+
return u.push(...Vr(c, o, l, s)), u.push(l, {
|
|
5348
5323
|
x: i.x,
|
|
5349
5324
|
y: i.y
|
|
5350
|
-
}),
|
|
5325
|
+
}), Hr(u);
|
|
5326
|
+
}
|
|
5327
|
+
function Vr(e, t, n, r) {
|
|
5328
|
+
let i = t.y === 0;
|
|
5329
|
+
if (i === (r.y === 0)) {
|
|
5330
|
+
if (i) {
|
|
5331
|
+
if (t.x === -r.x && (n.x - e.x) * t.x > 0) {
|
|
5332
|
+
let t = (e.x + n.x) / 2;
|
|
5333
|
+
return [{
|
|
5334
|
+
x: t,
|
|
5335
|
+
y: e.y
|
|
5336
|
+
}, {
|
|
5337
|
+
x: t,
|
|
5338
|
+
y: n.y
|
|
5339
|
+
}];
|
|
5340
|
+
}
|
|
5341
|
+
let i = (e.y + n.y) / 2;
|
|
5342
|
+
return [{
|
|
5343
|
+
x: e.x,
|
|
5344
|
+
y: i
|
|
5345
|
+
}, {
|
|
5346
|
+
x: n.x,
|
|
5347
|
+
y: i
|
|
5348
|
+
}];
|
|
5349
|
+
}
|
|
5350
|
+
if (t.y === -r.y && (n.y - e.y) * t.y > 0) {
|
|
5351
|
+
let t = (e.y + n.y) / 2;
|
|
5352
|
+
return [{
|
|
5353
|
+
x: e.x,
|
|
5354
|
+
y: t
|
|
5355
|
+
}, {
|
|
5356
|
+
x: n.x,
|
|
5357
|
+
y: t
|
|
5358
|
+
}];
|
|
5359
|
+
}
|
|
5360
|
+
let a = (e.x + n.x) / 2;
|
|
5361
|
+
return [{
|
|
5362
|
+
x: a,
|
|
5363
|
+
y: e.y
|
|
5364
|
+
}, {
|
|
5365
|
+
x: a,
|
|
5366
|
+
y: n.y
|
|
5367
|
+
}];
|
|
5368
|
+
}
|
|
5369
|
+
let [a, o, s, c] = i ? [
|
|
5370
|
+
e,
|
|
5371
|
+
t,
|
|
5372
|
+
n,
|
|
5373
|
+
r
|
|
5374
|
+
] : [
|
|
5375
|
+
n,
|
|
5376
|
+
r,
|
|
5377
|
+
e,
|
|
5378
|
+
t
|
|
5379
|
+
];
|
|
5380
|
+
return (s.x - a.x) * o.x >= 0 && (s.y - a.y) * c.y <= 0 ? [{
|
|
5381
|
+
x: s.x,
|
|
5382
|
+
y: a.y
|
|
5383
|
+
}] : [{
|
|
5384
|
+
x: a.x,
|
|
5385
|
+
y: s.y
|
|
5386
|
+
}];
|
|
5351
5387
|
}
|
|
5352
|
-
function
|
|
5388
|
+
function Hr(e) {
|
|
5353
5389
|
let t = [];
|
|
5354
5390
|
for (let n = 0; n < e.length; n++) {
|
|
5355
5391
|
let r = e[n], i = t[t.length - 1];
|
|
@@ -5359,7 +5395,7 @@ function Vr(e) {
|
|
|
5359
5395
|
}
|
|
5360
5396
|
//#endregion
|
|
5361
5397
|
//#region src/css/parseCssFilter.ts
|
|
5362
|
-
var
|
|
5398
|
+
var Ur = {
|
|
5363
5399
|
brightness: 1,
|
|
5364
5400
|
contrast: 1,
|
|
5365
5401
|
grayscale: 0,
|
|
@@ -5369,12 +5405,12 @@ var Hr = {
|
|
|
5369
5405
|
saturate: 1,
|
|
5370
5406
|
sepia: 0
|
|
5371
5407
|
};
|
|
5372
|
-
function
|
|
5408
|
+
function Wr(e) {
|
|
5373
5409
|
let t = new vt();
|
|
5374
5410
|
if (e === "none") return t;
|
|
5375
5411
|
let n = De(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5376
|
-
Object.keys(
|
|
5377
|
-
n[e] = n[e] ??
|
|
5412
|
+
Object.keys(Ur).forEach((e) => {
|
|
5413
|
+
n[e] = n[e] ?? Ur[e];
|
|
5378
5414
|
});
|
|
5379
5415
|
for (let e in n) {
|
|
5380
5416
|
let r = n[e];
|
|
@@ -5409,7 +5445,7 @@ function Ur(e) {
|
|
|
5409
5445
|
}
|
|
5410
5446
|
//#endregion
|
|
5411
5447
|
//#region src/css/parseCssTransformOrigin.ts
|
|
5412
|
-
function
|
|
5448
|
+
function Gr(e) {
|
|
5413
5449
|
let [t, n = t] = e.split(" ");
|
|
5414
5450
|
return [t, n].map((e) => {
|
|
5415
5451
|
switch (e = e.trim(), e) {
|
|
@@ -5424,9 +5460,9 @@ function Wr(e) {
|
|
|
5424
5460
|
}
|
|
5425
5461
|
//#endregion
|
|
5426
5462
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5427
|
-
var
|
|
5463
|
+
var Kr, qr, U = class extends H {
|
|
5428
5464
|
static {
|
|
5429
|
-
|
|
5465
|
+
qr = this;
|
|
5430
5466
|
}
|
|
5431
5467
|
static material = new F({ gl: {
|
|
5432
5468
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
@@ -5437,7 +5473,7 @@ var Gr, Kr, U = class extends H {
|
|
|
5437
5473
|
}
|
|
5438
5474
|
apply(e, t) {
|
|
5439
5475
|
t.redraw(e, () => {
|
|
5440
|
-
I.draw(e,
|
|
5476
|
+
I.draw(e, qr.material, {
|
|
5441
5477
|
sampler: 0,
|
|
5442
5478
|
saturation: this.saturation,
|
|
5443
5479
|
contrast: this.contrast,
|
|
@@ -5451,12 +5487,12 @@ var Gr, Kr, U = class extends H {
|
|
|
5451
5487
|
});
|
|
5452
5488
|
}
|
|
5453
5489
|
};
|
|
5454
|
-
O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "saturation", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "contrast", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "brightness", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "red", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "green", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "blue", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "alpha", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "gamma", void 0), U =
|
|
5490
|
+
O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "saturation", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "contrast", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "brightness", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "red", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "green", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "blue", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "alpha", void 0), O([_({ fallback: 1 }), D("design:type", Number)], U.prototype, "gamma", void 0), U = qr = O([x("ColorAdjustEffect"), D("design:paramtypes", [typeof (Kr = typeof Partial < "u" && Partial) == "function" ? Kr : Object, Array])], U);
|
|
5455
5491
|
//#endregion
|
|
5456
5492
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5457
|
-
var
|
|
5493
|
+
var Jr, Yr, Xr = class extends H {
|
|
5458
5494
|
static {
|
|
5459
|
-
|
|
5495
|
+
Yr = this;
|
|
5460
5496
|
}
|
|
5461
5497
|
static material = new F({ gl: {
|
|
5462
5498
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
@@ -5506,25 +5542,25 @@ var qr, Jr, Yr = class extends H {
|
|
|
5506
5542
|
break;
|
|
5507
5543
|
}
|
|
5508
5544
|
}), t.redraw(e, () => {
|
|
5509
|
-
I.draw(e,
|
|
5545
|
+
I.draw(e, Yr.material, {
|
|
5510
5546
|
sampler: 0,
|
|
5511
5547
|
m: r.toArray()
|
|
5512
5548
|
});
|
|
5513
5549
|
});
|
|
5514
5550
|
}
|
|
5515
5551
|
};
|
|
5516
|
-
O([_(), D("design:type", String)],
|
|
5552
|
+
O([_(), D("design:type", String)], Xr.prototype, "filter", void 0), Xr = Yr = O([x("ColorFilterEffect"), D("design:paramtypes", [typeof (Jr = typeof Partial < "u" && Partial) == "function" ? Jr : Object, Array])], Xr);
|
|
5517
5553
|
//#endregion
|
|
5518
5554
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
5519
|
-
var
|
|
5555
|
+
var Zr, Qr, $r = 50, ei = class extends H {
|
|
5520
5556
|
static {
|
|
5521
|
-
|
|
5557
|
+
Qr = this;
|
|
5522
5558
|
}
|
|
5523
5559
|
static material = new F({ gl: {
|
|
5524
5560
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5525
5561
|
fragment: `precision mediump float;
|
|
5526
5562
|
uniform sampler2D sampler;
|
|
5527
|
-
uniform vec4 colors[${
|
|
5563
|
+
uniform vec4 colors[${$r}];
|
|
5528
5564
|
varying vec2 vUv;
|
|
5529
5565
|
|
|
5530
5566
|
float calcWidth() {
|
|
@@ -5533,7 +5569,7 @@ float calcWidth() {
|
|
|
5533
5569
|
|
|
5534
5570
|
int calcCount() {
|
|
5535
5571
|
int count = 0;
|
|
5536
|
-
for (int i = 0; i < ${
|
|
5572
|
+
for (int i = 0; i < ${$r}; i++) {
|
|
5537
5573
|
if (colors[i] != vec4(0,0,0,0)){
|
|
5538
5574
|
count++;
|
|
5539
5575
|
}
|
|
@@ -5545,7 +5581,7 @@ vec4 calcColor(float x) {
|
|
|
5545
5581
|
float perUnit = calcWidth() / float(calcCount());
|
|
5546
5582
|
int index = int(x / perUnit);
|
|
5547
5583
|
|
|
5548
|
-
for(int i=0; i<${
|
|
5584
|
+
for(int i=0; i<${$r}; i++){
|
|
5549
5585
|
if(i==index){
|
|
5550
5586
|
return colors[i];
|
|
5551
5587
|
}
|
|
@@ -5571,25 +5607,25 @@ void main(void) {
|
|
|
5571
5607
|
let t = this._color.toArray();
|
|
5572
5608
|
return t[3] = this.alpha, t;
|
|
5573
5609
|
});
|
|
5574
|
-
for (; t.length <
|
|
5610
|
+
for (; t.length < $r;) t.push([
|
|
5575
5611
|
0,
|
|
5576
5612
|
0,
|
|
5577
5613
|
0,
|
|
5578
5614
|
0
|
|
5579
5615
|
]);
|
|
5580
|
-
I.draw(e,
|
|
5616
|
+
I.draw(e, Qr.material, {
|
|
5581
5617
|
sampler: 0,
|
|
5582
|
-
colors: t.slice(0,
|
|
5618
|
+
colors: t.slice(0, $r).flatMap((e) => e)
|
|
5583
5619
|
});
|
|
5584
5620
|
});
|
|
5585
5621
|
}
|
|
5586
5622
|
};
|
|
5587
|
-
O([_({ default: () => [] }), D("design:type", Array)],
|
|
5623
|
+
O([_({ default: () => [] }), D("design:type", Array)], ei.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], ei.prototype, "alpha", void 0), ei = Qr = O([x("ColorOverlayEffect"), D("design:paramtypes", [typeof (Zr = typeof Partial < "u" && Partial) == "function" ? Zr : Object, Array])], ei);
|
|
5588
5624
|
//#endregion
|
|
5589
5625
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
5590
|
-
var
|
|
5626
|
+
var ti, ni, ri = class extends H {
|
|
5591
5627
|
static {
|
|
5592
|
-
|
|
5628
|
+
ni = this;
|
|
5593
5629
|
}
|
|
5594
5630
|
static material = new F({ gl: {
|
|
5595
5631
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
@@ -5609,7 +5645,7 @@ var ei, ti, ni = class extends H {
|
|
|
5609
5645
|
r.slice(0, 50).forEach((e, t) => {
|
|
5610
5646
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
5611
5647
|
}), t.redraw(e, () => {
|
|
5612
|
-
I.draw(e,
|
|
5648
|
+
I.draw(e, ni.material, {
|
|
5613
5649
|
sampler: 0,
|
|
5614
5650
|
epsilon: this.epsilon,
|
|
5615
5651
|
originalColors: n
|
|
@@ -5617,19 +5653,19 @@ var ei, ti, ni = class extends H {
|
|
|
5617
5653
|
});
|
|
5618
5654
|
}
|
|
5619
5655
|
};
|
|
5620
|
-
O([_({ default: () => [] }), D("design:type", Array)],
|
|
5656
|
+
O([_({ default: () => [] }), D("design:type", Array)], ri.prototype, "colors", void 0), O([_({ fallback: .5 }), D("design:type", Number)], ri.prototype, "epsilon", void 0), ri = ni = O([x("ColorRemoveEffect"), D("design:paramtypes", [typeof (ti = typeof Partial < "u" && Partial) == "function" ? ti : Object, Array])], ri);
|
|
5621
5657
|
//#endregion
|
|
5622
5658
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
5623
|
-
var
|
|
5659
|
+
var ii, ai, oi = 50, si = class extends H {
|
|
5624
5660
|
static {
|
|
5625
|
-
|
|
5661
|
+
ai = this;
|
|
5626
5662
|
}
|
|
5627
5663
|
static material = new F({ gl: {
|
|
5628
5664
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5629
5665
|
fragment: `varying vec2 vUv;
|
|
5630
5666
|
uniform sampler2D sampler;
|
|
5631
5667
|
uniform float epsilon;
|
|
5632
|
-
const int MAX_COLORS = ${
|
|
5668
|
+
const int MAX_COLORS = ${oi};
|
|
5633
5669
|
uniform vec3 originalColors[MAX_COLORS];
|
|
5634
5670
|
uniform vec3 targetColors[MAX_COLORS];
|
|
5635
5671
|
|
|
@@ -5666,8 +5702,8 @@ void main(void) {
|
|
|
5666
5702
|
this._color.value = e[0];
|
|
5667
5703
|
let t = this._color.toArray().slice(0, 3);
|
|
5668
5704
|
return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
|
|
5669
|
-
}), r = this.epsilon, i = new Float32Array(
|
|
5670
|
-
for (; n.length <
|
|
5705
|
+
}), r = this.epsilon, i = new Float32Array(oi * 3), a = new Float32Array(oi * 3);
|
|
5706
|
+
for (; n.length < oi;) n.push([[
|
|
5671
5707
|
-1,
|
|
5672
5708
|
0,
|
|
5673
5709
|
0
|
|
@@ -5677,10 +5713,10 @@ void main(void) {
|
|
|
5677
5713
|
0,
|
|
5678
5714
|
1
|
|
5679
5715
|
]]);
|
|
5680
|
-
n.slice(0,
|
|
5716
|
+
n.slice(0, oi).forEach(([e, t], n) => {
|
|
5681
5717
|
i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
|
|
5682
5718
|
}), t.redraw(e, () => {
|
|
5683
|
-
I.draw(e,
|
|
5719
|
+
I.draw(e, ai.material, {
|
|
5684
5720
|
sampler: 0,
|
|
5685
5721
|
epsilon: r,
|
|
5686
5722
|
originalColors: i,
|
|
@@ -5689,17 +5725,17 @@ void main(void) {
|
|
|
5689
5725
|
});
|
|
5690
5726
|
}
|
|
5691
5727
|
};
|
|
5692
|
-
O([_({ default: () => [] }), D("design:type", Array)],
|
|
5728
|
+
O([_({ default: () => [] }), D("design:type", Array)], si.prototype, "colors", void 0), O([_({ fallback: .05 }), D("design:type", Number)], si.prototype, "epsilon", void 0), si = ai = O([x("ColorReplaceEffect"), D("design:paramtypes", [typeof (ii = typeof Partial < "u" && Partial) == "function" ? ii : Object, Array])], si);
|
|
5693
5729
|
//#endregion
|
|
5694
5730
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
5695
|
-
var
|
|
5731
|
+
var ci = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", li, ui, W = class extends H {
|
|
5696
5732
|
static {
|
|
5697
|
-
|
|
5733
|
+
ui = this;
|
|
5698
5734
|
}
|
|
5699
5735
|
_watermark;
|
|
5700
5736
|
static material = new F({ gl: {
|
|
5701
5737
|
vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5702
|
-
fragment:
|
|
5738
|
+
fragment: ci
|
|
5703
5739
|
} });
|
|
5704
5740
|
constructor(e, t = []) {
|
|
5705
5741
|
super(), this.setProperties(e).append(t);
|
|
@@ -5709,6 +5745,11 @@ var si = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5709
5745
|
case "watermark":
|
|
5710
5746
|
this._loadWatermark(t);
|
|
5711
5747
|
break;
|
|
5748
|
+
case "checkerboard":
|
|
5749
|
+
case "checkerboardStyle":
|
|
5750
|
+
case "pixelGrid":
|
|
5751
|
+
this.requestRender();
|
|
5752
|
+
break;
|
|
5712
5753
|
}
|
|
5713
5754
|
}
|
|
5714
5755
|
async _loadWatermark(e) {
|
|
@@ -5717,13 +5758,26 @@ var si = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5717
5758
|
_checkerboardStyleMap = {
|
|
5718
5759
|
grid: 1,
|
|
5719
5760
|
gridDark: 2,
|
|
5720
|
-
dot: 3
|
|
5761
|
+
dot: 3,
|
|
5762
|
+
dotDark: 4
|
|
5763
|
+
};
|
|
5764
|
+
_dotColors = {
|
|
5765
|
+
light: {
|
|
5766
|
+
base: .9608,
|
|
5767
|
+
zoomedOut: .6667,
|
|
5768
|
+
diff: .102
|
|
5769
|
+
},
|
|
5770
|
+
dark: {
|
|
5771
|
+
base: .1216,
|
|
5772
|
+
zoomedOut: .3137,
|
|
5773
|
+
diff: .102
|
|
5774
|
+
}
|
|
5721
5775
|
};
|
|
5722
5776
|
apply(e, t) {
|
|
5723
5777
|
t.redraw(e, () => {
|
|
5724
5778
|
this._watermark ? this._watermark.activate(e, 1) : e.texture.unbind(1);
|
|
5725
|
-
let n = e.shader.uniforms.viewMatrix, r = this._watermark ? [this.watermarkWidth, this.watermarkWidth * this._watermark.height / this._watermark.width] : [0, 0], i = Math.max(r[0], r[1]);
|
|
5726
|
-
I.draw(e,
|
|
5779
|
+
let n = e.shader.uniforms.viewMatrix, r = this._watermark ? [this.watermarkWidth, this.watermarkWidth * this._watermark.height / this._watermark.width] : [0, 0], i = Math.max(r[0], r[1]), a = this.checkerboardStyle === "dotDark" ? this._dotColors.dark : this._dotColors.light;
|
|
5780
|
+
I.draw(e, ui.material, {
|
|
5727
5781
|
uTexture: 0,
|
|
5728
5782
|
inputSize: [t.width, t.height],
|
|
5729
5783
|
zoom: [n[0], n[4]],
|
|
@@ -5732,9 +5786,9 @@ var si = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5732
5786
|
gridSize: [n[0] > 4 ? Math.ceil(.5 / n[0] * 1e4) / 1e4 : 0, n[4] > 4 ? Math.ceil(.5 / n[4] * 1e4) / 1e4 : 0],
|
|
5733
5787
|
checkerboard: +!!this.checkerboard,
|
|
5734
5788
|
checkerboardStyle: this._checkerboardStyleMap[this.checkerboardStyle] ?? 0,
|
|
5735
|
-
dotBackgroundBaseColor: .
|
|
5736
|
-
dotBackgroundZoomedOutColor: .
|
|
5737
|
-
dotColorDiff: .
|
|
5789
|
+
dotBackgroundBaseColor: a.base,
|
|
5790
|
+
dotBackgroundZoomedOutColor: a.zoomedOut,
|
|
5791
|
+
dotColorDiff: a.diff,
|
|
5738
5792
|
pixelGrid: +!!this.pixelGrid,
|
|
5739
5793
|
watermark: +!!this._watermark,
|
|
5740
5794
|
watermarkTexture: 1,
|
|
@@ -5747,20 +5801,20 @@ var si = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5747
5801
|
});
|
|
5748
5802
|
}
|
|
5749
5803
|
};
|
|
5750
|
-
O([_({ fallback: !1 }), D("design:type", Boolean)], W.prototype, "checkerboard", void 0), O([_({ fallback: "grid" }), D("design:type", Object)], W.prototype, "checkerboardStyle", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], W.prototype, "pixelGrid", void 0), O([_(), D("design:type", String)], W.prototype, "watermark", void 0), O([_({ fallback: 100 }), D("design:type", Number)], W.prototype, "watermarkWidth", void 0), O([_({ fallback: .05 }), D("design:type", Number)], W.prototype, "watermarkAlpha", void 0), O([_({ fallback: .5236 }), D("design:type", Number)], W.prototype, "watermarkRotation", void 0), W =
|
|
5804
|
+
O([_({ fallback: !1 }), D("design:type", Boolean)], W.prototype, "checkerboard", void 0), O([_({ fallback: "grid" }), D("design:type", Object)], W.prototype, "checkerboardStyle", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], W.prototype, "pixelGrid", void 0), O([_(), D("design:type", String)], W.prototype, "watermark", void 0), O([_({ fallback: 100 }), D("design:type", Number)], W.prototype, "watermarkWidth", void 0), O([_({ fallback: .05 }), D("design:type", Number)], W.prototype, "watermarkAlpha", void 0), O([_({ fallback: .5236 }), D("design:type", Number)], W.prototype, "watermarkRotation", void 0), W = ui = O([x("DrawboardEffect"), D("design:paramtypes", [typeof (li = typeof Partial < "u" && Partial) == "function" ? li : Object, Array])], W);
|
|
5751
5805
|
//#endregion
|
|
5752
5806
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
5753
|
-
var
|
|
5807
|
+
var di, fi, pi = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", mi = class extends H {
|
|
5754
5808
|
static {
|
|
5755
|
-
|
|
5809
|
+
fi = this;
|
|
5756
5810
|
}
|
|
5757
5811
|
static materialX = new F({ gl: {
|
|
5758
5812
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
|
|
5759
|
-
fragment:
|
|
5813
|
+
fragment: pi
|
|
5760
5814
|
} });
|
|
5761
5815
|
static materialY = new F({ gl: {
|
|
5762
5816
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
|
|
5763
|
-
fragment:
|
|
5817
|
+
fragment: pi
|
|
5764
5818
|
} });
|
|
5765
5819
|
constructor(e, t = []) {
|
|
5766
5820
|
super(), this.setProperties(e).append(t);
|
|
@@ -5768,31 +5822,31 @@ var ui, di, fi = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(
|
|
|
5768
5822
|
apply(e, t) {
|
|
5769
5823
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
5770
5824
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
5771
|
-
I.draw(e,
|
|
5825
|
+
I.draw(e, fi.materialX, {
|
|
5772
5826
|
sampler: 0,
|
|
5773
5827
|
uStrength: n * (this.strength / i)
|
|
5774
5828
|
});
|
|
5775
5829
|
});
|
|
5776
5830
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
5777
|
-
I.draw(e,
|
|
5831
|
+
I.draw(e, fi.materialY, {
|
|
5778
5832
|
sampler: 0,
|
|
5779
5833
|
uStrength: r * (this.strength / i)
|
|
5780
5834
|
});
|
|
5781
5835
|
});
|
|
5782
5836
|
}
|
|
5783
5837
|
};
|
|
5784
|
-
O([_({ fallback: 4 }), D("design:type", Number)],
|
|
5838
|
+
O([_({ fallback: 4 }), D("design:type", Number)], mi.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], mi.prototype, "quality", void 0), mi = fi = O([x("GaussianBlurEffect"), D("design:paramtypes", [typeof (di = typeof Partial < "u" && Partial) == "function" ? di : Object, Array])], mi);
|
|
5785
5839
|
//#endregion
|
|
5786
5840
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
5787
|
-
var
|
|
5841
|
+
var hi, gi, _i = class extends H {
|
|
5788
5842
|
static {
|
|
5789
|
-
|
|
5843
|
+
gi = this;
|
|
5790
5844
|
}
|
|
5791
5845
|
static material = new F({ gl: {
|
|
5792
5846
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5793
5847
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
|
|
5794
5848
|
} });
|
|
5795
|
-
blurEffect = new
|
|
5849
|
+
blurEffect = new mi();
|
|
5796
5850
|
viewport3 = new V();
|
|
5797
5851
|
_color = new T();
|
|
5798
5852
|
constructor(e, t = []) {
|
|
@@ -5800,7 +5854,7 @@ var mi, hi, gi = class extends H {
|
|
|
5800
5854
|
}
|
|
5801
5855
|
apply(e, t) {
|
|
5802
5856
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
5803
|
-
this._color.value = this.color, I.draw(e,
|
|
5857
|
+
this._color.value = this.color, I.draw(e, gi.material, {
|
|
5804
5858
|
sampler: 0,
|
|
5805
5859
|
uAlpha: this._color.a,
|
|
5806
5860
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -5817,12 +5871,12 @@ var mi, hi, gi = class extends H {
|
|
|
5817
5871
|
});
|
|
5818
5872
|
}
|
|
5819
5873
|
};
|
|
5820
|
-
O([_({ fallback: "#000000FF" }), D("design:type", Object)],
|
|
5874
|
+
O([_({ fallback: "#000000FF" }), D("design:type", Object)], _i.prototype, "color", void 0), O([_({ fallback: 4 }), D("design:type", Number)], _i.prototype, "blur", void 0), O([_({ fallback: 4 }), D("design:type", Number)], _i.prototype, "offsetX", void 0), O([_({ fallback: 4 }), D("design:type", Number)], _i.prototype, "offsetY", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], _i.prototype, "shadowOnly", void 0), _i = gi = O([x("DropShadowEffect"), D("design:paramtypes", [typeof (hi = typeof Partial < "u" && Partial) == "function" ? hi : Object, Array])], _i);
|
|
5821
5875
|
//#endregion
|
|
5822
5876
|
//#region src/scene/effects/EmbossEffect.ts
|
|
5823
|
-
var
|
|
5877
|
+
var vi, yi, bi = class extends H {
|
|
5824
5878
|
static {
|
|
5825
|
-
|
|
5879
|
+
yi = this;
|
|
5826
5880
|
}
|
|
5827
5881
|
static material = new F({ gl: {
|
|
5828
5882
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
@@ -5833,7 +5887,7 @@ var _i, vi, yi = class extends H {
|
|
|
5833
5887
|
}
|
|
5834
5888
|
apply(e, t) {
|
|
5835
5889
|
t.redraw(e, () => {
|
|
5836
|
-
I.draw(e,
|
|
5890
|
+
I.draw(e, yi.material, {
|
|
5837
5891
|
sampler: 0,
|
|
5838
5892
|
strength: this.strength,
|
|
5839
5893
|
inputSize: [
|
|
@@ -5846,12 +5900,12 @@ var _i, vi, yi = class extends H {
|
|
|
5846
5900
|
});
|
|
5847
5901
|
}
|
|
5848
5902
|
};
|
|
5849
|
-
O([_({ fallback: 5 }), D("design:type", Number)],
|
|
5903
|
+
O([_({ fallback: 5 }), D("design:type", Number)], bi.prototype, "strength", void 0), bi = yi = O([x("EmbossEffect"), D("design:paramtypes", [typeof (vi = typeof Partial < "u" && Partial) == "function" ? vi : Object, Array])], bi);
|
|
5850
5904
|
//#endregion
|
|
5851
5905
|
//#region src/scene/effects/GlitchEffect.ts
|
|
5852
|
-
var
|
|
5906
|
+
var xi, Si, G = class extends H {
|
|
5853
5907
|
static {
|
|
5854
|
-
|
|
5908
|
+
Si = this;
|
|
5855
5909
|
}
|
|
5856
5910
|
static material = new F({ gl: {
|
|
5857
5911
|
vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
@@ -5883,7 +5937,7 @@ var bi, xi, G = class extends H {
|
|
|
5883
5937
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
5884
5938
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
5885
5939
|
t.redraw(e, () => {
|
|
5886
|
-
this._texture.activate(e, 1), I.draw(e,
|
|
5940
|
+
this._texture.activate(e, 1), I.draw(e, Si.material, {
|
|
5887
5941
|
sampler: 0,
|
|
5888
5942
|
filterClamp: [
|
|
5889
5943
|
0,
|
|
@@ -5912,12 +5966,12 @@ var bi, xi, G = class extends H {
|
|
|
5912
5966
|
});
|
|
5913
5967
|
}
|
|
5914
5968
|
};
|
|
5915
|
-
O([_({ fallback: 10 }), D("design:type", Number)], G.prototype, "slices", void 0), O([_({ fallback: 512 }), D("design:type", Number)], G.prototype, "sampleSize", void 0), O([_({ fallback: 100 }), D("design:type", Number)], G.prototype, "offset", void 0), O([_({ fallback: 0 }), D("design:type", Number)], G.prototype, "direction", void 0), O([_({ fallback: 2 }), D("design:type", Number)], G.prototype, "fillMode", void 0), O([_({ fallback: 0 }), D("design:type", Number)], G.prototype, "seed", void 0), O([_({ default: () => [2, 2] }), D("design:type", Array)], G.prototype, "red", void 0), O([_({ default: () => [-10, 4] }), D("design:type", Array)], G.prototype, "green", void 0), O([_({ default: () => [10, -4] }), D("design:type", Array)], G.prototype, "blue", void 0), G =
|
|
5969
|
+
O([_({ fallback: 10 }), D("design:type", Number)], G.prototype, "slices", void 0), O([_({ fallback: 512 }), D("design:type", Number)], G.prototype, "sampleSize", void 0), O([_({ fallback: 100 }), D("design:type", Number)], G.prototype, "offset", void 0), O([_({ fallback: 0 }), D("design:type", Number)], G.prototype, "direction", void 0), O([_({ fallback: 2 }), D("design:type", Number)], G.prototype, "fillMode", void 0), O([_({ fallback: 0 }), D("design:type", Number)], G.prototype, "seed", void 0), O([_({ default: () => [2, 2] }), D("design:type", Array)], G.prototype, "red", void 0), O([_({ default: () => [-10, 4] }), D("design:type", Array)], G.prototype, "green", void 0), O([_({ default: () => [10, -4] }), D("design:type", Array)], G.prototype, "blue", void 0), G = Si = O([x("GlitchEffect"), D("design:paramtypes", [typeof (xi = typeof Partial < "u" && Partial) == "function" ? xi : Object, Array])], G);
|
|
5916
5970
|
//#endregion
|
|
5917
5971
|
//#region src/scene/effects/GodrayEffect.ts
|
|
5918
|
-
var
|
|
5972
|
+
var Ci, wi, Ti = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", K = class extends H {
|
|
5919
5973
|
static {
|
|
5920
|
-
|
|
5974
|
+
wi = this;
|
|
5921
5975
|
}
|
|
5922
5976
|
static material = new F({ gl: {
|
|
5923
5977
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
@@ -5932,7 +5986,7 @@ uniform float uTime;
|
|
|
5932
5986
|
uniform vec3 uRay;
|
|
5933
5987
|
uniform vec4 uInputSize;
|
|
5934
5988
|
|
|
5935
|
-
${
|
|
5989
|
+
${Ti}
|
|
5936
5990
|
|
|
5937
5991
|
void main(void) {
|
|
5938
5992
|
bool uParallel = uParallel > 0.5;
|
|
@@ -5971,7 +6025,7 @@ void main(void) {
|
|
|
5971
6025
|
apply(e, t) {
|
|
5972
6026
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
5973
6027
|
t.redraw(e, () => {
|
|
5974
|
-
I.draw(e,
|
|
6028
|
+
I.draw(e, wi.material, {
|
|
5975
6029
|
sampler: 0,
|
|
5976
6030
|
uDimensions: [t.width, t.height],
|
|
5977
6031
|
uParallel: +!!this.parallel,
|
|
@@ -5993,15 +6047,15 @@ void main(void) {
|
|
|
5993
6047
|
});
|
|
5994
6048
|
}
|
|
5995
6049
|
};
|
|
5996
|
-
O([_({ fallback: 0 }), D("design:type", Number)], K.prototype, "time", void 0), O([_({ fallback: 30 }), D("design:type", Number)], K.prototype, "angle", void 0), O([_({ fallback: .5 }), D("design:type", Number)], K.prototype, "gain", void 0), O([_({ fallback: 2.5 }), D("design:type", Number)], K.prototype, "lacunarity", void 0), O([_({ fallback: !0 }), D("design:type", Boolean)], K.prototype, "parallel", void 0), O([_({ default: () => [0, 0] }), D("design:type", Array)], K.prototype, "center", void 0), O([_({ fallback: 1 }), D("design:type", Number)], K.prototype, "alpha", void 0), K =
|
|
6050
|
+
O([_({ fallback: 0 }), D("design:type", Number)], K.prototype, "time", void 0), O([_({ fallback: 30 }), D("design:type", Number)], K.prototype, "angle", void 0), O([_({ fallback: .5 }), D("design:type", Number)], K.prototype, "gain", void 0), O([_({ fallback: 2.5 }), D("design:type", Number)], K.prototype, "lacunarity", void 0), O([_({ fallback: !0 }), D("design:type", Boolean)], K.prototype, "parallel", void 0), O([_({ default: () => [0, 0] }), D("design:type", Array)], K.prototype, "center", void 0), O([_({ fallback: 1 }), D("design:type", Number)], K.prototype, "alpha", void 0), K = wi = O([x("GodrayEffect"), D("design:paramtypes", [typeof (Ci = typeof Partial < "u" && Partial) == "function" ? Ci : Object, Array])], K);
|
|
5997
6051
|
//#endregion
|
|
5998
6052
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
5999
|
-
var
|
|
6053
|
+
var Ei, Di = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", Oi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", ki = class extends H {
|
|
6000
6054
|
_kernels = [0];
|
|
6001
6055
|
constructor(e, t = []) {
|
|
6002
6056
|
super(), this.material = new F({ gl: {
|
|
6003
6057
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6004
|
-
fragment: e?.clamp ?
|
|
6058
|
+
fragment: e?.clamp ? Oi : Di
|
|
6005
6059
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
6006
6060
|
}
|
|
6007
6061
|
_updateProperty(e, t, n) {
|
|
@@ -6039,12 +6093,12 @@ var Ti, Ei = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffse
|
|
|
6039
6093
|
});
|
|
6040
6094
|
}
|
|
6041
6095
|
};
|
|
6042
|
-
O([_({ fallback: 4 }), D("design:type", Number)],
|
|
6096
|
+
O([_({ fallback: 4 }), D("design:type", Number)], ki.prototype, "strength", void 0), O([_({ fallback: 3 }), D("design:type", Number)], ki.prototype, "quality", void 0), O([_({ default: () => [1, 1] }), D("design:type", Array)], ki.prototype, "pixelSize", void 0), ki = O([x("KawaseBlurEffect"), D("design:paramtypes", [typeof (Ei = typeof Partial < "u" && Partial) == "function" ? Ei : Object, Array])], ki);
|
|
6043
6097
|
//#endregion
|
|
6044
6098
|
//#region src/scene/effects/MaskEffect.ts
|
|
6045
|
-
var
|
|
6099
|
+
var Ai, ji, Mi = class extends H {
|
|
6046
6100
|
static {
|
|
6047
|
-
|
|
6101
|
+
ji = this;
|
|
6048
6102
|
}
|
|
6049
6103
|
static material = new F({ gl: {
|
|
6050
6104
|
vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
@@ -6066,7 +6120,7 @@ var ki, Ai, ji = class extends H {
|
|
|
6066
6120
|
}
|
|
6067
6121
|
apply(e, t, n) {
|
|
6068
6122
|
this.texture && t.redraw(e, () => {
|
|
6069
|
-
this.texture.activate(e, 1), I.draw(e,
|
|
6123
|
+
this.texture.activate(e, 1), I.draw(e, ji.material, {
|
|
6070
6124
|
sampler: 0,
|
|
6071
6125
|
mask: 1,
|
|
6072
6126
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -6074,23 +6128,23 @@ var ki, Ai, ji = class extends H {
|
|
|
6074
6128
|
});
|
|
6075
6129
|
}
|
|
6076
6130
|
};
|
|
6077
|
-
O([_({ fallback: "" }), D("design:type", String)],
|
|
6131
|
+
O([_({ fallback: "" }), D("design:type", String)], Mi.prototype, "image", void 0), Mi = ji = O([x("MaskEffect"), D("design:paramtypes", [typeof (Ai = typeof Partial < "u" && Partial) == "function" ? Ai : Object, Array])], Mi);
|
|
6078
6132
|
//#endregion
|
|
6079
6133
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6080
|
-
var
|
|
6134
|
+
var Ni, Pi, Fi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", q = class extends H {
|
|
6081
6135
|
static {
|
|
6082
|
-
|
|
6136
|
+
Pi = this;
|
|
6083
6137
|
}
|
|
6084
6138
|
static MIN_SAMPLES = 1;
|
|
6085
6139
|
static MAX_SAMPLES = 100;
|
|
6086
6140
|
static getAngleStep(e) {
|
|
6087
|
-
return Number.parseFloat((Math.PI * 2 / Math.max(e *
|
|
6141
|
+
return Number.parseFloat((Math.PI * 2 / Math.max(e * Pi.MAX_SAMPLES, Pi.MIN_SAMPLES)).toFixed(7));
|
|
6088
6142
|
}
|
|
6089
6143
|
_color = new T();
|
|
6090
6144
|
constructor(e, t = []) {
|
|
6091
6145
|
super(), this.setProperties(e).append(t), this.material = new F({ gl: {
|
|
6092
6146
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6093
|
-
fragment:
|
|
6147
|
+
fragment: Fi.replace(/\{ANGLE_STEP\}/, Pi.getAngleStep(this.quality).toFixed(7))
|
|
6094
6148
|
} });
|
|
6095
6149
|
}
|
|
6096
6150
|
apply(e, t) {
|
|
@@ -6100,7 +6154,7 @@ var Mi, Ni, Pi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D s
|
|
|
6100
6154
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
6101
6155
|
uColor: this._color.toArray().slice(0, 3),
|
|
6102
6156
|
uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
|
|
6103
|
-
uAngleStep:
|
|
6157
|
+
uAngleStep: Pi.getAngleStep(this.quality),
|
|
6104
6158
|
uKnockout: +!!this.knockout,
|
|
6105
6159
|
uInputClamp: [
|
|
6106
6160
|
0,
|
|
@@ -6112,12 +6166,12 @@ var Mi, Ni, Pi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D s
|
|
|
6112
6166
|
});
|
|
6113
6167
|
}
|
|
6114
6168
|
};
|
|
6115
|
-
O([_({ fallback: "#000000ff" }), D("design:type", Object)], q.prototype, "color", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", String)], q.prototype, "style", void 0), O([_(), D("design:type", Object)], q.prototype, "image", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "opacity", void 0), O([_({ fallback: .1 }), D("design:type", Number)], q.prototype, "quality", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], q.prototype, "knockout", void 0), q =
|
|
6169
|
+
O([_({ fallback: "#000000ff" }), D("design:type", Object)], q.prototype, "color", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", String)], q.prototype, "style", void 0), O([_(), D("design:type", Object)], q.prototype, "image", void 0), O([_({ fallback: 1 }), D("design:type", Number)], q.prototype, "opacity", void 0), O([_({ fallback: .1 }), D("design:type", Number)], q.prototype, "quality", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], q.prototype, "knockout", void 0), q = Pi = O([x("OutlineEffect"), D("design:paramtypes", [typeof (Ni = typeof Partial < "u" && Partial) == "function" ? Ni : Object, Array])], q);
|
|
6116
6170
|
//#endregion
|
|
6117
6171
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6118
|
-
var
|
|
6172
|
+
var Ii, Li, Ri = class extends H {
|
|
6119
6173
|
static {
|
|
6120
|
-
|
|
6174
|
+
Li = this;
|
|
6121
6175
|
}
|
|
6122
6176
|
static material = new F({ gl: {
|
|
6123
6177
|
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}",
|
|
@@ -6133,16 +6187,16 @@ var Fi, Ii, Li = class extends H {
|
|
|
6133
6187
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6134
6188
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6135
6189
|
};
|
|
6136
|
-
I.draw(e,
|
|
6190
|
+
I.draw(e, Li.material, a);
|
|
6137
6191
|
});
|
|
6138
6192
|
}
|
|
6139
6193
|
};
|
|
6140
|
-
O([_({ fallback: 10 }), D("design:type", Number)],
|
|
6194
|
+
O([_({ fallback: 10 }), D("design:type", Number)], Ri.prototype, "strength", void 0), Ri = Li = O([x("PixelateEffect"), D("design:paramtypes", [typeof (Ii = typeof Partial < "u" && Partial) == "function" ? Ii : Object, Array])], Ri);
|
|
6141
6195
|
//#endregion
|
|
6142
6196
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6143
|
-
var
|
|
6197
|
+
var zi, Bi, Vi = class extends H {
|
|
6144
6198
|
static {
|
|
6145
|
-
|
|
6199
|
+
Bi = this;
|
|
6146
6200
|
}
|
|
6147
6201
|
static material = new F({ gl: {
|
|
6148
6202
|
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}",
|
|
@@ -6153,7 +6207,7 @@ var Ri, zi, Bi = class extends H {
|
|
|
6153
6207
|
}
|
|
6154
6208
|
apply(e, t) {
|
|
6155
6209
|
t.redraw(e, () => {
|
|
6156
|
-
I.draw(e,
|
|
6210
|
+
I.draw(e, Bi.material, {
|
|
6157
6211
|
sampler: 0,
|
|
6158
6212
|
uCenter: [t.width / 2, t.height / 2],
|
|
6159
6213
|
uInnerRadius: this.innerRadius,
|
|
@@ -6169,10 +6223,10 @@ var Ri, zi, Bi = class extends H {
|
|
|
6169
6223
|
});
|
|
6170
6224
|
}
|
|
6171
6225
|
};
|
|
6172
|
-
O([_(), D("design:type", Array)],
|
|
6226
|
+
O([_(), D("design:type", Array)], Vi.prototype, "center", void 0), O([_({ fallback: 20 }), D("design:type", Number)], Vi.prototype, "innerRadius", void 0), O([_({ fallback: -1 }), D("design:type", Number)], Vi.prototype, "radius", void 0), O([_({ fallback: .1 }), D("design:type", Number)], Vi.prototype, "strength", void 0), Vi = Bi = O([x("ZoomBlurEffect"), D("design:paramtypes", [typeof (zi = typeof Partial < "u" && Partial) == "function" ? zi : Object, Array])], Vi);
|
|
6173
6227
|
//#endregion
|
|
6174
6228
|
//#region src/scene/2d/element/utils.ts
|
|
6175
|
-
function
|
|
6229
|
+
function Hi(e, t) {
|
|
6176
6230
|
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new v().translate(-n, -r).scale(1 / i, 1 / a);
|
|
6177
6231
|
if (e.cropRect) {
|
|
6178
6232
|
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
|
|
@@ -6253,7 +6307,7 @@ var J = class extends C {
|
|
|
6253
6307
|
let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
|
|
6254
6308
|
r = {
|
|
6255
6309
|
...r,
|
|
6256
|
-
...
|
|
6310
|
+
...Hi(this, this.tile && i ? {
|
|
6257
6311
|
x: 0,
|
|
6258
6312
|
y: 0,
|
|
6259
6313
|
width: i.sourceWidth,
|
|
@@ -6292,7 +6346,7 @@ var J = class extends C {
|
|
|
6292
6346
|
O([_({ fallback: !0 }), D("design:type", Boolean)], J.prototype, "enabled", void 0), O([_(), D("design:type", Object)], J.prototype, "color", void 0), O([_(), D("design:type", Object)], J.prototype, "image", void 0), O([_(), D("design:type", Object)], J.prototype, "linearGradient", void 0), O([_(), D("design:type", Object)], J.prototype, "radialGradient", void 0), O([_(), D("design:type", Object)], J.prototype, "cropRect", void 0), O([_(), D("design:type", Object)], J.prototype, "stretchRect", void 0), O([_(), D("design:type", Object)], J.prototype, "dpi", void 0), O([_(), D("design:type", Object)], J.prototype, "rotateWithShape", void 0), O([_(), D("design:type", Object)], J.prototype, "tile", void 0), O([_(), D("design:type", Object)], J.prototype, "opacity", void 0);
|
|
6293
6347
|
//#endregion
|
|
6294
6348
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6295
|
-
var
|
|
6349
|
+
var Ui = class extends J {
|
|
6296
6350
|
setProperties(e) {
|
|
6297
6351
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6298
6352
|
}
|
|
@@ -6304,14 +6358,14 @@ var Hi = class extends J {
|
|
|
6304
6358
|
}
|
|
6305
6359
|
}
|
|
6306
6360
|
};
|
|
6307
|
-
O([_(), D("design:type", Object)],
|
|
6361
|
+
O([_(), D("design:type", Object)], Ui.prototype, "fillWithShape", void 0);
|
|
6308
6362
|
//#endregion
|
|
6309
6363
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6310
|
-
var
|
|
6311
|
-
function
|
|
6312
|
-
return
|
|
6364
|
+
var Wi;
|
|
6365
|
+
function Gi() {
|
|
6366
|
+
return Wi ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), Wi;
|
|
6313
6367
|
}
|
|
6314
|
-
function
|
|
6368
|
+
function Ki(e) {
|
|
6315
6369
|
if (!e) return { show: !1 };
|
|
6316
6370
|
switch (e) {
|
|
6317
6371
|
case "bottom": return {
|
|
@@ -6377,7 +6431,7 @@ var Y = class extends C {
|
|
|
6377
6431
|
this._teardown(), this._parent.requestDraw();
|
|
6378
6432
|
return;
|
|
6379
6433
|
}
|
|
6380
|
-
let n = await
|
|
6434
|
+
let n = await Gi();
|
|
6381
6435
|
if (!n) {
|
|
6382
6436
|
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)");
|
|
6383
6437
|
return;
|
|
@@ -6426,7 +6480,7 @@ var Y = class extends C {
|
|
|
6426
6480
|
text: this.title,
|
|
6427
6481
|
left: "center"
|
|
6428
6482
|
} : void 0,
|
|
6429
|
-
legend:
|
|
6483
|
+
legend: Ki(this.legend),
|
|
6430
6484
|
tooltip: {}
|
|
6431
6485
|
};
|
|
6432
6486
|
if (n) {
|
|
@@ -6473,7 +6527,7 @@ var Y = class extends C {
|
|
|
6473
6527
|
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);
|
|
6474
6528
|
//#endregion
|
|
6475
6529
|
//#region src/scene/2d/element/Element2DConnection.ts
|
|
6476
|
-
var
|
|
6530
|
+
var qi = class extends C {
|
|
6477
6531
|
_parent;
|
|
6478
6532
|
_routeSig;
|
|
6479
6533
|
_routePath;
|
|
@@ -6511,7 +6565,7 @@ var Ki = class extends C {
|
|
|
6511
6565
|
y: Math.sin(n.ang)
|
|
6512
6566
|
}, {
|
|
6513
6567
|
point: e,
|
|
6514
|
-
dir:
|
|
6568
|
+
dir: Ji(r, t.globalRotation)
|
|
6515
6569
|
};
|
|
6516
6570
|
}
|
|
6517
6571
|
}
|
|
@@ -6528,8 +6582,8 @@ var Ki = class extends C {
|
|
|
6528
6582
|
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Rr(this.mode, e ?? t, t ?? e)), this._routePath;
|
|
6529
6583
|
}
|
|
6530
6584
|
};
|
|
6531
|
-
O([_(), D("design:type", Object)],
|
|
6532
|
-
function
|
|
6585
|
+
O([_(), D("design:type", Object)], qi.prototype, "start", void 0), O([_(), D("design:type", Object)], qi.prototype, "end", void 0), O([_({ fallback: "straight" }), D("design:type", Object)], qi.prototype, "mode", void 0);
|
|
6586
|
+
function Ji(e, t) {
|
|
6533
6587
|
if (!t) return e;
|
|
6534
6588
|
let n = Math.cos(t), r = Math.sin(t);
|
|
6535
6589
|
return {
|
|
@@ -6539,7 +6593,7 @@ function qi(e, t) {
|
|
|
6539
6593
|
}
|
|
6540
6594
|
//#endregion
|
|
6541
6595
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6542
|
-
var
|
|
6596
|
+
var Yi = class extends J {
|
|
6543
6597
|
setProperties(e) {
|
|
6544
6598
|
return super._setProperties(d(e) ? void 0 : g(e));
|
|
6545
6599
|
}
|
|
@@ -6551,10 +6605,10 @@ var Ji = class extends J {
|
|
|
6551
6605
|
}
|
|
6552
6606
|
}
|
|
6553
6607
|
};
|
|
6554
|
-
O([_(), D("design:type", Object)],
|
|
6608
|
+
O([_(), D("design:type", Object)], Yi.prototype, "fillWithShape", void 0);
|
|
6555
6609
|
//#endregion
|
|
6556
6610
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6557
|
-
var
|
|
6611
|
+
var Xi = class extends J {
|
|
6558
6612
|
setProperties(e) {
|
|
6559
6613
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6560
6614
|
}
|
|
@@ -6574,7 +6628,7 @@ var Yi = class extends J {
|
|
|
6574
6628
|
}
|
|
6575
6629
|
draw() {
|
|
6576
6630
|
let { width: e, height: t } = this._parent.size, n = this._parent.context;
|
|
6577
|
-
this.image === "viewport" ? n.strokeStyle = new lr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...
|
|
6631
|
+
this.image === "viewport" ? n.strokeStyle = new lr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...Hi(this, {
|
|
6578
6632
|
x: 0,
|
|
6579
6633
|
y: 0,
|
|
6580
6634
|
width: e,
|
|
@@ -6582,10 +6636,10 @@ var Yi = class extends J {
|
|
|
6582
6636
|
}) });
|
|
6583
6637
|
}
|
|
6584
6638
|
};
|
|
6585
|
-
O([_(), D("design:type", Object)],
|
|
6639
|
+
O([_(), D("design:type", Object)], Xi.prototype, "color", void 0), O([_(), D("design:type", Object)], Xi.prototype, "width", void 0), O([_({ fallback: "solid" }), D("design:type", Object)], Xi.prototype, "style", void 0), O([_({ fallback: "butt" }), D("design:type", Object)], Xi.prototype, "lineCap", void 0), O([_({ fallback: "miter" }), D("design:type", Object)], Xi.prototype, "lineJoin", void 0);
|
|
6586
6640
|
//#endregion
|
|
6587
6641
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
6588
|
-
var
|
|
6642
|
+
var Zi = class extends C {
|
|
6589
6643
|
_parent;
|
|
6590
6644
|
constructor(e) {
|
|
6591
6645
|
super(), this._parent = e;
|
|
@@ -6606,13 +6660,13 @@ var Xi = class extends C {
|
|
|
6606
6660
|
}
|
|
6607
6661
|
updateEffect() {
|
|
6608
6662
|
let e = "__$shadow", t = this._parent.getNode(e);
|
|
6609
|
-
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new
|
|
6663
|
+
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new _i({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
6610
6664
|
}
|
|
6611
6665
|
};
|
|
6612
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6666
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], Zi.prototype, "enabled", void 0), O([_({ fallback: "#000000FF" }), D("design:type", Object)], Zi.prototype, "color", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Zi.prototype, "blur", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Zi.prototype, "offsetY", void 0), O([_({ fallback: 0 }), D("design:type", Object)], Zi.prototype, "offsetX", void 0);
|
|
6613
6667
|
//#endregion
|
|
6614
6668
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
6615
|
-
var
|
|
6669
|
+
var Qi = class extends C {
|
|
6616
6670
|
_parent;
|
|
6617
6671
|
_path2DSet = new le();
|
|
6618
6672
|
_localPath;
|
|
@@ -6710,24 +6764,24 @@ var Zi = class extends C {
|
|
|
6710
6764
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
6711
6765
|
}
|
|
6712
6766
|
};
|
|
6713
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6767
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], Qi.prototype, "enabled", void 0), O([_(), D("design:type", Object)], Qi.prototype, "preset", void 0), O([_(), D("design:type", Object)], Qi.prototype, "svg", void 0), O([_(), D("design:type", Object)], Qi.prototype, "viewBox", void 0), O([_(), D("design:type", Object)], Qi.prototype, "paths", void 0), O([_(), D("design:type", Object)], Qi.prototype, "connectionPoints", void 0);
|
|
6714
6768
|
//#endregion
|
|
6715
6769
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
6716
|
-
var
|
|
6770
|
+
var $i = class extends w {
|
|
6717
6771
|
constructor(e) {
|
|
6718
6772
|
super(), this.setProperties(e);
|
|
6719
6773
|
}
|
|
6720
|
-
},
|
|
6774
|
+
}, ea = {
|
|
6721
6775
|
...o(),
|
|
6722
6776
|
left: 0,
|
|
6723
6777
|
top: 0,
|
|
6724
6778
|
width: 0,
|
|
6725
6779
|
height: 0
|
|
6726
6780
|
};
|
|
6727
|
-
for (let e in
|
|
6781
|
+
for (let e in ea) i($i, e, { fallback: ea[e] });
|
|
6728
6782
|
//#endregion
|
|
6729
6783
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
6730
|
-
var
|
|
6784
|
+
var ta = 100, na = 40, ra = class extends C {
|
|
6731
6785
|
_parent;
|
|
6732
6786
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
6733
6787
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -6758,10 +6812,10 @@ var ea = 100, ta = 40, na = class extends C {
|
|
|
6758
6812
|
return !!(this.enabled && this.cells.length);
|
|
6759
6813
|
}
|
|
6760
6814
|
get gridWidth() {
|
|
6761
|
-
return this.columns.reduce((e, t) => e + (t.width ||
|
|
6815
|
+
return this.columns.reduce((e, t) => e + (t.width || ta), 0);
|
|
6762
6816
|
}
|
|
6763
6817
|
get gridHeight() {
|
|
6764
|
-
return this.rows.reduce((e, t) => e + (t.height ||
|
|
6818
|
+
return this.rows.reduce((e, t) => e + (t.height || na), 0);
|
|
6765
6819
|
}
|
|
6766
6820
|
update() {
|
|
6767
6821
|
if (this._dirty = !1, !this.isValid()) {
|
|
@@ -6771,9 +6825,9 @@ var ea = 100, ta = 40, na = class extends C {
|
|
|
6771
6825
|
let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
|
|
6772
6826
|
for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
|
|
6773
6827
|
let a = [0];
|
|
6774
|
-
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width ||
|
|
6828
|
+
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || ta));
|
|
6775
6829
|
let o = [0];
|
|
6776
|
-
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height ||
|
|
6830
|
+
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || na));
|
|
6777
6831
|
this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
|
|
6778
6832
|
let s = /* @__PURE__ */ new Set();
|
|
6779
6833
|
for (let e of n) {
|
|
@@ -6810,10 +6864,10 @@ var ea = 100, ta = 40, na = class extends C {
|
|
|
6810
6864
|
this._clearCells();
|
|
6811
6865
|
}
|
|
6812
6866
|
};
|
|
6813
|
-
O([_({ fallback: !0 }), D("design:type", Boolean)],
|
|
6867
|
+
O([_({ fallback: !0 }), D("design:type", Boolean)], ra.prototype, "enabled", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], ra.prototype, "columns", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], ra.prototype, "rows", void 0), O([_({ fallback: () => [] }), D("design:type", Object)], ra.prototype, "cells", void 0);
|
|
6814
6868
|
//#endregion
|
|
6815
6869
|
//#region src/scene/2d/element/Element2DText.ts
|
|
6816
|
-
var
|
|
6870
|
+
var ia, X = class extends C {
|
|
6817
6871
|
_parent;
|
|
6818
6872
|
base;
|
|
6819
6873
|
get textContent() {
|
|
@@ -6924,7 +6978,7 @@ var ra, X = class extends C {
|
|
|
6924
6978
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
6925
6979
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
6926
6980
|
r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
|
|
6927
|
-
...
|
|
6981
|
+
...Hi(r, o?.box ?? {
|
|
6928
6982
|
x: 0,
|
|
6929
6983
|
y: 0,
|
|
6930
6984
|
width: this._parent.size.width,
|
|
@@ -6936,7 +6990,7 @@ var ra, X = class extends C {
|
|
|
6936
6990
|
if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
|
|
6937
6991
|
let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
6938
6992
|
r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? r.color, e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
|
|
6939
|
-
...
|
|
6993
|
+
...Hi(r, o?.box ?? {
|
|
6940
6994
|
x: 0,
|
|
6941
6995
|
y: 0,
|
|
6942
6996
|
width: this._parent.size.width,
|
|
@@ -6966,7 +7020,7 @@ var ra, X = class extends C {
|
|
|
6966
7020
|
}
|
|
6967
7021
|
process(e) {}
|
|
6968
7022
|
};
|
|
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 (
|
|
7023
|
+
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 (ia = typeof HTMLElement < "u" && HTMLElement) == "function" ? ia : 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);
|
|
6970
7024
|
//#endregion
|
|
6971
7025
|
//#region src/scene/2d/element/Flexbox.ts
|
|
6972
7026
|
var Z = {
|
|
@@ -6979,7 +7033,7 @@ var Z = {
|
|
|
6979
7033
|
horizontal: 6,
|
|
6980
7034
|
vertical: 7,
|
|
6981
7035
|
all: 8
|
|
6982
|
-
},
|
|
7036
|
+
}, aa = {
|
|
6983
7037
|
column: 0,
|
|
6984
7038
|
row: 1,
|
|
6985
7039
|
all: 2
|
|
@@ -6993,42 +7047,42 @@ var Z = {
|
|
|
6993
7047
|
"space-between": 6,
|
|
6994
7048
|
"space-around": 7,
|
|
6995
7049
|
"space-evenly": 8
|
|
6996
|
-
},
|
|
7050
|
+
}, oa = {
|
|
6997
7051
|
flex: 0,
|
|
6998
7052
|
none: 1,
|
|
6999
7053
|
contents: 2
|
|
7000
|
-
},
|
|
7054
|
+
}, sa = {
|
|
7001
7055
|
inherit: 0,
|
|
7002
7056
|
ltr: 1,
|
|
7003
7057
|
rtl: 2
|
|
7004
|
-
},
|
|
7058
|
+
}, ca = {
|
|
7005
7059
|
column: 0,
|
|
7006
7060
|
"column-reverse": 1,
|
|
7007
7061
|
row: 2,
|
|
7008
7062
|
"row-reverse": 3
|
|
7009
|
-
},
|
|
7063
|
+
}, la = {
|
|
7010
7064
|
"no-wrap": 0,
|
|
7011
7065
|
wrap: 1,
|
|
7012
7066
|
"Wrap-reverse": 2
|
|
7013
|
-
},
|
|
7067
|
+
}, ua = {
|
|
7014
7068
|
"flex-start": 0,
|
|
7015
7069
|
center: 1,
|
|
7016
7070
|
"flex-end": 2,
|
|
7017
7071
|
"space-between": 3,
|
|
7018
7072
|
"space-around": 4,
|
|
7019
7073
|
"space-evenly": 5
|
|
7020
|
-
},
|
|
7074
|
+
}, da = {
|
|
7021
7075
|
visible: 0,
|
|
7022
7076
|
hidden: 1,
|
|
7023
7077
|
scroll: 2
|
|
7024
|
-
},
|
|
7078
|
+
}, fa = {
|
|
7025
7079
|
static: 0,
|
|
7026
7080
|
relative: 1,
|
|
7027
7081
|
absolute: 2
|
|
7028
|
-
},
|
|
7082
|
+
}, pa = {
|
|
7029
7083
|
"border-box": 0,
|
|
7030
7084
|
"content-box": 1
|
|
7031
|
-
},
|
|
7085
|
+
}, ma = class e {
|
|
7032
7086
|
_parent;
|
|
7033
7087
|
static _yoga;
|
|
7034
7088
|
static async load() {
|
|
@@ -7040,14 +7094,14 @@ var Z = {
|
|
|
7040
7094
|
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);
|
|
7041
7095
|
}
|
|
7042
7096
|
_addChild(e, t) {
|
|
7043
|
-
if (e instanceof
|
|
7097
|
+
if (e instanceof ba && e.flexbox.node && this.node) {
|
|
7044
7098
|
this.node.insertChild(e.flexbox.node, t);
|
|
7045
7099
|
let n = e.style.getProperties();
|
|
7046
7100
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7047
7101
|
}
|
|
7048
7102
|
}
|
|
7049
7103
|
_removeChild(e, t) {
|
|
7050
|
-
e instanceof
|
|
7104
|
+
e instanceof ba && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7051
7105
|
}
|
|
7052
7106
|
updateStyleProperty(e, t) {
|
|
7053
7107
|
let n = this.node;
|
|
@@ -7081,10 +7135,10 @@ var Z = {
|
|
|
7081
7135
|
n.setBorder(Z.all, this._parent.style.borderWidth);
|
|
7082
7136
|
break;
|
|
7083
7137
|
case "direction":
|
|
7084
|
-
n.setDirection(t ?
|
|
7138
|
+
n.setDirection(t ? sa[t] ?? sa.inherit : sa.inherit);
|
|
7085
7139
|
break;
|
|
7086
7140
|
case "display":
|
|
7087
|
-
n.setDisplay(t ?
|
|
7141
|
+
n.setDisplay(t ? oa[t] ?? oa.flex : oa.flex);
|
|
7088
7142
|
break;
|
|
7089
7143
|
case "flex":
|
|
7090
7144
|
n.setFlex(t);
|
|
@@ -7093,7 +7147,7 @@ var Z = {
|
|
|
7093
7147
|
n.setFlexBasis(t);
|
|
7094
7148
|
break;
|
|
7095
7149
|
case "flexDirection":
|
|
7096
|
-
n.setFlexDirection(t ?
|
|
7150
|
+
n.setFlexDirection(t ? ca[t] ?? ca.row : ca.row);
|
|
7097
7151
|
break;
|
|
7098
7152
|
case "flexGrow":
|
|
7099
7153
|
n.setFlexGrow(t);
|
|
@@ -7102,16 +7156,16 @@ var Z = {
|
|
|
7102
7156
|
n.setFlexShrink(t);
|
|
7103
7157
|
break;
|
|
7104
7158
|
case "flexWrap":
|
|
7105
|
-
n.setFlexWrap(t ?
|
|
7159
|
+
n.setFlexWrap(t ? la[t] ?? la.wrap : la.wrap);
|
|
7106
7160
|
break;
|
|
7107
7161
|
case "height":
|
|
7108
7162
|
n.setHeight(t);
|
|
7109
7163
|
break;
|
|
7110
7164
|
case "justifyContent":
|
|
7111
|
-
n.setJustifyContent(t ?
|
|
7165
|
+
n.setJustifyContent(t ? ua[t] ?? ua["flex-start"] : ua["flex-start"]);
|
|
7112
7166
|
break;
|
|
7113
7167
|
case "gap":
|
|
7114
|
-
t !== void 0 && n.setGap(
|
|
7168
|
+
t !== void 0 && n.setGap(aa.all, t);
|
|
7115
7169
|
break;
|
|
7116
7170
|
case "marginTop":
|
|
7117
7171
|
n.setMargin(Z.top, t);
|
|
@@ -7141,7 +7195,7 @@ var Z = {
|
|
|
7141
7195
|
n.setMinWidth(t);
|
|
7142
7196
|
break;
|
|
7143
7197
|
case "overflow":
|
|
7144
|
-
n.setOverflow(t ?
|
|
7198
|
+
n.setOverflow(t ? da[t] ?? da.visible : da.visible);
|
|
7145
7199
|
break;
|
|
7146
7200
|
case "paddingTop":
|
|
7147
7201
|
n.setPadding(Z.top, t);
|
|
@@ -7171,10 +7225,10 @@ var Z = {
|
|
|
7171
7225
|
n.setPosition(Z.right, t);
|
|
7172
7226
|
break;
|
|
7173
7227
|
case "position":
|
|
7174
|
-
n.setPositionType(t ?
|
|
7228
|
+
n.setPositionType(t ? fa[t] ?? fa.relative : fa.relative);
|
|
7175
7229
|
break;
|
|
7176
7230
|
case "boxSizing":
|
|
7177
|
-
n.setBoxSizing(t ?
|
|
7231
|
+
n.setBoxSizing(t ? pa[t] ?? pa["content-box"] : pa["content-box"]);
|
|
7178
7232
|
break;
|
|
7179
7233
|
case "width":
|
|
7180
7234
|
n.setWidth(t);
|
|
@@ -7185,7 +7239,7 @@ var Z = {
|
|
|
7185
7239
|
}
|
|
7186
7240
|
update() {
|
|
7187
7241
|
let e = this._parent, t = this.node;
|
|
7188
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
7242
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, sa.ltr), t.hasNewLayout())) {
|
|
7189
7243
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7190
7244
|
(!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();
|
|
7191
7245
|
}
|
|
@@ -7193,13 +7247,13 @@ var Z = {
|
|
|
7193
7247
|
destroy() {
|
|
7194
7248
|
this.node?.free(), this.node = void 0;
|
|
7195
7249
|
}
|
|
7196
|
-
},
|
|
7250
|
+
}, ha, ga = new Set(Object.keys(a())), _a = new Set(Object.keys(s())), va = new y(), ya = [
|
|
7197
7251
|
[0, 0],
|
|
7198
7252
|
[1, 0],
|
|
7199
7253
|
[1, 1],
|
|
7200
7254
|
[0, 1]
|
|
7201
|
-
],
|
|
7202
|
-
flexbox = new
|
|
7255
|
+
], ba = class extends Pr {
|
|
7256
|
+
flexbox = new ma(this);
|
|
7203
7257
|
aabb = new mt();
|
|
7204
7258
|
globalAabb = new mt();
|
|
7205
7259
|
_parentGlobalDisplay;
|
|
@@ -7212,7 +7266,7 @@ var Z = {
|
|
|
7212
7266
|
});
|
|
7213
7267
|
_allowPointerEvents = !0;
|
|
7214
7268
|
_overflowHidden = !1;
|
|
7215
|
-
_style = new
|
|
7269
|
+
_style = new $i().on("updateProperty", (...e) => {
|
|
7216
7270
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
7217
7271
|
});
|
|
7218
7272
|
get style() {
|
|
@@ -7226,14 +7280,14 @@ var Z = {
|
|
|
7226
7280
|
this._endBatch();
|
|
7227
7281
|
}
|
|
7228
7282
|
}
|
|
7229
|
-
_background = new
|
|
7283
|
+
_background = new Ui(this);
|
|
7230
7284
|
get background() {
|
|
7231
7285
|
return this._background;
|
|
7232
7286
|
}
|
|
7233
7287
|
set background(e) {
|
|
7234
7288
|
this._background.resetProperties().setProperties(e);
|
|
7235
7289
|
}
|
|
7236
|
-
_shape = new
|
|
7290
|
+
_shape = new Qi(this);
|
|
7237
7291
|
get shape() {
|
|
7238
7292
|
return this._shape;
|
|
7239
7293
|
}
|
|
@@ -7247,14 +7301,14 @@ var Z = {
|
|
|
7247
7301
|
set fill(e) {
|
|
7248
7302
|
this._fill.resetProperties().setProperties(e);
|
|
7249
7303
|
}
|
|
7250
|
-
_outline = new
|
|
7304
|
+
_outline = new Xi(this);
|
|
7251
7305
|
get outline() {
|
|
7252
7306
|
return this._outline;
|
|
7253
7307
|
}
|
|
7254
7308
|
set outline(e) {
|
|
7255
7309
|
this._outline.resetProperties().setProperties(e);
|
|
7256
7310
|
}
|
|
7257
|
-
_foreground = new
|
|
7311
|
+
_foreground = new Yi(this);
|
|
7258
7312
|
get foreground() {
|
|
7259
7313
|
return this._foreground;
|
|
7260
7314
|
}
|
|
@@ -7268,21 +7322,21 @@ var Z = {
|
|
|
7268
7322
|
set text(e) {
|
|
7269
7323
|
this._text.resetProperties().setProperties(e);
|
|
7270
7324
|
}
|
|
7271
|
-
_shadow = new
|
|
7325
|
+
_shadow = new Zi(this);
|
|
7272
7326
|
get shadow() {
|
|
7273
7327
|
return this._shadow;
|
|
7274
7328
|
}
|
|
7275
7329
|
set shadow(e) {
|
|
7276
7330
|
this._shadow.resetProperties().setProperties(e);
|
|
7277
7331
|
}
|
|
7278
|
-
_connection = new
|
|
7332
|
+
_connection = new qi(this);
|
|
7279
7333
|
get connection() {
|
|
7280
7334
|
return this._connection;
|
|
7281
7335
|
}
|
|
7282
7336
|
set connection(e) {
|
|
7283
7337
|
this._connection.resetProperties().setProperties(e);
|
|
7284
7338
|
}
|
|
7285
|
-
_table = new
|
|
7339
|
+
_table = new ra(this);
|
|
7286
7340
|
get table() {
|
|
7287
7341
|
return this._table;
|
|
7288
7342
|
}
|
|
@@ -7395,7 +7449,7 @@ var Z = {
|
|
|
7395
7449
|
}), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
|
|
7396
7450
|
break;
|
|
7397
7451
|
case "transformOrigin": {
|
|
7398
|
-
let e =
|
|
7452
|
+
let e = Gr(t ?? "");
|
|
7399
7453
|
this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
|
|
7400
7454
|
break;
|
|
7401
7455
|
}
|
|
@@ -7439,7 +7493,7 @@ var Z = {
|
|
|
7439
7493
|
this.requestDraw();
|
|
7440
7494
|
break;
|
|
7441
7495
|
}
|
|
7442
|
-
if ((
|
|
7496
|
+
if ((_a.has(e) || ga.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
7443
7497
|
else switch (e) {
|
|
7444
7498
|
case "left":
|
|
7445
7499
|
this.position.x = Number(t);
|
|
@@ -7479,21 +7533,21 @@ var Z = {
|
|
|
7479
7533
|
}
|
|
7480
7534
|
_intersectsViewport(e) {
|
|
7481
7535
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7482
|
-
for (let [e, c] of
|
|
7536
|
+
for (let [e, c] of ya) t.applyAffineInverse({
|
|
7483
7537
|
x: e * n,
|
|
7484
7538
|
y: c * r
|
|
7485
|
-
},
|
|
7539
|
+
}, va), i = Math.min(i, va.x), a = Math.max(a, va.x), o = Math.min(o, va.y), s = Math.max(s, va.y);
|
|
7486
7540
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7487
7541
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7488
7542
|
}
|
|
7489
7543
|
_updateStyleFilter(e) {
|
|
7490
|
-
d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new
|
|
7544
|
+
d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new Xr({
|
|
7491
7545
|
name: "styleFilter",
|
|
7492
7546
|
internalMode: "front"
|
|
7493
7547
|
}), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e);
|
|
7494
7548
|
}
|
|
7495
7549
|
_updateStyleMaskImage(e) {
|
|
7496
|
-
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new
|
|
7550
|
+
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new Mi({
|
|
7497
7551
|
name: "styleMaskImage",
|
|
7498
7552
|
internalMode: "back"
|
|
7499
7553
|
}), this.append(this._maskEffect)), this._maskEffect.image = e);
|
|
@@ -7582,10 +7636,10 @@ var Z = {
|
|
|
7582
7636
|
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;
|
|
7583
7637
|
}
|
|
7584
7638
|
};
|
|
7585
|
-
|
|
7639
|
+
ba = O([x("Element2D"), D("design:paramtypes", [typeof (ha = typeof Partial < "u" && Partial) == "function" ? ha : Object, Array])], ba);
|
|
7586
7640
|
//#endregion
|
|
7587
7641
|
//#region src/scene/2d/TextureRect2D.ts
|
|
7588
|
-
var
|
|
7642
|
+
var xa = class extends ba {
|
|
7589
7643
|
texture;
|
|
7590
7644
|
constructor(e, t = []) {
|
|
7591
7645
|
super(), this.setProperties(e).append(t);
|
|
@@ -7599,7 +7653,7 @@ var ba = class extends ya {
|
|
|
7599
7653
|
} });
|
|
7600
7654
|
}
|
|
7601
7655
|
}
|
|
7602
|
-
},
|
|
7656
|
+
}, Sa, Ca = class extends xa {
|
|
7603
7657
|
texture = new rr();
|
|
7604
7658
|
animation;
|
|
7605
7659
|
_lastTime = NaN;
|
|
@@ -7630,10 +7684,10 @@ var ba = class extends ya {
|
|
|
7630
7684
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
7631
7685
|
}
|
|
7632
7686
|
};
|
|
7633
|
-
O([_({ fallback: "" }), D("design:type", String)],
|
|
7687
|
+
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);
|
|
7634
7688
|
//#endregion
|
|
7635
7689
|
//#region src/scene/2d/TransformRect2D.ts
|
|
7636
|
-
var
|
|
7690
|
+
var wa = class extends ba {
|
|
7637
7691
|
constructor(e, t = []) {
|
|
7638
7692
|
super(), this.setProperties(e).append(t);
|
|
7639
7693
|
}
|
|
@@ -7656,10 +7710,10 @@ var Ca = class extends ya {
|
|
|
7656
7710
|
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);
|
|
7657
7711
|
}
|
|
7658
7712
|
};
|
|
7659
|
-
O([_({ fallback: 6 }), D("design:type", Number)],
|
|
7713
|
+
O([_({ fallback: 6 }), D("design:type", Number)], wa.prototype, "handleSize", void 0);
|
|
7660
7714
|
//#endregion
|
|
7661
7715
|
//#region src/scene/2d/Video2D.ts
|
|
7662
|
-
var
|
|
7716
|
+
var Ta, Ea = class extends xa {
|
|
7663
7717
|
get videoDuration() {
|
|
7664
7718
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
7665
7719
|
}
|
|
@@ -7699,11 +7753,11 @@ var wa, Ta = class extends ba {
|
|
|
7699
7753
|
super._process(e), this._updateVideoCurrentTime();
|
|
7700
7754
|
}
|
|
7701
7755
|
};
|
|
7702
|
-
O([_({ fallback: "" }), D("design:type", String)],
|
|
7756
|
+
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);
|
|
7703
7757
|
//#endregion
|
|
7704
7758
|
//#region src/scene/animation/Animation.ts
|
|
7705
|
-
var
|
|
7706
|
-
function
|
|
7759
|
+
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);
|
|
7760
|
+
function Na(e, t, n, r) {
|
|
7707
7761
|
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;
|
|
7708
7762
|
function m(e) {
|
|
7709
7763
|
let t = e, n, r;
|
|
@@ -7723,13 +7777,13 @@ function Ma(e, t, n, r) {
|
|
|
7723
7777
|
}
|
|
7724
7778
|
return (e) => p(m(e));
|
|
7725
7779
|
}
|
|
7726
|
-
var
|
|
7727
|
-
linear:
|
|
7728
|
-
ease:
|
|
7729
|
-
easeIn:
|
|
7730
|
-
easeOut:
|
|
7731
|
-
easeInOut:
|
|
7732
|
-
},
|
|
7780
|
+
var Pa = {
|
|
7781
|
+
linear: Oa,
|
|
7782
|
+
ease: ka,
|
|
7783
|
+
easeIn: Aa,
|
|
7784
|
+
easeOut: ja,
|
|
7785
|
+
easeInOut: Ma
|
|
7786
|
+
}, Fa = class extends B {
|
|
7733
7787
|
_keyframes = [];
|
|
7734
7788
|
_isFirstUpdatePosition = !1;
|
|
7735
7789
|
_cachedProps = new t();
|
|
@@ -7764,7 +7818,7 @@ var Na = {
|
|
|
7764
7818
|
e = [this.getParent()].filter(Boolean);
|
|
7765
7819
|
break;
|
|
7766
7820
|
}
|
|
7767
|
-
return e.filter((e) => e instanceof
|
|
7821
|
+
return e.filter((e) => e instanceof ba);
|
|
7768
7822
|
}
|
|
7769
7823
|
_updateKeyframes() {
|
|
7770
7824
|
let e = [], t = this.keyframes;
|
|
@@ -7812,10 +7866,10 @@ var Na = {
|
|
|
7812
7866
|
});
|
|
7813
7867
|
}
|
|
7814
7868
|
_parseEasing(e) {
|
|
7815
|
-
if (!e) return
|
|
7816
|
-
if (e in
|
|
7869
|
+
if (!e) return Pa.linear;
|
|
7870
|
+
if (e in Pa) return Pa[e];
|
|
7817
7871
|
let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
|
|
7818
|
-
return
|
|
7872
|
+
return Na(t[0], t[1], t[2], t[3]);
|
|
7819
7873
|
}
|
|
7820
7874
|
_parseKeyframes(e, t) {
|
|
7821
7875
|
let n, r = this._keyframes;
|
|
@@ -7893,14 +7947,14 @@ var Na = {
|
|
|
7893
7947
|
});
|
|
7894
7948
|
}
|
|
7895
7949
|
};
|
|
7896
|
-
O([_({ fallback: "parent" }), D("design:type", Object)],
|
|
7950
|
+
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", {
|
|
7897
7951
|
renderMode: "disabled",
|
|
7898
7952
|
processSortMode: "parent-before",
|
|
7899
7953
|
duration: 2e3
|
|
7900
|
-
}), D("design:paramtypes", [typeof (
|
|
7954
|
+
}), D("design:paramtypes", [typeof (Da = typeof Partial < "u" && Partial) == "function" ? Da : Object, Array])], Fa);
|
|
7901
7955
|
//#endregion
|
|
7902
7956
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
7903
|
-
var
|
|
7957
|
+
var Ia = class t extends e {
|
|
7904
7958
|
static _instance;
|
|
7905
7959
|
static get instance() {
|
|
7906
7960
|
return this._instance ||= new t(), this._instance;
|
|
@@ -7930,7 +7984,7 @@ var Fa = class t extends e {
|
|
|
7930
7984
|
togglePause() {
|
|
7931
7985
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
7932
7986
|
}
|
|
7933
|
-
},
|
|
7987
|
+
}, La = class t extends e {
|
|
7934
7988
|
static PADDING = .1;
|
|
7935
7989
|
_source = null;
|
|
7936
7990
|
_audio = null;
|
|
@@ -8057,7 +8111,7 @@ var Fa = class t extends e {
|
|
|
8057
8111
|
let e = this._source;
|
|
8058
8112
|
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);
|
|
8059
8113
|
}
|
|
8060
|
-
},
|
|
8114
|
+
}, Ra = class {
|
|
8061
8115
|
parent;
|
|
8062
8116
|
source = new globalThis.Audio();
|
|
8063
8117
|
_src = "";
|
|
@@ -8074,7 +8128,7 @@ var Fa = class t extends e {
|
|
|
8074
8128
|
return !!this.source && this.source.readyState === 4;
|
|
8075
8129
|
}
|
|
8076
8130
|
get context() {
|
|
8077
|
-
return
|
|
8131
|
+
return Ia.instance;
|
|
8078
8132
|
}
|
|
8079
8133
|
constructor(e) {
|
|
8080
8134
|
this.parent = e;
|
|
@@ -8085,9 +8139,9 @@ var Fa = class t extends e {
|
|
|
8085
8139
|
});
|
|
8086
8140
|
}
|
|
8087
8141
|
createSound() {
|
|
8088
|
-
return new
|
|
8142
|
+
return new La();
|
|
8089
8143
|
}
|
|
8090
|
-
},
|
|
8144
|
+
}, za = class extends e {
|
|
8091
8145
|
_input;
|
|
8092
8146
|
_output;
|
|
8093
8147
|
_processers = [];
|
|
@@ -8109,7 +8163,7 @@ var Fa = class t extends e {
|
|
|
8109
8163
|
get destination() {
|
|
8110
8164
|
return this._input;
|
|
8111
8165
|
}
|
|
8112
|
-
},
|
|
8166
|
+
}, Ba = class {
|
|
8113
8167
|
destination;
|
|
8114
8168
|
source;
|
|
8115
8169
|
constructor(e, t = null) {
|
|
@@ -8124,21 +8178,21 @@ var Fa = class t extends e {
|
|
|
8124
8178
|
};
|
|
8125
8179
|
//#endregion
|
|
8126
8180
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8127
|
-
function
|
|
8181
|
+
function Va() {
|
|
8128
8182
|
if (ze) return new AudioContext();
|
|
8129
8183
|
if (Be) {
|
|
8130
8184
|
let e = globalThis.webkitAudioContext;
|
|
8131
8185
|
return new e();
|
|
8132
8186
|
} else throw Error("Failed to createAudioContext");
|
|
8133
8187
|
}
|
|
8134
|
-
function
|
|
8188
|
+
function Ha(e, t, n) {
|
|
8135
8189
|
if (Ve) return new OfflineAudioContext(e, t, n);
|
|
8136
8190
|
if (He) {
|
|
8137
8191
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8138
8192
|
return new r(e, t, n);
|
|
8139
8193
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8140
8194
|
}
|
|
8141
|
-
var
|
|
8195
|
+
var Ua = class e extends za {
|
|
8142
8196
|
static _instance;
|
|
8143
8197
|
static get instance() {
|
|
8144
8198
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8179,7 +8233,7 @@ var Ha = class e extends Ra {
|
|
|
8179
8233
|
_compressor;
|
|
8180
8234
|
_analyser;
|
|
8181
8235
|
constructor() {
|
|
8182
|
-
let e =
|
|
8236
|
+
let e = Va(), t = Ha(1, 2, Ve ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8183
8237
|
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));
|
|
8184
8238
|
}
|
|
8185
8239
|
_onFocus() {
|
|
@@ -8220,7 +8274,7 @@ var Ha = class e extends Ra {
|
|
|
8220
8274
|
setParamValue(e, t) {
|
|
8221
8275
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8222
8276
|
}
|
|
8223
|
-
},
|
|
8277
|
+
}, Wa = class extends e {
|
|
8224
8278
|
_audio = null;
|
|
8225
8279
|
_sourceNode = null;
|
|
8226
8280
|
_gain = null;
|
|
@@ -8353,7 +8407,7 @@ var Ha = class e extends Ra {
|
|
|
8353
8407
|
destroy() {
|
|
8354
8408
|
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;
|
|
8355
8409
|
}
|
|
8356
|
-
},
|
|
8410
|
+
}, Ga = class extends za {
|
|
8357
8411
|
parent;
|
|
8358
8412
|
_sourceBuffer;
|
|
8359
8413
|
_sourceNode;
|
|
@@ -8361,7 +8415,7 @@ var Ha = class e extends Ra {
|
|
|
8361
8415
|
gain;
|
|
8362
8416
|
analyser;
|
|
8363
8417
|
get context() {
|
|
8364
|
-
return
|
|
8418
|
+
return Ua.instance;
|
|
8365
8419
|
}
|
|
8366
8420
|
get isPlayable() {
|
|
8367
8421
|
return !!this._sourceNode.buffer;
|
|
@@ -8376,8 +8430,8 @@ var Ha = class e extends Ra {
|
|
|
8376
8430
|
this._sourceNode.buffer = e;
|
|
8377
8431
|
}
|
|
8378
8432
|
constructor(e) {
|
|
8379
|
-
let t =
|
|
8380
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8433
|
+
let t = Ua.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8434
|
+
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;
|
|
8381
8435
|
}
|
|
8382
8436
|
async load() {
|
|
8383
8437
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -8390,7 +8444,7 @@ var Ha = class e extends Ra {
|
|
|
8390
8444
|
});
|
|
8391
8445
|
}
|
|
8392
8446
|
_decode(e) {
|
|
8393
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8447
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : Ua.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
8394
8448
|
}
|
|
8395
8449
|
cloneSource() {
|
|
8396
8450
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -8400,15 +8454,15 @@ var Ha = class e extends Ra {
|
|
|
8400
8454
|
};
|
|
8401
8455
|
}
|
|
8402
8456
|
createSound() {
|
|
8403
|
-
return new
|
|
8457
|
+
return new Wa();
|
|
8404
8458
|
}
|
|
8405
|
-
},
|
|
8459
|
+
}, Ka, qa = class extends B {
|
|
8406
8460
|
static {
|
|
8407
|
-
|
|
8461
|
+
Ka = this;
|
|
8408
8462
|
}
|
|
8409
8463
|
static _soundPool = [];
|
|
8410
8464
|
_sounds = [];
|
|
8411
|
-
_platformAudio = Ue ? new
|
|
8465
|
+
_platformAudio = Ue ? new Ga(this) : new Ra(this);
|
|
8412
8466
|
get platformAudio() {
|
|
8413
8467
|
return this._platformAudio;
|
|
8414
8468
|
}
|
|
@@ -8501,7 +8555,7 @@ var Ha = class e extends Ra {
|
|
|
8501
8555
|
this._sounds.length = 0;
|
|
8502
8556
|
}
|
|
8503
8557
|
_createSound() {
|
|
8504
|
-
return
|
|
8558
|
+
return Ka._soundPool.length > 0 ? Ka._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
8505
8559
|
}
|
|
8506
8560
|
refresh() {
|
|
8507
8561
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -8517,7 +8571,7 @@ var Ha = class e extends Ra {
|
|
|
8517
8571
|
this._recycleSound(e);
|
|
8518
8572
|
};
|
|
8519
8573
|
_recycleSound(e) {
|
|
8520
|
-
e.destroy(),
|
|
8574
|
+
e.destroy(), Ka._soundPool.includes(e) || Ka._soundPool.push(e);
|
|
8521
8575
|
}
|
|
8522
8576
|
_prevTime = 0;
|
|
8523
8577
|
_timer = 0;
|
|
@@ -8533,10 +8587,10 @@ var Ha = class e extends Ra {
|
|
|
8533
8587
|
}, 100);
|
|
8534
8588
|
}
|
|
8535
8589
|
};
|
|
8536
|
-
|
|
8590
|
+
qa = Ka = O([x("Audio"), D("design:paramtypes", [Object])], qa);
|
|
8537
8591
|
//#endregion
|
|
8538
8592
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
8539
|
-
var
|
|
8593
|
+
var Ja = class extends Pr {}, Ya, Xa = class extends ba {
|
|
8540
8594
|
_audioBuffer;
|
|
8541
8595
|
_src = (() => {
|
|
8542
8596
|
let e = tt();
|
|
@@ -8560,7 +8614,7 @@ var qa = class extends Pr {}, Ja, Ya = class extends ya {
|
|
|
8560
8614
|
}
|
|
8561
8615
|
}
|
|
8562
8616
|
async _loadSrc(e) {
|
|
8563
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
8617
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ua.decode(e)).then((e) => {
|
|
8564
8618
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
8565
8619
|
});
|
|
8566
8620
|
}
|
|
@@ -8595,12 +8649,12 @@ var qa = class extends Pr {}, Ja, Ya = class extends ya {
|
|
|
8595
8649
|
this.syncTexture(), super._process(e);
|
|
8596
8650
|
}
|
|
8597
8651
|
};
|
|
8598
|
-
O([_(), D("design:type", Object)],
|
|
8652
|
+
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);
|
|
8599
8653
|
//#endregion
|
|
8600
8654
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
8601
|
-
var
|
|
8655
|
+
var Za, Qa = class extends Mr {
|
|
8602
8656
|
static {
|
|
8603
|
-
|
|
8657
|
+
Za = this;
|
|
8604
8658
|
}
|
|
8605
8659
|
blur = 10;
|
|
8606
8660
|
quality = 10;
|
|
@@ -8619,7 +8673,7 @@ var Xa, Za = class extends Mr {
|
|
|
8619
8673
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
8620
8674
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
8621
8675
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
8622
|
-
I.draw(e,
|
|
8676
|
+
I.draw(e, Za.material, {
|
|
8623
8677
|
sampler: r,
|
|
8624
8678
|
progress: i,
|
|
8625
8679
|
...t
|
|
@@ -8627,31 +8681,31 @@ var Xa, Za = class extends Mr {
|
|
|
8627
8681
|
});
|
|
8628
8682
|
}
|
|
8629
8683
|
};
|
|
8630
|
-
|
|
8684
|
+
Qa = Za = O([x("KawaseTransition")], Qa);
|
|
8631
8685
|
//#endregion
|
|
8632
8686
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
8633
|
-
var
|
|
8687
|
+
var $a, eo = class extends Mr {
|
|
8634
8688
|
static {
|
|
8635
|
-
|
|
8689
|
+
$a = this;
|
|
8636
8690
|
}
|
|
8637
8691
|
static material = new F({ gl: {
|
|
8638
8692
|
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}",
|
|
8639
8693
|
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}"
|
|
8640
8694
|
} });
|
|
8641
8695
|
apply(e) {
|
|
8642
|
-
I.draw(e,
|
|
8696
|
+
I.draw(e, $a.material, {
|
|
8643
8697
|
previous: 0,
|
|
8644
8698
|
next: 1,
|
|
8645
8699
|
progress: this.currentTimeProgress
|
|
8646
8700
|
});
|
|
8647
8701
|
}
|
|
8648
8702
|
};
|
|
8649
|
-
|
|
8703
|
+
eo = $a = O([x("LeftEraseTransition")], eo);
|
|
8650
8704
|
//#endregion
|
|
8651
8705
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
8652
|
-
var
|
|
8706
|
+
var to, no = class extends Mr {
|
|
8653
8707
|
static {
|
|
8654
|
-
|
|
8708
|
+
to = this;
|
|
8655
8709
|
}
|
|
8656
8710
|
blur = 100;
|
|
8657
8711
|
gradientBlur = 600;
|
|
@@ -8663,7 +8717,7 @@ var eo, to = class extends Mr {
|
|
|
8663
8717
|
let n = this.currentTimeProgress, r, i;
|
|
8664
8718
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8665
8719
|
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);
|
|
8666
|
-
I.draw(e,
|
|
8720
|
+
I.draw(e, to.material, {
|
|
8667
8721
|
sampler: r,
|
|
8668
8722
|
progress: i,
|
|
8669
8723
|
blur: this.blur,
|
|
@@ -8672,7 +8726,7 @@ var eo, to = class extends Mr {
|
|
|
8672
8726
|
end: c,
|
|
8673
8727
|
delta: [u / f, d / f],
|
|
8674
8728
|
texSize: l
|
|
8675
|
-
}), I.draw(e,
|
|
8729
|
+
}), I.draw(e, to.material, {
|
|
8676
8730
|
sampler: r,
|
|
8677
8731
|
progress: i,
|
|
8678
8732
|
blur: this.blur,
|
|
@@ -8684,12 +8738,12 @@ var eo, to = class extends Mr {
|
|
|
8684
8738
|
});
|
|
8685
8739
|
}
|
|
8686
8740
|
};
|
|
8687
|
-
|
|
8741
|
+
no = to = O([x("TiltShiftTransition")], no);
|
|
8688
8742
|
//#endregion
|
|
8689
8743
|
//#region src/scene/transitions/TwistTransition.ts
|
|
8690
|
-
var
|
|
8744
|
+
var ro, io = class extends Mr {
|
|
8691
8745
|
static {
|
|
8692
|
-
|
|
8746
|
+
ro = this;
|
|
8693
8747
|
}
|
|
8694
8748
|
radius;
|
|
8695
8749
|
angle = 4;
|
|
@@ -8703,7 +8757,7 @@ var no, ro = class extends Mr {
|
|
|
8703
8757
|
let n = this.currentTimeProgress, r, i;
|
|
8704
8758
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8705
8759
|
let a = t.width, o = t.height;
|
|
8706
|
-
I.draw(e,
|
|
8760
|
+
I.draw(e, ro.material, {
|
|
8707
8761
|
sampler: r,
|
|
8708
8762
|
progress: i,
|
|
8709
8763
|
filterArea: [
|
|
@@ -8719,10 +8773,10 @@ var no, ro = class extends Mr {
|
|
|
8719
8773
|
});
|
|
8720
8774
|
}
|
|
8721
8775
|
};
|
|
8722
|
-
|
|
8776
|
+
io = ro = O([x("TwistTransition")], io);
|
|
8723
8777
|
//#endregion
|
|
8724
8778
|
//#region src/asset/loaders/GifLoader.ts
|
|
8725
|
-
var
|
|
8779
|
+
var ao = class extends Rn {
|
|
8726
8780
|
install(e) {
|
|
8727
8781
|
let t = async (t) => {
|
|
8728
8782
|
let { decodeFrames: n } = await import("modern-gif");
|
|
@@ -8739,14 +8793,14 @@ var io = class extends Rn {
|
|
|
8739
8793
|
e.register(n, t);
|
|
8740
8794
|
}), e.gif = this, this;
|
|
8741
8795
|
}
|
|
8742
|
-
},
|
|
8796
|
+
}, oo = class extends Rn {
|
|
8743
8797
|
install(e) {
|
|
8744
8798
|
let t = async (e) => JSON.parse(await e.text());
|
|
8745
8799
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
8746
8800
|
e.register(n, t);
|
|
8747
8801
|
}), e.json = this, this;
|
|
8748
8802
|
}
|
|
8749
|
-
},
|
|
8803
|
+
}, so = class extends Rn {
|
|
8750
8804
|
install(e) {
|
|
8751
8805
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
8752
8806
|
container: null,
|
|
@@ -8757,12 +8811,12 @@ var io = class extends Rn {
|
|
|
8757
8811
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
8758
8812
|
}), e.lottie = this, this;
|
|
8759
8813
|
}
|
|
8760
|
-
},
|
|
8814
|
+
}, co = class extends Rn {
|
|
8761
8815
|
install(e) {
|
|
8762
8816
|
let t = async (e) => e.text();
|
|
8763
8817
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
8764
8818
|
}
|
|
8765
|
-
},
|
|
8819
|
+
}, lo = class extends Rn {
|
|
8766
8820
|
install(e) {
|
|
8767
8821
|
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new R({
|
|
8768
8822
|
source: e,
|
|
@@ -8786,11 +8840,11 @@ var io = class extends Rn {
|
|
|
8786
8840
|
e.register(n, t);
|
|
8787
8841
|
}), e.texture = this, this;
|
|
8788
8842
|
}
|
|
8789
|
-
},
|
|
8843
|
+
}, uo = class extends Rn {
|
|
8790
8844
|
install(e) {
|
|
8791
8845
|
return this.load = (t) => e.awaitBy(() => new cr(t).load()), e.video = this, this;
|
|
8792
8846
|
}
|
|
8793
|
-
},
|
|
8847
|
+
}, fo = Object.entries({
|
|
8794
8848
|
"font/woff": ["woff"],
|
|
8795
8849
|
"font/ttf": ["ttf"],
|
|
8796
8850
|
"font/otf": ["otf"],
|
|
@@ -8806,31 +8860,31 @@ var io = class extends Rn {
|
|
|
8806
8860
|
"image/webp": ["webp"],
|
|
8807
8861
|
"application/json": ["json"]
|
|
8808
8862
|
});
|
|
8809
|
-
function fo(e) {
|
|
8810
|
-
for (let [t, n] of uo) if (n.includes(e)) return t;
|
|
8811
|
-
}
|
|
8812
8863
|
function po(e) {
|
|
8864
|
+
for (let [t, n] of fo) if (n.includes(e)) return t;
|
|
8865
|
+
}
|
|
8866
|
+
function mo(e) {
|
|
8813
8867
|
let t;
|
|
8814
8868
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
8815
8869
|
else if (e.startsWith("http")) {
|
|
8816
8870
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
8817
|
-
n && (t =
|
|
8871
|
+
n && (t = po(n));
|
|
8818
8872
|
}
|
|
8819
8873
|
return t;
|
|
8820
8874
|
}
|
|
8821
8875
|
//#endregion
|
|
8822
8876
|
//#region src/asset/Assets.ts
|
|
8823
|
-
var
|
|
8877
|
+
var ho = "WeakRef" in globalThis, go = class extends e {
|
|
8824
8878
|
defaultHandler = (e) => e;
|
|
8825
8879
|
_handlers = /* @__PURE__ */ new Map();
|
|
8826
8880
|
_handleing = /* @__PURE__ */ new Map();
|
|
8827
8881
|
_handled = /* @__PURE__ */ new Map();
|
|
8828
|
-
_gc =
|
|
8882
|
+
_gc = ho ? new FinalizationRegistry((e) => {
|
|
8829
8883
|
let t = this.get(e);
|
|
8830
8884
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
8831
8885
|
}) : void 0;
|
|
8832
8886
|
constructor() {
|
|
8833
|
-
super(),
|
|
8887
|
+
super(), ho || S.on(this.gc.bind(this), { sort: 2 });
|
|
8834
8888
|
}
|
|
8835
8889
|
use(e) {
|
|
8836
8890
|
return e.install(this), this;
|
|
@@ -8879,11 +8933,11 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
|
|
|
8879
8933
|
}
|
|
8880
8934
|
get(e) {
|
|
8881
8935
|
let t = this._handled.get(e);
|
|
8882
|
-
return
|
|
8936
|
+
return ho && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
8883
8937
|
}
|
|
8884
8938
|
set(e, t) {
|
|
8885
8939
|
let n = t;
|
|
8886
|
-
|
|
8940
|
+
ho && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
8887
8941
|
}
|
|
8888
8942
|
async awaitBy(e) {
|
|
8889
8943
|
let t = e(), n = c();
|
|
@@ -8898,7 +8952,7 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
|
|
|
8898
8952
|
return this._handleing.set(e, r), r;
|
|
8899
8953
|
}
|
|
8900
8954
|
async load(e, t) {
|
|
8901
|
-
let n = await this.loadBy(e), r =
|
|
8955
|
+
let n = await this.loadBy(e), r = mo(e);
|
|
8902
8956
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
8903
8957
|
}
|
|
8904
8958
|
async waitUntilLoad() {
|
|
@@ -8912,14 +8966,14 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
|
|
|
8912
8966
|
n && "destroy" in n && n.destroy();
|
|
8913
8967
|
}), this._handled.clear();
|
|
8914
8968
|
}
|
|
8915
|
-
}, $ = new
|
|
8969
|
+
}, $ = new go().use(new zn()).use(new ao()).use(new oo()).use(new so()).use(new co()).use(new lo()).use(new uo()), _o = {
|
|
8916
8970
|
alpha: !0,
|
|
8917
8971
|
stencil: !0,
|
|
8918
8972
|
antialias: !1,
|
|
8919
8973
|
premultipliedAlpha: !0,
|
|
8920
8974
|
preserveDrawingBuffer: !1,
|
|
8921
8975
|
powerPreference: "default"
|
|
8922
|
-
},
|
|
8976
|
+
}, vo = class extends Ar {
|
|
8923
8977
|
renderer;
|
|
8924
8978
|
get view() {
|
|
8925
8979
|
return this.renderer.view;
|
|
@@ -8952,12 +9006,12 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
|
|
|
8952
9006
|
constructor(e = {}) {
|
|
8953
9007
|
let { view: t, width: n, height: r, pixelRatio: i = Ke, autoResize: a, data: o } = e;
|
|
8954
9008
|
super(), this.renderer = new Ln(t, {
|
|
8955
|
-
alpha:
|
|
8956
|
-
stencil:
|
|
8957
|
-
antialias:
|
|
8958
|
-
premultipliedAlpha:
|
|
8959
|
-
preserveDrawingBuffer:
|
|
8960
|
-
powerPreference:
|
|
9009
|
+
alpha: _o.alpha ?? e.alpha,
|
|
9010
|
+
stencil: _o.stencil ?? e.stencil,
|
|
9011
|
+
antialias: _o.antialias ?? e.antialias,
|
|
9012
|
+
premultipliedAlpha: _o.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
9013
|
+
preserveDrawingBuffer: _o.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
9014
|
+
powerPreference: _o.powerPreference ?? e.powerPreference
|
|
8961
9015
|
}), 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);
|
|
8962
9016
|
}
|
|
8963
9017
|
_updateProperty(e, t, n) {
|
|
@@ -9040,22 +9094,22 @@ var mo = "WeakRef" in globalThis, ho = class extends e {
|
|
|
9040
9094
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9041
9095
|
}
|
|
9042
9096
|
};
|
|
9043
|
-
O([_({ fallback: !1 }), D("design:type", Boolean)],
|
|
9097
|
+
O([_({ fallback: !1 }), D("design:type", Boolean)], vo.prototype, "autoResize", void 0), O([_({ fallback: !1 }), D("design:type", Boolean)], vo.prototype, "autoStart", void 0);
|
|
9044
9098
|
//#endregion
|
|
9045
9099
|
//#region src/render.ts
|
|
9046
|
-
var
|
|
9047
|
-
function
|
|
9048
|
-
return
|
|
9100
|
+
var yo, bo = [], xo = !1;
|
|
9101
|
+
function So() {
|
|
9102
|
+
return yo ??= new vo({
|
|
9049
9103
|
pixelRatio: 1,
|
|
9050
9104
|
width: 1,
|
|
9051
9105
|
height: 1,
|
|
9052
9106
|
preserveDrawingBuffer: !0
|
|
9053
9107
|
});
|
|
9054
9108
|
}
|
|
9055
|
-
async function
|
|
9056
|
-
if (!
|
|
9057
|
-
for (
|
|
9058
|
-
let t =
|
|
9109
|
+
async function Co(e = 100) {
|
|
9110
|
+
if (!xo) {
|
|
9111
|
+
for (xo = !0; bo.length;) {
|
|
9112
|
+
let t = bo.shift();
|
|
9059
9113
|
if (t) try {
|
|
9060
9114
|
await t();
|
|
9061
9115
|
} catch (e) {
|
|
@@ -9063,11 +9117,11 @@ async function So(e = 100) {
|
|
|
9063
9117
|
}
|
|
9064
9118
|
else await new Promise((t) => setTimeout(t, e));
|
|
9065
9119
|
}
|
|
9066
|
-
|
|
9120
|
+
xo = !1;
|
|
9067
9121
|
}
|
|
9068
9122
|
}
|
|
9069
|
-
async function
|
|
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 =
|
|
9123
|
+
async function wo(e) {
|
|
9124
|
+
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();
|
|
9071
9125
|
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) {
|
|
9072
9126
|
let e = o.length, t = o[e - 1];
|
|
9073
9127
|
for (let n = 0; n < e; n++) {
|
|
@@ -9085,15 +9139,15 @@ async function Co(e) {
|
|
|
9085
9139
|
toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
|
|
9086
9140
|
};
|
|
9087
9141
|
}
|
|
9088
|
-
async function
|
|
9142
|
+
async function To(e) {
|
|
9089
9143
|
return new Promise((t) => {
|
|
9090
|
-
|
|
9144
|
+
bo.push(async () => t(await wo(e).then((e) => e.toCanvas2D()))), Co();
|
|
9091
9145
|
});
|
|
9092
9146
|
}
|
|
9093
|
-
async function
|
|
9147
|
+
async function Eo(e) {
|
|
9094
9148
|
return new Promise((t) => {
|
|
9095
|
-
|
|
9149
|
+
bo.push(async () => t(await wo(e).then((e) => e.pixels))), Co();
|
|
9096
9150
|
});
|
|
9097
9151
|
}
|
|
9098
9152
|
//#endregion
|
|
9099
|
-
export { mt as Aabb2D, nr as AnimatedTexture,
|
|
9153
|
+
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, Xr as ColorFilterEffect, vt as ColorMatrix, ei as ColorOverlayEffect, ri as ColorRemoveEffect, si as ColorReplaceEffect, ir as ColorTexture, C as CoreObject, ht as DEG_TO_RAD, Ke as DEVICE_PIXEL_RATIO, W as DrawboardEffect, _i as DropShadowEffect, H as Effect, $n as EffectMaterial, ba as Element2D, Ui as Element2DBackground, Y as Element2DChart, qi as Element2DConnection, J as Element2DFill, Yi as Element2DForeground, Xi as Element2DOutline, Zi as Element2DShadow, Qi as Element2DShape, $i as Element2DStyle, ra as Element2DTable, X as Element2DText, bi as EmbossEffect, vo as Engine, ma as Flexbox, zn as FontLoader, mi 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, ki as KawaseBlurEffect, Qa as KawaseTransition, st as KeyboardInputEvent, eo as LeftEraseTransition, Rn as Loader, Ca as Lottie2D, so as LottieLoader, xt as MainLoop, Mi 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, Ri 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, Vi as ZoomBlurEffect, Q as alignMap, $ as assets, Lr as axisDir, pa as boxSizingMap, _t as clamp, Oi 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, sa as directionMap, oa as displayMap, ka as ease, Aa as easeIn, Ma as easeInOut, ja as easeOut, Z as edgeMap, ca as flexDirectionMap, la as flexWrapMap, Di as frag, et as getCanvasFactory, Te as getDefaultCssPropertyValue, So as getRenderEngine, aa as gutterMap, at as instanceId, Xe as isCanvasElement, qe as isElementNode, Ye as isImageElement, xe as isPow2, Je as isVideoElement, Ze as isWebgl2, ua as justifyMap, E as lerp, Oa as linear, cn as log2, nn as mapGlBlendModes, sn as nextPow2, ve as nextTick, da as overflowMap, Wr as parseCssFilter, De as parseCssFunctions, Ee as parseCssProperty, Gr as parseCssTransformOrigin, fa as positionTypeMap, To as render, Eo as renderPixels, xr as resetBatchPool, Rr as routeConnection, $e as setCanvasFactory, dn as stencilModeMap, Pa as timingFunctions };
|