@leapfrog/interactive-canvas 1.14.5 → 2.0.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.
Files changed (68) hide show
  1. package/package.json +3 -3
  2. package/readme.md +11 -4
  3. package/dist/abstract-interactive-canvas.d.ts +0 -372
  4. package/dist/dimensions/millimeter-dimensions.d.ts +0 -15
  5. package/dist/dimensions/pixel-canvas-dimensions.d.ts +0 -13
  6. package/dist/dimensions/print-6-col-canvas-dimensions.d.ts +0 -18
  7. package/dist/dimensions/print-8-col-canvas-dimensions.d.ts +0 -18
  8. package/dist/font/font-library.d.ts +0 -27
  9. package/dist/font/font-library.interface.d.ts +0 -24
  10. package/dist/font/font.interface.d.ts +0 -20
  11. package/dist/font/unknown-font.d.ts +0 -6
  12. package/dist/headless-interactive-canvas.d.ts +0 -10
  13. package/dist/index.d.ts +0 -54
  14. package/dist/interactive-canvas.d.ts +0 -25
  15. package/dist/interactive-canvas.es.js +0 -3988
  16. package/dist/interactive-canvas.interface.d.ts +0 -297
  17. package/dist/interactive-canvas.js +0 -4021
  18. package/dist/layout/abstract-layout-manager.d.ts +0 -17
  19. package/dist/layout/advanced-layout-manager.d.ts +0 -16
  20. package/dist/layout/function/pin-to-bottom.layout-function.d.ts +0 -4
  21. package/dist/layout/function/redraw-all.layout-function.d.ts +0 -4
  22. package/dist/layout/function/reposition-backgrounds.layout-function.d.ts +0 -4
  23. package/dist/layout/function/reposition-borders.layout-function.d.ts +0 -4
  24. package/dist/layout/function/reposition-cutoffs.layout-function.d.ts +0 -4
  25. package/dist/layout/function/resize-canvas.layout-function.d.ts +0 -4
  26. package/dist/layout/function/stack-objects.layout-function.d.ts +0 -11
  27. package/dist/layout/function/update-object-dimensions.layout-function.d.ts +0 -4
  28. package/dist/layout/layout-manager.enum.d.ts +0 -5
  29. package/dist/layout/layout-manager.interface.d.ts +0 -13
  30. package/dist/layout/standard-layout-manager.d.ts +0 -40
  31. package/dist/mutator/mutable-background-color.interface.d.ts +0 -15
  32. package/dist/mutator/mutable-color.interface.d.ts +0 -6
  33. package/dist/mutator/mutable-image.interface.d.ts +0 -28
  34. package/dist/mutator/mutable-position.interface.d.ts +0 -63
  35. package/dist/mutator/mutable-stroke.interface.d.ts +0 -8
  36. package/dist/mutator/mutable-text-style.interface.d.ts +0 -163
  37. package/dist/mutator/mutable-text.interface.d.ts +0 -80
  38. package/dist/object/abstract-canvas-object.d.ts +0 -207
  39. package/dist/object/canvas-object-data.d.ts +0 -24
  40. package/dist/object/canvas-object.interface.d.ts +0 -109
  41. package/dist/object/impl/background-image.d.ts +0 -38
  42. package/dist/object/impl/border.d.ts +0 -70
  43. package/dist/object/impl/cutoff.d.ts +0 -59
  44. package/dist/object/impl/extended-fabric-object.interface.d.ts +0 -7
  45. package/dist/object/impl/extended-fabric-textbox.interface.d.ts +0 -7
  46. package/dist/object/impl/horizontal-rule.d.ts +0 -83
  47. package/dist/object/impl/image.d.ts +0 -76
  48. package/dist/object/impl/rectangle.d.ts +0 -78
  49. package/dist/object/impl/rich-text.d.ts +0 -39
  50. package/dist/object/impl/text.d.ts +0 -314
  51. package/dist/object/impl/vertical-rule.d.ts +0 -83
  52. package/dist/profile/canvas-profile.interface.d.ts +0 -22
  53. package/dist/profile/default-canvas-profile.d.ts +0 -23
  54. package/dist/types/canvas-dimension-restrictions.interface.d.ts +0 -15
  55. package/dist/types/canvas-dimensions.interface.d.ts +0 -21
  56. package/dist/types/canvas-state.interface.d.ts +0 -11
  57. package/dist/types/dimension-restrictions.interface.d.ts +0 -6
  58. package/dist/types/image-type.enum.d.ts +0 -6
  59. package/dist/types/margin.interface.d.ts +0 -6
  60. package/dist/types/object-dimensions.interface.d.ts +0 -23
  61. package/dist/types/object-type.enum.d.ts +0 -12
  62. package/dist/types/overflow.interface.d.ts +0 -4
  63. package/dist/types/position.interface.d.ts +0 -9
  64. package/dist/types/rect.interface.d.ts +0 -6
  65. package/dist/types/selection-data.interface.d.ts +0 -19
  66. package/dist/types/text-alignment.interface.d.ts +0 -1
  67. package/dist/undo-stack.d.ts +0 -27
  68. package/dist/undo-stack.interface.d.ts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leapfrog/interactive-canvas",
