@leapfrog/interactive-canvas 2.0.18 → 2.0.19
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 +3 -0
- package/dist/interactive-canvas.es.js +298 -256
- package/dist/interactive-canvas.js +317 -267
- package/dist/mutator/mutable-text.interface.d.ts +6 -0
- package/dist/object/impl/text.d.ts +11 -1
- package/dist/types/selection-data.interface.d.ts +9 -0
- package/dist/types/text-alignment.interface.d.ts +1 -1
- package/package.json +4 -3
|
@@ -24,6 +24,12 @@ export interface IMutableText extends ICanvasObject {
|
|
|
24
24
|
* @param replacement Replacement fragment.
|
|
25
25
|
*/
|
|
26
26
|
replaceText(target: string, replacement: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Replace a text fragment in the field. Uses the first character styling for the new word.
|
|
29
|
+
* @param target Existing text fragment.
|
|
30
|
+
* @param replacement Replacement fragment.
|
|
31
|
+
*/
|
|
32
|
+
replaceTextWithStyle(target: string, replacement: string): void;
|
|
27
33
|
/**
|
|
28
34
|
* Taken from the fabric JSDOC:
|
|
29
35
|
* Insert characters at start position, before start position.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
import { IFont
|
|
2
|
+
import { IFont } from "../../font/font.interface";
|
|
3
|
+
import { IInteractiveCanvas } from "../../interactive-canvas.interface";
|
|
4
|
+
import { IMutableBackgroundColor } from "../../mutator/mutable-background-color.interface";
|
|
5
|
+
import { IMutableColor } from "../../mutator/mutable-color.interface";
|
|
6
|
+
import { IMutableText } from "../../mutator/mutable-text.interface";
|
|
7
|
+
import { IMutableTextStyle, ITextSelection } from "../../mutator/mutable-text-style.interface";
|
|
8
|
+
import { IMutablePosition } from "../../mutator/mutable-position.interface";
|
|
9
|
+
import { TextAlignment } from "../../types/text-alignment.interface";
|
|
3
10
|
import { ICanvasObject } from "../canvas-object.interface";
|
|
4
11
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
12
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
@@ -55,6 +62,7 @@ export declare class Text extends AbstractCanvasObject<ExtendedFabricTextbox> im
|
|
|
55
62
|
private baseComponentHeight;
|
|
56
63
|
private readonly text$;
|
|
57
64
|
private readonly textSelection$;
|
|
65
|
+
static readonly NEW_LINE: string;
|
|
58
66
|
constructor(canvas: IInteractiveCanvas, fabricObject: fabric.Textbox, persistedField?: CanvasObjectData);
|
|
59
67
|
/**
|
|
60
68
|
* @override
|
|
@@ -76,6 +84,8 @@ export declare class Text extends AbstractCanvasObject<ExtendedFabricTextbox> im
|
|
|
76
84
|
* @inheritDoc
|
|
77
85
|
*/
|
|
78
86
|
replaceText(target: string, replacement: string): void;
|
|
87
|
+
replaceTextWithStyle(target: string, replacement: string): void;
|
|
88
|
+
private getReplacementStyle;
|
|
79
89
|
/**
|
|
80
90
|
* @override
|
|
81
91
|
* @inheritDoc
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ICanvasObject, ITextSelection } from "..";
|
|
2
|
+
import { IEvent } from "fabric/fabric-impl";
|
|
2
3
|
export interface ISelectionData {
|
|
3
4
|
/**
|
|
4
5
|
* The currently selected fields.
|
|
@@ -16,4 +17,12 @@ export interface ISelectionData {
|
|
|
16
17
|
* Text selection data.
|
|
17
18
|
*/
|
|
18
19
|
readonly textSelection: ITextSelection | null;
|
|
20
|
+
/**
|
|
21
|
+
* Raw Fabric Event
|
|
22
|
+
*/
|
|
23
|
+
event: IEvent<MouseEvent>;
|
|
24
|
+
/**
|
|
25
|
+
* Set raw event
|
|
26
|
+
*/
|
|
27
|
+
setEvent(event: IEvent<MouseEvent>): void;
|
|
19
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TextAlignment = "left" | "center" | "right" | "justify";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leapfrog/interactive-canvas",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19",
|
|
4
4
|
"description": "Leapfrog interactive canvas",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"module": "dist/interactive-canvas.es.js",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "rollup -c",
|
|
13
|
-
"watch": "rollup -cw"
|
|
13
|
+
"watch": "rollup -cw",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"@types/fabric": "^5.3.0",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"rxjs": "^7.8.2"
|
|
26
27
|
},
|
|
27
28
|
"overrides": {
|
|
28
|
-
"form-data
|
|
29
|
+
"form-data": "4.0.4"
|
|
29
30
|
},
|
|
30
31
|
"author": "",
|
|
31
32
|
"license": "UNLICENSED"
|