modern-canvas 0.14.32 → 0.14.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineProperty as rs, Observable as ue, Reactivable as ss, parseColor as li, property as h, isGradient as ci, isColorFillObject as Vr, clearUndef as is, idGenerator as yr, normalizeFill as as, isNone as N, normalizeBackground as hi, normalizeForeground as ui, normalizeOutline as di, normalizeShadow as fi, normalizeShape as pi, getDefaultStyle as _i, normalizeText as mi, normalizeTextContent as gi, getDefaultTextStyle as vi, getDefaultLayoutStyle as bi, RawWeakMap as yi } from "modern-idoc";
1
+ import { defineProperty as rs, Observable as ue, Reactivable as ss, parseColor as li, property as h, isGradient as ci, isColorFillObject as Vr, clearUndef as is, idGenerator as yr, normalizeFill as as, isNone as M, normalizeBackground as hi, normalizeForeground as ui, normalizeOutline as di, normalizeShadow as fi, normalizeShape as pi, getDefaultStyle as _i, normalizeText as mi, normalizeTextContent as gi, getDefaultTextStyle as vi, getDefaultLayoutStyle as bi, RawWeakMap as yi } from "modern-idoc";
2
2
  import { fonts as xi } from "modern-font";
3
3
  import { extend as wi } from "colord";
4
4
  import Pi from "colord/plugins/names";
@@ -1424,8 +1424,8 @@ class ra extends _s {
1424
1424
  ]);
1425
1425
  }
1426
1426
  }