3
- "version": "1.14.5",
3
+ "version": "2.0.1",
4
4
  "description": "Leapfrog interactive canvas",
5
5
  "files": [
6
6
  "dist"
@@ -13,12 +13,12 @@
13
13
  "watch": "rollup -cw"
14
14
  },
15
15
  "devDependencies": {
16
- "@types/fabric": "^3.6.5",
16
+ "@types/fabric": "^4.2.0",
17
17
  "@types/lodash": "^4.14.153",
18
18
  "typescript": "^3.5.3"
19
19
  },
20
20
  "dependencies": {
21
- "fabric": "^3.6.3",
21
+ "fabric": "^5.2.4",
22
22
  "lodash": "^4.17.15",
23
23
  "rollup": "^2.13.0",
24
24
  "rollup-plugin-typescript2": "^0.27.1",
package/readme.md CHANGED
@@ -3,31 +3,37 @@
3
3
  A set of APIs wrapping the fabric.js library, providing Leapfrog-specific behavior and interactions.
4
4
 
5
5
  ### Installing
6
+
6
7
  ```
7
8
  npm install --save @leapfrog/interactive-canvas
8
9
  ```
9
10
 
10
11
  ### Installing (Node)
12
+
11
13
  If running in node, you additionally need `jsdom`:
14
+
12
15
  ```
13
16
  npm install --save jsdom
14
17
  ```
15
18
 
16
19
  ### Building
20
+
17
21
  npm run build
18
22
 
19
23
  or
20
24
 
21
25
  npm run watch
22
-
26
+
23
27
  ### Using library in another Project
28
+
24
29
  `npm install @leapfrog/interactive-canvas`
25
30
 
26
31
  ### Linking for local development
27
32
 
28
33
  You can use `npm link` to see changes to the library immediately in a linked project.
29
-
34
+
30
35
  Add the following lines to the `package.json` `scripts` config in the project that uses this library:
36
+
31
37
  ```json
32
38
  {
33
39
  "scripts": {
@@ -43,11 +49,12 @@ Add the following lines to the `package.json` `scripts` config in the project th
43
49
 
44
50
  Changes in the library will be visible in the calling project.
45
51
 
46
- Once complete, publish the changes then run `npm run upgrade:lic` to get the latest published version of the
47
- library in the calling project.
52
+ Once complete, publish the changes then run `npm run upgrade:lic` to get the latest published version of the library in the calling project.
48
53
 
49
54
  ### Publishing
55
+
50
56
  The `.npmrc` file contains the access token needed to publish to the `@leapfrog` npm repo.
57
+
51
58
  * `npm version <version>` or `npm version <version>-beta.0`
52
59
  * `npm run build`
53
60
  * `npm publish` or `npm publish --tag beta`
@@ -1,372 +0,0 @@
1
- import { BehaviorSubject, Observable, Subject } from "rxjs";
2
- import { ICutoff } from "./object/impl/cutoff";
3
- import { IRectangle } from "./object/impl/rectangle";
4
- import { IBorder } from "./object/impl/border";
5
- import { IImage } from "./object/impl/image";
6
- import { IText } from "./object/impl/text";
7
- import { ILayoutManager } from "./layout/layout-manager.interface";
8
- import { LayoutManager } from "./layout/layout-manager.enum";
9
- import { IVerticalRule } from "./object/impl/vertical-rule";
10
- import { IHorizontalRule } from "./object/impl/horizontal-rule";
11
- import { IInteractiveCanvas } from "./interactive-canvas.interface";
12
- import { ICanvasProfile } from "./profile/canvas-profile.interface";
13
- import { IFontLibrary } from "./font/font-library.interface";
14
- import { ICanvasDimensions } from "./types/canvas-dimensions.interface";
15
- import { ICanvasDimensionRestrictions } from "./types/canvas-dimension-restrictions.interface";
16
- import { AbstractCanvasObject } from "./object/abstract-canvas-object";
17
- import { IRect } from "./types/rect.interface";
18
- import { ObjectType } from "./types/object-type.enum";
19
- import { ICanvasObject } from "./object/canvas-object.interface";
20
- import { ISelectionData } from "./types/selection-data.interface";
21
- import { ICanvasState } from "./types/canvas-state.interface";
22
- import { ITextSelection } from "./mutator/mutable-text-style.interface";
23
- import { fabric } from "fabric";
24
- import { IRichText } from "./object/impl/rich-text";
25
- import { IBackgroundImage } from "./object/impl/background-image";
26
- export declare abstract class AbstractInteractiveCanvas implements IInteractiveCanvas {
27
- fabric: any;
28
- protected readonly fabricCanvas: fabric.Canvas;
29
- protected devicePixelRatio: number;
30
- protected readonly IMAGE_CAPTURE_COEFFICIENT: number;
31
- abstract readonly headless: boolean;
32
- protected readonly fontLibrary: IFontLibrary;
33
- protected readonly profile$: BehaviorSubject<ICanvasProfile>;
34
- protected readonly layoutManager$: BehaviorSubject<ILayoutManager>;
35
- protected readonly backgroundColor$: BehaviorSubject<string>;
36
- protected readonly dimensions$: BehaviorSubject<ICanvasDimensions>;
37
- protected readonly dimensionRestrictions$: BehaviorSubject<ICanvasDimensionRestrictions>;
38
- protected readonly dimensionChangeRejections$: Subject<ICanvasDimensions>;
39
- protected readonly zoom$: BehaviorSubject<number>;
40
- protected readonly objects$: BehaviorSubject<Array<AbstractCanvasObject<any>>>;
41
- protected readonly selection$: BehaviorSubject<SelectionData>;
42
- protected baseDimensions: ICanvasDimensions;
43
- protected constructor(fabric: any, fabricCanvas: fabric.Canvas, devicePixelRatio: number);
44
- /**
45
- * @override
46
- * @inheritDoc
47
- */
48
- getFontLibrary(): IFontLibrary;
49
- /**
50
- * @override
51
- * @inheritDoc
52
- */
53
- getProfile(): ICanvasProfile;
54
- /**
55
- * @override
56
- * @inheritDoc
57
- */
58
- getProfile$(): Observable<ICanvasProfile>;
59
- /**
60
- * @override
61
- * @inheritDoc
62
- */
63
- setProfile(profile: ICanvasProfile): void;
64
- /**
65
- * @override
66
- * @inheritDoc
67
- */
68
- getLayoutManager(): ILayoutManager;
69
- /**
70
- * @override
71
- * @inheritDoc
72
- */
73
- getLayoutManager$(): Observable<ILayoutManager>;
74
- /**
75
- * @override
76
- * @inheritDoc
77
- */
78
- setLayoutManager(layoutManager: LayoutManager): void;
79
- /**
80
- * @override
81
- * @inheritDoc
82
- */
83
- getBackgroundColor(): string;
84
- /**
85
- * @override
86
- * @inheritDoc
87
- */
88
- getBackgroundColor$(): Observable<string>;
89
- /**
90
- * @override
91
- * @inheritDoc
92
- */
93
- setBackgroundColor(color?: string): void;
94
- /**
95
- * @override
96
- * @inheritDoc
97
- */
98
- getDimensions(): ICanvasDimensions;
99
- /**
100
- * @override
101
- * @inheritDoc
102
- */
103
- getBaseDimensions(): ICanvasDimensions;
104
- /**
105
- * @override
106
- * @inheritDoc
107
- */
108
- getDimensions$(): Observable<ICanvasDimensions>;
109
- /**
110
- * @override
111
- * @inheritDoc
112
- */
113
- setDimensions(dimensions: ICanvasDimensions): void;
114
- /**
115
- * @override
116
- * @inheritDoc
117
- */
118
- setBaseDimensions(dimensions: ICanvasDimensions): void;
119
- /**
120
- * @override
121
- * @inheritDoc
122
- */
123
- getDimensionChangeRejections$(): Observable<ICanvasDimensions>;
124
- /**
125
- * @override
126
- * @inheritDoc
127
- */
128
- getDimensionsRestrictions(): ICanvasDimensionRestrictions;
129
- /**
130
- * @override
131
- * @inheritDoc
132
- */
133
- getDimensionsRestrictions$(): Observable<ICanvasDimensionRestrictions>;
134
- /**
135
- * @override
136
- * @inheritDoc
137
- */
138
- setDimensionRestrictions(restrictions: ICanvasDimensionRestrictions): void;
139
- getMargin(): IRect;
140
- /**
141
- * @override
142
- * @inheritDoc
143
- */
144
- getZoom(): number;
145
- /**
146
- * @override
147
- * @inheritDoc
148
- */
149
- getZoom$(): Observable<number>;
150
- /**
151
- * @override
152
- * @inheritDoc
153
- */
154
- setZoom(zoom: number): void;
155
- /**
156
- * @override
157
- * @inheritDoc
158
- */
159
- getObjects(): ICanvasObject[];
160
- /**
161
- * Get the list of objects directly.
162
- */
163
- getObjectsInternal(): Array<AbstractCanvasObject<any>>;
164
- /**
165
- * @override
166
- * @inheritDoc
167
- */
168
- getObjectsByTypeInternal<T extends AbstractCanvasObject<any>>(type: ObjectType): T[];
169
- /**
170
- * @override
171
- * @inheritDoc
172
- */
173
- getObjectsByTypesInternal(...types: ObjectType[]): Array<AbstractCanvasObject<any>>;
174
- /**
175
- * @override
176
- * @inheritDoc
177
- */
178
- getObjects$(): Observable<ICanvasObject[]>;
179
- /**
180
- * @override
181
- * @inheritDoc
182
- */
183
- removeObject(target: ICanvasObject): void;
184
- /**
185
- * @override
186
- * @inheritDoc
187
- */
188
- addImageObject(imageUrl: string): Promise<IImage>;
189
- /**
190
- * @override
191
- * @inheritDoc
192
- */
193
- addTextObject(): Promise<IText>;
194
- /**
195
- * @override
196
- * @inheritDoc
197
- */
198
- addRichTextObject(imageUrl: string, htmlContent: string): Promise<IRichText>;
199
- /**
200
- * @override
201
- * @inheritDoc
202
- */
203
- addRectangleObject(): Promise<IRectangle>;
204
- /**
205
- * @override
206
- * @inheritDoc
207
- */
208
- addCutoffObject(): Promise<ICutoff>;
209
- /**
210
- * @override
211
- * @inheritDoc
212
- */
213
- addBorderObject(): Promise<IBorder>;
214
- /**
215
- * @override
216
- * @inheritDoc
217
- */
218
- addVerticalRuleObject(): Promise<IVerticalRule>;
219
- /**
220
- * @override
221
- * @inheritDoc
222
- */
223
- addHorizontalRuleObject(): Promise<IHorizontalRule>;
224
- /**
225
- * @override
226
- * @inheritDoc
227
- */
228
- addBackgroundImageObject(imageUrl: string): Promise<IBackgroundImage>;
229
- /**
230
- * @override
231
- * @inheritDoc
232
- */
233
- setPrefillData(data: {
234
- [id: string]: string;
235
- }): void;
236
- /**
237
- * @override
238
- * @inheritDoc
239
- */
240
- distributeObjectsVertically(): void;
241
- /**
242
- * @override
243
- * @inheritDoc
244
- */
245
- getSelection(): ISelectionData;
246
- /**
247
- * @override
248
- * @inheritDoc
249
- */
250
- getSelection$(): Observable<ISelectionData>;
251
- /**
252
- * @override
253
- * @inheritDoc
254
- */
255
- select(object: ICanvasObject): void;
256
- /**
257
- * @override
258
- * @inheritDoc
259
- */
260
- clearSelection(): void;
261
- setMultiSelect(value: boolean): void;
262
- /**
263
- * @override
264
- * @inheritDoc
265
- */
266
- clear(): void;
267
- /**
268
- * @override
269
- * @inheritDoc
270
- */
271
- save(): ICanvasState;
272
- /**
273
- * @override
274
- * @inheritDoc
275
- */
276
- load(canvasState: ICanvasState): Promise<void>;
277
- /**
278
- * Another hack for bullet points... because they use canvas objects to render the bullets, they get saved when the canvas is persisted... and then loaded into a new canvas, but there's
279
- * nothing linking them to the field that needs bullets, so they end up duplicating every time the canvas is saved/loaded. Since we don't use circles for anything else, this just
280
- * deletes all circles on canvas load.
281
- */
282
- private removePersistedBullets;
283
- /**
284
- * Remove any slave objects persisted to the canvas; their master objects will recreate them.
285
- */
286
- private removeSlaveObjects;
287
- /**
288
- * @override
289
- * @inheritDoc
290
- */
291
- toSvg(): string;
292
- /**
293
- * @override
294
- * @inheritDoc
295
- */
296
- toImage(multiplier?: number): string;
297
- /**
298
- * @override
299
- * @inheritDoc
300
- */
301
- createPNGStream(): any;
302
- /**
303
- * @override
304
- * @inheritDoc
305
- */
306
- registerUndoState(): void;
307
- /**
308
- * @override
309
- * @inheritDoc
310
- */
311
- undo(): Promise<void>;
312
- /**
313
- * @override
314
- * @inheritDoc
315
- */
316
- redo(): Promise<void>;
317
- /**
318
- * Redraw the canvas.
319
- */
320
- redraw(): void;
321
- syncObjectList(): void;
322
- /**
323
- * @override
324
- * @inheritDoc
325
- */
326
- notifyObjectListChanged(): void;
327
- /**
328
- * @override
329
- * @inheritDoc
330
- */
331
- notifyTextChanged(): void;
332
- /**
333
- * @override
334
- * @inheritDoc
335
- */
336
- notifyMarginChanged(): void;
337
- removeFabricObject(obj: any): void;
338
- protected selectFabricObject(object: fabric.Object): void;
339
- protected onTextChange(): void;
340
- protected onObjectListChange(): void;
341
- protected onDimensionsChange(): void;
342
- protected onMarginChange(): void;
343
- private bindFields;
344
- private bindField;
345
- private findFabricObject;
346
- private findObject;
347
- /**
348
- * Reset zoom and canvas dimensions to 1:1 scale, execute a function, then return the canvas to
349
- * the previous values.
350
- * @param func Function to execute.
351
- */
352
- private executeWithNormalizedCanvas;
353
- /**
354
- * Update the actual dimensions of the canvas by multiplying the requested dimensions by the current zoom factor.
355
- */
356
- private updateCanvasDimensions;
357
- protected onProfileChanged(profile: ICanvasProfile): void;
358
- protected getFieldByCanvasObject?(object: any): AbstractCanvasObject<any> | null;
359
- protected getFieldsByCanvasObject(objects: any[]): Array<AbstractCanvasObject<any>>;
360
- private calculateImageCaptureCoefficient;
361
- private randomId;
362
- private getLowestTextPoint;
363
- private trackNewObject;
364
- private dimensionsExceedRestrictions;
365
- }
366
- export declare class SelectionData implements ISelectionData {
367
- readonly empty: boolean;
368
- readonly objects: Array<AbstractCanvasObject<any>>;
369
- readonly isText: boolean;
370
- readonly textSelection: ITextSelection | null;
371
- constructor(objects: Array<AbstractCanvasObject<any>>);
372
- }
@@ -1,15 +0,0 @@
1
- import { ICanvasDimensions } from "..";
2
- export declare class MillimeterDimensions implements ICanvasDimensions {
3
- readonly width: number;
4
- readonly widthPx: number;
5
- readonly widthMm: number;
6
- readonly widthUnit: string;
7
- readonly height: number;
8
- readonly heightPx: number;
9
- readonly heightMm: number;
10
- readonly heightUnit: string;
11
- constructor(width: number, height: number);
12
- withSize(width: number, height: number): ICanvasDimensions;
13
- widthPxToMm(px: number): number | undefined;
14
- heightPxToMm(px: number): number | undefined;
15
- }
@@ -1,13 +0,0 @@
1
- import { ICanvasDimensions } from "..";
2
- export declare class PixelCanvasDimensions implements ICanvasDimensions {
3
- readonly width: number;
4
- readonly widthPx: number;
5
- readonly widthUnit: string;
6
- readonly height: number;
7
- readonly heightPx: number;
8
- readonly heightUnit: string;
9
- constructor(width: number, height: number);
10
- withSize(width: number, height: number): ICanvasDimensions;
11
- widthPxToMm(px: number): number | undefined;
12
- heightPxToMm(px: number): number | undefined;
13
- }
@@ -1,18 +0,0 @@
1
- import { ICanvasDimensions } from "..";
2
- export declare class Print6ColCanvasDimensions implements ICanvasDimensions {
3
- readonly width: number;
4
- readonly widthPx: number;
5
- readonly widthMm: number;
6
- readonly widthUnit: string;
7
- readonly gutterCount: number;
8
- readonly gutterTotalMm: number;
9
- readonly columnsTotalMm: number;
10
- readonly height: number;
11
- readonly heightPx: number;
12
- readonly heightMm: number;
13
- readonly heightUnit: string;
14
- constructor(width: number, height: number);
15
- withSize(width: number, height: number): ICanvasDimensions;
16
- widthPxToMm(px: number): number | undefined;
17
- heightPxToMm(px: number): number | undefined;
18
- }
@@ -1,18 +0,0 @@
1
- import { ICanvasDimensions } from "..";
2
- export declare class Print8ColCanvasDimensions implements ICanvasDimensions {
3
- readonly width: number;
4
- readonly widthPx: number;
5
- readonly widthMm: number;
6
- readonly widthUnit: string;
7
- readonly gutterCount: number;
8
- readonly gutterTotalMm: number;
9
- readonly columnsTotalMm: number;
10
- readonly height: number;
11
- readonly heightPx: number;
12
- readonly heightMm: number;
13
- readonly heightUnit: string;
14
- constructor(width: number, height: number);
15
- withSize(width: number, height: number): ICanvasDimensions;
16
- widthPxToMm(px: number): number | undefined;
17
- heightPxToMm(px: number): number | undefined;
18
- }
@@ -1,27 +0,0 @@
1
- import { IFont } from "./font.interface";
2
- import { IFontLibrary } from "./font-library.interface";
3
- import { UnknownFont } from "./unknown-font";
4
- export declare const UNKNOWN_FONT: UnknownFont;
5
- export declare class FontLibrary implements IFontLibrary {
6
- private readonly _fonts;
7
- /**
8
- * @override
9
- * @inheritDoc
10
- */
11
- registerFont(font: IFont): void;
12
- /**
13
- * @override
14
- * @inheritDoc
15
- */
16
- registerFonts(fonts: IFont[]): void;
17
- /**
18
- * @override
19
- * @inheritDoc
20
- */
21
- getFonts(): IFont[];
22
- /**
23
- * @override
24
- * @inheritDoc
25
- */
26
- getFont(family: string): IFont;
27
- }
@@ -1,24 +0,0 @@
1
- import { IFont } from "./font.interface";
2
- /**
3
- * The font library manages a list of Fonts registered with the canvas.
4
- */
5
- export interface IFontLibrary {
6
- /**
7
- * Register a font
8
- */
9
- registerFont(font: IFont): void;
10
- /**
11
- * Register fonts
12
- */
13
- registerFonts(fonts: IFont[]): void;
14
- /**
15
- * Get all fonts registered in the library.
16
- */
17
- getFonts(): IFont[];
18
- /**
19
- * Get a font by family.
20
- * If font is not recognized, the {@link UNKNOWN_FONT} will be returned.
21
- * @param name Font family.
22
- */
23
- getFont(name: string): IFont;
24
- }
@@ -1,20 +0,0 @@
1
- export interface IFont {
2
- readonly family: string;
3
- readonly normalWeight: number;
4
- readonly boldWeight: number;
5
- /**
6
- * Returns true if the given font weight is considered bold for this font.
7
- * @param fontWeight Font weight.
8
- */
9
- isBold(fontWeight: number): boolean;
10
- }
11
- export declare abstract class Font implements IFont {
12
- abstract readonly family: string;
13
- abstract readonly normalWeight: number;
14
- abstract readonly boldWeight: number;
15
- /**
16
- * @override
17
- * @inheritDoc
18
- */
19
- isBold(fontWeight: number): boolean;
20
- }
@@ -1,6 +0,0 @@
1
- import { Font } from "./font.interface";
2
- export declare class UnknownFont extends Font {
3
- readonly family = "_Unknown_";
4
- readonly normalWeight = 400;
5
- readonly boldWeight = 700;
6
- }
@@ -1,10 +0,0 @@
1
- import { fabric } from "fabric";
2
- import { AbstractInteractiveCanvas } from "./abstract-interactive-canvas";
3
- export declare class HeadlessInteractiveCanvas extends AbstractInteractiveCanvas {
4
- readonly headless: boolean;
5
- constructor();
6
- /**
7
- * @override
8
- */
9
- protected selectFabricObject(object: fabric.Object): void;
10
- }
package/dist/index.d.ts DELETED
@@ -1,54 +0,0 @@
1
- export * from "./dimensions/millimeter-dimensions";
2
- export * from "./dimensions/pixel-canvas-dimensions";
3
- export * from "./dimensions/print-6-col-canvas-dimensions";
4
- export * from "./dimensions/print-8-col-canvas-dimensions";
5
- export * from "./font/font-library";
6
- export * from "./font/font-library.interface";
7
- export * from "./font/font.interface";
8
- export * from "./font/unknown-font";
9
- export * from "./layout/abstract-layout-manager";
10
- export * from "./layout/advanced-layout-manager";
11
- export * from "./layout/layout-manager.enum";
12
- export * from "./layout/layout-manager.interface";
13
- export * from "./layout/standard-layout-manager";
14
- export * from "./mutator/mutable-background-color.interface";
15
- export * from "./mutator/mutable-color.interface";
16
- export * from "./mutator/mutable-image.interface";
17
- export * from "./mutator/mutable-position.interface";
18
- export * from "./mutator/mutable-stroke.interface";
19
- export * from "./mutator/mutable-text-style.interface";
20
- export * from "./mutator/mutable-text.interface";
21
- export * from "./object/abstract-canvas-object";
22
- export * from "./object/canvas-object-data";
23
- export * from "./object/canvas-object.interface";
24
- export * from "./object/impl/background-image";
25
- export * from "./object/impl/border";
26
- export * from "./object/impl/cutoff";
27
- export * from "./object/impl/horizontal-rule";
28
- export * from "./object/impl/image";
29
- export * from "./object/impl/rectangle";
30
- export * from "./object/impl/rich-text";
31
- export * from "./object/impl/text";
32
- export * from "./object/impl/vertical-rule";
33
- export * from "./profile/canvas-profile.interface";
34
- export * from "./profile/default-canvas-profile";
35
- export * from "./types/canvas-dimension-restrictions.interface";
36
- export * from "./types/canvas-dimensions.interface";
37
- export * from "./types/canvas-dimension-restrictions.interface";
38
- export * from "./types/canvas-dimensions.interface";
39
- export * from "./types/canvas-state.interface";
40
- export * from "./types/dimension-restrictions.interface";
41
- export * from "./types/image-type.enum";
42
- export * from "./types/margin.interface";
43
- export * from "./types/object-dimensions.interface";
44
- export * from "./types/object-type.enum";
45
- export * from "./types/overflow.interface";
46
- export * from "./types/position.interface";
47
- export * from "./types/rect.interface";
48
- export * from "./types/selection-data.interface";
49
- export * from "./types/text-alignment.interface";
50
- export * from "./abstract-interactive-canvas";
51
- export * from "./headless-interactive-canvas";
52
- export * from "./interactive-canvas";
53
- export * from "./interactive-canvas.interface";
54
- export { ExtendedFabricTextbox } from "./object/impl/extended-fabric-textbox.interface";
@@ -1,25 +0,0 @@
1
- import { AbstractInteractiveCanvas } from "./abstract-interactive-canvas";
2
- export declare class InteractiveCanvas extends AbstractInteractiveCanvas {
3
- protected devicePixelRatio: number;
4
- readonly headless: boolean;
5
- private readonly undoStack;
6
- constructor(elementId: string, devicePixelRatio: number);
7
- /**
8
- * @override
9
- * @inheritDoc
10
- */
11
- registerUndoState(): void;
12
- /**
13
- * @override
14
- * @inheritDoc
15
- */
16
- undo(): Promise<void>;
17
- /**
18
- * @override
19
- * @inheritDoc
20
- */
21
- redo(): Promise<void>;
22
- private onFabricSelectionChanged;
23
- private enterTextSelectionModeIfRequired;
24
- private onTextEditing;
25
- }