@leapfrog/interactive-canvas 2.0.8 → 2.0.9
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/abstract-interactive-canvas.d.ts +372 -0
- package/dist/dimensions/millimeter-dimensions.d.ts +15 -0
- package/dist/dimensions/pixel-canvas-dimensions.d.ts +13 -0
- package/dist/dimensions/print-6-col-canvas-dimensions.d.ts +18 -0
- package/dist/dimensions/print-8-col-canvas-dimensions.d.ts +18 -0
- package/dist/font/font-library.d.ts +27 -0
- package/dist/font/font-library.interface.d.ts +24 -0
- package/dist/font/font.interface.d.ts +20 -0
- package/dist/font/unknown-font.d.ts +6 -0
- package/dist/headless-interactive-canvas.d.ts +10 -0
- package/dist/index.d.ts +54 -0
- package/dist/interactive-canvas.d.ts +25 -0
- package/dist/interactive-canvas.es.js +3995 -0
- package/dist/interactive-canvas.interface.d.ts +297 -0
- package/dist/interactive-canvas.js +4028 -0
- package/dist/layout/abstract-layout-manager.d.ts +17 -0
- package/dist/layout/advanced-layout-manager.d.ts +16 -0
- package/dist/layout/function/pin-to-bottom.layout-function.d.ts +4 -0
- package/dist/layout/function/redraw-all.layout-function.d.ts +4 -0
- package/dist/layout/function/reposition-backgrounds.layout-function.d.ts +4 -0
- package/dist/layout/function/reposition-borders.layout-function.d.ts +4 -0
- package/dist/layout/function/reposition-cutoffs.layout-function.d.ts +4 -0
- package/dist/layout/function/resize-canvas.layout-function.d.ts +4 -0
- package/dist/layout/function/stack-objects.layout-function.d.ts +11 -0
- package/dist/layout/function/update-object-dimensions.layout-function.d.ts +4 -0
- package/dist/layout/layout-manager.enum.d.ts +5 -0
- package/dist/layout/layout-manager.interface.d.ts +13 -0
- package/dist/layout/standard-layout-manager.d.ts +40 -0
- package/dist/mutator/mutable-background-color.interface.d.ts +15 -0
- package/dist/mutator/mutable-color.interface.d.ts +6 -0
- package/dist/mutator/mutable-image.interface.d.ts +28 -0
- package/dist/mutator/mutable-position.interface.d.ts +63 -0
- package/dist/mutator/mutable-stroke.interface.d.ts +8 -0
- package/dist/mutator/mutable-text-style.interface.d.ts +163 -0
- package/dist/mutator/mutable-text.interface.d.ts +80 -0
- package/dist/object/abstract-canvas-object.d.ts +207 -0
- package/dist/object/canvas-object-data.d.ts +24 -0
- package/dist/object/canvas-object.interface.d.ts +109 -0
- package/dist/object/impl/background-image.d.ts +38 -0
- package/dist/object/impl/border.d.ts +70 -0
- package/dist/object/impl/cutoff.d.ts +59 -0
- package/dist/object/impl/extended-fabric-object.interface.d.ts +7 -0
- package/dist/object/impl/extended-fabric-textbox.interface.d.ts +7 -0
- package/dist/object/impl/horizontal-rule.d.ts +83 -0
- package/dist/object/impl/image.d.ts +76 -0
- package/dist/object/impl/rectangle.d.ts +78 -0
- package/dist/object/impl/rich-text.d.ts +39 -0
- package/dist/object/impl/text.d.ts +314 -0
- package/dist/object/impl/vertical-rule.d.ts +83 -0
- package/dist/profile/canvas-profile.interface.d.ts +22 -0
- package/dist/profile/default-canvas-profile.d.ts +23 -0
- package/dist/types/canvas-dimension-restrictions.interface.d.ts +15 -0
- package/dist/types/canvas-dimensions.interface.d.ts +21 -0
- package/dist/types/canvas-state.interface.d.ts +11 -0
- package/dist/types/dimension-restrictions.interface.d.ts +6 -0
- package/dist/types/image-type.enum.d.ts +6 -0
- package/dist/types/margin.interface.d.ts +6 -0
- package/dist/types/object-dimensions.interface.d.ts +23 -0
- package/dist/types/object-type.enum.d.ts +12 -0
- package/dist/types/overflow.interface.d.ts +4 -0
- package/dist/types/position.interface.d.ts +9 -0
- package/dist/types/rect.interface.d.ts +6 -0
- package/dist/types/selection-data.interface.d.ts +19 -0
- package/dist/types/text-alignment.interface.d.ts +1 -0
- package/dist/undo-stack.d.ts +27 -0
- package/dist/undo-stack.interface.d.ts +6 -0
- package/package.json +30 -30
- package/readme.md +60 -60
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type TextAlignment = "left" | "center" | "right" | "justify";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ICanvasState } from "./types/canvas-state.interface";
|
|
2
|
+
import { IInteractiveCanvas } from "./interactive-canvas.interface";
|
|
3
|
+
import { IUndoStack } from "./undo-stack.interface";
|
|
4
|
+
export declare class UndoStack implements IUndoStack {
|
|
5
|
+
protected canvas: IInteractiveCanvas;
|
|
6
|
+
private readonly size;
|
|
7
|
+
private undoStates;
|
|
8
|
+
private redoStates;
|
|
9
|
+
private lastState;
|
|
10
|
+
constructor(canvas: IInteractiveCanvas, size?: number);
|
|
11
|
+
/**
|
|
12
|
+
* @override
|
|
13
|
+
* @inheritDoc
|
|
14
|
+
*/
|
|
15
|
+
save(state: ICanvasState): void;
|
|
16
|
+
/**
|
|
17
|
+
* @override
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
undo(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* @override
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
redo(): Promise<void>;
|
|
26
|
+
private clearRedoStackIfCanvasChanged;
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@leapfrog/interactive-canvas",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Leapfrog interactive canvas",
|
|
5
|
-
"files": [
|
|
6
|
-
"dist"
|
|
7
|
-
],
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
|
-
"main": "dist/interactive-canvas.js",
|
|
10
|
-
"module": "dist/interactive-canvas.es.js",
|
|
11
|
-
"scripts": {
|
|
12
|
-
"build": "rollup -c",
|
|
13
|
-
"watch": "rollup -cw"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@types/fabric": "^4.2.0",
|
|
17
|
-
"@types/lodash": "^4.14.153",
|
|
18
|
-
"typescript": "^3.5.3"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"fabric": "^5.2.4",
|
|
22
|
-
"lodash": "^4.17.15",
|
|
23
|
-
"rollup": "^2.13.0",
|
|
24
|
-
"rollup-plugin-typescript2": "^0.27.1",
|
|
25
|
-
"rxjs": "^6.5.5",
|
|
26
|
-
"ts-optchain": "^0.1.8"
|
|
27
|
-
},
|
|
28
|
-
"author": "",
|
|
29
|
-
"license": "UNLICENSED"
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@leapfrog/interactive-canvas",
|
|
3
|
+
"version": "2.0.9",
|
|
4
|
+
"description": "Leapfrog interactive canvas",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"main": "dist/interactive-canvas.js",
|
|
10
|
+
"module": "dist/interactive-canvas.es.js",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rollup -c",
|
|
13
|
+
"watch": "rollup -cw"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/fabric": "^4.2.0",
|
|
17
|
+
"@types/lodash": "^4.14.153",
|
|
18
|
+
"typescript": "^3.5.3"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"fabric": "^5.2.4",
|
|
22
|
+
"lodash": "^4.17.15",
|
|
23
|
+
"rollup": "^2.13.0",
|
|
24
|
+
"rollup-plugin-typescript2": "^0.27.1",
|
|
25
|
+
"rxjs": "^6.5.5",
|
|
26
|
+
"ts-optchain": "^0.1.8"
|
|
27
|
+
},
|
|
28
|
+
"author": "",
|
|
29
|
+
"license": "UNLICENSED"
|
|
30
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
# Leapfrog Interactive Canvas #
|
|
2
|
-
|
|
3
|
-
A set of APIs wrapping the fabric.js library, providing Leapfrog-specific behavior and interactions.
|
|
4
|
-
|
|
5
|
-
### Installing
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
npm install --save @leapfrog/interactive-canvas
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Installing (Node)
|
|
12
|
-
|
|
13
|
-
If running in node, you additionally need `jsdom`:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
npm install --save jsdom
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### Building
|
|
20
|
-
|
|
21
|
-
npm run build
|
|
22
|
-
|
|
23
|
-
or
|
|
24
|
-
|
|
25
|
-
npm run watch
|
|
26
|
-
|
|
27
|
-
### Using library in another Project
|
|
28
|
-
|
|
29
|
-
`npm install @leapfrog/interactive-canvas`
|
|
30
|
-
|
|
31
|
-
### Linking for local development
|
|
32
|
-
|
|
33
|
-
You can use `npm link` to see changes to the library immediately in a linked project.
|
|
34
|
-
|
|
35
|
-
Add the following lines to the `package.json` `scripts` config in the project that uses this library:
|
|
36
|
-
|
|
37
|
-
```json
|
|
38
|
-
{
|
|
39
|
-
"scripts": {
|
|
40
|
-
"link:lic": "npm link @leapfrog/interactive-canvas",
|
|
41
|
-
"upgrade:lic": "npm install @leapfrog/interactive-canvas@latest --save"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
* In this project: `npm link`
|
|
47
|
-
* In the calling project: `npm run link:lic`
|
|
48
|
-
* In this project: `npm run watch`
|
|
49
|
-
|
|
50
|
-
Changes in the library will be visible in the calling project.
|
|
51
|
-
|
|
52
|
-
Once complete, publish the changes then run `npm run upgrade:lic` to get the latest published version of the library in the calling project.
|
|
53
|
-
|
|
54
|
-
### Publishing
|
|
55
|
-
|
|
56
|
-
The `.npmrc` file contains the access token needed to publish to the `@leapfrog` npm repo.
|
|
57
|
-
|
|
58
|
-
* `npm version <version>` or `npm version <version>-beta.0`
|
|
59
|
-
* `npm run build`
|
|
60
|
-
* `npm publish` or `npm publish --tag beta`
|
|
1
|
+
# Leapfrog Interactive Canvas #
|
|
2
|
+
|
|
3
|
+
A set of APIs wrapping the fabric.js library, providing Leapfrog-specific behavior and interactions.
|
|
4
|
+
|
|
5
|
+
### Installing
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install --save @leapfrog/interactive-canvas
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Installing (Node)
|
|
12
|
+
|
|
13
|
+
If running in node, you additionally need `jsdom`:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm install --save jsdom
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Building
|
|
20
|
+
|
|
21
|
+
npm run build
|
|
22
|
+
|
|
23
|
+
or
|
|
24
|
+
|
|
25
|
+
npm run watch
|
|
26
|
+
|
|
27
|
+
### Using library in another Project
|
|
28
|
+
|
|
29
|
+
`npm install @leapfrog/interactive-canvas`
|
|
30
|
+
|
|
31
|
+
### Linking for local development
|
|
32
|
+
|
|
33
|
+
You can use `npm link` to see changes to the library immediately in a linked project.
|
|
34
|
+
|
|
35
|
+
Add the following lines to the `package.json` `scripts` config in the project that uses this library:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"scripts": {
|
|
40
|
+
"link:lic": "npm link @leapfrog/interactive-canvas",
|
|
41
|
+
"upgrade:lic": "npm install @leapfrog/interactive-canvas@latest --save"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
* In this project: `npm link`
|
|
47
|
+
* In the calling project: `npm run link:lic`
|
|
48
|
+
* In this project: `npm run watch`
|
|
49
|
+
|
|
50
|
+
Changes in the library will be visible in the calling project.
|
|
51
|
+
|
|
52
|
+
Once complete, publish the changes then run `npm run upgrade:lic` to get the latest published version of the library in the calling project.
|
|
53
|
+
|
|
54
|
+
### Publishing
|
|
55
|
+
|
|
56
|
+
The `.npmrc` file contains the access token needed to publish to the `@leapfrog` npm repo.
|
|
57
|
+
|
|
58
|
+
* `npm version <version>` or `npm version <version>-beta.0`
|
|
59
|
+
* `npm run build`
|
|
60
|
+
* `npm publish` or `npm publish --tag beta`
|