customized-fabric 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,8 @@ 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 = "", suffix = "" } = text ?? {};
21
+ const { prefix = "", infix = "", suffix = "", isAllCapital } = text ?? {};
22
+ const fullText = prefix + infix + suffix;
22
23
  this.textObject = new fabric_1.fabric.IText("", {
23
24
  originX: "center",
24
25
  originY: "center",
@@ -27,7 +28,7 @@ const CurvedTextClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group,
27
28
  fontFamily: "",
28
29
  paintFirst: "stroke",
29
30
  ...text,
30
- text: prefix + infix + suffix,
31
+ text: isAllCapital ? fullText.toUpperCase() : fullText,
31
32
  });
32
33
  const group = new fabric_1.fabric.Group([this.rectObject, this.textObject]);
33
34
  this.set({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",