@leapfrog/interactive-canvas 1.0.0 → 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 -3193
- package/dist/interactive-canvas.interface.d.ts +0 -267
- package/dist/interactive-canvas.js +0 -3222
- 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,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
|
-
* Vertical rule. A basic block of color that spans the canvas/row height.
|
|
9
|
-
*/
|
|
10
|
-
export interface IVerticalRule 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 VerticalRule extends AbstractCanvasObject<fabric.Rect> implements IVerticalRule {
|
|
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(width: 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,22 +0,0 @@
|
|
|
1
|
-
import { TextAlignment } from "..";
|
|
2
|
-
/**
|
|
3
|
-
* Defines the set of behaviors that can be adjusted on the interactive canvas, and provides an interface for grouping feature settings into a reusable profile.
|
|
4
|
-
*/
|
|
5
|
-
export interface ICanvasProfile {
|
|
6
|
-
readonly allowMultiSelect: boolean;
|
|
7
|
-
readonly allowObjectsToLeaveCanvas: boolean;
|
|
8
|
-
readonly enterTextEditImmediatelyOnSelect: boolean;
|
|
9
|
-
readonly allowMove: boolean;
|
|
10
|
-
readonly allowRotate: boolean;
|
|
11
|
-
readonly allowScale: boolean;
|
|
12
|
-
readonly defaultFont?: string;
|
|
13
|
-
readonly defaultFontSize: number;
|
|
14
|
-
readonly defaultFontColor: string;
|
|
15
|
-
readonly defaultLineHeight: number;
|
|
16
|
-
readonly defaultCharacterSpacing: number;
|
|
17
|
-
readonly defaultTextAlignment: TextAlignment;
|
|
18
|
-
readonly defaultBorderColor: string;
|
|
19
|
-
readonly defaultBorderWidth: number;
|
|
20
|
-
readonly defaultCutoffColor: string;
|
|
21
|
-
readonly defaultCutoffWidth: number;
|
|
22
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TextAlignment } from "..";
|
|
2
|
-
import { ICanvasProfile } from "./canvas-profile.interface";
|
|
3
|
-
/**
|
|
4
|
-
* Profile with as many features disabled as possible.
|
|
5
|
-
*/
|
|
6
|
-
export declare class DefaultCanvasProfile implements ICanvasProfile {
|
|
7
|
-
readonly allowMultiSelect: boolean;
|
|
8
|
-
readonly enterTextEditImmediatelyOnSelect: boolean;
|
|
9
|
-
readonly allowObjectsToLeaveCanvas: boolean;
|
|
10
|
-
readonly allowMove: boolean;
|
|
11
|
-
readonly allowRotate: boolean;
|
|
12
|
-
readonly allowScale: boolean;
|
|
13
|
-
readonly defaultFont?: string;
|
|
14
|
-
readonly defaultFontSize: number;
|
|
15
|
-
readonly defaultFontColor: string;
|
|
16
|
-
readonly defaultLineHeight: number;
|
|
17
|
-
readonly defaultCharacterSpacing: number;
|
|
18
|
-
readonly defaultTextAlignment: TextAlignment;
|
|
19
|
-
readonly defaultBorderColor: string;
|
|
20
|
-
readonly defaultBorderWidth: number;
|
|
21
|
-
readonly defaultCutoffColor: string;
|
|
22
|
-
readonly defaultCutoffWidth: number;
|
|
23
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface ICanvasDimensions {
|
|
2
|
-
readonly width: number;
|
|
3
|
-
readonly widthPx: number;
|
|
4
|
-
readonly widthMm?: number;
|
|
5
|
-
readonly widthUnit: string;
|
|
6
|
-
readonly height: number;
|
|
7
|
-
readonly heightPx: number;
|
|
8
|
-
readonly heightMm?: number;
|
|
9
|
-
readonly heightUnit: string;
|
|
10
|
-
withSize(width: number, height: number): ICanvasDimensions;
|
|
11
|
-
/**
|
|
12
|
-
* Convert a number of pixels on the width to millimeters.
|
|
13
|
-
* @param px Pixel count.
|
|
14
|
-
*/
|
|
15
|
-
widthPxToMm(px: number): number | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Convert a number of pixels on the height to millimeters.
|
|
18
|
-
* @param px Pixel count.
|
|
19
|
-
*/
|
|
20
|
-
heightPxToMm(px: number): number | undefined;
|
|
21
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ICanvasDimensions } from "./canvas-dimensions.interface";
|
|
2
|
-
import { CanvasObjectData } from "..";
|
|
3
|
-
/**
|
|
4
|
-
* Serialized canvas state that can be used to save the canvas.
|
|
5
|
-
*/
|
|
6
|
-
export interface ICanvasState {
|
|
7
|
-
readonly dimensions: ICanvasDimensions;
|
|
8
|
-
readonly canvasJson: string;
|
|
9
|
-
readonly objects: CanvasObjectData[];
|
|
10
|
-
readonly backgroundColor?: string;
|
|
11
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface IObjectDimensions {
|
|
2
|
-
readonly top: {
|
|
3
|
-
readonly px: number;
|
|
4
|
-
readonly mm: number;
|
|
5
|
-
};
|
|
6
|
-
readonly left: {
|
|
7
|
-
readonly px: number;
|
|
8
|
-
readonly mm: number;
|
|
9
|
-
};
|
|
10
|
-
readonly width: {
|
|
11
|
-
readonly px: number;
|
|
12
|
-
readonly mm: number;
|
|
13
|
-
};
|
|
14
|
-
readonly height: {
|
|
15
|
-
readonly px: number;
|
|
16
|
-
readonly mm: number;
|
|
17
|
-
};
|
|
18
|
-
readonly angle: number;
|
|
19
|
-
readonly scale: {
|
|
20
|
-
readonly x: number;
|
|
21
|
-
readonly y: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ICanvasObject, ITextSelection } from "..";
|
|
2
|
-
export interface ISelectionData {
|
|
3
|
-
/**
|
|
4
|
-
* The currently selected fields.
|
|
5
|
-
*/
|
|
6
|
-
readonly objects: ICanvasObject[];
|
|
7
|
-
/**
|
|
8
|
-
* True if there is nothing selected.
|
|
9
|
-
*/
|
|
10
|
-
readonly empty: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* True if text is currently being edited.
|
|
13
|
-
*/
|
|
14
|
-
readonly isText: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Text selection data.
|
|
17
|
-
*/
|
|
18
|
-
readonly textSelection: ITextSelection | null;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type TextAlignment = "left" | "center" | "right" | "justify";
|