modern-canvas 0.4.22 → 0.4.24

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
 
@@ -7083,7 +7081,7 @@ class CanvasContext extends modernPath2d.Path2D {
7083
7081
  miterLimit;
7084
7082
  _defaultStyle = Texture2D.EMPTY;
7085
7083
  _draws = [];
7086
- stroke() {
7084
+ stroke(options) {
7087
7085
  let texture = this._defaultStyle;
7088
7086
  if (this.strokeStyle) {
7089
7087
  if (this.strokeStyle instanceof Texture2D) {
@@ -7094,6 +7092,7 @@ class CanvasContext extends modernPath2d.Path2D {
7094
7092
  }
7095
7093
  if (this.curves.length) {
7096
7094
  this._draws.push({
7095
+ ...options,
7097
7096
  type: "stroke",
7098
7097
  path: new modernPath2d.Path2D(this),
7099
7098
  texture,
@@ -7115,7 +7114,7 @@ class CanvasContext extends modernPath2d.Path2D {
7115
7114
  strokeRect(x, y, width, height) {
7116
7115
  this.rect(x, y, width, height).stroke();
7117
7116
  }
7118
- fill() {
7117
+ fill(options) {
7119
7118
  let texture = this._defaultStyle;
7120
7119
  if (this.fillStyle) {
7121
7120
  if (this.fillStyle instanceof Texture2D) {
@@ -7125,6 +7124,7 @@ class CanvasContext extends modernPath2d.Path2D {
7125
7124
  }
7126
7125
  }
7127
7126
  this._draws.push({
7127
+ ...options,
7128
7128
  type: "fill",
7129
7129
  path: new modernPath2d.Path2D(this),
7130
7130
  texture,
@@ -7184,13 +7184,14 @@ class CanvasContext extends modernPath2d.Path2D {
7184
7184
  let indices = [];
7185
7185
  let uvs = [];
7186
7186
  let texture;
7187
- const push = (type) => {
7187
+ const push = (draw) => {
7188
7188
  batchables.push({
7189
- type,
7190
7189
  vertices,
7191
7190
  indices,
7192
7191
  uvs,
7193
- texture
7192
+ texture,
7193
+ type: draw.type,
7194
+ disableWrapMode: draw.disableWrapMode
7194
7195
  });
7195
7196
  vertices = [];
7196
7197
  indices = [];
@@ -7201,14 +7202,15 @@ class CanvasContext extends modernPath2d.Path2D {
7201
7202
  const draw = this._draws[i];
7202
7203
  const prev = this._draws[i - 1];
7203
7204
  if (vertices.length && prev && prev?.type !== draw.type) {
7204
- push(prev.type);
7205
+ push(prev);
7205
7206
  }
7206
7207
  const oldTexture = texture;
7207
7208
  if (!oldTexture) {
7208
7209
  texture = draw.texture;
7209
7210
  }
7210
7211
  if (vertices.length && oldTexture !== draw.texture && !oldTexture?.is(draw.texture)) {
7211
- push(draw.type);
7212
+ push(draw);
7213
+ texture = draw.texture;
7212
7214
  }
7213
7215
  const start = vertices.length;
7214
7216
  if (draw.type === "fill") {
@@ -7230,20 +7232,20 @@ class CanvasContext extends modernPath2d.Path2D {
7230
7232
  }
7231
7233
  const last = this._draws[this._draws.length - 1];
7232
7234
  if (last && vertices.length) {
7233
- push(last.type);
7235
+ push(last);
7234
7236
  }
7235
7237
  return batchables;
7236
7238
  }
7237
7239
  }
7238
7240
 
7239
- var __defProp$v = Object.defineProperty;
7241
+ var __defProp$y = Object.defineProperty;
7240
7242
  var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
7241
- var __decorateClass$D = (decorators, target, key, kind) => {
7243
+ var __decorateClass$G = (decorators, target, key, kind) => {
7242
7244
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
7243
7245
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7244
7246
  if (decorator = decorators[i])
7245
7247
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7246
- if (kind && result) __defProp$v(target, key, result);
7248
+ if (kind && result) __defProp$y(target, key, result);
7247
7249
  return result;
7248
7250
  };
7249
7251
  exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
@@ -7258,7 +7260,6 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
7258
7260
  return this._globalOpacity ?? 1;
7259
7261
  }
7260
7262
  _modulate = new Color(4294967295);
7261
- _backgroundImage;
7262
7263
  // Batch render
7263
7264
  context = new CanvasContext();
7264
7265
  _resetContext = true;
@@ -7405,19 +7406,19 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
7405
7406
  super._render(renderer);
7406
7407
  }
7407
7408
  };
7408
- __decorateClass$D([
7409
+ __decorateClass$G([
7409
7410
  property()
7410
7411
  ], exports.CanvasItem.prototype, "modulate", 2);
7411
- __decorateClass$D([
7412
+ __decorateClass$G([
7412
7413
  property()
7413
7414
  ], exports.CanvasItem.prototype, "blendMode", 2);
7414
- __decorateClass$D([
7415
+ __decorateClass$G([
7415
7416
  protectedProperty({ default: true })
7416
7417
  ], exports.CanvasItem.prototype, "visible", 2);
7417
- __decorateClass$D([
7418
+ __decorateClass$G([
7418
7419
  protectedProperty({ default: 1 })
7419
7420
  ], exports.CanvasItem.prototype, "opacity", 2);
7420
- exports.CanvasItem = __decorateClass$D([
7421
+ exports.CanvasItem = __decorateClass$G([
7421
7422
  customNode("CanvasItem")
7422
7423
  ], exports.CanvasItem);
7423
7424
 
@@ -7447,14 +7448,14 @@ class RenderStack {
7447
7448
  }
7448
7449
  }
7449
7450
 
7450
- var __defProp$u = Object.defineProperty;
7451
+ var __defProp$x = Object.defineProperty;
7451
7452
  var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7452
- var __decorateClass$C = (decorators, target, key, kind) => {
7453
+ var __decorateClass$F = (decorators, target, key, kind) => {
7453
7454
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7454
7455
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7455
7456
  if (decorator = decorators[i])
7456
7457
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7457
- if (kind && result) __defProp$u(target, key, result);
7458
+ if (kind && result) __defProp$x(target, key, result);
7458
7459
  return result;
7459
7460
  };
7460
7461
  exports.Timeline = class Timeline extends exports.Node {
@@ -7499,29 +7500,29 @@ exports.Timeline = class Timeline extends exports.Node {
7499
7500
  this.addTime(delta);
7500
7501
  }
7501
7502
  };
7502
- __decorateClass$C([
7503
+ __decorateClass$F([
7503
7504
  property({ default: 0 })
7504
7505
  ], exports.Timeline.prototype, "startTime", 2);
7505
- __decorateClass$C([
7506
+ __decorateClass$F([
7506
7507
  property({ default: 0 })
7507
7508
  ], exports.Timeline.prototype, "currentTime", 2);
7508
- __decorateClass$C([
7509
+ __decorateClass$F([
7509
7510
  property({ default: Number.MAX_SAFE_INTEGER })
7510
7511
  ], exports.Timeline.prototype, "endTime", 2);
7511
- __decorateClass$C([
7512
+ __decorateClass$F([
7512
7513
  property({ default: false })
7513
7514
  ], exports.Timeline.prototype, "loop", 2);
7514
- exports.Timeline = __decorateClass$C([
7515
+ exports.Timeline = __decorateClass$F([
7515
7516
  customNode("Timeline")
7516
7517
  ], exports.Timeline);
7517
7518
 
7518
- var __defProp$t = Object.defineProperty;
7519
- var __decorateClass$B = (decorators, target, key, kind) => {
7519
+ var __defProp$w = Object.defineProperty;
7520
+ var __decorateClass$E = (decorators, target, key, kind) => {
7520
7521
  var result = void 0 ;
7521
7522
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7522
7523
  if (decorator = decorators[i])
7523
7524
  result = (decorator(target, key, result) ) || result;
7524
- if (result) __defProp$t(target, key, result);
7525
+ if (result) __defProp$w(target, key, result);
7525
7526
  return result;
7526
7527
  };
7527
7528
  class SceneTree extends MainLoop {
@@ -7594,18 +7595,18 @@ class SceneTree extends MainLoop {
7594
7595
  this.input.removeEventListeners();
7595
7596
  }
7596
7597
  }
7597
- __decorateClass$B([
7598
+ __decorateClass$E([
7598
7599
  property({ default: false })
7599
7600
  ], SceneTree.prototype, "processPaused");
7600
- __decorateClass$B([
7601
+ __decorateClass$E([
7601
7602
  property()
7602
7603
  ], SceneTree.prototype, "backgroundColor");
7603
- __decorateClass$B([
7604
+ __decorateClass$E([
7604
7605
  protectedProperty({ default: false })
7605
7606
  ], SceneTree.prototype, "debug");
7606
7607
 
7607
7608
  var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7608
- var __decorateClass$A = (decorators, target, key, kind) => {
7609
+ var __decorateClass$D = (decorators, target, key, kind) => {
7609
7610
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7610
7611
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7611
7612
  if (decorator = decorators[i])
@@ -7618,7 +7619,7 @@ exports.Transition = class Transition extends exports.Effect {
7618
7619
  this.setProperties(properties).append(children);
7619
7620
  }
7620
7621
  };
7621
- exports.Transition = __decorateClass$A([
7622
+ exports.Transition = __decorateClass$D([
7622
7623
  customNode("Transition", {
7623
7624
  effectMode: "transition",
7624
7625
  processMode: "pausable",
@@ -7626,15 +7627,15 @@ exports.Transition = __decorateClass$A([
7626
7627
  })
7627
7628
  ], exports.Transition);
7628
7629
 
7629
- var __defProp$s = Object.defineProperty;
7630
+ var __defProp$v = Object.defineProperty;
7630
7631
  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) => {
7632
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7633
+ var __decorateClass$C = (decorators, target, key, kind) => {
7633
7634
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7634
7635
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7635
7636
  if (decorator = decorators[i])
7636
7637
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7637
- if (kind && result) __defProp$s(target, key, result);
7638
+ if (kind && result) __defProp$v(target, key, result);
7638
7639
  return result;
7639
7640
  };
7640
7641
  var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -7740,25 +7741,25 @@ void main(void) {
7740
7741
  }`,
7741
7742
  frag: frag$2
7742
7743
  }));
7743
- __decorateClass$z([
7744
+ __decorateClass$C([
7744
7745
  property({ default: 4 })
7745
7746
  ], exports.GaussianBlurEffect.prototype, "strength", 2);
7746
- __decorateClass$z([
7747
+ __decorateClass$C([
7747
7748
  property({ default: 3 })
7748
7749
  ], exports.GaussianBlurEffect.prototype, "quality", 2);
7749
- exports.GaussianBlurEffect = __decorateClass$z([
7750
+ exports.GaussianBlurEffect = __decorateClass$C([
7750
7751
  customNode("GaussianBlurEffect")
7751
7752
  ], exports.GaussianBlurEffect);
7752
7753
 
7753
- var __defProp$r = Object.defineProperty;
7754
+ var __defProp$u = Object.defineProperty;
7754
7755
  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) => {
7756
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7757
+ var __decorateClass$B = (decorators, target, key, kind) => {
7757
7758
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7758
7759
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7759
7760
  if (decorator = decorators[i])
7760
7761
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7761
- if (kind && result) __defProp$r(target, key, result);
7762
+ if (kind && result) __defProp$u(target, key, result);
7762
7763
  return result;
7763
7764
  };
7764
7765
  var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
@@ -7822,34 +7823,34 @@ void main(void) {
7822
7823
  gl_FragColor = sample;
7823
7824
  }`
7824
7825
  }));
7825
- __decorateClass$y([
7826
+ __decorateClass$B([
7826
7827
  property({ default: 0 })
7827
7828
  ], exports.DropShadowEffect.prototype, "color", 2);
7828
- __decorateClass$y([
7829
+ __decorateClass$B([
7829
7830
  property({ default: 4 })
7830
7831
  ], exports.DropShadowEffect.prototype, "blur", 2);
7831
- __decorateClass$y([
7832
+ __decorateClass$B([
7832
7833
  property({ default: 4 })
7833
7834
  ], exports.DropShadowEffect.prototype, "offsetX", 2);
7834
- __decorateClass$y([
7835
+ __decorateClass$B([
7835
7836
  property({ default: 4 })
7836
7837
  ], exports.DropShadowEffect.prototype, "offsetY", 2);
7837
- __decorateClass$y([
7838
+ __decorateClass$B([
7838
7839
  property({ default: false })
7839
7840
  ], exports.DropShadowEffect.prototype, "shadowOnly", 2);
7840
- exports.DropShadowEffect = __decorateClass$y([
7841
+ exports.DropShadowEffect = __decorateClass$B([
7841
7842
  customNode("DropShadowEffect")
7842
7843
  ], exports.DropShadowEffect);
7843
7844
 
7844
- var __defProp$q = Object.defineProperty;
7845
+ var __defProp$t = Object.defineProperty;
7845
7846
  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) => {
7847
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7848
+ var __decorateClass$A = (decorators, target, key, kind) => {
7848
7849
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
7849
7850
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7850
7851
  if (decorator = decorators[i])
7851
7852
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7852
- if (kind && result) __defProp$q(target, key, result);
7853
+ if (kind && result) __defProp$t(target, key, result);
7853
7854
  return result;
7854
7855
  };
7855
7856
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
@@ -7894,22 +7895,22 @@ void main(void) {
7894
7895
  gl_FragColor = vec4(color.rgb * alpha, alpha);
7895
7896
  }`
7896
7897
  }));
7897
- __decorateClass$x([
7898
+ __decorateClass$A([
7898
7899
  property({ default: 5 })
7899
7900
  ], exports.EmbossEffect.prototype, "strength", 2);
7900
- exports.EmbossEffect = __decorateClass$x([
7901
+ exports.EmbossEffect = __decorateClass$A([
7901
7902
  customNode("EmbossEffect")
7902
7903
  ], exports.EmbossEffect);
7903
7904
 
7904
- var __defProp$p = Object.defineProperty;
7905
+ var __defProp$s = Object.defineProperty;
7905
7906
  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) => {
7907
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7908
+ var __decorateClass$z = (decorators, target, key, kind) => {
7908
7909
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
7909
7910
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7910
7911
  if (decorator = decorators[i])
7911
7912
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7912
- if (kind && result) __defProp$p(target, key, result);
7913
+ if (kind && result) __defProp$s(target, key, result);
7913
7914
  return result;
7914
7915
  };
7915
7916
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
@@ -8083,46 +8084,46 @@ void main(void) {
8083
8084
  gl_FragColor.a = texture2D(sampler, coord).a;
8084
8085
  }`
8085
8086
  }));
8086
- __decorateClass$w([
8087
+ __decorateClass$z([
8087
8088
  property({ default: 10 })
8088
8089
  ], exports.GlitchEffect.prototype, "slices", 2);
8089
- __decorateClass$w([
8090
+ __decorateClass$z([
8090
8091
  property({ default: 512 })
8091
8092
  ], exports.GlitchEffect.prototype, "sampleSize", 2);
8092
- __decorateClass$w([
8093
+ __decorateClass$z([
8093
8094
  property({ default: 100 })
8094
8095
  ], exports.GlitchEffect.prototype, "offset", 2);
8095
- __decorateClass$w([
8096
+ __decorateClass$z([
8096
8097
  property({ default: 0 })
8097
8098
  ], exports.GlitchEffect.prototype, "direction", 2);
8098
- __decorateClass$w([
8099
+ __decorateClass$z([
8099
8100
  property({ default: 2 })
8100
8101
  ], exports.GlitchEffect.prototype, "fillMode", 2);
8101
- __decorateClass$w([
8102
+ __decorateClass$z([
8102
8103
  property({ default: 0 })
8103
8104
  ], exports.GlitchEffect.prototype, "seed", 2);
8104
- __decorateClass$w([
8105
+ __decorateClass$z([
8105
8106
  property({ default: [2, 2] })
8106
8107
  ], exports.GlitchEffect.prototype, "red", 2);
8107
- __decorateClass$w([
8108
+ __decorateClass$z([
8108
8109
  property({ default: [-10, 4] })
8109
8110
  ], exports.GlitchEffect.prototype, "green", 2);
8110
- __decorateClass$w([
8111
+ __decorateClass$z([
8111
8112
  property({ default: [10, -4] })
8112
8113
  ], exports.GlitchEffect.prototype, "blue", 2);
8113
- exports.GlitchEffect = __decorateClass$w([
8114
+ exports.GlitchEffect = __decorateClass$z([
8114
8115
  customNode("GlitchEffect")
8115
8116
  ], exports.GlitchEffect);
8116
8117
 
8117
- var __defProp$o = Object.defineProperty;
8118
+ var __defProp$r = Object.defineProperty;
8118
8119
  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) => {
8120
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8121
+ var __decorateClass$y = (decorators, target, key, kind) => {
8121
8122
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
8122
8123
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8123
8124
  if (decorator = decorators[i])
8124
8125
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8125
- if (kind && result) __defProp$o(target, key, result);
8126
+ if (kind && result) __defProp$r(target, key, result);
8126
8127
  return result;
8127
8128
  };
8128
8129
  var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
@@ -8300,39 +8301,39 @@ void main(void) {
8300
8301
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
8301
8302
  }`
8302
8303
  }));
8303
- __decorateClass$v([
8304
+ __decorateClass$y([
8304
8305
  property({ default: 0 })
8305
8306
  ], exports.GodrayEffect.prototype, "time", 2);
8306
- __decorateClass$v([
8307
+ __decorateClass$y([
8307
8308
  property({ default: 30 })
8308
8309
  ], exports.GodrayEffect.prototype, "angle", 2);
8309
- __decorateClass$v([
8310
+ __decorateClass$y([
8310
8311
  property({ default: 0.5 })
8311
8312
  ], exports.GodrayEffect.prototype, "gain", 2);
8312
- __decorateClass$v([
8313
+ __decorateClass$y([
8313
8314
  property({ default: 2.5 })
8314
8315
  ], exports.GodrayEffect.prototype, "lacunarity", 2);
8315
- __decorateClass$v([
8316
+ __decorateClass$y([
8316
8317
  property({ default: true })
8317
8318
  ], exports.GodrayEffect.prototype, "parallel", 2);
8318
- __decorateClass$v([
8319
+ __decorateClass$y([
8319
8320
  property({ default: [0, 0] })
8320
8321
  ], exports.GodrayEffect.prototype, "center", 2);
8321
- __decorateClass$v([
8322
+ __decorateClass$y([
8322
8323
  property({ default: 1 })
8323
8324
  ], exports.GodrayEffect.prototype, "alpha", 2);
8324
- exports.GodrayEffect = __decorateClass$v([
8325
+ exports.GodrayEffect = __decorateClass$y([
8325
8326
  customNode("GodrayEffect")
8326
8327
  ], exports.GodrayEffect);
8327
8328
 
8328
- var __defProp$n = Object.defineProperty;
8329
+ var __defProp$q = Object.defineProperty;
8329
8330
  var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8330
- var __decorateClass$u = (decorators, target, key, kind) => {
8331
+ var __decorateClass$x = (decorators, target, key, kind) => {
8331
8332
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8332
8333
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8333
8334
  if (decorator = decorators[i])
8334
8335
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8335
- if (kind && result) __defProp$n(target, key, result);
8336
+ if (kind && result) __defProp$q(target, key, result);
8336
8337
  return result;
8337
8338
  };
8338
8339
  const frag$1 = `varying vec2 vUv;
@@ -8423,28 +8424,28 @@ void main() {
8423
8424
  });
8424
8425
  }
8425
8426
  };
8426
- __decorateClass$u([
8427
+ __decorateClass$x([
8427
8428
  property({ default: 4 })
8428
8429
  ], exports.KawaseBlurEffect.prototype, "strength", 2);
8429
- __decorateClass$u([
8430
+ __decorateClass$x([
8430
8431
  property({ default: 3 })
8431
8432
  ], exports.KawaseBlurEffect.prototype, "quality", 2);
8432
- __decorateClass$u([
8433
+ __decorateClass$x([
8433
8434
  property({ default: [1, 1] })
8434
8435
  ], exports.KawaseBlurEffect.prototype, "pixelSize", 2);
8435
- exports.KawaseBlurEffect = __decorateClass$u([
8436
+ exports.KawaseBlurEffect = __decorateClass$x([
8436
8437
  customNode("KawaseBlurEffect")
8437
8438
  ], exports.KawaseBlurEffect);
8438
8439
 
8439
- var __defProp$m = Object.defineProperty;
8440
+ var __defProp$p = Object.defineProperty;
8440
8441
  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) => {
8442
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8443
+ var __decorateClass$w = (decorators, target, key, kind) => {
8443
8444
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8444
8445
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8445
8446
  if (decorator = decorators[i])
8446
8447
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8447
- if (kind && result) __defProp$m(target, key, result);
8448
+ if (kind && result) __defProp$p(target, key, result);
8448
8449
  return result;
8449
8450
  };
8450
8451
  var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
@@ -8533,25 +8534,25 @@ void main(void) {
8533
8534
  }
8534
8535
  }`
8535
8536
  }));
8536
- __decorateClass$t([
8537
+ __decorateClass$w([
8537
8538
  protectedProperty()
8538
8539
  ], exports.MaskEffect.prototype, "texture", 2);
8539
- __decorateClass$t([
8540
+ __decorateClass$w([
8540
8541
  property({ default: "" })
8541
8542
  ], exports.MaskEffect.prototype, "src", 2);
8542
- exports.MaskEffect = __decorateClass$t([
8543
+ exports.MaskEffect = __decorateClass$w([
8543
8544
  customNode("MaskEffect")
8544
8545
  ], exports.MaskEffect);
8545
8546
 
8546
- var __defProp$l = Object.defineProperty;
8547
+ var __defProp$o = Object.defineProperty;
8547
8548
  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) => {
8549
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8550
+ var __decorateClass$v = (decorators, target, key, kind) => {
8550
8551
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8551
8552
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8552
8553
  if (decorator = decorators[i])
8553
8554
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8554
- if (kind && result) __defProp$l(target, key, result);
8555
+ if (kind && result) __defProp$o(target, key, result);
8555
8556
  return result;
8556
8557
  };
8557
8558
  var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -8639,40 +8640,40 @@ void main() {
8639
8640
  };
8640
8641
  __publicField$7(exports.OutlineEffect, "MIN_SAMPLES", 1);
8641
8642
  __publicField$7(exports.OutlineEffect, "MAX_SAMPLES", 100);
8642
- __decorateClass$s([
8643
+ __decorateClass$v([
8643
8644
  property({ default: 0 })
8644
8645
  ], exports.OutlineEffect.prototype, "color", 2);
8645
- __decorateClass$s([
8646
+ __decorateClass$v([
8646
8647
  property({ default: 1 })
8647
8648
  ], exports.OutlineEffect.prototype, "width", 2);
8648
- __decorateClass$s([
8649
+ __decorateClass$v([
8649
8650
  property({ default: "solid" })
8650
8651
  ], exports.OutlineEffect.prototype, "style", 2);
8651
- __decorateClass$s([
8652
+ __decorateClass$v([
8652
8653
  property()
8653
8654
  ], exports.OutlineEffect.prototype, "image", 2);
8654
- __decorateClass$s([
8655
+ __decorateClass$v([
8655
8656
  property({ default: 1 })
8656
8657
  ], exports.OutlineEffect.prototype, "opacity", 2);
8657
- __decorateClass$s([
8658
+ __decorateClass$v([
8658
8659
  property({ default: 0.1 })
8659
8660
  ], exports.OutlineEffect.prototype, "quality", 2);
8660
- __decorateClass$s([
8661
+ __decorateClass$v([
8661
8662
  property({ default: false })
8662
8663
  ], exports.OutlineEffect.prototype, "knockout", 2);
8663
- exports.OutlineEffect = __decorateClass$s([
8664
+ exports.OutlineEffect = __decorateClass$v([
8664
8665
  customNode("OutlineEffect")
8665
8666
  ], exports.OutlineEffect);
8666
8667
 
8667
- var __defProp$k = Object.defineProperty;
8668
+ var __defProp$n = Object.defineProperty;
8668
8669
  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) => {
8670
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8671
+ var __decorateClass$u = (decorators, target, key, kind) => {
8671
8672
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8672
8673
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8673
8674
  if (decorator = decorators[i])
8674
8675
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8675
- if (kind && result) __defProp$k(target, key, result);
8676
+ if (kind && result) __defProp$n(target, key, result);
8676
8677
  return result;
8677
8678
  };
8678
8679
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
@@ -8728,22 +8729,22 @@ void main(void) {
8728
8729
  gl_FragColor = texture2D(sampler, coord);
8729
8730
  }`
8730
8731
  }));
8731
- __decorateClass$r([
8732
+ __decorateClass$u([
8732
8733
  property({ default: 10 })
8733
8734
  ], exports.PixelateEffect.prototype, "strength", 2);
8734
- exports.PixelateEffect = __decorateClass$r([
8735
+ exports.PixelateEffect = __decorateClass$u([
8735
8736
  customNode("PixelateEffect")
8736
8737
  ], exports.PixelateEffect);
8737
8738
 
8738
- var __defProp$j = Object.defineProperty;
8739
+ var __defProp$m = Object.defineProperty;
8739
8740
  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) => {
8741
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8742
+ var __decorateClass$t = (decorators, target, key, kind) => {
8742
8743
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
8743
8744
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8744
8745
  if (decorator = decorators[i])
8745
8746
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8746
- if (kind && result) __defProp$j(target, key, result);
8747
+ if (kind && result) __defProp$m(target, key, result);
8747
8748
  return result;
8748
8749
  };
8749
8750
  var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
@@ -8856,93 +8857,279 @@ void main() {
8856
8857
  gl_FragColor = color;
8857
8858
  }`
8858
8859
  }));
8859
- __decorateClass$q([
8860
+ __decorateClass$t([
8860
8861
  property()
8861
8862
  ], exports.ZoomBlurEffect.prototype, "center", 2);
8862
- __decorateClass$q([
8863
+ __decorateClass$t([
8863
8864
  property({ default: 20 })
8864
8865
  ], exports.ZoomBlurEffect.prototype, "innerRadius", 2);
8865
- __decorateClass$q([
8866
+ __decorateClass$t([
8866
8867
  property({ default: -1 })
8867
8868
  ], exports.ZoomBlurEffect.prototype, "radius", 2);
8868
- __decorateClass$q([
8869
+ __decorateClass$t([
8869
8870
  property({ default: 0.1 })
8870
8871
  ], exports.ZoomBlurEffect.prototype, "strength", 2);
8871
- exports.ZoomBlurEffect = __decorateClass$q([
8872
+ exports.ZoomBlurEffect = __decorateClass$t([
8872
8873
  customNode("ZoomBlurEffect")
8873
8874
  ], exports.ZoomBlurEffect);
8874
8875
 
8875
- var __defProp$i = Object.defineProperty;
8876
- var __decorateClass$p = (decorators, target, key, kind) => {
8876
+ var __defProp$l = Object.defineProperty;
8877
+ var __decorateClass$s = (decorators, target, key, kind) => {
8877
8878
  var result = void 0 ;
8878
8879
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8879
8880
  if (decorator = decorators[i])
8880
8881
  result = (decorator(target, key, result) ) || result;
8881
- if (result) __defProp$i(target, key, result);
8882
+ if (result) __defProp$l(target, key, result);
8882
8883
  return result;
8883
8884
  };
8884
- class BaseElement2DOutline extends CoreObject {
8885
- constructor(parent) {
8885
+ class BaseElement2DFill extends CoreObject {
8886
+ constructor(parent, properties) {
8886
8887
  super();
8887
8888
  this.parent = parent;
8889
+ this.setProperties(properties);
8888
8890
  }
8891
+ _image;
8889
8892
  _updateProperty(key, value, oldValue, declaration) {
8890
8893
  super._updateProperty(key, value, oldValue, declaration);
8891
8894
  switch (key) {
8892
8895
  case "color":
8893
- case "width":
8894
- case "style":
8896
+ case "dpi":
8897
+ case "rotateWithShape":
8898
+ case "tile":
8899
+ this.parent.requestRedraw();
8900
+ break;
8895
8901
  case "image":
8896
- case "opacity":
8897
- this.updateEffect();
8902
+ this._updateImage();
8898
8903
  break;
8899
8904
  }
8900
8905
  }
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");
8906
+ async loadImage() {
8907
+ if (this.image && this.image !== "none") {
8908
+ return await assets.texture.load(this.image);
8909
+ }
8910
+ }
8911
+ async _updateImage() {
8912
+ this._image = await this.loadImage();
8913
+ this.parent.requestRedraw();
8914
+ }
8915
+ canDraw() {
8916
+ return Boolean(
8917
+ this._image || this.color
8918
+ );
8919
+ }
8920
+ draw() {
8921
+ const ctx = this.parent.context;
8922
+ if (this._image) {
8923
+ const { width: imageWidth, height: imageHeight } = this._image;
8924
+ const { width, height } = this.parent.size;
8925
+ const transform = new Transform2D();
8926
+ if (this.tile) {
8927
+ const {
8928
+ translateX = 0,
8929
+ translateY = 0,
8930
+ scaleX = 1,
8931
+ scaleY = 1
8932
+ // flip, TODO
8933
+ // alignment, TODO
8934
+ } = this.tile;
8935
+ transform.scale(1 / imageWidth, 1 / imageHeight).scale(1 / scaleX, 1 / scaleY).translate(-translateX / imageWidth, -translateY / imageHeight);
8936
+ } else if (this.stretch) {
8937
+ const { left = 0, top = 0, right = 0, bottom = 0 } = this.stretch.rect ?? {};
8938
+ const w = Math.abs(1 + (-left + -right)) * width;
8939
+ const h = Math.abs(1 + (-top + -bottom)) * height;
8940
+ const scaleX = 1 / w;
8941
+ const scaleY = 1 / h;
8942
+ const translateX = -left * width * scaleX;
8943
+ const translateY = -top * height * scaleY;
8944
+ transform.scale(scaleX, scaleY).translate(translateX, translateY);
8945
+ } else {
8946
+ transform.scale(1 / width, 1 / height);
8908
8947
  }
8909
- effect.setProperties(this.getProperties());
8948
+ ctx.textureTransform = transform;
8949
+ ctx.fillStyle = this._image;
8950
+ ctx.fill({
8951
+ disableWrapMode: true
8952
+ });
8910
8953
  } else {
8911
- if (effect) {
8912
- this.parent.removeChild(effect);
8954
+ ctx.fillStyle = this.color;
8955
+ ctx.fill();
8956
+ }
8957
+ }
8958
+ }
8959
+ __decorateClass$s([
8960
+ property()
8961
+ ], BaseElement2DFill.prototype, "color");
8962
+ __decorateClass$s([
8963
+ property()
8964
+ ], BaseElement2DFill.prototype, "image");
8965
+ __decorateClass$s([
8966
+ property()
8967
+ ], BaseElement2DFill.prototype, "dpi");
8968
+ __decorateClass$s([
8969
+ property()
8970
+ ], BaseElement2DFill.prototype, "rotateWithShape");
8971
+ __decorateClass$s([
8972
+ property()
8973
+ ], BaseElement2DFill.prototype, "tile");
8974
+ __decorateClass$s([
8975
+ property()
8976
+ ], BaseElement2DFill.prototype, "stretch");
8977
+
8978
+ var __defProp$k = Object.defineProperty;
8979
+ var __decorateClass$r = (decorators, target, key, kind) => {
8980
+ var result = void 0 ;
8981
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8982
+ if (decorator = decorators[i])
8983
+ result = (decorator(target, key, result) ) || result;
8984
+ if (result) __defProp$k(target, key, result);
8985
+ return result;
8986
+ };
8987
+ class BaseElement2DGeometry extends CoreObject {
8988
+ constructor(parent, properties) {
8989
+ super();
8990
+ this.parent = parent;
8991
+ this.setProperties(properties);
8992
+ this._updatePath2DSet();
8993
+ }
8994
+ _path2DSet = new modernPath2d.Path2DSet();
8995
+ _updateProperty(key, value, oldValue, declaration) {
8996
+ super._updateProperty(key, value, oldValue, declaration);
8997
+ switch (key) {
8998
+ case "svg":
8999
+ case "data":
9000
+ case "viewBox":
9001
+ this._updatePath2DSet();
9002
+ this.parent.requestRedraw();
9003
+ break;
9004
+ }
9005
+ }
9006
+ _updatePath2DSet() {
9007
+ let viewBox;
9008
+ if (this.svg) {
9009
+ const dom = modernPath2d.svgToDOM(this.svg);
9010
+ this._path2DSet = modernPath2d.svgToPath2DSet(dom);
9011
+ viewBox = this._path2DSet.viewBox ?? this.viewBox;
9012
+ } else {
9013
+ viewBox = this.viewBox;
9014
+ this.data.forEach((path, i) => {
9015
+ const { data, ...style } = path;
9016
+ const path2D = new modernPath2d.Path2D();
9017
+ path2D.style = style;
9018
+ path2D.addData(data);
9019
+ this._path2DSet.paths[i] = path2D;
9020
+ });
9021
+ }
9022
+ const [x, y, w, h] = viewBox;
9023
+ this._path2DSet.paths.forEach((path) => {
9024
+ path.applyTransform(new modernPath2d.Matrix3().translate(-x, -y).scale(1 / w, 1 / h));
9025
+ });
9026
+ }
9027
+ draw() {
9028
+ if (this._path2DSet.paths.length) {
9029
+ const ctx = this.parent.context;
9030
+ const { width, height } = this.parent.size;
9031
+ this._path2DSet.paths.forEach((path) => {
9032
+ ctx.addPath(path.clone().applyTransform(new modernPath2d.Matrix3().scale(width, height)));
9033
+ });
9034
+ } else {
9035
+ this.drawRect();
9036
+ }
9037
+ }
9038
+ drawRect() {
9039
+ const ctx = this.parent.context;
9040
+ const { width, height } = this.parent.size;
9041
+ const { borderRadius } = this.parent.style;
9042
+ if (width && height) {
9043
+ if (borderRadius) {
9044
+ ctx.roundRect(0, 0, width, height, borderRadius);
9045
+ } else {
9046
+ ctx.rect(0, 0, width, height);
8913
9047
  }
8914
9048
  }
8915
9049
  }
8916
9050
  }
8917
- __decorateClass$p([
8918
- property({ default: "#000000" })
9051
+ __decorateClass$r([
9052
+ property()
9053
+ ], BaseElement2DGeometry.prototype, "name");
9054
+ __decorateClass$r([
9055
+ property()
9056
+ ], BaseElement2DGeometry.prototype, "svg");
9057
+ __decorateClass$r([
9058
+ property({ default: [0, 0, 1, 1] })
9059
+ ], BaseElement2DGeometry.prototype, "viewBox");
9060
+ __decorateClass$r([
9061
+ property({ default: [] })
9062
+ ], BaseElement2DGeometry.prototype, "data");
9063
+
9064
+ var __defProp$j = Object.defineProperty;
9065
+ var __decorateClass$q = (decorators, target, key, kind) => {
9066
+ var result = void 0 ;
9067
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9068
+ if (decorator = decorators[i])
9069
+ result = (decorator(target, key, result) ) || result;
9070
+ if (result) __defProp$j(target, key, result);
9071
+ return result;
9072
+ };
9073
+ class BaseElement2DOutline extends CoreObject {
9074
+ constructor(parent, properties) {
9075
+ super();
9076
+ this.parent = parent;
9077
+ this.setProperties(properties);
9078
+ }
9079
+ _updateProperty(key, value, oldValue, declaration) {
9080
+ super._updateProperty(key, value, oldValue, declaration);
9081
+ switch (key) {
9082
+ case "color":
9083
+ case "width":
9084
+ case "style":
9085
+ case "image":
9086
+ case "opacity":
9087
+ this.parent.requestRedraw();
9088
+ break;
9089
+ }
9090
+ }
9091
+ canDraw() {
9092
+ return Boolean(
9093
+ this.width || this.color
9094
+ );
9095
+ }
9096
+ draw() {
9097
+ const ctx = this.parent.context;
9098
+ ctx.lineWidth = this.width;
9099
+ ctx.strokeStyle = this.color;
9100
+ ctx.stroke();
9101
+ }
9102
+ }
9103
+ __decorateClass$q([
9104
+ property({ default: 0 })
8919
9105
  ], BaseElement2DOutline.prototype, "color");
8920
- __decorateClass$p([
9106
+ __decorateClass$q([
8921
9107
  property({ default: 0 })
8922
9108
  ], BaseElement2DOutline.prototype, "width");
8923
- __decorateClass$p([
9109
+ __decorateClass$q([
8924
9110
  property({ default: "solid" })
8925
9111
  ], BaseElement2DOutline.prototype, "style");
8926
- __decorateClass$p([
9112
+ __decorateClass$q([
8927
9113
  property()
8928
9114
  ], BaseElement2DOutline.prototype, "image");
8929
- __decorateClass$p([
9115
+ __decorateClass$q([
8930
9116
  property({ default: 1 })
8931
9117
  ], BaseElement2DOutline.prototype, "opacity");
8932
9118
 
8933
- var __defProp$h = Object.defineProperty;
8934
- var __decorateClass$o = (decorators, target, key, kind) => {
9119
+ var __defProp$i = Object.defineProperty;
9120
+ var __decorateClass$p = (decorators, target, key, kind) => {
8935
9121
  var result = void 0 ;
8936
9122
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8937
9123
  if (decorator = decorators[i])
8938
9124
  result = (decorator(target, key, result) ) || result;
8939
- if (result) __defProp$h(target, key, result);
9125
+ if (result) __defProp$i(target, key, result);
8940
9126
  return result;
8941
9127
  };
8942
9128
  class BaseElement2DShadow extends CoreObject {
8943
- constructor(parent) {
9129
+ constructor(parent, properties) {
8944
9130
  super();
8945
9131
  this.parent = parent;
9132
+ this.setProperties(properties);
8946
9133
  }
8947
9134
  _updateProperty(key, value, oldValue, declaration) {
8948
9135
  super._updateProperty(key, value, oldValue, declaration);
@@ -8971,16 +9158,16 @@ class BaseElement2DShadow extends CoreObject {
8971
9158
  }
8972
9159
  }
8973
9160
  }
8974
- __decorateClass$o([
9161
+ __decorateClass$p([
8975
9162
  property({ default: "#000000" })
8976
9163
  ], BaseElement2DShadow.prototype, "color");
8977
- __decorateClass$o([
9164
+ __decorateClass$p([
8978
9165
  property({ default: 0 })
8979
9166
  ], BaseElement2DShadow.prototype, "blur");
8980
- __decorateClass$o([
9167
+ __decorateClass$p([
8981
9168
  property({ default: 0 })
8982
9169
  ], BaseElement2DShadow.prototype, "offsetY");
8983
- __decorateClass$o([
9170
+ __decorateClass$p([
8984
9171
  property({ default: 0 })
8985
9172
  ], BaseElement2DShadow.prototype, "offsetX");
8986
9173
 
@@ -9018,6 +9205,98 @@ for (const key in defaultStyles$1) {
9018
9205
  });
9019
9206
  }
9020
9207
 
9208
+ var __defProp$h = Object.defineProperty;
9209
+ var __decorateClass$o = (decorators, target, key, kind) => {
9210
+ var result = void 0 ;
9211
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9212
+ if (decorator = decorators[i])
9213
+ result = (decorator(target, key, result) ) || result;
9214
+ if (result) __defProp$h(target, key, result);
9215
+ return result;
9216
+ };
9217
+ class BaseElement2DText extends CoreObject {
9218
+ constructor(parent, properties) {
9219
+ super();
9220
+ this.parent = parent;
9221
+ this.setProperties(properties);
9222
+ }
9223
+ effects;
9224
+ measureDom;
9225
+ fonts;
9226
+ texture = new CanvasTexture();
9227
+ baseText = new modernText.Text();
9228
+ measureResult;
9229
+ _updateProperty(key, value, oldValue, declaration) {
9230
+ super._updateProperty(key, value, oldValue, declaration);
9231
+ switch (key) {
9232
+ case "content":
9233
+ case "effects":
9234
+ case "measureDom":
9235
+ case "fonts":
9236
+ case "split":
9237
+ this.parent.requestRedraw();
9238
+ break;
9239
+ }
9240
+ }
9241
+ _updateText() {
9242
+ this.baseText.style = {
9243
+ justifyContent: "center",
9244
+ alignItems: "center",
9245
+ textAlign: "center",
9246
+ ...this.parent.style.toJSON()
9247
+ };
9248
+ this.baseText.content = this.content ?? "";
9249
+ this.baseText.effects = this.effects;
9250
+ this.baseText.fonts = this.fonts;
9251
+ this.baseText.measureDom = this.measureDom;
9252
+ this.baseText.requestUpdate();
9253
+ }
9254
+ measure() {
9255
+ this._updateText();
9256
+ return this.baseText.measure();
9257
+ }
9258
+ updateMeasure() {
9259
+ this.measureResult = this.measure();
9260
+ const textWidth = this.measureResult.boundingBox.width;
9261
+ const textHeight = this.measureResult.boundingBox.height;
9262
+ const { left, top, width, height = textHeight } = this.parent.style;
9263
+ this.parent.position.x = left + Math.min(0, ((width || textWidth) - textWidth) / 2);
9264
+ this.parent.position.y = top + Math.min(0, ((height || textHeight) - textHeight) / 2);
9265
+ this.parent.size.width = textWidth;
9266
+ this.parent.size.height = textHeight;
9267
+ return this;
9268
+ }
9269
+ canDraw() {
9270
+ return Boolean(
9271
+ this.content && this.texture?.valid
9272
+ );
9273
+ }
9274
+ draw() {
9275
+ const ctx = this.parent.context;
9276
+ this.baseText.render({
9277
+ pixelRatio: this.texture.pixelRatio,
9278
+ view: this.texture.source
9279
+ });
9280
+ this.texture.requestUpload();
9281
+ const { width, height } = this.parent.size;
9282
+ ctx.fillStyle = this.texture;
9283
+ ctx.textureTransform = new Transform2D().scale(1 / width, 1 / height);
9284
+ ctx.fill();
9285
+ }
9286
+ }
9287
+ __decorateClass$o([
9288
+ property({ default: "" })
9289
+ ], BaseElement2DText.prototype, "content");
9290
+ __decorateClass$o([
9291
+ property()
9292
+ ], BaseElement2DText.prototype, "effects");
9293
+ __decorateClass$o([
9294
+ protectedProperty()
9295
+ ], BaseElement2DText.prototype, "measureDom");
9296
+ __decorateClass$o([
9297
+ protectedProperty()
9298
+ ], BaseElement2DText.prototype, "fonts");
9299
+
9021
9300
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
9022
9301
  var __decorateClass$n = (decorators, target, key, kind) => {
9023
9302
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
@@ -9125,8 +9404,41 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9125
9404
  this._style?.off("updateProperty", cb);
9126
9405
  this._style = style;
9127
9406
  }
9128
- shadow = new BaseElement2DShadow(this);
9129
- outline = new BaseElement2DOutline(this);
9407
+ _text = new BaseElement2DText(this);
9408
+ get text() {
9409
+ return this._text;
9410
+ }
9411
+ set text(value) {
9412
+ this._text.setProperties(value);
9413
+ }
9414
+ _geometry = new BaseElement2DGeometry(this);
9415
+ get geometry() {
9416
+ return this._geometry;
9417
+ }
9418
+ set geometry(value) {
9419
+ this._geometry.setProperties(value);
9420
+ }
9421
+ _fill = new BaseElement2DFill(this);
9422
+ get fill() {
9423
+ return this._fill;
9424
+ }
9425
+ set fill(value) {
9426
+ this._fill.setProperties(value);
9427
+ }
9428
+ _outline = new BaseElement2DOutline(this);
9429
+ get outline() {
9430
+ return this._outline;
9431
+ }
9432
+ set outline(value) {
9433
+ this._outline.setProperties(value);
9434
+ }
9435
+ _shadow = new BaseElement2DShadow(this);
9436
+ get shadow() {
9437
+ return this._shadow;
9438
+ }
9439
+ set shadow(value) {
9440
+ this._shadow.setProperties(value);
9441
+ }
9130
9442
  constructor(properties, nodes = []) {
9131
9443
  super();
9132
9444
  this._updateStyleProperty = this._updateStyleProperty.bind(this);
@@ -9135,10 +9447,21 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9135
9447
  }
9136
9448
  setProperties(properties) {
9137
9449
  if (properties) {
9138
- const { style, shadow, outline, ...restProperties } = properties;
9450
+ const {
9451
+ style,
9452
+ text,
9453
+ geometry,
9454
+ fill,
9455
+ outline,
9456
+ shadow,
9457
+ ...restProperties
9458
+ } = properties;
9139
9459
  style && this.style.setProperties(style);
9140
- shadow && this.shadow.setProperties(shadow);
9460
+ text && this.text.setProperties(text);
9461
+ geometry && this.geometry.setProperties(geometry);
9462
+ fill && this.fill.setProperties(fill);
9141
9463
  outline && this.outline.setProperties(outline);
9464
+ shadow && this.shadow.setProperties(shadow);
9142
9465
  super.setProperties(restProperties);
9143
9466
  }
9144
9467
  return this;
@@ -9180,12 +9503,6 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9180
9503
  this.requestRelayout();
9181
9504
  break;
9182
9505
  /** draw */
9183
- case "backgroundColor":
9184
- this._updateBackgroundColor();
9185
- break;
9186
- case "backgroundImage":
9187
- this._updateBackgroundImage();
9188
- break;
9189
9506
  case "opacity":
9190
9507
  this.opacity = this.style.opacity;
9191
9508
  break;
@@ -9201,6 +9518,24 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9201
9518
  case "borderRadius":
9202
9519
  this.requestRedraw();
9203
9520
  break;
9521
+ case "backgroundColor":
9522
+ this.fill.color = this.style.backgroundColor;
9523
+ break;
9524
+ case "backgroundImage":
9525
+ this.fill.image = this.style.backgroundImage;
9526
+ break;
9527
+ case "borderStyle":
9528
+ case "outlineStyle":
9529
+ this.outline.style = value;
9530
+ break;
9531
+ case "borderWidth":
9532
+ case "outlineWidth":
9533
+ this.outline.width = value;
9534
+ break;
9535
+ case "borderColor":
9536
+ case "outlineColor":
9537
+ this.outline.color = value;
9538
+ break;
9204
9539
  }
9205
9540
  }
9206
9541
  _updateMaskImage() {
@@ -9220,18 +9555,6 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9220
9555
  }
9221
9556
  }
9222
9557
  }
9223
- _updateBackgroundColor() {
9224
- const backgroundColor = this.style.getComputedBackgroundColor();
9225
- if (this._originalBatchables.length) {
9226
- this.requestRepaint();
9227
- } else if (backgroundColor.a > 0) {
9228
- this.requestRedraw();
9229
- }
9230
- }
9231
- async _updateBackgroundImage() {
9232
- this._backgroundImage = await this.style.loadBackgroundImage();
9233
- this.requestRedraw();
9234
- }
9235
9558
  _updateTransform() {
9236
9559
  const { width, height } = this.size;
9237
9560
  const [originX, originY] = parseCSSTransformOrigin(this.style.transformOrigin);
@@ -9291,65 +9614,33 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9291
9614
  }
9292
9615
  _draw() {
9293
9616
  super._draw();
9294
- this._drawBackground();
9295
- this._drawContent();
9296
- this._drawBorder();
9297
- this._drawOutline();
9298
- }
9299
- _drawBackground() {
9300
- const texture = this._backgroundImage;
9301
- if (texture?.valid) {
9302
- const { width, height } = this.size;
9303
- this.context.fillStyle = texture;
9304
- this.context.textureTransform = new Transform2D().scale(
9305
- 1 / width,
9306
- 1 / height
9307
- );
9308
- this._fillBoundingRect();
9617
+ if (this.text.canDraw()) {
9618
+ this.text.updateMeasure();
9309
9619
  }
9310
- }
9311
- _drawContent() {
9312
- this._fillBoundingRect();
9313
- }
9314
- _drawBorder() {
9315
- if (this.style.borderWidth && this.style.borderStyle !== "none") {
9316
- this.context.lineWidth = this.style.borderWidth;
9317
- this.context.strokeStyle = this.style.borderColor;
9318
- this._strokeBoundingRect();
9620
+ if (this.fill.canDraw()) {
9621
+ this._tree?.log(this.name, "draw fill");
9622
+ this.geometry.draw();
9623
+ this.fill.draw();
9319
9624
  }
9320
- }
9321
- _drawOutline() {
9322
- if (this.style.outlineWidth && this.style.outlineColor !== "none") {
9323
- this.context.lineWidth = this.style.outlineWidth;
9324
- this.context.strokeStyle = this.style.outlineColor;
9325
- this._strokeBoundingRect();
9625
+ if (this.outline.canDraw()) {
9626
+ this._tree?.log(this.name, "draw outline");
9627
+ this.geometry.draw();
9628
+ this.outline.draw();
9326
9629
  }
9327
- }
9328
- _drawBoundingRect() {
9329
- const { borderRadius } = this.style;
9330
- const { width, height } = this.size;
9331
- if (width && height) {
9332
- if (borderRadius) {
9333
- this.context.roundRect(0, 0, width, height, borderRadius);
9334
- } else {
9335
- this.context.rect(0, 0, width, height);
9336
- }
9630
+ if (this.text.canDraw()) {
9631
+ this._tree?.log(this.name, "draw text");
9632
+ this.geometry.drawRect();
9633
+ this.text.draw();
9337
9634
  }
9635
+ this._drawContent();
9338
9636
  }
9339
- _fillBoundingRect() {
9340
- this._drawBoundingRect();
9341
- this.context.fill();
9342
- }
9343
- _strokeBoundingRect() {
9344
- this._drawBoundingRect();
9345
- this.context.stroke();
9637
+ _drawContent() {
9346
9638
  }
9347
9639
  _repaint(batchables) {
9348
9640
  const colorMatrix = parseCSSFilter(this.style.filter);
9349
9641
  return super._repaint(batchables).map((batchable) => {
9350
9642
  return {
9351
9643
  ...batchable,
9352
- backgroundColor: this.style.getComputedBackgroundColor().abgr,
9353
9644
  colorMatrix: colorMatrix.toMatrix4().toArray(true),
9354
9645
  colorMatrixOffset: colorMatrix.toVector4().toArray()
9355
9646
  };
@@ -9366,13 +9657,6 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9366
9657
  this._input(event, key);
9367
9658
  }
9368
9659
  }
9369
- _pointerEntering = false;
9370
- _pointerEntered() {
9371
- this._pointerEntering = true;
9372
- }
9373
- _pointerExited() {
9374
- if (this._pointerEntering) ;
9375
- }
9376
9660
  // eslint-disable-next-line unused-imports/no-unused-vars
9377
9661
  _pointerInput(point, key) {
9378
9662
  const { width, height } = this.size;
@@ -9405,8 +9689,11 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
9405
9689
  ...json,
9406
9690
  props: {
9407
9691
  style: this.style.toJSON(),
9408
- shadow: this.shadow.toJSON(),
9692
+ text: this.text.toJSON(),
9693
+ geometry: this.geometry.toJSON(),
9694
+ fill: this.fill.toJSON(),
9409
9695
  outline: this.outline.toJSON(),
9696
+ shadow: this.shadow.toJSON(),
9410
9697
  ...json.props
9411
9698
  }
9412
9699
  };
@@ -10056,7 +10343,8 @@ exports.Image2D = class Image2D extends exports.Element2D {
10056
10343
  const tx = left * width * sx;
10057
10344
  const ty = top * height * sy;
10058
10345
  this.context.textureTransform = new Transform2D().scale(sx, sy).translate(tx, ty);
10059
- super._drawContent();
10346
+ this.geometry.drawRect();
10347
+ this.context.fill();
10060
10348
  }
10061
10349
  }
10062
10350
  _repaint(batchables) {
@@ -10071,12 +10359,12 @@ exports.Image2D = class Image2D extends exports.Element2D {
10071
10359
  __decorateClass$i([
10072
10360
  protectedProperty()
10073
10361
  ], exports.Image2D.prototype, "texture", 2);
10074
- __decorateClass$i([
10075
- property()
10076
- ], exports.Image2D.prototype, "srcRect", 2);
10077
10362
  __decorateClass$i([
10078
10363
  property({ default: "" })
10079
10364
  ], exports.Image2D.prototype, "src", 2);
10365
+ __decorateClass$i([
10366
+ property()
10367
+ ], exports.Image2D.prototype, "srcRect", 2);
10080
10368
  __decorateClass$i([
10081
10369
  property({ default: false })
10082
10370
  ], exports.Image2D.prototype, "gif", 2);
@@ -10098,7 +10386,8 @@ class TextureRect2D extends exports.Element2D {
10098
10386
  1 / width,
10099
10387
  1 / height
10100
10388
  );
10101
- super._drawContent();
10389
+ this.geometry.drawRect();
10390
+ this.context.fill();
10102
10391
  }
10103
10392
  }
10104
10393
  }
@@ -10176,7 +10465,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
10176
10465
  measureDom;
10177
10466
  fonts;
10178
10467
  texture = new CanvasTexture();
10179
- text = new modernText.Text();
10468
+ _baseText = new modernText.Text();
10180
10469
  measureResult;
10181
10470
  _subTextsCount = 0;
10182
10471
  constructor(properties, children = []) {
@@ -10203,12 +10492,12 @@ exports.Text2D = class Text2D extends TextureRect2D {
10203
10492
  }
10204
10493
  }
10205
10494
  _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();
10495
+ this._baseText.style = this.style.toJSON();
10496
+ this._baseText.content = this.content ?? "";
10497
+ this._baseText.effects = this.effects;
10498
+ this._baseText.fonts = this.fonts;
10499
+ this._baseText.measureDom = this.measureDom;
10500
+ this._baseText.requestUpdate();
10212
10501
  }
10213
10502
  _updateStyleProperty(key, value, oldValue) {
10214
10503
  switch (key) {
@@ -10261,7 +10550,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
10261
10550
  }
10262
10551
  measure() {
10263
10552
  this._updateText();
10264
- return this.text.measure();
10553
+ return this._baseText.measure();
10265
10554
  }
10266
10555
  updateMeasure() {
10267
10556
  this.measureResult = this.measure();
@@ -10313,7 +10602,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
10313
10602
  if (onText2DRender) {
10314
10603
  onText2DRender();
10315
10604
  } else {
10316
- this.text.render({
10605
+ this._baseText.render({
10317
10606
  pixelRatio: this.texture.pixelRatio,
10318
10607
  view: this.texture.source
10319
10608
  });
@@ -13630,7 +13919,12 @@ exports.Assets = Assets;
13630
13919
  exports.AudioPipeline = AudioPipeline;
13631
13920
  exports.AudioProcessor = AudioProcessor;
13632
13921
  exports.AudioSpectrum = AudioSpectrum;
13922
+ exports.BaseElement2DFill = BaseElement2DFill;
13923
+ exports.BaseElement2DGeometry = BaseElement2DGeometry;
13924
+ exports.BaseElement2DOutline = BaseElement2DOutline;
13925
+ exports.BaseElement2DShadow = BaseElement2DShadow;
13633
13926
  exports.BaseElement2DStyle = BaseElement2DStyle;
13927
+ exports.BaseElement2DText = BaseElement2DText;
13634
13928
  exports.CanvasContext = CanvasContext;
13635
13929
  exports.CanvasItemEditor = CanvasItemEditor;
13636
13930
  exports.CanvasTexture = CanvasTexture;