@anu3ev/fabric-image-editor 0.8.0 → 0.8.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.
Files changed (2) hide show
  1. package/dist/main.js +261 -261
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -605,7 +605,7 @@ var H = 180, U = {
605
605
  width: oe({ value: e * n }),
606
606
  height: oe({ value: t * n })
607
607
  };
608
- }, G = ({ spikes: e, outerRadius: t = 50, innerRadius: n = 22, centerX: r = 50, centerY: i = 50, rotation: a = -Math.PI / 2 }) => {
608
+ }, se = ({ spikes: e, outerRadius: t = 50, innerRadius: n = 22, centerX: r = 50, centerY: i = 50, rotation: a = -Math.PI / 2 }) => {
609
609
  let o = [], s = e * 2;
610
610
  for (let c = 0; c < s; c += 1) {
611
611
  let s = c % 2 == 0 ? t : n, l = a + c * Math.PI / e;
@@ -615,7 +615,7 @@ var H = 180, U = {
615
615
  });
616
616
  }
617
617
  return o;
618
- }, se = [
618
+ }, G = [
619
619
  {
620
620
  key: "circle",
621
621
  type: "ellipse",
@@ -822,7 +822,7 @@ var H = 180, U = {
822
822
  type: "polygon",
823
823
  width: H,
824
824
  height: H,
825
- points: G({
825
+ points: se({
826
826
  spikes: 16,
827
827
  outerRadius: 50,
828
828
  innerRadius: 45,
@@ -840,7 +840,7 @@ var H = 180, U = {
840
840
  type: "polygon",
841
841
  width: H,
842
842
  height: H,
843
- points: G({
843
+ points: se({
844
844
  spikes: 4,
845
845
  outerRadius: 50,
846
846
  innerRadius: 19.1,
@@ -1424,7 +1424,7 @@ var H = 180, U = {
1424
1424
  type: "polygon",
1425
1425
  width: H,
1426
1426
  height: H,
1427
- points: G({
1427
+ points: se({
1428
1428
  spikes: 14,
1429
1429
  outerRadius: 50,
1430
1430
  innerRadius: 40,
@@ -1503,8 +1503,8 @@ var H = 180, U = {
1503
1503
  }
1504
1504
  }
1505
1505
  ], ce = "circle", le = "center", ue = "middle", de = {};
1506
- for (let e = 0; e < se.length; e += 1) {
1507
- let t = se[e];
1506
+ for (let e = 0; e < G.length; e += 1) {
1507
+ let t = G[e];
1508
1508
  de[t.key] = t;
1509
1509
  }
1510
1510
  var fe = de, pe = ({ presetKey: e }) => fe[e] ?? null, me = ({ preset: e, rounding: t }) => B({ rounding: t }) <= 0 || e.type === "rect" ? e.key : e.roundedVariant ?? e.key;
@@ -1559,7 +1559,7 @@ function be({ value: e }) {
1559
1559
  function xe({ stroke: e, strokeWidth: t }) {
1560
1560
  return e == null ? !1 : Math.max(0, t ?? 0) > 0;
1561
1561
  }
1562
- function Se({ padding: e }) {
1562
+ function K({ padding: e }) {
1563
1563
  return {
1564
1564
  top: ye({ value: e?.top }),
1565
1565
  right: ye({ value: e?.right }),
@@ -1567,7 +1567,7 @@ function Se({ padding: e }) {
1567
1567
  left: ye({ value: e?.left })
1568
1568
  };
1569
1569
  }
1570
- function Ce({ padding: e }) {
1570
+ function Se({ padding: e }) {
1571
1571
  return {
1572
1572
  top: be({ value: e?.top }),
1573
1573
  right: be({ value: e?.right }),
@@ -1575,7 +1575,7 @@ function Ce({ padding: e }) {
1575
1575
  left: be({ value: e?.left })
1576
1576
  };
1577
1577
  }
1578
- function we({ stroke: e, strokeWidth: t }) {
1578
+ function Ce({ stroke: e, strokeWidth: t }) {
1579
1579
  if (!xe({
1580
1580
  stroke: e,
1581
1581
  strokeWidth: t
@@ -1593,16 +1593,16 @@ function we({ stroke: e, strokeWidth: t }) {
1593
1593
  left: n
1594
1594
  };
1595
1595
  }
1596
- function Te({ base: e, override: t }) {
1597
- return t ? Ce({ padding: {
1596
+ function we({ base: e, override: t }) {
1597
+ return t ? Se({ padding: {
1598
1598
  top: t.top ?? e.top,
1599
1599
  right: t.right ?? e.right,
1600
1600
  bottom: t.bottom ?? e.bottom,
1601
1601
  left: t.left ?? e.left
1602
1602
  } }) : e;
1603
1603
  }
1604
- function Ee({ base: e, addition: t }) {
1605
- let n = Se({ padding: e }), r = Se({ padding: t });
1604
+ function Te({ base: e, addition: t }) {
1605
+ let n = K({ padding: e }), r = K({ padding: t });
1606
1606
  return {
1607
1607
  top: n.top + r.top,
1608
1608
  right: n.right + r.right,
@@ -1610,16 +1610,16 @@ function Ee({ base: e, addition: t }) {
1610
1610
  left: n.left + r.left
1611
1611
  };
1612
1612
  }
1613
- function De({ baseInset: e, stroke: t, strokeWidth: n }) {
1614
- return Ee({
1613
+ function Ee({ baseInset: e, stroke: t, strokeWidth: n }) {
1614
+ return Te({
1615
1615
  base: e,
1616
- addition: we({
1616
+ addition: Ce({
1617
1617
  stroke: t,
1618
1618
  strokeWidth: n
1619
1619
  })
1620
1620
  });
1621
1621
  }
1622
- function Oe({ padding: e }) {
1622
+ function De({ padding: e }) {
1623
1623
  if (!e) return {};
1624
1624
  let t = {}, n = Object.keys(e);
1625
1625
  for (let r = 0; r < n.length; r += 1) {
@@ -1630,7 +1630,7 @@ function Oe({ padding: e }) {
1630
1630
  }
1631
1631
  //#endregion
1632
1632
  //#region src/editor/shape-manager/shape-runtime.ts
1633
- var ke = ({ group: e }) => {
1633
+ var Oe = ({ group: e }) => {
1634
1634
  let t = !!e.locked, n = e;
1635
1635
  typeof n.setInteractive == "function" && n.setInteractive(!0), n.set({
1636
1636
  evented: !0,
@@ -1642,7 +1642,7 @@ var ke = ({ group: e }) => {
1642
1642
  subTargetCheck: !0,
1643
1643
  hoverCursor: void 0
1644
1644
  });
1645
- }, Ae = ({ text: e }) => {
1645
+ }, ke = ({ text: e }) => {
1646
1646
  let t = !!(e.locked || e.group?.locked);
1647
1647
  e.set({
1648
1648
  hasBorders: !1,
@@ -1655,7 +1655,7 @@ var ke = ({ group: e }) => {
1655
1655
  autoExpand: !1,
1656
1656
  shapeNodeType: "text"
1657
1657
  }), e.setCoords();
1658
- }, je = ({ group: e }) => {
1658
+ }, Ae = ({ group: e }) => {
1659
1659
  let { layoutManager: t } = e;
1660
1660
  if (!t || typeof t.unsubscribeTargets != "function") return;
1661
1661
  let n = e.getObjects();
@@ -1663,7 +1663,7 @@ var ke = ({ group: e }) => {
1663
1663
  target: e,
1664
1664
  targets: n
1665
1665
  });
1666
- }, Me = ({ group: e }) => {
1666
+ }, je = ({ group: e }) => {
1667
1667
  let t = e.getObjects();
1668
1668
  for (let e = 0; e < t.length; e += 1) {
1669
1669
  let n = t[e];
@@ -1674,23 +1674,23 @@ var ke = ({ group: e }) => {
1674
1674
  if (n instanceof _) return n;
1675
1675
  }
1676
1676
  return null;
1677
- }, Ne = [
1677
+ }, Me = [
1678
1678
  "tl",
1679
1679
  "tr",
1680
1680
  "bl",
1681
1681
  "br"
1682
- ], Pe = ({ transform: e }) => {
1682
+ ], Ne = ({ transform: e }) => {
1683
1683
  let { originX: t, originY: n } = e;
1684
1684
  return (t === "center" || t === .5) && (n === "center" || n === .5);
1685
- }, Fe = ({ transform: e, x: t, y: n }) => {
1685
+ }, Pe = ({ transform: e, x: t, y: n }) => {
1686
1686
  let r = e, { target: i } = r, { scaleX: a = 1, scaleY: o = 1 } = i, s = b.getLocalPoint(r, r.originX, r.originY, t, n), c = Math.sign(s.x || r.signX || 1), l = Math.sign(s.y || r.signY || 1);
1687
1687
  r.signX === void 0 && (r.signX = c), r.signY === void 0 && (r.signY = l);
1688
1688
  let u = i._getTransformedDimensions(), d = Math.abs(s.x * a / u.x), f = Math.abs(s.y * o / u.y);
1689
- Pe({ transform: r }) && (d *= 2, f *= 2);
1689
+ Ne({ transform: r }) && (d *= 2, f *= 2);
1690
1690
  let p = !i.lockScalingX && (!i.lockScalingFlip || r.signX === c), m = !i.lockScalingY && (!i.lockScalingFlip || r.signY === l);
1691
1691
  return p && i.set("scaleX", d), m && i.set("scaleY", f), a !== i.scaleX || o !== i.scaleY;
1692
- }, Ie = () => {
1693
- let e = b.wrapWithFireEvent("scaling", b.wrapWithFixedAnchor((e, t, n, r) => Fe({
1692
+ }, Fe = () => {
1693
+ let e = b.wrapWithFireEvent("scaling", b.wrapWithFixedAnchor((e, t, n, r) => Pe({
1694
1694
  transform: t,
1695
1695
  x: n,
1696
1696
  y: r
@@ -1706,31 +1706,31 @@ var ke = ({ group: e }) => {
1706
1706
  a.uniformScaling = s;
1707
1707
  }
1708
1708
  };
1709
- }, Le = ({ control: e }) => {
1709
+ }, Ie = ({ control: e }) => {
1710
1710
  let t = new r({
1711
1711
  ...e,
1712
- actionHandler: Ie()
1712
+ actionHandler: Fe()
1713
1713
  });
1714
1714
  return t.shapeFreeScaleCornerControl = !0, t;
1715
- }, Re = ({ group: e }) => {
1715
+ }, Le = ({ group: e }) => {
1716
1716
  let t = { ...e.controls };
1717
- Ne.forEach((n) => {
1717
+ Me.forEach((n) => {
1718
1718
  let r = e.controls[n];
1719
- r && (r.shapeFreeScaleCornerControl || (t[n] = Le({ control: r })));
1719
+ r && (r.shapeFreeScaleCornerControl || (t[n] = Ie({ control: r })));
1720
1720
  }), e.controls = t;
1721
- }, ze = "shape-group";
1722
- function Be() {
1721
+ }, Re = "shape-group";
1722
+ function ze() {
1723
1723
  return { performLayout() {} };
1724
1724
  }
1725
- function Ve({ layoutManager: e }) {
1725
+ function Be({ layoutManager: e }) {
1726
1726
  let t = y.getClass("layoutManager");
1727
1727
  if (!e) return new t();
1728
1728
  let { strategy: n, type: r } = e, i = y.getClass(r);
1729
1729
  return n ? new i(new (y.getClass(n))()) : new i();
1730
1730
  }
1731
- var He = class e extends l {
1731
+ var Ve = class e extends l {
1732
1732
  static {
1733
- this.type = ze;
1733
+ this.type = Re;
1734
1734
  }
1735
1735
  constructor(e = [], t = {}) {
1736
1736
  let { layoutManager: n, objectCaching: r, centeredScaling: i, lockScalingFlip: a, ...o } = t;
@@ -1747,23 +1747,23 @@ var He = class e extends l {
1747
1747
  objectCaching: !1,
1748
1748
  shapeComposite: !0
1749
1749
  }), this.shapeTextAutoExpand === void 0 && (this.shapeTextAutoExpand = !0), this.shapeAlignHorizontal === void 0 && (this.shapeAlignHorizontal = le), this.shapeAlignVertical === void 0 && (this.shapeAlignVertical = ue);
1750
- let e = Ce({ padding: {
1750
+ let e = Se({ padding: {
1751
1751
  top: this.shapePaddingTop,
1752
1752
  right: this.shapePaddingRight,
1753
1753
  bottom: this.shapePaddingBottom,
1754
1754
  left: this.shapePaddingLeft
1755
1755
  } });
1756
- this.shapePaddingTop = e.top, this.shapePaddingRight = e.right, this.shapePaddingBottom = e.bottom, this.shapePaddingLeft = e.left, this._syncRoundability(), ke({ group: this }), Re({ group: this });
1757
- let t = Me({ group: this });
1758
- t && Ae({ text: t }), je({ group: this }), this.setCoords();
1756
+ this.shapePaddingTop = e.top, this.shapePaddingRight = e.right, this.shapePaddingBottom = e.bottom, this.shapePaddingLeft = e.left, this._syncRoundability(), Oe({ group: this }), Le({ group: this });
1757
+ let t = je({ group: this });
1758
+ t && ke({ text: t }), Ae({ group: this }), this.setCoords();
1759
1759
  }
1760
1760
  static async fromObject({ type: t, objects: n = [], layoutManager: r, ...i }, a) {
1761
1761
  let [o, s] = await Promise.all([C.enlivenObjects(n, a), C.enlivenObjectEnlivables(i, a)]), c = new e(o, {
1762
1762
  ...i,
1763
1763
  ...s,
1764
- layoutManager: Be()
1764
+ layoutManager: ze()
1765
1765
  });
1766
- return c.layoutManager = Ve({ layoutManager: r }), c.layoutManager.subscribeTargets({
1766
+ return c.layoutManager = Be({ layoutManager: r }), c.layoutManager.subscribeTargets({
1767
1767
  type: "initialization",
1768
1768
  target: c,
1769
1769
  targets: c.getObjects()
@@ -1776,19 +1776,19 @@ var He = class e extends l {
1776
1776
  let t = pe({ presetKey: e });
1777
1777
  t && (this.shapeCanRound = ve({ preset: t }));
1778
1778
  }
1779
- }, Ue = () => {
1780
- y?.setClass && y.setClass(He, ze);
1781
- }, K = (e) => e instanceof He || e instanceof l && e.shapeComposite === !0, We = ({ target: e, subTargets: t = [] }) => {
1782
- if (K(e)) return e;
1783
- if (e?.group && K(e.group)) return e.group;
1779
+ }, He = () => {
1780
+ y?.setClass && y.setClass(Ve, Re);
1781
+ }, q = (e) => e instanceof Ve || e instanceof l && e.shapeComposite === !0, Ue = ({ target: e, subTargets: t = [] }) => {
1782
+ if (q(e)) return e;
1783
+ if (e?.group && q(e.group)) return e.group;
1784
1784
  for (let e = 0; e < t.length; e += 1) {
1785
1785
  let n = t[e];
1786
- if (K(n)) return n;
1786
+ if (q(n)) return n;
1787
1787
  let { group: r } = n;
1788
- if (r && K(r)) return r;
1788
+ if (r && q(r)) return r;
1789
1789
  }
1790
1790
  return null;
1791
- }, Ge = ({ group: e }) => {
1791
+ }, We = ({ group: e }) => {
1792
1792
  let t = e.getObjects();
1793
1793
  for (let e = 0; e < t.length; e += 1) {
1794
1794
  let n = t[e];
@@ -1799,7 +1799,7 @@ var He = class e extends l {
1799
1799
  if (!(n instanceof _)) return n;
1800
1800
  }
1801
1801
  return null;
1802
- }, Ke = ({ group: e }) => {
1802
+ }, Ge = ({ group: e }) => {
1803
1803
  let t = e.getObjects();
1804
1804
  for (let e = 0; e < t.length; e += 1) {
1805
1805
  let n = t[e];
@@ -1810,11 +1810,11 @@ var He = class e extends l {
1810
1810
  if (n instanceof _) return n;
1811
1811
  }
1812
1812
  return null;
1813
- }, q = ({ group: e }) => ({
1814
- shape: Ge({ group: e }),
1815
- text: Ke({ group: e })
1813
+ }, Ke = ({ group: e }) => ({
1814
+ shape: We({ group: e }),
1815
+ text: Ge({ group: e })
1816
1816
  }), qe = ({ group: e }) => {
1817
- ke({ group: e });
1817
+ Oe({ group: e });
1818
1818
  }, Je = {
1819
1819
  style: {
1820
1820
  position: "absolute",
@@ -2017,7 +2017,7 @@ var He = class e extends l {
2017
2017
  }
2018
2018
  _resolveCurrentTarget() {
2019
2019
  let e = this.canvas.getActiveObject();
2020
- return We({ target: e }) ?? e ?? null;
2020
+ return Ue({ target: e }) ?? e ?? null;
2021
2021
  }
2022
2022
  destroy() {
2023
2023
  this.el.removeEventListener("mouseover", this._onBtnOver), this.el.removeEventListener("mouseout", this._onBtnOut), this.canvas.off("mouse:down", this._onMouseDown), this.canvas.off("object:moving", this._onObjectMoving), this.canvas.off("object:scaling", this._onObjectScaling), this.canvas.off("object:rotating", this._onObjectRotating), this.canvas.off("mouse:up", this._onMouseUp), this.canvas.off("object:modified", this._onObjectModified), this.canvas.off("selection:created", this._onSelectionChange), this.canvas.off("selection:updated", this._onSelectionChange), this.canvas.off("after:render", this._onSelectionChange), this.canvas.off("selection:cleared", this._onSelectionClear), this.el.remove();
@@ -4483,7 +4483,7 @@ function xn({ padding: e, internalShapeTextInset: t, height: n, textHeight: r, c
4483
4483
  };
4484
4484
  }
4485
4485
  function Sn({ text: e, width: t, height: n, padding: r, internalShapeTextInset: i, expandShapeHeightToFitText: a, changedPadding: o, measureTextboxHeightForFrame: s, resolveMinimumTextFrameWidth: c }) {
4486
- let l = Math.max(1, t), u = Math.max(1, n), d = Se({ padding: r }), f = Se({ padding: i }), p = bn({
4486
+ let l = Math.max(1, t), u = Math.max(1, n), d = K({ padding: r }), f = K({ padding: i }), p = bn({
4487
4487
  text: e,
4488
4488
  width: l,
4489
4489
  height: u,
@@ -4580,7 +4580,7 @@ var On = ({ text: e, width: t, height: n, alignV: r, padding: i, internalShapeTe
4580
4580
  appliedUserPadding: h
4581
4581
  });
4582
4582
  }, kn = ({ text: e, width: t, height: n, alignV: r, padding: i, internalShapeTextInset: a, resolveInternalShapeTextInset: o, expandShapeHeightToFitText: s = !0, changedPadding: c }) => {
4583
- let l = Ce({ padding: i }), u = Se({ padding: a }), d = Math.max(Y, t), f = Math.max(Y, n), p = Sn({
4583
+ let l = Se({ padding: i }), u = K({ padding: a }), d = Math.max(Y, t), f = Math.max(Y, n), p = Sn({
4584
4584
  text: e,
4585
4585
  width: d,
4586
4586
  height: f,
@@ -4804,7 +4804,7 @@ var Mn = ({ text: e, currentWidth: t, minimumWidth: n, padding: r, montageAreaWi
4804
4804
  let a = Un({
4805
4805
  width: Math.max(Y, t),
4806
4806
  height: Math.max(Y, n),
4807
- padding: Se({ padding: i })
4807
+ padding: K({ padding: i })
4808
4808
  }), o = Xn({
4809
4809
  text: e,
4810
4810
  frameWidth: a.width
@@ -4849,22 +4849,22 @@ function In({ text: e }) {
4849
4849
  return (e.text ?? "").trim().length > 0;
4850
4850
  }
4851
4851
  function Ln({ width: e, padding: t, resolvePaddingForWidth: n }) {
4852
- return Se(n ? { padding: n({ width: Math.max(Y, e) }) } : { padding: t });
4852
+ return K(n ? { padding: n({ width: Math.max(Y, e) }) } : { padding: t });
4853
4853
  }
4854
4854
  function Rn({ width: e, height: t, padding: n, resolvePaddingForSize: r }) {
4855
- return Se(r ? { padding: r({
4855
+ return K(r ? { padding: r({
4856
4856
  width: Math.max(Y, e),
4857
4857
  height: Math.max(Y, t)
4858
4858
  }) } : { padding: n });
4859
4859
  }
4860
4860
  function zn({ width: e, height: t, internalShapeTextInset: n, resolveInternalShapeTextInset: r }) {
4861
- return Se(r ? { padding: r({
4861
+ return K(r ? { padding: r({
4862
4862
  width: Math.max(Y, e),
4863
4863
  height: Math.max(Y, t)
4864
4864
  }) } : { padding: n });
4865
4865
  }
4866
4866
  function Bn({ text: e, width: t, height: n, padding: r, internalShapeTextInset: i, resolveInternalShapeTextInset: a, expandShapeHeightToFitText: o = !0, changedPadding: s }) {
4867
- let c = Ce({ padding: r }), l = Se({ padding: i }), u = Math.max(Y, t), d = Math.max(Y, n), f = Sn({
4867
+ let c = Se({ padding: r }), l = K({ padding: i }), u = Math.max(Y, t), d = Math.max(Y, n), f = Sn({
4868
4868
  text: e,
4869
4869
  width: u,
4870
4870
  height: d,
@@ -5160,8 +5160,8 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5160
5160
  constructor({ canvas: t }) {
5161
5161
  this.handleObjectScaling = (t) => {
5162
5162
  let { target: n, transform: r } = t;
5163
- if (!K(n)) return;
5164
- let i = n, { shape: a, text: o } = q({ group: i });
5163
+ if (!q(n)) return;
5164
+ let i = n, { shape: a, text: o } = Ke({ group: i });
5165
5165
  if (!a || !o) return;
5166
5166
  i.set({
5167
5167
  lockScalingFlip: !0,
@@ -5221,12 +5221,12 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5221
5221
  let n = this.canvas._currentTransform;
5222
5222
  if (!n) return;
5223
5223
  let { target: r } = n;
5224
- if (!K(r)) return;
5224
+ if (!q(r)) return;
5225
5225
  let { canScaleHeight: i, canScaleWidth: a } = sr({ transform: n });
5226
5226
  if (!a && !i) return;
5227
5227
  let o = r, s = this.scalingState.get(o);
5228
5228
  if (!s || s.isProportionalScaling) return;
5229
- let { shape: c, text: l } = q({ group: o });
5229
+ let { shape: c, text: l } = Ke({ group: o });
5230
5230
  if (!c || !l) return;
5231
5231
  let u = e._resolveScalingConstraintPadding({ group: o }), d = o.shapeAlignHorizontal ?? "center", f = Math.abs(o.scaleX ?? s.lastAllowedScaleX ?? 1) || 1, p = Math.abs(o.scaleY ?? s.lastAllowedScaleY ?? 1) || 1, m = {
5232
5232
  ...t,
@@ -5310,12 +5310,12 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5310
5310
  }), this.canvas.requestRenderAll();
5311
5311
  }, this.handleObjectModified = (t) => {
5312
5312
  let { target: n } = t;
5313
- if (!K(n)) return;
5313
+ if (!q(n)) return;
5314
5314
  let r = n, i = this.scalingState.get(r), a = Math.abs(r.scaleX ?? 1) || 1, o = Math.abs(r.scaleY ?? 1) || 1;
5315
5315
  if (!(Math.abs(a - 1) > Z || Math.abs(o - 1) > Z) && !i) return;
5316
5316
  let s = i?.startWidth ?? Math.max(X, r.shapeBaseWidth ?? r.width ?? r.shapeManualBaseWidth ?? X), c = i?.startHeight ?? Math.max(X, r.shapeBaseHeight ?? r.height ?? r.shapeManualBaseHeight ?? X), l = i?.startManualBaseWidth ?? Math.max(X, r.shapeManualBaseWidth ?? s), u = i?.startManualBaseHeight ?? Math.max(X, r.shapeManualBaseHeight ?? c);
5317
5317
  if (i?.blockedScaleAttempt && i) {
5318
- let { shape: e, text: t } = q({ group: r });
5318
+ let { shape: e, text: t } = Ke({ group: r });
5319
5319
  this._restoreGroupTransformOnly({
5320
5320
  group: r,
5321
5321
  shape: e,
@@ -5324,7 +5324,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5324
5324
  }), r.shapeScalingNoopTransform = !1, this.scalingState.delete(r), this.canvas.requestRenderAll();
5325
5325
  return;
5326
5326
  }
5327
- let { shape: d, text: f } = q({ group: r });
5327
+ let { shape: d, text: f } = Ke({ group: r });
5328
5328
  if (!d || !f) {
5329
5329
  this.scalingState.delete(r);
5330
5330
  return;
@@ -5647,7 +5647,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5647
5647
  });
5648
5648
  }
5649
5649
  static _resolveUserPadding({ group: e }) {
5650
- return Ce({ padding: {
5650
+ return Se({ padding: {
5651
5651
  top: e.shapePaddingTop,
5652
5652
  right: e.shapePaddingRight,
5653
5653
  bottom: e.shapePaddingBottom,
@@ -5656,7 +5656,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5656
5656
  }
5657
5657
  static _resolveInternalShapeTextInset({ group: e, width: t, height: n }) {
5658
5658
  let r = e.shapePresetKey ?? "", i = r ? pe({ presetKey: r }) : null;
5659
- return De({
5659
+ return Ee({
5660
5660
  baseInset: i ? ge({
5661
5661
  preset: i,
5662
5662
  width: t,
@@ -5763,17 +5763,17 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5763
5763
  }, vr = class {
5764
5764
  constructor({ canvas: e }) {
5765
5765
  this.handleMouseDown = (e) => {
5766
- let { target: t, e: n, subTargets: r = [] } = e, i = We({
5766
+ let { target: t, e: n, subTargets: r = [] } = e, i = Ue({
5767
5767
  target: t,
5768
5768
  subTargets: r
5769
5769
  });
5770
5770
  if (!i) return;
5771
- let { text: a } = q({ group: i });
5771
+ let { text: a } = Ke({ group: i });
5772
5772
  if (!a) return;
5773
5773
  let o = this.canvas.getActiveObject(), s = o === i;
5774
5774
  if (!(o === a && a.isEditing)) {
5775
5775
  if (!s) {
5776
- a.isEditing || Ae({ text: a });
5776
+ a.isEditing || ke({ text: a });
5777
5777
  return;
5778
5778
  }
5779
5779
  n instanceof MouseEvent && (n.detail < 2 || this.enterTextEditing({ group: i }));
@@ -5782,7 +5782,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5782
5782
  let { target: t } = e;
5783
5783
  if (!(t instanceof _)) return;
5784
5784
  let n = t, { group: r } = n;
5785
- K(r) && (this._enterTextEditingInteractionMode({
5785
+ q(r) && (this._enterTextEditingInteractionMode({
5786
5786
  group: r,
5787
5787
  text: n
5788
5788
  }), this.canvas.requestRenderAll());
@@ -5790,17 +5790,17 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5790
5790
  let { target: t } = e;
5791
5791
  if (!(t instanceof _)) return;
5792
5792
  let n = t, { group: r } = n;
5793
- K(r) && (this._restoreTextEditingInteractionMode({
5793
+ q(r) && (this._restoreTextEditingInteractionMode({
5794
5794
  group: r,
5795
5795
  text: n
5796
- }), Ae({ text: n }), this.canvas.getActiveObject() === n && this.canvas.setActiveObject(r), this.canvas.requestRenderAll());
5796
+ }), ke({ text: n }), this.canvas.getActiveObject() === n && this.canvas.setActiveObject(r), this.canvas.requestRenderAll());
5797
5797
  }, this.canvas = e, this.editingInteractionState = /* @__PURE__ */ new WeakMap(), this.editingTargetResolverState = void 0;
5798
5798
  }
5799
5799
  enterTextEditing({ group: e }) {
5800
- let { text: t } = q({ group: e });
5800
+ let { text: t } = Ke({ group: e });
5801
5801
  if (t) {
5802
5802
  if (e.locked || t.locked) {
5803
- Ae({ text: t }), this.canvas.requestRenderAll();
5803
+ ke({ text: t }), this.canvas.requestRenderAll();
5804
5804
  return;
5805
5805
  }
5806
5806
  this._enterTextEditingInteractionMode({
@@ -5860,7 +5860,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5860
5860
  let r = this.canvas, i = r.findTarget.bind(r);
5861
5861
  r.findTarget = (n) => {
5862
5862
  let r = i(n);
5863
- if (this.canvas.getActiveObject() !== t || !t.isEditing || r.target === t || We({
5863
+ if (this.canvas.getActiveObject() !== t || !t.isEditing || r.target === t || Ue({
5864
5864
  target: r.target,
5865
5865
  subTargets: r.subTargets
5866
5866
  }) !== e) return r;
@@ -5949,7 +5949,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5949
5949
  if (!t) return null;
5950
5950
  this.pendingTextUpdates.delete(e);
5951
5951
  let n = this.fireUpdated({ lifecycle: t }), { group: r } = e;
5952
- return K(r) && this.textEditingSnapshots.has(r) && this.textEditingSnapshots.set(r, n), n;
5952
+ return q(r) && this.textEditingSnapshots.has(r) && this.textEditingSnapshots.set(r, n), n;
5953
5953
  }
5954
5954
  captureResizeStart({ group: t }) {
5955
5955
  this.resizeStartSnapshots.has(t) || this.resizeStartSnapshots.set(t, e.getSnapshot({ group: t }));
@@ -5981,7 +5981,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
5981
5981
  }));
5982
5982
  }
5983
5983
  static getSnapshot({ group: t }) {
5984
- let { id: n, shapePresetKey: r, shapeBaseWidth: i, shapeBaseHeight: a, shapeManualBaseWidth: o, shapeManualBaseHeight: s, shapeTextAutoExpand: c, shapeAlignHorizontal: l, shapeAlignVertical: u, shapePaddingTop: d, shapePaddingRight: f, shapePaddingBottom: p, shapePaddingLeft: m, shapeFill: h, shapeStroke: g, shapeStrokeWidth: _, shapeStrokeDashArray: v, shapeOpacity: y, shapeRounding: b, left: x, top: S, originX: C, originY: w, angle: T, flipX: E, flipY: D, scaleX: O, scaleY: k } = t, { text: A } = q({ group: t });
5984
+ let { id: n, shapePresetKey: r, shapeBaseWidth: i, shapeBaseHeight: a, shapeManualBaseWidth: o, shapeManualBaseHeight: s, shapeTextAutoExpand: c, shapeAlignHorizontal: l, shapeAlignVertical: u, shapePaddingTop: d, shapePaddingRight: f, shapePaddingBottom: p, shapePaddingLeft: m, shapeFill: h, shapeStroke: g, shapeStrokeWidth: _, shapeStrokeDashArray: v, shapeOpacity: y, shapeRounding: b, left: x, top: S, originX: C, originY: w, angle: T, flipX: E, flipY: D, scaleX: O, scaleY: k } = t, { text: A } = Ke({ group: t });
5985
5985
  return {
5986
5986
  id: n,
5987
5987
  presetKey: r,
@@ -6083,11 +6083,11 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6083
6083
  }, br = "#B4B7BD", xr = 0, Sr = 1, Cr = class {
6084
6084
  constructor({ editor: e }) {
6085
6085
  this._handleObjectScaling = (e) => {
6086
- let t = e.target && K(e.target) ? e.target : null;
6086
+ let t = e.target && q(e.target) ? e.target : null;
6087
6087
  t && this.lifecycleController.beginResize({ group: t }), this.scalingController.handleObjectScaling(e);
6088
6088
  }, this._handleObjectModified = (e) => {
6089
6089
  this.scalingController.handleObjectModified(e);
6090
- let t = e.target && K(e.target) ? e.target : null;
6090
+ let t = e.target && q(e.target) ? e.target : null;
6091
6091
  t && this.lifecycleController.finishResize({ group: t });
6092
6092
  }, this._handleMouseMove = (e) => {
6093
6093
  this.scalingController.handleCanvasMouseMove(e);
@@ -6104,7 +6104,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6104
6104
  let t = null, { target: n } = e;
6105
6105
  if (n instanceof _) {
6106
6106
  let e = n, { group: r } = e;
6107
- K(r) && (this.editingPlacements.delete(r), t = {
6107
+ q(r) && (this.editingPlacements.delete(r), t = {
6108
6108
  group: r,
6109
6109
  textNode: e
6110
6110
  });
@@ -6114,19 +6114,19 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6114
6114
  let { target: t } = e;
6115
6115
  if (t instanceof _) {
6116
6116
  let { group: e } = t;
6117
- K(e) && (this._detachShapeGroupAutoLayout({ group: e }), this.lifecycleController.beginTextEditing({ group: e }), this.editingPlacements.set(e, this.editor.canvasManager.getObjectPlacement({ object: e })));
6117
+ q(e) && (this._detachShapeGroupAutoLayout({ group: e }), this.lifecycleController.beginTextEditing({ group: e }), this.editingPlacements.set(e, this.editor.canvasManager.getObjectPlacement({ object: e })));
6118
6118
  }
6119
6119
  this.editingController.handleTextEditingEntered(e);
6120
6120
  }, this._handleTextChanged = (e) => {
6121
6121
  let { target: t } = e;
6122
6122
  if (!(t instanceof _)) return;
6123
6123
  let n = t, { group: r } = n;
6124
- K(r) && this._syncShapeTextLayoutAfterTextMutation({ textNode: n }) && this.editor.canvas.requestRenderAll();
6124
+ q(r) && this._syncShapeTextLayoutAfterTextMutation({ textNode: n }) && this.editor.canvas.requestRenderAll();
6125
6125
  }, this._handleBeforeTextUpdated = (e) => {
6126
6126
  let { textbox: t, style: n } = e;
6127
6127
  if (!(t instanceof _)) return;
6128
6128
  let r = t, { group: i } = r;
6129
- if (!K(i) || this.internalTextUpdates.has(r)) return;
6129
+ if (!q(i) || this.internalTextUpdates.has(r)) return;
6130
6130
  let a = this.lifecycleController.beginTextUpdate({
6131
6131
  group: i,
6132
6132
  textNode: r,
@@ -6145,7 +6145,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6145
6145
  if (!(t instanceof _)) return;
6146
6146
  let n = t;
6147
6147
  this.lifecycleController.finishTextUpdate({ textNode: n });
6148
- }, this.editor = e, Ue(), this.scalingController = new _r({ canvas: e.canvas }), this.editingController = new vr({ canvas: e.canvas }), this.editingPlacements = /* @__PURE__ */ new WeakMap(), this.lifecycleController = new yr({ canvas: e.canvas }), this.internalTextUpdates = /* @__PURE__ */ new WeakSet(), this._bindEvents();
6148
+ }, this.editor = e, He(), this.scalingController = new _r({ canvas: e.canvas }), this.editingController = new vr({ canvas: e.canvas }), this.editingPlacements = /* @__PURE__ */ new WeakMap(), this.lifecycleController = new yr({ canvas: e.canvas }), this.internalTextUpdates = /* @__PURE__ */ new WeakSet(), this._bindEvents();
6149
6149
  }
6150
6150
  async add({ presetKey: e = ce, options: t = {} } = {}) {
6151
6151
  let n = pe({ presetKey: e });
@@ -6203,7 +6203,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6203
6203
  }), E = l ?? "middle", O = this._resolveShapeStyle({
6204
6204
  options: t,
6205
6205
  fallback: null
6206
- }), k = Ce({ padding: u }), A = ({ width: e, height: t }) => De({
6206
+ }), k = Se({ padding: u }), A = ({ width: e, height: t }) => Ee({
6207
6207
  baseInset: ge({
6208
6208
  preset: m,
6209
6209
  width: e,
@@ -6211,7 +6211,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6211
6211
  }),
6212
6212
  stroke: O.stroke,
6213
6213
  strokeWidth: O.strokeWidth
6214
- }), j = De({
6214
+ }), j = Ee({
6215
6215
  baseInset: ge({
6216
6216
  preset: m,
6217
6217
  width: b,
@@ -6219,10 +6219,10 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6219
6219
  }),
6220
6220
  stroke: O.stroke,
6221
6221
  strokeWidth: O.strokeWidth
6222
- }), M = Ee({
6222
+ }), M = Te({
6223
6223
  base: j,
6224
6224
  addition: k
6225
- }), N = Oe({ padding: u }), P = this._createTextNode({
6225
+ }), N = De({ padding: u }), P = this._createTextNode({
6226
6226
  text: o,
6227
6227
  textStyle: s,
6228
6228
  width: b,
@@ -6235,7 +6235,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6235
6235
  manualWidth: b,
6236
6236
  shapeTextAutoExpandEnabled: w,
6237
6237
  padding: M,
6238
- resolvePaddingForWidth: ({ width: e }) => Ee({
6238
+ resolvePaddingForWidth: ({ width: e }) => Te({
6239
6239
  base: A({
6240
6240
  width: e,
6241
6241
  height: x
@@ -6277,60 +6277,60 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6277
6277
  async update({ target: e, presetKey: t, options: n = {} } = {}) {
6278
6278
  let r = this._resolveShapeGroup({ target: e });
6279
6279
  if (!r) return null;
6280
- let i = pe({ presetKey: t ?? r.shapePresetKey ?? "circle" });
6281
- if (!i) return null;
6282
- let { left: a, top: o, originX: s, originY: c, width: l, height: u, preserveCurrentAspectRatio: d, shapeTextAutoExpand: f, text: p, textStyle: m, alignH: h, alignV: g, textPadding: _, rounding: v, withoutSelection: y, withoutSave: b } = n, x = this.editor.canvasManager.resolveObjectPlacement({
6280
+ let i = r.shapePresetKey ?? "circle", a = t ?? i, o = pe({ presetKey: a });
6281
+ if (!o) return null;
6282
+ let { left: s, top: c, originX: l, originY: u, width: d, height: f, preserveCurrentAspectRatio: p, shapeTextAutoExpand: m, text: h, textStyle: g, alignH: _, alignV: v, textPadding: y, rounding: b, withoutSelection: x, withoutSave: S } = n, C = this.editor.canvasManager.resolveObjectPlacement({
6283
6283
  object: r,
6284
- left: a,
6285
- top: o,
6286
- originX: s,
6287
- originY: c
6288
- }), S = this._resolveCurrentDimensions({ group: r }), C = this._resolveManualDimensions({ group: r }), w = this._resolveReplaceBoxDimensions({ group: r }), T = this._isShapeTextAutoExpandEnabled({ group: r }), E = f === void 0 ? T : f !== !1, D = B(v === void 0 ? { rounding: r.shapeRounding } : { rounding: v }), O = pe({ presetKey: me({
6289
- preset: i,
6290
- rounding: D
6291
- }) }) ?? i, k = ve({ preset: O }), A = k ? D : 0, { width: j, height: M } = O, N = !!d, P = t !== void 0, F = P && !N, I = F ? {
6292
- width: Math.max(1, l ?? w.width),
6293
- height: Math.max(1, u ?? w.height)
6294
- } : null, { width: ee, height: te } = I ? this._resolveAspectRatioFittedDimensions({
6295
- targetWidth: I.width,
6296
- targetHeight: I.height,
6297
- aspectWidth: j,
6298
- aspectHeight: M
6284
+ left: s,
6285
+ top: c,
6286
+ originX: l,
6287
+ originY: u
6288
+ }), w = this._resolveCurrentDimensions({ group: r }), T = this._resolveManualDimensions({ group: r }), E = this._resolveReplaceBoxDimensions({ group: r }), D = this._isShapeTextAutoExpandEnabled({ group: r }), O = m === void 0 ? D : m !== !1, k = B(b === void 0 ? { rounding: r.shapeRounding } : { rounding: b }), A = pe({ presetKey: me({
6289
+ preset: o,
6290
+ rounding: k
6291
+ }) }) ?? o, j = ve({ preset: A }), M = j ? k : 0, { width: N, height: P } = A, F = !!p, I = t !== void 0 && a !== i, ee = I && !F, te = ee ? {
6292
+ width: Math.max(1, d ?? E.width),
6293
+ height: Math.max(1, f ?? E.height)
6294
+ } : null, { width: L, height: ne } = te ? this._resolveAspectRatioFittedDimensions({
6295
+ targetWidth: te.width,
6296
+ targetHeight: te.height,
6297
+ aspectWidth: N,
6298
+ aspectHeight: P
6299
6299
  }) : {
6300
- width: Math.max(1, l ?? S.width),
6301
- height: Math.max(1, u ?? S.height)
6302
- }, L = h ?? r.shapeAlignHorizontal ?? "center", ne = g ?? r.shapeAlignVertical ?? "middle", re = this._resolveGroupUserPadding({ group: r }), R = Oe({ padding: _ }), ie = Te({
6303
- base: re,
6304
- override: _
6305
- }), z = this._resolveShapeStyle({
6300
+ width: Math.max(1, d ?? w.width),
6301
+ height: Math.max(1, f ?? w.height)
6302
+ }, re = _ ?? r.shapeAlignHorizontal ?? "center", R = v ?? r.shapeAlignVertical ?? "middle", ie = this._resolveGroupUserPadding({ group: r }), z = De({ padding: y }), V = we({
6303
+ base: ie,
6304
+ override: y
6305
+ }), H = this._resolveShapeStyle({
6306
6306
  options: n,
6307
6307
  fallback: r
6308
- }), V = ({ width: e, height: t }) => De({
6308
+ }), U = ({ width: e, height: t }) => Ee({
6309
6309
  baseInset: ge({
6310
- preset: O,
6310
+ preset: A,
6311
6311
  width: e,
6312
6312
  height: t
6313
6313
  }),
6314
- stroke: z.stroke,
6315
- strokeWidth: z.strokeWidth
6316
- }), H = Ee({
6317
- base: V({
6318
- width: ee,
6319
- height: te
6314
+ stroke: H.stroke,
6315
+ strokeWidth: H.strokeWidth
6316
+ }), ae = Te({
6317
+ base: U({
6318
+ width: L,
6319
+ height: ne
6320
6320
  }),
6321
- addition: ie
6322
- }), U = C.width, ae = C.height;
6323
- P && (U = ee, ae = te), !P && l !== void 0 && (U = Math.max(1, l)), !P && u !== void 0 && (ae = Math.max(1, u)), !P && l === void 0 && T && !E && (U = S.width);
6324
- let { shape: oe, text: W } = q({ group: r });
6325
- if (!oe || !W) return null;
6326
- let G = this.lifecycleController.createContext({
6321
+ addition: V
6322
+ }), oe = T.width, W = T.height;
6323
+ I && (oe = L, W = ne), !I && d !== void 0 && (oe = Math.max(1, d)), !I && f !== void 0 && (W = Math.max(1, f)), !I && d === void 0 && D && !O && (oe = w.width);
6324
+ let { shape: se, text: G } = Ke({ group: r });
6325
+ if (!se || !G) return null;
6326
+ let ce = this.lifecycleController.createContext({
6327
6327
  group: r,
6328
6328
  source: "update",
6329
6329
  target: e,
6330
- presetKey: O.key,
6330
+ presetKey: A.key,
6331
6331
  options: n,
6332
- withoutSave: b
6333
- }), se = {
6332
+ withoutSave: S
6333
+ }), le = {
6334
6334
  angle: 0,
6335
6335
  skewX: 0,
6336
6336
  skewY: 0,
@@ -6343,91 +6343,91 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6343
6343
  top: 0,
6344
6344
  originX: "left",
6345
6345
  originY: "top"
6346
- }, ce = W, le = this._createTextNode({
6347
- text: ce.textCaseRaw ?? W.text ?? "",
6348
- textStyle: this._resolveCurrentTextStyle({ textNode: W }),
6349
- width: Math.max(1, W.width ?? S.width),
6350
- align: L
6346
+ }, ue = G, de = this._createTextNode({
6347
+ text: ue.textCaseRaw ?? G.text ?? "",
6348
+ textStyle: this._resolveCurrentTextStyle({ textNode: G }),
6349
+ width: Math.max(1, G.width ?? w.width),
6350
+ align: re
6351
6351
  });
6352
- le.set(se), this._applyTextUpdates({
6353
- textNode: le,
6354
- text: p,
6355
- textStyle: m,
6356
- align: L
6352
+ de.set(le), this._applyTextUpdates({
6353
+ textNode: de,
6354
+ text: h,
6355
+ textStyle: g,
6356
+ align: re
6357
6357
  });
6358
- let ue = l === void 0 && u === void 0 && t === void 0 && f === void 0 && v === void 0 && p === void 0 && !this._hasShapeTextSizeAffectingStyleChanges({ textStyle: m }), de = _ !== void 0 && ue, fe = ee, he = te;
6359
- ue ? (fe = S.width, he = S.height) : F || (fe = this._resolveShapeLayoutWidth({
6360
- text: le,
6361
- currentWidth: ee,
6362
- manualWidth: U,
6363
- shapeTextAutoExpandEnabled: E,
6364
- padding: H,
6365
- resolvePaddingForWidth: ({ width: e }) => Ee({
6366
- base: V({
6358
+ let fe = d === void 0 && f === void 0 && !I && m === void 0 && b === void 0 && h === void 0 && !this._hasShapeTextSizeAffectingStyleChanges({ textStyle: g }), he = y !== void 0 && fe, _e = L, ye = ne;
6359
+ fe ? (_e = w.width, ye = w.height) : ee || (_e = this._resolveShapeLayoutWidth({
6360
+ text: de,
6361
+ currentWidth: L,
6362
+ manualWidth: oe,
6363
+ shapeTextAutoExpandEnabled: O,
6364
+ padding: ae,
6365
+ resolvePaddingForWidth: ({ width: e }) => Te({
6366
+ base: U({
6367
6367
  width: e,
6368
- height: te
6368
+ height: ne
6369
6369
  }),
6370
- addition: ie
6370
+ addition: V
6371
6371
  })
6372
6372
  }));
6373
- let _e = V({
6374
- width: fe,
6375
- height: he
6376
- }), ye = await fn({
6377
- preset: O,
6378
- width: fe,
6379
- height: he,
6380
- style: z,
6381
- rounding: A
6382
- }), be = r.getObjects().indexOf(oe);
6383
- if (be < 0) return null;
6384
- let xe = () => {
6385
- this._detachShapeGroupAutoLayout({ group: r }), W.set(se), this._applyTextUpdates({
6386
- textNode: W,
6387
- text: p,
6388
- textStyle: m,
6389
- align: L
6390
- }), r.remove(oe), r.insertAt(be, ye), this._applyShapeGroupMetadata({
6373
+ let be = U({
6374
+ width: _e,
6375
+ height: ye
6376
+ }), xe = await fn({
6377
+ preset: A,
6378
+ width: _e,
6379
+ height: ye,
6380
+ style: H,
6381
+ rounding: M
6382
+ }), K = r.getObjects().indexOf(se);
6383
+ if (K < 0) return null;
6384
+ let Se = () => {
6385
+ this._detachShapeGroupAutoLayout({ group: r }), G.set(le), this._applyTextUpdates({
6386
+ textNode: G,
6387
+ text: h,
6388
+ textStyle: g,
6389
+ align: re
6390
+ }), r.remove(se), r.insertAt(K, xe), this._applyShapeGroupMetadata({
6391
6391
  group: r,
6392
- presetKey: O.key,
6393
- presetCanRound: k,
6394
- width: fe,
6395
- height: he,
6396
- manualWidth: U,
6397
- manualHeight: ae,
6398
- replaceBoxWidth: I?.width,
6399
- replaceBoxHeight: I?.height,
6400
- shapeTextAutoExpand: E,
6401
- alignH: L,
6402
- alignV: ne,
6403
- padding: ie,
6404
- style: z,
6405
- rounding: A
6392
+ presetKey: A.key,
6393
+ presetCanRound: j,
6394
+ width: _e,
6395
+ height: ye,
6396
+ manualWidth: oe,
6397
+ manualHeight: W,
6398
+ replaceBoxWidth: te?.width,
6399
+ replaceBoxHeight: te?.height,
6400
+ shapeTextAutoExpand: O,
6401
+ alignH: re,
6402
+ alignV: R,
6403
+ padding: V,
6404
+ style: H,
6405
+ rounding: M
6406
6406
  }), this._applyCurrentLayout({
6407
6407
  group: r,
6408
- shape: ye,
6409
- text: W,
6410
- placement: x,
6411
- width: fe,
6412
- height: he,
6413
- alignH: L,
6414
- alignV: ne,
6415
- internalShapeTextInset: _e,
6416
- resolveInternalShapeTextInset: V,
6417
- preserveAspectRatio: F,
6418
- minimumReplaceBox: I ?? void 0,
6419
- expandShapeHeightToFitText: !de,
6420
- changedPadding: R
6421
- }), F && (r.shapeManualBaseWidth = Math.max(1, r.shapeBaseWidth ?? fe), r.shapeManualBaseHeight = Math.max(1, r.shapeBaseHeight ?? he)), W.isEditing && this.editingPlacements.set(r, x);
6408
+ shape: xe,
6409
+ text: G,
6410
+ placement: C,
6411
+ width: _e,
6412
+ height: ye,
6413
+ alignH: re,
6414
+ alignV: R,
6415
+ internalShapeTextInset: be,
6416
+ resolveInternalShapeTextInset: U,
6417
+ preserveAspectRatio: ee,
6418
+ minimumReplaceBox: te ?? void 0,
6419
+ expandShapeHeightToFitText: !he,
6420
+ changedPadding: z
6421
+ }), ee && (r.shapeManualBaseWidth = Math.max(1, r.shapeBaseWidth ?? _e), r.shapeManualBaseHeight = Math.max(1, r.shapeBaseHeight ?? ye)), G.isEditing && this.editingPlacements.set(r, C);
6422
6422
  };
6423
- if (!this._isOnCanvas({ object: r })) return xe(), this.lifecycleController.fireBefore({ lifecycle: G }), this.lifecycleController.fireUpdated({ lifecycle: G }), r;
6423
+ if (!this._isOnCanvas({ object: r })) return Se(), this.lifecycleController.fireBefore({ lifecycle: ce }), this.lifecycleController.fireUpdated({ lifecycle: ce }), r;
6424
6424
  this._beginMutation();
6425
6425
  try {
6426
- xe(), !W.isEditing && !y && this.editor.canvas.setActiveObject(r), this.lifecycleController.fireBefore({ lifecycle: G }), this.editor.canvas.requestRenderAll();
6426
+ Se(), !G.isEditing && !x && this.editor.canvas.setActiveObject(r), this.lifecycleController.fireBefore({ lifecycle: ce }), this.editor.canvas.requestRenderAll();
6427
6427
  } finally {
6428
- this._endMutation({ withoutSave: b });
6428
+ this._endMutation({ withoutSave: S });
6429
6429
  }
6430
- return this.lifecycleController.fireUpdated({ lifecycle: G }), r;
6430
+ return this.lifecycleController.fireUpdated({ lifecycle: ce }), r;
6431
6431
  }
6432
6432
  _resolveAspectRatioFittedDimensions({ targetWidth: e, targetHeight: t, aspectWidth: n, aspectHeight: r }) {
6433
6433
  let i = Math.max(1, n), a = Math.max(1, r), o = e === void 0 ? void 0 : Math.max(1, e), s = t === void 0 ? void 0 : Math.max(1, t);
@@ -6463,7 +6463,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6463
6463
  setFill({ target: e, fill: t, withoutSave: n }) {
6464
6464
  let r = this._resolveShapeGroup({ target: e });
6465
6465
  if (!r) return null;
6466
- let { shape: i } = q({ group: r });
6466
+ let { shape: i } = Ke({ group: r });
6467
6467
  if (!i) return null;
6468
6468
  let a = this.lifecycleController.createContext({
6469
6469
  group: r,
@@ -6485,7 +6485,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6485
6485
  setStroke({ target: e, stroke: t, strokeWidth: n, dash: r, withoutSave: i }) {
6486
6486
  let a = this._resolveShapeGroup({ target: e });
6487
6487
  if (!a) return null;
6488
- let { shape: o, text: s } = q({ group: a });
6488
+ let { shape: o, text: s } = Ke({ group: a });
6489
6489
  if (!o) return null;
6490
6490
  let c = this.lifecycleController.createContext({
6491
6491
  group: a,
@@ -6521,7 +6521,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6521
6521
  setOpacity({ target: e, opacity: t, applyToText: n = !0, withoutSave: r }) {
6522
6522
  let i = this._resolveShapeGroup({ target: e });
6523
6523
  if (!i) return null;
6524
- let { shape: a, text: o } = q({ group: i });
6524
+ let { shape: a, text: o } = Ke({ group: i });
6525
6525
  if (!a) return null;
6526
6526
  let s = this.lifecycleController.createContext({
6527
6527
  group: i,
@@ -6543,13 +6543,13 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6543
6543
  getTextNode({ target: e } = {}) {
6544
6544
  let t = this._resolveShapeGroup({ target: e });
6545
6545
  if (!t) return null;
6546
- let { text: n } = q({ group: t });
6546
+ let { text: n } = Ke({ group: t });
6547
6547
  return n || null;
6548
6548
  }
6549
6549
  updateTextStyle({ target: e, style: t = {}, withoutSave: n } = {}) {
6550
6550
  let r = this._resolveShapeGroup({ target: e });
6551
6551
  if (!r) return null;
6552
- let { shape: i, text: a } = q({ group: r });
6552
+ let { shape: i, text: a } = Ke({ group: r });
6553
6553
  if (!i || !a) return null;
6554
6554
  if (!(Object.keys(t).length > 0)) return r;
6555
6555
  let o = this._resolveManualDimensions({ group: r }), s = this.editor.canvasManager.getObjectPlacement({ object: r }), c = this._resolveShapeTextHorizontalAlign({
@@ -6583,7 +6583,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6583
6583
  setTextAlign({ target: e, horizontal: t, vertical: n, withoutSave: r }) {
6584
6584
  let i = this._resolveShapeGroup({ target: e });
6585
6585
  if (!i) return null;
6586
- let { shape: a, text: o } = q({ group: i });
6586
+ let { shape: a, text: o } = Ke({ group: i });
6587
6587
  if (!a || !o) return null;
6588
6588
  let s = this._resolveCurrentDimensions({ group: i }), c = t ?? i.shapeAlignHorizontal ?? "center", l = n ?? i.shapeAlignVertical ?? "middle", u = this.lifecycleController.createContext({
6589
6589
  group: i,
@@ -6634,7 +6634,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6634
6634
  e.on("object:scaling", this._handleObjectScaling), e.on("object:modified", this._handleObjectModified), e.on("mouse:move", this._handleMouseMove), e.on("mouse:down", this._handleMouseDown), e.on("mouse:up", this._handleMouseUp), e.on("text:editing:entered", this._handleTextEditingEntered), e.on("text:editing:exited", this._handleTextEditingExited), e.on("text:changed", this._handleTextChanged), e.on("editor:before:text-updated", this._handleBeforeTextUpdated), e.on("editor:text-updated", this._handleTextUpdated);
6635
6635
  }
6636
6636
  _createShapeGroup({ id: e, presetKey: t, presetCanRound: n, shape: r, text: i, width: a, height: o, manualWidth: s, manualHeight: c, replaceBoxWidth: l, replaceBoxHeight: u, preserveAspectRatio: d, shapeTextAutoExpand: f, alignH: p, alignV: m, padding: h, internalShapeTextInset: g, resolveInternalShapeTextInset: _, changedPadding: v, style: y, rounding: b }) {
6637
- let x = new He([r, i], {
6637
+ let x = new Ve([r, i], {
6638
6638
  originX: "center",
6639
6639
  originY: "center",
6640
6640
  left: 0,
@@ -6657,7 +6657,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6657
6657
  padding: h,
6658
6658
  style: y,
6659
6659
  rounding: b
6660
- }), x.rehydrateRuntimeState(), qe({ group: x }), Ae({ text: i }), An({
6660
+ }), x.rehydrateRuntimeState(), qe({ group: x }), ke({ text: i }), An({
6661
6661
  group: x,
6662
6662
  shape: r,
6663
6663
  text: i,
@@ -6722,7 +6722,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6722
6722
  return s.set({
6723
6723
  shapeNodeType: "text",
6724
6724
  splitByGrapheme: !1
6725
- }), Ae({ text: s }), s;
6725
+ }), ke({ text: s }), s;
6726
6726
  }
6727
6727
  _applyTextUpdates({ textNode: e, text: t, textStyle: n, align: r }) {
6728
6728
  let i = {};
@@ -6802,7 +6802,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6802
6802
  };
6803
6803
  }
6804
6804
  _resolveGroupUserPadding({ group: e }) {
6805
- return Ce({ padding: {
6805
+ return Se({ padding: {
6806
6806
  top: e.shapePaddingTop,
6807
6807
  right: e.shapePaddingRight,
6808
6808
  bottom: e.shapePaddingBottom,
@@ -6811,7 +6811,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6811
6811
  }
6812
6812
  _resolveGroupInternalShapeTextInset({ group: e, width: t, height: n }) {
6813
6813
  let r = pe({ presetKey: e.shapePresetKey ?? "circle" });
6814
- return De({
6814
+ return Ee({
6815
6815
  baseInset: r ? ge({
6816
6816
  preset: r,
6817
6817
  width: t,
@@ -6868,14 +6868,14 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6868
6868
  currentWidth: m.width,
6869
6869
  manualWidth: h.width,
6870
6870
  shapeTextAutoExpandEnabled: _,
6871
- padding: Ee({
6871
+ padding: Te({
6872
6872
  base: v({
6873
6873
  width: y,
6874
6874
  height: e
6875
6875
  }),
6876
6876
  addition: g
6877
6877
  }),
6878
- resolvePaddingForWidth: ({ width: t }) => Ee({
6878
+ resolvePaddingForWidth: ({ width: t }) => Te({
6879
6879
  base: v({
6880
6880
  width: t,
6881
6881
  height: e
@@ -6911,8 +6911,8 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6911
6911
  }
6912
6912
  _syncShapeTextLayoutAfterTextMutation({ textNode: e, textStyle: t }) {
6913
6913
  let { group: n } = e;
6914
- if (!K(n)) return !1;
6915
- let { shape: r, text: i } = q({ group: n });
6914
+ if (!q(n)) return !1;
6915
+ let { shape: r, text: i } = Ke({ group: n });
6916
6916
  if (!r || !i) return !1;
6917
6917
  this._detachShapeGroupAutoLayout({ group: n });
6918
6918
  let a = this._resolveEditingPlacement({ group: n }), o = this._resolveManualDimensions({ group: n }), s = this._resolveShapeTextHorizontalAlign({
@@ -6932,7 +6932,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6932
6932
  return this.editingPlacements.get(e) || this.editor.canvasManager.getObjectPlacement({ object: e });
6933
6933
  }
6934
6934
  _detachShapeGroupAutoLayout({ group: e }) {
6935
- je({ group: e });
6935
+ Ae({ group: e });
6936
6936
  }
6937
6937
  _resolveHorizontalAlign({ explicitAlign: e, textStyle: t }) {
6938
6938
  if (e) return e;
@@ -6967,12 +6967,12 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6967
6967
  });
6968
6968
  return;
6969
6969
  }
6970
- if (K(t)) {
6970
+ if (q(t)) {
6971
6971
  r.includes(t) || r.push(t);
6972
6972
  return;
6973
6973
  }
6974
6974
  let { group: n } = t;
6975
- !n || !K(n) || r.includes(n) || r.push(n);
6975
+ !n || !q(n) || r.includes(n) || r.push(n);
6976
6976
  };
6977
6977
  return i(t), n.forEach((e) => {
6978
6978
  i(e);
@@ -6990,24 +6990,24 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
6990
6990
  return !1;
6991
6991
  }
6992
6992
  _resolveShapeGroup({ target: e }) {
6993
- if (e instanceof l && K(e)) return e;
6993
+ if (e instanceof l && q(e)) return e;
6994
6994
  if (!e) {
6995
6995
  let e = this.editor.canvas.getActiveObject();
6996
- if (K(e)) return e;
6996
+ if (q(e)) return e;
6997
6997
  let t = e?.group;
6998
- return t && K(t) ? t : null;
6998
+ return t && q(t) ? t : null;
6999
6999
  }
7000
7000
  if (typeof e == "string") {
7001
7001
  let t = this.editor.canvas.getObjects();
7002
7002
  for (let n = 0; n < t.length; n += 1) {
7003
7003
  let r = t[n];
7004
- if (r.id === e && K(r)) return r;
7004
+ if (r.id === e && q(r)) return r;
7005
7005
  }
7006
7006
  }
7007
7007
  if (e instanceof o) {
7008
- if (K(e)) return e;
7008
+ if (q(e)) return e;
7009
7009
  let { group: t } = e;
7010
- if (t && K(t)) return t;
7010
+ if (t && q(t)) return t;
7011
7011
  }
7012
7012
  return null;
7013
7013
  }
@@ -7272,7 +7272,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
7272
7272
  this.editor = e;
7273
7273
  }
7274
7274
  lockObject({ object: e, skipInnerObjects: n, withoutSave: r } = {}) {
7275
- let { canvas: i, historyManager: a } = this.editor, o = e || i.getActiveObject(), s = We({ target: o }) ?? o;
7275
+ let { canvas: i, historyManager: a } = this.editor, o = e || i.getActiveObject(), s = Ue({ target: o }) ?? o;
7276
7276
  if (!s || s.locked) return;
7277
7277
  let c = {
7278
7278
  lockMovementX: !0,
@@ -7294,7 +7294,7 @@ var hr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
7294
7294
  });
7295
7295
  }
7296
7296
  unlockObject({ object: e, withoutSave: n } = {}) {
7297
- let { canvas: r, historyManager: i } = this.editor, a = e || r.getActiveObject(), o = We({ target: a }) ?? a;
7297
+ let { canvas: r, historyManager: i } = this.editor, a = e || r.getActiveObject(), o = Ue({ target: a }) ?? a;
7298
7298
  if (!o) return;
7299
7299
  let s = {
7300
7300
  lockMovementX: !1,
@@ -8776,16 +8776,16 @@ var ui = class {
8776
8776
  }) : null, V = {}, H = {}, U = {}, ae, oe, W = Pr({
8777
8777
  textbox: s,
8778
8778
  range: z
8779
- }), G = !z || W, se = !z;
8780
- if (h !== void 0 && (B && (H.fontFamily = h), G && (R.fontFamily = h, se && (U.fontFamily = h))), g !== void 0 && (B && (H.fontSize = g), G && (R.fontSize = g, se && (U.fontSize = g))), _ !== void 0) {
8779
+ }), se = !z || W, G = !z;
8780
+ if (h !== void 0 && (B && (H.fontFamily = h), se && (R.fontFamily = h, G && (U.fontFamily = h))), g !== void 0 && (B && (H.fontSize = g), se && (R.fontSize = g, G && (U.fontSize = g))), _ !== void 0) {
8781
8781
  let e = _ ? "bold" : "normal";
8782
- z && (V.fontWeight = e), G && (R.fontWeight = e, se && (U.fontWeight = e));
8782
+ z && (V.fontWeight = e), se && (R.fontWeight = e, G && (U.fontWeight = e));
8783
8783
  }
8784
8784
  if (v !== void 0) {
8785
8785
  let e = v ? "italic" : "normal";
8786
- z && (V.fontStyle = e), G && (R.fontStyle = e, se && (U.fontStyle = e));
8786
+ z && (V.fontStyle = e), se && (R.fontStyle = e, G && (U.fontStyle = e));
8787
8787
  }
8788
- if (y !== void 0 && (z && (V.underline = y), G && (R.underline = y, se && (U.underline = y))), x !== void 0 && (z && (V.linethrough = x), G && (R.linethrough = x, se && (U.linethrough = x))), S !== void 0 && (R.textAlign = S), C !== void 0 && (z && (V.fill = C), G && (R.fill = C, se && (U.fill = C))), w !== void 0 || T !== void 0) {
8788
+ if (y !== void 0 && (z && (V.underline = y), se && (R.underline = y, G && (U.underline = y))), x !== void 0 && (z && (V.linethrough = x), se && (R.linethrough = x, G && (U.linethrough = x))), S !== void 0 && (R.textAlign = S), C !== void 0 && (z && (V.fill = C), se && (R.fill = C, G && (U.fill = C))), w !== void 0 || T !== void 0) {
8789
8789
  let e = z ? Ir({
8790
8790
  textbox: s,
8791
8791
  range: z,
@@ -8798,7 +8798,7 @@ var ui = class {
8798
8798
  oe = Rr({ width: T ?? e ?? s.strokeWidth ?? 0 }), ae = Lr({
8799
8799
  strokeColor: w ?? t ?? s.stroke ?? void 0,
8800
8800
  width: oe
8801
- }), z && (V.stroke = ae, V.strokeWidth = oe), G && (R.stroke = ae, R.strokeWidth = oe, se && (U.stroke = ae, U.strokeWidth = oe));
8801
+ }), z && (V.stroke = ae, V.strokeWidth = oe), se && (R.stroke = ae, R.strokeWidth = oe, G && (U.stroke = ae, U.strokeWidth = oe));
8802
8802
  }
8803
8803
  E !== void 0 && (R.opacity = E), D !== void 0 && (R.backgroundColor = D), O !== void 0 && (R.backgroundOpacity = O), k !== void 0 && (R.paddingTop = k), A !== void 0 && (R.paddingRight = A), j !== void 0 && (R.paddingBottom = j), M !== void 0 && (R.paddingLeft = M), N !== void 0 && (R.radiusTopLeft = N), P !== void 0 && (R.radiusTopRight = P), F !== void 0 && (R.radiusBottomRight = F), I !== void 0 && (R.radiusBottomLeft = I);
8804
8804
  let ce = s.textCaseRaw ?? c, le = !!s.uppercase, ue = p !== void 0, de = ue ? p ?? "" : ce, fe = b ?? le, pe = fe !== le;
@@ -8824,7 +8824,7 @@ var ui = class {
8824
8824
  originX: ie.originX,
8825
8825
  originY: ie.originY
8826
8826
  })), s.uppercase = fe, s.set(R);
8827
- let Se = !1;
8827
+ let K = !1;
8828
8828
  if (z) {
8829
8829
  let e = Fr({
8830
8830
  textbox: s,
@@ -8835,21 +8835,21 @@ var ui = class {
8835
8835
  styles: H,
8836
8836
  range: B
8837
8837
  }) : !1;
8838
- Se = e || t;
8838
+ K = e || t;
8839
8839
  } else if (Object.keys(U).length) {
8840
8840
  let e = Nr({ textbox: s });
8841
- e && (Se = Fr({
8841
+ e && (K = Fr({
8842
8842
  textbox: s,
8843
8843
  styles: U,
8844
8844
  range: e
8845
8845
  }));
8846
8846
  }
8847
- let Ce = Se && $r({ stylesList: [
8847
+ let Se = K && $r({ stylesList: [
8848
8848
  V,
8849
8849
  H,
8850
8850
  U
8851
8851
  ] });
8852
- if (Se && (s.dirty = !0), B && (h !== void 0 || g !== void 0)) {
8852
+ if (K && (s.dirty = !0), B && (h !== void 0 || g !== void 0)) {
8853
8853
  let e = mi({
8854
8854
  textbox: s,
8855
8855
  range: B
@@ -8871,7 +8871,7 @@ var ui = class {
8871
8871
  updates: t
8872
8872
  });
8873
8873
  }
8874
- Ce && (s.initDimensions(), s.dirty = !0), [
8874
+ Se && (s.initDimensions(), s.dirty = !0), [
8875
8875
  D,
8876
8876
  O,
8877
8877
  ...ge,
@@ -8880,38 +8880,38 @@ var ui = class {
8880
8880
  F,
8881
8881
  I
8882
8882
  ].some((e) => e !== void 0) && (s.dirty = !0);
8883
- let { autoExpand: we } = s, Te = m !== void 0, Ee = (m ?? we) !== !1;
8884
- Te ? s.autoExpand = m !== !1 : we === void 0 && (s.autoExpand = !0);
8885
- let De = Ee && !ye && (ue || pe || me);
8883
+ let { autoExpand: Ce } = s, we = m !== void 0, Te = (m ?? Ce) !== !1;
8884
+ we ? s.autoExpand = m !== !1 : Ce === void 0 && (s.autoExpand = !0);
8885
+ let Ee = Te && !ye && (ue || pe || me);
8886
8886
  this._normalizeTextboxAfterContentChange({
8887
8887
  textbox: s,
8888
8888
  placement: ie,
8889
- shouldAutoExpand: De
8889
+ shouldAutoExpand: Ee
8890
8890
  }), xe && this._restoreTextboxContentPlacement({
8891
8891
  textbox: s,
8892
8892
  contentPlacement: xe
8893
8893
  }), s.setCoords();
8894
- let Oe = {
8894
+ let De = {
8895
8895
  withoutSave: !!r,
8896
8896
  skipRender: !!i
8897
- }, ke = !!z && Object.keys(V).length > 0, Ae = {
8897
+ }, Oe = !!z && Object.keys(V).length > 0, ke = {
8898
8898
  textbox: s,
8899
8899
  target: t,
8900
8900
  style: n,
8901
- options: Oe,
8901
+ options: De,
8902
8902
  updates: R,
8903
8903
  selectionRange: z ?? void 0,
8904
- selectionStyles: ke ? V : void 0
8904
+ selectionStyles: Oe ? V : void 0
8905
8905
  };
8906
- o && d.fire("editor:before:text-updated", Ae), i || d.requestRenderAll();
8907
- let je = e._getSnapshot(s);
8906
+ o && d.fire("editor:before:text-updated", ke), i || d.requestRenderAll();
8907
+ let Ae = e._getSnapshot(s);
8908
8908
  l.resumeHistory(), r || l.saveState();
8909
- let Me = {
8910
- ...Ae,
8909
+ let je = {
8910
+ ...ke,
8911
8911
  before: f,
8912
- after: je
8912
+ after: Ae
8913
8913
  };
8914
- return o && d.fire("editor:text-updated", Me), s;
8914
+ return o && d.fire("editor:text-updated", je), s;
8915
8915
  }
8916
8916
  stylesFromArray(e, t) {
8917
8917
  return C.stylesFromArray(e, t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anu3ev/fabric-image-editor",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "TypeScript image editor library built on FabricJS, allowing you to create instances with an integrated montage area and providing an API to modify and manage state.",
5
5
  "module": "dist/main.js",
6
6
  "files": [