@leapfrog/interactive-canvas 1.0.1 → 1.0.2
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/package.json +1 -1
- package/dist/abstract-interactive-canvas.d.ts +0 -340
- package/dist/dimensions/pixel-canvas-dimensions.d.ts +0 -13
- package/dist/dimensions/print-6-col-canvas-dimensions.d.ts +0 -18
- package/dist/dimensions/print-8-col-canvas-dimensions.d.ts +0 -18
- package/dist/font/font-library.d.ts +0 -27
- package/dist/font/font-library.interface.d.ts +0 -24
- package/dist/font/font.interface.d.ts +0 -20
- package/dist/font/unknown-font.d.ts +0 -6
- package/dist/headless-interactive-canvas.d.ts +0 -9
- package/dist/index.d.ts +0 -49
- package/dist/interactive-canvas.d.ts +0 -8
- package/dist/interactive-canvas.es.js +0 -3195
- package/dist/interactive-canvas.interface.d.ts +0 -267
- package/dist/interactive-canvas.js +0 -3224
- package/dist/layout/abstract-layout-manager.d.ts +0 -17
- package/dist/layout/advanced-layout-manager.d.ts +0 -15
- package/dist/layout/function/pin-to-bottom.layout-function.d.ts +0 -4
- package/dist/layout/function/redraw-all.layout-function.d.ts +0 -4
- package/dist/layout/function/reposition-borders.layout-function.d.ts +0 -4
- package/dist/layout/function/reposition-cutoffs.layout-function.d.ts +0 -4
- package/dist/layout/function/resize-canvas.layout-function.d.ts +0 -4
- package/dist/layout/function/stack-objects.layout-function.d.ts +0 -11
- package/dist/layout/function/update-object-dimensions.layout-function.d.ts +0 -4
- package/dist/layout/layout-manager.enum.d.ts +0 -5
- package/dist/layout/layout-manager.interface.d.ts +0 -13
- package/dist/layout/standard-layout-manager.d.ts +0 -35
- package/dist/mutator/mutable-background-color.interface.d.ts +0 -15
- package/dist/mutator/mutable-color.interface.d.ts +0 -6
- package/dist/mutator/mutable-image.interface.d.ts +0 -28
- package/dist/mutator/mutable-position.interface.d.ts +0 -33
- package/dist/mutator/mutable-text-style.interface.d.ts +0 -163
- package/dist/mutator/mutable-text.interface.d.ts +0 -40
- package/dist/object/abstract-canvas-object.d.ts +0 -155
- package/dist/object/canvas-object-data.d.ts +0 -23
- package/dist/object/canvas-object.interface.d.ts +0 -96
- package/dist/object/impl/border.d.ts +0 -59
- package/dist/object/impl/cutoff.d.ts +0 -59
- package/dist/object/impl/horizontal-rule.d.ts +0 -88
- package/dist/object/impl/image.d.ts +0 -81
- package/dist/object/impl/rectangle.d.ts +0 -58
- package/dist/object/impl/text.d.ts +0 -264
- package/dist/object/impl/vertical-rule.d.ts +0 -88
- package/dist/profile/canvas-profile.interface.d.ts +0 -22
- package/dist/profile/default-canvas-profile.d.ts +0 -23
- package/dist/types/canvas-dimension-restrictions.interface.d.ts +0 -14
- package/dist/types/canvas-dimensions.interface.d.ts +0 -21
- package/dist/types/canvas-state.interface.d.ts +0 -11
- package/dist/types/dimension-restrictions.interface.d.ts +0 -6
- package/dist/types/image-type.enum.d.ts +0 -6
- package/dist/types/margin.interface.d.ts +0 -6
- package/dist/types/object-dimensions.interface.d.ts +0 -23
- package/dist/types/object-type.enum.d.ts +0 -10
- package/dist/types/overflow.interface.d.ts +0 -4
- package/dist/types/position.interface.d.ts +0 -6
- package/dist/types/rect.interface.d.ts +0 -6
- package/dist/types/selection-data.interface.d.ts +0 -19
- package/dist/types/text-alignment.interface.d.ts +0 -1
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { IMargin, IObjectDimensions, ObjectType } from "..";
|
|
3
|
-
import { CanvasObjectData } from "./canvas-object-data";
|
|
4
|
-
/**
|
|
5
|
-
* An object rendered on the {@link IInteractiveCanvas Interactive Canvas}.
|
|
6
|
-
*/
|
|
7
|
-
export interface ICanvasObject {
|
|
8
|
-
/**
|
|
9
|
-
* Get the field id.
|
|
10
|
-
*/
|
|
11
|
-
getId(): string;
|
|
12
|
-
/**
|
|
13
|
-
* Get the field type.
|
|
14
|
-
*/
|
|
15
|
-
getType(): ObjectType;
|
|
16
|
-
/**
|
|
17
|
-
* Get the field description, a user-friendly version of Type.
|
|
18
|
-
*/
|
|
19
|
-
getDescription(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Set whether this field is to be used for the sort caption.
|
|
22
|
-
*/
|
|
23
|
-
setSortCaption(value: boolean): void;
|
|
24
|
-
/**
|
|
25
|
-
* True if this field is a sort caption.
|
|
26
|
-
*/
|
|
27
|
-
isSortCaption(): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Get object dimensions.
|
|
30
|
-
* @see IObjectDimensions.
|
|
31
|
-
*/
|
|
32
|
-
getDimensions(): IObjectDimensions;
|
|
33
|
-
/**
|
|
34
|
-
* Get an observable for the field dimensions.
|
|
35
|
-
*/
|
|
36
|
-
getDimensions$(): Observable<IObjectDimensions>;
|
|
37
|
-
/**
|
|
38
|
-
* Get the component margin.
|
|
39
|
-
*/
|
|
40
|
-
getMargin(): IMargin;
|
|
41
|
-
/**
|
|
42
|
-
* Set component margin.
|
|
43
|
-
* @param margin New margin.
|
|
44
|
-
*/
|
|
45
|
-
setMargin(margin: IMargin): void;
|
|
46
|
-
/**
|
|
47
|
-
* Get the column width percentage.
|
|
48
|
-
*/
|
|
49
|
-
getColumnWidthPercent(): number;
|
|
50
|
-
/**
|
|
51
|
-
* Set column width percentage.
|
|
52
|
-
* @param percent New value.
|
|
53
|
-
*/
|
|
54
|
-
setColumnWidthPercent(percent: number): void;
|
|
55
|
-
/**
|
|
56
|
-
* Bring object to front.
|
|
57
|
-
*/
|
|
58
|
-
bringToFront(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Bring object forward one place.
|
|
61
|
-
*/
|
|
62
|
-
bringForward(): void;
|
|
63
|
-
/**
|
|
64
|
-
* Send object backward one place.
|
|
65
|
-
*/
|
|
66
|
-
sendBackward(): void;
|
|
67
|
-
/**
|
|
68
|
-
* Send object to the back.
|
|
69
|
-
*/
|
|
70
|
-
sendToBack(): void;
|
|
71
|
-
/**
|
|
72
|
-
* Move the object up in the object list.
|
|
73
|
-
*/
|
|
74
|
-
moveUp(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Move the object down in the object list.
|
|
77
|
-
*/
|
|
78
|
-
moveDown(): void;
|
|
79
|
-
/**
|
|
80
|
-
* Delete this object, removing it from the canvas.
|
|
81
|
-
*/
|
|
82
|
-
delete(): void;
|
|
83
|
-
/**
|
|
84
|
-
* Persist this object, returning a copy of the data block.
|
|
85
|
-
*/
|
|
86
|
-
persist(): CanvasObjectData;
|
|
87
|
-
/**
|
|
88
|
-
* Get whether the object is pinned to the bottom of the canvas.
|
|
89
|
-
*/
|
|
90
|
-
isPinToBottom(): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Set whether the object is pinned to the bottom of the canvas.
|
|
93
|
-
* @param value New value.
|
|
94
|
-
*/
|
|
95
|
-
setPinToBottom(value?: boolean): void;
|
|
96
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
-
import { IInteractiveCanvas, IMutableColor } from "../..";
|
|
4
|
-
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
|
-
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import { fabric } from "fabric";
|
|
7
|
-
/**
|
|
8
|
-
* Border field. A rectangle with a stroke width that automatically follows the canvas border.
|
|
9
|
-
*/
|
|
10
|
-
export interface IBorder extends ICanvasObject, IMutableColor {
|
|
11
|
-
/**
|
|
12
|
-
* Get the width of the border stroke.
|
|
13
|
-
*/
|
|
14
|
-
getStrokeWidth(): number;
|
|
15
|
-
/**
|
|
16
|
-
* Get an observable of the width of the cutoff stroke.
|
|
17
|
-
*/
|
|
18
|
-
getStrokeWidth$(): Observable<number>;
|
|
19
|
-
/**
|
|
20
|
-
* Set the border stroke width.
|
|
21
|
-
* @param width New width.
|
|
22
|
-
*/
|
|
23
|
-
setStrokeWidth(width: number): void;
|
|
24
|
-
}
|
|
25
|
-
export declare class Border extends AbstractCanvasObject<fabric.Rect> implements IBorder {
|
|
26
|
-
private readonly strokeWidth$;
|
|
27
|
-
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Rect, persistedField?: CanvasObjectData);
|
|
28
|
-
/**
|
|
29
|
-
* @override
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
getColor(): string;
|
|
33
|
-
/**
|
|
34
|
-
* @override
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
setColor(color: string): void;
|
|
38
|
-
/**
|
|
39
|
-
* @override
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
getStrokeWidth(): number;
|
|
43
|
-
/**
|
|
44
|
-
* @override
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
getStrokeWidth$(): Observable<number>;
|
|
48
|
-
/**
|
|
49
|
-
* @override
|
|
50
|
-
* @inheritDoc
|
|
51
|
-
*/
|
|
52
|
-
setStrokeWidth(width: number): void;
|
|
53
|
-
updatePosition(): void;
|
|
54
|
-
/**
|
|
55
|
-
* @override
|
|
56
|
-
* @inheritDoc
|
|
57
|
-
*/
|
|
58
|
-
protected updateFabricObjectBehavior(): void;
|
|
59
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
-
import { IInteractiveCanvas, IMutableColor } from "../..";
|
|
4
|
-
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
|
-
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import { fabric } from "fabric";
|
|
7
|
-
/**
|
|
8
|
-
* Cutoff field. A cutoff rule that sits on the bottom of the canvas.
|
|
9
|
-
*/
|
|
10
|
-
export interface ICutoff extends ICanvasObject, IMutableColor {
|
|
11
|
-
/**
|
|
12
|
-
* Get the width of the cutoff stroke.
|
|
13
|
-
*/
|
|
14
|
-
getStrokeWidth(): number;
|
|
15
|
-
/**
|
|
16
|
-
* Get an observable of the width of the cutoff stroke.
|
|
17
|
-
*/
|
|
18
|
-
getStrokeWidth$(): Observable<number>;
|
|
19
|
-
/**
|
|
20
|
-
* Set the cutoff stroke width.
|
|
21
|
-
* @param width New width.
|
|
22
|
-
*/
|
|
23
|
-
setStrokeWidth(width: number): void;
|
|
24
|
-
}
|
|
25
|
-
export declare class Cutoff extends AbstractCanvasObject<fabric.Rect> implements ICutoff {
|
|
26
|
-
private readonly strokeWidth$;
|
|
27
|
-
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Rect, persistedField?: CanvasObjectData);
|
|
28
|
-
/**
|
|
29
|
-
* @override
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
getColor(): string;
|
|
33
|
-
/**
|
|
34
|
-
* @override
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
setColor(color: string): void;
|
|
38
|
-
/**
|
|
39
|
-
* @override
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
getStrokeWidth(): number;
|
|
43
|
-
/**
|
|
44
|
-
* @override
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
getStrokeWidth$(): Observable<number>;
|
|
48
|
-
/**
|
|
49
|
-
* @override
|
|
50
|
-
* @inheritDoc
|
|
51
|
-
*/
|
|
52
|
-
setStrokeWidth(width: number): void;
|
|
53
|
-
updatePosition(): void;
|
|
54
|
-
/**
|
|
55
|
-
* @override
|
|
56
|
-
* @inheritDoc
|
|
57
|
-
*/
|
|
58
|
-
protected updateFabricObjectBehavior(): void;
|
|
59
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
-
import { IInteractiveCanvas, IMutableColor, IMutablePosition } from "../..";
|
|
4
|
-
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
|
-
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import { fabric } from "fabric";
|
|
7
|
-
/**
|
|
8
|
-
* Horizontal rule. A basic block of color in a thin line across the canvas.
|
|
9
|
-
*/
|
|
10
|
-
export interface IHorizontalRule extends ICanvasObject, IMutableColor, IMutablePosition {
|
|
11
|
-
/**
|
|
12
|
-
* Get the width of the rule.
|
|
13
|
-
*/
|
|
14
|
-
getStrokeWidth(): number;
|
|
15
|
-
/**
|
|
16
|
-
* Get an observable of the width of the rule.
|
|
17
|
-
*/
|
|
18
|
-
getStrokeWidth$(): Observable<number>;
|
|
19
|
-
/**
|
|
20
|
-
* Set the rule width.
|
|
21
|
-
* @param width New width.
|
|
22
|
-
*/
|
|
23
|
-
setStrokeWidth(width: number): void;
|
|
24
|
-
}
|
|
25
|
-
export declare class HorizontalRule extends AbstractCanvasObject<fabric.Rect> implements IHorizontalRule {
|
|
26
|
-
private readonly strokeWidth$;
|
|
27
|
-
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Rect, persistedField?: CanvasObjectData);
|
|
28
|
-
/**
|
|
29
|
-
* @override
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
getStrokeWidth(): number;
|
|
33
|
-
/**
|
|
34
|
-
* @override
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
getStrokeWidth$(): Observable<number>;
|
|
38
|
-
/**
|
|
39
|
-
* @override
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
setStrokeWidth(value: number): void;
|
|
43
|
-
/**
|
|
44
|
-
* @override
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
getColor(): string;
|
|
48
|
-
/**
|
|
49
|
-
* @override
|
|
50
|
-
* @inheritDoc
|
|
51
|
-
*/
|
|
52
|
-
setColor(color: string): void;
|
|
53
|
-
/**
|
|
54
|
-
* @override
|
|
55
|
-
* @inheritDoc
|
|
56
|
-
*/
|
|
57
|
-
centerHorizontally(): void;
|
|
58
|
-
/**
|
|
59
|
-
* @override
|
|
60
|
-
* @inheritDoc
|
|
61
|
-
*/
|
|
62
|
-
centerVertically(): void;
|
|
63
|
-
/**
|
|
64
|
-
* @override
|
|
65
|
-
* @inheritDoc
|
|
66
|
-
*/
|
|
67
|
-
setHeight(height: number): void;
|
|
68
|
-
/**
|
|
69
|
-
* @override
|
|
70
|
-
* @inheritDoc
|
|
71
|
-
*/
|
|
72
|
-
nudgeUp(): void;
|
|
73
|
-
/**
|
|
74
|
-
* @override
|
|
75
|
-
* @inheritDoc
|
|
76
|
-
*/
|
|
77
|
-
nudgeDown(): void;
|
|
78
|
-
/**
|
|
79
|
-
* @override
|
|
80
|
-
* @inheritDoc
|
|
81
|
-
*/
|
|
82
|
-
nudgeLeft(): void;
|
|
83
|
-
/**
|
|
84
|
-
* @override
|
|
85
|
-
* @inheritDoc
|
|
86
|
-
*/
|
|
87
|
-
nudgeRight(): void;
|
|
88
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
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): 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
|
-
setHeight(height: number): void;
|
|
52
|
-
/**
|
|
53
|
-
* @override
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
nudgeUp(): void;
|
|
57
|
-
/**
|
|
58
|
-
* @override
|
|
59
|
-
* @inheritDoc
|
|
60
|
-
*/
|
|
61
|
-
nudgeDown(): void;
|
|
62
|
-
/**
|
|
63
|
-
* @override
|
|
64
|
-
* @inheritDoc
|
|
65
|
-
*/
|
|
66
|
-
nudgeLeft(): void;
|
|
67
|
-
/**
|
|
68
|
-
* @override
|
|
69
|
-
* @inheritDoc
|
|
70
|
-
*/
|
|
71
|
-
nudgeRight(): void;
|
|
72
|
-
/**
|
|
73
|
-
* @override
|
|
74
|
-
* @inheritDoc
|
|
75
|
-
*/
|
|
76
|
-
setPosition(position: IPosition): void;
|
|
77
|
-
private centerHorizontallyInLayoutWidth;
|
|
78
|
-
private setCanvasImage;
|
|
79
|
-
private getMinWidthBasedOnMinHeight;
|
|
80
|
-
private getMaxWidthBasedOnMaxHeight;
|
|
81
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ICanvasObject } from "../canvas-object.interface";
|
|
2
|
-
import { IInteractiveCanvas, IMutableColor, IMutablePosition } 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, 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
|
-
centerHorizontally(): void;
|
|
28
|
-
/**
|
|
29
|
-
* @override
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
centerVertically(): void;
|
|
33
|
-
/**
|
|
34
|
-
* @override
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
setHeight(height: number): void;
|
|
38
|
-
/**
|
|
39
|
-
* @override
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
nudgeUp(): void;
|
|
43
|
-
/**
|
|
44
|
-
* @override
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
nudgeDown(): void;
|
|
48
|
-
/**
|
|
49
|
-
* @override
|
|
50
|
-
* @inheritDoc
|
|
51
|
-
*/
|
|
52
|
-
nudgeLeft(): void;
|
|
53
|
-
/**
|
|
54
|
-
* @override
|
|
55
|
-
* @inheritDoc
|
|
56
|
-
*/
|
|
57
|
-
nudgeRight(): void;
|
|
58
|
-
}
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { IFont, IInteractiveCanvas, IMutableBackgroundColor, IMutableColor, IMutablePosition, IMutableText, IMutableTextStyle, ITextSelection, TextAlignment } from "../..";
|
|
3
|
-
import { ICanvasObject } from "../canvas-object.interface";
|
|
4
|
-
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
|
-
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import { fabric } from "fabric";
|
|
7
|
-
/**
|
|
8
|
-
* Text field. Displays customizable text.
|
|
9
|
-
*/
|
|
10
|
-
export interface IText extends ICanvasObject, IMutableColor, IMutableText, IMutableTextStyle, IMutablePosition, IMutableBackgroundColor {
|
|
11
|
-
/**
|
|
12
|
-
* @return Whether this text object should resize the canvas.
|
|
13
|
-
*/
|
|
14
|
-
isResizeCanvas(): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Set whether this text object should resize the canvas.
|
|
17
|
-
*/
|
|
18
|
-
setResizeCanvas(value: boolean): void;
|
|
19
|
-
/**
|
|
20
|
-
* Focus input on the text object.
|
|
21
|
-
*/
|
|
22
|
-
focus(): void;
|
|
23
|
-
/**
|
|
24
|
-
* @return Is the text box currently being edited.
|
|
25
|
-
*/
|
|
26
|
-
isEditing(): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Start editing the text.
|
|
29
|
-
*/
|
|
30
|
-
enterEditing(): void;
|
|
31
|
-
/**
|
|
32
|
-
* Select all text.
|
|
33
|
-
*/
|
|
34
|
-
selectAllText(): void;
|
|
35
|
-
/**
|
|
36
|
-
* Set the prefill type used for this text field.
|
|
37
|
-
*/
|
|
38
|
-
setPrefillType(prefillType: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Get the prefill type used for this text field.
|
|
41
|
-
*/
|
|
42
|
-
getPrefillType(): string;
|
|
43
|
-
}
|
|
44
|
-
export declare class Text extends AbstractCanvasObject<fabric.Textbox> implements IText {
|
|
45
|
-
private readonly fontLibrary;
|
|
46
|
-
private baseComponentHeight;
|
|
47
|
-
private readonly text$;
|
|
48
|
-
private readonly textSelection$;
|
|
49
|
-
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Textbox, persistedField?: CanvasObjectData);
|
|
50
|
-
/**
|
|
51
|
-
* @override
|
|
52
|
-
* @inheritDoc
|
|
53
|
-
*/
|
|
54
|
-
getText(): string;
|
|
55
|
-
/**
|
|
56
|
-
* @override
|
|
57
|
-
* @inheritDoc
|
|
58
|
-
*/
|
|
59
|
-
getText$(): Observable<string>;
|
|
60
|
-
/**
|
|
61
|
-
* @override
|
|
62
|
-
* @inheritDoc
|
|
63
|
-
*/
|
|
64
|
-
setText(text: string): void;
|
|
65
|
-
/**
|
|
66
|
-
* @override
|
|
67
|
-
* @inheritDoc
|
|
68
|
-
*/
|
|
69
|
-
replaceText(target: string, replacement: string): void;
|
|
70
|
-
/**
|
|
71
|
-
* @override
|
|
72
|
-
* @inheritDoc
|
|
73
|
-
*/
|
|
74
|
-
getColor(): string;
|
|
75
|
-
/**
|
|
76
|
-
* @override
|
|
77
|
-
* @inheritDoc
|
|
78
|
-
*/
|
|
79
|
-
setColor(color: string): void;
|
|
80
|
-
/**
|
|
81
|
-
* @override
|
|
82
|
-
* @inheritDoc
|
|
83
|
-
*/
|
|
84
|
-
getTextSelection(): ITextSelection;
|
|
85
|
-
/**
|
|
86
|
-
* @override
|
|
87
|
-
* @inheritDoc
|
|
88
|
-
*/
|
|
89
|
-
getTextSelection$(): Observable<ITextSelection>;
|
|
90
|
-
/**
|
|
91
|
-
* @override
|
|
92
|
-
* @inheritDoc
|
|
93
|
-
*/
|
|
94
|
-
setTextAlign(alignment: TextAlignment): void;
|
|
95
|
-
/**
|
|
96
|
-
* @override
|
|
97
|
-
* @inheritDoc
|
|
98
|
-
*/
|
|
99
|
-
setCharSpacing(spacing: number): void;
|
|
100
|
-
/**
|
|
101
|
-
* @override
|
|
102
|
-
* @inheritDoc
|
|
103
|
-
*/
|
|
104
|
-
setLineHeight(height: number): void;
|
|
105
|
-
/**
|
|
106
|
-
* @override
|
|
107
|
-
* @inheritDoc
|
|
108
|
-
*/
|
|
109
|
-
setBold(bold?: boolean): void;
|
|
110
|
-
/**
|
|
111
|
-
* @override
|
|
112
|
-
* @inheritDoc
|
|
113
|
-
*/
|
|
114
|
-
setBoldRegion(start: number, end: number, bold?: boolean): void;
|
|
115
|
-
/**
|
|
116
|
-
* @override
|
|
117
|
-
* @inheritDoc
|
|
118
|
-
*/
|
|
119
|
-
setItalic(italic?: boolean): void;
|
|
120
|
-
/**
|
|
121
|
-
* @override
|
|
122
|
-
* @inheritDoc
|
|
123
|
-
*/
|
|
124
|
-
setItalicRegion(start: number, end: number, italic?: boolean): void;
|
|
125
|
-
/**
|
|
126
|
-
* @override
|
|
127
|
-
* @inheritDoc
|
|
128
|
-
*/
|
|
129
|
-
setStrikethrough(strikethrough?: boolean): void;
|
|
130
|
-
/**
|
|
131
|
-
* @override
|
|
132
|
-
* @inheritDoc
|
|
133
|
-
*/
|
|
134
|
-
setUnderline(underline?: boolean): void;
|
|
135
|
-
/**
|
|
136
|
-
* @override
|
|
137
|
-
* @inheritDoc
|
|
138
|
-
*/
|
|
139
|
-
setFont(font: IFont): void;
|
|
140
|
-
/**
|
|
141
|
-
* @override
|
|
142
|
-
* @inheritDoc
|
|
143
|
-
*/
|
|
144
|
-
setFontSize(fontSize: number): void;
|
|
145
|
-
/**
|
|
146
|
-
* @override
|
|
147
|
-
* @inheritDoc
|
|
148
|
-
*/
|
|
149
|
-
setTextBackgroundColor(color: string): void;
|
|
150
|
-
/**
|
|
151
|
-
* @override
|
|
152
|
-
* @inheritDoc
|
|
153
|
-
*/
|
|
154
|
-
centerHorizontally(): void;
|
|
155
|
-
/**
|
|
156
|
-
* @override
|
|
157
|
-
* @inheritDoc
|
|
158
|
-
*/
|
|
159
|
-
centerVertically(): void;
|
|
160
|
-
/**
|
|
161
|
-
* @override
|
|
162
|
-
* @inheritDoc
|
|
163
|
-
*/
|
|
164
|
-
setHeight(height: number): void;
|
|
165
|
-
/**
|
|
166
|
-
* @override
|
|
167
|
-
* @inheritDoc
|
|
168
|
-
*/
|
|
169
|
-
nudgeUp(): void;
|
|
170
|
-
/**
|
|
171
|
-
* @override
|
|
172
|
-
* @inheritDoc
|
|
173
|
-
*/
|
|
174
|
-
nudgeDown(): void;
|
|
175
|
-
/**
|
|
176
|
-
* @override
|
|
177
|
-
* @inheritDoc
|
|
178
|
-
*/
|
|
179
|
-
nudgeLeft(): void;
|
|
180
|
-
/**
|
|
181
|
-
* @override
|
|
182
|
-
* @inheritDoc
|
|
183
|
-
*/
|
|
184
|
-
nudgeRight(): void;
|
|
185
|
-
/**
|
|
186
|
-
* @override
|
|
187
|
-
* @inheritDoc
|
|
188
|
-
*/
|
|
189
|
-
getBackgroundColor(): string;
|
|
190
|
-
/**
|
|
191
|
-
* @override
|
|
192
|
-
* @inheritDoc
|
|
193
|
-
*/
|
|
194
|
-
setBackgroundColor(color: string): void;
|
|
195
|
-
/**
|
|
196
|
-
* @override
|
|
197
|
-
* @inheritDoc
|
|
198
|
-
*/
|
|
199
|
-
setPrefillType(prefillType: string): void;
|
|
200
|
-
/**
|
|
201
|
-
* @override
|
|
202
|
-
* @inheritDoc
|
|
203
|
-
*/
|
|
204
|
-
getPrefillType(): string;
|
|
205
|
-
/**
|
|
206
|
-
* @override
|
|
207
|
-
* @inheritDoc
|
|
208
|
-
*/
|
|
209
|
-
isResizeCanvas(): boolean;
|
|
210
|
-
/**
|
|
211
|
-
* @override
|
|
212
|
-
* @inheritDoc
|
|
213
|
-
*/
|
|
214
|
-
setResizeCanvas(value: boolean): void;
|
|
215
|
-
/**
|
|
216
|
-
* @override
|
|
217
|
-
* @inheritDoc
|
|
218
|
-
*/
|
|
219
|
-
focus(): void;
|
|
220
|
-
/**
|
|
221
|
-
* @override
|
|
222
|
-
* @inheritDoc
|
|
223
|
-
*/
|
|
224
|
-
isEditing(): boolean;
|
|
225
|
-
/**
|
|
226
|
-
* @override
|
|
227
|
-
* @inheritDoc
|
|
228
|
-
*/
|
|
229
|
-
enterEditing(): void;
|
|
230
|
-
/**
|
|
231
|
-
* @override
|
|
232
|
-
* @inheritDoc
|
|
233
|
-
*/
|
|
234
|
-
selectAllText(): void;
|
|
235
|
-
/**
|
|
236
|
-
* @override
|
|
237
|
-
* @inheritDoc
|
|
238
|
-
*/
|
|
239
|
-
isBulleted(): boolean;
|
|
240
|
-
/**
|
|
241
|
-
* @override
|
|
242
|
-
* @inheritDoc
|
|
243
|
-
*/
|
|
244
|
-
enableBullets(): void;
|
|
245
|
-
/**
|
|
246
|
-
* @override
|
|
247
|
-
* @inheritDoc
|
|
248
|
-
*/
|
|
249
|
-
disableBullets(): void;
|
|
250
|
-
getSizeIncreaseSinceCreation(): number;
|
|
251
|
-
private removeBullets;
|
|
252
|
-
private applyBulletListMonkeyPatches;
|
|
253
|
-
/**
|
|
254
|
-
* @override
|
|
255
|
-
* @inheritDoc
|
|
256
|
-
*/
|
|
257
|
-
protected updateFabricObjectBehavior(): void;
|
|
258
|
-
protected onTextChange(): void;
|
|
259
|
-
protected onDelete(): void;
|
|
260
|
-
protected onSelectionChange(): void;
|
|
261
|
-
private hasTextSelection;
|
|
262
|
-
private updateTextSelection;
|
|
263
|
-
private notifyCanvasOfTextChanges;
|
|
264
|
-
}
|