1427
- class D extends _s {
1428
- static _t2d = /* @__PURE__ */ new D();
1427
+ class N extends _s {
1428
+ static _t2d = /* @__PURE__ */ new N();
1429
1429
  premultiply(e) {
1430
1430
  return e.multiply(this, this);
1431
1431
  }
@@ -1436,7 +1436,7 @@ class D extends _s {
1436
1436
  return this.skew(0, e);
1437
1437
  }
1438
1438
  skew(e, t) {
1439
- return this.premultiply(D._t2d.makeSkew(e, t));
1439
+ return this.premultiply(N._t2d.makeSkew(e, t));
1440
1440
  }
1441
1441
  makeSkew(e, t) {
1442
1442
  const s = Math.tan(e), i = Math.tan(t);
@@ -1465,7 +1465,7 @@ class D extends _s {
1465
1465
  return this.translate(e, t, s);
1466
1466
  }
1467
1467
  translate(e, t, s = 0) {
1468
- return this.premultiply(D._t2d.makeTranslation(e, t, s));
1468
+ return this.premultiply(N._t2d.makeTranslation(e, t, s));
1469
1469
  }
1470
1470
  makeTranslation(e, t, s = 0) {
1471
1471
  return this.set([
@@ -1490,7 +1490,7 @@ class D extends _s {
1490
1490
  return this.scale(e, t, s);
1491
1491
  }
1492
1492
  scale(e, t, s = 1) {
1493
- return this.premultiply(D._t2d.makeScale(e, t, s));
1493
+ return this.premultiply(N._t2d.makeScale(e, t, s));
1494
1494
  }
1495
1495
  makeScale(e, t, s = 1) {
1496
1496
  return this.set([
@@ -1515,7 +1515,7 @@ class D extends _s {
1515
1515
  return this.rotate(e);
1516
1516
  }
1517
1517
  rotate(e) {
1518
- return this.premultiply(D._t2d.makeRotation(e));
1518
+ return this.premultiply(N._t2d.makeRotation(e));
1519
1519
  }
1520
1520
  rotate3d(e, t, s, i) {
1521
1521
  const [a, o, n] = this._rotate3d(e, t, s, i);
@@ -2489,7 +2489,7 @@ function Kr(r) {
2489
2489
  let t = (r > 255 ? 1 : 0) << 3;
2490
2490
  return r >>>= t, e |= t, t = (r > 15 ? 1 : 0) << 2, r >>>= t, e |= t, t = (r > 3 ? 1 : 0) << 1, r >>>= t, e |= t, e | r >> 1;
2491
2491
  }
2492
- var I = /* @__PURE__ */ ((r) => (r[r.disabled = 0] = "disabled", r[r.renderingMaskAdd = 1] = "renderingMaskAdd", r[r.maskActive = 2] = "maskActive", r[r.inverseMaskActive = 3] = "inverseMaskActive", r[r.renderingMaskRemove = 4] = "renderingMaskRemove", r[r.none = 5] = "none", r))(I || {}), at = /* @__PURE__ */ ((r) => (r[r.none = 0] = "none", r[r.color = 16384] = "color", r[r.stencil = 1024] = "stencil", r[r.depth = 256] = "depth", r[r.colorDepth = 16640] = "colorDepth", r[r.colorStencil = 17408] = "colorStencil", r[r.depthStencil = 1280] = "depthStencil", r[r.all = 17664] = "all", r))(at || {});
2492
+ var D = /* @__PURE__ */ ((r) => (r[r.disabled = 0] = "disabled", r[r.renderingMaskAdd = 1] = "renderingMaskAdd", r[r.maskActive = 2] = "maskActive", r[r.inverseMaskActive = 3] = "inverseMaskActive", r[r.renderingMaskRemove = 4] = "renderingMaskRemove", r[r.none = 5] = "none", r))(D || {}), at = /* @__PURE__ */ ((r) => (r[r.none = 0] = "none", r[r.color = 16384] = "color", r[r.stencil = 1024] = "stencil", r[r.depth = 256] = "depth", r[r.colorDepth = 16640] = "colorDepth", r[r.colorStencil = 17408] = "colorStencil", r[r.depthStencil = 1280] = "depthStencil", r[r.all = 17664] = "all", r))(at || {});
2493
2493
  class Ea extends W {
2494
2494
  install(e) {
2495
2495
  super.install(e), e.mask = this;
@@ -2507,7 +2507,7 @@ class Ea extends W {
2507
2507
  this.stack.push(s);
2508
2508
  const i = this._renderer.renderTarget.current?.instanceId ?? -1;
2509
2509
  let a = this._maskStackHash[i] ?? 0;
2510
- "x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(I.renderingMaskAdd, a), this._renderer.colorMask.bind(0), a++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(I.maskActive, a), this._renderer.colorMask.bind(15)), this._maskStackHash[i] = a;
2510
+ "x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(D.renderingMaskAdd, a), this._renderer.colorMask.bind(0), a++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(D.maskActive, a), this._renderer.colorMask.bind(15)), this._maskStackHash[i] = a;
2511
2511
  }
2512
2512
  pop(e) {
2513
2513
  const t = this.stack.pop();
@@ -2515,7 +2515,7 @@ class Ea extends W {
2515
2515
  return;
2516
2516
  const { mask: s } = t, i = this._renderer.renderTarget.current?.instanceId ?? -1;
2517
2517
  let a = this._maskStackHash[i] ?? 0;
2518
- "x" in s && this._renderer.scissor.pop(), "render" in s && (this._renderer.flush(), a !== 0 ? this._renderer.stencil.bind(I.renderingMaskRemove, a) : (this._renderer.clear(at.stencil), this._renderer.stencil.bind(I.disabled, a)), a--, s.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(I.maskActive, a), this._renderer.colorMask.bind(15)), this._maskStackHash[i] = a;
2518
+ "x" in s && this._renderer.scissor.pop(), "render" in s && (this._renderer.flush(), a !== 0 ? this._renderer.stencil.bind(D.renderingMaskRemove, a) : (this._renderer.clear(at.stencil), this._renderer.stencil.bind(D.disabled, a)), a--, s.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(D.maskActive, a), this._renderer.colorMask.bind(15)), this._maskStackHash[i] = a;
2519
2519
  }
2520
2520
  }
2521
2521
  var _r = /* @__PURE__ */ ((r) => (r[r.RGBA = 6408] = "RGBA", r[r.RGB = 6407] = "RGB", r[r.RG = 33319] = "RG", r[r.RED = 6403] = "RED", r[r.RGBA_INTEGER = 36249] = "RGBA_INTEGER", r[r.RGB_INTEGER = 36248] = "RGB_INTEGER", r[r.RG_INTEGER = 33320] = "RG_INTEGER", r[r.RED_INTEGER = 36244] = "RED_INTEGER", r[r.ALPHA = 6406] = "ALPHA", r[r.LUMINANCE = 6409] = "LUMINANCE", r[r.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", r[r.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", r[r.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", r))(_r || {}), bs = /* @__PURE__ */ ((r) => (r[r.TEXTURE_2D = 3553] = "TEXTURE_2D", r[r.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", r[r.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", r[r.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", r[r.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", r[r.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", r[r.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", r))(bs || {}), y = /* @__PURE__ */ ((r) => (r[r.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", r[r.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", r[r.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", r[r.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", r[r.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", r[r.UNSIGNED_INT = 5125] = "UNSIGNED_INT", r[r.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", r[r.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", r[r.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", r[r.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", r[r.BYTE = 5120] = "BYTE", r[r.SHORT = 5122] = "SHORT", r[r.INT = 5124] = "INT", r[r.FLOAT = 5126] = "FLOAT", r[r.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", r[r.HALF_FLOAT = 36193] = "HALF_FLOAT", r))(y || {});
@@ -3294,12 +3294,12 @@ class Ga extends W {
3294
3294
  }
3295
3295
  }
3296
3296
  const Ne = [];
3297
- Ne[I.none] = {};
3298
- Ne[I.disabled] = {
3297
+ Ne[D.none] = {};
3298
+ Ne[D.disabled] = {
3299
3299
  stencilWriteMask: 0,
3300
3300
  stencilReadMask: 0
3301
3301
  };
3302
- Ne[I.renderingMaskAdd] = {
3302
+ Ne[D.renderingMaskAdd] = {
3303
3303
  stencilFront: {
3304
3304
  compare: "equal",
3305
3305
  passOp: "increment-clamp"
@@ -3309,7 +3309,7 @@ Ne[I.renderingMaskAdd] = {
3309
3309
  passOp: "increment-clamp"
3310
3310
  }
3311
3311
  };
3312
- Ne[I.renderingMaskRemove] = {
3312
+ Ne[D.renderingMaskRemove] = {
3313
3313
  stencilFront: {
3314
3314
  compare: "equal",
3315
3315
  passOp: "decrement-clamp"
@@ -3319,7 +3319,7 @@ Ne[I.renderingMaskRemove] = {
3319
3319
  passOp: "decrement-clamp"
3320
3320
  }
3321
3321
  };
3322
- Ne[I.maskActive] = {
3322
+ Ne[D.maskActive] = {
3323
3323
  stencilWriteMask: 0,
3324
3324
  stencilFront: {
3325
3325
  compare: "equal",
@@ -3330,7 +3330,7 @@ Ne[I.maskActive] = {
3330
3330
  passOp: "keep"
3331
3331
  }
3332
3332
  };
3333
- Ne[I.inverseMaskActive] = {
3333
+ Ne[D.inverseMaskActive] = {
3334
3334
  stencilWriteMask: 0,
3335
3335
  stencilFront: {
3336
3336
  compare: "not-equal",
@@ -3347,12 +3347,12 @@ class Va extends W {
3347
3347
  }
3348
3348
  _cache = {
3349
3349
  enabled: !1,
3350
- stencilMode: I.none,
3350
+ stencilMode: D.none,
3351
3351
  refCount: 0
3352
3352
  };
3353
3353
  current = {
3354
3354
  [-1]: {
3355
- stencilMode: I.disabled,
3355
+ stencilMode: D.disabled,
3356
3356
  refCount: 0
3357
3357
  }
3358
3358
  };
@@ -3383,20 +3383,20 @@ class Va extends W {
3383
3383
  super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
3384
3384
  }
3385
3385
  reset() {
3386
- this._cache.enabled = !1, this._cache.stencilMode = I.none, this._cache.refCount = 0;
3386
+ this._cache.enabled = !1, this._cache.stencilMode = D.none, this._cache.refCount = 0;
3387
3387
  }
3388
3388
  _updateRenderTarget = (e) => {
3389
3389
  if (e) {
3390
3390
  let t = this.current[e.instanceId];
3391
3391
  t || (t = this.current[e.instanceId] = {
3392
- stencilMode: I.disabled,
3392
+ stencilMode: D.disabled,
3393
3393
  refCount: 0
3394
3394
  }), this.bind(t.stencilMode, t.refCount);
3395
3395
  }
3396
3396
  };
3397
3397
  bind(e, t) {
3398
3398
  const s = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], i = this._gl, a = Ne[e], o = this._cache;
3399
- if (s.stencilMode = e, s.refCount = t, e === I.disabled) {
3399
+ if (s.stencilMode = e, s.refCount = t, e === D.disabled) {
3400
3400
  this._cache.enabled && (this._cache.enabled = !1, i.disable(i.STENCIL_TEST));
3401
3401
  return;
3402
3402
  }
@@ -4657,7 +4657,7 @@ function go(r) {
4657
4657
  let e = Qr[r] ?? 0;
4658
4658
  return e++, Qr[r] = e, e;
4659
4659
  }
4660
- let M = class extends Se {
4660
+ let I = class extends Se {
4661
4661
  _meta = new po(this);
4662
4662
  get meta() {
4663
4663
  return this._meta;
@@ -4917,7 +4917,7 @@ let M = class extends Se {
4917
4917
  append(...r) {
4918
4918
  let e;
4919
4919
  Array.isArray(r[0]) ? e = r[0] : e = r, e.forEach((t) => {
4920
- t instanceof M ? this.appendChild(t) : this.appendChild(M.parse(t));
4920
+ t instanceof I ? this.appendChild(t) : this.appendChild(I.parse(t));
4921
4921
  });
4922
4922
  }
4923
4923
  before(...r) {
@@ -5040,46 +5040,46 @@ let M = class extends Se {
5040
5040
  static parse(r, e = "Node") {
5041
5041
  if (Array.isArray(r))
5042
5042
  return r.map((l) => this.parse(l));
5043
- const { is: t, meta: s = {}, children: i, ...a } = r, o = xr.get(t ?? s.inCanvasIs ?? e) ?? M, n = new o({ ...a, meta: s });
5043
+ const { is: t, meta: s = {}, children: i, ...a } = r, o = xr.get(t ?? s.inCanvasIs ?? e) ?? I, n = new o({ ...a, meta: s });
5044
5044
  return i?.forEach((l) => n.appendChild(this.parse(l))), n;
5045
5045
  }
5046
5046
  };
5047
5047
  ae([
5048
5048
  h({ default: () => yr() })
5049
- ], M.prototype, "id", 2);
5049
+ ], I.prototype, "id", 2);
5050
5050
  ae([
5051
5051
  h({ default: () => yr() })
5052
- ], M.prototype, "name", 2);
5052
+ ], I.prototype, "name", 2);
5053
5053
  ae([
5054
5054
  h({ fallback: "inherit" })
5055
- ], M.prototype, "processMode", 2);
5055
+ ], I.prototype, "processMode", 2);
5056
5056
  ae([
5057
5057
  h({ fallback: "default" })
5058
- ], M.prototype, "processSortMode", 2);
5058
+ ], I.prototype, "processSortMode", 2);
5059
5059
  ae([
5060
5060
  h({ fallback: "inherit" })
5061
- ], M.prototype, "renderMode", 2);
5061
+ ], I.prototype, "renderMode", 2);
5062
5062
  ae([
5063
5063
  h({ fallback: "inherit" })
5064
- ], M.prototype, "inputMode", 2);
5064
+ ], I.prototype, "inputMode", 2);
5065
5065
  ae([
5066
5066
  h({ fallback: "default" })
5067
- ], M.prototype, "internalMode", 2);
5067
+ ], I.prototype, "internalMode", 2);
5068
5068
  ae([
5069
5069
  h({ internal: !0 })
5070
- ], M.prototype, "mask", 2);
5070
+ ], I.prototype, "mask", 2);
5071
5071
  ae([
5072
5072
  h({ internal: !0, default: !0 })
5073
- ], M.prototype, "needsRender", 2);
5074
- M = ae([
5073
+ ], I.prototype, "needsRender", 2);
5074
+ I = ae([
5075
5075
  b("Node")
5076
- ], M);
5076
+ ], I);
5077
5077
  var vo = Object.defineProperty, bo = Object.getOwnPropertyDescriptor, Ye = (r, e, t, s) => {
5078
5078
  for (var i = s > 1 ? void 0 : s ? bo(e, t) : e, a = r.length - 1, o; a >= 0; a--)
5079
5079
  (o = r[a]) && (i = (s ? o(e, t, i) : o(i)) || i);
5080
5080
  return s && i && vo(e, t, i), i;
5081
5081
  };
5082
- let q = class extends M {
5082
+ let q = class extends I {
5083
5083
  constructor(r, e = []) {
5084
5084
  super(), this.setProperties(r).append(e);
5085
5085
  }
@@ -5269,7 +5269,7 @@ let Ge = class extends q {
5269
5269
  _handleViewportTexture(r) {
5270
5270
  const e = this.tree?.getPreviousViewport();
5271
5271
  if (e && "getRect" in this) {
5272
- const { a: t, d: s, tx: i, ty: a } = e.canvasTransform.toObject(), { vertices: o } = r, n = new D().scale(1 / e.width * t, -1 / e.height * s).translate(
5272
+ const { a: t, d: s, tx: i, ty: a } = e.canvasTransform.toObject(), { vertices: o } = r, n = new N().scale(1 / e.width * t, -1 / e.height * s).translate(
5273
5273
  - -i / e.width,
5274
5274
  1 + -a / e.height
5275
5275
  ), l = new Float32Array(o.length);
@@ -5311,8 +5311,8 @@ var wo = Object.defineProperty, Po = Object.getOwnPropertyDescriptor, Le = (r, e
5311
5311
  (o = r[a]) && (i = (s ? o(e, t, i) : o(i)) || i);
5312
5312
  return s && i && wo(e, t, i), i;
5313
5313
  };
5314
- let X = class extends M {
5315
- canvasTransform = new D();
5314
+ let X = class extends I {
5315
+ canvasTransform = new N();
5316
5316
  renderTargetIndex = 0;
5317
5317
  renderTargets = [
5318
5318
  new se(),
@@ -5643,7 +5643,7 @@ var Ro = Object.defineProperty, Ao = Object.getOwnPropertyDescriptor, mt = (r, e
5643
5643
  (o = r[a]) && (i = (s ? o(e, t, i) : o(i)) || i);
5644
5644
  return s && i && Ro(e, t, i), i;
5645
5645
  };
5646
- let we = class extends M {
5646
+ let we = class extends I {
5647
5647
  currentTime = 0;
5648
5648
  static from(r, e = !1) {
5649
5649
  const [t, s] = r ? Array.isArray(r) ? r : [0, r] : [];
@@ -5814,12 +5814,12 @@ let Me = class extends Ge {
5814
5814
  scale = new O(1, 1).on("update", () => this.updateGlobalTransform());
5815
5815
  skew = new O().on("update", () => this.updateGlobalTransform());
5816
5816
  pivot = new O().on("update", () => this.updateGlobalTransform());
5817
- extraTransform = new D();
5818
- transform = new D();
5817
+ extraTransform = new N();
5818
+ transform = new N();
5819
5819
  globalPosition = new O();
5820
5820
  globalScale = new O();
5821
5821
  globalSkew = new O();
5822
- globalTransform = new D();
5822
+ globalTransform = new N();
5823
5823
  _parentTransformDirtyId;
5824
5824
  constructor(r, e = []) {
5825
5825
  super(), this.setProperties(r).append(e);
@@ -5887,7 +5887,7 @@ var Uo = Object.defineProperty, Bo = Object.getOwnPropertyDescriptor, Or = (r, e
5887
5887
  return s && i && Uo(e, t, i), i;
5888
5888
  };
5889
5889
  let kt = class extends Me {
5890
- canvasTransform = new D();
5890
+ canvasTransform = new N();
5891
5891
  _screenOffset = { x: 0, y: 0 };
5892
5892
  _zoom = new O(1, 1).on("update", () => this.updateTransform());
5893
5893
  get zoom() {
@@ -6062,7 +6062,7 @@ function vc(r) {
6062
6062
  }
6063
6063
  return e;
6064
6064
  }
6065
- function Lo(r, e, t, s = new D()) {
6065
+ function Lo(r, e, t, s = new N()) {
6066
6066
  return r = !r || r === "none" ? "" : r, Gt(r, { width: e, height: t }).reverse().forEach(({ name: i, args: a }) => {
6067
6067
  const o = a.map((n) => n.normalizedIntValue);
6068
6068
  switch (i) {
@@ -7887,7 +7887,7 @@ Pe = gt([
7887
7887
  function Ut(r, e) {
7888
7888
  const { x: t, y: s, width: i, height: a } = e;
7889
7889
  let o = !1;
7890
- const n = new D().translate(-t, -s).scale(1 / i, 1 / a);
7890
+ const n = new N().translate(-t, -s).scale(1 / i, 1 / a);
7891
7891
  if (r.cropRect) {
7892
7892
  const {
7893
7893
  left: g = 0,
@@ -7937,7 +7937,7 @@ var Bn = Object.defineProperty, Z = (r, e, t, s) => {
7937
7937
  };
7938
7938
  class z extends Se {
7939
7939
  constructor(e) {
7940
- super(), this.parent = e;
7940
+ super(), this._parent = e;
7941
7941
  }
7942
7942
  texture;
7943
7943
  animatedTexture;
@@ -7946,7 +7946,7 @@ class z extends Se {
7946
7946
  }
7947
7947
  setProperties(e) {
7948
7948
  return this._setProperties(
7949
- N(e) ? void 0 : as(e)
7949
+ M(e) ? void 0 : as(e)
7950
7950
  );
7951
7951
  }
7952
7952
  _updateProperty(e, t, s) {
@@ -7959,7 +7959,7 @@ class z extends Se {
7959
7959
  case "tile":
7960
7960
  case "opacity":
7961
7961
  case "enabled":
7962
- this.parent.requestDraw();
7962
+ this._parent.requestDraw();
7963
7963
  break;
7964
7964
  case "image":
7965
7965
  case "linearGradient":
@@ -7972,12 +7972,12 @@ class z extends Se {
7972
7972
  if (this.linearGradient || this.radialGradient)
7973
7973
  this.texture = new Ht(
7974
7974
  this.linearGradient ?? this.radialGradient,
7975
- Math.floor(this.parent.size.width),
7976
- Math.floor(this.parent.size.height)
7975
+ Math.floor(this._parent.size.width),
7976
+ Math.floor(this._parent.size.height)
7977
7977
  );
7978
- else if (N(this.image))
7978
+ else if (M(this.image))
7979
7979
  this.animatedTexture = void 0, this.texture = void 0;
7980
- else if (this.parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
7980
+ else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
7981
7981
  let e = this.image.split("?")[0].endsWith(".gif");
7982
7982
  const t = this.image, s = await V.loadBy(t, async () => {
7983
7983
  const i = await V.fetch(t).then((a) => a.blob());
@@ -7987,13 +7987,13 @@ class z extends Se {
7987
7987
  }
7988
7988
  }
7989
7989
  async _updateTexture() {
7990
- await this.loadTexture(), this.parent.requestDraw();
7990
+ await this.loadTexture(), this._parent.requestDraw();
7991
7991
  }
7992
7992
  isValid() {
7993
7993
  return !!(this.enabled && (this.texture || this.animatedTexture || this.color || this.image === "viewport"));
7994
7994
  }
7995
7995
  draw() {
7996
- const { width: e, height: t } = this.parent.size, s = this.parent.context;
7996
+ const { width: e, height: t } = this._parent.size, s = this._parent.context;
7997
7997
  let i = {
7998
7998
  size: { width: e, height: t }
7999
7999
  };
@@ -8006,7 +8006,7 @@ class z extends Se {
8006
8006
  const e = this.animatedTexture?.duration ?? 0;
8007
8007
  if (!e)
8008
8008
  return 0;
8009
- const t = this.parent.currentTime;
8009
+ const t = this._parent.currentTime;
8010
8010
  return t < 0 ? 0 : t % e;
8011
8011
  }
8012
8012
  updateFrameIndex() {
@@ -8021,7 +8021,7 @@ class z extends Se {
8021
8021
  i = o;
8022
8022
  break;
8023
8023
  }
8024
- return this.animatedTexture.frameIndex !== i && (this.animatedTexture.frameIndex = i, this.parent.requestDraw()), this;
8024
+ return this.animatedTexture.frameIndex !== i && (this.animatedTexture.frameIndex = i, this._parent.requestDraw()), this;
8025
8025
  }
8026
8026
  process(e) {
8027
8027
  this.updateFrameIndex();
@@ -8068,11 +8068,11 @@ var Ln = Object.defineProperty, Fn = (r, e, t, s) => {
8068
8068
  class Ws extends z {
8069
8069
  setProperties(e) {
8070
8070
  return super._setProperties(
8071
- N(e) ? void 0 : hi(e)
8071
+ M(e) ? void 0 : hi(e)
8072
8072
  );
8073
8073
  }
8074
8074
  _updateProperty(e, t, s) {
8075
- super._updateProperty(e, t, s), e === "fillWithShape" && this.parent.requestDraw();
8075
+ super._updateProperty(e, t, s), e === "fillWithShape" && this._parent.requestDraw();
8076
8076
  }
8077
8077
  }
8078
8078
  Fn([
@@ -8086,11 +8086,11 @@ var zn = Object.defineProperty, Gn = (r, e, t, s) => {
8086
8086
  class qs extends z {
8087
8087
  setProperties(e) {
8088
8088
  return super._setProperties(
8089
- N(e) ? void 0 : ui(e)
8089
+ M(e) ? void 0 : ui(e)
8090
8090
  );
8091
8091
  }
8092
8092
  _updateProperty(e, t, s) {
8093
- super._updateProperty(e, t, s), e === "fillWithShape" && this.parent.requestDraw();
8093
+ super._updateProperty(e, t, s), e === "fillWithShape" && this._parent.requestDraw();
8094
8094
  }
8095
8095
  }
8096
8096
  Gn([
@@ -8104,7 +8104,7 @@ var Vn = Object.defineProperty, vt = (r, e, t, s) => {
8104
8104
  class Ze extends z {
8105
8105
  setProperties(e) {
8106
8106
  return super._setProperties(
8107
- N(e) ? void 0 : di(e)
8107
+ M(e) ? void 0 : di(e)
8108
8108
  );
8109
8109
  }
8110
8110
  _updateProperty(e, t, s) {
@@ -8114,7 +8114,7 @@ class Ze extends z {
8114
8114
  case "lineCap":
8115
8115
  case "lineJoin":
8116
8116
  case "enabled":
8117
- this.parent.requestDraw();
8117
+ this._parent.requestDraw();
8118
8118
  break;
8119
8119
  }
8120
8120
  }
@@ -8122,7 +8122,7 @@ class Ze extends z {
8122
8122
  return !!(this.enabled && (this.width || this.color || super.isValid()));
8123
8123
  }
8124
8124
  draw() {
8125
- const { width: e, height: t } = this.parent.size, s = this.parent.context;
8125
+ const { width: e, height: t } = this._parent.size, s = this._parent.context;
8126
8126
  this.image === "viewport" ? s.strokeStyle = new Ar() : s.strokeStyle = this.texture ?? this.color ?? "#000000FF", s.lineWidth = this.width || 1, s.lineCap = this.lineCap, s.lineJoin = this.lineJoin, s.stroke({
8127
8127
  ...Ut(this, { x: 0, y: 0, width: e, height: t })
8128
8128
  });
@@ -8150,11 +8150,11 @@ var $n = Object.defineProperty, bt = (r, e, t, s) => {
8150
8150
  };
8151
8151
  class Je extends Se {
8152
8152
  constructor(e) {
8153
- super(), this.parent = e;
8153
+ super(), this._parent = e;
8154
8154
  }
8155
8155
  setProperties(e) {
8156
8156
  return super.setProperties(
8157
- N(e) ? void 0 : fi(e)
8157
+ M(e) ? void 0 : fi(e)
8158
8158
  );
8159
8159
  }
8160
8160
  _updateProperty(e, t, s) {
@@ -8169,8 +8169,8 @@ class Je extends Se {
8169
8169
  }
8170
8170
  updateEffect() {
8171
8171
  const e = "__$shadow";
8172
- let t = this.parent.getNode(e);
8173
- this.blur || this.offsetX || this.offsetY ? (t || (t = new ie({ name: e }), this.parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this.parent.removeChild(t);
8172
+ let t = this._parent.getNode(e);
8173
+ this.blur || this.offsetX || this.offsetY ? (t || (t = new ie({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
8174
8174
  }
8175
8175
  }
8176
8176
  bt([
@@ -8195,12 +8195,12 @@ var Hn = Object.defineProperty, yt = (r, e, t, s) => {
8195
8195
  };
8196
8196
  class Qe extends Se {
8197
8197
  constructor(e) {
8198
- super(), this.parent = e, this._updatePath2DSet();
8198
+ super(), this._parent = e, this._updatePath2DSet();
8199
8199
  }
8200
8200
  _path2DSet = new Ei();
8201
8201
  setProperties(e) {
8202
8202
  return super.setProperties(
8203
- N(e) ? void 0 : pi(e)
8203
+ M(e) ? void 0 : pi(e)
8204
8204
  );
8205
8205
  }
8206
8206
  _updateProperty(e, t, s) {
@@ -8209,7 +8209,7 @@ class Qe extends Se {
8209
8209
  case "paths":
8210
8210
  case "viewBox":
8211
8211
  case "enabled":
8212
- this._updatePath2DSet(), this.parent.requestDraw();
8212
+ this._updatePath2DSet(), this._parent.requestDraw();
8213
8213
  break;
8214
8214
  }
8215
8215
  }
@@ -8222,7 +8222,7 @@ class Qe extends Se {
8222
8222
  const o = Si(this.svg);
8223
8223
  this._path2DSet = Ti(o), e = this._path2DSet.viewBox;
8224
8224
  } else
8225
- this.paths?.forEach((o, n) => {
8225
+ this._path2DSet.paths.length = 0, this.paths?.forEach((o, n) => {
8226
8226
  const { data: l, ...c } = o, u = new Ot();
8227
8227
  u.style = c, u.addData(l), this._path2DSet.paths[n] = u;
8228
8228
  });
@@ -8237,7 +8237,7 @@ class Qe extends Se {
8237
8237
  }
8238
8238
  draw(e = !1) {
8239
8239
  if (!e && this.isValid()) {
8240
- const t = this.parent.context, { width: s, height: i } = this.parent.size;
8240
+ const t = this._parent.context, { width: s, height: i } = this._parent.size;
8241
8241
  this._path2DSet.paths.forEach((a) => {
8242
8242
  t.addPath(a.clone().applyTransform(new $r().scale(s, i)));
8243
8243
  });
@@ -8245,7 +8245,7 @@ class Qe extends Se {
8245
8245
  this._drawRect();
8246
8246
  }
8247
8247
  _drawRect() {
8248
- const e = this.parent.context, { width: t, height: s } = this.parent.size, { borderRadius: i } = this.parent.style;
8248
+ const e = this._parent.context, { width: t, height: s } = this._parent.size, { borderRadius: i } = this._parent.style;
8249
8249
  t && s && (i ? e.roundRect(0, 0, t, s, i) : e.rect(0, 0, t, s));
8250
8250
  }
8251
8251
  }
@@ -8285,7 +8285,7 @@ var Xn = Object.defineProperty, _e = (r, e, t, s) => {
8285
8285
  };
8286
8286
  class ne extends Se {
8287
8287
  constructor(e) {
8288
- super(), this.parent = e, this.base = new Ri(), this.base.setPropertyAccessor(this);
8288
+ super(), this._parent = e, this.base = new Ri(), this.base.setPropertyAccessor(this);
8289
8289
  }
8290
8290
  base;
8291
8291
  get textContent() {
@@ -8303,13 +8303,13 @@ class ne extends Se {
8303
8303
  _textureMap = /* @__PURE__ */ new Map();
8304
8304
  setProperties(e) {
8305
8305
  return super.setProperties(
8306
- N(e) ? void 0 : mi(e)
8306
+ M(e) ? void 0 : mi(e)
8307
8307
  );
8308
8308
  }
8309
8309
  _updateProperty(e, t, s) {
8310
8310
  switch (super._updateProperty(e, t, s), e) {
8311
8311
  case "enabled":
8312
- this.parent.requestDraw();
8312
+ this._parent.requestDraw();
8313
8313
  break;
8314
8314
  case "effects":
8315
8315
  case "measureDom":
@@ -8332,15 +8332,16 @@ class ne extends Se {
8332
8332
  });
8333
8333
  }
8334
8334
  update() {
8335
- this.base.fonts = this.base.fonts ?? this.parent.tree?.fonts, this.base.update();
8335
+ this.base.fonts = this.base.fonts ?? this._parent.tree?.fonts, this.base.update();
8336
8336
  const e = this._texture;
8337
8337
  e.width = Math.ceil(this.base.boundingBox.width), e.height = Math.ceil(this.base.boundingBox.height), this.base.render({
8338
8338
  view: e.source,
8339
8339
  pixelRatio: e.pixelRatio
8340
- }), e.requestUpdate("source"), this.parent.requestDraw();
8340
+ }), e.requestUpdate("source"), this._parent.requestDraw();
8341
8341
  }
8342
8342
  _updateTextureMap() {
8343
- this._textureMap.clear();
8343
+ if (this._textureMap.clear(), this.useTextureDraw())
8344
+ return;
8344
8345
  const e = [];
8345
8346
  if (this.base.paragraphs.forEach((t, s) => {
8346
8347
  const i = [];
@@ -8364,14 +8365,14 @@ class ne extends Se {
8364
8365
  t && Object.keys(t).length > 0 && (this._textureMap.set(e, {
8365
8366
  texture: await this._loadTexture(as(t), s),
8366
8367
  box: s
8367
- }), this.parent.requestDraw());
8368
+ }), this._parent.requestDraw());
8368
8369
  }
8369
8370
  async _loadTexture(e, t) {
8370
8371
  return e.linearGradient || e.radialGradient ? new Ht(
8371
8372
  e.linearGradient ?? e.radialGradient,
8372
8373
  t.width,
8373
8374
  t.height
8374
- ) : N(e.image) ? void 0 : (this.parent.tree?.log(`load image ${e.image}`), await V.texture.load(e.image));
8375
+ ) : M(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await V.texture.load(e.image));
8375
8376
  }
8376
8377
  setContent(e) {
8377
8378
  this.content = gi(e);
@@ -8386,18 +8387,10 @@ class ne extends Se {
8386
8387
  return !!(this.enabled && !/^\s*$/.test(this.getStringContent()));
8387
8388
  }
8388
8389
  _createTransformVertex() {
8389
- const e = this.parent;
8390
- if (e.scale.x > 0 && e.scale.y > 0)
8391
- return;
8392
- const t = e.scale.x * e.scale.y, s = e.pivot, i = new D().translate(-s.x, -s.y).scale(t > 0 ? 1 : -1, 1).translate(s.x, s.y), { a, c: o, tx: n, b: l, d: c, ty: u } = i.toObject();
8393
- let d, f;
8394
- return (m, p) => {
8395
- d = m[p], f = m[p + 1], m[p] = a * d + o * f + n, m[p + 1] = l * d + c * f + u;
8396
- };
8397
8390
  }
8398
8391
  useTextureDraw() {
8399
8392
  let e = this.drawMode;
8400
- return e === "auto" && (this.effects?.length || this.content.some((t) => t.fragments.some((s) => !!s.highlightImage)) ? e = "texture" : e = this._autoDrawMode ?? "texture"), e === "texture";
8393
+ return e === "auto" && (this.effects?.length || this.content.some((t) => t.fragments.some((s) => !!(s.highlightImage || s.highlight?.image))) ? e = "texture" : e = this._autoDrawMode ?? "texture"), e === "texture";
8401
8394
  }
8402
8395
  _pathDraw(e) {
8403
8396
  const t = this._createTransformVertex();
@@ -8406,7 +8399,7 @@ class ne extends Se {
8406
8399
  const a = i.getMeta();
8407
8400
  if (a instanceof Ai) {
8408
8401
  const o = a.parent.index, n = a.parent.parent.index;
8409
- if (i.style.fill && !N(i.style.fill))
8402
+ if (i.style.fill && !M(i.style.fill))
8410
8403
  if (typeof i.style.fill == "object") {
8411
8404
  const l = i.style.fill, c = this._textureMap.get(`${n}.${o}.fill`) ?? this._textureMap.get(`${n}.fill`) ?? this._textureMap.get("fill");
8412
8405
  l.enabled !== !1 && (c || l.color) && (e.addPath(i), e.style = { ...i.style }, e.fillStyle = c?.texture ?? l.color, e.fill({
@@ -8415,8 +8408,8 @@ class ne extends Se {
8415
8408
  c?.box ?? {
8416
8409
  x: 0,
8417
8410
  y: 0,
8418
- width: this.parent.size.width,
8419
- height: this.parent.size.height
8411
+ width: this._parent.size.width,
8412
+ height: this._parent.size.height
8420
8413
  }
8421
8414
  ),
8422
8415
  transformVertex: t
@@ -8425,7 +8418,7 @@ class ne extends Se {
8425
8418
  e.addPath(i), e.style = { ...i.style }, e.fill({
8426
8419
  transformVertex: t
8427
8420
  });
8428
- if (i.style.stroke && !N(i.style.stroke))
8421
+ if (i.style.stroke && !M(i.style.stroke))
8429
8422
  if (typeof i.style.stroke == "object") {
8430
8423
  const l = i.style.stroke, c = this._textureMap.get(`${n}.${o}.outline`) ?? this._textureMap.get(`${n}.outline`) ?? this._textureMap.get("outline");
8431
8424
  l.enabled !== !1 && (c || l.color) && (l.width === void 0 || l.width) && (e.addPath(i), e.style = { ...i.style }, e.lineWidth = l.width || 1, e.strokeStyle = c?.texture ?? l.color, e.lineCap = l.lineCap, e.lineJoin = l.lineJoin, e.stroke({
@@ -8434,8 +8427,8 @@ class ne extends Se {
8434
8427
  c?.box ?? {
8435
8428
  x: 0,
8436
8429
  y: 0,
8437
- width: this.parent.size.width,
8438
- height: this.parent.size.height
8430
+ width: this._parent.size.width,
8431
+ height: this._parent.size.height
8439
8432
  }
8440
8433
  ),
8441
8434
  transformVertex: t
@@ -8445,9 +8438,9 @@ class ne extends Se {
8445
8438
  transformVertex: t
8446
8439
  });
8447
8440
  } else
8448
- e.addPath(i), e.style = { ...i.style }, i.style.fill && !N(i.style.fill) && e.fill({
8441
+ e.addPath(i), e.style = { ...i.style }, i.style.fill && !M(i.style.fill) && e.fill({
8449
8442
  transformVertex: this._createTransformVertex()
8450
- }), i.style.stroke && !N(i.style.stroke) && e.stroke({
8443
+ }), i.style.stroke && !M(i.style.stroke) && e.stroke({
8451
8444
  transformVertex: this._createTransformVertex()
8452
8445
  });
8453
8446
  });
@@ -8456,7 +8449,7 @@ class ne extends Se {
8456
8449
  _textureDraw(e) {
8457
8450
  const { left: t = 0, top: s = 0, width: i, height: a } = this.base.boundingBox;
8458
8451
  e.fillStyle = this._texture, e.rect(t, s, i, a);
8459
- const o = new D().translate(-t, -s).scale(1 / i, 1 / a), { a: n, c: l, tx: c, b: u, d, ty: f } = o.toObject();
8452
+ const o = new N().translate(-t, -s).scale(1 / i, 1 / a), { a: n, c: l, tx: c, b: u, d, ty: f } = o.toObject();
8460
8453
  let m, p;
8461
8454
  e.fill({
8462
8455
  transformUv: (_, g) => {
@@ -8466,15 +8459,15 @@ class ne extends Se {
8466
8459
  });
8467
8460
  }
8468
8461
  draw() {
8469
- const e = this.parent.context;
8462
+ const e = this._parent.context;
8470
8463
  this.useTextureDraw() ? this._textureDraw(e) : this._pathDraw(e);
8471
8464
  }
8472
8465
  process(e) {
8473
8466
  if (this.drawMode === "auto") {
8474
- const { width: t, height: s } = this.base.boundingBox, i = this.parent.getViewport();
8467
+ const { width: t, height: s } = this.base.boundingBox, i = this._parent.getViewport();
8475
8468
  if (i) {
8476
8469
  const { a, d: o } = i.canvasTransform.toObject(), n = this._autoDrawMode;
8477
- t * a < this._autoDrawThreshold || s * o < this._autoDrawThreshold ? this._autoDrawMode = "texture" : this._autoDrawMode = "path", n !== this._autoDrawMode && this.parent.requestDraw();
8470
+ t * a < this._autoDrawThreshold || s * o < this._autoDrawThreshold ? this._autoDrawMode = "texture" : this._autoDrawMode = "path", n !== this._autoDrawMode && (this._autoDrawMode === "path" && this._updateTextureMap(), this._parent.requestDraw());
8478
8471
  }
8479
8472
  }
8480
8473
  }
@@ -8486,7 +8479,7 @@ _e([
8486
8479
  h({ fallback: () => [] })
8487
8480
  ], ne.prototype, "content");
8488
8481
  _e([
8489
- h({ alias: "parent.style.json" })
8482
+ h({ alias: "_parent.style.json" })
8490
8483
  ], ne.prototype, "style");
8491
8484
  _e([
8492
8485
  h()
@@ -8616,7 +8609,7 @@ const R = {
8616
8609
  };
8617
8610
  class kr {
8618
8611
  constructor(e) {
8619
- this._el = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._el.on("addChild", this._addChild), this._el.on("removeChild", this._removeChild);
8612
+ this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
8620
8613
  }
8621
8614
  static _yoga;
8622
8615
  static async load() {
@@ -8658,19 +8651,19 @@ class kr {
8658
8651
  s.setAspectRatio(t);
8659
8652
  break;
8660
8653
  case "borderTop":
8661
- s.setBorder(R.top, this._el.style.borderWidth);
8654
+ s.setBorder(R.top, this._parent.style.borderWidth);
8662
8655
  break;
8663
8656
  case "borderBottom":
8664
- s.setBorder(R.bottom, this._el.style.borderWidth);
8657
+ s.setBorder(R.bottom, this._parent.style.borderWidth);
8665
8658
  break;
8666
8659
  case "borderLeft":
8667
- s.setBorder(R.left, this._el.style.borderWidth);
8660
+ s.setBorder(R.left, this._parent.style.borderWidth);
8668
8661
  break;
8669
8662
  case "borderRight":
8670
- s.setBorder(R.right, this._el.style.borderWidth);
8663
+ s.setBorder(R.right, this._parent.style.borderWidth);
8671
8664
  break;
8672
8665
  case "border":
8673
- s.setBorder(R.all, this._el.style.borderWidth);
8666
+ s.setBorder(R.all, this._parent.style.borderWidth);
8674
8667
  break;
8675
8668
  case "direction":
8676
8669
  s.setDirection(
@@ -8794,7 +8787,7 @@ class kr {
8794
8787
  }
8795
8788
  }
8796
8789
  update() {
8797
- const e = this._el, t = this.node;
8790
+ const e = this._parent, t = this.node;
8798
8791
  if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, At.ltr), t.hasNewLayout())) {
8799
8792
  const { left: s, top: i, width: a, height: o } = t.getComputedLayout();
8800
8793
  (!Number.isNaN(s) && s !== e.position.x || !Number.isNaN(i) && i !== e.position.y) && e.position.set(s, i), (!Number.isNaN(a) && a !== e.size.x || !Number.isNaN(o) && o !== e.size.y) && e.size.set(a, o), t.markLayoutSeen();
@@ -8975,7 +8968,7 @@ let Ee = class extends Me {
8975
8968
  this._overflowHidden = e === "hidden";
8976
8969
  break;
8977
8970
  case "pointerEvents":
8978
- this._allowPointerEvents = !N(e);
8971
+ this._allowPointerEvents = !M(e);
8979
8972
  break;
8980
8973
  case "borderRadius":
8981
8974
  this.requestDraw();
@@ -9011,13 +9004,13 @@ let Ee = class extends Me {
9011
9004
  this._parentGlobalDisplay !== e?.globalDisplay && this.updateGlobalDisplay(), this.flexbox.update(), super._process(r);
9012
9005
  }
9013
9006
  _updateStyleFilter(r) {
9014
- N(r) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new $e({
9007
+ M(r) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new $e({
9015
9008
  name: "styleFilter",
9016
9009
  internalMode: "front"
9017
9010
  }), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = r);
9018
9011
  }
9019
9012
  _updateStyleMaskImage(r) {
9020
- N(r) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new We({
9013
+ M(r) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new We({
9021
9014
  name: "styleMaskImage",
9022
9015
  internalMode: "back"
9023
9016
  }), this.append(this._maskEffect)), this._maskEffect.image = r);
@@ -9159,7 +9152,7 @@ class Ks extends Ee {
9159
9152
  _drawContent() {
9160
9153
  if (this.texture?.isValid()) {
9161
9154
  this.shape.draw(!0), this.context.fillStyle = this.texture;
9162
- const { a: e, c: t, tx: s, b: i, d: a, ty: o } = new D().scale(1 / this.size.x, 1 / this.size.y).toObject();
9155
+ const { a: e, c: t, tx: s, b: i, d: a, ty: o } = new N().scale(1 / this.size.x, 1 / this.size.y).toObject();
9163
9156
  let n, l;
9164
9157
  this.context.fill({
9165
9158
  transformUv: (c, u) => {
@@ -9262,7 +9255,7 @@ let vr = class extends Ks {
9262
9255
  _updateVideoCurrentTime() {
9263
9256
  const r = this.texture;
9264
9257
  if (r && !r.isPlaying && !r.seeking) {
9265
- const e = ~~Math.max(0, this.currentTime % (r.duration * 1e3)) / 1e3;
9258
+ const e = ~~Math.max(0, this.currentTime % this.videoDuration) / 1e3;
9266
9259
  r.currentTime !== e && (r.currentTime = e);
9267
9260
  }
9268
9261
  }
@@ -11089,7 +11082,7 @@ export {
11089
11082
  ea as Matrix4,
11090
11083
  po as Meta,
11091
11084
  fs as MouseInputEvent,
11092
- M as Node,
11085
+ I as Node,
11093
11086
  Me as Node2D,
11094
11087
  It as Obb2D,
11095
11088
  F as OutlineEffect,
@@ -11129,7 +11122,7 @@ export {
11129
11122
  pt as TiltShiftTransition,
11130
11123
  we as Timeline,
11131
11124
  q as TimelineNode,
11132
- D as Transform2D,
11125
+ N as Transform2D,
11133
11126
  tl as TransformRect2D,
11134
11127
  Ve as Transition,
11135
11128
  zt as TwistTransition,
@@ -5,7 +5,7 @@ import { CoreObject } from '../../../core';
5
5
  export interface Element2DFill extends NormalizedFill {
6
6
  }
7
7
  export declare class Element2DFill extends CoreObject {
8
- parent: Element2D;
8
+ protected _parent: Element2D;
9
9
  enabled: boolean;
10
10
  color?: NormalizedFill['color'];
11
11
  image?: NormalizedFill['image'];
@@ -19,7 +19,7 @@ export declare class Element2DFill extends CoreObject {
19
19
  opacity?: NormalizedFill['opacity'];
20
20
  texture?: Texture2D;
21
21
  animatedTexture?: AnimatedTexture;
22
- constructor(parent: Element2D);
22
+ constructor(_parent: Element2D);
23
23
  protected _setProperties(properties?: NormalizedFill): this;
24
24
  setProperties(properties?: Fill): this;
25
25
  protected _updateProperty(key: string, value: any, oldValue: any): void;
@@ -2,13 +2,13 @@ import type { NormalizedShadow, Shadow } from 'modern-idoc';
2
2
  import type { Element2D } from './Element2D';
3
3
  import { CoreObject } from '../../../core';
4
4
  export declare class Element2DShadow extends CoreObject {
5
- parent: Element2D;
5
+ protected _parent: Element2D;
6
6
  enabled: boolean;
7
7
  color: NormalizedShadow['color'];
8
8
  blur: NormalizedShadow['blur'];
9
9
  offsetY: NormalizedShadow['offsetX'];
10
10
  offsetX: NormalizedShadow['offsetY'];
11
- constructor(parent: Element2D);
11
+ constructor(_parent: Element2D);
12
12
  setProperties(properties?: Shadow): this;
13
13
  protected _updateProperty(key: string, value: any, oldValue: any): void;
14
14
  updateEffect(): void;
@@ -3,14 +3,14 @@ import type { Element2D } from './Element2D';
3
3
  import { Path2DSet } from 'modern-path2d';
4
4
  import { CoreObject } from '../../../core';
5
5
  export declare class Element2DShape extends CoreObject {
6
- parent: Element2D;
6
+ protected _parent: Element2D;
7
7
  enabled: boolean;
8
8
  preset: NormalizedShape['preset'];
9
9
  svg: NormalizedShape['svg'];
10
10
  viewBox: NormalizedShape['viewBox'];
11
11
  paths: NormalizedShape['paths'];
12
12
  protected _path2DSet: Path2DSet;
13
- constructor(parent: Element2D);
13
+ constructor(_parent: Element2D);
14
14
  setProperties(properties?: Shape): this;
15
15
  protected _updateProperty(key: string, value: any, oldValue: any): void;
16
16
  isValid(): boolean;
@@ -11,7 +11,7 @@ import { CoreObject } from '../../../core';
11
11
  import { CanvasTexture } from '../../resources';
12
12
  export type TextDrawMode = 'auto' | 'texture' | 'path';
13
13
  export declare class Element2DText extends CoreObject {
14
- parent: Element2D;
14
+ protected _parent: Element2D;
15
15
  enabled: boolean;
16
16
  content: NormalizedText['content'];
17
17
  style: NormalizedText['style'];
@@ -32,7 +32,7 @@ export declare class Element2DText extends CoreObject {
32
32
  texture: Texture2D | undefined;
33
33
  box: RectangleLike;
34
34
  }>;
35
- constructor(parent: Element2D);
35
+ constructor(_parent: Element2D);
36
36
  setProperties(properties?: TextProperties): this;
37
37
  protected _updateProperty(key: string, value: any, oldValue: any): void;
38
38
  load(): Promise<void>;
@@ -72,11 +72,11 @@ export declare const boxSizingMap: {
72
72
  'content-box': number;
73
73
  };
74
74
  export declare class Flexbox {
75
- protected _el: Element2D;
75
+ protected _parent: Element2D;
76
76
  static _yoga?: any;
77
77
  static load(): Promise<void>;
78
78
  readonly node: YogaNode | undefined;
79
- constructor(_el: Element2D);
79
+ constructor(_parent: Element2D);
80
80
  protected _addChild(child: Node, newIndex: number): void;
81
81
  protected _removeChild(child: Node, _oldIndex: number): void;
82
82
  updateStyleProperty(key: string, value: any): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.14.32",
4
+ "version": "0.14.34",
5
5
  "packageManager": "pnpm@10.19.0",
6
6
  "description": "A JavaScript WebGL rendering engine. only the ESM.",
7
7
  "author": "wxm",