@leapfrog/interactive-canvas 2.0.19 → 2.0.20-beta-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/dist/ErrorOptions.interface.d.ts +3 -0
- package/dist/abstract-interactive-canvas.d.ts +26 -7
- package/dist/headless-interactive-canvas.d.ts +2 -2
- package/dist/interactive-canvas.d.ts +1 -1
- package/dist/interactive-canvas.es.js +1751 -1944
- package/dist/interactive-canvas.interface.d.ts +22 -2
- package/dist/interactive-canvas.js +1773 -1953
- 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 +1 -1
- package/dist/object/impl/vertical-rule.d.ts +1 -1
- package/dist/types/selection-data.interface.d.ts +3 -3
- package/dist/undo-stack.d.ts +1 -1
- package/package.json +11 -9
|
@@ -3,8 +3,8 @@ import { ICanvasProfile, ILayoutManager, IMargin, IObjectDimensions, IOverflow,
|
|
|
3
3
|
import { ICanvasObject } from "./canvas-object.interface";
|
|
4
4
|
import { CanvasObjectData } from "./canvas-object-data";
|
|
5
5
|
import { IInteractiveCanvas } from "../interactive-canvas.interface";
|
|
6
|
-
import {
|
|
7
|
-
export declare abstract class AbstractCanvasObject<T extends
|
|
6
|
+
import { FabricObject } from "fabric";
|
|
7
|
+
export declare abstract class AbstractCanvasObject<T extends FabricObject> implements ICanvasObject {
|
|
8
8
|
protected pinToBottomDistance: number;
|
|
9
9
|
protected canvas: IInteractiveCanvas;
|
|
10
10
|
protected fabricObject: T;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AbstractCanvasObject, CanvasObjectData, IDimensionRestrictions, IInteractiveCanvas, IMutableImage } from "../..";
|
|
2
2
|
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
-
import {
|
|
3
|
+
import { FabricImage } from "fabric";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
5
5
|
export interface IBackgroundImage extends ICanvasObject, IMutableImage {
|
|
6
6
|
updatePosition(): void;
|
|
7
7
|
}
|
|
8
|
-
export declare class BackgroundImage extends AbstractCanvasObject<
|
|
8
|
+
export declare class BackgroundImage extends AbstractCanvasObject<FabricImage> implements IBackgroundImage {
|
|
9
9
|
private readonly imageUrl$;
|
|
10
|
-
constructor(canvas: IInteractiveCanvas, fabricObject:
|
|
10
|
+
constructor(canvas: IInteractiveCanvas, fabricObject: FabricImage, persistedField?: CanvasObjectData);
|
|
11
11
|
updatePosition(): void;
|
|
12
12
|
/**
|
|
13
13
|
* @override
|
|
@@ -3,7 +3,7 @@ import { ICanvasObject } from "../canvas-object.interface";
|
|
|
3
3
|
import { IInteractiveCanvas, IMutableColor, IRect } from "../..";
|
|
4
4
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
5
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import {
|
|
6
|
+
import { Rect } from "fabric";
|
|
7
7
|
/**
|
|
8
8
|
* Border field. A rectangle with a stroke width that automatically follows the canvas border.
|
|
9
9
|
*/
|
|
@@ -31,9 +31,9 @@ export interface IBorder extends ICanvasObject, IMutableColor {
|
|
|
31
31
|
*/
|
|
32
32
|
setPadding(padding: any): void;
|
|
33
33
|
}
|
|
34
|
-
export declare class Border extends AbstractCanvasObject<
|
|
34
|
+
export declare class Border extends AbstractCanvasObject<Rect> implements IBorder {
|
|
35
35
|
private readonly strokeWidth$;
|
|
36
|
-
constructor(canvas: IInteractiveCanvas, fabricObject:
|
|
36
|
+
constructor(canvas: IInteractiveCanvas, fabricObject: Rect, persistedField?: CanvasObjectData);
|
|
37
37
|
/**
|
|
38
38
|
* @override
|
|
39
39
|
* @inheritDoc
|
|
@@ -3,7 +3,7 @@ import { ICanvasObject } from "../canvas-object.interface";
|
|
|
3
3
|
import { IInteractiveCanvas, IMutableColor } from "../..";
|
|
4
4
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
5
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import
|
|
6
|
+
import fabric from "fabric";
|
|
7
7
|
/**
|
|
8
8
|
* Cutoff field. A cutoff rule that sits on the bottom of the canvas.
|
|
9
9
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ExtendedFabricObject extends
|
|
1
|
+
import { FabricObject } from "fabric";
|
|
2
|
+
export interface ExtendedFabricObject extends FabricObject {
|
|
3
3
|
/**
|
|
4
4
|
* If true, this object is a slave object controlled by another object and not directly by the user, such as the line markers in an ordered list.
|
|
5
5
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { fabric } from "fabric";
|
|
2
1
|
import { ExtendedFabricObject } from "./extended-fabric-object.interface";
|
|
3
|
-
|
|
2
|
+
import * as fabric from "fabric";
|
|
3
|
+
export interface ExtendedFabricTextbox extends Omit<fabric.Textbox, keyof ExtendedFabricObject>, ExtendedFabricObject {
|
|
4
4
|
_isOrderedList?: boolean;
|
|
5
5
|
_orderedListStart?: number;
|
|
6
6
|
_orderedListMarkerEntities?: fabric.Textbox[];
|
|
7
|
+
_bullets?: Record<number, fabric.Object>;
|
|
7
8
|
}
|
|
@@ -3,7 +3,7 @@ import { ICanvasObject } from "../canvas-object.interface";
|
|
|
3
3
|
import { IInteractiveCanvas, IMutableColor, IMutablePosition } from "../..";
|
|
4
4
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
5
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import
|
|
6
|
+
import fabric from "fabric";
|
|
7
7
|
/**
|
|
8
8
|
* Horizontal rule. A basic block of color in a thin line across the canvas.
|
|
9
9
|
*/
|
|
@@ -3,17 +3,17 @@ import { ICanvasObject } from "../canvas-object.interface";
|
|
|
3
3
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
5
5
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import {
|
|
6
|
+
import { FabricImage } from "fabric";
|
|
7
7
|
/**
|
|
8
8
|
* Image field. Displays a custom image on the canvas.
|
|
9
9
|
*/
|
|
10
10
|
export interface IImage extends ICanvasObject, IMutableImage, IMutablePosition {
|
|
11
11
|
}
|
|
12
|
-
export declare class Image extends AbstractCanvasObject<
|
|
12
|
+
export declare class Image extends AbstractCanvasObject<FabricImage> implements IImage {
|
|
13
13
|
private readonly DEFAULT_RESTRICTIONS;
|
|
14
14
|
private layoutWidth;
|
|
15
15
|
private readonly imageUrl$;
|
|
16
|
-
constructor(canvas: IInteractiveCanvas, fabricObject:
|
|
16
|
+
constructor(canvas: IInteractiveCanvas, fabricObject: FabricImage, persistedField?: CanvasObjectData);
|
|
17
17
|
/**
|
|
18
18
|
* @override
|
|
19
19
|
* @inheritDoc
|
|
@@ -2,14 +2,14 @@ import { ICanvasObject } from "../canvas-object.interface";
|
|
|
2
2
|
import { IInteractiveCanvas, IMutableColor, IMutablePosition, IMutableStroke } from "../..";
|
|
3
3
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
4
4
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
5
|
-
import {
|
|
5
|
+
import { Rect } from "fabric";
|
|
6
6
|
/**
|
|
7
7
|
* Rectangle field. A basic block of color that can be moved and scaled.
|
|
8
8
|
*/
|
|
9
9
|
export interface IRectangle extends ICanvasObject, IMutableStroke, IMutableColor, IMutablePosition {
|
|
10
10
|
}
|
|
11
|
-
export declare class Rectangle extends AbstractCanvasObject<
|
|
12
|
-
constructor(canvas: IInteractiveCanvas, fabricObject:
|
|
11
|
+
export declare class Rectangle extends AbstractCanvasObject<Rect> implements IRectangle {
|
|
12
|
+
constructor(canvas: IInteractiveCanvas, fabricObject: Rect, persistedField?: CanvasObjectData);
|
|
13
13
|
/**
|
|
14
14
|
* @override
|
|
15
15
|
* @inheritDoc
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CanvasObjectData, IInteractiveCanvas, Image, IMutableImage, IMutablePosition } from "../..";
|
|
2
2
|
import { ICanvasObject } from "../canvas-object.interface";
|
|
3
|
-
import {
|
|
3
|
+
import { FabricImage } from "fabric";
|
|
4
4
|
/**
|
|
5
5
|
* Rich text field.
|
|
6
6
|
* Displays complex text by taking a rendered image of a html block of rich text and displays it on the canvas.
|
|
@@ -20,7 +20,7 @@ export interface IRichText extends ICanvasObject, IMutableImage, IMutablePositio
|
|
|
20
20
|
setRichTextContent(renderedContentUrl: string, htmlContent: string): Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
export declare class RichText extends Image implements IRichText {
|
|
23
|
-
constructor(canvas: IInteractiveCanvas, fabricObject:
|
|
23
|
+
constructor(canvas: IInteractiveCanvas, fabricObject: FabricImage, persistedField?: CanvasObjectData);
|
|
24
24
|
/**
|
|
25
25
|
* @override
|
|
26
26
|
* @inheritDoc
|
|
@@ -10,7 +10,7 @@ import { TextAlignment } from "../../types/text-alignment.interface";
|
|
|
10
10
|
import { ICanvasObject } from "../canvas-object.interface";
|
|
11
11
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
12
12
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
13
|
-
import
|
|
13
|
+
import * as fabric from "fabric";
|
|
14
14
|
import { ExtendedFabricTextbox } from "./extended-fabric-textbox.interface";
|
|
15
15
|
/**
|
|
16
16
|
* Text field. Displays customizable text.
|
|
@@ -3,7 +3,7 @@ import { ICanvasObject } from "../canvas-object.interface";
|
|
|
3
3
|
import { IInteractiveCanvas, IMutableColor, IMutablePosition } from "../..";
|
|
4
4
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
5
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
|
-
import
|
|
6
|
+
import fabric from "fabric";
|
|
7
7
|
/**
|
|
8
8
|
* Vertical rule. A basic block of color that spans the canvas/row height.
|
|
9
9
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICanvasObject, ITextSelection } from "..";
|
|
2
|
-
import {
|
|
2
|
+
import { TEvent } from "fabric";
|
|
3
3
|
export interface ISelectionData {
|
|
4
4
|
/**
|
|
5
5
|
* The currently selected fields.
|
|
@@ -20,9 +20,9 @@ export interface ISelectionData {
|
|
|
20
20
|
/**
|
|
21
21
|
* Raw Fabric Event
|
|
22
22
|
*/
|
|
23
|
-
event:
|
|
23
|
+
event: TEvent<MouseEvent>;
|
|
24
24
|
/**
|
|
25
25
|
* Set raw event
|
|
26
26
|
*/
|
|
27
|
-
setEvent(event:
|
|
27
|
+
setEvent(event: TEvent<MouseEvent>): void;
|
|
28
28
|
}
|
package/dist/undo-stack.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { IUndoStack } from "./undo-stack.interface";
|
|
|
4
4
|
export declare class UndoStack implements IUndoStack {
|
|
5
5
|
protected canvas: IInteractiveCanvas;
|
|
6
6
|
private readonly size;
|
|
7
|
-
private undoStates;
|
|
7
|
+
private readonly undoStates;
|
|
8
8
|
private redoStates;
|
|
9
9
|
private lastState;
|
|
10
10
|
constructor(canvas: IInteractiveCanvas, size?: number);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leapfrog/interactive-canvas",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.20-beta-2",
|
|
4
4
|
"description": "Leapfrog interactive canvas",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -9,25 +9,27 @@
|
|
|
9
9
|
"main": "dist/interactive-canvas.js",
|
|
10
10
|
"module": "dist/interactive-canvas.es.js",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "rollup -c",
|
|
12
|
+
"build": "rollup -c --bundleConfigAsCjs",
|
|
13
13
|
"watch": "rollup -cw",
|
|
14
14
|
"prepublishOnly": "npm run build"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types/
|
|
18
|
-
"
|
|
19
|
-
"typescript": "^5.8.2"
|
|
17
|
+
"@types/lodash": "^4.17.23",
|
|
18
|
+
"typescript": "^6.0.3"
|
|
20
19
|
},
|
|
21
20
|
"dependencies": {
|
|
22
|
-
"fabric": "^
|
|
23
|
-
"lodash": "^4.
|
|
24
|
-
"rollup": "^
|
|
25
|
-
"rollup-plugin-typescript2": "^0.
|
|
21
|
+
"fabric": "^7.2.0",
|
|
22
|
+
"lodash": "^4.18.1",
|
|
23
|
+
"rollup": "^4.60.3",
|
|
24
|
+
"rollup-plugin-typescript2": "^0.37.0",
|
|
26
25
|
"rxjs": "^7.8.2"
|
|
27
26
|
},
|
|
28
27
|
"overrides": {
|
|
29
28
|
"form-data": "4.0.4"
|
|
30
29
|
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"tag": "beta"
|
|
32
|
+
},
|
|
31
33
|
"author": "",
|
|
32
34
|
"license": "UNLICENSED"
|
|
33
35
|
}
|