@leapfrog/interactive-canvas 0.1.0 → 1.0.0

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.
Files changed (61) hide show
  1. package/dist/{interactive-canvas.impl.d.ts → abstract-interactive-canvas.d.ts} +340 -305
  2. package/dist/dimensions/pixel-canvas-dimensions.d.ts +13 -13
  3. package/dist/dimensions/print-6-col-canvas-dimensions.d.ts +18 -18
  4. package/dist/dimensions/print-8-col-canvas-dimensions.d.ts +18 -18
  5. package/dist/font/font-library.d.ts +27 -22
  6. package/dist/font/font-library.interface.d.ts +24 -20
  7. package/dist/font/font.interface.d.ts +20 -20
  8. package/dist/font/unknown-font.d.ts +6 -6
  9. package/dist/headless-interactive-canvas.d.ts +9 -0
  10. package/dist/index.d.ts +49 -47
  11. package/dist/interactive-canvas.d.ts +8 -0
  12. package/dist/interactive-canvas.es.js +3193 -0
  13. package/dist/interactive-canvas.interface.d.ts +267 -221
  14. package/dist/interactive-canvas.js +3222 -34
  15. package/dist/layout/abstract-layout-manager.d.ts +17 -18
  16. package/dist/layout/advanced-layout-manager.d.ts +15 -15
  17. package/dist/layout/function/pin-to-bottom.layout-function.d.ts +4 -4
  18. package/dist/layout/function/redraw-all.layout-function.d.ts +4 -4
  19. package/dist/layout/function/reposition-borders.layout-function.d.ts +4 -4
  20. package/dist/layout/function/reposition-cutoffs.layout-function.d.ts +4 -4
  21. package/dist/layout/function/resize-canvas.layout-function.d.ts +4 -4
  22. package/dist/layout/function/stack-objects.layout-function.d.ts +11 -11
  23. package/dist/layout/function/update-object-dimensions.layout-function.d.ts +4 -4
  24. package/dist/layout/layout-manager.enum.d.ts +5 -5
  25. package/dist/layout/layout-manager.interface.d.ts +13 -13
  26. package/dist/layout/standard-layout-manager.d.ts +35 -36
  27. package/dist/mutator/mutable-background-color.interface.d.ts +15 -15
  28. package/dist/mutator/mutable-color.interface.d.ts +6 -6
  29. package/dist/mutator/mutable-image.interface.d.ts +28 -28
  30. package/dist/mutator/mutable-position.interface.d.ts +33 -33
  31. package/dist/mutator/mutable-text-style.interface.d.ts +163 -149
  32. package/dist/mutator/mutable-text.interface.d.ts +40 -40
  33. package/dist/object/abstract-canvas-object.d.ts +155 -155
  34. package/dist/object/canvas-object-data.d.ts +23 -23
  35. package/dist/object/canvas-object.interface.d.ts +96 -96
  36. package/dist/object/impl/border.d.ts +59 -60
  37. package/dist/object/impl/cutoff.d.ts +59 -60
  38. package/dist/object/impl/horizontal-rule.d.ts +88 -89
  39. package/dist/object/impl/image.d.ts +81 -82
  40. package/dist/object/impl/rectangle.d.ts +58 -59
  41. package/dist/object/impl/text.d.ts +264 -255
  42. package/dist/object/impl/vertical-rule.d.ts +88 -89
  43. package/dist/profile/canvas-profile.interface.d.ts +22 -22
  44. package/dist/profile/default-canvas-profile.d.ts +23 -23
  45. package/dist/types/canvas-dimension-restrictions.interface.d.ts +14 -14
  46. package/dist/types/canvas-dimensions.interface.d.ts +21 -21
  47. package/dist/types/canvas-state.interface.d.ts +11 -11
  48. package/dist/types/dimension-restrictions.interface.d.ts +6 -6
  49. package/dist/types/image-type.enum.d.ts +6 -6
  50. package/dist/types/margin.interface.d.ts +6 -6
  51. package/dist/types/object-dimensions.interface.d.ts +23 -23
  52. package/dist/types/object-type.enum.d.ts +10 -10
  53. package/dist/types/overflow.interface.d.ts +4 -4
  54. package/dist/types/position.interface.d.ts +6 -6
  55. package/dist/types/rect.interface.d.ts +6 -6
  56. package/dist/types/selection-data.interface.d.ts +19 -19
  57. package/dist/types/text-alignment.interface.d.ts +1 -1
  58. package/package.json +7 -9
  59. package/readme.md +12 -1
  60. package/dist/interactive-canvas.js.map +0 -1
  61. package/dist/interactive-canvas.nomin.js +0 -57456
