@leapfrog/interactive-canvas 2.0.18 → 2.0.20-beta-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.
- package/dist/ErrorOptions.interface.d.ts +3 -0
- package/dist/abstract-interactive-canvas.d.ts +26 -4
- package/dist/headless-interactive-canvas.d.ts +2 -2
- package/dist/interactive-canvas.d.ts +1 -1
- package/dist/interactive-canvas.es.js +1829 -1984
- package/dist/interactive-canvas.interface.d.ts +22 -2
- package/dist/interactive-canvas.js +1846 -1980
- package/dist/mutator/mutable-text.interface.d.ts +6 -0
- package/dist/object/abstract-canvas-object.d.ts +2 -2
- package/dist/object/impl/background-image.d.ts +3 -3
- package/dist/object/impl/border.d.ts +3 -3
- package/dist/object/impl/cutoff.d.ts +1 -1
- package/dist/object/impl/extended-fabric-object.interface.d.ts +2 -2
- package/dist/object/impl/extended-fabric-textbox.interface.d.ts +3 -2
- package/dist/object/impl/horizontal-rule.d.ts +1 -1
- package/dist/object/impl/image.d.ts +3 -3
- package/dist/object/impl/rectangle.d.ts +3 -3
- package/dist/object/impl/rich-text.d.ts +2 -2
- package/dist/object/impl/text.d.ts +12 -2
- package/dist/object/impl/vertical-rule.d.ts +1 -1
- package/dist/types/selection-data.interface.d.ts +9 -0
- package/dist/types/text-alignment.interface.d.ts +1 -1
- package/dist/undo-stack.d.ts +1 -1
- package/package.json +14 -11
|
@@ -20,12 +20,12 @@ import { ICanvasObject } from "./object/canvas-object.interface";
|
|
|
20
20
|
import { ISelectionData } from "./types/selection-data.interface";
|
|
21
21
|
import { ICanvasState } from "./types/canvas-state.interface";
|
|
22
22
|
import { ITextSelection } from "./mutator/mutable-text-style.interface";
|
|
23
|
-
import {
|
|
23
|
+
import { TEvent, FabricObject, Canvas } from "fabric";
|
|
24
24
|
import { IRichText } from "./object/impl/rich-text";
|
|
25
25
|
import { IBackgroundImage } from "./object/impl/background-image";
|
|
26
26
|
export declare abstract class AbstractInteractiveCanvas implements IInteractiveCanvas {
|
|
27
27
|
fabric: any;
|
|
28
|
-
protected readonly fabricCanvas:
|
|
28
|
+
protected readonly fabricCanvas: Canvas;
|
|
29
29
|
protected devicePixelRatio: number;
|
|
30
30
|
protected readonly IMAGE_CAPTURE_COEFFICIENT: number;
|
|
31
31
|
abstract readonly headless: boolean;
|
|
@@ -40,7 +40,7 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
|
|
|
40
40
|
protected readonly objects$: BehaviorSubject<Array<AbstractCanvasObject<any>>>;
|
|
41
41
|
protected readonly selection$: BehaviorSubject<SelectionData>;
|
|
42
42
|
protected baseDimensions: ICanvasDimensions;
|
|
43
|
-
protected constructor(fabric: any, fabricCanvas:
|
|
43
|
+
protected constructor(fabric: any, fabricCanvas: Canvas, devicePixelRatio: number);
|
|
44
44
|
/**
|
|
45
45
|
* @override
|
|
46
46
|
* @inheritDoc
|
|
@@ -181,6 +181,26 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
|
|
|
181
181
|
* @inheritDoc
|
|
182
182
|
*/
|
|
183
183
|
removeObject(target: ICanvasObject): void;
|
|
184
|
+
/**
|
|
185
|
+
* @override
|
|
186
|
+
* @inheritDoc
|
|
187
|
+
*/
|
|
188
|
+
bringObjectToFront(target: FabricObject): void;
|
|
189
|
+
/**
|
|
190
|
+
* @override
|
|
191
|
+
* @inheritDoc
|
|
192
|
+
*/
|
|
193
|
+
bringObjectForward(target: FabricObject): void;
|
|
194
|
+
/**
|
|
195
|
+
* @override
|
|
196
|
+
* @inheritDoc
|
|
197
|
+
*/
|
|
198
|
+
sendObjectBackwards(target: FabricObject): void;
|
|
199
|
+
/**
|
|
200
|
+
* @override
|
|
201
|
+
* @inheritDoc
|
|
202
|
+
*/
|
|
203
|
+
sendObjectToBack(target: FabricObject): void;
|
|
184
204
|
/**
|
|
185
205
|
* @override
|
|
186
206
|
* @inheritDoc
|
|
@@ -335,7 +355,7 @@ export declare abstract class AbstractInteractiveCanvas implements IInteractiveC
|
|
|
335
355
|
*/
|
|
336
356
|
notifyMarginChanged(): void;
|
|
337
357
|
removeFabricObject(obj: any): void;
|
|
338
|
-
protected selectFabricObject(object:
|
|
358
|
+
protected selectFabricObject(object: FabricObject): void;
|
|
339
359
|
protected onTextChange(): void;
|
|
340
360
|
protected onObjectListChange(): void;
|
|
341
361
|
protected onDimensionsChange(): void;
|
|
@@ -368,5 +388,7 @@ export declare class SelectionData implements ISelectionData {
|
|
|
368
388
|
readonly objects: Array<AbstractCanvasObject<any>>;
|
|
369
389
|
readonly isText: boolean;
|
|
370
390
|
readonly textSelection: ITextSelection | null;
|
|
391
|
+
event: TEvent<MouseEvent>;
|
|
371
392
|
constructor(objects: Array<AbstractCanvasObject<any>>);
|
|
393
|
+
setEvent(event: TEvent<MouseEvent>): void;
|
|
372
394
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fabric } from "fabric";
|
|
2
1
|
import { AbstractInteractiveCanvas } from "./abstract-interactive-canvas";
|
|
2
|
+
import { FabricObject } from "fabric";
|
|
3
3
|
export declare class HeadlessInteractiveCanvas extends AbstractInteractiveCanvas {
|
|
4
4
|
readonly headless: boolean;
|
|
5
5
|
constructor();
|
|
6
6
|
/**
|
|
7
7
|
* @override
|
|
8
8
|
*/
|
|
9
|
-
protected selectFabricObject(object:
|
|
9
|
+
protected selectFabricObject(object: FabricObject): void;
|
|
10
10
|
}
|
|
@@ -3,7 +3,7 @@ export declare class InteractiveCanvas extends AbstractInteractiveCanvas {
|
|
|
3
3
|
protected devicePixelRatio: number;
|
|
4
4
|
readonly headless: boolean;
|
|
5
5
|
private readonly undoStack;
|
|
6
|
-
constructor(canvas: HTMLCanvasElement | string |
|
|
6
|
+
constructor(canvas: HTMLCanvasElement | string | undefined, devicePixelRatio: number);
|
|
7
7
|
/**
|
|
8
8
|
* @override
|
|
9
9
|
* @inheritDoc
|