customized-fabric 1.6.9 → 1.7.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.
@@ -22,7 +22,7 @@ const ClipartClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
22
22
  height: options?.height,
23
23
  });
24
24
  this.imageObject = imageObject;
25
- const group = new fabric_1.fabric.Group([this.rectObject, this.imageObject]);
25
+ const group = new fabric_1.fabric.Group([this.imageObject, this.rectObject]);
26
26
  this.set(group);
27
27
  this.on("scaling", () => {
28
28
  const attributes = {
@@ -65,7 +65,7 @@ const ClipartClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
65
65
  });
66
66
  this.remove(this.imageObject);
67
67
  this.imageObject = image;
68
- this.add(this.imageObject);
68
+ this.insertAt(this.imageObject, 0, false);
69
69
  this.fitImage(this.imageObject);
70
70
  }
71
71
  else {
@@ -76,7 +76,7 @@ const ClipartClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
76
76
  height: this.height,
77
77
  });
78
78
  this.imageObject = imageObject;
79
- this.add(this.imageObject);
79
+ this.insertAt(this.imageObject, 0, false);
80
80
  this.fitImage(this.imageObject);
81
81
  }
82
82
  this.canvas?.renderAll();
@@ -18,13 +18,16 @@ const CurvedTextClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group,
18
18
  objectCaching: false,
19
19
  ...constants_1.CURVED_TEXT_OBJECT_ATTRIBUTES.stroke,
20
20
  });
21
+ const { prefix = "", infix = "A", suffix = "" } = text ?? {};
21
22
  this.textObject = new fabric_1.fabric.IText("", {
22
23
  originX: "center",
23
24
  originY: "center",
24
25
  textAlign: "center",
25
26
  objectCaching: false,
26
27
  ...text,
28
+ text: prefix + infix + suffix,
27
29
  fontFamily: "",
30
+ paintFirst: "stroke",
28
31
  });
29
32
  const group = new fabric_1.fabric.Group([this.rectObject, this.textObject]);
30
33
  this.set(group);
@@ -17,13 +17,16 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
17
17
  objectCaching: false,
18
18
  ...constants_1.TEXT_INPUT_OBJECT_ATTRIBUTES.stroke,
19
19
  });
20
+ const { prefix = "", infix = "A", suffix = "" } = text ?? {};
20
21
  this.textObject = new fabric_1.fabric.IText("", {
21
22
  originX: "center",
22
23
  originY: "center",
23
24
  textAlign: "center",
24
25
  objectCaching: false,
25
26
  ...text,
27
+ text: prefix + infix + suffix,
26
28
  fontFamily: "",
29
+ paintFirst: "stroke",
27
30
  });
28
31
  const group = new fabric_1.fabric.Group([this.rectObject, this.textObject]);
29
32
  this.set(group);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.6.9",
3
+ "version": "1.7.1",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",