customized-fabric 1.0.4 → 1.0.6
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.
- package/lib/{customizedFabric/ClipartObject → ClipartObject}/constants.js +1 -1
- package/lib/ClipartObject/index.d.ts +31 -0
- package/lib/{customizedFabric/ClipartObject → ClipartObject}/index.js +3 -3
- package/lib/ClipartObject/interfaces.d.ts +9 -0
- package/lib/ImagePlaceholderObject/index.d.ts +26 -0
- package/lib/{customizedFabric/ImagePlaceholderObject → ImagePlaceholderObject}/index.js +3 -3
- package/lib/ImagePlaceholderObject/interfaces.d.ts +8 -0
- package/lib/TextInputObject/index.d.ts +48 -0
- package/lib/{customizedFabric/TextInputObject → TextInputObject}/index.js +3 -3
- package/lib/TextInputObject/interfaces.d.ts +21 -0
- package/lib/constants/index.d.ts +6 -0
- package/lib/constants/index.js +12 -0
- package/lib/index.d.ts +6 -1
- package/lib/index.js +28 -3
- package/lib/{customizedFabric/utils.d.ts → utils/index.d.ts} +5 -3
- package/lib/{customizedFabric/utils.js → utils/index.js} +54 -6
- package/package.json +1 -1
- package/lib/customizedFabric/ClipartObject/index.d.ts +0 -19
- package/lib/customizedFabric/ClipartObject/interfaces.d.ts +0 -30
- package/lib/customizedFabric/ImagePlaceholderObject/index.d.ts +0 -14
- package/lib/customizedFabric/ImagePlaceholderObject/interfaces.d.ts +0 -22
- package/lib/customizedFabric/TextInputObject/index.d.ts +0 -30
- package/lib/customizedFabric/TextInputObject/interfaces.d.ts +0 -41
- package/lib/customizedFabric/index.d.ts +0 -8
- package/lib/customizedFabric/index.js +0 -54
- package/lib/customizedFabric/interfaces.d.ts +0 -3
- package/lib/customizedFabric/interfaces.js +0 -19
- /package/lib/{customizedFabric/ClipartObject → ClipartObject}/constants.d.ts +0 -0
- /package/lib/{customizedFabric/ClipartObject → ClipartObject}/interfaces.js +0 -0
- /package/lib/{customizedFabric/ImagePlaceholderObject → ImagePlaceholderObject}/constants.d.ts +0 -0
- /package/lib/{customizedFabric/ImagePlaceholderObject → ImagePlaceholderObject}/constants.js +0 -0
- /package/lib/{customizedFabric/ImagePlaceholderObject → ImagePlaceholderObject}/interfaces.js +0 -0
- /package/lib/{customizedFabric/TextInputObject → TextInputObject}/constants.d.ts +0 -0
- /package/lib/{customizedFabric/TextInputObject → TextInputObject}/constants.js +0 -0
- /package/lib/{customizedFabric/TextInputObject → TextInputObject}/interfaces.js +0 -0
- /package/lib/{customizedFabric/constants.d.ts → constants.d.ts} +0 -0
- /package/lib/{customizedFabric/constants.js → constants.js} +0 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
import { fabric } from "fabric";
|
2
|
+
import { IClipartOptions } from "./interfaces";
|
3
|
+
import { ObjectId } from "../utils/objectId";
|
4
|
+
export declare const toClipartObject: (clipartObject: Clipart) => {
|
5
|
+
id: ObjectId | undefined;
|
6
|
+
personalizeId: number | undefined;
|
7
|
+
layerId: number | undefined;
|
8
|
+
name: string | undefined;
|
9
|
+
locked: boolean | undefined;
|
10
|
+
isAdditional: boolean | undefined;
|
11
|
+
clipartUrl: string | undefined;
|
12
|
+
clipartFile: File | undefined;
|
13
|
+
clipartRootCategoryId: string | undefined;
|
14
|
+
clipartCategoryId: string | undefined;
|
15
|
+
clipartOptionId: number | undefined;
|
16
|
+
};
|
17
|
+
export default class Clipart extends fabric.Group {
|
18
|
+
_id?: ObjectId;
|
19
|
+
layerId?: number;
|
20
|
+
locked?: boolean;
|
21
|
+
isAdditional?: boolean;
|
22
|
+
clipartFile?: File;
|
23
|
+
clipartRootCategoryId?: string;
|
24
|
+
clipartRootCategoryName?: string;
|
25
|
+
clipartCategoryId?: string;
|
26
|
+
clipartCategoryName?: string;
|
27
|
+
clipartOptionId?: number;
|
28
|
+
clipartUrl?: string;
|
29
|
+
imageObject?: fabric.Image;
|
30
|
+
constructor(options?: IClipartOptions);
|
31
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.toClipartObject = void 0;
|
4
4
|
const fabric_1 = require("fabric");
|
5
5
|
const constants_1 = require("./constants");
|
6
|
-
const objectId_1 = require("@/utils/objectId");
|
7
6
|
const utils_1 = require("../utils");
|
7
|
+
const objectId_1 = require("../utils/objectId");
|
8
8
|
const ClipartClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
9
9
|
initialize: function (options) {
|
10
10
|
this.rectObject = new fabric_1.fabric.Rect({
|
@@ -142,4 +142,4 @@ class Clipart extends fabric_1.fabric.Group {
|
|
142
142
|
return new ClipartClass(options);
|
143
143
|
}
|
144
144
|
}
|
145
|
-
exports.
|
145
|
+
exports.default = Clipart;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { fabric } from "fabric";
|
2
|
+
import { IImagePlaceholderOptions } from "./interfaces";
|
3
|
+
import { ObjectId } from "../utils/objectId";
|
4
|
+
export declare const toImagePlaceholderObject: (imagePlaceholderObject: ImagePlaceholder) => {
|
5
|
+
id: ObjectId | undefined;
|
6
|
+
personalizeId: number | undefined;
|
7
|
+
layerId: number | undefined;
|
8
|
+
name: string | undefined;
|
9
|
+
locked: boolean | undefined;
|
10
|
+
isAdditional: boolean | undefined;
|
11
|
+
};
|
12
|
+
export default class ImagePlaceholder extends fabric.Group {
|
13
|
+
_id?: ObjectId;
|
14
|
+
layerId?: number;
|
15
|
+
locked?: boolean;
|
16
|
+
imageFile?: File;
|
17
|
+
isAdditional?: boolean;
|
18
|
+
loadImageFromFile?: (imageFile: File) => void;
|
19
|
+
loadImageFromUrl?: (imageUrl: string) => void;
|
20
|
+
getSettings?: (attribute: string) => any;
|
21
|
+
setSizes?: (options: {
|
22
|
+
width?: number;
|
23
|
+
height?: number;
|
24
|
+
}) => void;
|
25
|
+
constructor(options?: IImagePlaceholderOptions);
|
26
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.toImagePlaceholderObject = void 0;
|
4
4
|
const fabric_1 = require("fabric");
|
5
5
|
const constants_1 = require("./constants");
|
6
|
-
const objectId_1 = require("@/utils/objectId");
|
7
6
|
const utils_1 = require("../utils");
|
7
|
+
const objectId_1 = require("../utils/objectId");
|
8
8
|
const ImagePlaceholderClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
9
9
|
initialize: function (options) {
|
10
10
|
this.rectObject = new fabric_1.fabric.Rect({
|
@@ -137,4 +137,4 @@ class ImagePlaceholder extends fabric_1.fabric.Group {
|
|
137
137
|
return new ImagePlaceholderClass(options);
|
138
138
|
}
|
139
139
|
}
|
140
|
-
exports.
|
140
|
+
exports.default = ImagePlaceholder;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { fabric } from "fabric";
|
2
|
+
import { ITextInputOptions } from "./interfaces";
|
3
|
+
import { ObjectId } from "../utils/objectId";
|
4
|
+
export declare const toTextInputObject: (textInputObject: TextInput) => {
|
5
|
+
id: ObjectId | undefined;
|
6
|
+
personalizeId: number | undefined;
|
7
|
+
layerId: number | undefined;
|
8
|
+
name: string | undefined;
|
9
|
+
locked: boolean | undefined;
|
10
|
+
fontId: number | undefined;
|
11
|
+
fontCategoryId: string | undefined;
|
12
|
+
fontUrl: string | undefined;
|
13
|
+
isAdditional: boolean | undefined;
|
14
|
+
text: {
|
15
|
+
fontWeight: string | number | undefined;
|
16
|
+
fontSize: number | undefined;
|
17
|
+
textAlign: string | undefined;
|
18
|
+
text: string | undefined;
|
19
|
+
fill: string | fabric.Gradient | fabric.Pattern | undefined;
|
20
|
+
width: number | undefined;
|
21
|
+
height: number | undefined;
|
22
|
+
fontFamily: string | undefined;
|
23
|
+
maxFontSize: any;
|
24
|
+
stroke: string | undefined;
|
25
|
+
strokeWidth: number | undefined;
|
26
|
+
};
|
27
|
+
};
|
28
|
+
export default class TextInput extends fabric.Group {
|
29
|
+
_id?: ObjectId;
|
30
|
+
layerId?: number;
|
31
|
+
locked?: boolean;
|
32
|
+
textObject?: fabric.IText;
|
33
|
+
fontId?: number;
|
34
|
+
fontCategoryId?: string;
|
35
|
+
fontUrl?: string;
|
36
|
+
isAdditional?: boolean;
|
37
|
+
setText?: (text: string) => void;
|
38
|
+
setMaxFontSize?: (fontSize: string) => void;
|
39
|
+
setFontFamily?: (fontName: string, fontUrl?: string) => void;
|
40
|
+
setTextAttributes?: (options: fabric.ITextOptions) => void;
|
41
|
+
getTextAttribute?: (attribute: string) => any;
|
42
|
+
getSettings?: (attribute: string) => any;
|
43
|
+
setSizes?: (options: {
|
44
|
+
width?: number;
|
45
|
+
height?: number;
|
46
|
+
}) => void;
|
47
|
+
constructor(options?: ITextInputOptions);
|
48
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.toTextInputObject = void 0;
|
4
4
|
const fabric_1 = require("fabric");
|
5
5
|
const constants_1 = require("./constants");
|
6
|
-
const objectId_1 = require("@/utils/objectId");
|
7
6
|
const utils_1 = require("../utils");
|
7
|
+
const objectId_1 = require("../utils/objectId");
|
8
8
|
const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
9
9
|
initialize: function (options) {
|
10
10
|
const { text, ...rest } = options ?? {};
|
@@ -185,4 +185,4 @@ class TextInput extends fabric_1.fabric.Group {
|
|
185
185
|
return new TextInputClass(options);
|
186
186
|
}
|
187
187
|
}
|
188
|
-
exports.
|
188
|
+
exports.default = TextInput;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ObjectId } from "../utils/objectId";
|
2
|
+
export interface ITextInputOptions extends fabric.IGroupOptions {
|
3
|
+
_id?: ObjectId;
|
4
|
+
personalizeId?: string;
|
5
|
+
layerId: number;
|
6
|
+
text: {
|
7
|
+
fontSize?: number;
|
8
|
+
fill?: string;
|
9
|
+
width?: number;
|
10
|
+
height?: number;
|
11
|
+
textAlign?: string;
|
12
|
+
fontWeight?: string;
|
13
|
+
text: string;
|
14
|
+
fontFamily?: string;
|
15
|
+
maxFontSize: number;
|
16
|
+
stroke?: string;
|
17
|
+
strokeWidth?: number;
|
18
|
+
};
|
19
|
+
fontUrl?: string;
|
20
|
+
hideStroke?: boolean;
|
21
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.OBJECT_TYPES = void 0;
|
4
|
+
const constants_1 = require("../ClipartObject/constants");
|
5
|
+
const constants_2 = require("../ImagePlaceholderObject/constants");
|
6
|
+
const constants_3 = require("../TextInputObject/constants");
|
7
|
+
exports.OBJECT_TYPES = {
|
8
|
+
textInput: constants_3.TEXT_INPUT_OBJECT_ATTRIBUTES.type,
|
9
|
+
clipart: constants_1.CLIPART_OBJECT_ATTRIBUTES.type,
|
10
|
+
imagePlaceHolder: constants_2.IMAGE_PLACEHOLDER_OBJECT_ATTRIBUTES.type,
|
11
|
+
activeSelection: "activeSelection",
|
12
|
+
};
|
package/lib/index.d.ts
CHANGED
@@ -1 +1,6 @@
|
|
1
|
-
|
1
|
+
import TextInput from "./TextInputObject";
|
2
|
+
import Clipart from "./ClipartObject";
|
3
|
+
import ImagePlaceholder from "./ImagePlaceholderObject";
|
4
|
+
import fabric, { lockObject, lockAllObjects, getObject } from "./utils";
|
5
|
+
import { OBJECT_TYPES } from "./constants";
|
6
|
+
export { fabric, TextInput, Clipart, ImagePlaceholder, lockObject, lockAllObjects, getObject, OBJECT_TYPES, };
|
package/lib/index.js
CHANGED
@@ -10,8 +10,33 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
11
11
|
o[k2] = m[k];
|
12
12
|
}));
|
13
|
-
var
|
14
|
-
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
27
|
};
|
16
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
|
29
|
+
exports.OBJECT_TYPES = exports.getObject = exports.lockAllObjects = exports.lockObject = exports.ImagePlaceholder = exports.Clipart = exports.TextInput = exports.fabric = void 0;
|
30
|
+
const TextInputObject_1 = __importDefault(require("./TextInputObject"));
|
31
|
+
exports.TextInput = TextInputObject_1.default;
|
32
|
+
const ClipartObject_1 = __importDefault(require("./ClipartObject"));
|
33
|
+
exports.Clipart = ClipartObject_1.default;
|
34
|
+
const ImagePlaceholderObject_1 = __importDefault(require("./ImagePlaceholderObject"));
|
35
|
+
exports.ImagePlaceholder = ImagePlaceholderObject_1.default;
|
36
|
+
const utils_1 = __importStar(require("./utils"));
|
37
|
+
exports.fabric = utils_1.default;
|
38
|
+
Object.defineProperty(exports, "lockObject", { enumerable: true, get: function () { return utils_1.lockObject; } });
|
39
|
+
Object.defineProperty(exports, "lockAllObjects", { enumerable: true, get: function () { return utils_1.lockAllObjects; } });
|
40
|
+
Object.defineProperty(exports, "getObject", { enumerable: true, get: function () { return utils_1.getObject; } });
|
41
|
+
const constants_1 = require("./constants");
|
42
|
+
Object.defineProperty(exports, "OBJECT_TYPES", { enumerable: true, get: function () { return constants_1.OBJECT_TYPES; } });
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { fabric } from "fabric";
|
2
|
-
import
|
3
|
-
import
|
2
|
+
import Clipart from "../ClipartObject";
|
3
|
+
import ImagePlaceholder from "../ImagePlaceholderObject";
|
4
|
+
import TextInput from "../TextInputObject";
|
4
5
|
export declare const loadFontFromUrl: (name: string, url: string) => Promise<void>;
|
5
6
|
export declare const isFontLoaded: (name: string) => boolean;
|
6
7
|
export declare const loadImageFromFile: (image: File) => Promise<fabric.Image>;
|
@@ -8,4 +9,5 @@ export declare const lockObject: (object: fabric.Object | any, locked: boolean,
|
|
8
9
|
export declare const lockAllObjects: (canvas: fabric.Canvas, locked: boolean) => void;
|
9
10
|
export declare const getObject: (object: any, options?: {
|
10
11
|
isOriginal?: boolean;
|
11
|
-
}) =>
|
12
|
+
}) => Clipart | ImagePlaceholder | TextInput | undefined;
|
13
|
+
export default fabric;
|
@@ -1,10 +1,34 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
26
|
exports.getObject = exports.lockAllObjects = exports.lockObject = exports.loadImageFromFile = exports.isFontLoaded = exports.loadFontFromUrl = void 0;
|
4
27
|
const fabric_1 = require("fabric");
|
5
|
-
const constants_1 = require("
|
6
|
-
const
|
7
|
-
const ImagePlaceholderObject_1 = require("
|
28
|
+
const constants_1 = require("../constants");
|
29
|
+
const ClipartObject_1 = __importStar(require("../ClipartObject"));
|
30
|
+
const ImagePlaceholderObject_1 = __importStar(require("../ImagePlaceholderObject"));
|
31
|
+
const TextInputObject_1 = __importStar(require("../TextInputObject"));
|
8
32
|
const loadFontFromUrl = async (name, url) => {
|
9
33
|
if (!name || !url)
|
10
34
|
return;
|
@@ -63,21 +87,21 @@ exports.lockAllObjects = lockAllObjects;
|
|
63
87
|
const getObject = (object, options) => {
|
64
88
|
switch (object.type) {
|
65
89
|
case constants_1.OBJECT_TYPES.textInput: {
|
66
|
-
const textInputObject = new
|
90
|
+
const textInputObject = new TextInputObject_1.default({
|
67
91
|
...object,
|
68
92
|
hideStroke: options?.isOriginal,
|
69
93
|
});
|
70
94
|
return textInputObject;
|
71
95
|
}
|
72
96
|
case constants_1.OBJECT_TYPES.clipart: {
|
73
|
-
const clipartObject = new
|
97
|
+
const clipartObject = new ClipartObject_1.default({
|
74
98
|
...object,
|
75
99
|
hideStroke: options?.isOriginal,
|
76
100
|
});
|
77
101
|
return clipartObject;
|
78
102
|
}
|
79
103
|
case constants_1.OBJECT_TYPES.imagePlaceHolder: {
|
80
|
-
const imagePlaceHolderObject = new ImagePlaceholderObject_1.
|
104
|
+
const imagePlaceHolderObject = new ImagePlaceholderObject_1.default({
|
81
105
|
...object,
|
82
106
|
hideStroke: options?.isOriginal,
|
83
107
|
});
|
@@ -88,3 +112,27 @@ const getObject = (object, options) => {
|
|
88
112
|
}
|
89
113
|
};
|
90
114
|
exports.getObject = getObject;
|
115
|
+
fabric_1.fabric.Object.prototype.transparentCorners = false;
|
116
|
+
fabric_1.fabric.Object.prototype.cornerColor = "black";
|
117
|
+
fabric_1.fabric.Object.prototype.cornerStyle = "circle";
|
118
|
+
fabric_1.fabric.Object.prototype.cornerStrokeColor = "black";
|
119
|
+
fabric_1.fabric.Object.prototype.borderColor = "black";
|
120
|
+
fabric_1.fabric.Object.prototype.toObject = (function (toObject) {
|
121
|
+
return function () {
|
122
|
+
switch (this.type) {
|
123
|
+
case constants_1.OBJECT_TYPES.textInput: {
|
124
|
+
return fabric_1.fabric.util.object.extend(toObject.call(this), (0, TextInputObject_1.toTextInputObject)(this));
|
125
|
+
}
|
126
|
+
case constants_1.OBJECT_TYPES.clipart: {
|
127
|
+
return fabric_1.fabric.util.object.extend(toObject.call(this), (0, ClipartObject_1.toClipartObject)(this));
|
128
|
+
}
|
129
|
+
case constants_1.OBJECT_TYPES.imagePlaceHolder: {
|
130
|
+
return fabric_1.fabric.util.object.extend(toObject.call(this), (0, ImagePlaceholderObject_1.toImagePlaceholderObject)(this));
|
131
|
+
}
|
132
|
+
default: {
|
133
|
+
return {};
|
134
|
+
}
|
135
|
+
}
|
136
|
+
};
|
137
|
+
})(fabric_1.fabric.Object.prototype.toObject);
|
138
|
+
exports.default = fabric_1.fabric;
|
package/package.json
CHANGED
@@ -1,19 +0,0 @@
|
|
1
|
-
import { fabric } from "fabric";
|
2
|
-
import { ObjectId } from "@/utils/objectId";
|
3
|
-
import { ClipartObject, IClipartOptions } from "./interfaces";
|
4
|
-
export declare const toClipartObject: (clipartObject: ClipartObject) => {
|
5
|
-
id: ObjectId;
|
6
|
-
personalizeId: number | undefined;
|
7
|
-
layerId: number | undefined;
|
8
|
-
name: string | undefined;
|
9
|
-
locked: boolean | undefined;
|
10
|
-
isAdditional: boolean | undefined;
|
11
|
-
clipartUrl: string | undefined;
|
12
|
-
clipartFile: File | undefined;
|
13
|
-
clipartRootCategoryId: string | undefined;
|
14
|
-
clipartCategoryId: string | undefined;
|
15
|
-
clipartOptionId: number | undefined;
|
16
|
-
};
|
17
|
-
export declare class Clipart extends fabric.Group {
|
18
|
-
constructor(options?: IClipartOptions);
|
19
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { ObjectId } from "@/utils/objectId";
|
2
|
-
export interface ClipartObject extends fabric.Group {
|
3
|
-
_id: ObjectId;
|
4
|
-
layerId?: number;
|
5
|
-
locked?: boolean;
|
6
|
-
isAdditional?: boolean;
|
7
|
-
clipartFile?: File;
|
8
|
-
clipartRootCategoryId?: string;
|
9
|
-
clipartRootCategoryName?: string;
|
10
|
-
clipartCategoryId?: string;
|
11
|
-
clipartCategoryName?: string;
|
12
|
-
clipartOptionId?: number;
|
13
|
-
imageObject?: fabric.Image;
|
14
|
-
clipartUrl?: string;
|
15
|
-
loadImageFromFile: (imageFile: File) => void;
|
16
|
-
loadImageFromUrl: (imageUrl: string) => void;
|
17
|
-
getSettings: (attribute: string) => any;
|
18
|
-
setSizes: (options: {
|
19
|
-
width?: number;
|
20
|
-
height?: number;
|
21
|
-
}) => void;
|
22
|
-
}
|
23
|
-
export interface IClipartOptions extends fabric.IGroupOptions {
|
24
|
-
_id?: string;
|
25
|
-
personalizeId?: number;
|
26
|
-
layerId: number;
|
27
|
-
clipartUrl?: string;
|
28
|
-
clipartFile?: File;
|
29
|
-
hideStroke?: boolean;
|
30
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { fabric } from "fabric";
|
2
|
-
import { ObjectId } from "@/utils/objectId";
|
3
|
-
import { IImagePlaceholderOptions, ImagePlaceholderObject } from "./interfaces";
|
4
|
-
export declare const toImagePlaceholderObject: (imagePlaceholderObject: ImagePlaceholderObject) => {
|
5
|
-
id: ObjectId;
|
6
|
-
personalizeId: number;
|
7
|
-
layerId: number;
|
8
|
-
name: string | undefined;
|
9
|
-
locked: boolean;
|
10
|
-
isAdditional: boolean;
|
11
|
-
};
|
12
|
-
export declare class ImagePlaceholder extends fabric.Group {
|
13
|
-
constructor(options?: IImagePlaceholderOptions);
|
14
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { ObjectId } from "@/utils/objectId";
|
2
|
-
export interface ImagePlaceholderObject extends fabric.Group {
|
3
|
-
_id: ObjectId;
|
4
|
-
layerId: number;
|
5
|
-
locked: boolean;
|
6
|
-
imageFile?: File;
|
7
|
-
isAdditional: boolean;
|
8
|
-
loadImageFromFile: (imageFile: File) => void;
|
9
|
-
loadImageFromUrl: (imageUrl: string) => void;
|
10
|
-
getSettings: (attribute: string) => any;
|
11
|
-
setSizes: (options: {
|
12
|
-
width?: number;
|
13
|
-
height?: number;
|
14
|
-
}) => void;
|
15
|
-
}
|
16
|
-
export interface IImagePlaceholderOptions extends fabric.IGroupOptions {
|
17
|
-
_id?: string;
|
18
|
-
personalizeId?: number;
|
19
|
-
layerId: number;
|
20
|
-
imageFile?: File;
|
21
|
-
hideStroke?: boolean;
|
22
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { fabric } from "fabric";
|
2
|
-
import { ObjectId } from "@/utils/objectId";
|
3
|
-
import { ITextInputOptions, TextInputObject } from "./interfaces";
|
4
|
-
export declare const toTextInputObject: (textInputObject: TextInputObject) => {
|
5
|
-
id: ObjectId;
|
6
|
-
personalizeId: number;
|
7
|
-
layerId: number;
|
8
|
-
name: string | undefined;
|
9
|
-
locked: boolean;
|
10
|
-
fontId: number;
|
11
|
-
fontCategoryId: string;
|
12
|
-
fontUrl: string;
|
13
|
-
isAdditional: boolean;
|
14
|
-
text: {
|
15
|
-
fontWeight: string | number | undefined;
|
16
|
-
fontSize: number | undefined;
|
17
|
-
textAlign: string | undefined;
|
18
|
-
text: string | undefined;
|
19
|
-
fill: string | fabric.Gradient | fabric.Pattern | undefined;
|
20
|
-
width: number | undefined;
|
21
|
-
height: number | undefined;
|
22
|
-
fontFamily: string | undefined;
|
23
|
-
maxFontSize: any;
|
24
|
-
stroke: string | undefined;
|
25
|
-
strokeWidth: number | undefined;
|
26
|
-
};
|
27
|
-
};
|
28
|
-
export declare class TextInput extends fabric.Group {
|
29
|
-
constructor(options?: ITextInputOptions);
|
30
|
-
}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import { ObjectId } from "@/utils/objectId";
|
2
|
-
export interface TextInputObject extends fabric.Group {
|
3
|
-
_id: ObjectId;
|
4
|
-
layerId: number;
|
5
|
-
locked: boolean;
|
6
|
-
textObject: fabric.IText;
|
7
|
-
fontId: number;
|
8
|
-
fontCategoryId: string;
|
9
|
-
fontUrl: string;
|
10
|
-
isAdditional: boolean;
|
11
|
-
setText: (text: string) => void;
|
12
|
-
setMaxFontSize: (fontSize: string) => void;
|
13
|
-
setFontFamily: (fontName: string, fontUrl?: string) => void;
|
14
|
-
setTextAttributes: (options: fabric.ITextOptions) => void;
|
15
|
-
getTextAttribute: (attribute: string) => any;
|
16
|
-
getSettings: (attribute: string) => any;
|
17
|
-
setSizes: (options: {
|
18
|
-
width?: number;
|
19
|
-
height?: number;
|
20
|
-
}) => void;
|
21
|
-
}
|
22
|
-
export interface ITextInputOptions extends fabric.IGroupOptions {
|
23
|
-
_id?: ObjectId;
|
24
|
-
personalizeId?: string;
|
25
|
-
layerId: number;
|
26
|
-
text: {
|
27
|
-
fontSize?: number;
|
28
|
-
fill?: string;
|
29
|
-
width?: number;
|
30
|
-
height?: number;
|
31
|
-
textAlign?: string;
|
32
|
-
fontWeight?: string;
|
33
|
-
text: string;
|
34
|
-
fontFamily?: string;
|
35
|
-
maxFontSize: number;
|
36
|
-
stroke?: string;
|
37
|
-
strokeWidth?: number;
|
38
|
-
};
|
39
|
-
fontUrl?: string;
|
40
|
-
hideStroke?: boolean;
|
41
|
-
}
|
@@ -1,54 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
const fabric_1 = require("fabric");
|
18
|
-
const TextInputObject_1 = require("./TextInputObject");
|
19
|
-
const ClipartObject_1 = require("./ClipartObject");
|
20
|
-
const ImagePlaceholderObject_1 = require("./ImagePlaceholderObject");
|
21
|
-
const constants_1 = require("./constants");
|
22
|
-
fabric_1.fabric.TextInput = TextInputObject_1.TextInput;
|
23
|
-
fabric_1.fabric.Clipart = ClipartObject_1.Clipart;
|
24
|
-
fabric_1.fabric.ImagePlaceholder = ImagePlaceholderObject_1.ImagePlaceholder;
|
25
|
-
fabric_1.fabric.Object.prototype.transparentCorners = false;
|
26
|
-
fabric_1.fabric.Object.prototype.cornerColor = "black";
|
27
|
-
fabric_1.fabric.Object.prototype.cornerStyle = "circle";
|
28
|
-
fabric_1.fabric.Object.prototype.cornerStrokeColor = "black";
|
29
|
-
fabric_1.fabric.Object.prototype.borderColor = "black";
|
30
|
-
fabric_1.fabric.Object.prototype.toObject = (function (toObject) {
|
31
|
-
return function () {
|
32
|
-
switch (this.type) {
|
33
|
-
case constants_1.OBJECT_TYPES.textInput: {
|
34
|
-
return fabric_1.fabric.util.object.extend(toObject.call(this), (0, TextInputObject_1.toTextInputObject)(this));
|
35
|
-
}
|
36
|
-
case constants_1.OBJECT_TYPES.clipart: {
|
37
|
-
return fabric_1.fabric.util.object.extend(toObject.call(this), (0, ClipartObject_1.toClipartObject)(this));
|
38
|
-
}
|
39
|
-
case constants_1.OBJECT_TYPES.imagePlaceHolder: {
|
40
|
-
return fabric_1.fabric.util.object.extend(toObject.call(this), (0, ImagePlaceholderObject_1.toImagePlaceholderObject)(this));
|
41
|
-
}
|
42
|
-
default: {
|
43
|
-
return {};
|
44
|
-
}
|
45
|
-
}
|
46
|
-
};
|
47
|
-
})(fabric_1.fabric.Object.prototype.toObject);
|
48
|
-
__exportStar(require("./TextInputObject"), exports);
|
49
|
-
__exportStar(require("./ClipartObject"), exports);
|
50
|
-
__exportStar(require("./ImagePlaceholderObject"), exports);
|
51
|
-
__exportStar(require("./constants"), exports);
|
52
|
-
__exportStar(require("./interfaces"), exports);
|
53
|
-
__exportStar(require("./utils"), exports);
|
54
|
-
exports.default = fabric_1.fabric;
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./TextInputObject/interfaces"), exports);
|
18
|
-
__exportStar(require("./ClipartObject/interfaces"), exports);
|
19
|
-
__exportStar(require("./ImagePlaceholderObject/interfaces"), exports);
|
File without changes
|
File without changes
|
/package/lib/{customizedFabric/ImagePlaceholderObject → ImagePlaceholderObject}/constants.d.ts
RENAMED
File without changes
|
/package/lib/{customizedFabric/ImagePlaceholderObject → ImagePlaceholderObject}/constants.js
RENAMED
File without changes
|
/package/lib/{customizedFabric/ImagePlaceholderObject → ImagePlaceholderObject}/interfaces.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|