@anu3ev/fabric-image-editor 0.8.21 → 0.8.22

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 +9 -3
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -9802,6 +9802,12 @@ var pa = {
9802
9802
  }
9803
9803
  return n instanceof l ? [n] : null;
9804
9804
  }
9805
+ _materializeUngroupedObject({ object: e }) {
9806
+ let { shapeManager: t, textManager: n } = this.editor, r = { target: e };
9807
+ e.shapeComposite === !0 && (r.textScale = Math.abs(e.scaleX ?? 1) || 1);
9808
+ let i = n.commitStandaloneTextScale({ target: e }), a = t.commitRehydratedShapeLayout(r);
9809
+ !i && !a && e.setCoords();
9810
+ }
9805
9811
  group({ target: e, withoutSave: t = !1 } = {}) {
9806
9812
  let { canvas: n, historyManager: r } = this.editor, i = this._getObjectsToGroup(e);
9807
9813
  if (!i) return null;
@@ -9827,7 +9833,7 @@ var pa = {
9827
9833
  a.forEach((e) => {
9828
9834
  let n = e.removeAll();
9829
9835
  r.remove(e), n.forEach((e) => {
9830
- r.add(e), t.push(e);
9836
+ this._materializeUngroupedObject({ object: e }), r.add(e), t.push(e);
9831
9837
  });
9832
9838
  });
9833
9839
  let o = new e(t, { canvas: r });
@@ -10041,11 +10047,11 @@ var pa = {
10041
10047
  this.editor = e;
10042
10048
  }
10043
10049
  static _isUngroupableGroup(e) {
10044
- return e.type === "group" && e.format !== "svg";
10050
+ return e instanceof l && e.format !== "svg";
10045
10051
  }
10046
10052
  _handleGroupDeletion(e) {
10047
10053
  let { groupingManager: t } = this.editor, { ungroupedObjects: n = [] } = t.ungroup({
10048
- object: e,
10054
+ target: e,
10049
10055
  withoutSave: !0
10050
10056
  }) ?? {};
10051
10057
  return this.deleteSelectedObjects({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anu3ev/fabric-image-editor",
3
- "version": "0.8.21",
3
+ "version": "0.8.22",
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": [