@leapfrog/interactive-canvas 2.0.9 → 2.0.10
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/dist/abstract-interactive-canvas.d.ts +375 -372
- package/dist/dimensions/millimeter-dimensions.d.ts +15 -15
- package/dist/dimensions/pixel-canvas-dimensions.d.ts +13 -13
- package/dist/dimensions/print-6-col-canvas-dimensions.d.ts +18 -18
- package/dist/dimensions/print-8-col-canvas-dimensions.d.ts +18 -18
- package/dist/font/font-library.d.ts +27 -27
- package/dist/font/font-library.interface.d.ts +24 -24
- package/dist/font/font.interface.d.ts +20 -20
- package/dist/font/unknown-font.d.ts +6 -6
- package/dist/headless-interactive-canvas.d.ts +10 -10
- package/dist/index.d.ts +54 -54
- package/dist/interactive-canvas.d.ts +25 -25
- package/dist/interactive-canvas.es.js +3910 -3905
- package/dist/interactive-canvas.interface.d.ts +297 -297
- package/dist/interactive-canvas.js +3907 -3902
- package/dist/layout/abstract-layout-manager.d.ts +17 -17
- package/dist/layout/advanced-layout-manager.d.ts +16 -16
- package/dist/layout/function/pin-to-bottom.layout-function.d.ts +4 -4
- package/dist/layout/function/redraw-all.layout-function.d.ts +4 -4
- package/dist/layout/function/reposition-backgrounds.layout-function.d.ts +4 -4
- package/dist/layout/function/reposition-borders.layout-function.d.ts +4 -4
- package/dist/layout/function/reposition-cutoffs.layout-function.d.ts +4 -4
- package/dist/layout/function/resize-canvas.layout-function.d.ts +4 -4
- package/dist/layout/function/stack-objects.layout-function.d.ts +11 -11
- package/dist/layout/function/update-object-dimensions.layout-function.d.ts +4 -4
- package/dist/layout/layout-manager.enum.d.ts +5 -5
- package/dist/layout/layout-manager.interface.d.ts +13 -13
- package/dist/layout/standard-layout-manager.d.ts +40 -40
- package/dist/mutator/mutable-background-color.interface.d.ts +15 -15
- package/dist/mutator/mutable-color.interface.d.ts +6 -6
- package/dist/mutator/mutable-image.interface.d.ts +28 -28
- package/dist/mutator/mutable-position.interface.d.ts +63 -63
- package/dist/mutator/mutable-stroke.interface.d.ts +8 -8
- package/dist/mutator/mutable-text-style.interface.d.ts +163 -163
- package/dist/mutator/mutable-text.interface.d.ts +80 -80
- package/dist/object/abstract-canvas-object.d.ts +207 -207
- package/dist/object/canvas-object-data.d.ts +24 -24
- package/dist/object/canvas-object.interface.d.ts +109 -109
- package/dist/object/impl/background-image.d.ts +38 -38
- package/dist/object/impl/border.d.ts +70 -70
- package/dist/object/impl/cutoff.d.ts +59 -59
- package/dist/object/impl/extended-fabric-object.interface.d.ts +7 -7
- package/dist/object/impl/extended-fabric-textbox.interface.d.ts +7 -7
- package/dist/object/impl/horizontal-rule.d.ts +83 -83
- package/dist/object/impl/image.d.ts +76 -76
- package/dist/object/impl/rectangle.d.ts +78 -78
- package/dist/object/impl/rich-text.d.ts +39 -39
- package/dist/object/impl/text.d.ts +314 -314
- package/dist/object/impl/vertical-rule.d.ts +83 -83
- package/dist/profile/canvas-profile.interface.d.ts +22 -22
- package/dist/profile/default-canvas-profile.d.ts +23 -23
- package/dist/types/canvas-dimension-restrictions.interface.d.ts +15 -15
- package/dist/types/canvas-dimensions.interface.d.ts +21 -21
- package/dist/types/canvas-state.interface.d.ts +11 -11
- package/dist/types/dimension-restrictions.interface.d.ts +6 -6
- package/dist/types/image-type.enum.d.ts +6 -6
- package/dist/types/margin.interface.d.ts +6 -6
- package/dist/types/object-dimensions.interface.d.ts +23 -23
- package/dist/types/object-type.enum.d.ts +12 -12
- package/dist/types/overflow.interface.d.ts +4 -4
- package/dist/types/position.interface.d.ts +9 -9
- package/dist/types/rect.interface.d.ts +6 -6
- package/dist/types/selection-data.interface.d.ts +24 -19
- package/dist/types/text-alignment.interface.d.ts +1 -1
- package/dist/undo-stack.d.ts +27 -27
- package/dist/undo-stack.interface.d.ts +6 -6
- package/package.json +2 -2
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { IDimensionRestrictions, IInteractiveCanvas, IMutableImage, IMutablePosition, IPosition } from "../..";
|
|
2
|
-
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
-
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
4
|
-
import { Observable } from "rxjs";
|
|
5
|
-
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import { fabric } from "fabric";
|
|
7
|
-
/**
|
|
8
|
-
* Image field. Displays a custom image on the canvas.
|
|
9
|
-
*/
|
|
10
|
-
export interface IImage extends ICanvasObject, IMutableImage, IMutablePosition {
|
|
11
|
-
}
|
|
12
|
-
export declare class Image extends AbstractCanvasObject<fabric.Image> implements IImage {
|
|
13
|
-
private readonly DEFAULT_RESTRICTIONS;
|
|
14
|
-
private layoutWidth;
|
|
15
|
-
private readonly imageUrl$;
|
|
16
|
-
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Image, persistedField?: CanvasObjectData);
|
|
17
|
-
/**
|
|
18
|
-
* @override
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
getImageUrl(): string;
|
|
22
|
-
/**
|
|
23
|
-
* @override
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
getImageUrl$(): Observable<string>;
|
|
27
|
-
/**
|
|
28
|
-
* @override
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
setImageUrl(url: string): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* @override
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
setImageWidth(px: number, sizeRestrictions?: IDimensionRestrictions): number;
|
|
37
|
-
/**
|
|
38
|
-
* @override
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
centerHorizontally(): void;
|
|
42
|
-
/**
|
|
43
|
-
* @override
|
|
44
|
-
* @inheritDoc
|
|
45
|
-
*/
|
|
46
|
-
centerVertically(): void;
|
|
47
|
-
/**
|
|
48
|
-
* @override
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
nudgeUp(): void;
|
|
52
|
-
/**
|
|
53
|
-
* @override
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
nudgeDown(): void;
|
|
57
|
-
/**
|
|
58
|
-
* @override
|
|
59
|
-
* @inheritDoc
|
|
60
|
-
*/
|
|
61
|
-
nudgeLeft(): void;
|
|
62
|
-
/**
|
|
63
|
-
* @override
|
|
64
|
-
* @inheritDoc
|
|
65
|
-
*/
|
|
66
|
-
nudgeRight(): void;
|
|
67
|
-
/**
|
|
68
|
-
* @override
|
|
69
|
-
* @inheritDoc
|
|
70
|
-
*/
|
|
71
|
-
setPosition(position: IPosition): void;
|
|
72
|
-
private centerHorizontallyInLayoutWidth;
|
|
73
|
-
private setCanvasImage;
|
|
74
|
-
private getMinWidthBasedOnMinHeight;
|
|
75
|
-
private getMaxWidthBasedOnMaxHeight;
|
|
76
|
-
}
|
|
1
|
+
import { IDimensionRestrictions, IInteractiveCanvas, IMutableImage, IMutablePosition, IPosition } from "../..";
|
|
2
|
+
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
+
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
4
|
+
import { Observable } from "rxjs";
|
|
5
|
+
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
+
import { fabric } from "fabric";
|
|
7
|
+
/**
|
|
8
|
+
* Image field. Displays a custom image on the canvas.
|
|
9
|
+
*/
|
|
10
|
+
export interface IImage extends ICanvasObject, IMutableImage, IMutablePosition {
|
|
11
|
+
}
|
|
12
|
+
export declare class Image extends AbstractCanvasObject<fabric.Image> implements IImage {
|
|
13
|
+
private readonly DEFAULT_RESTRICTIONS;
|
|
14
|
+
private layoutWidth;
|
|
15
|
+
private readonly imageUrl$;
|
|
16
|
+
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Image, persistedField?: CanvasObjectData);
|
|
17
|
+
/**
|
|
18
|
+
* @override
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
getImageUrl(): string;
|
|
22
|
+
/**
|
|
23
|
+
* @override
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
getImageUrl$(): Observable<string>;
|
|
27
|
+
/**
|
|
28
|
+
* @override
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
setImageUrl(url: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* @override
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
setImageWidth(px: number, sizeRestrictions?: IDimensionRestrictions): number;
|
|
37
|
+
/**
|
|
38
|
+
* @override
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
centerHorizontally(): void;
|
|
42
|
+
/**
|
|
43
|
+
* @override
|
|
44
|
+
* @inheritDoc
|
|
45
|
+
*/
|
|
46
|
+
centerVertically(): void;
|
|
47
|
+
/**
|
|
48
|
+
* @override
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
nudgeUp(): void;
|
|
52
|
+
/**
|
|
53
|
+
* @override
|
|
54
|
+
* @inheritDoc
|
|
55
|
+
*/
|
|
56
|
+
nudgeDown(): void;
|
|
57
|
+
/**
|
|
58
|
+
* @override
|
|
59
|
+
* @inheritDoc
|
|
60
|
+
*/
|
|
61
|
+
nudgeLeft(): void;
|
|
62
|
+
/**
|
|
63
|
+
* @override
|
|
64
|
+
* @inheritDoc
|
|
65
|
+
*/
|
|
66
|
+
nudgeRight(): void;
|
|
67
|
+
/**
|
|
68
|
+
* @override
|
|
69
|
+
* @inheritDoc
|
|
70
|
+
*/
|
|
71
|
+
setPosition(position: IPosition): void;
|
|
72
|
+
private centerHorizontallyInLayoutWidth;
|
|
73
|
+
private setCanvasImage;
|
|
74
|
+
private getMinWidthBasedOnMinHeight;
|
|
75
|
+
private getMaxWidthBasedOnMaxHeight;
|
|
76
|
+
}
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { ICanvasObject } from "../canvas-object.interface";
|
|
2
|
-
import { IInteractiveCanvas, IMutableColor, IMutablePosition, IMutableStroke } from "../..";
|
|
3
|
-
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
4
|
-
import { CanvasObjectData } from "../canvas-object-data";
|
|
5
|
-
import { fabric } from "fabric";
|
|
6
|
-
/**
|
|
7
|
-
* Rectangle field. A basic block of color that can be moved and scaled.
|
|
8
|
-
*/
|
|
9
|
-
export interface IRectangle extends ICanvasObject, IMutableStroke, IMutableColor, IMutablePosition {
|
|
10
|
-
}
|
|
11
|
-
export declare class Rectangle extends AbstractCanvasObject<fabric.Rect> implements IRectangle {
|
|
12
|
-
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Rect, persistedField?: CanvasObjectData);
|
|
13
|
-
/**
|
|
14
|
-
* @override
|
|
15
|
-
* @inheritDoc
|
|
16
|
-
*/
|
|
17
|
-
getColor(): string;
|
|
18
|
-
/**
|
|
19
|
-
* @override
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
setColor(color: string): void;
|
|
23
|
-
/**
|
|
24
|
-
* @override
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
getStrokeColor(): string | null;
|
|
28
|
-
/**
|
|
29
|
-
* @override
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
setStrokeColor(color: string | null): void;
|
|
33
|
-
/**
|
|
34
|
-
* @override
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
getStrokeWidth(): number;
|
|
38
|
-
/**
|
|
39
|
-
* @override
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
setStrokeWidth(width: number): void;
|
|
43
|
-
/**
|
|
44
|
-
* @override
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
centerHorizontally(): void;
|
|
48
|
-
/**
|
|
49
|
-
* @override
|
|
50
|
-
* @inheritDoc
|
|
51
|
-
*/
|
|
52
|
-
centerVertically(): void;
|
|
53
|
-
/**
|
|
54
|
-
* @override
|
|
55
|
-
* @inheritDoc
|
|
56
|
-
*/
|
|
57
|
-
nudgeUp(): void;
|
|
58
|
-
/**
|
|
59
|
-
* @override
|
|
60
|
-
* @inheritDoc
|
|
61
|
-
*/
|
|
62
|
-
nudgeDown(): void;
|
|
63
|
-
/**
|
|
64
|
-
* @override
|
|
65
|
-
* @inheritDoc
|
|
66
|
-
*/
|
|
67
|
-
nudgeLeft(): void;
|
|
68
|
-
/**
|
|
69
|
-
* @override
|
|
70
|
-
* @inheritDoc
|
|
71
|
-
*/
|
|
72
|
-
nudgeRight(): void;
|
|
73
|
-
/**
|
|
74
|
-
* @override
|
|
75
|
-
* @inheritDoc
|
|
76
|
-
*/
|
|
77
|
-
protected afterScale(event: any): void;
|
|
78
|
-
}
|
|
1
|
+
import { ICanvasObject } from "../canvas-object.interface";
|
|
2
|
+
import { IInteractiveCanvas, IMutableColor, IMutablePosition, IMutableStroke } from "../..";
|
|
3
|
+
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
4
|
+
import { CanvasObjectData } from "../canvas-object-data";
|
|
5
|
+
import { fabric } from "fabric";
|
|
6
|
+
/**
|
|
7
|
+
* Rectangle field. A basic block of color that can be moved and scaled.
|
|
8
|
+
*/
|
|
9
|
+
export interface IRectangle extends ICanvasObject, IMutableStroke, IMutableColor, IMutablePosition {
|
|
10
|
+
}
|
|
11
|
+
export declare class Rectangle extends AbstractCanvasObject<fabric.Rect> implements IRectangle {
|
|
12
|
+
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Rect, persistedField?: CanvasObjectData);
|
|
13
|
+
/**
|
|
14
|
+
* @override
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
getColor(): string;
|
|
18
|
+
/**
|
|
19
|
+
* @override
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
setColor(color: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* @override
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
getStrokeColor(): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* @override
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
setStrokeColor(color: string | null): void;
|
|
33
|
+
/**
|
|
34
|
+
* @override
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
getStrokeWidth(): number;
|
|
38
|
+
/**
|
|
39
|
+
* @override
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
setStrokeWidth(width: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* @override
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
centerHorizontally(): void;
|
|
48
|
+
/**
|
|
49
|
+
* @override
|
|
50
|
+
* @inheritDoc
|
|
51
|
+
*/
|
|
52
|
+
centerVertically(): void;
|
|
53
|
+
/**
|
|
54
|
+
* @override
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
nudgeUp(): void;
|
|
58
|
+
/**
|
|
59
|
+
* @override
|
|
60
|
+
* @inheritDoc
|
|
61
|
+
*/
|
|
62
|
+
nudgeDown(): void;
|
|
63
|
+
/**
|
|
64
|
+
* @override
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
nudgeLeft(): void;
|
|
68
|
+
/**
|
|
69
|
+
* @override
|
|
70
|
+
* @inheritDoc
|
|
71
|
+
*/
|
|
72
|
+
nudgeRight(): void;
|
|
73
|
+
/**
|
|
74
|
+
* @override
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
protected afterScale(event: any): void;
|
|
78
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { CanvasObjectData, IInteractiveCanvas, Image, IMutableImage, IMutablePosition } from "../..";
|
|
2
|
-
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
-
import { fabric } from "fabric";
|
|
4
|
-
/**
|
|
5
|
-
* Rich text field.
|
|
6
|
-
* Displays complex text by taking a rendered image of a html block of rich text and displays it on the canvas.
|
|
7
|
-
* The rendering of the text content to an image must be handled by the caller.
|
|
8
|
-
* This is an attempt to work around the poor rich-text support of fabric, which supports virtually no rich-text features on the canvas itself.
|
|
9
|
-
*/
|
|
10
|
-
export interface IRichText extends ICanvasObject, IMutableImage, IMutablePosition {
|
|
11
|
-
/**
|
|
12
|
-
* HTML rich text content.
|
|
13
|
-
*/
|
|
14
|
-
htmlContent: string;
|
|
15
|
-
/**
|
|
16
|
-
* Set the rich text content by providing the rendered image version of the content and the html content.
|
|
17
|
-
* @param renderedContentUrl Rendered version of the rich-text content.
|
|
18
|
-
* @param htmlContent Html version of the rich text content.
|
|
19
|
-
*/
|
|
20
|
-
setRichTextContent(renderedContentUrl: string, htmlContent: string): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
export declare class RichText extends Image implements IRichText {
|
|
23
|
-
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Image, persistedField?: CanvasObjectData);
|
|
24
|
-
/**
|
|
25
|
-
* @override
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
get htmlContent(): string;
|
|
29
|
-
/**
|
|
30
|
-
* @override
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
set htmlContent(text: string);
|
|
34
|
-
/**
|
|
35
|
-
* @override
|
|
36
|
-
* @inheritDoc
|
|
37
|
-
*/
|
|
38
|
-
setRichTextContent(renderedContentUrl: string, htmlContent: string): Promise<void>;
|
|
39
|
-
}
|
|
1
|
+
import { CanvasObjectData, IInteractiveCanvas, Image, IMutableImage, IMutablePosition } from "../..";
|
|
2
|
+
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
+
import { fabric } from "fabric";
|
|
4
|
+
/**
|
|
5
|
+
* Rich text field.
|
|
6
|
+
* Displays complex text by taking a rendered image of a html block of rich text and displays it on the canvas.
|
|
7
|
+
* The rendering of the text content to an image must be handled by the caller.
|
|
8
|
+
* This is an attempt to work around the poor rich-text support of fabric, which supports virtually no rich-text features on the canvas itself.
|
|
9
|
+
*/
|
|
10
|
+
export interface IRichText extends ICanvasObject, IMutableImage, IMutablePosition {
|
|
11
|
+
/**
|
|
12
|
+
* HTML rich text content.
|
|
13
|
+
*/
|
|
14
|
+
htmlContent: string;
|
|
15
|
+
/**
|
|
16
|
+
* Set the rich text content by providing the rendered image version of the content and the html content.
|
|
17
|
+
* @param renderedContentUrl Rendered version of the rich-text content.
|
|
18
|
+
* @param htmlContent Html version of the rich text content.
|
|
19
|
+
*/
|
|
20
|
+
setRichTextContent(renderedContentUrl: string, htmlContent: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare class RichText extends Image implements IRichText {
|
|
23
|
+
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Image, persistedField?: CanvasObjectData);
|
|
24
|
+
/**
|
|
25
|
+
* @override
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
get htmlContent(): string;
|
|
29
|
+
/**
|
|
30
|
+
* @override
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
set htmlContent(text: string);
|
|
34
|
+
/**
|
|
35
|
+
* @override
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
setRichTextContent(renderedContentUrl: string, htmlContent: string): Promise<void>;
|
|
39
|
+
}
|