modern-canvas 0.8.10 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -484,7 +484,7 @@ const TOUCH_TO_POINTER = {
484
484
  touchmove: "pointermove",
485
485
  touchcancel: "pointercancel"
486
486
  };
487
- class Input extends modernIdoc.EventEmitter {
487
+ class Input extends modernIdoc.Observable {
488
488
  /**
489
489
  * Current event
490
490
  */
@@ -874,167 +874,14 @@ class Input extends modernIdoc.EventEmitter {
874
874
  }
875
875
 
876
876
  let IID = 0;
877
- class CoreObject extends modernIdoc.EventEmitter {
877
+ class CoreObject extends modernIdoc.Reactivable {
878
878
  instanceId = ++IID;
879
- _propertyAccessor;
880
- _properties = /* @__PURE__ */ new Map();
881
- _updatedProperties = /* @__PURE__ */ new Map();
882
- _changedProperties = /* @__PURE__ */ new Set();
883
- _updatingPromise = Promise.resolve();
884
- _updating = false;
885
- useCustomPropertyAccessor(accessor) {
886
- this._propertyAccessor = accessor;
887
- this.getPropertyDeclarations().forEach((declaration, key) => {
888
- const newValue = accessor.get(key, () => void 0);
889
- const oldValue = this._properties.get(key);
890
- if (newValue === void 0) {
891
- if (oldValue !== void 0) {
892
- accessor.set(key, oldValue);
893
- }
894
- } else if (newValue !== oldValue) {
895
- if (declaration.alias && declaration.alias !== key) {
896
- this.setProperty(key, newValue);
897
- } else {
898
- this._properties.set(key, newValue);
899
- }
900
- this._updateProperty(key, newValue, oldValue, declaration);
901
- this.emit("updateProperty", key, newValue, oldValue, declaration);
902
- }
903
- });
904
- return this;
905
- }
906
- getter(key, context) {
907
- if (context?.declaration.protected) {
908
- return this[context.internalKey];
909
- } else {
910
- return this._propertyAccessor ? this._propertyAccessor.get(key, () => this._properties.get(key)) : this._properties.get(key);
911
- }
912
- }
913
- setter(key, value, context) {
914
- if (context?.declaration.protected) {
915
- this[context.internalKey] = value;
916
- } else {
917
- if (this._propertyAccessor) {
918
- this._propertyAccessor.set(key, value);
919
- }
920
- this._properties.set(key, value);
921
- }
879
+ _nextTick() {
880
+ return nextTick();
922
881
  }
923
882
  equal(target) {
924
883
  return Boolean(target && this.instanceId === target.instanceId);
925
884
  }
926
- async _enqueueUpdate() {
927
- this._updating = true;
928
- try {
929
- await this._updatingPromise;
930
- } catch (e) {
931
- Promise.reject(e);
932
- }
933
- await nextTick();
934
- if (!this._updating)
935
- return;
936
- this.update();
937
- this._updating = false;
938
- }
939
- update() {
940
- this._update(this._updatedProperties);
941
- this._updatedProperties = /* @__PURE__ */ new Map();
942
- }
943
- // eslint-disable-next-line unused-imports/no-unused-vars
944
- _update(changed) {
945
- }
946
- // eslint-disable-next-line unused-imports/no-unused-vars
947
- _updateProperty(key, value, oldValue, declaration) {
948
- }
949
- isDirty(key) {
950
- return this._updatedProperties.has(key);
951
- }
952
- getPropertyDeclarations() {
953
- return modernIdoc.getDeclarations(this.constructor);
954
- }
955
- getPropertyDeclaration(key) {
956
- return this.getPropertyDeclarations().get(key);
957
- }
958
- getProperty(key) {
959
- return this[key];
960
- }
961
- setProperty(key, value) {
962
- this[key] = value;
963
- return this;
964
- }
965
- getProperties(keys) {
966
- const properties = {};
967
- for (const [name, property] of this.getPropertyDeclarations()) {
968
- if (!property.protected && !property.alias && (!keys || keys.includes(name))) {
969
- properties[name] = this.getProperty(name);
970
- }
971
- }
972
- return properties;
973
- }
974
- setProperties(properties) {
975
- if (properties && typeof properties === "object") {
976
- for (const [name] of this.getPropertyDeclarations()) {
977
- if (name in properties) {
978
- this.setProperty(name, properties[name]);
979
- }
980
- }
981
- }
982
- return this;
983
- }
984
- resetProperties() {
985
- for (const [name, property] of this.getPropertyDeclarations()) {
986
- this.setProperty(
987
- name,
988
- typeof property.fallback === "function" ? property.fallback() : property.fallback
989
- );
990
- }
991
- return this;
992
- }
993
- onUpdateProperty(key, newValue, oldValue, declaration) {
994
- this.requestUpdate(key, newValue, oldValue, declaration);
995
- }
996
- requestUpdate(key, newValue, oldValue, declaration) {
997
- if (key !== void 0) {
998
- if (!Object.is(newValue, oldValue)) {
999
- this._updatedProperties.set(key, oldValue);
1000
- this._changedProperties.add(key);
1001
- declaration ??= this.getPropertyDeclaration(key);
1002
- this._updateProperty(key, newValue, oldValue, declaration);
1003
- this.emit("updateProperty", key, newValue, oldValue, declaration);
1004
- } else {
1005
- return;
1006
- }
1007
- }
1008
- if (!this._updating) {
1009
- this._updatingPromise = this._enqueueUpdate();
1010
- }
1011
- }
1012
- toJSON() {
1013
- const json = {};
1014
- this._properties.forEach((value, key) => {
1015
- if (value === void 0) {
1016
- return;
1017
- }
1018
- if (value && typeof value === "object") {
1019
- if ("toJSON" in value && typeof value.toJSON === "function") {
1020
- json[key] = value.toJSON();
1021
- } else if (Array.isArray(value)) {
1022
- json[key] = [...value];
1023
- } else {
1024
- json[key] = { ...value };
1025
- }
1026
- } else {
1027
- json[key] = value;
1028
- }
1029
- });
1030
- return json;
1031
- }
1032
- clone() {
1033
- return new this.constructor(this.toJSON());
1034
- }
1035
- free() {
1036
- this.removeAllListeners();
1037
- }
1038
885
  }
1039
886
 
1040
887
  class RefCounted extends CoreObject {
@@ -1132,7 +979,7 @@ class Color {
1132
979
  }
1133
980
  }
1134
981
 
1135
- class Vector extends modernIdoc.EventEmitter {
982
+ class Vector extends modernIdoc.Observable {
1136
983
  constructor(dim) {
1137
984
  super();
1138
985
  this.dim = dim;
@@ -1284,7 +1131,7 @@ class Vector extends modernIdoc.EventEmitter {
1284
1131
  }
1285
1132
  }
1286
1133
 
1287
- class Matrix extends modernIdoc.EventEmitter {
1134
+ class Matrix extends modernIdoc.Observable {
1288
1135
  constructor(rows, cols, array) {
1289
1136
  super();
1290
1137
  this.rows = rows;
@@ -2251,6 +2098,7 @@ var __decorateClass$Z = (decorators, target, key, kind) => {
2251
2098
  class MainLoop extends CoreObject {
2252
2099
  _starting = false;
2253
2100
  _nextDeltaTime = 0;
2101
+ _startedProcess;
2254
2102
  get starting() {
2255
2103
  return this._starting;
2256
2104
  }
@@ -2264,7 +2112,10 @@ class MainLoop extends CoreObject {
2264
2112
  start(process) {
2265
2113
  if (!this._starting) {
2266
2114
  this._starting = true;
2267
- this.off("process");
2115
+ if (this._startedProcess) {
2116
+ this.off("process", this._startedProcess);
2117
+ }
2118
+ this._startedProcess = process;
2268
2119
  this.on("process", process);
2269
2120
  Ticker.on(this._onNextTick, { sort: 0 });
2270
2121
  }
@@ -2283,8 +2134,8 @@ class MainLoop extends CoreObject {
2283
2134
  this.emit("process", delta);
2284
2135
  }
2285
2136
  }
2286
- free() {
2287
- super.free();
2137
+ destroy() {
2138
+ super.destroy();
2288
2139
  this.stop();
2289
2140
  }
2290
2141
  }
@@ -2383,7 +2234,7 @@ class WebGLModule {
2383
2234
  }
2384
2235
  reset() {
2385
2236
  }
2386
- free() {
2237
+ destroy() {
2387
2238
  }
2388
2239
  }
2389
2240
 
@@ -3560,8 +3411,8 @@ ${gl.getShaderInfoLog(shader)}`);
3560
3411
  viewMatrix: [1, 0, 0, 0, 1, 0, 0, 0, 1]
3561
3412
  };
3562
3413
  }
3563
- free() {
3564
- super.free();
3414
+ destroy() {
3415
+ super.destroy();
3565
3416
  this.bind(null);
3566
3417
  }
3567
3418
  }
@@ -4335,8 +4186,8 @@ class WebGLRenderer extends Renderer {
4335
4186
  flush() {
4336
4187
  this._modules.forEach((module) => module.flush());
4337
4188
  }
4338
- free() {
4339
- this._modules.forEach((module) => module.free());
4189
+ destroy() {
4190
+ this._modules.forEach((module) => module.destroy());
4340
4191
  this.view?.removeEventListener("webglcontextlost", this._onContextLost, false);
4341
4192
  this.view?.removeEventListener("webglcontextrestored", this._onContextRestored, false);
4342
4193
  this.extensions.loseContext?.loseContext();
@@ -4493,8 +4344,8 @@ class IndexBuffer extends Resource {
4493
4344
  return renderer.buffer.create(this._glBufferOptions());
4494
4345
  });
4495
4346
  }
4496
- _updateProperty(key, value, oldValue, declaration) {
4497
- super._updateProperty(key, value, oldValue, declaration);
4347
+ _updateProperty(key, value, oldValue) {
4348
+ super._updateProperty(key, value, oldValue);
4498
4349
  switch (key) {
4499
4350
  case "data":
4500
4351
  case "dynamic":
@@ -4515,10 +4366,10 @@ class IndexBuffer extends Resource {
4515
4366
  }
4516
4367
  }
4517
4368
  __decorateClass$Y([
4518
- modernIdoc.property({ protected: true, default: null })
4369
+ modernIdoc.property({ internal: true, fallback: null })
4519
4370
  ], IndexBuffer.prototype, "data");
4520
4371
  __decorateClass$Y([
4521
- modernIdoc.property({ protected: true, fallback: false })
4372
+ modernIdoc.property({ internal: true, fallback: false })
4522
4373
  ], IndexBuffer.prototype, "dynamic");
4523
4374
 
4524
4375
  var __defProp$O = Object.defineProperty;
@@ -4550,8 +4401,8 @@ class VertexBuffer extends Resource {
4550
4401
  return renderer.buffer.create(this._glBufferOptions());
4551
4402
  });
4552
4403
  }
4553
- _updateProperty(key, value, oldValue, declaration) {
4554
- super._updateProperty(key, value, oldValue, declaration);
4404
+ _updateProperty(key, value, oldValue) {
4405
+ super._updateProperty(key, value, oldValue);
4555
4406
  switch (key) {
4556
4407
  case "data":
4557
4408
  case "dynamic":
@@ -4572,10 +4423,10 @@ class VertexBuffer extends Resource {
4572
4423
  }
4573
4424
  }
4574
4425
  __decorateClass$X([
4575
- modernIdoc.property({ protected: true, default: null })
4426
+ modernIdoc.property({ internal: true, default: null })
4576
4427
  ], VertexBuffer.prototype, "data");
4577
4428
  __decorateClass$X([
4578
- modernIdoc.property({ protected: true, fallback: false })
4429
+ modernIdoc.property({ internal: true, fallback: false })
4579
4430
  ], VertexBuffer.prototype, "dynamic");
4580
4431
 
4581
4432
  var __defProp$N = Object.defineProperty;
@@ -4596,8 +4447,8 @@ class VertexAttribute extends Resource {
4596
4447
  ...options
4597
4448
  });
4598
4449
  }
4599
- _updateProperty(key, value, oldValue, declaration) {
4600
- super._updateProperty(key, value, oldValue, declaration);
4450
+ _updateProperty(key, value, oldValue) {
4451
+ super._updateProperty(key, value, oldValue);
4601
4452
  switch (key) {
4602
4453
  case "buffer":
4603
4454
  case "size":
@@ -4945,8 +4796,8 @@ class Texture2D extends Resource {
4945
4796
  return renderer.texture.create(this._glTextureOptions(renderer, options));
4946
4797
  });
4947
4798
  }
4948
- _updateProperty(key, value, oldValue, declaration) {
4949
- super._updateProperty(key, value, oldValue, declaration);
4799
+ _updateProperty(key, value, oldValue) {
4800
+ super._updateProperty(key, value, oldValue);
4950
4801
  switch (key) {
4951
4802
  case "width":
4952
4803
  case "height":
@@ -5006,7 +4857,7 @@ class Texture2D extends Resource {
5006
4857
  inactivate(renderer) {
5007
4858
  renderer.texture.unbind(this._glTexture(renderer));
5008
4859
  }
5009
- free() {
4860
+ destroy() {
5010
4861
  if (SUPPORTS_IMAGE_BITMAP && this.source instanceof ImageBitmap) {
5011
4862
  this.source.close();
5012
4863
  }
@@ -5050,9 +4901,9 @@ class AnimatedTexture extends Resource {
5050
4901
  this.duration = this.frames.reduce((duration, frame) => frame.duration + duration, 0);
5051
4902
  return this;
5052
4903
  }
5053
- free() {
4904
+ destroy() {
5054
4905
  this.frames.forEach((frame) => {
5055
- frame.texture.free();
4906
+ frame.texture.destroy();
5056
4907
  });
5057
4908
  }
5058
4909
  }
@@ -5070,7 +4921,7 @@ class CanvasTexture extends Texture2D {
5070
4921
  constructor(source = document.createElement("canvas")) {
5071
4922
  super(source);
5072
4923
  }
5073
- _updateProperty(key, value, oldValue, declaration) {
4924
+ _updateProperty(key, value, oldValue) {
5074
4925
  switch (key) {
5075
4926
  case "width":
5076
4927
  this.source.width = Math.max(1, Math.ceil(value * this.pixelRatio));
@@ -5079,7 +4930,7 @@ class CanvasTexture extends Texture2D {
5079
4930
  this.source.height = Math.max(1, Math.ceil(value * this.pixelRatio));
5080
4931
  break;
5081
4932
  }
5082
- super._updateProperty(key, value, oldValue, declaration);
4933
+ super._updateProperty(key, value, oldValue);
5083
4934
  }
5084
4935
  }
5085
4936
  __decorateClass$U([
@@ -5287,7 +5138,7 @@ class PixelsTexture extends Texture2D {
5287
5138
  }
5288
5139
  super(source);
5289
5140
  }
5290
- _updateProperty(key, value, oldValue, declaration) {
5141
+ _updateProperty(key, value, oldValue) {
5291
5142
  switch (key) {
5292
5143
  case "width":
5293
5144
  this.source.width = Math.round(this.width * this.pixelRatio);
@@ -5300,7 +5151,7 @@ class PixelsTexture extends Texture2D {
5300
5151
  this.source.height = Math.round(this.height * this.pixelRatio);
5301
5152
  break;
5302
5153
  }
5303
- super._updateProperty(key, value, oldValue, declaration);
5154
+ super._updateProperty(key, value, oldValue);
5304
5155
  }
5305
5156
  }
5306
5157
 
@@ -5402,8 +5253,8 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5402
5253
  }
5403
5254
  this._setupAutoUpdate();
5404
5255
  }
5405
- _updateProperty(key, value, oldValue, declaration) {
5406
- super._updateProperty(key, value, oldValue, declaration);
5256
+ _updateProperty(key, value, oldValue) {
5257
+ super._updateProperty(key, value, oldValue);
5407
5258
  switch (key) {
5408
5259
  case "fps":
5409
5260
  this._spf = value ? Math.floor(1e3 / value) : 0;
@@ -5538,7 +5389,7 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5538
5389
  }
5539
5390
  return this._sourceLoad;
5540
5391
  }
5541
- free() {
5392
+ destroy() {
5542
5393
  this._setupAutoUpdate();
5543
5394
  const source = this.source;
5544
5395
  if (source) {
@@ -5555,10 +5406,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5555
5406
  }
5556
5407
  };
5557
5408
  __decorateClass$T([
5558
- modernIdoc.property({ protected: true, fallback: true })
5409
+ modernIdoc.property({ internal: true, fallback: true })
5559
5410
  ], _VideoTexture.prototype, "autoUpdate");
5560
5411
  __decorateClass$T([
5561
- modernIdoc.property({ protected: true, fallback: 0 })
5412
+ modernIdoc.property({ internal: true, fallback: 0 })
5562
5413
  ], _VideoTexture.prototype, "fps");
5563
5414
  let VideoTexture = _VideoTexture;
5564
5415
 
@@ -5757,11 +5608,7 @@ class Children {
5757
5608
  default = [];
5758
5609
  back = [];
5759
5610
  get internal() {
5760
- return [
5761
- ...this.front,
5762
- ...this.default,
5763
- ...this.back
5764
- ];
5611
+ return this.getInternal();
5765
5612
  }
5766
5613
  constructor(...items) {
5767
5614
  this.set(items);
@@ -5786,15 +5633,23 @@ class Children {
5786
5633
  return this;
5787
5634
  }
5788
5635
  getInternal(includeInternal) {
5789
- switch (includeInternal) {
5790
- case "front":
5791
- return this.front;
5792
- case "default":
5793
- return this.default;
5794
- case "back":
5795
- return this.back;
5796
- default:
5797
- throw new Error(`Unknown internal mode: ${includeInternal}`);
5636
+ if (includeInternal) {
5637
+ switch (includeInternal) {
5638
+ case "front":
5639
+ return this.front;
5640
+ case "default":
5641
+ return this.default;
5642
+ case "back":
5643
+ return this.back;
5644
+ default:
5645
+ throw new Error(`Unknown internal mode: ${includeInternal}`);
5646
+ }
5647
+ } else {
5648
+ return [
5649
+ ...this.front,
5650
+ ...this.default,
5651
+ ...this.back
5652
+ ];
5798
5653
  }
5799
5654
  }
5800
5655
  toJSON() {
@@ -5944,8 +5799,8 @@ exports.Node = class Node extends CoreObject {
5944
5799
  set children(value) {
5945
5800
  this._children.set(value);
5946
5801
  }
5947
- getChildren(includeInternal) {
5948
- return this._children.getInternal(includeInternal);
5802
+ getChildren(internalMode = "default") {
5803
+ return this._children.getInternal(internalMode === true ? void 0 : internalMode);
5949
5804
  }
5950
5805
  getChild(index = 0) {
5951
5806
  return this.children[index];
@@ -6012,9 +5867,6 @@ exports.Node = class Node extends CoreObject {
6012
5867
  return false;
6013
5868
  }
6014
5869
  }
6015
- _updateProperty(key, value, oldValue, declaration) {
6016
- super._updateProperty(key, value, oldValue, declaration);
6017
- }
6018
5870
  _onTreeEnter(tree) {
6019
5871
  this._treeEnter(tree);
6020
5872
  this.emit("treeEntered", tree);
@@ -6289,6 +6141,10 @@ exports.Node = class Node extends CoreObject {
6289
6141
  // eslint-disable-next-line unused-imports/no-unused-vars
6290
6142
  _render(renderer) {
6291
6143
  }
6144
+ destroy() {
6145
+ super.destroy();
6146
+ this._children.internal.forEach((node) => this.removeChild(node));
6147
+ }
6292
6148
  clone() {
6293
6149
  return new this.constructor(
6294
6150
  this.toJSON(),
@@ -6327,19 +6183,19 @@ __decorateClass$S([
6327
6183
  modernIdoc.property({ default: () => ({}) })
6328
6184
  ], exports.Node.prototype, "meta", 2);
6329
6185
  __decorateClass$S([
6330
- modernIdoc.property({ protected: true, fallback: "inherit" })
6186
+ modernIdoc.property({ internal: true, fallback: "inherit" })
6331
6187
  ], exports.Node.prototype, "processMode", 2);
6332
6188
  __decorateClass$S([
6333
- modernIdoc.property({ protected: true, fallback: "default" })
6189
+ modernIdoc.property({ internal: true, fallback: "default" })
6334
6190
  ], exports.Node.prototype, "processSortMode", 2);
6335
6191
  __decorateClass$S([
6336
- modernIdoc.property({ protected: true, fallback: "inherit" })
6192
+ modernIdoc.property({ internal: true, fallback: "inherit" })
6337
6193
  ], exports.Node.prototype, "renderMode", 2);
6338
6194
  __decorateClass$S([
6339
- modernIdoc.property({ protected: true, fallback: "inherit" })
6195
+ modernIdoc.property({ internal: true, fallback: "inherit" })
6340
6196
  ], exports.Node.prototype, "inputMode", 2);
6341
6197
  __decorateClass$S([
6342
- modernIdoc.property({ protected: true, fallback: "default" })
6198
+ modernIdoc.property({ internal: true, fallback: "default" })
6343
6199
  ], exports.Node.prototype, "internalMode", 2);
6344
6200
  __decorateClass$S([
6345
6201
  modernIdoc.property({ protected: true })
@@ -6425,7 +6281,7 @@ __decorateClass$R([
6425
6281
  modernIdoc.property({ fallback: false })
6426
6282
  ], exports.TimelineNode.prototype, "paused", 2);
6427
6283
  __decorateClass$R([
6428
- modernIdoc.property({ protected: true, fallback: false })
6284
+ modernIdoc.property({ internal: true, fallback: false })
6429
6285
  ], exports.TimelineNode.prototype, "insideTimeRange", 2);
6430
6286
  exports.TimelineNode = __decorateClass$R([
6431
6287
  customNode("TimelineNode")
@@ -6466,8 +6322,8 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
6466
6322
  super();
6467
6323
  this.setProperties(properties).append(nodes);
6468
6324
  }
6469
- _updateProperty(key, value, oldValue, declaration) {
6470
- super._updateProperty(key, value, oldValue, declaration);
6325
+ _updateProperty(key, value, oldValue) {
6326
+ super._updateProperty(key, value, oldValue);
6471
6327
  switch (key) {
6472
6328
  case "modulate":
6473
6329
  this._modulate.value = value;
@@ -6597,10 +6453,10 @@ __decorateClass$Q([
6597
6453
  modernIdoc.property()
6598
6454
  ], exports.CanvasItem.prototype, "blendMode", 2);
6599
6455
  __decorateClass$Q([
6600
- modernIdoc.property({ protected: true, fallback: true })
6456
+ modernIdoc.property({ internal: true, fallback: true })
6601
6457
  ], exports.CanvasItem.prototype, "visible", 2);
6602
6458
  __decorateClass$Q([
6603
- modernIdoc.property({ protected: true, fallback: 1 })
6459
+ modernIdoc.property({ internal: true, fallback: 1 })
6604
6460
  ], exports.CanvasItem.prototype, "opacity", 2);
6605
6461
  exports.CanvasItem = __decorateClass$Q([
6606
6462
  customNode("CanvasItem")
@@ -6666,8 +6522,8 @@ exports.Viewport = class Viewport extends exports.Node {
6666
6522
  );
6667
6523
  });
6668
6524
  }
6669
- _updateProperty(key, value, oldValue, declaration) {
6670
- super._updateProperty(key, value, oldValue, declaration);
6525
+ _updateProperty(key, value, oldValue) {
6526
+ super._updateProperty(key, value, oldValue);
6671
6527
  switch (key) {
6672
6528
  case "x":
6673
6529
  case "y":
@@ -6806,8 +6662,8 @@ exports.Effect = class Effect extends exports.TimelineNode {
6806
6662
  this._onNodeProcessed = this._onNodeProcessed.bind(this);
6807
6663
  this.setProperties(properties).append(children);
6808
6664
  }
6809
- _updateProperty(key, value, oldValue, declaration) {
6810
- super._updateProperty(key, value, oldValue, declaration);
6665
+ _updateProperty(key, value, oldValue) {
6666
+ super._updateProperty(key, value, oldValue);
6811
6667
  switch (key) {
6812
6668
  case "glsl": {
6813
6669
  const material = new EffectMaterial(value);
@@ -7176,8 +7032,8 @@ class SceneTree extends MainLoop {
7176
7032
  super();
7177
7033
  this.timeline = timeline.setTree(this);
7178
7034
  }
7179
- _updateProperty(key, value, oldValue, declaration) {
7180
- super._updateProperty(key, value, oldValue, declaration);
7035
+ _updateProperty(key, value, oldValue) {
7036
+ super._updateProperty(key, value, oldValue);
7181
7037
  switch (key) {
7182
7038
  case "backgroundColor":
7183
7039
  this._backgroundColor.value = value;
@@ -7222,20 +7078,20 @@ class SceneTree extends MainLoop {
7222
7078
  QuadUvGeometry.draw(renderer);
7223
7079
  renderer.texture.unbind(texture);
7224
7080
  }
7225
- free() {
7226
- super.free();
7227
- this.root.children.internal.forEach((node) => this.root.removeChild(node));
7081
+ destroy() {
7082
+ super.destroy();
7083
+ this.root.destroy();
7228
7084
  this.input.removeEventListeners();
7229
7085
  }
7230
7086
  }
7231
7087
  __decorateClass$L([
7232
- modernIdoc.property({ protected: true, fallback: false })
7088
+ modernIdoc.property({ internal: true, fallback: false })
7233
7089
  ], SceneTree.prototype, "processPaused");
7234
7090
  __decorateClass$L([
7235
7091
  modernIdoc.property()
7236
7092
  ], SceneTree.prototype, "backgroundColor");
7237
7093
  __decorateClass$L([
7238
- modernIdoc.property({ protected: true, fallback: false })
7094
+ modernIdoc.property({ internal: true, fallback: false })
7239
7095
  ], SceneTree.prototype, "debug");
7240
7096
 
7241
7097
  var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
@@ -7284,8 +7140,8 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
7284
7140
  super();
7285
7141
  this.setProperties(properties).append(nodes);
7286
7142
  }
7287
- _updateProperty(key, value, oldValue, declaration) {
7288
- super._updateProperty(key, value, oldValue, declaration);
7143
+ _updateProperty(key, value, oldValue) {
7144
+ super._updateProperty(key, value, oldValue);
7289
7145
  switch (key) {
7290
7146
  case "rotation":
7291
7147
  this.updateGlobalTransform();
@@ -7372,10 +7228,10 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
7372
7228
  }
7373
7229
  };
7374
7230
  __decorateClass$J([
7375
- modernIdoc.property({ protected: true, fallback: 0 })
7231
+ modernIdoc.property({ internal: true, fallback: 0 })
7376
7232
  ], exports.Node2D.prototype, "rotation", 2);
7377
7233
  __decorateClass$J([
7378
- modernIdoc.property({ protected: true, fallback: 0 })
7234
+ modernIdoc.property({ internal: true, fallback: 0 })
7379
7235
  ], exports.Node2D.prototype, "globalRotation", 2);
7380
7236
  exports.Node2D = __decorateClass$J([
7381
7237
  customNode("Node2D")
@@ -7502,10 +7358,10 @@ exports.Camera2D = class Camera2D extends exports.Node2D {
7502
7358
  }
7503
7359
  };
7504
7360
  __decorateClass$I([
7505
- modernIdoc.property({ protected: true, fallback: false })
7361
+ modernIdoc.property({ internal: true, fallback: false })
7506
7362
  ], exports.Camera2D.prototype, "spaceKey", 2);
7507
7363
  __decorateClass$I([
7508
- modernIdoc.property({ protected: true, fallback: false })
7364
+ modernIdoc.property({ internal: true, fallback: false })
7509
7365
  ], exports.Camera2D.prototype, "grabbing", 2);
7510
7366
  exports.Camera2D = __decorateClass$I([
7511
7367
  customNode("Camera2D", {
@@ -8891,8 +8747,8 @@ void main() {
8891
8747
  this.setProperties(properties).append(children);
8892
8748
  this._generateKernels();
8893
8749
  }
8894
- _updateProperty(key, value, oldValue, declaration) {
8895
- super._updateProperty(key, value, oldValue, declaration);
8750
+ _updateProperty(key, value, oldValue) {
8751
+ super._updateProperty(key, value, oldValue);
8896
8752
  switch (key) {
8897
8753
  case "quality":
8898
8754
  case "strength":
@@ -8969,8 +8825,8 @@ exports.MaskEffect = class MaskEffect extends exports.Effect {
8969
8825
  this.texture = await assets.texture.load(this.src);
8970
8826
  }
8971
8827
  }
8972
- _updateProperty(key, value, oldValue, declaration) {
8973
- super._updateProperty(key, value, oldValue, declaration);
8828
+ _updateProperty(key, value, oldValue) {
8829
+ super._updateProperty(key, value, oldValue);
8974
8830
  switch (key) {
8975
8831
  case "src":
8976
8832
  this.load();
@@ -9447,8 +9303,8 @@ class BaseElement2DFill extends CoreObject {
9447
9303
  modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeFill(properties)
9448
9304
  );
9449
9305
  }
9450
- _updateProperty(key, value, oldValue, declaration) {
9451
- super._updateProperty(key, value, oldValue, declaration);
9306
+ _updateProperty(key, value, oldValue) {
9307
+ super._updateProperty(key, value, oldValue);
9452
9308
  switch (key) {
9453
9309
  case "color":
9454
9310
  case "cropRect":
@@ -9555,8 +9411,8 @@ class BaseElement2DBackground extends BaseElement2DFill {
9555
9411
  modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeBackground(properties)
9556
9412
  );
9557
9413
  }
9558
- _updateProperty(key, value, oldValue, declaration) {
9559
- super._updateProperty(key, value, oldValue, declaration);
9414
+ _updateProperty(key, value, oldValue) {
9415
+ super._updateProperty(key, value, oldValue);
9560
9416
  switch (key) {
9561
9417
  case "fillWithShape":
9562
9418
  this.parent.requestRedraw();
@@ -9583,8 +9439,8 @@ class BaseElement2DForeground extends BaseElement2DFill {
9583
9439
  modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeForeground(properties)
9584
9440
  );
9585
9441
  }
9586
- _updateProperty(key, value, oldValue, declaration) {
9587
- super._updateProperty(key, value, oldValue, declaration);
9442
+ _updateProperty(key, value, oldValue) {
9443
+ super._updateProperty(key, value, oldValue);
9588
9444
  switch (key) {
9589
9445
  case "fillWithShape":
9590
9446
  this.parent.requestRedraw();
@@ -9611,8 +9467,8 @@ class BaseElement2DOutline extends BaseElement2DFill {
9611
9467
  modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeOutline(properties)
9612
9468
  );
9613
9469
  }
9614
- _updateProperty(key, value, oldValue, declaration) {
9615
- super._updateProperty(key, value, oldValue, declaration);
9470
+ _updateProperty(key, value, oldValue) {
9471
+ super._updateProperty(key, value, oldValue);
9616
9472
  switch (key) {
9617
9473
  case "width":
9618
9474
  case "style":
@@ -9680,8 +9536,8 @@ class BaseElement2DShadow extends CoreObject {
9680
9536
  modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeShadow(properties)
9681
9537
  );
9682
9538
  }
9683
- _updateProperty(key, value, oldValue, declaration) {
9684
- super._updateProperty(key, value, oldValue, declaration);
9539
+ _updateProperty(key, value, oldValue) {
9540
+ super._updateProperty(key, value, oldValue);
9685
9541
  switch (key) {
9686
9542
  case "color":
9687
9543
  case "blur":
@@ -9744,8 +9600,8 @@ class BaseElement2DShape extends CoreObject {
9744
9600
  modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeShape(properties)
9745
9601
  );
9746
9602
  }
9747
- _updateProperty(key, value, oldValue, declaration) {
9748
- super._updateProperty(key, value, oldValue, declaration);
9603
+ _updateProperty(key, value, oldValue) {
9604
+ super._updateProperty(key, value, oldValue);
9749
9605
  switch (key) {
9750
9606
  case "svg":
9751
9607
  case "paths":
@@ -9851,7 +9707,7 @@ class BaseElement2DText extends CoreObject {
9851
9707
  case "effects":
9852
9708
  case "fill":
9853
9709
  case "outline":
9854
- this.setter(args[0], args[1]);
9710
+ this.setProperty(args[0], args[1]);
9855
9711
  break;
9856
9712
  }
9857
9713
  this._updateProperty(...args);
@@ -9865,8 +9721,8 @@ class BaseElement2DText extends CoreObject {
9865
9721
  modernIdoc.isNone(properties) ? void 0 : modernIdoc.normalizeText(properties)
9866
9722
  );
9867
9723
  }
9868
- _updateProperty(key, value, oldValue, declaration) {
9869
- super._updateProperty(key, value, oldValue, declaration);
9724
+ _updateProperty(key, value, oldValue) {
9725
+ super._updateProperty(key, value, oldValue);
9870
9726
  switch (key) {
9871
9727
  case "enabled":
9872
9728
  case "effects":
@@ -10058,10 +9914,10 @@ __decorateClass$m([
10058
9914
  modernIdoc.property({ alias: "base.outline" })
10059
9915
  ], BaseElement2DText.prototype, "outline");
10060
9916
  __decorateClass$m([
10061
- modernIdoc.property({ protected: true, alias: "base.measureDom" })
9917
+ modernIdoc.property({ internal: true, alias: "base.measureDom" })
10062
9918
  ], BaseElement2DText.prototype, "measureDom");
10063
9919
  __decorateClass$m([
10064
- modernIdoc.property({ protected: true, alias: "base.fonts" })
9920
+ modernIdoc.property({ internal: true, alias: "base.fonts" })
10065
9921
  ], BaseElement2DText.prototype, "fonts");
10066
9922
 
10067
9923
  var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
@@ -10082,8 +9938,8 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
10082
9938
  }
10083
9939
  set style(style) {
10084
9940
  const cb = (...args) => {
10085
- this.emit("updateStyleProperty", ...args);
10086
- this._updateStyleProperty(args[0], args[1], args[2], args[3]);
9941
+ this.emit("updateStyleProperty", args[0], args[1], args[2]);
9942
+ this._updateStyleProperty(args[0], args[1], args[2]);
10087
9943
  };
10088
9944
  style.on("updateProperty", cb);
10089
9945
  this._style?.off("updateProperty", cb);
@@ -10169,7 +10025,7 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
10169
10025
  }
10170
10026
  return this;
10171
10027
  }
10172
- _updateStyleProperty(key, value, oldValue, _declaration) {
10028
+ _updateStyleProperty(key, value, oldValue) {
10173
10029
  switch (key) {
10174
10030
  case "rotate":
10175
10031
  this.rotation = this.style.rotate * DEG_TO_RAD;
@@ -10422,7 +10278,7 @@ exports.BaseElement2D = class BaseElement2D extends exports.Node2D {
10422
10278
  return this.style.pointerEvents !== "none";
10423
10279
  }
10424
10280
  input(event, key) {
10425
- const array = this._children.internal;
10281
+ const array = this.getChildren(true);
10426
10282
  for (let i = array.length - 1; i >= 0; i--) {
10427
10283
  array[i].input(event, key);
10428
10284
  }
@@ -10519,8 +10375,8 @@ exports.Element2D = class Element2D extends exports.BaseElement2D {
10519
10375
  }
10520
10376
  set style(style) {
10521
10377
  const cb = (...args) => {
10522
- this.emit("updateStyleProperty", ...args);
10523
- this._updateStyleProperty(args[0], args[1], args[2], args[3]);
10378
+ this.emit("updateStyleProperty", args[0], args[1], args[2]);
10379
+ this._updateStyleProperty(args[0], args[1], args[2]);
10524
10380
  };
10525
10381
  style.on("updateProperty", cb);
10526
10382
  this._style?.off("updateProperty", cb);
@@ -10531,8 +10387,8 @@ exports.Element2D = class Element2D extends exports.BaseElement2D {
10531
10387
  this.style = new Element2DStyle();
10532
10388
  this.setProperties(properties).append(nodes);
10533
10389
  }
10534
- _updateStyleProperty(key, value, oldValue, declaration) {
10535
- super._updateStyleProperty(key, value, oldValue, declaration);
10390
+ _updateStyleProperty(key, value, oldValue) {
10391
+ super._updateStyleProperty(key, value, oldValue);
10536
10392
  switch (key) {
10537
10393
  case "left":
10538
10394
  this.position.x = Number(value);
@@ -10712,7 +10568,7 @@ class FlexLayout {
10712
10568
  return this._node.getComputedLayout();
10713
10569
  }
10714
10570
  // eslint-disable-next-line unused-imports/no-unused-vars
10715
- updateStyleProperty(key, value, oldValue, declaration) {
10571
+ updateStyleProperty(key, value, oldValue) {
10716
10572
  switch (key) {
10717
10573
  case "alignContent":
10718
10574
  this._node.setAlignContent(
@@ -10882,8 +10738,8 @@ exports.FlexElement2D = class FlexElement2D extends exports.BaseElement2D {
10882
10738
  }
10883
10739
  set style(style) {
10884
10740
  const cb = (...args) => {
10885
- this.emit("updateStyleProperty", ...args);
10886
- this._updateStyleProperty(args[0], args[1], args[2], args[3]);
10741
+ this.emit("updateStyleProperty", args[0], args[1], args[2]);
10742
+ this._updateStyleProperty(args[0], args[1], args[2]);
10887
10743
  };
10888
10744
  style.on("updateProperty", cb);
10889
10745
  this._style?.off("updateProperty", cb);
@@ -10922,9 +10778,9 @@ exports.FlexElement2D = class FlexElement2D extends exports.BaseElement2D {
10922
10778
  oldParent._layout._node.removeChild(this._layout._node);
10923
10779
  }
10924
10780
  }
10925
- _updateStyleProperty(key, value, oldValue, declaration) {
10926
- super._updateStyleProperty(key, value, oldValue, declaration);
10927
- this._layout.updateStyleProperty(key, value, oldValue, declaration);
10781
+ _updateStyleProperty(key, value, oldValue) {
10782
+ super._updateStyleProperty(key, value, oldValue);
10783
+ this._layout.updateStyleProperty(key, value, oldValue);
10928
10784
  if (this._layout._node.isDirty()) {
10929
10785
  this.requestRelayout();
10930
10786
  }
@@ -10986,8 +10842,8 @@ exports.Image2D = class Image2D extends exports.Element2D {
10986
10842
  this.setProperties(properties);
10987
10843
  this.append(children);
10988
10844
  }
10989
- _updateProperty(key, value, oldValue, declaration) {
10990
- super._updateProperty(key, value, oldValue, declaration);
10845
+ _updateProperty(key, value, oldValue) {
10846
+ super._updateProperty(key, value, oldValue);
10991
10847
  switch (key) {
10992
10848
  case "src":
10993
10849
  this._wait = this._load(value);
@@ -11148,8 +11004,8 @@ exports.Lottie2D = class Lottie2D extends TextureRect2D {
11148
11004
  this.setProperties(properties);
11149
11005
  this.append(children);
11150
11006
  }
11151
- _updateProperty(key, value, oldValue, declaration) {
11152
- super._updateProperty(key, value, oldValue, declaration);
11007
+ _updateProperty(key, value, oldValue) {
11008
+ super._updateProperty(key, value, oldValue);
11153
11009
  switch (key) {
11154
11010
  case "src":
11155
11011
  this._load();
@@ -11201,8 +11057,8 @@ class TransformRect2D extends exports.Element2D {
11201
11057
  super();
11202
11058
  this.setProperties(properties).append(nodes);
11203
11059
  }
11204
- _updateStyleProperty(key, value, oldValue, declaration) {
11205
- super._updateStyleProperty(key, value, oldValue, declaration);
11060
+ _updateStyleProperty(key, value, oldValue) {
11061
+ super._updateStyleProperty(key, value, oldValue);
11206
11062
  switch (key) {
11207
11063
  case "width":
11208
11064
  case "height":
@@ -11263,8 +11119,8 @@ exports.Video2D = class Video2D extends TextureRect2D {
11263
11119
  this.setProperties(properties);
11264
11120
  this.append(children);
11265
11121
  }
11266
- _updateProperty(key, value, oldValue, declaration) {
11267
- super._updateProperty(key, value, oldValue, declaration);
11122
+ _updateProperty(key, value, oldValue) {
11123
+ super._updateProperty(key, value, oldValue);
11268
11124
  switch (key) {
11269
11125
  case "src":
11270
11126
  this._wait = this._load(value);
@@ -11399,8 +11255,8 @@ exports.Animation = class Animation extends exports.TimelineNode {
11399
11255
  this.commitStyles();
11400
11256
  }
11401
11257
  }
11402
- _updateProperty(key, value, oldValue, declaration) {
11403
- super._updateProperty(key, value, oldValue, declaration);
11258
+ _updateProperty(key, value, oldValue) {
11259
+ super._updateProperty(key, value, oldValue);
11404
11260
  switch (key) {
11405
11261
  case "effectMode":
11406
11262
  case "keyframes":
@@ -11412,7 +11268,7 @@ exports.Animation = class Animation extends exports.TimelineNode {
11412
11268
  let targets;
11413
11269
  switch (this.effectMode) {
11414
11270
  case "sibling":
11415
- targets = this.getParent()?.children.internal.filter((val) => val instanceof exports.CanvasItem) ?? [];
11271
+ targets = this.getParent()?.getChildren(true).filter((val) => val instanceof exports.CanvasItem) ?? [];
11416
11272
  break;
11417
11273
  case "parent":
11418
11274
  default:
@@ -11657,7 +11513,7 @@ exports.Animation = __decorateClass$e([
11657
11513
  })
11658
11514
  ], exports.Animation);
11659
11515
 
11660
- class HTMLAudioContext extends modernIdoc.EventEmitter {
11516
+ class HTMLAudioContext extends modernIdoc.Observable {
11661
11517
  static _instance;
11662
11518
  static get instance() {
11663
11519
  if (!this._instance) {
@@ -11696,12 +11552,9 @@ class HTMLAudioContext extends modernIdoc.EventEmitter {
11696
11552
  this.refreshPaused();
11697
11553
  return this.paused;
11698
11554
  }
11699
- free() {
11700
- this.removeAllListeners();
11701
- }
11702
11555
  }
11703
11556
 
11704
- class HTMLSound extends modernIdoc.EventEmitter {
11557
+ class HTMLSound extends modernIdoc.Observable {
11705
11558
  static PADDING = 0.1;
11706
11559
  _source = null;
11707
11560
  _audio = null;
@@ -11907,9 +11760,9 @@ class HTMLSound extends modernIdoc.EventEmitter {
11907
11760
  this.emit("progress", 1, this._duration);
11908
11761
  this.emit("end", this);
11909
11762
  }
11910
- free() {
11763
+ destroy() {
11911
11764
  Ticker.off(this._onUpdate);
11912
- this.removeAllListeners();
11765
+ super.destroy();
11913
11766
  const source = this._source;
11914
11767
  if (source) {
11915
11768
  source.onended = null;
@@ -11972,7 +11825,7 @@ class HTMLAudio {
11972
11825
  }
11973
11826
  }
11974
11827
 
11975
- class AudioPipeline extends modernIdoc.EventEmitter {
11828
+ class AudioPipeline extends modernIdoc.Observable {
11976
11829
  constructor(_input, _output) {
11977
11830
  super();
11978
11831
  this._input = _input;
@@ -12196,7 +12049,7 @@ class WebAudioContext extends AudioPipeline {
12196
12049
  }
12197
12050
  }
12198
12051
 
12199
- class WebSound extends modernIdoc.EventEmitter {
12052
+ class WebSound extends modernIdoc.Observable {
12200
12053
  _audio = null;
12201
12054
  _sourceNode = null;
12202
12055
  _gain = null;
@@ -12428,8 +12281,8 @@ class WebSound extends modernIdoc.EventEmitter {
12428
12281
  Ticker.on(this._updateListener);
12429
12282
  }
12430
12283
  }
12431
- free() {
12432
- this.removeAllListeners();
12284
+ destroy() {
12285
+ super.destroy();
12433
12286
  this._stop();
12434
12287
  this._gain?.disconnect();
12435
12288
  this._gain = null;
@@ -12625,8 +12478,8 @@ exports.Audio = class Audio extends exports.TimelineNode {
12625
12478
  super();
12626
12479
  this.src = src;
12627
12480
  }
12628
- _updateProperty(key, value, oldValue, declaration) {
12629
- super._updateProperty(key, value, oldValue, declaration);
12481
+ _updateProperty(key, value, oldValue) {
12482
+ super._updateProperty(key, value, oldValue);
12630
12483
  switch (key) {
12631
12484
  case "paused":
12632
12485
  this.refreshPaused();
@@ -12713,7 +12566,7 @@ exports.Audio = class Audio extends exports.TimelineNode {
12713
12566
  this._recycleSound(sound);
12714
12567
  };
12715
12568
  _recycleSound(sound) {
12716
- sound.free();
12569
+ sound.destroy();
12717
12570
  if (!exports.Audio._soundPool.includes(sound)) {
12718
12571
  exports.Audio._soundPool.push(sound);
12719
12572
  }
@@ -12773,8 +12626,8 @@ exports.AudioWaveform = class AudioWaveform extends exports.Element2D {
12773
12626
  super();
12774
12627
  this.setProperties(options);
12775
12628
  }
12776
- _updateProperty(key, value, oldValue, declaration) {
12777
- super._updateProperty(key, value, oldValue, declaration);
12629
+ _updateProperty(key, value, oldValue) {
12630
+ super._updateProperty(key, value, oldValue);
12778
12631
  switch (key) {
12779
12632
  case "src":
12780
12633
  this._loadSrc(value);
@@ -12857,10 +12710,10 @@ __decorateClass$c([
12857
12710
  modernIdoc.property()
12858
12711
  ], exports.AudioWaveform.prototype, "src", 2);
12859
12712
  __decorateClass$c([
12860
- modernIdoc.property()
12713
+ modernIdoc.property({ fallback: 0 })
12861
12714
  ], exports.AudioWaveform.prototype, "gap", 2);
12862
12715
  __decorateClass$c([
12863
- modernIdoc.property()
12716
+ modernIdoc.property({ fallback: "#000000" })
12864
12717
  ], exports.AudioWaveform.prototype, "color", 2);
12865
12718
  exports.AudioWaveform = __decorateClass$c([
12866
12719
  customNode("AudioWaveform")
@@ -12900,8 +12753,8 @@ exports.Control = class Control extends exports.Element2D {
12900
12753
  super._input(event, key);
12901
12754
  this._guiInput(event, key);
12902
12755
  }
12903
- _updateStyleProperty(key, value, oldValue, declaration) {
12904
- super._updateStyleProperty(key, value, oldValue, declaration);
12756
+ _updateStyleProperty(key, value, oldValue) {
12757
+ super._updateStyleProperty(key, value, oldValue);
12905
12758
  switch (key) {
12906
12759
  case "width":
12907
12760
  case "height":
@@ -12934,8 +12787,8 @@ exports.Range = class Range extends exports.Control {
12934
12787
  super();
12935
12788
  this.setProperties(properties).append(children);
12936
12789
  }
12937
- _updateProperty(key, value, oldValue, declaration) {
12938
- super._updateProperty(key, value, oldValue, declaration);
12790
+ _updateProperty(key, value, oldValue) {
12791
+ super._updateProperty(key, value, oldValue);
12939
12792
  switch (key) {
12940
12793
  case "allowGreater":
12941
12794
  case "allowLesser":
@@ -12991,8 +12844,8 @@ exports.Ruler = class Ruler extends exports.Control {
12991
12844
  this.setProperties(properties);
12992
12845
  this.append(children);
12993
12846
  }
12994
- _updateProperty(key, value, oldValue, declaration) {
12995
- super._updateProperty(key, value, oldValue, declaration);
12847
+ _updateProperty(key, value, oldValue) {
12848
+ super._updateProperty(key, value, oldValue);
12996
12849
  switch (key) {
12997
12850
  case "offsetX":
12998
12851
  case "offsetY":
@@ -13007,8 +12860,8 @@ exports.Ruler = class Ruler extends exports.Control {
13007
12860
  break;
13008
12861
  }
13009
12862
  }
13010
- _updateStyleProperty(key, value, oldValue, declaration) {
13011
- super._updateStyleProperty(key, value, oldValue, declaration);
12863
+ _updateStyleProperty(key, value, oldValue) {
12864
+ super._updateStyleProperty(key, value, oldValue);
13012
12865
  switch (key) {
13013
12866
  case "width":
13014
12867
  case "height":
@@ -13175,8 +13028,8 @@ exports.ScrollBar = class ScrollBar extends exports.Range {
13175
13028
  super();
13176
13029
  this.setProperties(properties).append(children);
13177
13030
  }
13178
- _updateStyleProperty(key, value, oldValue, declaration) {
13179
- super._updateStyleProperty(key, value, oldValue, declaration);
13031
+ _updateStyleProperty(key, value, oldValue) {
13032
+ super._updateStyleProperty(key, value, oldValue);
13180
13033
  switch (key) {
13181
13034
  case "width":
13182
13035
  case "height":
@@ -13295,8 +13148,8 @@ exports.Scaler = class Scaler extends exports.Node {
13295
13148
  this.setProperties(properties);
13296
13149
  this.append(children);
13297
13150
  }
13298
- _updateProperty(key, value, oldValue, declaration) {
13299
- super._updateProperty(key, value, oldValue, declaration);
13151
+ _updateProperty(key, value, oldValue) {
13152
+ super._updateProperty(key, value, oldValue);
13300
13153
  switch (key) {
13301
13154
  case "translateY":
13302
13155
  case "translateX":
@@ -13944,8 +13797,8 @@ class Assets {
13944
13797
  _handled = /* @__PURE__ */ new Map();
13945
13798
  _gc = SUPPORTS_WEAK_REF ? new FinalizationRegistry((id) => {
13946
13799
  const ref = this.get(id);
13947
- if (ref && "free" in ref) {
13948
- ref.free();
13800
+ if (ref && "destroy" in ref) {
13801
+ ref.destroy();
13949
13802
  }
13950
13803
  this._handled.delete(id);
13951
13804
  }) : void 0;
@@ -14064,8 +13917,8 @@ class Assets {
14064
13917
  gc() {
14065
13918
  this._handled.forEach((_, id) => {
14066
13919
  const ref = this.get(id);
14067
- if (ref && "free" in ref) {
14068
- ref.free();
13920
+ if (ref && "destroy" in ref) {
13921
+ ref.destroy();
14069
13922
  }
14070
13923
  });
14071
13924
  this._handled.clear();
@@ -14162,8 +14015,8 @@ exports.CanvasItemEditor = class CanvasItemEditor extends exports.Control {
14162
14015
  this._onPointerup = this._onPointerup.bind(this);
14163
14016
  this.append(this.ruler);
14164
14017
  }
14165
- _updateStyleProperty(key, value, oldValue, declaration) {
14166
- super._updateStyleProperty(key, value, oldValue, declaration);
14018
+ _updateStyleProperty(key, value, oldValue) {
14019
+ super._updateStyleProperty(key, value, oldValue);
14167
14020
  switch (key) {
14168
14021
  case "width":
14169
14022
  this.drawboard.style.left = (this.size.width - this.drawboard.size.width) / 2;
@@ -14429,10 +14282,10 @@ class Engine extends SceneTree {
14429
14282
  this._render(this.renderer);
14430
14283
  });
14431
14284
  }
14432
- free() {
14433
- super.free();
14285
+ destroy() {
14286
+ super.destroy();
14434
14287
  this.enableAutoResize(false);
14435
- this.renderer.free();
14288
+ this.renderer.destroy();
14436
14289
  }
14437
14290
  toPixels() {
14438
14291
  return this.renderer.toPixels();