konva 8.4.2 → 9.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.
- package/README.md +1 -9
- package/konva.js +17669 -16968
- package/konva.min.js +3 -3
- package/lib/Animation.d.ts +2 -2
- package/lib/Animation.js +11 -7
- package/lib/BezierFunctions.d.ts +6 -0
- package/lib/BezierFunctions.js +791 -0
- package/lib/Canvas.d.ts +2 -1
- package/lib/Canvas.js +26 -18
- package/lib/Container.d.ts +4 -4
- package/lib/Container.js +16 -12
- package/lib/Context.d.ts +16 -13
- package/lib/Context.js +27 -19
- package/lib/Core.d.ts +2 -2
- package/lib/Core.js +7 -3
- package/lib/DragAndDrop.d.ts +3 -3
- package/lib/DragAndDrop.js +25 -22
- package/lib/Factory.js +27 -24
- package/lib/FastLayer.d.ts +1 -1
- package/lib/FastLayer.js +10 -6
- package/lib/Global.js +16 -12
- package/lib/Group.d.ts +3 -3
- package/lib/Group.js +10 -6
- package/lib/Layer.d.ts +9 -9
- package/lib/Layer.js +37 -33
- package/lib/Node.d.ts +8 -8
- package/lib/Node.js +95 -90
- package/lib/PointerEvents.d.ts +4 -4
- package/lib/PointerEvents.js +15 -7
- package/lib/Shape.d.ts +6 -4
- package/lib/Shape.js +90 -86
- package/lib/Stage.d.ts +7 -7
- package/lib/Stage.js +51 -47
- package/lib/Tween.d.ts +2 -2
- package/lib/Tween.js +26 -22
- package/lib/Util.d.ts +2 -2
- package/lib/Util.js +29 -25
- package/lib/Validators.js +58 -44
- package/lib/_CoreInternals.d.ts +29 -29
- package/lib/_CoreInternals.js +36 -33
- package/lib/_FullInternals.d.ts +67 -67
- package/lib/_FullInternals.js +78 -75
- package/lib/filters/Blur.d.ts +1 -1
- package/lib/filters/Blur.js +9 -5
- package/lib/filters/Brighten.d.ts +1 -1
- package/lib/filters/Brighten.js +9 -5
- package/lib/filters/Contrast.d.ts +1 -1
- package/lib/filters/Contrast.js +9 -5
- package/lib/filters/Emboss.d.ts +1 -1
- package/lib/filters/Emboss.js +14 -10
- package/lib/filters/Enhance.d.ts +1 -1
- package/lib/filters/Enhance.js +9 -5
- package/lib/filters/Grayscale.d.ts +1 -1
- package/lib/filters/Grayscale.js +5 -1
- package/lib/filters/HSL.d.ts +1 -1
- package/lib/filters/HSL.js +11 -7
- package/lib/filters/HSV.d.ts +1 -1
- package/lib/filters/HSV.js +11 -7
- package/lib/filters/Invert.d.ts +1 -1
- package/lib/filters/Invert.js +5 -1
- package/lib/filters/Kaleidoscope.d.ts +1 -1
- package/lib/filters/Kaleidoscope.js +13 -9
- package/lib/filters/Mask.d.ts +1 -1
- package/lib/filters/Mask.js +9 -5
- package/lib/filters/Noise.d.ts +1 -1
- package/lib/filters/Noise.js +9 -5
- package/lib/filters/Pixelate.d.ts +1 -1
- package/lib/filters/Pixelate.js +11 -7
- package/lib/filters/Posterize.d.ts +1 -1
- package/lib/filters/Posterize.js +9 -5
- package/lib/filters/RGB.d.ts +1 -1
- package/lib/filters/RGB.js +11 -7
- package/lib/filters/RGBA.d.ts +1 -1
- package/lib/filters/RGBA.js +12 -8
- package/lib/filters/Sepia.d.ts +1 -1
- package/lib/filters/Sepia.js +5 -1
- package/lib/filters/Solarize.d.ts +1 -1
- package/lib/filters/Solarize.js +5 -1
- package/lib/filters/Threshold.d.ts +1 -1
- package/lib/filters/Threshold.js +9 -5
- package/lib/index-node.d.ts +1 -1
- package/lib/index-node.js +7 -5
- package/lib/index-types.d.ts +124 -124
- package/lib/index.d.ts +1 -1
- package/lib/index.js +4 -2
- package/lib/shapes/Arc.d.ts +6 -5
- package/lib/shapes/Arc.js +17 -13
- package/lib/shapes/Arrow.d.ts +5 -4
- package/lib/shapes/Arrow.js +17 -13
- package/lib/shapes/Circle.d.ts +6 -5
- package/lib/shapes/Circle.js +11 -7
- package/lib/shapes/Ellipse.d.ts +6 -5
- package/lib/shapes/Ellipse.js +13 -9
- package/lib/shapes/Image.d.ts +5 -5
- package/lib/shapes/Image.js +21 -17
- package/lib/shapes/Label.d.ts +8 -7
- package/lib/shapes/Label.js +18 -13
- package/lib/shapes/Line.d.ts +3 -3
- package/lib/shapes/Line.js +14 -10
- package/lib/shapes/Path.d.ts +6 -3
- package/lib/shapes/Path.js +44 -43
- package/lib/shapes/Rect.d.ts +3 -3
- package/lib/shapes/Rect.js +13 -9
- package/lib/shapes/RegularPolygon.d.ts +6 -5
- package/lib/shapes/RegularPolygon.js +12 -8
- package/lib/shapes/Ring.d.ts +6 -5
- package/lib/shapes/Ring.js +12 -8
- package/lib/shapes/Sprite.d.ts +7 -6
- package/lib/shapes/Sprite.js +19 -15
- package/lib/shapes/Star.d.ts +6 -5
- package/lib/shapes/Star.js +13 -9
- package/lib/shapes/Text.d.ts +8 -7
- package/lib/shapes/Text.js +31 -26
- package/lib/shapes/TextPath.d.ts +12 -7
- package/lib/shapes/TextPath.js +82 -188
- package/lib/shapes/Transformer.d.ts +10 -10
- package/lib/shapes/Transformer.js +92 -81
- package/lib/shapes/Wedge.d.ts +6 -5
- package/lib/shapes/Wedge.js +16 -12
- package/lib/types.d.ts +6 -0
- package/lib/types.js +5 -2
- package/package.json +13 -42
- package/cmj/Animation.d.ts +0 -24
- package/cmj/Animation.js +0 -145
- package/cmj/Canvas.d.ts +0 -32
- package/cmj/Canvas.js +0 -114
- package/cmj/Container.d.ts +0 -47
- package/cmj/Container.js +0 -325
- package/cmj/Context.d.ts +0 -84
- package/cmj/Context.js +0 -538
- package/cmj/Core.d.ts +0 -3
- package/cmj/Core.js +0 -7
- package/cmj/DragAndDrop.d.ts +0 -17
- package/cmj/DragAndDrop.js +0 -111
- package/cmj/Factory.d.ts +0 -11
- package/cmj/Factory.js +0 -125
- package/cmj/FastLayer.d.ts +0 -4
- package/cmj/FastLayer.js +0 -16
- package/cmj/Global.d.ts +0 -34
- package/cmj/Global.js +0 -61
- package/cmj/Group.d.ts +0 -8
- package/cmj/Group.js +0 -17
- package/cmj/Layer.d.ts +0 -61
- package/cmj/Layer.js +0 -309
- package/cmj/Node.d.ts +0 -328
- package/cmj/Node.js +0 -1420
- package/cmj/PointerEvents.d.ts +0 -11
- package/cmj/PointerEvents.js +0 -45
- package/cmj/Shape.d.ts +0 -184
- package/cmj/Shape.js +0 -521
- package/cmj/Stage.d.ts +0 -85
- package/cmj/Stage.js +0 -692
- package/cmj/Tween.d.ts +0 -86
- package/cmj/Tween.js +0 -520
- package/cmj/Util.d.ts +0 -91
- package/cmj/Util.js +0 -801
- package/cmj/Validators.d.ts +0 -11
- package/cmj/Validators.js +0 -192
- package/cmj/_CoreInternals.d.ts +0 -152
- package/cmj/_CoreInternals.js +0 -37
- package/cmj/_FullInternals.d.ts +0 -196
- package/cmj/_FullInternals.js +0 -81
- package/cmj/filters/Blur.d.ts +0 -2
- package/cmj/filters/Blur.js +0 -701
- package/cmj/filters/Brighten.d.ts +0 -2
- package/cmj/filters/Brighten.js +0 -16
- package/cmj/filters/Contrast.d.ts +0 -2
- package/cmj/filters/Contrast.js +0 -38
- package/cmj/filters/Emboss.d.ts +0 -2
- package/cmj/filters/Emboss.js +0 -106
- package/cmj/filters/Enhance.d.ts +0 -2
- package/cmj/filters/Enhance.js +0 -87
- package/cmj/filters/Grayscale.d.ts +0 -2
- package/cmj/filters/Grayscale.js +0 -13
- package/cmj/filters/HSL.d.ts +0 -2
- package/cmj/filters/HSL.js +0 -28
- package/cmj/filters/HSV.d.ts +0 -2
- package/cmj/filters/HSV.js +0 -28
- package/cmj/filters/Invert.d.ts +0 -2
- package/cmj/filters/Invert.js +0 -12
- package/cmj/filters/Kaleidoscope.d.ts +0 -2
- package/cmj/filters/Kaleidoscope.js +0 -137
- package/cmj/filters/Mask.d.ts +0 -2
- package/cmj/filters/Mask.js +0 -144
- package/cmj/filters/Noise.d.ts +0 -2
- package/cmj/filters/Noise.js +0 -16
- package/cmj/filters/Pixelate.d.ts +0 -2
- package/cmj/filters/Pixelate.js +0 -64
- package/cmj/filters/Posterize.d.ts +0 -2
- package/cmj/filters/Posterize.js +0 -14
- package/cmj/filters/RGB.d.ts +0 -2
- package/cmj/filters/RGB.js +0 -43
- package/cmj/filters/RGBA.d.ts +0 -2
- package/cmj/filters/RGBA.js +0 -53
- package/cmj/filters/Sepia.d.ts +0 -2
- package/cmj/filters/Sepia.js +0 -15
- package/cmj/filters/Solarize.d.ts +0 -2
- package/cmj/filters/Solarize.js +0 -29
- package/cmj/filters/Threshold.d.ts +0 -2
- package/cmj/filters/Threshold.js +0 -14
- package/cmj/index-node.d.ts +0 -2
- package/cmj/index-node.js +0 -21
- package/cmj/index-types.d.ts +0 -181
- package/cmj/index.d.ts +0 -2
- package/cmj/index.js +0 -4
- package/cmj/package.json +0 -6
- package/cmj/shapes/Arc.d.ts +0 -25
- package/cmj/shapes/Arc.js +0 -59
- package/cmj/shapes/Arrow.d.ts +0 -25
- package/cmj/shapes/Arrow.js +0 -103
- package/cmj/shapes/Circle.d.ts +0 -13
- package/cmj/shapes/Circle.js +0 -37
- package/cmj/shapes/Ellipse.d.ts +0 -16
- package/cmj/shapes/Ellipse.js +0 -41
- package/cmj/shapes/Image.d.ts +0 -25
- package/cmj/shapes/Image.js +0 -117
- package/cmj/shapes/Label.d.ts +0 -35
- package/cmj/shapes/Label.js +0 -178
- package/cmj/shapes/Line.d.ts +0 -28
- package/cmj/shapes/Line.js +0 -159
- package/cmj/shapes/Path.d.ts +0 -37
- package/cmj/shapes/Path.js +0 -631
- package/cmj/shapes/Rect.d.ts +0 -10
- package/cmj/shapes/Rect.js +0 -26
- package/cmj/shapes/RegularPolygon.d.ts +0 -22
- package/cmj/shapes/RegularPolygon.js +0 -69
- package/cmj/shapes/Ring.d.ts +0 -15
- package/cmj/shapes/Ring.js +0 -37
- package/cmj/shapes/Sprite.d.ts +0 -30
- package/cmj/shapes/Sprite.js +0 -112
- package/cmj/shapes/Star.d.ts +0 -17
- package/cmj/shapes/Star.js +0 -42
- package/cmj/shapes/Text.d.ts +0 -62
- package/cmj/shapes/Text.js +0 -373
- package/cmj/shapes/TextPath.d.ts +0 -55
- package/cmj/shapes/TextPath.js +0 -351
- package/cmj/shapes/Transformer.d.ts +0 -116
- package/cmj/shapes/Transformer.js +0 -964
- package/cmj/shapes/Wedge.d.ts +0 -17
- package/cmj/shapes/Wedge.js +0 -42
- package/cmj/types.d.ts +0 -50
- package/cmj/types.js +0 -25
package/lib/_CoreInternals.js
CHANGED
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Konva = void 0;
|
|
4
|
+
const Global_1 = require("./Global");
|
|
5
|
+
const Util_1 = require("./Util");
|
|
6
|
+
const Node_1 = require("./Node");
|
|
7
|
+
const Container_1 = require("./Container");
|
|
8
|
+
const Stage_1 = require("./Stage");
|
|
9
|
+
const Layer_1 = require("./Layer");
|
|
10
|
+
const FastLayer_1 = require("./FastLayer");
|
|
11
|
+
const Group_1 = require("./Group");
|
|
12
|
+
const DragAndDrop_1 = require("./DragAndDrop");
|
|
13
|
+
const Shape_1 = require("./Shape");
|
|
14
|
+
const Animation_1 = require("./Animation");
|
|
15
|
+
const Tween_1 = require("./Tween");
|
|
16
|
+
const Context_1 = require("./Context");
|
|
17
|
+
const Canvas_1 = require("./Canvas");
|
|
18
|
+
exports.Konva = Util_1.Util._assign(Global_1.Konva, {
|
|
19
|
+
Util: Util_1.Util,
|
|
20
|
+
Transform: Util_1.Transform,
|
|
21
|
+
Node: Node_1.Node,
|
|
22
|
+
Container: Container_1.Container,
|
|
23
|
+
Stage: Stage_1.Stage,
|
|
24
|
+
stages: Stage_1.stages,
|
|
25
|
+
Layer: Layer_1.Layer,
|
|
26
|
+
FastLayer: FastLayer_1.FastLayer,
|
|
27
|
+
Group: Group_1.Group,
|
|
28
|
+
DD: DragAndDrop_1.DD,
|
|
29
|
+
Shape: Shape_1.Shape,
|
|
30
|
+
shapes: Shape_1.shapes,
|
|
31
|
+
Animation: Animation_1.Animation,
|
|
32
|
+
Tween: Tween_1.Tween,
|
|
33
|
+
Easings: Tween_1.Easings,
|
|
34
|
+
Context: Context_1.Context,
|
|
35
|
+
Canvas: Canvas_1.Canvas,
|
|
33
36
|
});
|
|
34
|
-
|
|
37
|
+
exports.default = exports.Konva;
|
package/lib/_FullInternals.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Arc } from './shapes/Arc';
|
|
2
|
-
import { Arrow } from './shapes/Arrow';
|
|
3
|
-
import { Circle } from './shapes/Circle';
|
|
4
|
-
import { Ellipse } from './shapes/Ellipse';
|
|
5
|
-
import { Image } from './shapes/Image';
|
|
6
|
-
import { Label, Tag } from './shapes/Label';
|
|
7
|
-
import { Line } from './shapes/Line';
|
|
8
|
-
import { Path } from './shapes/Path';
|
|
9
|
-
import { Rect } from './shapes/Rect';
|
|
10
|
-
import { RegularPolygon } from './shapes/RegularPolygon';
|
|
11
|
-
import { Ring } from './shapes/Ring';
|
|
12
|
-
import { Sprite } from './shapes/Sprite';
|
|
13
|
-
import { Star } from './shapes/Star';
|
|
14
|
-
import { Text } from './shapes/Text';
|
|
15
|
-
import { TextPath } from './shapes/TextPath';
|
|
16
|
-
import { Transformer } from './shapes/Transformer';
|
|
17
|
-
import { Wedge } from './shapes/Wedge';
|
|
1
|
+
import { Arc } from './shapes/Arc.js';
|
|
2
|
+
import { Arrow } from './shapes/Arrow.js';
|
|
3
|
+
import { Circle } from './shapes/Circle.js';
|
|
4
|
+
import { Ellipse } from './shapes/Ellipse.js';
|
|
5
|
+
import { Image } from './shapes/Image.js';
|
|
6
|
+
import { Label, Tag } from './shapes/Label.js';
|
|
7
|
+
import { Line } from './shapes/Line.js';
|
|
8
|
+
import { Path } from './shapes/Path.js';
|
|
9
|
+
import { Rect } from './shapes/Rect.js';
|
|
10
|
+
import { RegularPolygon } from './shapes/RegularPolygon.js';
|
|
11
|
+
import { Ring } from './shapes/Ring.js';
|
|
12
|
+
import { Sprite } from './shapes/Sprite.js';
|
|
13
|
+
import { Star } from './shapes/Star.js';
|
|
14
|
+
import { Text } from './shapes/Text.js';
|
|
15
|
+
import { TextPath } from './shapes/TextPath.js';
|
|
16
|
+
import { Transformer } from './shapes/Transformer.js';
|
|
17
|
+
import { Wedge } from './shapes/Wedge.js';
|
|
18
18
|
export declare const Konva: {
|
|
19
19
|
_global: any;
|
|
20
20
|
version: string;
|
|
@@ -64,24 +64,24 @@ export declare const Konva: {
|
|
|
64
64
|
_isInDocument(el: any): boolean;
|
|
65
65
|
_urlToImage(url: string, callback: Function): void;
|
|
66
66
|
_rgbToHex(r: number, g: number, b: number): string;
|
|
67
|
-
_hexToRgb(hex: string): import("./types").RGB;
|
|
67
|
+
_hexToRgb(hex: string): import("./types.js").RGB;
|
|
68
68
|
getRandomColor(): string;
|
|
69
|
-
getRGB(color: string): import("./types").RGB;
|
|
70
|
-
colorToRGBA(str: string): import("./types").RGBA;
|
|
69
|
+
getRGB(color: string): import("./types.js").RGB;
|
|
70
|
+
colorToRGBA(str: string): import("./types.js").RGBA;
|
|
71
71
|
_namedColorToRBA(str: string): {
|
|
72
72
|
r: any;
|
|
73
73
|
g: any;
|
|
74
74
|
b: any;
|
|
75
75
|
a: number;
|
|
76
76
|
};
|
|
77
|
-
_rgbColorToRGBA(str: string): import("./types").RGBA;
|
|
78
|
-
_rgbaColorToRGBA(str: string): import("./types").RGBA;
|
|
79
|
-
_hex8ColorToRGBA(str: string): import("./types").RGBA;
|
|
80
|
-
_hex6ColorToRGBA(str: string): import("./types").RGBA;
|
|
81
|
-
_hex4ColorToRGBA(str: string): import("./types").RGBA;
|
|
82
|
-
_hex3ColorToRGBA(str: string): import("./types").RGBA;
|
|
83
|
-
_hslColorToRGBA(str: string): import("./types").RGBA;
|
|
84
|
-
haveIntersection(r1: import("./types").IRect, r2: import("./types").IRect): boolean;
|
|
77
|
+
_rgbColorToRGBA(str: string): import("./types.js").RGBA;
|
|
78
|
+
_rgbaColorToRGBA(str: string): import("./types.js").RGBA;
|
|
79
|
+
_hex8ColorToRGBA(str: string): import("./types.js").RGBA;
|
|
80
|
+
_hex6ColorToRGBA(str: string): import("./types.js").RGBA;
|
|
81
|
+
_hex4ColorToRGBA(str: string): import("./types.js").RGBA;
|
|
82
|
+
_hex3ColorToRGBA(str: string): import("./types.js").RGBA;
|
|
83
|
+
_hslColorToRGBA(str: string): import("./types.js").RGBA;
|
|
84
|
+
haveIntersection(r1: import("./types").IRect, r2: import("./types.js").IRect): boolean;
|
|
85
85
|
cloneObject<Any>(obj: Any): Any;
|
|
86
86
|
cloneArray(arr: any[]): any[];
|
|
87
87
|
degToRad(deg: number): number;
|
|
@@ -96,30 +96,30 @@ export declare const Konva: {
|
|
|
96
96
|
each(obj: any, func: any): void;
|
|
97
97
|
_inRange(val: any, left: any, right: any): boolean;
|
|
98
98
|
_getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[];
|
|
99
|
-
_getProjectionToLine(pt: import("./types").Vector2d, line: any, isClosed: any): import("./types").Vector2d;
|
|
99
|
+
_getProjectionToLine(pt: import("./types").Vector2d, line: any, isClosed: any): import("./types.js").Vector2d;
|
|
100
100
|
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): any[];
|
|
101
101
|
_prepareToStringify(obj: any): any;
|
|
102
102
|
_assign<T, U>(target: T, source: U): T & U;
|
|
103
103
|
_getFirstPointerId(evt: any): any;
|
|
104
104
|
releaseCanvas(...canvases: HTMLCanvasElement[]): void;
|
|
105
|
-
drawRoundedRectPath(context: import("./Context").Context, width: number, height: number, cornerRadius: number | number[]): void;
|
|
105
|
+
drawRoundedRectPath(context: import("./Context.js").Context, width: number, height: number, cornerRadius: number | number[]): void;
|
|
106
106
|
};
|
|
107
|
-
Transform: typeof import("./Util").Transform;
|
|
108
|
-
Node: typeof import("./Node").Node;
|
|
109
|
-
Container: typeof import("./Container").Container;
|
|
110
|
-
Stage: typeof import("./Stage").Stage;
|
|
111
|
-
stages: import("./Stage").Stage[];
|
|
112
|
-
Layer: typeof import("./Layer").Layer;
|
|
113
|
-
FastLayer: typeof import("./FastLayer").FastLayer;
|
|
114
|
-
Group: typeof import("./Group").Group;
|
|
107
|
+
Transform: typeof import("./Util.js").Transform;
|
|
108
|
+
Node: typeof import("./Node.js").Node;
|
|
109
|
+
Container: typeof import("./Container.js").Container;
|
|
110
|
+
Stage: typeof import("./Stage.js").Stage;
|
|
111
|
+
stages: import("./Stage.js").Stage[];
|
|
112
|
+
Layer: typeof import("./Layer.js").Layer;
|
|
113
|
+
FastLayer: typeof import("./FastLayer.js").FastLayer;
|
|
114
|
+
Group: typeof import("./Group.js").Group;
|
|
115
115
|
DD: {
|
|
116
116
|
readonly isDragging: boolean;
|
|
117
117
|
justDragged: boolean;
|
|
118
|
-
readonly node: import("./Node").Node<import("./Node").NodeConfig>;
|
|
118
|
+
readonly node: import("./Node").Node<import("./Node.js").NodeConfig>;
|
|
119
119
|
_dragElements: Map<number, {
|
|
120
|
-
node: import("./Node").Node<import("./Node").NodeConfig>;
|
|
121
|
-
startPointerPos: import("./types").Vector2d;
|
|
122
|
-
offset: import("./types").Vector2d;
|
|
120
|
+
node: import("./Node").Node<import("./Node.js").NodeConfig>;
|
|
121
|
+
startPointerPos: import("./types.js").Vector2d;
|
|
122
|
+
offset: import("./types.js").Vector2d;
|
|
123
123
|
pointerId?: number;
|
|
124
124
|
dragStatus: "stopped" | "ready" | "dragging";
|
|
125
125
|
}>;
|
|
@@ -127,12 +127,12 @@ export declare const Konva: {
|
|
|
127
127
|
_endDragBefore(evt?: any): void;
|
|
128
128
|
_endDragAfter(evt: any): void;
|
|
129
129
|
};
|
|
130
|
-
Shape: typeof import("./Shape").Shape;
|
|
130
|
+
Shape: typeof import("./Shape.js").Shape;
|
|
131
131
|
shapes: {
|
|
132
|
-
[key: string]: import("./Shape").Shape<import("./Shape").ShapeConfig>;
|
|
132
|
+
[key: string]: import("./Shape").Shape<import("./Shape.js").ShapeConfig>;
|
|
133
133
|
};
|
|
134
|
-
Animation: typeof import("./Animation").Animation;
|
|
135
|
-
Tween: typeof import("./Tween").Tween;
|
|
134
|
+
Animation: typeof import("./Animation.js").Animation;
|
|
135
|
+
Tween: typeof import("./Tween.js").Tween;
|
|
136
136
|
Easings: {
|
|
137
137
|
BackEaseIn(t: any, b: any, c: any, d: any): any;
|
|
138
138
|
BackEaseOut(t: any, b: any, c: any, d: any): any;
|
|
@@ -151,8 +151,8 @@ export declare const Konva: {
|
|
|
151
151
|
StrongEaseInOut(t: any, b: any, c: any, d: any): any;
|
|
152
152
|
Linear(t: any, b: any, c: any, d: any): any;
|
|
153
153
|
};
|
|
154
|
-
Context: typeof import("./Context").Context;
|
|
155
|
-
Canvas: typeof import("./Canvas").Canvas;
|
|
154
|
+
Context: typeof import("./Context.js").Context;
|
|
155
|
+
Canvas: typeof import("./Canvas.js").Canvas;
|
|
156
156
|
} & {
|
|
157
157
|
Arc: typeof Arc;
|
|
158
158
|
Arrow: typeof Arrow;
|
|
@@ -173,24 +173,24 @@ export declare const Konva: {
|
|
|
173
173
|
Transformer: typeof Transformer;
|
|
174
174
|
Wedge: typeof Wedge;
|
|
175
175
|
Filters: {
|
|
176
|
-
Blur: import("./Node").Filter;
|
|
177
|
-
Brighten: import("./Node").Filter;
|
|
178
|
-
Contrast: import("./Node").Filter;
|
|
179
|
-
Emboss: import("./Node").Filter;
|
|
180
|
-
Enhance: import("./Node").Filter;
|
|
181
|
-
Grayscale: import("./Node").Filter;
|
|
182
|
-
HSL: import("./Node").Filter;
|
|
183
|
-
HSV: import("./Node").Filter;
|
|
184
|
-
Invert: import("./Node").Filter;
|
|
185
|
-
Kaleidoscope: import("./Node").Filter;
|
|
186
|
-
Mask: import("./Node").Filter;
|
|
187
|
-
Noise: import("./Node").Filter;
|
|
188
|
-
Pixelate: import("./Node").Filter;
|
|
189
|
-
Posterize: import("./Node").Filter;
|
|
190
|
-
RGB: import("./Node").Filter;
|
|
191
|
-
RGBA: import("./Node").Filter;
|
|
192
|
-
Sepia: import("./Node").Filter;
|
|
193
|
-
Solarize: import("./Node").Filter;
|
|
194
|
-
Threshold: import("./Node").Filter;
|
|
176
|
+
Blur: import("./Node.js").Filter;
|
|
177
|
+
Brighten: import("./Node.js").Filter;
|
|
178
|
+
Contrast: import("./Node.js").Filter;
|
|
179
|
+
Emboss: import("./Node.js").Filter;
|
|
180
|
+
Enhance: import("./Node.js").Filter;
|
|
181
|
+
Grayscale: import("./Node.js").Filter;
|
|
182
|
+
HSL: import("./Node.js").Filter;
|
|
183
|
+
HSV: import("./Node.js").Filter;
|
|
184
|
+
Invert: import("./Node.js").Filter;
|
|
185
|
+
Kaleidoscope: import("./Node.js").Filter;
|
|
186
|
+
Mask: import("./Node.js").Filter;
|
|
187
|
+
Noise: import("./Node.js").Filter;
|
|
188
|
+
Pixelate: import("./Node.js").Filter;
|
|
189
|
+
Posterize: import("./Node.js").Filter;
|
|
190
|
+
RGB: import("./Node.js").Filter;
|
|
191
|
+
RGBA: import("./Node.js").Filter;
|
|
192
|
+
Sepia: import("./Node.js").Filter;
|
|
193
|
+
Solarize: import("./Node.js").Filter;
|
|
194
|
+
Threshold: import("./Node.js").Filter;
|
|
195
195
|
};
|
|
196
196
|
};
|
package/lib/_FullInternals.js
CHANGED
|
@@ -1,78 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Konva = void 0;
|
|
4
|
+
const _CoreInternals_1 = require("./_CoreInternals");
|
|
5
|
+
const Arc_1 = require("./shapes/Arc");
|
|
6
|
+
const Arrow_1 = require("./shapes/Arrow");
|
|
7
|
+
const Circle_1 = require("./shapes/Circle");
|
|
8
|
+
const Ellipse_1 = require("./shapes/Ellipse");
|
|
9
|
+
const Image_1 = require("./shapes/Image");
|
|
10
|
+
const Label_1 = require("./shapes/Label");
|
|
11
|
+
const Line_1 = require("./shapes/Line");
|
|
12
|
+
const Path_1 = require("./shapes/Path");
|
|
13
|
+
const Rect_1 = require("./shapes/Rect");
|
|
14
|
+
const RegularPolygon_1 = require("./shapes/RegularPolygon");
|
|
15
|
+
const Ring_1 = require("./shapes/Ring");
|
|
16
|
+
const Sprite_1 = require("./shapes/Sprite");
|
|
17
|
+
const Star_1 = require("./shapes/Star");
|
|
18
|
+
const Text_1 = require("./shapes/Text");
|
|
19
|
+
const TextPath_1 = require("./shapes/TextPath");
|
|
20
|
+
const Transformer_1 = require("./shapes/Transformer");
|
|
21
|
+
const Wedge_1 = require("./shapes/Wedge");
|
|
22
|
+
const Blur_1 = require("./filters/Blur");
|
|
23
|
+
const Brighten_1 = require("./filters/Brighten");
|
|
24
|
+
const Contrast_1 = require("./filters/Contrast");
|
|
25
|
+
const Emboss_1 = require("./filters/Emboss");
|
|
26
|
+
const Enhance_1 = require("./filters/Enhance");
|
|
27
|
+
const Grayscale_1 = require("./filters/Grayscale");
|
|
28
|
+
const HSL_1 = require("./filters/HSL");
|
|
29
|
+
const HSV_1 = require("./filters/HSV");
|
|
30
|
+
const Invert_1 = require("./filters/Invert");
|
|
31
|
+
const Kaleidoscope_1 = require("./filters/Kaleidoscope");
|
|
32
|
+
const Mask_1 = require("./filters/Mask");
|
|
33
|
+
const Noise_1 = require("./filters/Noise");
|
|
34
|
+
const Pixelate_1 = require("./filters/Pixelate");
|
|
35
|
+
const Posterize_1 = require("./filters/Posterize");
|
|
36
|
+
const RGB_1 = require("./filters/RGB");
|
|
37
|
+
const RGBA_1 = require("./filters/RGBA");
|
|
38
|
+
const Sepia_1 = require("./filters/Sepia");
|
|
39
|
+
const Solarize_1 = require("./filters/Solarize");
|
|
40
|
+
const Threshold_1 = require("./filters/Threshold");
|
|
41
|
+
exports.Konva = _CoreInternals_1.Konva.Util._assign(_CoreInternals_1.Konva, {
|
|
42
|
+
Arc: Arc_1.Arc,
|
|
43
|
+
Arrow: Arrow_1.Arrow,
|
|
44
|
+
Circle: Circle_1.Circle,
|
|
45
|
+
Ellipse: Ellipse_1.Ellipse,
|
|
46
|
+
Image: Image_1.Image,
|
|
47
|
+
Label: Label_1.Label,
|
|
48
|
+
Tag: Label_1.Tag,
|
|
49
|
+
Line: Line_1.Line,
|
|
50
|
+
Path: Path_1.Path,
|
|
51
|
+
Rect: Rect_1.Rect,
|
|
52
|
+
RegularPolygon: RegularPolygon_1.RegularPolygon,
|
|
53
|
+
Ring: Ring_1.Ring,
|
|
54
|
+
Sprite: Sprite_1.Sprite,
|
|
55
|
+
Star: Star_1.Star,
|
|
56
|
+
Text: Text_1.Text,
|
|
57
|
+
TextPath: TextPath_1.TextPath,
|
|
58
|
+
Transformer: Transformer_1.Transformer,
|
|
59
|
+
Wedge: Wedge_1.Wedge,
|
|
57
60
|
Filters: {
|
|
58
|
-
Blur,
|
|
59
|
-
Brighten,
|
|
60
|
-
Contrast,
|
|
61
|
-
Emboss,
|
|
62
|
-
Enhance,
|
|
63
|
-
Grayscale,
|
|
64
|
-
HSL,
|
|
65
|
-
HSV,
|
|
66
|
-
Invert,
|
|
67
|
-
Kaleidoscope,
|
|
68
|
-
Mask,
|
|
69
|
-
Noise,
|
|
70
|
-
Pixelate,
|
|
71
|
-
Posterize,
|
|
72
|
-
RGB,
|
|
73
|
-
RGBA,
|
|
74
|
-
Sepia,
|
|
75
|
-
Solarize,
|
|
76
|
-
Threshold,
|
|
61
|
+
Blur: Blur_1.Blur,
|
|
62
|
+
Brighten: Brighten_1.Brighten,
|
|
63
|
+
Contrast: Contrast_1.Contrast,
|
|
64
|
+
Emboss: Emboss_1.Emboss,
|
|
65
|
+
Enhance: Enhance_1.Enhance,
|
|
66
|
+
Grayscale: Grayscale_1.Grayscale,
|
|
67
|
+
HSL: HSL_1.HSL,
|
|
68
|
+
HSV: HSV_1.HSV,
|
|
69
|
+
Invert: Invert_1.Invert,
|
|
70
|
+
Kaleidoscope: Kaleidoscope_1.Kaleidoscope,
|
|
71
|
+
Mask: Mask_1.Mask,
|
|
72
|
+
Noise: Noise_1.Noise,
|
|
73
|
+
Pixelate: Pixelate_1.Pixelate,
|
|
74
|
+
Posterize: Posterize_1.Posterize,
|
|
75
|
+
RGB: RGB_1.RGB,
|
|
76
|
+
RGBA: RGBA_1.RGBA,
|
|
77
|
+
Sepia: Sepia_1.Sepia,
|
|
78
|
+
Solarize: Solarize_1.Solarize,
|
|
79
|
+
Threshold: Threshold_1.Threshold,
|
|
77
80
|
},
|
|
78
81
|
});
|
package/lib/filters/Blur.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Filter } from '../Node';
|
|
1
|
+
import { Filter } from '../Node.js';
|
|
2
2
|
export declare const Blur: Filter;
|
package/lib/filters/Blur.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Blur = void 0;
|
|
4
|
+
const Factory_1 = require("../Factory");
|
|
5
|
+
const Node_1 = require("../Node");
|
|
6
|
+
const Validators_1 = require("../Validators");
|
|
4
7
|
function BlurStack() {
|
|
5
8
|
this.r = 0;
|
|
6
9
|
this.g = 0;
|
|
@@ -688,10 +691,11 @@ function filterGaussBlurRGBA(imageData, radius) {
|
|
|
688
691
|
}
|
|
689
692
|
}
|
|
690
693
|
}
|
|
691
|
-
|
|
694
|
+
const Blur = function Blur(imageData) {
|
|
692
695
|
var radius = Math.round(this.blurRadius());
|
|
693
696
|
if (radius > 0) {
|
|
694
697
|
filterGaussBlurRGBA(imageData, radius);
|
|
695
698
|
}
|
|
696
699
|
};
|
|
697
|
-
|
|
700
|
+
exports.Blur = Blur;
|
|
701
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'blurRadius', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Filter } from '../Node';
|
|
1
|
+
import { Filter } from '../Node.js';
|
|
2
2
|
export declare const Brighten: Filter;
|
package/lib/filters/Brighten.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Brighten = void 0;
|
|
4
|
+
const Factory_1 = require("../Factory");
|
|
5
|
+
const Node_1 = require("../Node");
|
|
6
|
+
const Validators_1 = require("../Validators");
|
|
7
|
+
const Brighten = function (imageData) {
|
|
5
8
|
var brightness = this.brightness() * 255, data = imageData.data, len = data.length, i;
|
|
6
9
|
for (i = 0; i < len; i += 4) {
|
|
7
10
|
data[i] += brightness;
|
|
@@ -9,4 +12,5 @@ export const Brighten = function (imageData) {
|
|
|
9
12
|
data[i + 2] += brightness;
|
|
10
13
|
}
|
|
11
14
|
};
|
|
12
|
-
|
|
15
|
+
exports.Brighten = Brighten;
|
|
16
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'brightness', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Filter } from '../Node';
|
|
1
|
+
import { Filter } from '../Node.js';
|
|
2
2
|
export declare const Contrast: Filter;
|
package/lib/filters/Contrast.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Contrast = void 0;
|
|
4
|
+
const Factory_1 = require("../Factory");
|
|
5
|
+
const Node_1 = require("../Node");
|
|
6
|
+
const Validators_1 = require("../Validators");
|
|
7
|
+
const Contrast = function (imageData) {
|
|
5
8
|
var adjust = Math.pow((this.contrast() + 100) / 100, 2);
|
|
6
9
|
var data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;
|
|
7
10
|
for (i = 0; i < nPixels; i += 4) {
|
|
@@ -31,4 +34,5 @@ export const Contrast = function (imageData) {
|
|
|
31
34
|
data[i + 2] = blue;
|
|
32
35
|
}
|
|
33
36
|
};
|
|
34
|
-
|
|
37
|
+
exports.Contrast = Contrast;
|
|
38
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'contrast', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
package/lib/filters/Emboss.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Filter } from '../Node';
|
|
1
|
+
import { Filter } from '../Node.js';
|
|
2
2
|
export declare const Emboss: Filter;
|
package/lib/filters/Emboss.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Emboss = void 0;
|
|
4
|
+
const Factory_1 = require("../Factory");
|
|
5
|
+
const Node_1 = require("../Node");
|
|
6
|
+
const Util_1 = require("../Util");
|
|
7
|
+
const Validators_1 = require("../Validators");
|
|
8
|
+
const Emboss = function (imageData) {
|
|
6
9
|
var strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;
|
|
7
10
|
switch (direction) {
|
|
8
11
|
case 'top-left':
|
|
@@ -38,7 +41,7 @@ export const Emboss = function (imageData) {
|
|
|
38
41
|
dirX = -1;
|
|
39
42
|
break;
|
|
40
43
|
default:
|
|
41
|
-
Util.error('Unknown emboss direction: ' + direction);
|
|
44
|
+
Util_1.Util.error('Unknown emboss direction: ' + direction);
|
|
42
45
|
}
|
|
43
46
|
do {
|
|
44
47
|
var offsetY = (y - 1) * w4;
|
|
@@ -96,7 +99,8 @@ export const Emboss = function (imageData) {
|
|
|
96
99
|
} while (--x);
|
|
97
100
|
} while (--y);
|
|
98
101
|
};
|
|
99
|
-
|
|
100
|
-
Factory.addGetterSetter(Node, '
|
|
101
|
-
Factory.addGetterSetter(Node, '
|
|
102
|
-
Factory.addGetterSetter(Node, '
|
|
102
|
+
exports.Emboss = Emboss;
|
|
103
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
104
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
105
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', null, Factory_1.Factory.afterSetFilter);
|
|
106
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, null, Factory_1.Factory.afterSetFilter);
|
package/lib/filters/Enhance.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Filter } from '../Node';
|
|
1
|
+
import { Filter } from '../Node.js';
|
|
2
2
|
export declare const Enhance: Filter;
|
package/lib/filters/Enhance.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Enhance = void 0;
|
|
4
|
+
const Factory_1 = require("../Factory");
|
|
5
|
+
const Node_1 = require("../Node");
|
|
6
|
+
const Validators_1 = require("../Validators");
|
|
4
7
|
function remap(fromValue, fromMin, fromMax, toMin, toMax) {
|
|
5
8
|
var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;
|
|
6
9
|
if (fromRange === 0) {
|
|
@@ -13,7 +16,7 @@ function remap(fromValue, fromMin, fromMax, toMin, toMax) {
|
|
|
13
16
|
toValue = toRange * toValue + toMin;
|
|
14
17
|
return toValue;
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
const Enhance = function (imageData) {
|
|
17
20
|
var data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;
|
|
18
21
|
var enhanceAmount = this.enhance();
|
|
19
22
|
if (enhanceAmount === 0) {
|
|
@@ -80,4 +83,5 @@ export const Enhance = function (imageData) {
|
|
|
80
83
|
data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);
|
|
81
84
|
}
|
|
82
85
|
};
|
|
83
|
-
|
|
86
|
+
exports.Enhance = Enhance;
|
|
87
|
+
Factory_1.Factory.addGetterSetter(Node_1.Node, 'enhance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Filter } from '../Node';
|
|
1
|
+
import { Filter } from '../Node.js';
|
|
2
2
|
export declare const Grayscale: Filter;
|
package/lib/filters/Grayscale.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Grayscale = void 0;
|
|
4
|
+
const Grayscale = function (imageData) {
|
|
2
5
|
var data = imageData.data, len = data.length, i, brightness;
|
|
3
6
|
for (i = 0; i < len; i += 4) {
|
|
4
7
|
brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
|
|
@@ -7,3 +10,4 @@ export const Grayscale = function (imageData) {
|
|
|
7
10
|
data[i + 2] = brightness;
|
|
8
11
|
}
|
|
9
12
|
};
|
|
13
|
+
exports.Grayscale = Grayscale;
|
package/lib/filters/HSL.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Filter } from '../Node';
|
|
1
|
+
import { Filter } from '../Node.js';
|
|
2
2
|
export declare const HSL: Filter;
|