modern-canvas 0.4.22 → 0.4.23

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.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  const colord = require('colord');
4
4
  const namesPlugin = require('colord/plugins/names');
5
- const modernIdoc = require('modern-idoc');
6
5
  const modernPath2d = require('modern-path2d');
7
- const load = require('yoga-layout/load');
6
+ const modernIdoc = require('modern-idoc');
8
7
  const modernText = require('modern-text');
8
+ const load = require('yoga-layout/load');
9
9
 
10
10
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
11
11
 
@@ -2155,13 +2155,13 @@ class Vector3 extends Vector {
2155
2155
  }
2156
2156
  }
2157
2157
 
2158
- var __defProp$L = Object.defineProperty;
2159
- var __decorateClass$T = (decorators, target, key, kind) => {
2158
+ var __defProp$O = Object.defineProperty;
2159
+ var __decorateClass$W = (decorators, target, key, kind) => {
2160
2160
  var result = void 0 ;
2161
2161
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2162
2162
  if (decorator = decorators[i])
2163
2163
  result = (decorator(target, key, result) ) || result;
2164
- if (result) __defProp$L(target, key, result);
2164
+ if (result) __defProp$O(target, key, result);
2165
2165
  return result;
2166
2166
  };
2167
2167
  class MainLoop extends CoreObject {
@@ -2204,10 +2204,10 @@ class MainLoop extends CoreObject {
2204
2204
  this.stop();
2205
2205
  }
2206
2206
  }
2207
- __decorateClass$T([
2207
+ __decorateClass$W([
2208
2208
  property({ default: 24 })
2209
2209
  ], MainLoop.prototype, "fps");
2210
- __decorateClass$T([
2210
+ __decorateClass$W([
2211
2211
  property({ default: 1 })
2212
2212
  ], MainLoop.prototype, "speed");
2213
2213
 
@@ -4509,13 +4509,13 @@ class Geometry extends Resource {
4509
4509
  }
4510
4510
  }
4511
4511
 
4512
- var __defProp$K = Object.defineProperty;
4513
- var __decorateClass$S = (decorators, target, key, kind) => {
4512
+ var __defProp$N = Object.defineProperty;
4513
+ var __decorateClass$V = (decorators, target, key, kind) => {
4514
4514
  var result = void 0 ;
4515
4515
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4516
4516
  if (decorator = decorators[i])
4517
4517
  result = (decorator(target, key, result) ) || result;
4518
- if (result) __defProp$K(target, key, result);
4518
+ if (result) __defProp$N(target, key, result);
4519
4519
  return result;
4520
4520
  };
4521
4521
  class IndexBuffer extends Resource {
@@ -4559,20 +4559,20 @@ class IndexBuffer extends Resource {
4559
4559
  return result;
4560
4560
  }
4561
4561
  }
4562
- __decorateClass$S([
4562
+ __decorateClass$V([
4563
4563
  protectedProperty({ default: null })
4564
4564
  ], IndexBuffer.prototype, "data");
4565
- __decorateClass$S([
4565
+ __decorateClass$V([
4566
4566
  protectedProperty({ default: false })
4567
4567
  ], IndexBuffer.prototype, "dynamic");
4568
4568
 
4569
- var __defProp$J = Object.defineProperty;
4570
- var __decorateClass$R = (decorators, target, key, kind) => {
4569
+ var __defProp$M = Object.defineProperty;
4570
+ var __decorateClass$U = (decorators, target, key, kind) => {
4571
4571
  var result = void 0 ;
4572
4572
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4573
4573
  if (decorator = decorators[i])
4574
4574
  result = (decorator(target, key, result) ) || result;
4575
- if (result) __defProp$J(target, key, result);
4575
+ if (result) __defProp$M(target, key, result);
4576
4576
  return result;
4577
4577
  };
4578
4578
  class VertexBuffer extends Resource {
@@ -4616,20 +4616,20 @@ class VertexBuffer extends Resource {
4616
4616
  return result;
4617
4617
  }
4618
4618
  }
4619
- __decorateClass$R([
4619
+ __decorateClass$U([
4620
4620
  protectedProperty({ default: null })
4621
4621
  ], VertexBuffer.prototype, "data");
4622
- __decorateClass$R([
4622
+ __decorateClass$U([
4623
4623
  protectedProperty({ default: false })
4624
4624
  ], VertexBuffer.prototype, "dynamic");
4625
4625
 
4626
- var __defProp$I = Object.defineProperty;
4627
- var __decorateClass$Q = (decorators, target, key, kind) => {
4626
+ var __defProp$L = Object.defineProperty;
4627
+ var __decorateClass$T = (decorators, target, key, kind) => {
4628
4628
  var result = void 0 ;
4629
4629
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4630
4630
  if (decorator = decorators[i])
4631
4631
  result = (decorator(target, key, result) ) || result;
4632
- if (result) __defProp$I(target, key, result);
4632
+ if (result) __defProp$L(target, key, result);
4633
4633
  return result;
4634
4634
  };
4635
4635
  class VertexAttribute extends Resource {
@@ -4666,25 +4666,25 @@ class VertexAttribute extends Resource {
4666
4666
  return result;
4667
4667
  }
4668
4668
  }
4669
- __decorateClass$Q([
4669
+ __decorateClass$T([
4670
4670
  protectedProperty()
4671
4671
  ], VertexAttribute.prototype, "buffer");
4672
- __decorateClass$Q([
4672
+ __decorateClass$T([
4673
4673
  protectedProperty({ default: 0 })
4674
4674
  ], VertexAttribute.prototype, "size");
4675
- __decorateClass$Q([
4675
+ __decorateClass$T([
4676
4676
  protectedProperty({ default: false })
4677
4677
  ], VertexAttribute.prototype, "normalized");
4678
- __decorateClass$Q([
4678
+ __decorateClass$T([
4679
4679
  protectedProperty({ default: "float" })
4680
4680
  ], VertexAttribute.prototype, "type");
4681
- __decorateClass$Q([
4681
+ __decorateClass$T([
4682
4682
  protectedProperty()
4683
4683
  ], VertexAttribute.prototype, "stride");
4684
- __decorateClass$Q([
4684
+ __decorateClass$T([
4685
4685
  protectedProperty()
4686
4686
  ], VertexAttribute.prototype, "offset");
4687
- __decorateClass$Q([
4687
+ __decorateClass$T([
4688
4688
  protectedProperty()
4689
4689
  ], VertexAttribute.prototype, "divisor");
4690
4690
 
@@ -4928,13 +4928,13 @@ class UvGeometry extends Geometry {
4928
4928
  }
4929
4929
  }
4930
4930
 
4931
- var __defProp$H = Object.defineProperty;
4932
- var __decorateClass$P = (decorators, target, key, kind) => {
4931
+ var __defProp$K = Object.defineProperty;
4932
+ var __decorateClass$S = (decorators, target, key, kind) => {
4933
4933
  var result = void 0 ;
4934
4934
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4935
4935
  if (decorator = decorators[i])
4936
4936
  result = (decorator(target, key, result) ) || result;
4937
- if (result) __defProp$H(target, key, result);
4937
+ if (result) __defProp$K(target, key, result);
4938
4938
  return result;
4939
4939
  };
4940
4940
  class Texture2D extends Resource {
@@ -5060,22 +5060,22 @@ class Texture2D extends Resource {
5060
5060
  }
5061
5061
  }
5062
5062
  }
5063
- __decorateClass$P([
5063
+ __decorateClass$S([
5064
5064
  protectedProperty()
5065
5065
  ], Texture2D.prototype, "source");
5066
- __decorateClass$P([
5066
+ __decorateClass$S([
5067
5067
  property({ default: 0 })
5068
5068
  ], Texture2D.prototype, "width");
5069
- __decorateClass$P([
5069
+ __decorateClass$S([
5070
5070
  property({ default: 0 })
5071
5071
  ], Texture2D.prototype, "height");
5072
- __decorateClass$P([
5072
+ __decorateClass$S([
5073
5073
  property({ default: "linear" })
5074
5074
  ], Texture2D.prototype, "filterMode");
5075
- __decorateClass$P([
5075
+ __decorateClass$S([
5076
5076
  property({ default: "clamp_to_edge" })
5077
5077
  ], Texture2D.prototype, "wrapMode");
5078
- __decorateClass$P([
5078
+ __decorateClass$S([
5079
5079
  property({ default: 1 })
5080
5080
  ], Texture2D.prototype, "pixelRatio");
5081
5081
 
@@ -5105,13 +5105,13 @@ class AnimatedTexture extends Resource {
5105
5105
  }
5106
5106
  }
5107
5107
 
5108
- var __defProp$G = Object.defineProperty;
5109
- var __decorateClass$O = (decorators, target, key, kind) => {
5108
+ var __defProp$J = Object.defineProperty;
5109
+ var __decorateClass$R = (decorators, target, key, kind) => {
5110
5110
  var result = void 0 ;
5111
5111
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5112
5112
  if (decorator = decorators[i])
5113
5113
  result = (decorator(target, key, result) ) || result;
5114
- if (result) __defProp$G(target, key, result);
5114
+ if (result) __defProp$J(target, key, result);
5115
5115
  return result;
5116
5116
  };
5117
5117
  class CanvasTexture extends Texture2D {
@@ -5130,7 +5130,7 @@ class CanvasTexture extends Texture2D {
5130
5130
  super._updateProperty(key, value, oldValue, declaration);
5131
5131
  }
5132
5132
  }
5133
- __decorateClass$O([
5133
+ __decorateClass$R([
5134
5134
  property({ default: 2 })
5135
5135
  ], CanvasTexture.prototype, "pixelRatio");
5136
5136
 
@@ -5292,13 +5292,13 @@ class PixelsTexture extends Texture2D {
5292
5292
  }
5293
5293
  }
5294
5294
 
5295
- var __defProp$F = Object.defineProperty;
5296
- var __decorateClass$N = (decorators, target, key, kind) => {
5295
+ var __defProp$I = Object.defineProperty;
5296
+ var __decorateClass$Q = (decorators, target, key, kind) => {
5297
5297
  var result = void 0 ;
5298
5298
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5299
5299
  if (decorator = decorators[i])
5300
5300
  result = (decorator(target, key, result) ) || result;
5301
- if (result) __defProp$F(target, key, result);
5301
+ if (result) __defProp$I(target, key, result);
5302
5302
  return result;
5303
5303
  };
5304
5304
  function resolveOptions(options) {
@@ -5542,10 +5542,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5542
5542
  }
5543
5543
  }
5544
5544
  };
5545
- __decorateClass$N([
5545
+ __decorateClass$Q([
5546
5546
  protectedProperty({ default: true })
5547
5547
  ], _VideoTexture.prototype, "autoUpdate");
5548
- __decorateClass$N([
5548
+ __decorateClass$Q([
5549
5549
  protectedProperty({ default: 0 })
5550
5550
  ], _VideoTexture.prototype, "fps");
5551
5551
  let VideoTexture = _VideoTexture;
@@ -5554,14 +5554,14 @@ class ViewportTexture extends PixelsTexture {
5554
5554
  //
5555
5555
  }
5556
5556
 
5557
- var __defProp$E = Object.defineProperty;
5557
+ var __defProp$H = Object.defineProperty;
5558
5558
  var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
5559
- var __decorateClass$M = (decorators, target, key, kind) => {
5559
+ var __decorateClass$P = (decorators, target, key, kind) => {
5560
5560
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
5561
5561
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5562
5562
  if (decorator = decorators[i])
5563
5563
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5564
- if (kind && result) __defProp$E(target, key, result);
5564
+ if (kind && result) __defProp$H(target, key, result);
5565
5565
  return result;
5566
5566
  };
5567
5567
  const tagUidMap = {};
@@ -5738,11 +5738,9 @@ exports.Node = class Node extends CoreObject {
5738
5738
  }
5739
5739
  }
5740
5740
  _update(changed) {
5741
- this._tree?.log(this.name, "updating");
5742
5741
  super._update(changed);
5743
5742
  }
5744
5743
  _updateProperty(key, value, oldValue, declaration) {
5745
- this._tree?.log(this.name, `updating [${String(key)}]`);
5746
5744
  super._updateProperty(key, value, oldValue, declaration);
5747
5745
  }
5748
5746
  _onTreeEnter(tree) {
@@ -6066,36 +6064,36 @@ exports.Node = class Node extends CoreObject {
6066
6064
  return node;
6067
6065
  }
6068
6066
  };
6069
- __decorateClass$M([
6067
+ __decorateClass$P([
6070
6068
  protectedProperty()
6071
6069
  ], exports.Node.prototype, "name", 2);
6072
- __decorateClass$M([
6070
+ __decorateClass$P([
6073
6071
  property()
6074
6072
  ], exports.Node.prototype, "mask", 2);
6075
- __decorateClass$M([
6073
+ __decorateClass$P([
6076
6074
  property({ default: "inherit" })
6077
6075
  ], exports.Node.prototype, "processMode", 2);
6078
- __decorateClass$M([
6076
+ __decorateClass$P([
6079
6077
  property({ default: "default" })
6080
6078
  ], exports.Node.prototype, "processSortMode", 2);
6081
- __decorateClass$M([
6079
+ __decorateClass$P([
6082
6080
  property({ default: "inherit" })
6083
6081
  ], exports.Node.prototype, "renderMode", 2);
6084
- __decorateClass$M([
6082
+ __decorateClass$P([
6085
6083
  property({ default: "default" })
6086
6084
  ], exports.Node.prototype, "internalMode", 2);
6087
- exports.Node = __decorateClass$M([
6085
+ exports.Node = __decorateClass$P([
6088
6086
  customNode("Node")
6089
6087
  ], exports.Node);
6090
6088
 
6091
- var __defProp$D = Object.defineProperty;
6089
+ var __defProp$G = Object.defineProperty;
6092
6090
  var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
6093
- var __decorateClass$L = (decorators, target, key, kind) => {
6091
+ var __decorateClass$O = (decorators, target, key, kind) => {
6094
6092
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
6095
6093
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6096
6094
  if (decorator = decorators[i])
6097
6095
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6098
- if (kind && result) __defProp$D(target, key, result);
6096
+ if (kind && result) __defProp$G(target, key, result);
6099
6097
  return result;
6100
6098
  };
6101
6099
  exports.TimelineNode = class TimelineNode extends exports.Node {
@@ -6155,30 +6153,30 @@ exports.TimelineNode = class TimelineNode extends exports.Node {
6155
6153
  this._updateCurrentTime();
6156
6154
  }
6157
6155
  };
6158
- __decorateClass$L([
6156
+ __decorateClass$O([
6159
6157
  property({ default: 0 })
6160
6158
  ], exports.TimelineNode.prototype, "delay", 2);
6161
- __decorateClass$L([
6159
+ __decorateClass$O([
6162
6160
  property({ default: 0 })
6163
6161
  ], exports.TimelineNode.prototype, "duration", 2);
6164
- __decorateClass$L([
6162
+ __decorateClass$O([
6165
6163
  property({ default: false })
6166
6164
  ], exports.TimelineNode.prototype, "paused", 2);
6167
- __decorateClass$L([
6165
+ __decorateClass$O([
6168
6166
  protectedProperty()
6169
6167
  ], exports.TimelineNode.prototype, "insideTimeRange", 2);
6170
- exports.TimelineNode = __decorateClass$L([
6168
+ exports.TimelineNode = __decorateClass$O([
6171
6169
  customNode("TimelineNode")
6172
6170
  ], exports.TimelineNode);
6173
6171
 
6174
- var __defProp$C = Object.defineProperty;
6172
+ var __defProp$F = Object.defineProperty;
6175
6173
  var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
6176
- var __decorateClass$K = (decorators, target, key, kind) => {
6174
+ var __decorateClass$N = (decorators, target, key, kind) => {
6177
6175
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
6178
6176
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6179
6177
  if (decorator = decorators[i])
6180
6178
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6181
- if (kind && result) __defProp$C(target, key, result);
6179
+ if (kind && result) __defProp$F(target, key, result);
6182
6180
  return result;
6183
6181
  };
6184
6182
  exports.Viewport = class Viewport extends exports.Node {
@@ -6316,30 +6314,30 @@ exports.Viewport = class Viewport extends exports.Node {
6316
6314
  return this._projection.toArray(transpose);
6317
6315
  }
6318
6316
  };
6319
- __decorateClass$K([
6317
+ __decorateClass$N([
6320
6318
  property({ default: 0 })
6321
6319
  ], exports.Viewport.prototype, "x", 2);
6322
- __decorateClass$K([
6320
+ __decorateClass$N([
6323
6321
  property({ default: 0 })
6324
6322
  ], exports.Viewport.prototype, "y", 2);
6325
- __decorateClass$K([
6323
+ __decorateClass$N([
6326
6324
  property({ default: 0 })
6327
6325
  ], exports.Viewport.prototype, "width", 2);
6328
- __decorateClass$K([
6326
+ __decorateClass$N([
6329
6327
  property({ default: 0 })
6330
6328
  ], exports.Viewport.prototype, "height", 2);
6331
- exports.Viewport = __decorateClass$K([
6329
+ exports.Viewport = __decorateClass$N([
6332
6330
  customNode("Viewport")
6333
6331
  ], exports.Viewport);
6334
6332
 
6335
- var __defProp$B = Object.defineProperty;
6333
+ var __defProp$E = Object.defineProperty;
6336
6334
  var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
6337
- var __decorateClass$J = (decorators, target, key, kind) => {
6335
+ var __decorateClass$M = (decorators, target, key, kind) => {
6338
6336
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
6339
6337
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6340
6338
  if (decorator = decorators[i])
6341
6339
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6342
- if (kind && result) __defProp$B(target, key, result);
6340
+ if (kind && result) __defProp$E(target, key, result);
6343
6341
  return result;
6344
6342
  };
6345
6343
  exports.Effect = class Effect extends exports.TimelineNode {
@@ -6580,31 +6578,31 @@ exports.Effect = class Effect extends exports.TimelineNode {
6580
6578
  }
6581
6579
  }
6582
6580
  };
6583
- __decorateClass$J([
6581
+ __decorateClass$M([
6584
6582
  protectedProperty()
6585
6583
  ], exports.Effect.prototype, "material", 2);
6586
- __decorateClass$J([
6584
+ __decorateClass$M([
6587
6585
  property()
6588
6586
  ], exports.Effect.prototype, "effectMode", 2);
6589
- __decorateClass$J([
6587
+ __decorateClass$M([
6590
6588
  property({ default: "" })
6591
6589
  ], exports.Effect.prototype, "glsl", 2);
6592
- __decorateClass$J([
6590
+ __decorateClass$M([
6593
6591
  property({ default: "" })
6594
6592
  ], exports.Effect.prototype, "glslSrc", 2);
6595
- exports.Effect = __decorateClass$J([
6593
+ exports.Effect = __decorateClass$M([
6596
6594
  customNode("Effect")
6597
6595
  ], exports.Effect);
6598
6596
 
6599
- var __defProp$A = Object.defineProperty;
6597
+ var __defProp$D = Object.defineProperty;
6600
6598
  var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
6601
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6602
- var __decorateClass$I = (decorators, target, key, kind) => {
6599
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6600
+ var __decorateClass$L = (decorators, target, key, kind) => {
6603
6601
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
6604
6602
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6605
6603
  if (decorator = decorators[i])
6606
6604
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6607
- if (kind && result) __defProp$A(target, key, result);
6605
+ if (kind && result) __defProp$D(target, key, result);
6608
6606
  return result;
6609
6607
  };
6610
6608
  var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
@@ -6664,43 +6662,43 @@ void main(void) {
6664
6662
  gl_FragColor = c * alpha;
6665
6663
  }`
6666
6664
  }));
6667
- __decorateClass$I([
6665
+ __decorateClass$L([
6668
6666
  property({ default: 1 })
6669
6667
  ], exports.ColorAdjustEffect.prototype, "saturation", 2);
6670
- __decorateClass$I([
6668
+ __decorateClass$L([
6671
6669
  property({ default: 1 })
6672
6670
  ], exports.ColorAdjustEffect.prototype, "contrast", 2);
6673
- __decorateClass$I([
6671
+ __decorateClass$L([
6674
6672
  property({ default: 1 })
6675
6673
  ], exports.ColorAdjustEffect.prototype, "brightness", 2);
6676
- __decorateClass$I([
6674
+ __decorateClass$L([
6677
6675
  property({ default: 1 })
6678
6676
  ], exports.ColorAdjustEffect.prototype, "red", 2);
6679
- __decorateClass$I([
6677
+ __decorateClass$L([
6680
6678
  property({ default: 1 })
6681
6679
  ], exports.ColorAdjustEffect.prototype, "green", 2);
6682
- __decorateClass$I([
6680
+ __decorateClass$L([
6683
6681
  property({ default: 1 })
6684
6682
  ], exports.ColorAdjustEffect.prototype, "blue", 2);
6685
- __decorateClass$I([
6683
+ __decorateClass$L([
6686
6684
  property({ default: 1 })
6687
6685
  ], exports.ColorAdjustEffect.prototype, "alpha", 2);
6688
- __decorateClass$I([
6686
+ __decorateClass$L([
6689
6687
  property({ default: 1 })
6690
6688
  ], exports.ColorAdjustEffect.prototype, "gamma", 2);
6691
- exports.ColorAdjustEffect = __decorateClass$I([
6689
+ exports.ColorAdjustEffect = __decorateClass$L([
6692
6690
  customNode("ColorAdjustEffect")
6693
6691
  ], exports.ColorAdjustEffect);
6694
6692
 
6695
- var __defProp$z = Object.defineProperty;
6693
+ var __defProp$C = Object.defineProperty;
6696
6694
  var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6697
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6698
- var __decorateClass$H = (decorators, target, key, kind) => {
6695
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6696
+ var __decorateClass$K = (decorators, target, key, kind) => {
6699
6697
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
6700
6698
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6701
6699
  if (decorator = decorators[i])
6702
6700
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6703
- if (kind && result) __defProp$z(target, key, result);
6701
+ if (kind && result) __defProp$C(target, key, result);
6704
6702
  return result;
6705
6703
  };
6706
6704
  var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
@@ -6780,22 +6778,22 @@ void main(void) {
6780
6778
  );
6781
6779
  }`
6782
6780
  }));
6783
- __decorateClass$H([
6781
+ __decorateClass$K([
6784
6782
  property()
6785
6783
  ], exports.ColorFilterEffect.prototype, "filter", 2);
6786
- exports.ColorFilterEffect = __decorateClass$H([
6784
+ exports.ColorFilterEffect = __decorateClass$K([
6787
6785
  customNode("ColorFilterEffect")
6788
6786
  ], exports.ColorFilterEffect);
6789
6787
 
6790
- var __defProp$y = Object.defineProperty;
6788
+ var __defProp$B = Object.defineProperty;
6791
6789
  var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6792
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6793
- var __decorateClass$G = (decorators, target, key, kind) => {
6790
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6791
+ var __decorateClass$J = (decorators, target, key, kind) => {
6794
6792
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
6795
6793
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6796
6794
  if (decorator = decorators[i])
6797
6795
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6798
- if (kind && result) __defProp$y(target, key, result);
6796
+ if (kind && result) __defProp$B(target, key, result);
6799
6797
  return result;
6800
6798
  };
6801
6799
  var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
@@ -6871,25 +6869,25 @@ void main(void) {
6871
6869
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
6872
6870
  }`
6873
6871
  }));
6874
- __decorateClass$G([
6872
+ __decorateClass$J([
6875
6873
  property({ default: [] })
6876
6874
  ], exports.ColorOverlayEffect.prototype, "colors", 2);
6877
- __decorateClass$G([
6875
+ __decorateClass$J([
6878
6876
  property({ default: 0.5 })
6879
6877
  ], exports.ColorOverlayEffect.prototype, "alpha", 2);
6880
- exports.ColorOverlayEffect = __decorateClass$G([
6878
+ exports.ColorOverlayEffect = __decorateClass$J([
6881
6879
  customNode("ColorOverlayEffect")
6882
6880
  ], exports.ColorOverlayEffect);
6883
6881
 
6884
- var __defProp$x = Object.defineProperty;
6882
+ var __defProp$A = Object.defineProperty;
6885
6883
  var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6886
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6887
- var __decorateClass$F = (decorators, target, key, kind) => {
6884
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6885
+ var __decorateClass$I = (decorators, target, key, kind) => {
6888
6886
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
6889
6887
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6890
6888
  if (decorator = decorators[i])
6891
6889
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6892
- if (kind && result) __defProp$x(target, key, result);
6890
+ if (kind && result) __defProp$A(target, key, result);
6893
6891
  return result;
6894
6892
  };
6895
6893
  var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
@@ -6956,25 +6954,25 @@ void main(void) {
6956
6954
  gl_FragColor = color;
6957
6955
  }`
6958
6956
  }));
6959
- __decorateClass$F([
6957
+ __decorateClass$I([
6960
6958
  property({ default: [] })
6961
6959
  ], exports.ColorRemoveEffect.prototype, "colors", 2);
6962
- __decorateClass$F([
6960
+ __decorateClass$I([
6963
6961
  property({ default: 0.5 })
6964
6962
  ], exports.ColorRemoveEffect.prototype, "epsilon", 2);
6965
- exports.ColorRemoveEffect = __decorateClass$F([
6963
+ exports.ColorRemoveEffect = __decorateClass$I([
6966
6964
  customNode("ColorRemoveEffect")
6967
6965
  ], exports.ColorRemoveEffect);
6968
6966
 
6969
- var __defProp$w = Object.defineProperty;
6967
+ var __defProp$z = Object.defineProperty;
6970
6968
  var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6971
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6972
- var __decorateClass$E = (decorators, target, key, kind) => {
6969
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6970
+ var __decorateClass$H = (decorators, target, key, kind) => {
6973
6971
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
6974
6972
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6975
6973
  if (decorator = decorators[i])
6976
6974
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6977
- if (kind && result) __defProp$w(target, key, result);
6975
+ if (kind && result) __defProp$z(target, key, result);
6978
6976
  return result;
6979
6977
  };
6980
6978
  var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
@@ -7063,13 +7061,13 @@ void main(void) {
7063
7061
  }
7064
7062
  }`
7065
7063
  }));
7066
- __decorateClass$E([
7064
+ __decorateClass$H([
7067
7065
  property({ default: [] })
7068
7066
  ], exports.ColorReplaceEffect.prototype, "colors", 2);
7069
- __decorateClass$E([
7067
+ __decorateClass$H([
7070
7068
  property({ default: 0.05 })
7071
7069
  ], exports.ColorReplaceEffect.prototype, "epsilon", 2);
7072
- exports.ColorReplaceEffect = __decorateClass$E([
7070
+ exports.ColorReplaceEffect = __decorateClass$H([
7073
7071
  customNode("ColorReplaceEffect")
7074
7072
  ], exports.ColorReplaceEffect);
7075
7073
 
@@ -7209,6 +7207,7 @@ class CanvasContext extends modernPath2d.Path2D {
7209
7207
  }
7210
7208
  if (vertices.length && oldTexture !== draw.texture && !oldTexture?.is(draw.texture)) {
7211
7209
  push(draw.type);
7210
+ texture = draw.texture;
7212
7211
  }
7213
7212
  const start = vertices.length;
7214
7213
  if (draw.type === "fill") {
@@ -7236,14 +7235,14 @@ class CanvasContext extends modernPath2d.Path2D {
7236
7235
  }
7237
7236
  }
7238
7237
 
7239
- var __defProp$v = Object.defineProperty;
7238
+ var __defProp$y = Object.defineProperty;
7240
7239
  var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
7241
- var __decorateClass$D = (decorators, target, key, kind) => {
7240
+ var __decorateClass$G = (decorators, target, key, kind) => {
7242
7241
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
7243
7242
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7244
7243
  if (decorator = decorators[i])
7245
7244
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7246
- if (kind && result) __defProp$v(target, key, result);
7245
+ if (kind && result) __defProp$y(target, key, result);
7247
7246
  return result;
7248
7247
  };
7249
7248
  exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
@@ -7405,19 +7404,19 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
7405
7404
  super._render(renderer);
7406
7405
  }
7407
7406
  };
7408
- __decorateClass$D([
7407
+ __decorateClass$G([
7409
7408
  property()
7410
7409
  ], exports.CanvasItem.prototype, "modulate", 2);
7411
- __decorateClass$D([
7410
+ __decorateClass$G([
7412
7411
  property()
7413
7412
  ], exports.CanvasItem.prototype, "blendMode", 2);
7414
- __decorateClass$D([
7413
+ __decorateClass$G([
7415
7414
  protectedProperty({ default: true })
7416
7415
  ], exports.CanvasItem.prototype, "visible", 2);
7417
- __decorateClass$D([
7416
+ __decorateClass$G([
7418
7417
  protectedProperty({ default: 1 })
7419
7418
  ], exports.CanvasItem.prototype, "opacity", 2);
7420
- exports.CanvasItem = __decorateClass$D([
7419
+ exports.CanvasItem = __decorateClass$G([
7421
7420
  customNode("CanvasItem")
7422
7421
  ], exports.CanvasItem);
7423
7422
 
@@ -7447,14 +7446,14 @@ class RenderStack {
7447
7446
  }
7448
7447
  }
7449
7448
 
7450
- var __defProp$u = Object.defineProperty;
7449
+ var __defProp$x = Object.defineProperty;
7451
7450
  var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7452
- var __decorateClass$C = (decorators, target, key, kind) => {
7451
+ var __decorateClass$F = (decorators, target, key, kind) => {
7453
7452
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7454
7453
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7455
7454
  if (decorator = decorators[i])
7456
7455
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7457
- if (kind && result) __defProp$u(target, key, result);
7456
+ if (kind && result) __defProp$x(target, key, result);
7458
7457
  return result;
7459
7458
  };
7460
7459
  exports.Timeline = class Timeline extends exports.Node {
@@ -7499,29 +7498,29 @@ exports.Timeline = class Timeline extends exports.Node {
7499
7498
  this.addTime(delta);
7500
7499
  }
7501
7500
  };
7502
- __decorateClass$C([
7501
+ __decorateClass$F([
7503
7502
  property({ default: 0 })
7504
7503
  ], exports.Timeline.prototype, "startTime", 2);
7505
- __decorateClass$C([
7504
+ __decorateClass$F([
7506
7505
  property({ default: 0 })
7507
7506
  ], exports.Timeline.prototype, "currentTime", 2);
7508
- __decorateClass$C([
7507
+ __decorateClass$F([
7509
7508
  property({ default: Number.MAX_SAFE_INTEGER })
7510
7509
  ], exports.Timeline.prototype, "endTime", 2);
7511
- __decorateClass$C([
7510
+ __decorateClass$F([
7512
7511
  property({ default: false })
7513
7512
  ], exports.Timeline.prototype, "loop", 2);
7514
- exports.Timeline = __decorateClass$C([
7513
+ exports.Timeline = __decorateClass$F([
7515
7514
  customNode("Timeline")
7516
7515
  ], exports.Timeline);
7517
7516
 
7518
- var __defProp$t = Object.defineProperty;
7519
- var __decorateClass$B = (decorators, target, key, kind) => {
7517
+ var __defProp$w = Object.defineProperty;
7518
+ var __decorateClass$E = (decorators, target, key, kind) => {
7520
7519
  var result = void 0 ;
7521
7520
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7522
7521
  if (decorator = decorators[i])
7523
7522
  result = (decorator(target, key, result) ) || result;
7524
- if (result) __defProp$t(target, key, result);
7523
+ if (result) __defProp$w(target, key, result);
7525
7524
  return result;
7526
7525
  };
7527
7526
  class SceneTree extends MainLoop {
@@ -7594,18 +7593,18 @@ class SceneTree extends MainLoop {
7594
7593
  this.input.removeEventListeners();
7595
7594
  }
7596
7595
  }
7597
- __decorateClass$B([
7596
+ __decorateClass$E([
7598
7597
  property({ default: false })
7599
7598
  ], SceneTree.prototype, "processPaused");
7600
- __decorateClass$B([
7599
+ __decorateClass$E([
7601
7600
  property()
7602
7601
  ], SceneTree.prototype, "backgroundColor");
7603
- __decorateClass$B([
7602
+ __decorateClass$E([
7604
7603
  protectedProperty({ default: false })
7605
7604
  ], SceneTree.prototype, "debug");
7606
7605
 
7607
7606
  var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7608
- var __decorateClass$A = (decorators, target, key, kind) => {
7607
+ var __decorateClass$D = (decorators, target, key, kind) => {
7609
7608
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7610
7609
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7611
7610
  if (decorator = decorators[i])
@@ -7618,7 +7617,7 @@ exports.Transition = class Transition extends exports.Effect {
7618
7617
  this.setProperties(properties).append(children);
7619
7618
  }
7620
7619
  };
7621
- exports.Transition = __decorateClass$A([
7620
+ exports.Transition = __decorateClass$D([
7622
7621
  customNode("Transition", {
7623
7622
  effectMode: "transition",
7624
7623
  processMode: "pausable",
@@ -7626,15 +7625,15 @@ exports.Transition = __decorateClass$A([
7626
7625
  })
7627
7626
  ], exports.Transition);
7628
7627
 
7629
- var __defProp$s = Object.defineProperty;
7628
+ var __defProp$v = Object.defineProperty;
7630
7629
  var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7631
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7632
- var __decorateClass$z = (decorators, target, key, kind) => {
7630
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7631
+ var __decorateClass$C = (decorators, target, key, kind) => {
7633
7632
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7634
7633
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7635
7634
  if (decorator = decorators[i])
7636
7635
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7637
- if (kind && result) __defProp$s(target, key, result);
7636
+ if (kind && result) __defProp$v(target, key, result);
7638
7637
  return result;
7639
7638
  };
7640
7639
  var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -7740,25 +7739,25 @@ void main(void) {
7740
7739
  }`,
7741
7740
  frag: frag$2
7742
7741
  }));
7743
- __decorateClass$z([
7742
+ __decorateClass$C([
7744
7743
  property({ default: 4 })
7745
7744
  ], exports.GaussianBlurEffect.prototype, "strength", 2);
7746
- __decorateClass$z([
7745
+ __decorateClass$C([
7747
7746
  property({ default: 3 })
7748
7747
  ], exports.GaussianBlurEffect.prototype, "quality", 2);
7749
- exports.GaussianBlurEffect = __decorateClass$z([
7748
+ exports.GaussianBlurEffect = __decorateClass$C([
7750
7749
  customNode("GaussianBlurEffect")
7751
7750
  ], exports.GaussianBlurEffect);
7752
7751
 
7753
- var __defProp$r = Object.defineProperty;
7752
+ var __defProp$u = Object.defineProperty;
7754
7753
  var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7755
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7756
- var __decorateClass$y = (decorators, target, key, kind) => {
7754
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7755
+ var __decorateClass$B = (decorators, target, key, kind) => {
7757
7756
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7758
7757
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7759
7758
  if (decorator = decorators[i])
7760
7759
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7761
- if (kind && result) __defProp$r(target, key, result);
7760
+ if (kind && result) __defProp$u(target, key, result);
7762
7761
  return result;
7763
7762
  };
7764
7763
  var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
@@ -7822,34 +7821,34 @@ void main(void) {
7822
7821
  gl_FragColor = sample;
7823
7822
  }`
7824
7823
  }));
7825
- __decorateClass$y([
7824
+ __decorateClass$B([
7826
7825
  property({ default: 0 })
7827
7826
  ], exports.DropShadowEffect.prototype, "color", 2);
7828
- __decorateClass$y([
7827
+ __decorateClass$B([
7829
7828
  property({ default: 4 })
7830
7829
  ], exports.DropShadowEffect.prototype, "blur", 2);
7831
- __decorateClass$y([
7830
+ __decorateClass$B([
7832
7831
  property({ default: 4 })
7833
7832
  ], exports.DropShadowEffect.prototype, "offsetX", 2);
7834
- __decorateClass$y([
7833
+ __decorateClass$B([
7835
7834
  property({ default: 4 })
7836
7835
  ], exports.DropShadowEffect.prototype, "offsetY", 2);
7837
- __decorateClass$y([
7836
+ __decorateClass$B([
7838
7837
  property({ default: false })
7839
7838
  ], exports.DropShadowEffect.prototype, "shadowOnly", 2);
7840
- exports.DropShadowEffect = __decorateClass$y([
7839
+ exports.DropShadowEffect = __decorateClass$B([
7841
7840
  customNode("DropShadowEffect")
7842
7841
  ], exports.DropShadowEffect);
7843
7842
 
7844
- var __defProp$q = Object.defineProperty;
7843
+ var __defProp$t = Object.defineProperty;
7845
7844
  var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7846
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7847
- var __decorateClass$x = (decorators, target, key, kind) => {
7845
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7846
+ var __decorateClass$A = (decorators, target, key, kind) => {
7848
7847
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
7849
7848
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7850
7849
  if (decorator = decorators[i])
7851
7850
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7852
- if (kind && result) __defProp$q(target, key, result);
7851
+ if (kind && result) __defProp$t(target, key, result);
7853
7852
  return result;
7854
7853
  };
7855
7854
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
@@ -7894,22 +7893,22 @@ void main(void) {
7894
7893
  gl_FragColor = vec4(color.rgb * alpha, alpha);
7895
7894
  }`
7896
7895
  }));
7897
- __decorateClass$x([
7896
+ __decorateClass$A([
7898
7897
  property({ default: 5 })
7899
7898
  ], exports.EmbossEffect.prototype, "strength", 2);
7900
- exports.EmbossEffect = __decorateClass$x([
7899
+ exports.EmbossEffect = __decorateClass$A([
7901
7900
  customNode("EmbossEffect")
7902
7901
  ], exports.EmbossEffect);
7903
7902
 
7904
- var __defProp$p = Object.defineProperty;
7903
+ var __defProp$s = Object.defineProperty;
7905
7904
  var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7906
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7907
- var __decorateClass$w = (decorators, target, key, kind) => {
7905
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7906
+ var __decorateClass$z = (decorators, target, key, kind) => {
7908
7907
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
7909
7908
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7910
7909
  if (decorator = decorators[i])
7911
7910
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7912
- if (kind && result) __defProp$p(target, key, result);
7911
+ if (kind && result) __defProp$s(target, key, result);
7913
7912
  return result;
7914
7913
  };
7915
7914
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
@@ -8083,46 +8082,46 @@ void main(void) {
8083
8082
  gl_FragColor.a = texture2D(sampler, coord).a;
8084
8083
  }`
8085
8084
  }));
8086
- __decorateClass$w([
8085
+ __decorateClass$z([
8087
8086
  property({ default: 10 })
8088
8087
  ], exports.GlitchEffect.prototype, "slices", 2);
8089
- __decorateClass$w([
8088
+ __decorateClass$z([
8090
8089
  property({ default: 512 })
8091
8090
  ], exports.GlitchEffect.prototype, "sampleSize", 2);
8092
- __decorateClass$w([
8091
+ __decorateClass$z([
8093
8092
  property({ default: 100 })
8094
8093
  ], exports.GlitchEffect.prototype, "offset", 2);
8095
- __decorateClass$w([
8094
+ __decorateClass$z([
8096
8095
  property({ default: 0 })
8097
8096
  ], exports.GlitchEffect.prototype, "direction", 2);
8098
- __decorateClass$w([
8097
+ __decorateClass$z([
8099
8098
  property({ default: 2 })
8100
8099
  ], exports.GlitchEffect.prototype, "fillMode", 2);
8101
- __decorateClass$w([
8100
+ __decorateClass$z([
8102
8101
  property({ default: 0 })
8103
8102
  ], exports.GlitchEffect.prototype, "seed", 2);
8104
- __decorateClass$w([
8103
+ __decorateClass$z([
8105
8104
  property({ default: [2, 2] })
8106
8105
  ], exports.GlitchEffect.prototype, "red", 2);
8107
- __decorateClass$w([
8106
+ __decorateClass$z([
8108
8107
  property({ default: [-10, 4] })
8109
8108
  ], exports.GlitchEffect.prototype, "green", 2);
8110
- __decorateClass$w([
8109
+ __decorateClass$z([
8111
8110
  property({ default: [10, -4] })
8112
8111
  ], exports.GlitchEffect.prototype, "blue", 2);
8113
- exports.GlitchEffect = __decorateClass$w([
8112
+ exports.GlitchEffect = __decorateClass$z([
8114
8113
  customNode("GlitchEffect")
8115
8114
  ], exports.GlitchEffect);
8116
8115
 
8117
- var __defProp$o = Object.defineProperty;
8116
+ var __defProp$r = Object.defineProperty;
8118
8117
  var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8119
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8120
- var __decorateClass$v = (decorators, target, key, kind) => {
8118
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8119
+ var __decorateClass$y = (decorators, target, key, kind) => {
8121
8120
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
8122
8121
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8123
8122
  if (decorator = decorators[i])
8124
8123
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8125
- if (kind && result) __defProp$o(target, key, result);
8124
+ if (kind && result) __defProp$r(target, key, result);
8126
8125
  return result;
8127
8126
  };
8128
8127
  var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
@@ -8300,39 +8299,39 @@ void main(void) {
8300
8299
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
8301
8300
  }`
8302
8301
  }));
8303
- __decorateClass$v([
8302
+ __decorateClass$y([
8304
8303
  property({ default: 0 })
8305
8304
  ], exports.GodrayEffect.prototype, "time", 2);
8306
- __decorateClass$v([
8305
+ __decorateClass$y([
8307
8306
  property({ default: 30 })
8308
8307
  ], exports.GodrayEffect.prototype, "angle", 2);
8309
- __decorateClass$v([
8308
+ __decorateClass$y([
8310
8309
  property({ default: 0.5 })
8311
8310
  ], exports.GodrayEffect.prototype, "gain", 2);
8312
- __decorateClass$v([
8311
+ __decorateClass$y([
8313
8312
  property({ default: 2.5 })
8314
8313
  ], exports.GodrayEffect.prototype, "lacunarity", 2);
8315
- __decorateClass$v([
8314
+ __decorateClass$y([
8316
8315
  property({ default: true })
8317
8316
  ], exports.GodrayEffect.prototype, "parallel", 2);
8318
- __decorateClass$v([
8317
+ __decorateClass$y([
8319
8318
  property({ default: [0, 0] })
8320
8319
  ], exports.GodrayEffect.prototype, "center", 2);
8321
- __decorateClass$v([
8320
+ __decorateClass$y([
8322
8321
  property({ default: 1 })
8323
8322
  ], exports.GodrayEffect.prototype, "alpha", 2);
8324
- exports.GodrayEffect = __decorateClass$v([
8323
+ exports.GodrayEffect = __decorateClass$y([
8325
8324
  customNode("GodrayEffect")
8326
8325
  ], exports.GodrayEffect);
8327
8326
 
8328
- var __defProp$n = Object.defineProperty;
8327
+ var __defProp$q = Object.defineProperty;
8329
8328
  var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8330
- var __decorateClass$u = (decorators, target, key, kind) => {
8329
+ var __decorateClass$x = (decorators, target, key, kind) => {
8331
8330
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8332
8331
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8333
8332
  if (decorator = decorators[i])
8334
8333
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8335
- if (kind && result) __defProp$n(target, key, result);
8334
+ if (kind && result) __defProp$q(target, key, result);
8336
8335
  return result;
8337
8336
  };
8338
8337
  const frag$1 = `varying vec2 vUv;
@@ -8423,28 +8422,28 @@ void main() {
8423
8422
  });
8424
8423
  }
8425
8424
  };
8426
- __decorateClass$u([
8425
+ __decorateClass$x([
8427
8426
  property({ default: 4 })
8428
8427
  ], exports.KawaseBlurEffect.prototype, "strength", 2);
8429
- __decorateClass$u([
8428
+ __decorateClass$x([
8430
8429
  property({ default: 3 })
8431
8430
  ], exports.KawaseBlurEffect.prototype, "quality", 2);
8432
- __decorateClass$u([
8431
+ __decorateClass$x([
8433
8432
  property({ default: [1, 1] })
8434
8433
  ], exports.KawaseBlurEffect.prototype, "pixelSize", 2);
8435
- exports.KawaseBlurEffect = __decorateClass$u([
8434
+ exports.KawaseBlurEffect = __decorateClass$x([
8436
8435
  customNode("KawaseBlurEffect")
8437
8436
  ], exports.KawaseBlurEffect);
8438
8437
 
8439
- var __defProp$m = Object.defineProperty;
8438
+ var __defProp$p = Object.defineProperty;
8440
8439
  var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8441
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8442
- var __decorateClass$t = (decorators, target, key, kind) => {
8440
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8441
+ var __decorateClass$w = (decorators, target, key, kind) => {
8443
8442
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8444
8443
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8445
8444
  if (decorator = decorators[i])
8446
8445
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8447
- if (kind && result) __defProp$m(target, key, result);
8446
+ if (kind && result) __defProp$p(target, key, result);
8448
8447
  return result;
8449
8448
  };
8450
8449
  var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
@@ -8533,25 +8532,25 @@ void main(void) {
8533
8532
  }
8534
8533
  }`
8535
8534
  }));
8536
- __decorateClass$t([
8535
+ __decorateClass$w([
8537
8536
  protectedProperty()
8538
8537
  ], exports.MaskEffect.prototype, "texture", 2);
8539
- __decorateClass$t([
8538
+ __decorateClass$w([
8540
8539
  property({ default: "" })
8541
8540
  ], exports.MaskEffect.prototype, "src", 2);
8542
- exports.MaskEffect = __decorateClass$t([
8541
+ exports.MaskEffect = __decorateClass$w([
8543
8542
  customNode("MaskEffect")
8544
8543
  ], exports.MaskEffect);
8545
8544
 
8546
- var __defProp$l = Object.defineProperty;
8545
+ var __defProp$o = Object.defineProperty;
8547
8546
  var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8548
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8549
- var __decorateClass$s = (decorators, target, key, kind) => {
8547
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8548
+ var __decorateClass$v = (decorators, target, key, kind) => {
8550
8549
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8551
8550
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8552
8551
  if (decorator = decorators[i])
8553
8552
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8554
- if (kind && result) __defProp$l(target, key, result);
8553
+ if (kind && result) __defProp$o(target, key, result);
8555
8554
  return result;
8556
8555
  };
8557
8556
  var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -8639,40 +8638,40 @@ void main() {
8639
8638
  };
8640
8639
  __publicField$7(exports.OutlineEffect, "MIN_SAMPLES", 1);
8641
8640
  __publicField$7(exports.OutlineEffect, "MAX_SAMPLES", 100);
8642
- __decorateClass$s([
8641
+ __decorateClass$v([
8643
8642
  property({ default: 0 })
8644
8643
  ], exports.OutlineEffect.prototype, "color", 2);
8645
- __decorateClass$s([
8644
+ __decorateClass$v([
8646
8645
  property({ default: 1 })
8647
8646
  ], exports.OutlineEffect.prototype, "width", 2);
8648
- __decorateClass$s([
8647
+ __decorateClass$v([
8649
8648
  property({ default: "solid" })
8650
8649
  ], exports.OutlineEffect.prototype, "style", 2);
8651
- __decorateClass$s([
8650
+ __decorateClass$v([
8652
8651
  property()
8653
8652
  ], exports.OutlineEffect.prototype, "image", 2);
8654
- __decorateClass$s([
8653
+ __decorateClass$v([
8655
8654
  property({ default: 1 })
8656
8655
  ], exports.OutlineEffect.prototype, "opacity", 2);
8657
- __decorateClass$s([
8656
+ __decorateClass$v([
8658
8657
  property({ default: 0.1 })
8659
8658
  ], exports.OutlineEffect.prototype, "quality", 2);
8660
- __decorateClass$s([
8659
+ __decorateClass$v([
8661
8660
  property({ default: false })
8662
8661
  ], exports.OutlineEffect.prototype, "knockout", 2);
8663
- exports.OutlineEffect = __decorateClass$s([
8662
+ exports.OutlineEffect = __decorateClass$v([
8664
8663
  customNode("OutlineEffect")
8665
8664
  ], exports.OutlineEffect);
8666
8665
 
8667
- var __defProp$k = Object.defineProperty;
8666
+ var __defProp$n = Object.defineProperty;
8668
8667
  var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8669
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8670
- var __decorateClass$r = (decorators, target, key, kind) => {
8668
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8669
+ var __decorateClass$u = (decorators, target, key, kind) => {
8671
8670
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8672
8671
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8673
8672
  if (decorator = decorators[i])
8674
8673
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8675
- if (kind && result) __defProp$k(target, key, result);
8674
+ if (kind && result) __defProp$n(target, key, result);
8676
8675
  return result;
8677
8676
  };
8678
8677
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
@@ -8728,22 +8727,22 @@ void main(void) {
8728
8727
  gl_FragColor = texture2D(sampler, coord);
8729
8728
  }`
8730
8729
  }));
8731
- __decorateClass$r([
8730
+ __decorateClass$u([
8732
8731
  property({ default: 10 })
8733
8732
  ], exports.PixelateEffect.prototype, "strength", 2);
8734
- exports.PixelateEffect = __decorateClass$r([
8733
+ exports.PixelateEffect = __decorateClass$u([
8735
8734
  customNode("PixelateEffect")
8736
8735
  ], exports.PixelateEffect);
8737
8736
 
8738
- var __defProp$j = Object.defineProperty;
8737
+ var __defProp$m = Object.defineProperty;
8739
8738
  var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8740
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8741
- var __decorateClass$q = (decorators, target, key, kind) => {
8739
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8740
+ var __decorateClass$t = (decorators, target, key, kind) => {
8742
8741
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
8743
8742
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8744
8743
  if (decorator = decorators[i])
8745
8744
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8746
- if (kind && result) __defProp$j(target, key, result);
8745
+ if (kind && result) __defProp$m(target, key, result);
8747
8746
  return result;
8748
8747
  };
8749
8748
  var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
@@ -8856,35 +8855,181 @@ void main() {
8856
8855
  gl_FragColor = color;
8857
8856
  }`
8858
8857
  }));
8859
- __decorateClass$q([
8858
+ __decorateClass$t([
8860
8859
  property()
8861
8860
  ], exports.ZoomBlurEffect.prototype, "center", 2);
8862
- __decorateClass$q([
8861
+ __decorateClass$t([
8863
8862
  property({ default: 20 })
8864
8863
  ], exports.ZoomBlurEffect.prototype, "innerRadius", 2);
8865
- __decorateClass$q([
8864
+ __decorateClass$t([
8866
8865
  property({ default: -1 })
8867
8866
  ], exports.ZoomBlurEffect.prototype, "radius", 2);
8868
- __decorateClass$q([
8867
+ __decorateClass$t([
8869
8868
  property({ default: 0.1 })
8870
8869
  ], exports.ZoomBlurEffect.prototype, "strength", 2);
8871
- exports.ZoomBlurEffect = __decorateClass$q([
8870
+ exports.ZoomBlurEffect = __decorateClass$t([
8872
8871
  customNode("ZoomBlurEffect")
8873
8872
  ], exports.ZoomBlurEffect);
8874
8873
 
8875
- var __defProp$i = Object.defineProperty;
8876
- var __decorateClass$p = (decorators, target, key, kind) => {
8874
+ var __defProp$l = Object.defineProperty;
8875
+ var __decorateClass$s = (decorators, target, key, kind) => {
8877
8876
  var result = void 0 ;
8878
8877
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8879
8878
  if (decorator = decorators[i])
8880
8879
  result = (decorator(target, key, result) ) || result;
8881
- if (result) __defProp$i(target, key, result);
8880
+ if (result) __defProp$l(target, key, result);
8881
+ return result;
8882
+ };
8883
+ class BaseElement2DFill extends CoreObject {
8884
+ constructor(parent, properties) {
8885
+ super();
8886
+ this.parent = parent;
8887
+ this.setProperties(properties);
8888
+ }
8889
+ _image;
8890
+ _updateProperty(key, value, oldValue, declaration) {
8891
+ super._updateProperty(key, value, oldValue, declaration);
8892
+ switch (key) {
8893
+ case "color":
8894
+ case "dpi":
8895
+ case "rotateWithShape":
8896
+ case "tile":
8897
+ this.parent.requestRedraw();
8898
+ break;
8899
+ case "image":
8900
+ this._updateImage();
8901
+ break;
8902
+ }
8903
+ }
8904
+ async loadImage() {
8905
+ if (this.image && this.image !== "none") {
8906
+ return await assets.texture.load(this.image);
8907
+ }
8908
+ }
8909
+ async _updateImage() {
8910
+ this._image = await this.loadImage();
8911
+ this.parent.requestRedraw();
8912
+ }
8913
+ canDraw() {
8914
+ return Boolean(
8915
+ this._image || this.color
8916
+ );
8917
+ }
8918
+ draw() {
8919
+ const ctx = this.parent.context;
8920
+ if (this._image) {
8921
+ const { width, height } = this.parent.size;
8922
+ ctx.textureTransform = new Transform2D().scale(1 / width, 1 / height);
8923
+ ctx.fillStyle = this._image;
8924
+ } else {
8925
+ ctx.fillStyle = this.color;
8926
+ }
8927
+ ctx.fill();
8928
+ }
8929
+ }
8930
+ __decorateClass$s([
8931
+ property()
8932
+ ], BaseElement2DFill.prototype, "color");
8933
+ __decorateClass$s([
8934
+ property()
8935
+ ], BaseElement2DFill.prototype, "image");
8936
+ __decorateClass$s([
8937
+ property()
8938
+ ], BaseElement2DFill.prototype, "dpi");
8939
+ __decorateClass$s([
8940
+ property()
8941
+ ], BaseElement2DFill.prototype, "rotateWithShape");
8942
+ __decorateClass$s([
8943
+ property()
8944
+ ], BaseElement2DFill.prototype, "tile");
8945
+
8946
+ var __defProp$k = Object.defineProperty;
8947
+ var __decorateClass$r = (decorators, target, key, kind) => {
8948
+ var result = void 0 ;
8949
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8950
+ if (decorator = decorators[i])
8951
+ result = (decorator(target, key, result) ) || result;
8952
+ if (result) __defProp$k(target, key, result);
8953
+ return result;
8954
+ };
8955
+ class BaseElement2DGeometry extends CoreObject {
8956
+ constructor(parent, properties) {
8957
+ super();
8958
+ this.parent = parent;
8959
+ this.setProperties(properties);
8960
+ this._updatePath2DSet();
8961
+ }
8962
+ _path2DSet = new modernPath2d.Path2DSet();
8963
+ _updateProperty(key, value, oldValue, declaration) {
8964
+ super._updateProperty(key, value, oldValue, declaration);
8965
+ switch (key) {
8966
+ case "svg":
8967
+ case "data":
8968
+ case "viewBox":
8969
+ this._updatePath2DSet();
8970
+ this.parent.requestRedraw();
8971
+ break;
8972
+ }
8973
+ }
8974
+ _updatePath2DSet() {
8975
+ let viewBox;
8976
+ if (this.svg) {
8977
+ const dom = modernPath2d.svgToDOM(this.svg);
8978
+ this._path2DSet = modernPath2d.svgToPath2DSet(dom);
8979
+ viewBox = this._path2DSet.viewBox ?? this.viewBox;
8980
+ } else {
8981
+ viewBox = this.viewBox;
8982
+ this.data.forEach((path, i) => {
8983
+ const { data, ...style } = path;
8984
+ const path2D = new modernPath2d.Path2D();
8985
+ path2D.style = style;
8986
+ path2D.addData(data);
8987
+ this._path2DSet.paths[i] = path2D;
8988
+ });
8989
+ }
8990
+ const [x, y, w, h] = viewBox;
8991
+ this._path2DSet.paths.forEach((path) => {
8992
+ path.applyTransform(new modernPath2d.Matrix3().translate(-x, -y).scale(1 / w, 1 / h));
8993
+ });
8994
+ }
8995
+ draw() {
8996
+ const ctx = this.parent.context;
8997
+ const { width, height } = this.parent.size;
8998
+ this._path2DSet.paths.forEach((path) => {
8999
+ modernPath2d.svgPathCommandsAddToPath2D(
9000
+ path.clone().applyTransform(new modernPath2d.Matrix3().scale(width, height)).toCommands(),
9001
+ ctx
9002
+ );
9003
+ });
9004
+ }
9005
+ }
9006
+ __decorateClass$r([
9007
+ property()
9008
+ ], BaseElement2DGeometry.prototype, "name");
9009
+ __decorateClass$r([
9010
+ property()
9011
+ ], BaseElement2DGeometry.prototype, "svg");
9012
+ __decorateClass$r([
9013
+ property({ default: [0, 0, 1, 1] })
9014
+ ], BaseElement2DGeometry.prototype, "viewBox");
9015
+ __decorateClass$r([
9016
+ property({ default: [{ data: "M0,0L0,1L1,1L1,0Z" }] })
9017
+ ], BaseElement2DGeometry.prototype, "data");
9018
+
9019
+ var __defProp$j = Object.defineProperty;
9020
+ var __decorateClass$q = (decorators, target, key, kind) => {
9021
+ var result = void 0 ;
9022
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9023
+ if (decorator = decorators[i])
9024
+ result = (decorator(target, key, result) ) || result;
9025
+ if (result) __defProp$j(target, key, result);
8882
9026
  return result;
8883
9027
  };
8884
9028
  class BaseElement2DOutline extends CoreObject {
8885
- constructor(parent) {
9029
+ constructor(parent, properties) {
8886
9030
  super();
8887
9031
  this.parent = parent;
9032
+ this.setProperties(properties);
8888
9033
  }
8889
9034
  _updateProperty(key, value, oldValue, declaration) {
8890
9035
  super._updateProperty(key, value, oldValue, declaration);
@@ -8894,55 +9039,52 @@ class BaseElement2DOutline extends CoreObject {
8894
9039
  case "style":
8895
9040
  case "image":
8896
9041
  case "opacity":
8897
- this.updateEffect();
9042
+ this.parent.requestRedraw();
8898
9043
  break;
8899
9044
  }
8900
9045
  }
8901
- updateEffect() {
8902
- const name = "__$outline";
8903
- let effect = this.parent.getNode(name);
8904
- if (this.width) {
8905
- if (!effect) {
8906
- effect = new exports.OutlineEffect({ name });
8907
- this.parent.appendChild(effect, "back");
8908
- }
8909
- effect.setProperties(this.getProperties());
8910
- } else {
8911
- if (effect) {
8912
- this.parent.removeChild(effect);
8913
- }
8914
- }
9046
+ canDraw() {
9047
+ return Boolean(
9048
+ this.width || this.color
9049
+ );
9050
+ }
9051
+ draw() {
9052
+ const ctx = this.parent.context;
9053
+ ctx.lineWidth = this.width;
9054
+ ctx.strokeStyle = this.color;
9055
+ ctx.stroke();
8915
9056
  }
8916
9057
  }
8917
- __decorateClass$p([
8918
- property({ default: "#000000" })
9058
+ __decorateClass$q([
9059
+ property({ default: 0 })
8919
9060
  ], BaseElement2DOutline.prototype, "color");
8920
- __decorateClass$p([
9061
+ __decorateClass$q([
8921
9062
  property({ default: 0 })
8922
9063
  ], BaseElement2DOutline.prototype, "width");
8923
- __decorateClass$p([
9064
+ __decorateClass$q([
8924
9065
  property({ default: "solid" })
8925
9066
  ], BaseElement2DOutline.prototype, "style");
8926
- __decorateClass$p([
9067
+ __decorateClass$q([
8927
9068
  property()
8928
9069
  ], BaseElement2DOutline.prototype, "image");
8929
- __decorateClass$p([
9070
+ __decorateClass$q([
8930
9071
  property({ default: 1 })
8931
9072
  ], BaseElement2DOutline.prototype, "opacity");
8932
9073
 
8933
- var __defProp$h = Object.defineProperty;
8934
- var __decorateClass$o = (decorators, target, key, kind) => {
9074
+ var __defProp$i = Object.defineProperty;
9075
+ var __decorateClass$p = (decorators, target, key, kind) => {
8935
9076
  var result = void 0 ;
8936
9077
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8937
9078
  if (decorator = decorators[i])
8938
9079
  result = (decorator(target, key, result) ) || result;
8939
- if (result) __defProp$h(target, key, result);
9080
+ if (result) __defProp$i(target, key, result);
8940
9081
  return result;
8941
9082
  };
8942
9083
  class BaseElement2DShadow extends CoreObject {
8943
- constructor(parent) {
9084
+ constructor(parent, properties) {
8944
9085
  super();
8945
9086
  this.parent = parent;
9087
+ this.setProperties(properties);
8946
9088
  }
8947
9089
  _updateProperty(key, value, oldValue, declaration) {
8948
9090
  super._updateProperty(key, value, oldValue, declaration);
@@ -8971,16 +9113,16 @@ class BaseElement2DShadow extends CoreObject {
8971
9113
  }
8972
9114
  }
8973
9115
  }
8974
- __decorateClass$o([
9116
+ __decorateClass$p([
8975
9117
  property({ default: "#000000" })
8976
9118
  ], BaseElement2DShadow.prototype, "color");
8977
- __decorateClass$o([
9119
+ __decorateClass$p([
8978
9120
  property({ default: 0 })
8979
9121
  ], BaseElement2DShadow.prototype, "blur");
8980
- __decorateClass$o([
9122
+ __decorateClass$p([
8981
9123
  property({ default: 0 })
8982
9124
  ], BaseElement2DShadow.prototype, "offsetY");
8983
- __decorateClass$o([
9125
+ __decorateClass$p([
8984
9126
  property({ default: 0 })
8985
9127
  ], BaseElement2DShadow.prototype, "offsetX");
8986
9128
 
@@ -9018,6 +9160,93 @@ for (const key in defaultStyles$1) {
9018
9160
  });
9019
9161
  }
9020
9162
 
9163
+ var __defProp$h = Object.defineProperty;
9164
+ var __decorateClass$o = (decorators, target, key, kind) => {
9165
+ var result = void 0 ;
9166
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9167
+ if (decorator = decorators[i])
9168
+ result = (decorator(target, key, result) ) || result;
9169
+ if (result) __defProp$h(target, key, result);
9170
+ return result;
9171
+ };
9172
+ class BaseElement2DText extends CoreObject {
9173
+ constructor(parent, properties) {
9174
+ super();
9175
+ this.parent = parent;
9176
+ this.setProperties(properties);
9177
+ }
9178
+ effects;
9179
+ measureDom;
9180
+ fonts;
9181
+ texture = new CanvasTexture();
9182
+ text = new modernText.Text();
9183
+ measureResult;
9184
+ _updateProperty(key, value, oldValue, declaration) {
9185
+ super._updateProperty(key, value, oldValue, declaration);
9186
+ switch (key) {
9187
+ case "content":
9188
+ case "effects":
9189
+ case "measureDom":
9190
+ case "fonts":
9191
+ case "split":
9192
+ this.parent.requestRedraw();
9193
+ break;
9194
+ }
9195
+ }
9196
+ _updateText() {
9197
+ this.text.style = this.parent.style.toJSON();
9198
+ this.text.content = this.content ?? "";
9199
+ this.text.effects = this.effects;
9200
+ this.text.fonts = this.fonts;
9201
+ this.text.measureDom = this.measureDom;
9202
+ this.text.requestUpdate();
9203
+ }
9204
+ measure() {
9205
+ this._updateText();
9206
+ return this.text.measure();
9207
+ }
9208
+ updateMeasure() {
9209
+ this.measureResult = this.measure();
9210
+ const textWidth = this.measureResult.boundingBox.width;
9211
+ const textHeight = this.measureResult.boundingBox.height;
9212
+ const { left, top, width, height = textHeight } = this.parent.style;
9213
+ this.parent.position.x = left + Math.min(0, ((width || textWidth) - textWidth) / 2);
9214
+ this.parent.position.y = top + Math.min(0, ((height || textHeight) - textHeight) / 2);
9215
+ this.parent.size.width = textWidth;
9216
+ this.parent.size.height = textHeight;
9217
+ return this;
9218
+ }
9219
+ canDraw() {
9220
+ return Boolean(
9221
+ this.content && this.texture?.valid
9222
+ );
9223
+ }
9224
+ draw() {
9225
+ const ctx = this.parent.context;
9226
+ this.text.render({
9227
+ pixelRatio: this.texture.pixelRatio,
9228
+ view: this.texture.source
9229
+ });
9230
+ this.texture.requestUpload();
9231
+ const { width, height } = this.parent.size;
9232
+ ctx.fillStyle = this.texture;
9233
+ ctx.textureTransform = new Transform2D().scale(1 / width, 1 / height);
9234
+ ctx.fill();
9235
+ }
9236
+ }
9237
+ __decorateClass$o([
9238
+ property({ default: "" })
9239
+ ], BaseElement2DText.prototype, "content");
9240
+ __decorateClass$o([
9241
+ property()
9242
+ ], BaseElement2DText.prototype, "effects");
9243
+ __decorateClass$o([
9244
+ protectedProperty()
9245
+ ], BaseElement2DText.prototype, "measureDom");
9246
+ __decorateClass$o([
9247
+ protectedProperty()
9248
+ ], BaseElement2DText.prototype, "fonts");
9249
+
9021
9250
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
9022
9251
  var __decorateClass$n = (decorators, target, key, kind) => {
9023
9252
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
@@ -9125,8 +9354,41 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9125
9354
  this._style?.off("updateProperty", cb);
9126
9355
  this._style = style;
9127
9356
  }
9128
- shadow = new BaseElement2DShadow(this);
9129
- outline = new BaseElement2DOutline(this);
9357
+ _text = new BaseElement2DText(this);
9358
+ get text() {
9359
+ return this._text;
9360
+ }
9361
+ set text(value) {
9362
+ this._text.setProperties(value);
9363
+ }
9364
+ _geometry = new BaseElement2DGeometry(this);
9365
+ get geometry() {
9366
+ return this._geometry;
9367
+ }
9368
+ set geometry(value) {
9369
+ this._geometry.setProperties(value);
9370
+ }
9371
+ _fill = new BaseElement2DFill(this);
9372
+ get fill() {
9373
+ return this._fill;
9374
+ }
9375
+ set fill(value) {
9376
+ this._fill.setProperties(value);
9377
+ }
9378
+ _outline = new BaseElement2DOutline(this);
9379
+ get outline() {
9380
+ return this._outline;
9381
+ }
9382
+ set outline(value) {
9383
+ this._outline.setProperties(value);
9384
+ }
9385
+ _shadow = new BaseElement2DShadow(this);
9386
+ get shadow() {
9387
+ return this._shadow;
9388
+ }
9389
+ set shadow(value) {
9390
+ this._shadow.setProperties(value);
9391
+ }
9130
9392
  constructor(properties, nodes = []) {
9131
9393
  super();
9132
9394
  this._updateStyleProperty = this._updateStyleProperty.bind(this);
@@ -9135,10 +9397,21 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9135
9397
  }
9136
9398
  setProperties(properties) {
9137
9399
  if (properties) {
9138
- const { style, shadow, outline, ...restProperties } = properties;
9400
+ const {
9401
+ style,
9402
+ text,
9403
+ geometry,
9404
+ fill,
9405
+ outline,
9406
+ shadow,
9407
+ ...restProperties
9408
+ } = properties;
9139
9409
  style && this.style.setProperties(style);
9140
- shadow && this.shadow.setProperties(shadow);
9410
+ text && this.text.setProperties(text);
9411
+ geometry && this.geometry.setProperties(geometry);
9412
+ fill && this.fill.setProperties(fill);
9141
9413
  outline && this.outline.setProperties(outline);
9414
+ shadow && this.shadow.setProperties(shadow);
9142
9415
  super.setProperties(restProperties);
9143
9416
  }
9144
9417
  return this;
@@ -9291,10 +9564,34 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9291
9564
  }
9292
9565
  _draw() {
9293
9566
  super._draw();
9294
- this._drawBackground();
9295
- this._drawContent();
9296
- this._drawBorder();
9297
- this._drawOutline();
9567
+ let flag = false;
9568
+ if (this.text.canDraw()) {
9569
+ this.text.updateMeasure();
9570
+ }
9571
+ if (this.fill.canDraw()) {
9572
+ this._tree?.log(this.name, "draw fill");
9573
+ this.geometry.draw();
9574
+ this.fill.draw();
9575
+ flag = true;
9576
+ }
9577
+ if (this.outline.canDraw()) {
9578
+ this._tree?.log(this.name, "draw outline");
9579
+ this.geometry.draw();
9580
+ this.outline.draw();
9581
+ flag = true;
9582
+ }
9583
+ if (this.text.canDraw()) {
9584
+ this._tree?.log(this.name, "draw text");
9585
+ this._drawBoundingRect();
9586
+ this.text.draw();
9587
+ flag = true;
9588
+ }
9589
+ if (!flag) {
9590
+ this._drawBackground();
9591
+ this._drawContent();
9592
+ this._drawBorder();
9593
+ this._drawOutline();
9594
+ }
9298
9595
  }
9299
9596
  _drawBackground() {
9300
9597
  const texture = this._backgroundImage;
@@ -9366,13 +9663,6 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9366
9663
  this._input(event, key);
9367
9664
  }
9368
9665
  }
9369
- _pointerEntering = false;
9370
- _pointerEntered() {
9371
- this._pointerEntering = true;
9372
- }
9373
- _pointerExited() {
9374
- if (this._pointerEntering) ;
9375
- }
9376
9666
  // eslint-disable-next-line unused-imports/no-unused-vars
9377
9667
  _pointerInput(point, key) {
9378
9668
  const { width, height } = this.size;
@@ -9405,8 +9695,11 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9405
9695
  ...json,
9406
9696
  props: {
9407
9697
  style: this.style.toJSON(),
9408
- shadow: this.shadow.toJSON(),
9698
+ text: this.text.toJSON(),
9699
+ geometry: this.geometry.toJSON(),
9700
+ fill: this.fill.toJSON(),
9409
9701
  outline: this.outline.toJSON(),
9702
+ shadow: this.shadow.toJSON(),
9410
9703
  ...json.props
9411
9704
  }
9412
9705
  };
@@ -10071,12 +10364,12 @@ exports.Image2D = class Image2D extends exports.Element2D {
10071
10364
  __decorateClass$i([
10072
10365
  protectedProperty()
10073
10366
  ], exports.Image2D.prototype, "texture", 2);
10074
- __decorateClass$i([
10075
- property()
10076
- ], exports.Image2D.prototype, "srcRect", 2);
10077
10367
  __decorateClass$i([
10078
10368
  property({ default: "" })
10079
10369
  ], exports.Image2D.prototype, "src", 2);
10370
+ __decorateClass$i([
10371
+ property()
10372
+ ], exports.Image2D.prototype, "srcRect", 2);
10080
10373
  __decorateClass$i([
10081
10374
  property({ default: false })
10082
10375
  ], exports.Image2D.prototype, "gif", 2);
@@ -10176,7 +10469,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
10176
10469
  measureDom;
10177
10470
  fonts;
10178
10471
  texture = new CanvasTexture();
10179
- text = new modernText.Text();
10472
+ _baseText = new modernText.Text();
10180
10473
  measureResult;
10181
10474
  _subTextsCount = 0;
10182
10475
  constructor(properties, children = []) {
@@ -10203,12 +10496,12 @@ exports.Text2D = class Text2D extends TextureRect2D {
10203
10496
  }
10204
10497
  }
10205
10498
  _updateText() {
10206
- this.text.style = this.style.toJSON();
10207
- this.text.content = this.content ?? "";
10208
- this.text.effects = this.effects;
10209
- this.text.fonts = this.fonts;
10210
- this.text.measureDom = this.measureDom;
10211
- this.text.requestUpdate();
10499
+ this._baseText.style = this.style.toJSON();
10500
+ this._baseText.content = this.content ?? "";
10501
+ this._baseText.effects = this.effects;
10502
+ this._baseText.fonts = this.fonts;
10503
+ this._baseText.measureDom = this.measureDom;
10504
+ this._baseText.requestUpdate();
10212
10505
  }
10213
10506
  _updateStyleProperty(key, value, oldValue) {
10214
10507
  switch (key) {
@@ -10261,7 +10554,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
10261
10554
  }
10262
10555
  measure() {
10263
10556
  this._updateText();
10264
- return this.text.measure();
10557
+ return this._baseText.measure();
10265
10558
  }
10266
10559
  updateMeasure() {
10267
10560
  this.measureResult = this.measure();
@@ -10313,7 +10606,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
10313
10606
  if (onText2DRender) {
10314
10607
  onText2DRender();
10315
10608
  } else {
10316
- this.text.render({
10609
+ this._baseText.render({
10317
10610
  pixelRatio: this.texture.pixelRatio,
10318
10611
  view: this.texture.source
10319
10612
  });
@@ -13630,7 +13923,12 @@ exports.Assets = Assets;
13630
13923
  exports.AudioPipeline = AudioPipeline;
13631
13924
  exports.AudioProcessor = AudioProcessor;
13632
13925
  exports.AudioSpectrum = AudioSpectrum;
13926
+ exports.BaseElement2DFill = BaseElement2DFill;
13927
+ exports.BaseElement2DGeometry = BaseElement2DGeometry;
13928
+ exports.BaseElement2DOutline = BaseElement2DOutline;
13929
+ exports.BaseElement2DShadow = BaseElement2DShadow;
13633
13930
  exports.BaseElement2DStyle = BaseElement2DStyle;
13931
+ exports.BaseElement2DText = BaseElement2DText;
13634
13932
  exports.CanvasContext = CanvasContext;
13635
13933
  exports.CanvasItemEditor = CanvasItemEditor;
13636
13934
  exports.CanvasTexture = CanvasTexture;