@leapfrog/interactive-canvas 2.0.19 → 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.
@@ -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 { Object } from "fabric/fabric-impl";
7
- export declare abstract class AbstractCanvasObject<T extends Object> implements ICanvasObject {
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 { fabric } from "fabric";
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<fabric.Image> implements IBackgroundImage {
8
+ export declare class BackgroundImage extends AbstractCanvasObject<FabricImage> implements IBackgroundImage {
9
9
  private readonly imageUrl$;
10
- constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Image, persistedField?: CanvasObjectData);
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 { fabric } from "fabric";
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<fabric.Rect> implements IBorder {
34
+ export declare class Border extends AbstractCanvasObject<Rect> implements IBorder {
35
35
  private readonly strokeWidth$;
36
- constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Rect, persistedField?: CanvasObjectData);
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 { fabric } from "fabric";
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 { fabric } from "fabric";
2
- export interface ExtendedFabricObject extends fabric.Object {
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
- export interface ExtendedFabricTextbox extends fabric.Textbox, ExtendedFabricObject {
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 { fabric } from "fabric";
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 { fabric } from "fabric";
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<fabric.Image> implements IImage {
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: fabric.Image, persistedField?: CanvasObjectData);
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 { fabric } from "fabric";
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<fabric.Rect> implements IRectangle {
12
- constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Rect, persistedField?: CanvasObjectData);
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 { fabric } from "fabric";
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: fabric.Image, persistedField?: CanvasObjectData);
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 { fabric } from "fabric";
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 { fabric } from "fabric";
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 { IEvent } from "fabric/fabric-impl";
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: IEvent<MouseEvent>;
23
+ event: TEvent<MouseEvent>;
24
24
  /**
25
25
  * Set raw event
26
26
  */
27
- setEvent(event: IEvent<MouseEvent>): void;
27
+ setEvent(event: TEvent<MouseEvent>): void;
28
28
  }
@@ -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.19",
3
+ "version": "2.0.20-beta-1",
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/fabric": "^5.3.0",
18
- "@types/lodash": "^4.17.16",
19
- "typescript": "^5.8.2"
17
+ "@types/lodash": "^4.17.23",
18
+ "typescript": "^6.0.3"
20
19
  },
21
20
  "dependencies": {
22
- "fabric": "^5.2.4",
23
- "lodash": "^4.17.21",
24
- "rollup": "^2.79.2",
25
- "rollup-plugin-typescript2": "^0.36.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
  }