@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,18 +1,17 @@
1
- import { ILayoutManager } from "./layout-manager.interface";
2
- import { LayoutManager } from "./layout-manager.enum";
3
- import { InteractiveCanvas } from "../interactive-canvas.impl";
4
- import { ICanvasProfile } from "..";
5
- export declare abstract class AbstractLayoutManager implements ILayoutManager {
6
- abstract readonly key: LayoutManager;
7
- readonly isEnforcedPositioning: boolean;
8
- readonly enterTextEditImmediatelyOnSelect: boolean;
9
- protected canvas: InteractiveCanvas;
10
- protected constructor(canvas: InteractiveCanvas);
11
- getCanvas(): InteractiveCanvas;
12
- onInit(): void;
13
- onProfileChange(profile: ICanvasProfile): void;
14
- onCanvasDimensionsChange(): void;
15
- onTextChange(): void;
16
- onObjectListChange(): void;
17
- onMarginChange(): void;
18
- }
1
+ import { ILayoutManager } from "./layout-manager.interface";
2
+ import { LayoutManager } from "./layout-manager.enum";
3
+ import { ICanvasProfile, IInteractiveCanvas } from "..";
4
+ export declare abstract class AbstractLayoutManager implements ILayoutManager {
5
+ abstract readonly key: LayoutManager;
6
+ readonly isEnforcedPositioning: boolean;
7
+ readonly enterTextEditImmediatelyOnSelect: boolean;
8
+ protected canvas: IInteractiveCanvas;
9
+ protected constructor(canvas: IInteractiveCanvas);
10
+ getCanvas(): IInteractiveCanvas;
11
+ onInit(): void;
12
+ onProfileChange(profile: ICanvasProfile): void;
13
+ onCanvasDimensionsChange(): void;
14
+ onTextChange(): void;
15
+ onObjectListChange(): void;
16
+ onMarginChange(): void;
17
+ }
@@ -1,15 +1,15 @@
1
- import { AbstractLayoutManager } from "./abstract-layout-manager";
2
- import { LayoutManager } from "./layout-manager.enum";
3
- import { InteractiveCanvas } from "../interactive-canvas.impl";
4
- export declare class AdvancedLayoutManager extends AbstractLayoutManager {
5
- readonly key: LayoutManager;
6
- private pinToBottom;
7
- private redrawAll;
8
- private repositionBorders;
9
- private repositionCutoffs;
10
- private resizeCanvas;
11
- constructor(canvas: InteractiveCanvas);
12
- onCanvasDimensionsChange(): void;
13
- onTextChange(): void;
14
- onObjectListChange(): void;
15
- }
1
+ import { AbstractLayoutManager } from "./abstract-layout-manager";
2
+ import { LayoutManager } from "./layout-manager.enum";
3
+ import { IInteractiveCanvas } from "../interactive-canvas.interface";
4
+ export declare class AdvancedLayoutManager extends AbstractLayoutManager {
5
+ readonly key: LayoutManager;
6
+ private pinToBottom;
7
+ private redrawAll;
8
+ private repositionBorders;
9
+ private repositionCutoffs;
10
+ private resizeCanvas;
11
+ constructor(canvas: IInteractiveCanvas);
12
+ onCanvasDimensionsChange(): void;
13
+ onTextChange(): void;
14
+ onObjectListChange(): void;
15
+ }
@@ -1,4 +1,4 @@
1
- import { InteractiveCanvas } from "../../interactive-canvas.impl";
2
- export declare class PinToBottomLayoutFunction {
3
- execute(canvas: InteractiveCanvas): void;
4
- }
1
+ import { IInteractiveCanvas } from "../../interactive-canvas.interface";
2
+ export declare class PinToBottomLayoutFunction {
3
+ execute(canvas: IInteractiveCanvas): void;
4
+ }
@@ -1,4 +1,4 @@
1
- import { InteractiveCanvas } from "../../interactive-canvas.impl";
2
- export declare class RedrawAllLayoutFunction {
3
- execute(canvas: InteractiveCanvas): void;
4
- }
1
+ import { IInteractiveCanvas } from "../../interactive-canvas.interface";
2
+ export declare class RedrawAllLayoutFunction {
3
+ execute(canvas: IInteractiveCanvas): void;
4
+ }
@@ -1,4 +1,4 @@
1
- import { InteractiveCanvas } from "../../interactive-canvas.impl";
2
- export declare class RepositionBordersLayoutFunction {
3
- execute(canvas: InteractiveCanvas): void;
4
- }
1
+ import { IInteractiveCanvas } from "../..";
2
+ export declare class RepositionBordersLayoutFunction {
3
+ execute(canvas: IInteractiveCanvas): void;
4
+ }
@@ -1,4 +1,4 @@
1
- import { InteractiveCanvas } from "../../interactive-canvas.impl";
2
- export declare class RepositionCutoffsLayoutFunction {
3
- execute(canvas: InteractiveCanvas): void;
4
- }
1
+ import { IInteractiveCanvas } from "../..";
2
+ export declare class RepositionCutoffsLayoutFunction {
3
+ execute(canvas: IInteractiveCanvas): void;
4
+ }
@@ -1,4 +1,4 @@
1
- import { InteractiveCanvas } from "../../interactive-canvas.impl";
2
- export declare class ResizeCanvasLayoutFunction {
3
- execute(canvas: InteractiveCanvas): void;
4
- }
1
+ import { IInteractiveCanvas } from "../..";
2
+ export declare class ResizeCanvasLayoutFunction {
3
+ execute(canvas: IInteractiveCanvas): void;
4
+ }
@@ -1,11 +1,11 @@
1
- import { InteractiveCanvas } from "../../interactive-canvas.impl";
2
- export declare class StackObjectsLayoutFunction {
3
- execute(canvas: InteractiveCanvas): void;
4
- private layoutFooter;
5
- private layoutBody;
6
- private applyWidths;
7
- private adjustCanvasSize;
8
- private getRows;
9
- private getObjectHeight;
10
- private countSpaces;
11
- }
1
+ import { IInteractiveCanvas } from "../../interactive-canvas.interface";
2
+ export declare class StackObjectsLayoutFunction {
3
+ execute(canvas: IInteractiveCanvas): void;
4
+ private layoutFooter;
5
+ private layoutBody;
6
+ private applyWidths;
7
+ private adjustCanvasSize;
8
+ private getRows;
9
+ private getObjectHeight;
10
+ private countSpaces;
11
+ }
@@ -1,4 +1,4 @@
1
- import { InteractiveCanvas } from "../../interactive-canvas.impl";
2
- export declare class UpdateObjectDimensionsLayoutFunction {
3
- execute(canvas: InteractiveCanvas): void;
4
- }
1
+ import { IInteractiveCanvas } from "../../interactive-canvas.interface";
2
+ export declare class UpdateObjectDimensionsLayoutFunction {
3
+ execute(canvas: IInteractiveCanvas): void;
4
+ }
@@ -1,5 +1,5 @@
1
- export declare enum LayoutManager {
2
- LEGACY = "LEGACY",
3
- STANDARD = "STANDARD",
4
- ADVANCED = "ADVANCED"
5
- }
1
+ export declare enum LayoutManager {
2
+ LEGACY = "LEGACY",
3
+ STANDARD = "STANDARD",
4
+ ADVANCED = "ADVANCED"
5
+ }
@@ -1,13 +1,13 @@
1
- import { LayoutManager } from "./layout-manager.enum";
2
- import { ICanvasProfile } from "..";
3
- export interface ILayoutManager {
4
- readonly key: LayoutManager;
5
- readonly isEnforcedPositioning: boolean;
6
- readonly enterTextEditImmediatelyOnSelect: boolean;
7
- onInit(): void;
8
- onProfileChange(profile: ICanvasProfile): void;
9
- onCanvasDimensionsChange(): void;
10
- onTextChange(): void;
11
- onObjectListChange(): void;
12
- onMarginChange(): void;
13
- }
1
+ import { LayoutManager } from "./layout-manager.enum";
2
+ import { ICanvasProfile } from "..";
3
+ export interface ILayoutManager {
4
+ readonly key: LayoutManager;
5
+ readonly isEnforcedPositioning: boolean;
6
+ readonly enterTextEditImmediatelyOnSelect: boolean;
7
+ onInit(): void;
8
+ onProfileChange(profile: ICanvasProfile): void;
9
+ onCanvasDimensionsChange(): void;
10
+ onTextChange(): void;
11
+ onObjectListChange(): void;
12
+ onMarginChange(): void;
13
+ }
@@ -1,36 +1,35 @@
1
- import { AbstractLayoutManager } from "./abstract-layout-manager";
2
- import { LayoutManager } from "./layout-manager.enum";
3
- import { InteractiveCanvas } from "../interactive-canvas.impl";
4
- import { ICanvasProfile } from "..";
5
- export declare class StandardLayoutManager extends AbstractLayoutManager {
6
- readonly key: LayoutManager;
7
- readonly isEnforcedPositioning: boolean;
8
- readonly enterTextEditImmediatelyOnSelect: boolean;
9
- private redrawAll;
10
- private repositionCutoffs;
11
- private repositionBorders;
12
- private stackObjects;
13
- private updateObjectDimensions;
14
- constructor(canvas: InteractiveCanvas);
15
- /**
16
- * @override
17
- */
18
- onInit(): void;
19
- /**
20
- * @override
21
- */
22
- onProfileChange(profile: ICanvasProfile): void;
23
- /**
24
- * @override
25
- */
26
- onTextChange(): void;
27
- /**
28
- * @override
29
- */
30
- onObjectListChange(): void;
31
- /**
32
- * @override
33
- */
34
- onMarginChange(): void;
35
- private stackAndRedraw;
36
- }
1
+ import { AbstractLayoutManager } from "./abstract-layout-manager";
2
+ import { LayoutManager } from "./layout-manager.enum";
3
+ import { ICanvasProfile, IInteractiveCanvas } from "..";
4
+ export declare class StandardLayoutManager extends AbstractLayoutManager {
5
+ readonly key: LayoutManager;
6
+ readonly isEnforcedPositioning: boolean;
7
+ readonly enterTextEditImmediatelyOnSelect: boolean;
8
+ private redrawAll;
9
+ private repositionCutoffs;
10
+ private repositionBorders;
11
+ private stackObjects;
12
+ private updateObjectDimensions;
13
+ constructor(canvas: IInteractiveCanvas);
14
+ /**
15
+ * @override
16
+ */
17
+ onInit(): void;
18
+ /**
19
+ * @override
20
+ */
21
+ onProfileChange(profile: ICanvasProfile): void;
22
+ /**
23
+ * @override
24
+ */
25
+ onTextChange(): void;
26
+ /**
27
+ * @override
28
+ */
29
+ onObjectListChange(): void;
30
+ /**
31
+ * @override
32
+ */
33
+ onMarginChange(): void;
34
+ private stackAndRedraw;
35
+ }
@@ -1,15 +1,15 @@
1
- /**
2
- * Canvas object with customizable background color.
3
- */
4
- export interface IMutableBackgroundColor {
5
- /**
6
- * Get the background color.
7
- */
8
- getBackgroundColor(): string;
9
- /**
10
- * Set the background color.
11
- * @param color Color.
12
- */
13
- setBackgroundColor(color: string): void;
14
- }
15
- export declare function isMutableBackgroundColor(object: any): object is IMutableBackgroundColor;
1
+ /**
2
+ * Canvas object with customizable background color.
3
+ */
4
+ export interface IMutableBackgroundColor {
5
+ /**
6
+ * Get the background color.
7
+ */
8
+ getBackgroundColor(): string;
9
+ /**
10
+ * Set the background color.
11
+ * @param color Color.
12
+ */
13
+ setBackgroundColor(color: string): void;
14
+ }
15
+ export declare function isMutableBackgroundColor(object: any): object is IMutableBackgroundColor;
@@ -1,6 +1,6 @@
1
- import { ICanvasObject } from "..";
2
- export interface IMutableColor extends ICanvasObject {
3
- getColor(): string;
4
- setColor(color: string): void;
5
- }
6
- export declare function isMutableColor(object: any): object is IMutableColor;
1
+ import { ICanvasObject } from "..";
2
+ export interface IMutableColor extends ICanvasObject {
3
+ getColor(): string;
4
+ setColor(color: string): void;
5
+ }
6
+ export declare function isMutableColor(object: any): object is IMutableColor;
@@ -1,28 +1,28 @@
1
- import { Observable } from "rxjs";
2
- import { ICanvasObject, IDimensionRestrictions } from "..";
3
- /**
4
- * Canvas field with a modifiable image.
5
- */
6
- export interface IMutableImage extends ICanvasObject {
7
- /**
8
- * Get the image url.
9
- */
10
- getImageUrl(): string;
11
- /**
12
- * Get an observable of the image url.
13
- */
14
- getImageUrl$(): Observable<string>;
15
- /**
16
- * Set the image url.
17
- * @param url New url.
18
- */
19
- setImageUrl(url: string): void;
20
- /**
21
- * Sets the image width to x pixels.
22
- * @param px Pixels.
23
- * @param sizeRestrictions Restrictions on image size.
24
- * @returns the new width in pixels
25
- */
26
- setImageWidth(px: number, sizeRestrictions: IDimensionRestrictions): number;
27
- }
28
- export declare function isMutableImage(object: any): object is IMutableImage;
1
+ import { Observable } from "rxjs";
2
+ import { ICanvasObject, IDimensionRestrictions } from "..";
3
+ /**
4
+ * Canvas field with a modifiable image.
5
+ */
6
+ export interface IMutableImage extends ICanvasObject {
7
+ /**
8
+ * Get the image url.
9
+ */
10
+ getImageUrl(): string;
11
+ /**
12
+ * Get an observable of the image url.
13
+ */
14
+ getImageUrl$(): Observable<string>;
15
+ /**
16
+ * Set the image url.
17
+ * @param url New url.
18
+ */
19
+ setImageUrl(url: string): void;
20
+ /**
21
+ * Sets the image width to x pixels.
22
+ * @param px Pixels.
23
+ * @param sizeRestrictions Restrictions on image size.
24
+ * @returns the new width in pixels
25
+ */
26
+ setImageWidth(px: number, sizeRestrictions: IDimensionRestrictions): number;
27
+ }
28
+ export declare function isMutableImage(object: any): object is IMutableImage;
@@ -1,33 +1,33 @@
1
- import { ICanvasObject } from "..";
2
- export interface IMutablePosition extends ICanvasObject {
3
- /**
4
- * Center the object horizontally on the canvas.
5
- */
6
- centerHorizontally(): void;
7
- /**
8
- * Center the object vertically on the canvas.
9
- */
10
- centerVertically(): void;
11
- /**
12
- * Set the height of the element.
13
- * @param height New height.
14
- */
15
- setHeight(height: number): void;
16
- /**
17
- * Nudge the object upward.
18
- */
19
- nudgeUp(): void;
20
- /**
21
- * Nudge the object downward.
22
- */
23
- nudgeDown(): void;
24
- /**
25
- * Nudge the object leftward.
26
- */
27
- nudgeLeft(): void;
28
- /**
29
- * Nudge the object rightward.
30
- */
31
- nudgeRight(): void;
32
- }
33
- export declare function isMutablePosition(object: any): object is IMutablePosition;
1
+ import { ICanvasObject } from "..";
2
+ export interface IMutablePosition extends ICanvasObject {
3
+ /**
4
+ * Center the object horizontally on the canvas.
5
+ */
6
+ centerHorizontally(): void;
7
+ /**
8
+ * Center the object vertically on the canvas.
9
+ */
10
+ centerVertically(): void;
11
+ /**
12
+ * Set the height of the element.
13
+ * @param height New height.
14
+ */
15
+ setHeight(height: number): void;
16
+ /**
17
+ * Nudge the object upward.
18
+ */
19
+ nudgeUp(): void;
20
+ /**
21
+ * Nudge the object downward.
22
+ */
23
+ nudgeDown(): void;
24
+ /**
25
+ * Nudge the object leftward.
26
+ */
27
+ nudgeLeft(): void;
28
+ /**
29
+ * Nudge the object rightward.
30
+ */
31
+ nudgeRight(): void;
32
+ }
33
+ export declare function isMutablePosition(object: any): object is IMutablePosition;