modern-canvas 0.8.10 → 0.9.1

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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineProperty, EventEmitter, getDeclarations, parseColor, property, RawWeakMap as RawWeakMap$1, isGradient, isColorFillObject, clearUndef, idGenerator, normalizeFill, isNone, normalizeBackground, normalizeForeground, normalizeOutline, normalizeShadow, normalizeShape, getDefaultStyle, normalizeText, normalizeTextContent } from 'modern-idoc';
1
+ import { defineProperty, Observable, Reactivable, parseColor, property, RawWeakMap as RawWeakMap$1, isGradient, isColorFillObject, clearUndef, idGenerator, normalizeFill, isNone, normalizeBackground, normalizeForeground, normalizeOutline, normalizeShadow, normalizeShape, getDefaultStyle, normalizeText, normalizeTextContent } from 'modern-idoc';
2
2
  import { extend } from 'colord';
3
3
  import namesPlugin from 'colord/plugins/names';
4
4
  import { Path2D, Path2DSet, svgToDom, svgToPath2DSet, Matrix3 as Matrix3$1, BoundingBox } from 'modern-path2d';
@@ -478,7 +478,7 @@ const TOUCH_TO_POINTER = {
478
478
  touchmove: "pointermove",
479
479
  touchcancel: "pointercancel"
480
480
  };
