customized-fabric 1.7.1 → 1.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,7 @@ export declare const toCurvedTextObject: (object: CurvedText) => {
32
32
  curvedWidth: any;
33
33
  pathSide: any;
34
34
  pathStartOffset: any;
35
+ isAllCapital: any;
35
36
  };
36
37
  };
37
38
  export default class CurvedText extends fabric.Group {
@@ -111,7 +111,9 @@ const CurvedTextClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group,
111
111
  },
112
112
  getText: function () {
113
113
  const { prefix = "", infix = "", suffix = "" } = this.textObject;
114
- this.setText(infix?.length > 0 ? prefix + infix + suffix : "");
114
+ const isAllCapital = this.textObject.isAllCapital;
115
+ const text = prefix + infix + suffix;
116
+ this.setText(infix?.length > 0 ? (isAllCapital ? text.toUpperCase() : text) : "");
115
117
  },
116
118
  setMaxFontSize: function (fontSize) {
117
119
  this.textObject.set({
@@ -225,6 +227,7 @@ const toCurvedTextObject = (object) => {
225
227
  curvedWidth: textObject?.curvedWidth,
226
228
  pathSide: textObject?.pathSide,
227
229
  pathStartOffset: textObject?.pathStartOffset,
230
+ isAllCapital: textObject?.isAllCapital,
228
231
  },
229
232
  };
230
233
  };
@@ -10,7 +10,7 @@ export interface ICurvedTextOptions extends fabric.IGroupOptions {
10
10
  height?: number;
11
11
  textAlign?: string;
12
12
  fontWeight?: string;
13
- text: string;
13
+ text?: string;
14
14
  fontFamily?: string;
15
15
  maxFontSize: number;
16
16
  stroke?: string;
@@ -19,6 +19,7 @@ export interface ICurvedTextOptions extends fabric.IGroupOptions {
19
19
  infix?: string;
20
20
  suffix?: string;
21
21
  curvedWidth?: number;
22
+ isAllCapital?: boolean;
22
23
  };
23
24
  fontUrl?: string;
24
25
  isOriginal?: boolean;
@@ -17,6 +17,7 @@ export declare const toImagePlaceholderObject: (object: ImagePlaceholder) => {
17
17
  color: string | undefined;
18
18
  removeBackground: boolean | undefined;
19
19
  faceCutout: boolean | undefined;
20
+ advancedFilter: string | undefined;
20
21
  };
21
22
  };
22
23
  export default class ImagePlaceholder extends fabric.Group {
@@ -35,6 +36,7 @@ export default class ImagePlaceholder extends fabric.Group {
35
36
  uploadedImage?: fabric.Image;
36
37
  layoutGroupId?: string;
37
38
  layoutGroupName?: string;
39
+ advancedFilter?: string;
38
40
  getSettings?: (attribute: string) => any;
39
41
  setSizes?: (options: {
40
42
  width?: number;
@@ -50,14 +50,14 @@ const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.G
50
50
  }
51
51
  }
52
52
  if (options?.imageSettings) {
53
- const { type, color, removeBackground, faceCutout } = options?.imageSettings;
53
+ const { type, color, removeBackground, faceCutout, advancedFilter } = options?.imageSettings;
54
54
  if (type) {
55
55
  this.setImageType(type);
56
56
  }
57
57
  if (color) {
58
58
  this.setImageColor(color);
59
59
  }
60
- this.set({ removeBackground, faceCutout });
60
+ this.set({ removeBackground, faceCutout, advancedFilter });
61
61
  }
62
62
  },
63
63
  loadImage: async function (image) {
@@ -305,6 +305,7 @@ const toImagePlaceholderObject = (object) => {
305
305
  color: object?.imageColor,
306
306
  removeBackground: object?.removeBackground,
307
307
  faceCutout: object?.faceCutout,
308
+ advancedFilter: object?.advancedFilter,
308
309
  },
309
310
  };
310
311
  };
@@ -57,6 +57,7 @@ export interface IImagePlaceholderOptions extends fabric.IGroupOptions {
57
57
  color?: string;
58
58
  removeBackground?: boolean;
59
59
  faceCutout?: boolean;
60
+ advancedFilter?: string;
60
61
  };
61
62
  }
62
63
  export declare type ImageFilterType = "Full color" | "Grayscale" | "Blend color";
@@ -29,6 +29,7 @@ export declare const toTextInputObject: (object: TextInput) => {
29
29
  prefix: any;
30
30
  infix: any;
31
31
  suffix: any;
32
+ isAllCapital: any;
32
33
  };
33
34
  };
34
35
  export default class TextInput extends fabric.Group {
@@ -117,7 +117,9 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
117
117
  },
118
118
  getText: function () {
119
119
  const { prefix = "", infix = "", suffix = "" } = this.textObject;
120
- this.setText(infix?.length > 0 ? prefix + infix + suffix : "");
120
+ const isAllCapital = this.textObject.isAllCapital;
121
+ const text = prefix + infix + suffix;
122
+ this.setText(infix?.length > 0 ? (isAllCapital ? text.toUpperCase() : text) : "");
121
123
  },
122
124
  setMaxFontSize: function (fontSize) {
123
125
  this.textObject.set({
@@ -205,6 +207,7 @@ const toTextInputObject = (object) => {
205
207
  prefix: textObject?.prefix,
206
208
  infix: textObject?.infix,
207
209
  suffix: textObject?.suffix,
210
+ isAllCapital: textObject?.isAllCapital,
208
211
  },
209
212
  };
210
213
  };
@@ -10,7 +10,7 @@ export interface ITextInputOptions extends fabric.IGroupOptions {
10
10
  height?: number;
11
11
  textAlign?: string;
12
12
  fontWeight?: string;
13
- text: string;
13
+ text?: string;
14
14
  fontFamily?: string;
15
15
  maxFontSize: number;
16
16
  stroke?: string;
@@ -18,6 +18,7 @@ export interface ITextInputOptions extends fabric.IGroupOptions {
18
18
  prefix?: string;
19
19
  infix?: string;
20
20
  suffix?: string;
21
+ isAllCapital?: boolean;
21
22
  };
22
23
  fontUrl?: string;
23
24
  isOriginal?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",