@@ -1,89 +1,88 @@
1
- import { Observable } from "rxjs";
2
- import { ICanvasObject } from "../canvas-object.interface";
3
- import { IMutableColor, IMutablePosition } from "../..";
4
- import { AbstractCanvasObject } from "../abstract-canvas-object";
5
- import { CanvasObjectData } from "../canvas-object-data";
6
- import { InteractiveCanvas } from "../../interactive-canvas.impl";
7
- import { fabric } from "fabric";
8
- /**
9
- * Vertical rule. A basic block of color that spans the canvas/row height.
10
- */
11
- export interface IVerticalRule extends ICanvasObject, IMutableColor, IMutablePosition {
12
- /**
13
- * Get the width of the rule.
14
- */
15
- getStrokeWidth(): number;
16
- /**
17
- * Get an observable of the width of the rule.
18
- */
19
- getStrokeWidth$(): Observable<number>;
20
- /**
21
- * Set the rule width.
22
- * @param width New width.
23
- */
24
- setStrokeWidth(width: number): void;
25
- }
26
- export declare class VerticalRule extends AbstractCanvasObject<fabric.Rect> implements IVerticalRule {
27
- private readonly strokeWidth$;
28
- constructor(canvas: InteractiveCanvas, fabricObject: fabric.Rect, persistedField?: CanvasObjectData);
29
- /**
30
- * @override
31
- * @inheritDoc
32
- */
33
- getStrokeWidth(): number;
34
- /**
35
- * @override
36
- * @inheritDoc
37
- */
38
- getStrokeWidth$(): Observable<number>;
39
- /**
40
- * @override
41
- * @inheritDoc
42
- */
43
- setStrokeWidth(width: number): void;
44
- /**
45
- * @override
46
- * @inheritDoc
47
- */
48
- getColor(): string;
49
- /**
50
- * @override
51
- * @inheritDoc
52
- */
53
- setColor(color: string): void;
54
- /**
55
- * @override
56
- * @inheritDoc
57
- */
58
- centerHorizontally(): void;
59
- /**
60
- * @override
61
- * @inheritDoc
62
- */
63
- centerVertically(): void;
64
- /**
65
- * @override
66
- * @inheritDoc
67
- */
68
- setHeight(height: number): void;
69
- /**
70
- * @override
71
- * @inheritDoc
72
- */
73
- nudgeUp(): void;
74
- /**
75
- * @override
76
- * @inheritDoc
77
- */
78
- nudgeDown(): void;
79
- /**
80
- * @override
81
- * @inheritDoc
82
- */
83
- nudgeLeft(): void;
84
- /**
85
- * @override
86
- * @inheritDoc
87
- */
88
- nudgeRight(): void;
89
- }
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 +1,22 @@
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
+ 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 +1,23 @@
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
+ 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,14 +1,14 @@
1
- export interface ICanvasDimensionRestrictions {
2
- readonly width?: {
3
- min?: number;
4
- max?: number;
5
- };
6
- readonly height?: {
7
- min?: number;
8
- max?: number;
9
- };
10
- readonly volume?: {
11
- min?: number;
12
- max?: number;
13
- };
14
- }
1
+ export interface ICanvasDimensionRestrictions {
2
+ readonly width?: {
3
+ min?: number;
4
+ max?: number;
5
+ };
6
+ readonly height?: {
7
+ min?: number;
8
+ max?: number;
9
+ };
10
+ readonly volume?: {
11
+ min?: number;
12
+ max?: number;
13
+ };
14
+ }
@@ -1,21 +1,21 @@
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
+ 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 +1,11 @@
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
+ 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,6 +1,6 @@
1
- export interface IDimensionRestrictions {
2
- minWidth: number;
3
- minHeight: number;
4
- maxWidth?: number;
5
- maxHeight?: number;
6
- }
1
+ export interface IDimensionRestrictions {
2
+ minWidth: number;
3
+ minHeight: number;
4
+ maxWidth?: number;
5
+ maxHeight?: number;
6
+ }
@@ -1,6 +1,6 @@
1
- export declare enum ImageType {
2
- DEFAULT = "DEFAULT",
3
- BACKGROUND = "BACKGROUND",
4
- LOGO = "LOGO",
5
- PHOTO = "PHOTO"
6
- }
1
+ export declare enum ImageType {
2
+ DEFAULT = "DEFAULT",
3
+ BACKGROUND = "BACKGROUND",
4
+ LOGO = "LOGO",
5
+ PHOTO = "PHOTO"
6
+ }
@@ -1,6 +1,6 @@
1
- export interface IMargin {
2
- top?: number | null;
3
- right?: number | null;
4
- bottom?: number | null;
5
- left?: number | null;
6
- }
1
+ export interface IMargin {
2
+ top?: number | null;
3
+ right?: number | null;
4
+ bottom?: number | null;
5
+ left?: number | null;
6
+ }
@@ -1,23 +1,23 @@
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
+ 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,10 +1,10 @@
1
- export declare enum ObjectType {
2
- TEXT = "TEXT",
3
- BORDER = "BORDER",
4
- IMAGE = "IMAGE",
5
- RECTANGLE = "RECTANGLE",
6
- LIBRARY_IMAGE = "LIBRARY_IMAGE",
7
- CUTOFF = "CUTOFF",
8
- VERTICAL_RULE = "VERTICAL_RULE",
9
- HORIZONTAL_RULE = "HORIZONTAL_RULE"
10
- }
1
+ export declare enum ObjectType {
2
+ TEXT = "TEXT",
3
+ BORDER = "BORDER",
4
+ IMAGE = "IMAGE",
5
+ RECTANGLE = "RECTANGLE",
6
+ LIBRARY_IMAGE = "LIBRARY_IMAGE",
7
+ CUTOFF = "CUTOFF",
8
+ VERTICAL_RULE = "VERTICAL_RULE",
9
+ HORIZONTAL_RULE = "HORIZONTAL_RULE"
10
+ }
@@ -1,4 +1,4 @@
1
- import { IRect } from "./rect.interface";
2
- export interface IOverflow extends IRect {
3
- readonly hasOverflow: boolean;
4
- }
1
+ import { IRect } from "./rect.interface";
2
+ export interface IOverflow extends IRect {
3
+ readonly hasOverflow: boolean;
4
+ }
@@ -1,6 +1,6 @@
1
- export interface IPosition {
2
- readonly top?: number;
3
- readonly left?: number;
4
- readonly width?: number;
5
- readonly height?: number;
6
- }
1
+ export interface IPosition {
2
+ readonly top?: number;
3
+ readonly left?: number;
4
+ readonly width?: number;
5
+ readonly height?: number;
6
+ }
@@ -1,6 +1,6 @@
1
- export interface IRect {
2
- readonly top: number;
3
- readonly right: number;
4
- readonly bottom: number;
5
- readonly left: number;
6
- }
1
+ export interface IRect {
2
+ readonly top: number;
3
+ readonly right: number;
4
+ readonly bottom: number;
5
+ readonly left: number;
6
+ }
@@ -1,19 +1,19 @@
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
+ 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 +1 @@
1
- export declare type TextAlignment = "left" | "center" | "right" | "justify";
1
+ export declare type TextAlignment = "left" | "center" | "right" | "justify";
package/package.json CHANGED
@@ -1,29 +1,27 @@
1
1
  {
2
2
  "name": "@leapfrog/interactive-canvas",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "Leapfrog interactive canvas",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "types": "dist/index.d.ts",
9
9
  "main": "dist/interactive-canvas.js",
10
+ "module": "dist/interactive-canvas.es.js",
10
11
  "scripts": {
11
- "build": "webpack --mode=production",
12
- "watch": "webpack --mode=production --watch"
12
+ "build": "rollup -c",
13
+ "watch": "rollup -cw"
13
14
  },
14
15
  "devDependencies": {
15
16
  "@types/fabric": "^3.6.5",
16
17
  "@types/lodash": "^4.14.153",
17
- "clean-webpack-plugin": "^3.0.0",
18
- "ts-loader": "^6.0.4",
19
- "typescript": "^3.5.3",
20
- "unminified-webpack-plugin": "^2.0.0",
21
- "webpack": "^4.39.3",
22
- "webpack-cli": "^3.3.7"
18
+ "typescript": "^3.5.3"
23
19
  },
24
20
  "dependencies": {
25
21
  "fabric": "^3.6.3",
26
22
  "lodash": "^4.17.15",
23
+ "rollup": "^2.13.0",
24
+ "rollup-plugin-typescript2": "^0.27.1",
27
25
  "rxjs": "^6.5.5",
28
26
  "ts-optchain": "^0.1.8"
29
27
  },
package/readme.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  A set of APIs wrapping the fabric.js library, providing Leapfrog-specific behavior and interactions.
4
4
 
5
+ ### Installing
6
+ ```
7
+ npm install --save @leapfrog/interactive-canvas
8
+ ```
9
+
10
+ ### Installing (Node)
11
+ If running in node, you additionally need `jsdom`:
12
+ ```
13
+ npm install --save jsdom
14
+ ```
15
+
5
16
  ### Building
6
17
  npm run build
7
18
 
@@ -21,7 +32,7 @@ Add the following lines to the `package.json` `scripts` config in the project th
21
32
  {
22
33
  "scripts": {
23
34
  "link:lic": "npm link @leapfrog/interactive-canvas",
24
- "upgrade:lic": "npm install @leapfrog/interactive-canvas@latest"
35
+ "upgrade:lic": "npm install @leapfrog/interactive-canvas@latest --save"
25
36
  }
26
37
  }
27
38
  ```