481
- class Input extends EventEmitter {
481
+ class Input extends Observable {
482
482
  /**
483
483
  * Current event
484
484
  */
@@ -868,167 +868,14 @@ class Input extends EventEmitter {
868
868
  }
869
869
 
870
870
  let IID = 0;
871
- class CoreObject extends EventEmitter {
871
+ class CoreObject extends Reactivable {
872
872
  instanceId = ++IID;
873
- _propertyAccessor;
874
- _properties = /* @__PURE__ */ new Map();
875
- _updatedProperties = /* @__PURE__ */ new Map();
876
- _changedProperties = /* @__PURE__ */ new Set();
877
- _updatingPromise = Promise.resolve();
878
- _updating = false;
879
- useCustomPropertyAccessor(accessor) {
880
- this._propertyAccessor = accessor;
881
- this.getPropertyDeclarations().forEach((declaration, key) => {
882
- const newValue = accessor.get(key, () => void 0);
883
- const oldValue = this._properties.get(key);
884
- if (newValue === void 0) {
885
- if (oldValue !== void 0) {
886
- accessor.set(key, oldValue);
887
- }
888
- } else if (newValue !== oldValue) {
889
- if (declaration.alias && declaration.alias !== key) {
890
- this.setProperty(key, newValue);
891
- } else {
892
- this._properties.set(key, newValue);
893
- }
894
- this._updateProperty(key, newValue, oldValue, declaration);
895
- this.emit("updateProperty", key, newValue, oldValue, declaration);
896
- }
897
- });
898
- return this;
899
- }
900
- getter(key, context) {
901
- if (context?.declaration.protected) {
902
- return this[context.internalKey];
903
- } else {
904
- return this._propertyAccessor ? this._propertyAccessor.get(key, () => this._properties.get(key)) : this._properties.get(key);
905
- }
906
- }
907
- setter(key, value, context) {
908
- if (context?.declaration.protected) {
909
- this[context.internalKey] = value;
910
- } else {
911
- if (this._propertyAccessor) {
912
- this._propertyAccessor.set(key, value);
913
- }
914
- this._properties.set(key, value);
915
- }
873
+ _nextTick() {
874
+ return nextTick();
916
875
  }
917
876
  equal(target) {
918
877
  return Boolean(target && this.instanceId === target.instanceId);
919
878
  }
920
- async _enqueueUpdate() {
921
- this._updating = true;
922
- try {
923
- await this._updatingPromise;
924
- } catch (e) {
925
- Promise.reject(e);
926
- }
927
- await nextTick();
928
- if (!this._updating)
929
- return;
930
- this.update();
931
- this._updating = false;
932
- }
933
- update() {
934
- this._update(this._updatedProperties);
935
- this._updatedProperties = /* @__PURE__ */ new Map();
936
- }
937
- // eslint-disable-next-line unused-imports/no-unused-vars
938
- _update(changed) {
939
- }
940
- // eslint-disable-next-line unused-imports/no-unused-vars
941
- _updateProperty(key, value, oldValue, declaration) {
942
- }
943
- isDirty(key) {
944
- return this._updatedProperties.has(key);
945
- }
946
- getPropertyDeclarations() {
947
- return getDeclarations(this.constructor);
948
- }
949
- getPropertyDeclaration(key) {
950
- return this.getPropertyDeclarations().get(key);
951
- }
952
- getProperty(key) {
953
- return this[key];
954
- }
955
- setProperty(key, value) {
956
- this[key] = value;
957
- return this;
958
- }
959
- getProperties(keys) {
960
- const properties = {};
961
- for (const [name, property] of this.getPropertyDeclarations()) {
962
- if (!property.protected && !property.alias && (!keys || keys.includes(name))) {
963
- properties[name] = this.getProperty(name);
964
- }
965
- }
966
- return properties;
967
- }
968
- setProperties(properties) {
969
- if (properties && typeof properties === "object") {
970
- for (const [name] of this.getPropertyDeclarations()) {
971
- if (name in properties) {
972
- this.setProperty(name, properties[name]);
973
- }
974
- }
975
- }
976
- return this;
977
- }
978
- resetProperties() {
979
- for (const [name, property] of this.getPropertyDeclarations()) {
980
- this.setProperty(
981
- name,
982
- typeof property.fallback === "function" ? property.fallback() : property.fallback
983
- );
984
- }
985
- return this;
986
- }
987
- onUpdateProperty(key, newValue, oldValue, declaration) {
988
- this.requestUpdate(key, newValue, oldValue, declaration);
989
- }
990
- requestUpdate(key, newValue, oldValue, declaration) {
991
- if (key !== void 0) {
992
- if (!Object.is(newValue, oldValue)) {
993
- this._updatedProperties.set(key, oldValue);
994
- this._changedProperties.add(key);
995
- declaration ??= this.getPropertyDeclaration(key);
996
- this._updateProperty(key, newValue, oldValue, declaration);
997
- this.emit("updateProperty", key, newValue, oldValue, declaration);
998
- } else {
999
- return;
1000
- }
1001
- }
1002
- if (!this._updating) {
1003
- this._updatingPromise = this._enqueueUpdate();
1004
- }
1005
- }
1006
- toJSON() {
1007
- const json = {};
1008
- this._properties.forEach((value, key) => {
1009
- if (value === void 0) {
1010
- return;
1011
- }
1012
- if (value && typeof value === "object") {
1013
- if ("toJSON" in value && typeof value.toJSON === "function") {
1014
- json[key] = value.toJSON();
1015
- } else if (Array.isArray(value)) {
1016
- json[key] = [...value];
1017
- } else {
1018
- json[key] = { ...value };
1019
- }
1020
- } else {
1021
- json[key] = value;
1022
- }
1023
- });
1024
- return json;
1025
- }
1026
- clone() {
1027
- return new this.constructor(this.toJSON());
1028
- }
1029
- free() {
1030
- this.removeAllListeners();
1031
- }
1032
879
  }
1033
880
 
1034
881
  class RefCounted extends CoreObject {
@@ -1126,7 +973,7 @@ class Color {
1126
973
  }
1127
974
  }
1128
975
 
1129
- class Vector extends EventEmitter {
976
+ class Vector extends Observable {
1130
977
  constructor(dim) {
1131
978
  super();
1132
979
  this.dim = dim;
@@ -1278,7 +1125,7 @@ class Vector extends EventEmitter {
1278
1125
  }
1279
1126
  }
1280
1127
 
1281
- class Matrix extends EventEmitter {
1128
+ class Matrix extends Observable {
1282
1129
  constructor(rows, cols, array) {
1283
1130
  super();
1284
1131
  this.rows = rows;
@@ -2245,6 +2092,7 @@ var __decorateClass$Z = (decorators, target, key, kind) => {
2245
2092
  class MainLoop extends CoreObject {
2246
2093
  _starting = false;
2247
2094
  _nextDeltaTime = 0;
2095
+ _startedProcess;
2248
2096
  get starting() {
2249
2097
  return this._starting;
2250
2098
  }
@@ -2258,7 +2106,10 @@ class MainLoop extends CoreObject {
2258
2106
  start(process) {
2259
2107
  if (!this._starting) {
2260
2108
  this._starting = true;
2261
- this.off("process");
2109
+ if (this._startedProcess) {
2110
+ this.off("process", this._startedProcess);
2111
+ }
2112
+ this._startedProcess = process;
2262
2113
  this.on("process", process);
2263
2114
  Ticker.on(this._onNextTick, { sort: 0 });
2264
2115
  }
@@ -2277,8 +2128,8 @@ class MainLoop extends CoreObject {
2277
2128
  this.emit("process", delta);
2278
2129
  }
2279
2130
  }
2280
- free() {
2281
- super.free();
2131
+ destroy() {
2132
+ super.destroy();
2282
2133
  this.stop();
2283
2134
  }
2284
2135
  }
@@ -2377,7 +2228,7 @@ class WebGLModule {
2377
2228
  }
2378
2229
  reset() {
2379
2230
  }
2380
- free() {
2231
+ destroy() {
2381
2232
  }
2382
2233
  }
2383
2234
 
@@ -3554,8 +3405,8 @@ ${gl.getShaderInfoLog(shader)}`);
3554
3405
  viewMatrix: [1, 0, 0, 0, 1, 0, 0, 0, 1]
3555
3406
  };
3556
3407
  }
3557
- free() {
3558
- super.free();
3408
+ destroy() {
3409
+ super.destroy();
3559
3410
  this.bind(null);
3560
3411
  }
3561
3412
  }
@@ -4329,8 +4180,8 @@ class WebGLRenderer extends Renderer {
4329
4180
  flush() {
4330
4181
  this._modules.forEach((module) => module.flush());
4331
4182
  }
4332
- free() {
4333
- this._modules.forEach((module) => module.free());
4183
+ destroy() {
4184
+ this._modules.forEach((module) => module.destroy());
4334
4185
  this.view?.removeEventListener("webglcontextlost", this._onContextLost, false);
4335
4186
  this.view?.removeEventListener("webglcontextrestored", this._onContextRestored, false);
4336
4187
  this.extensions.loseContext?.loseContext();
@@ -4487,8 +4338,8 @@ class IndexBuffer extends Resource {
4487
4338
  return renderer.buffer.create(this._glBufferOptions());
4488
4339
  });
4489
4340
  }
4490
- _updateProperty(key, value, oldValue, declaration) {
4491
- super._updateProperty(key, value, oldValue, declaration);
4341
+ _updateProperty(key, value, oldValue) {
4342
+ super._updateProperty(key, value, oldValue);
4492
4343
  switch (key) {
4493
4344
  case "data":
4494
4345
  case "dynamic":
@@ -4509,10 +4360,10 @@ class IndexBuffer extends Resource {
4509
4360
  }
4510
4361
  }
4511
4362
  __decorateClass$Y([
4512
- property({ protected: true, default: null })
4363
+ property({ internal: true, fallback: null })
4513
4364
  ], IndexBuffer.prototype, "data");
4514
4365
  __decorateClass$Y([
4515
- property({ protected: true, fallback: false })
4366
+ property({ internal: true, fallback: false })
4516
4367
  ], IndexBuffer.prototype, "dynamic");
4517
4368
 
4518
4369
  var __defProp$O = Object.defineProperty;
@@ -4544,8 +4395,8 @@ class VertexBuffer extends Resource {
4544
4395
  return renderer.buffer.create(this._glBufferOptions());
4545
4396
  });
4546
4397
  }
4547
- _updateProperty(key, value, oldValue, declaration) {
4548
- super._updateProperty(key, value, oldValue, declaration);
4398
+ _updateProperty(key, value, oldValue) {
4399
+ super._updateProperty(key, value, oldValue);
4549
4400
  switch (key) {
4550
4401
  case "data":
4551
4402
  case "dynamic":
@@ -4566,10 +4417,10 @@ class VertexBuffer extends Resource {
4566
4417
  }
4567
4418
  }
4568
4419
  __decorateClass$X([
4569
- property({ protected: true, default: null })
4420
+ property({ internal: true, default: null })
4570
4421
  ], VertexBuffer.prototype, "data");
4571
4422
  __decorateClass$X([
4572
- property({ protected: true, fallback: false })
4423
+ property({ internal: true, fallback: false })
4573
4424
  ], VertexBuffer.prototype, "dynamic");
4574
4425
 
4575
4426
  var __defProp$N = Object.defineProperty;
@@ -4590,8 +4441,8 @@ class VertexAttribute extends Resource {
4590
4441
  ...options
4591
4442
  });
4592
4443
  }
4593
- _updateProperty(key, value, oldValue, declaration) {
4594
- super._updateProperty(key, value, oldValue, declaration);
4444
+ _updateProperty(key, value, oldValue) {
4445
+ super._updateProperty(key, value, oldValue);
4595
4446
  switch (key) {
4596
4447
  case "buffer":
4597
4448
  case "size":
@@ -4939,8 +4790,8 @@ class Texture2D extends Resource {
4939
4790
  return renderer.texture.create(this._glTextureOptions(renderer, options));
4940
4791
  });
4941
4792
  }
4942
- _updateProperty(key, value, oldValue, declaration) {
4943
- super._updateProperty(key, value, oldValue, declaration);
4793
+ _updateProperty(key, value, oldValue) {
4794
+ super._updateProperty(key, value, oldValue);
4944
4795
  switch (key) {
4945
4796
  case "width":
4946
4797
  case "height":
@@ -5000,7 +4851,7 @@ class Texture2D extends Resource {
5000
4851
  inactivate(renderer) {
5001
4852
  renderer.texture.unbind(this._glTexture(renderer));
5002
4853
  }
5003
- free() {
4854
+ destroy() {
5004
4855
  if (SUPPORTS_IMAGE_BITMAP && this.source instanceof ImageBitmap) {
5005
4856
  this.source.close();
5006
4857
  }
@@ -5044,9 +4895,9 @@ class AnimatedTexture extends Resource {
5044
4895
  this.duration = this.frames.reduce((duration, frame) => frame.duration + duration, 0);
5045
4896
  return this;
5046
4897
  }
5047
- free() {
4898
+ destroy() {
5048
4899
  this.frames.forEach((frame) => {
5049
- frame.texture.free();
4900
+ frame.texture.destroy();
5050
4901
  });
5051
4902
  }
5052
4903
  }
@@ -5064,7 +4915,7 @@ class CanvasTexture extends Texture2D {
5064
4915
  constructor(source = document.createElement("canvas")) {
5065
4916
  super(source);
5066
4917
  }
5067
- _updateProperty(key, value, oldValue, declaration) {
4918
+ _updateProperty(key, value, oldValue) {
5068
4919
  switch (key) {
5069
4920
  case "width":
5070
4921
  this.source.width = Math.max(1, Math.ceil(value * this.pixelRatio));
@@ -5073,7 +4924,7 @@ class CanvasTexture extends Texture2D {
5073
4924
  this.source.height = Math.max(1, Math.ceil(value * this.pixelRatio));
5074
4925
  break;
5075
4926
  }
5076
- super._updateProperty(key, value, oldValue, declaration);
4927
+ super._updateProperty(key, value, oldValue);
5077
4928
  }
5078
4929
  }
5079
4930
  __decorateClass$U([
@@ -5281,7 +5132,7 @@ class PixelsTexture extends Texture2D {
5281
5132
  }
5282
5133
  super(source);
5283
5134
  }
5284
- _updateProperty(key, value, oldValue, declaration) {
5135
+ _updateProperty(key, value, oldValue) {
5285
5136
  switch (key) {
5286
5137
  case "width":
5287
5138
  this.source.width = Math.round(this.width * this.pixelRatio);
@@ -5294,7 +5145,7 @@ class PixelsTexture extends Texture2D {
5294
5145
  this.source.height = Math.round(this.height * this.pixelRatio);
5295
5146
  break;
5296
5147
  }
5297
- super._updateProperty(key, value, oldValue, declaration);
5148
+ super._updateProperty(key, value, oldValue);
5298
5149
  }
5299
5150
  }
5300
5151
 
@@ -5396,8 +5247,8 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5396
5247
  }
5397
5248
  this._setupAutoUpdate();
5398
5249
  }
5399
- _updateProperty(key, value, oldValue, declaration) {
5400
- super._updateProperty(key, value, oldValue, declaration);
5250
+ _updateProperty(key, value, oldValue) {
5251
+ super._updateProperty(key, value, oldValue);
5401
5252
  switch (key) {
5402
5253
  case "fps":
5403
5254
  this._spf = value ? Math.floor(1e3 / value) : 0;
@@ -5532,7 +5383,7 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5532
5383
  }
5533
5384
  return this._sourceLoad;
5534
5385
  }
5535
- free() {
5386
+ destroy() {
5536
5387
  this._setupAutoUpdate();
5537
5388
  const source = this.source;
5538
5389
  if (source) {
@@ -5549,10 +5400,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5549
5400
  }
5550
5401
  };
5551
5402
  __decorateClass$T([
5552
- property({ protected: true, fallback: true })
5403
+ property({ internal: true, fallback: true })
5553
5404
  ], _VideoTexture.prototype, "autoUpdate");
5554
5405
  __decorateClass$T([
5555
- property({ protected: true, fallback: 0 })
5406
+ property({ internal: true, fallback: 0 })
5556
5407
  ], _VideoTexture.prototype, "fps");
5557
5408
  let VideoTexture = _VideoTexture;
5558
5409
 
@@ -5751,11 +5602,7 @@ class Children {
5751
5602
  default = [];
5752
5603
  back = [];
5753
5604
  get internal() {
5754
- return [
5755
- ...this.front,
5756
- ...this.default,
5757
- ...this.back
5758
- ];
5605
+ return this.getInternal();
5759
5606
  }
5760
5607
  constructor(...items) {
5761
5608
  this.set(items);
@@ -5780,15 +5627,23 @@ class Children {
5780
5627
  return this;
5781
5628
  }
5782
5629
  getInternal(includeInternal) {
5783
- switch (includeInternal) {
5784
- case "front":
5785
- return this.front;
5786
- case "default":
5787
- return this.default;
5788
- case "back":
5789
- return this.back;
5790
- default:
5791
- throw new Error(`Unknown internal mode: ${includeInternal}`);
5630
+ if (includeInternal) {
5631
+ switch (includeInternal) {
5632
+ case "front":
5633
+ return this.front;
5634
+ case "default":
5635
+ return this.default;
5636
+ case "back":
5637
+ return this.back;
5638
+ default:
5639
+ throw new Error(`Unknown internal mode: ${includeInternal}`);
5640
+ }
5641
+ } else {
5642
+ return [
5643
+ ...this.front,
5644
+ ...this.default,
5645
+ ...this.back
5646
+ ];
5792
5647
  }
5793
5648
  }
5794
5649
  toJSON() {
@@ -5938,8 +5793,8 @@ let Node = class extends CoreObject {
5938
5793
  set children(value) {
5939
5794
  this._children.set(value);
5940
5795
  }
5941
- getChildren(includeInternal) {
5942
- return this._children.getInternal(includeInternal);
5796
+ getChildren(internalMode = "default") {
5797
+ return this._children.getInternal(internalMode === true ? void 0 : internalMode);
5943
5798
  }
5944
5799
  getChild(index = 0) {
5945
5800
  return this.children[index];
@@ -6006,9 +5861,6 @@ let Node = class extends CoreObject {
6006
5861
  return false;
6007
5862
  }
6008
5863
  }
6009
- _updateProperty(key, value, oldValue, declaration) {
6010
- super._updateProperty(key, value, oldValue, declaration);
6011
- }
6012
5864
  _onTreeEnter(tree) {
6013
5865
  this._treeEnter(tree);
6014
5866
  this.emit("treeEntered", tree);
@@ -6283,6 +6135,10 @@ let Node = class extends CoreObject {
6283
6135
  // eslint-disable-next-line unused-imports/no-unused-vars
6284
6136
  _render(renderer) {
6285
6137
  }
6138
+ destroy() {
6139
+ super.destroy();
6140
+ this._children.internal.forEach((node) => this.removeChild(node));
6141
+ }
6286
6142
  clone() {
6287
6143
  return new this.constructor(
6288
6144
  this.toJSON(),
@@ -6321,19 +6177,19 @@ __decorateClass$S([
6321
6177
  property({ default: () => ({}) })
6322
6178
  ], Node.prototype, "meta", 2);
6323
6179
  __decorateClass$S([
6324
- property({ protected: true, fallback: "inherit" })
6180
+ property({ internal: true, fallback: "inherit" })
6325
6181
  ], Node.prototype, "processMode", 2);
6326
6182
  __decorateClass$S([
6327
- property({ protected: true, fallback: "default" })
6183
+ property({ internal: true, fallback: "default" })
6328
6184
  ], Node.prototype, "processSortMode", 2);
6329
6185
  __decorateClass$S([
6330
- property({ protected: true, fallback: "inherit" })
6186
+ property({ internal: true, fallback: "inherit" })
6331
6187
  ], Node.prototype, "renderMode", 2);
6332
6188
  __decorateClass$S([
6333
- property({ protected: true, fallback: "inherit" })
6189
+ property({ internal: true, fallback: "inherit" })
6334
6190
  ], Node.prototype, "inputMode", 2);
6335
6191
  __decorateClass$S([
6336
- property({ protected: true, fallback: "default" })
6192
+ property({ internal: true, fallback: "default" })
6337
6193
  ], Node.prototype, "internalMode", 2);
6338
6194
  __decorateClass$S([
6339
6195
  property({ protected: true })
@@ -6419,7 +6275,7 @@ __decorateClass$R([
6419
6275
  property({ fallback: false })
6420
6276
  ], TimelineNode.prototype, "paused", 2);
6421
6277
  __decorateClass$R([
6422
- property({ protected: true, fallback: false })
6278
+ property({ internal: true, fallback: false })
6423
6279
  ], TimelineNode.prototype, "insideTimeRange", 2);
6424
6280
  TimelineNode = __decorateClass$R([
6425
6281
  customNode("TimelineNode")
@@ -6460,8 +6316,8 @@ let CanvasItem = class extends TimelineNode {
6460
6316
  super();
6461
6317
  this.setProperties(properties).append(nodes);
6462
6318
  }
6463
- _updateProperty(key, value, oldValue, declaration) {
6464
- super._updateProperty(key, value, oldValue, declaration);
6319
+ _updateProperty(key, value, oldValue) {
6320
+ super._updateProperty(key, value, oldValue);
6465
6321
  switch (key) {
6466
6322
  case "modulate":
6467
6323
  this._modulate.value = value;
@@ -6591,10 +6447,10 @@ __decorateClass$Q([
6591
6447
  property()
6592
6448
  ], CanvasItem.prototype, "blendMode", 2);
6593
6449
  __decorateClass$Q([
6594
- property({ protected: true, fallback: true })
6450
+ property({ internal: true, fallback: true })
6595
6451
  ], CanvasItem.prototype, "visible", 2);
6596
6452
  __decorateClass$Q([
6597
- property({ protected: true, fallback: 1 })
6453
+ property({ internal: true, fallback: 1 })
6598
6454
  ], CanvasItem.prototype, "opacity", 2);
6599
6455
  CanvasItem = __decorateClass$Q([
6600
6456
  customNode("CanvasItem")
@@ -6660,8 +6516,8 @@ let Viewport = class extends Node {
6660
6516
  );
6661
6517
  });
6662
6518
  }
6663
- _updateProperty(key, value, oldValue, declaration) {
6664
- super._updateProperty(key, value, oldValue, declaration);
6519
+ _updateProperty(key, value, oldValue) {
6520
+ super._updateProperty(key, value, oldValue);
6665
6521
  switch (key) {
6666
6522
  case "x":
6667
6523
  case "y":
@@ -6800,8 +6656,8 @@ let Effect = class extends TimelineNode {
6800
6656
  this._onNodeProcessed = this._onNodeProcessed.bind(this);
6801
6657
  this.setProperties(properties).append(children);
6802
6658
  }
6803
- _updateProperty(key, value, oldValue, declaration) {
6804
- super._updateProperty(key, value, oldValue, declaration);
6659
+ _updateProperty(key, value, oldValue) {
6660
+ super._updateProperty(key, value, oldValue);
6805
6661
  switch (key) {
6806
6662
  case "glsl": {
6807
6663
  const material = new EffectMaterial(value);
@@ -7170,8 +7026,8 @@ class SceneTree extends MainLoop {
7170
7026
  super();
7171
7027
  this.timeline = timeline.setTree(this);
7172
7028
  }
7173
- _updateProperty(key, value, oldValue, declaration) {
7174
- super._updateProperty(key, value, oldValue, declaration);
7029
+ _updateProperty(key, value, oldValue) {
7030
+ super._updateProperty(key, value, oldValue);
7175
7031
  switch (key) {
7176
7032
  case "backgroundColor":
7177
7033
  this._backgroundColor.value = value;
@@ -7216,20 +7072,20 @@ class SceneTree extends MainLoop {
7216
7072
  QuadUvGeometry.draw(renderer);
7217
7073
  renderer.texture.unbind(texture);
7218
7074
  }
7219
- free() {
7220
- super.free();
7221
- this.root.children.internal.forEach((node) => this.root.removeChild(node));
7075
+ destroy() {
7076
+ super.destroy();
7077
+ this.root.destroy();
7222
7078
  this.input.removeEventListeners();
7223
7079
  }
7224
7080
  }
7225
7081
  __decorateClass$L([
7226
- property({ protected: true, fallback: false })
7082
+ property({ internal: true, fallback: false })
7227
7083
  ], SceneTree.prototype, "processPaused");
7228
7084
  __decorateClass$L([
7229
7085
  property()
7230
7086
  ], SceneTree.prototype, "backgroundColor");
7231
7087
  __decorateClass$L([
7232
- property({ protected: true, fallback: false })
7088
+ property({ internal: true, fallback: false })
7233
7089
  ], SceneTree.prototype, "debug");
7234
7090
 
7235
7091
  var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
@@ -7278,8 +7134,8 @@ let Node2D = class extends CanvasItem {
7278
7134
  super();
7279
7135
  this.setProperties(properties).append(nodes);
7280
7136
  }
7281
- _updateProperty(key, value, oldValue, declaration) {
7282
- super._updateProperty(key, value, oldValue, declaration);
7137
+ _updateProperty(key, value, oldValue) {
7138
+ super._updateProperty(key, value, oldValue);
7283
7139
  switch (key) {
7284
7140
  case "rotation":
7285
7141
  this.updateGlobalTransform();
@@ -7366,10 +7222,10 @@ let Node2D = class extends CanvasItem {
7366
7222
  }
7367
7223
  };
7368
7224
  __decorateClass$J([
7369
- property({ protected: true, fallback: 0 })
7225
+ property({ internal: true, fallback: 0 })
7370
7226
  ], Node2D.prototype, "rotation", 2);
7371
7227
  __decorateClass$J([
7372
- property({ protected: true, fallback: 0 })
7228
+ property({ internal: true, fallback: 0 })
7373
7229
  ], Node2D.prototype, "globalRotation", 2);
7374
7230
  Node2D = __decorateClass$J([
7375
7231
  customNode("Node2D")
@@ -7496,10 +7352,10 @@ let Camera2D = class extends Node2D {
7496
7352
  }
7497
7353
  };
7498
7354
  __decorateClass$I([
7499
- property({ protected: true, fallback: false })
7355
+ property({ internal: true, fallback: false })
7500
7356
  ], Camera2D.prototype, "spaceKey", 2);
7501
7357
  __decorateClass$I([
7502
- property({ protected: true, fallback: false })
7358
+ property({ internal: true, fallback: false })
7503
7359
  ], Camera2D.prototype, "grabbing", 2);
7504
7360
  Camera2D = __decorateClass$I([
7505
7361
  customNode("Camera2D", {
@@ -8885,8 +8741,8 @@ void main() {
8885
8741
  this.setProperties(properties).append(children);
8886
8742
  this._generateKernels();
8887
8743
  }
8888
- _updateProperty(key, value, oldValue, declaration) {
8889
- super._updateProperty(key, value, oldValue, declaration);
8744
+ _updateProperty(key, value, oldValue) {
8745
+ super._updateProperty(key, value, oldValue);
8890
8746
  switch (key) {
8891
8747
  case "quality":
8892
8748
  case "strength":
@@ -8963,8 +8819,8 @@ let MaskEffect = class extends Effect {
8963
8819
  this.texture = await assets.texture.load(this.src);
8964
8820
  }
8965
8821
  }
8966
- _updateProperty(key, value, oldValue, declaration) {
8967
- super._updateProperty(key, value, oldValue, declaration);
8822
+ _updateProperty(key, value, oldValue) {
8823
+ super._updateProperty(key, value, oldValue);
8968
8824
  switch (key) {
8969
8825
  case "src":
8970
8826
  this.load();
@@ -9441,8 +9297,8 @@ class BaseElement2DFill extends CoreObject {
9441
9297
  isNone(properties) ? void 0 : normalizeFill(properties)
9442
9298
  );
9443
9299
  }
9444
- _updateProperty(key, value, oldValue, declaration) {
9445
- super._updateProperty(key, value, oldValue, declaration);
9300
+ _updateProperty(key, value, oldValue) {
9301
+ super._updateProperty(key, value, oldValue);
9446
9302
  switch (key) {
9447
9303
  case "color":
9448
9304
  case "cropRect":
@@ -9549,8 +9405,8 @@ class BaseElement2DBackground extends BaseElement2DFill {
9549
9405
  isNone(properties) ? void 0 : normalizeBackground(properties)
9550
9406
  );
9551
9407
  }
9552
- _updateProperty(key, value, oldValue, declaration) {
9553
- super._updateProperty(key, value, oldValue, declaration);
9408
+ _updateProperty(key, value, oldValue) {
9409
+ super._updateProperty(key, value, oldValue);
9554
9410
  switch (key) {
9555
9411
  case "fillWithShape":
9556
9412
  this.parent.requestRedraw();
@@ -9577,8 +9433,8 @@ class BaseElement2DForeground extends BaseElement2DFill {
9577
9433
  isNone(properties) ? void 0 : normalizeForeground(properties)
9578
9434
  );
9579
9435
  }
9580
- _updateProperty(key, value, oldValue, declaration) {
9581
- super._updateProperty(key, value, oldValue, declaration);
9436
+ _updateProperty(key, value, oldValue) {
9437
+ super._updateProperty(key, value, oldValue);
9582
9438
  switch (key) {
9583
9439
  case "fillWithShape":
9584
9440
  this.parent.requestRedraw();
@@ -9605,8 +9461,8 @@ class BaseElement2DOutline extends BaseElement2DFill {
9605
9461
  isNone(properties) ? void 0 : normalizeOutline(properties)
9606
9462
  );
9607
9463
  }
9608
- _updateProperty(key, value, oldValue, declaration) {
9609
- super._updateProperty(key, value, oldValue, declaration);
9464
+ _updateProperty(key, value, oldValue) {
9465
+ super._updateProperty(key, value, oldValue);
9610
9466
  switch (key) {
9611
9467
  case "width":
9612
9468
  case "style":
@@ -9674,8 +9530,8 @@ class BaseElement2DShadow extends CoreObject {
9674
9530
  isNone(properties) ? void 0 : normalizeShadow(properties)
9675
9531
  );
9676
9532
  }
9677
- _updateProperty(key, value, oldValue, declaration) {
9678
- super._updateProperty(key, value, oldValue, declaration);
9533
+ _updateProperty(key, value, oldValue) {
9534
+ super._updateProperty(key, value, oldValue);
9679
9535
  switch (key) {
9680
9536
  case "color":
9681
9537
  case "blur":
@@ -9738,8 +9594,8 @@ class BaseElement2DShape extends CoreObject {
9738
9594
  isNone(properties) ? void 0 : normalizeShape(properties)
9739
9595
  );
9740
9596
  }
9741
- _updateProperty(key, value, oldValue, declaration) {
9742
- super._updateProperty(key, value, oldValue, declaration);
9597
+ _updateProperty(key, value, oldValue) {
9598
+ super._updateProperty(key, value, oldValue);
9743
9599
  switch (key) {
9744
9600
  case "svg":
9745
9601
  case "paths":
@@ -9845,7 +9701,7 @@ class BaseElement2DText extends CoreObject {
9845
9701
  case "effects":
9846
9702
  case "fill":
9847
9703
  case "outline":
9848
- this.setter(args[0], args[1]);
9704
+ this.setProperty(args[0], args[1]);
9849
9705
  break;
9850
9706
  }
9851
9707
  this._updateProperty(...args);
@@ -9859,8 +9715,8 @@ class BaseElement2DText extends CoreObject {
9859
9715
  isNone(properties) ? void 0 : normalizeText(properties)
9860
9716
  );
9861
9717
  }
9862
- _updateProperty(key, value, oldValue, declaration) {
9863
- super._updateProperty(key, value, oldValue, declaration);
9718
+ _updateProperty(key, value, oldValue) {
9719
+ super._updateProperty(key, value, oldValue);
9864
9720
  switch (key) {
9865
9721
  case "enabled":
9866
9722
  case "effects":
@@ -10052,10 +9908,10 @@ __decorateClass$m([
10052
9908
  property({ alias: "base.outline" })
10053
9909
  ], BaseElement2DText.prototype, "outline");
10054
9910
  __decorateClass$m([
10055
- property({ protected: true, alias: "base.measureDom" })
9911
+ property({ internal: true, alias: "base.measureDom" })
10056
9912
  ], BaseElement2DText.prototype, "measureDom");
10057
9913
  __decorateClass$m([
10058
- property({ protected: true, alias: "base.fonts" })
9914
+ property({ internal: true, alias: "base.fonts" })
10059
9915
  ], BaseElement2DText.prototype, "fonts");
10060
9916
 
10061
9917
  var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
@@ -10076,8 +9932,8 @@ let BaseElement2D = class extends Node2D {
10076
9932
  }
10077
9933
  set style(style) {
10078
9934
  const cb = (...args) => {
10079
- this.emit("updateStyleProperty", ...args);
10080
- this._updateStyleProperty(args[0], args[1], args[2], args[3]);
9935
+ this.emit("updateStyleProperty", args[0], args[1], args[2]);
9936
+ this._updateStyleProperty(args[0], args[1], args[2]);
10081
9937
  };
10082
9938
  style.on("updateProperty", cb);
10083
9939
  this._style?.off("updateProperty", cb);
@@ -10163,7 +10019,7 @@ let BaseElement2D = class extends Node2D {
10163
10019
  }
10164
10020
  return this;
10165
10021
  }
10166
- _updateStyleProperty(key, value, oldValue, _declaration) {
10022
+ _updateStyleProperty(key, value, oldValue) {
10167
10023
  switch (key) {
10168
10024
  case "rotate":
10169
10025
  this.rotation = this.style.rotate * DEG_TO_RAD;
@@ -10416,7 +10272,7 @@ let BaseElement2D = class extends Node2D {
10416
10272
  return this.style.pointerEvents !== "none";
10417
10273
  }
10418
10274
  input(event, key) {
10419
- const array = this._children.internal;
10275
+ const array = this.getChildren(true);
10420
10276
  for (let i = array.length - 1; i >= 0; i--) {
10421
10277
  array[i].input(event, key);
10422
10278
  }
@@ -10513,8 +10369,8 @@ let Element2D = class extends BaseElement2D {
10513
10369
  }
10514
10370
  set style(style) {
10515
10371
  const cb = (...args) => {
10516
- this.emit("updateStyleProperty", ...args);
10517
- this._updateStyleProperty(args[0], args[1], args[2], args[3]);
10372
+ this.emit("updateStyleProperty", args[0], args[1], args[2]);
10373
+ this._updateStyleProperty(args[0], args[1], args[2]);
10518
10374
  };
10519
10375
  style.on("updateProperty", cb);
10520
10376
  this._style?.off("updateProperty", cb);
@@ -10525,8 +10381,8 @@ let Element2D = class extends BaseElement2D {
10525
10381
  this.style = new Element2DStyle();
10526
10382
  this.setProperties(properties).append(nodes);
10527
10383
  }
10528
- _updateStyleProperty(key, value, oldValue, declaration) {
10529
- super._updateStyleProperty(key, value, oldValue, declaration);
10384
+ _updateStyleProperty(key, value, oldValue) {
10385
+ super._updateStyleProperty(key, value, oldValue);
10530
10386
  switch (key) {
10531
10387
  case "left":
10532
10388
  this.position.x = Number(value);
@@ -10706,7 +10562,7 @@ class FlexLayout {
10706
10562
  return this._node.getComputedLayout();
10707
10563
  }
10708
10564
  // eslint-disable-next-line unused-imports/no-unused-vars
10709
- updateStyleProperty(key, value, oldValue, declaration) {
10565
+ updateStyleProperty(key, value, oldValue) {
10710
10566
  switch (key) {
10711
10567
  case "alignContent":
10712
10568
  this._node.setAlignContent(
@@ -10876,8 +10732,8 @@ let FlexElement2D = class extends BaseElement2D {
10876
10732
  }
10877
10733
  set style(style) {
10878
10734
  const cb = (...args) => {
10879
- this.emit("updateStyleProperty", ...args);
10880
- this._updateStyleProperty(args[0], args[1], args[2], args[3]);
10735
+ this.emit("updateStyleProperty", args[0], args[1], args[2]);
10736
+ this._updateStyleProperty(args[0], args[1], args[2]);
10881
10737
  };
10882
10738
  style.on("updateProperty", cb);
10883
10739
  this._style?.off("updateProperty", cb);
@@ -10916,9 +10772,9 @@ let FlexElement2D = class extends BaseElement2D {
10916
10772
  oldParent._layout._node.removeChild(this._layout._node);
10917
10773
  }
10918
10774
  }
10919
- _updateStyleProperty(key, value, oldValue, declaration) {
10920
- super._updateStyleProperty(key, value, oldValue, declaration);
10921
- this._layout.updateStyleProperty(key, value, oldValue, declaration);
10775
+ _updateStyleProperty(key, value, oldValue) {
10776
+ super._updateStyleProperty(key, value, oldValue);
10777
+ this._layout.updateStyleProperty(key, value, oldValue);
10922
10778
  if (this._layout._node.isDirty()) {
10923
10779
  this.requestRelayout();
10924
10780
  }
@@ -10980,8 +10836,8 @@ let Image2D = class extends Element2D {
10980
10836
  this.setProperties(properties);
10981
10837
  this.append(children);
10982
10838
  }
10983
- _updateProperty(key, value, oldValue, declaration) {
10984
- super._updateProperty(key, value, oldValue, declaration);
10839
+ _updateProperty(key, value, oldValue) {
10840
+ super._updateProperty(key, value, oldValue);
10985
10841
  switch (key) {
10986
10842
  case "src":
10987
10843
  this._wait = this._load(value);
@@ -11142,8 +10998,8 @@ let Lottie2D = class extends TextureRect2D {
11142
10998
  this.setProperties(properties);
11143
10999
  this.append(children);
11144
11000
  }
11145
- _updateProperty(key, value, oldValue, declaration) {
11146
- super._updateProperty(key, value, oldValue, declaration);
11001
+ _updateProperty(key, value, oldValue) {
11002
+ super._updateProperty(key, value, oldValue);
11147
11003
  switch (key) {
11148
11004
  case "src":
11149
11005
  this._load();
@@ -11195,8 +11051,8 @@ class TransformRect2D extends Element2D {
11195
11051
  super();
11196
11052
  this.setProperties(properties).append(nodes);
11197
11053
  }
11198
- _updateStyleProperty(key, value, oldValue, declaration) {
11199
- super._updateStyleProperty(key, value, oldValue, declaration);
11054
+ _updateStyleProperty(key, value, oldValue) {
11055
+ super._updateStyleProperty(key, value, oldValue);
11200
11056
  switch (key) {
11201
11057
  case "width":
11202
11058
  case "height":
@@ -11257,8 +11113,8 @@ let Video2D = class extends TextureRect2D {
11257
11113
  this.setProperties(properties);
11258
11114
  this.append(children);
11259
11115
  }
11260
- _updateProperty(key, value, oldValue, declaration) {
11261
- super._updateProperty(key, value, oldValue, declaration);
11116
+ _updateProperty(key, value, oldValue) {
11117
+ super._updateProperty(key, value, oldValue);
11262
11118
  switch (key) {
11263
11119
  case "src":
11264
11120
  this._wait = this._load(value);
@@ -11393,8 +11249,8 @@ let Animation = class extends TimelineNode {
11393
11249
  this.commitStyles();
11394
11250
  }
11395
11251
  }
11396
- _updateProperty(key, value, oldValue, declaration) {
11397
- super._updateProperty(key, value, oldValue, declaration);
11252
+ _updateProperty(key, value, oldValue) {
11253
+ super._updateProperty(key, value, oldValue);
11398
11254
  switch (key) {
11399
11255
  case "effectMode":
11400
11256
  case "keyframes":
@@ -11406,7 +11262,7 @@ let Animation = class extends TimelineNode {
11406
11262
  let targets;
11407
11263
  switch (this.effectMode) {
11408
11264
  case "sibling":
11409
- targets = this.getParent()?.children.internal.filter((val) => val instanceof CanvasItem) ?? [];
11265
+ targets = this.getParent()?.getChildren(true).filter((val) => val instanceof CanvasItem) ?? [];
11410
11266
  break;
11411
11267
  case "parent":
11412
11268
  default:
@@ -11651,7 +11507,7 @@ Animation = __decorateClass$e([
11651
11507
  })
11652
11508
  ], Animation);
11653
11509
 
11654
- class HTMLAudioContext extends EventEmitter {
11510
+ class HTMLAudioContext extends Observable {
11655
11511
  static _instance;
11656
11512
  static get instance() {
11657
11513
  if (!this._instance) {
@@ -11690,12 +11546,9 @@ class HTMLAudioContext extends EventEmitter {
11690
11546
  this.refreshPaused();
11691
11547
  return this.paused;
11692
11548
  }
11693
- free() {
11694
- this.removeAllListeners();
11695
- }
11696
11549
  }
11697
11550
 
11698
- class HTMLSound extends EventEmitter {
11551
+ class HTMLSound extends Observable {
11699
11552
  static PADDING = 0.1;
11700
11553
  _source = null;
11701
11554
  _audio = null;
@@ -11901,9 +11754,9 @@ class HTMLSound extends EventEmitter {
11901
11754
  this.emit("progress", 1, this._duration);
11902
11755
  this.emit("end", this);
11903
11756
  }
11904
- free() {
11757
+ destroy() {
11905
11758
  Ticker.off(this._onUpdate);
11906
- this.removeAllListeners();
11759
+ super.destroy();
11907
11760
  const source = this._source;
11908
11761
  if (source) {
11909
11762
  source.onended = null;
@@ -11966,7 +11819,7 @@ class HTMLAudio {
11966
11819
  }
11967
11820
  }
11968
11821
 
11969
- class AudioPipeline extends EventEmitter {
11822
+ class AudioPipeline extends Observable {
11970
11823
  constructor(_input, _output) {
11971
11824
  super();
11972
11825
  this._input = _input;
@@ -12190,7 +12043,7 @@ class WebAudioContext extends AudioPipeline {
12190
12043
  }
12191
12044
  }
12192
12045
 
12193
- class WebSound extends EventEmitter {
12046
+ class WebSound extends Observable {
12194
12047
  _audio = null;
12195
12048
  _sourceNode = null;
12196
12049
  _gain = null;
@@ -12422,8 +12275,8 @@ class WebSound extends EventEmitter {
12422
12275
  Ticker.on(this._updateListener);
12423
12276
  }
12424
12277
  }
12425
- free() {
12426
- this.removeAllListeners();
12278
+ destroy() {
12279
+ super.destroy();
12427
12280
  this._stop();
12428
12281
  this._gain?.disconnect();
12429
12282
  this._gain = null;
@@ -12619,8 +12472,8 @@ let Audio = class extends TimelineNode {
12619
12472
  super();
12620
12473
  this.src = src;
12621
12474
  }
12622
- _updateProperty(key, value, oldValue, declaration) {
12623
- super._updateProperty(key, value, oldValue, declaration);
12475
+ _updateProperty(key, value, oldValue) {
12476
+ super._updateProperty(key, value, oldValue);
12624
12477
  switch (key) {
12625
12478
  case "paused":
12626
12479
  this.refreshPaused();
@@ -12707,7 +12560,7 @@ let Audio = class extends TimelineNode {
12707
12560
  this._recycleSound(sound);
12708
12561
  };
12709
12562
  _recycleSound(sound) {
12710
- sound.free();
12563
+ sound.destroy();
12711
12564
  if (!Audio._soundPool.includes(sound)) {
12712
12565
  Audio._soundPool.push(sound);
12713
12566
  }
@@ -12767,8 +12620,8 @@ let AudioWaveform = class extends Element2D {
12767
12620
  super();
12768
12621
  this.setProperties(options);
12769
12622
  }
12770
- _updateProperty(key, value, oldValue, declaration) {
12771
- super._updateProperty(key, value, oldValue, declaration);
12623
+ _updateProperty(key, value, oldValue) {
12624
+ super._updateProperty(key, value, oldValue);
12772
12625
  switch (key) {
12773
12626
  case "src":
12774
12627
  this._loadSrc(value);
@@ -12851,10 +12704,10 @@ __decorateClass$c([
12851
12704
  property()
12852
12705
  ], AudioWaveform.prototype, "src", 2);
12853
12706
  __decorateClass$c([
12854
- property()
12707
+ property({ fallback: 0 })
12855
12708
  ], AudioWaveform.prototype, "gap", 2);
12856
12709
  __decorateClass$c([
12857
- property()
12710
+ property({ fallback: "#000000" })
12858
12711
  ], AudioWaveform.prototype, "color", 2);
12859
12712
  AudioWaveform = __decorateClass$c([
12860
12713
  customNode("AudioWaveform")
@@ -12894,8 +12747,8 @@ let Control = class extends Element2D {
12894
12747
  super._input(event, key);
12895
12748
  this._guiInput(event, key);
12896
12749
  }
12897
- _updateStyleProperty(key, value, oldValue, declaration) {
12898
- super._updateStyleProperty(key, value, oldValue, declaration);
12750
+ _updateStyleProperty(key, value, oldValue) {
12751
+ super._updateStyleProperty(key, value, oldValue);
12899
12752
  switch (key) {
12900
12753
  case "width":
12901
12754
  case "height":
@@ -12928,8 +12781,8 @@ let Range = class extends Control {
12928
12781
  super();
12929
12782
  this.setProperties(properties).append(children);
12930
12783
  }
12931
- _updateProperty(key, value, oldValue, declaration) {
12932
- super._updateProperty(key, value, oldValue, declaration);
12784
+ _updateProperty(key, value, oldValue) {
12785
+ super._updateProperty(key, value, oldValue);
12933
12786
  switch (key) {
12934
12787
  case "allowGreater":
12935
12788
  case "allowLesser":
@@ -12985,8 +12838,8 @@ let Ruler = class extends Control {
12985
12838
  this.setProperties(properties);
12986
12839
  this.append(children);
12987
12840
  }
12988
- _updateProperty(key, value, oldValue, declaration) {
12989
- super._updateProperty(key, value, oldValue, declaration);
12841
+ _updateProperty(key, value, oldValue) {
12842
+ super._updateProperty(key, value, oldValue);
12990
12843
  switch (key) {
12991
12844
  case "offsetX":
12992
12845
  case "offsetY":
@@ -13001,8 +12854,8 @@ let Ruler = class extends Control {
13001
12854
  break;
13002
12855
  }
13003
12856
  }
13004
- _updateStyleProperty(key, value, oldValue, declaration) {
13005
- super._updateStyleProperty(key, value, oldValue, declaration);
12857
+ _updateStyleProperty(key, value, oldValue) {
12858
+ super._updateStyleProperty(key, value, oldValue);
13006
12859
  switch (key) {
13007
12860
  case "width":
13008
12861
  case "height":
@@ -13169,8 +13022,8 @@ let ScrollBar = class extends Range {
13169
13022
  super();
13170
13023
  this.setProperties(properties).append(children);
13171
13024
  }
13172
- _updateStyleProperty(key, value, oldValue, declaration) {
13173
- super._updateStyleProperty(key, value, oldValue, declaration);
13025
+ _updateStyleProperty(key, value, oldValue) {
13026
+ super._updateStyleProperty(key, value, oldValue);
13174
13027
  switch (key) {
13175
13028
  case "width":
13176
13029
  case "height":
@@ -13289,8 +13142,8 @@ let Scaler = class extends Node {
13289
13142
  this.setProperties(properties);
13290
13143
  this.append(children);
13291
13144
  }
13292
- _updateProperty(key, value, oldValue, declaration) {
13293
- super._updateProperty(key, value, oldValue, declaration);
13145
+ _updateProperty(key, value, oldValue) {
13146
+ super._updateProperty(key, value, oldValue);
13294
13147
  switch (key) {
13295
13148
  case "translateY":
13296
13149
  case "translateX":
@@ -13938,8 +13791,8 @@ class Assets {
13938
13791
  _handled = /* @__PURE__ */ new Map();
13939
13792
  _gc = SUPPORTS_WEAK_REF ? new FinalizationRegistry((id) => {
13940
13793
  const ref = this.get(id);
13941
- if (ref && "free" in ref) {
13942
- ref.free();
13794
+ if (ref && "destroy" in ref) {
13795
+ ref.destroy();
13943
13796
  }
13944
13797
  this._handled.delete(id);
13945
13798
  }) : void 0;
@@ -14058,8 +13911,8 @@ class Assets {
14058
13911
  gc() {
14059
13912
  this._handled.forEach((_, id) => {
14060
13913
  const ref = this.get(id);
14061
- if (ref && "free" in ref) {
14062
- ref.free();
13914
+ if (ref && "destroy" in ref) {
13915
+ ref.destroy();
14063
13916
  }
14064
13917
  });
14065
13918
  this._handled.clear();
@@ -14156,8 +14009,8 @@ let CanvasItemEditor = class extends Control {
14156
14009
  this._onPointerup = this._onPointerup.bind(this);
14157
14010
  this.append(this.ruler);
14158
14011
  }
14159
- _updateStyleProperty(key, value, oldValue, declaration) {
14160
- super._updateStyleProperty(key, value, oldValue, declaration);
14012
+ _updateStyleProperty(key, value, oldValue) {
14013
+ super._updateStyleProperty(key, value, oldValue);
14161
14014
  switch (key) {
14162
14015
  case "width":
14163
14016
  this.drawboard.style.left = (this.size.width - this.drawboard.size.width) / 2;
@@ -14423,10 +14276,10 @@ class Engine extends SceneTree {
14423
14276
  this._render(this.renderer);
14424
14277
  });
14425
14278
  }
14426
- free() {
14427
- super.free();
14279
+ destroy() {
14280
+ super.destroy();
14428
14281
  this.enableAutoResize(false);
14429
- this.renderer.free();
14282
+ this.renderer.destroy();
14430
14283
  }
14431
14284
  toPixels() {
14432
14285
  return this.renderer.toPixels();