konva 8.4.2 → 8.4.3
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/cmj/Context.d.ts +10 -9
- package/cmj/Context.js +9 -9
- package/cmj/Global.js +1 -1
- package/cmj/Shape.d.ts +2 -0
- package/cmj/shapes/Arc.d.ts +4 -3
- package/cmj/shapes/Arrow.d.ts +3 -2
- package/cmj/shapes/Circle.d.ts +4 -3
- package/cmj/shapes/Ellipse.d.ts +4 -3
- package/cmj/shapes/Image.d.ts +2 -2
- package/cmj/shapes/Label.d.ts +3 -2
- package/cmj/shapes/RegularPolygon.d.ts +4 -3
- package/cmj/shapes/Ring.d.ts +4 -3
- package/cmj/shapes/Sprite.d.ts +4 -3
- package/cmj/shapes/Star.d.ts +4 -3
- package/cmj/shapes/Text.d.ts +6 -5
- package/cmj/shapes/TextPath.d.ts +5 -4
- package/cmj/shapes/Transformer.d.ts +2 -2
- package/cmj/shapes/Transformer.js +8 -1
- package/cmj/shapes/Wedge.d.ts +4 -3
- package/konva.js +34 -13
- package/konva.min.js +3 -3
- package/lib/Animation.d.ts +2 -2
- package/lib/Canvas.d.ts +1 -1
- package/lib/Container.d.ts +4 -4
- package/lib/Context.d.ts +13 -12
- package/lib/Context.js +9 -9
- package/lib/Core.d.ts +2 -2
- package/lib/DragAndDrop.d.ts +3 -3
- package/lib/FastLayer.d.ts +1 -1
- package/lib/Global.js +1 -1
- package/lib/Group.d.ts +3 -3
- package/lib/Layer.d.ts +9 -9
- package/lib/Node.d.ts +8 -8
- package/lib/PointerEvents.d.ts +4 -4
- package/lib/Shape.d.ts +6 -4
- package/lib/Stage.d.ts +7 -7
- package/lib/Tween.d.ts +2 -2
- package/lib/Util.d.ts +2 -2
- package/lib/_CoreInternals.d.ts +29 -29
- package/lib/_FullInternals.d.ts +67 -67
- package/lib/filters/Blur.d.ts +1 -1
- package/lib/filters/Brighten.d.ts +1 -1
- package/lib/filters/Contrast.d.ts +1 -1
- package/lib/filters/Emboss.d.ts +1 -1
- package/lib/filters/Enhance.d.ts +1 -1
- package/lib/filters/Grayscale.d.ts +1 -1
- package/lib/filters/HSL.d.ts +1 -1
- package/lib/filters/HSV.d.ts +1 -1
- package/lib/filters/Invert.d.ts +1 -1
- package/lib/filters/Kaleidoscope.d.ts +1 -1
- package/lib/filters/Mask.d.ts +1 -1
- package/lib/filters/Noise.d.ts +1 -1
- package/lib/filters/Pixelate.d.ts +1 -1
- package/lib/filters/Posterize.d.ts +1 -1
- package/lib/filters/RGB.d.ts +1 -1
- package/lib/filters/RGBA.d.ts +1 -1
- package/lib/filters/Sepia.d.ts +1 -1
- package/lib/filters/Solarize.d.ts +1 -1
- package/lib/filters/Threshold.d.ts +1 -1
- package/lib/index-node.d.ts +1 -1
- package/lib/index-types.d.ts +124 -124
- package/lib/index.d.ts +1 -1
- package/lib/shapes/Arc.d.ts +6 -5
- package/lib/shapes/Arrow.d.ts +5 -4
- package/lib/shapes/Circle.d.ts +6 -5
- package/lib/shapes/Ellipse.d.ts +6 -5
- package/lib/shapes/Image.d.ts +5 -5
- package/lib/shapes/Label.d.ts +8 -7
- package/lib/shapes/Line.d.ts +3 -3
- package/lib/shapes/Path.d.ts +2 -2
- package/lib/shapes/Rect.d.ts +3 -3
- package/lib/shapes/RegularPolygon.d.ts +6 -5
- package/lib/shapes/Ring.d.ts +6 -5
- package/lib/shapes/Sprite.d.ts +7 -6
- package/lib/shapes/Star.d.ts +6 -5
- package/lib/shapes/Text.d.ts +8 -7
- package/lib/shapes/TextPath.d.ts +7 -6
- package/lib/shapes/Transformer.d.ts +10 -10
- package/lib/shapes/Transformer.js +8 -1
- package/lib/shapes/Wedge.d.ts +6 -5
- package/package.json +1 -1
package/lib/shapes/Circle.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Shape, ShapeConfig } from '../Shape';
|
|
2
|
-
import { GetSet } from '../types';
|
|
1
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
2
|
+
import { GetSet } from '../types.js';
|
|
3
|
+
import { Context } from '../Context.js';
|
|
3
4
|
export interface CircleConfig extends ShapeConfig {
|
|
4
5
|
radius?: number;
|
|
5
6
|
}
|
|
6
7
|
export declare class Circle extends Shape<CircleConfig> {
|
|
7
|
-
_sceneFunc(context:
|
|
8
|
+
_sceneFunc(context: Context): void;
|
|
8
9
|
getWidth(): number;
|
|
9
10
|
getHeight(): number;
|
|
10
|
-
setWidth(width:
|
|
11
|
-
setHeight(height:
|
|
11
|
+
setWidth(width: number): void;
|
|
12
|
+
setHeight(height: number): void;
|
|
12
13
|
radius: GetSet<number, this>;
|
|
13
14
|
}
|
package/lib/shapes/Ellipse.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Shape, ShapeConfig } from '../Shape';
|
|
2
|
-
import {
|
|
1
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
2
|
+
import { Context } from '../Context.js';
|
|
3
|
+
import { GetSet, Vector2d } from '../types.js';
|
|
3
4
|
export interface EllipseConfig extends ShapeConfig {
|
|
4
5
|
radiusX: number;
|
|
5
6
|
radiusY: number;
|
|
6
7
|
}
|
|
7
8
|
export declare class Ellipse extends Shape<EllipseConfig> {
|
|
8
|
-
_sceneFunc(context:
|
|
9
|
+
_sceneFunc(context: Context): void;
|
|
9
10
|
getWidth(): number;
|
|
10
11
|
getHeight(): number;
|
|
11
|
-
setWidth(width:
|
|
12
|
-
setHeight(height:
|
|
12
|
+
setWidth(width: number): void;
|
|
13
|
+
setHeight(height: number): void;
|
|
13
14
|
radius: GetSet<Vector2d, this>;
|
|
14
15
|
radiusX: GetSet<number, this>;
|
|
15
16
|
radiusY: GetSet<number, this>;
|
package/lib/shapes/Image.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Shape, ShapeConfig } from '../Shape';
|
|
2
|
-
import { GetSet, IRect } from '../types';
|
|
3
|
-
import { Context } from '../Context';
|
|
1
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
2
|
+
import { GetSet, IRect } from '../types.js';
|
|
3
|
+
import { Context } from '../Context.js';
|
|
4
4
|
export interface ImageConfig extends ShapeConfig {
|
|
5
5
|
image: CanvasImageSource | undefined;
|
|
6
6
|
crop?: IRect;
|
|
@@ -11,10 +11,10 @@ export declare class Image extends Shape<ImageConfig> {
|
|
|
11
11
|
_setImageLoad(): void;
|
|
12
12
|
_useBufferCanvas(): boolean;
|
|
13
13
|
_sceneFunc(context: Context): void;
|
|
14
|
-
_hitFunc(context:
|
|
14
|
+
_hitFunc(context: Context): void;
|
|
15
15
|
getWidth(): any;
|
|
16
16
|
getHeight(): any;
|
|
17
|
-
static fromURL(url:
|
|
17
|
+
static fromURL(url: string, callback: (img: Image) => void, onError?: OnErrorEventHandler): void;
|
|
18
18
|
image: GetSet<CanvasImageSource | undefined, this>;
|
|
19
19
|
crop: GetSet<IRect, this>;
|
|
20
20
|
cropX: GetSet<number, this>;
|
package/lib/shapes/Label.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Shape, ShapeConfig } from '../Shape';
|
|
2
|
-
import { Group } from '../Group';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
2
|
+
import { Group } from '../Group.js';
|
|
3
|
+
import { Context } from '../Context.js';
|
|
4
|
+
import { ContainerConfig } from '../Container.js';
|
|
5
|
+
import { GetSet } from '../types.js';
|
|
6
|
+
import { Text } from './Text.js';
|
|
6
7
|
export interface LabelConfig extends ContainerConfig {
|
|
7
8
|
}
|
|
8
9
|
export declare class Label extends Group {
|
|
9
|
-
constructor(config?:
|
|
10
|
+
constructor(config?: LabelConfig);
|
|
10
11
|
getText(): Text;
|
|
11
12
|
getTag(): Tag;
|
|
12
13
|
_addListeners(text: any): void;
|
|
@@ -21,7 +22,7 @@ export interface TagConfig extends ShapeConfig {
|
|
|
21
22
|
cornerRadius?: number | Array<number>;
|
|
22
23
|
}
|
|
23
24
|
export declare class Tag extends Shape<TagConfig> {
|
|
24
|
-
_sceneFunc(context:
|
|
25
|
+
_sceneFunc(context: Context): void;
|
|
25
26
|
getSelfRect(): {
|
|
26
27
|
x: number;
|
|
27
28
|
y: number;
|
package/lib/shapes/Line.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Shape, ShapeConfig } from '../Shape';
|
|
2
|
-
import { GetSet } from '../types';
|
|
3
|
-
import { Context } from '../Context';
|
|
1
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
2
|
+
import { GetSet } from '../types.js';
|
|
3
|
+
import { Context } from '../Context.js';
|
|
4
4
|
export interface LineConfig extends ShapeConfig {
|
|
5
5
|
points?: number[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
6
6
|
tension?: number;
|
package/lib/shapes/Path.d.ts
CHANGED
package/lib/shapes/Rect.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Shape, ShapeConfig } from '../Shape';
|
|
2
|
-
import { GetSet } from '../types';
|
|
3
|
-
import { Context } from '../Context';
|
|
1
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
2
|
+
import { GetSet } from '../types.js';
|
|
3
|
+
import { Context } from '../Context.js';
|
|
4
4
|
export interface RectConfig extends ShapeConfig {
|
|
5
5
|
cornerRadius?: number | number[];
|
|
6
6
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Shape, ShapeConfig } from '../Shape';
|
|
2
|
-
import { GetSet } from '../types';
|
|
1
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
2
|
+
import { GetSet } from '../types.js';
|
|
3
|
+
import { Context } from '../Context.js';
|
|
3
4
|
export interface RegularPolygonConfig extends ShapeConfig {
|
|
4
5
|
sides: number;
|
|
5
6
|
radius: number;
|
|
6
7
|
}
|
|
7
8
|
export declare class RegularPolygon extends Shape<RegularPolygonConfig> {
|
|
8
|
-
_sceneFunc(context:
|
|
9
|
+
_sceneFunc(context: Context): void;
|
|
9
10
|
_getPoints(): any[];
|
|
10
11
|
getSelfRect(): {
|
|
11
12
|
x: any;
|
|
@@ -15,8 +16,8 @@ export declare class RegularPolygon extends Shape<RegularPolygonConfig> {
|
|
|
15
16
|
};
|
|
16
17
|
getWidth(): number;
|
|
17
18
|
getHeight(): number;
|
|
18
|
-
setWidth(width:
|
|
19
|
-
setHeight(height:
|
|
19
|
+
setWidth(width: number): void;
|
|
20
|
+
setHeight(height: number): void;
|
|
20
21
|
radius: GetSet<number, this>;
|
|
21
22
|
sides: GetSet<number, this>;
|
|
22
23
|
}
|
package/lib/shapes/Ring.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Shape, ShapeConfig } from '../Shape';
|
|
2
|
-
import { GetSet } from '../types';
|
|
1
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
2
|
+
import { GetSet } from '../types.js';
|
|
3
|
+
import { Context } from '../Context.js';
|
|
3
4
|
export interface RingConfig extends ShapeConfig {
|
|
4
5
|
innerRadius: number;
|
|
5
6
|
outerRadius: number;
|
|
6
7
|
}
|
|
7
8
|
export declare class Ring extends Shape<RingConfig> {
|
|
8
|
-
_sceneFunc(context:
|
|
9
|
+
_sceneFunc(context: Context): void;
|
|
9
10
|
getWidth(): number;
|
|
10
11
|
getHeight(): number;
|
|
11
|
-
setWidth(width:
|
|
12
|
-
setHeight(height:
|
|
12
|
+
setWidth(width: number): void;
|
|
13
|
+
setHeight(height: number): void;
|
|
13
14
|
outerRadius: GetSet<number, this>;
|
|
14
15
|
innerRadius: GetSet<number, this>;
|
|
15
16
|
}
|
package/lib/shapes/Sprite.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Context } from '../Context.js';
|
|
2
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
3
|
+
import { Animation } from '../Animation.js';
|
|
4
|
+
import { GetSet } from '../types.js';
|
|
4
5
|
export interface SpriteConfig extends ShapeConfig {
|
|
5
6
|
animation: string;
|
|
6
7
|
animations: any;
|
|
@@ -12,9 +13,9 @@ export declare class Sprite extends Shape<SpriteConfig> {
|
|
|
12
13
|
_updated: boolean;
|
|
13
14
|
anim: Animation;
|
|
14
15
|
interval: any;
|
|
15
|
-
constructor(config:
|
|
16
|
-
_sceneFunc(context:
|
|
17
|
-
_hitFunc(context:
|
|
16
|
+
constructor(config: SpriteConfig);
|
|
17
|
+
_sceneFunc(context: Context): void;
|
|
18
|
+
_hitFunc(context: Context): void;
|
|
18
19
|
_useBufferCanvas(): boolean;
|
|
19
20
|
_setInterval(): void;
|
|
20
21
|
start(): void;
|
package/lib/shapes/Star.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Context } from '../Context.js';
|
|
2
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
3
|
+
import { GetSet } from '../types.js';
|
|
3
4
|
export interface StarConfig extends ShapeConfig {
|
|
4
5
|
numPoints: number;
|
|
5
6
|
innerRadius: number;
|
|
6
7
|
outerRadius: number;
|
|
7
8
|
}
|
|
8
9
|
export declare class Star extends Shape<StarConfig> {
|
|
9
|
-
_sceneFunc(context:
|
|
10
|
+
_sceneFunc(context: Context): void;
|
|
10
11
|
getWidth(): number;
|
|
11
12
|
getHeight(): number;
|
|
12
|
-
setWidth(width:
|
|
13
|
-
setHeight(height:
|
|
13
|
+
setWidth(width: number): void;
|
|
14
|
+
setHeight(height: number): void;
|
|
14
15
|
outerRadius: GetSet<number, this>;
|
|
15
16
|
innerRadius: GetSet<number, this>;
|
|
16
17
|
numPoints: GetSet<number, this>;
|
package/lib/shapes/Text.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Context } from '../Context.js';
|
|
2
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
3
|
+
import { GetSet } from '../types.js';
|
|
3
4
|
export declare function stringToArray(string: string): string[];
|
|
4
5
|
export interface TextConfig extends ShapeConfig {
|
|
5
6
|
text?: string;
|
|
@@ -28,9 +29,9 @@ export declare class Text extends Shape<TextConfig> {
|
|
|
28
29
|
textWidth: number;
|
|
29
30
|
textHeight: number;
|
|
30
31
|
constructor(config?: TextConfig);
|
|
31
|
-
_sceneFunc(context:
|
|
32
|
-
_hitFunc(context:
|
|
33
|
-
setText(text:
|
|
32
|
+
_sceneFunc(context: Context): void;
|
|
33
|
+
_hitFunc(context: Context): void;
|
|
34
|
+
setText(text: string): this;
|
|
34
35
|
getWidth(): any;
|
|
35
36
|
getHeight(): any;
|
|
36
37
|
getTextWidth(): number;
|
|
@@ -40,8 +41,8 @@ export declare class Text extends Shape<TextConfig> {
|
|
|
40
41
|
height: number;
|
|
41
42
|
};
|
|
42
43
|
_getContextFont(): string;
|
|
43
|
-
_addTextLine(line:
|
|
44
|
-
_getTextWidth(text:
|
|
44
|
+
_addTextLine(line: string): number;
|
|
45
|
+
_getTextWidth(text: string): number;
|
|
45
46
|
_setTextData(): void;
|
|
46
47
|
_shouldHandleEllipsis(currentHeightPx: number): boolean;
|
|
47
48
|
_tryToAddEllipsisToLastLine(): void;
|
package/lib/shapes/TextPath.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Context } from '../Context.js';
|
|
2
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
3
|
+
import { GetSet, Vector2d } from '../types.js';
|
|
3
4
|
export interface TextPathConfig extends ShapeConfig {
|
|
4
5
|
text?: string;
|
|
5
6
|
data?: string;
|
|
@@ -23,13 +24,13 @@ export declare class TextPath extends Shape<TextPathConfig> {
|
|
|
23
24
|
textWidth: number;
|
|
24
25
|
textHeight: number;
|
|
25
26
|
constructor(config?: TextPathConfig);
|
|
26
|
-
_sceneFunc(context:
|
|
27
|
-
_hitFunc(context:
|
|
27
|
+
_sceneFunc(context: Context): void;
|
|
28
|
+
_hitFunc(context: Context): void;
|
|
28
29
|
getTextWidth(): number;
|
|
29
30
|
getTextHeight(): number;
|
|
30
|
-
setText(text:
|
|
31
|
+
setText(text: string): any;
|
|
31
32
|
_getContextFont(): any;
|
|
32
|
-
_getTextSize(text:
|
|
33
|
+
_getTextSize(text: string): {
|
|
33
34
|
width: number;
|
|
34
35
|
height: number;
|
|
35
36
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Transform } from '../Util';
|
|
2
|
-
import { Node } from '../Node';
|
|
3
|
-
import { Rect } from './Rect';
|
|
4
|
-
import { Group } from '../Group';
|
|
5
|
-
import { ContainerConfig } from '../Container';
|
|
6
|
-
import { GetSet, IRect, Vector2d } from '../types';
|
|
1
|
+
import { Transform } from '../Util.js';
|
|
2
|
+
import { Node } from '../Node.js';
|
|
3
|
+
import { Rect } from './Rect.js';
|
|
4
|
+
import { Group } from '../Group.js';
|
|
5
|
+
import { ContainerConfig } from '../Container.js';
|
|
6
|
+
import { GetSet, IRect, Vector2d } from '../types.js';
|
|
7
7
|
export interface Box extends IRect {
|
|
8
8
|
rotation: number;
|
|
9
9
|
}
|
|
@@ -41,13 +41,13 @@ export declare class Transformer extends Group {
|
|
|
41
41
|
cos: number;
|
|
42
42
|
_cursorChange: boolean;
|
|
43
43
|
constructor(config?: TransformerConfig);
|
|
44
|
-
attachTo(node:
|
|
45
|
-
setNode(node:
|
|
46
|
-
getNode(): Node<import("../Node").NodeConfig>;
|
|
44
|
+
attachTo(node: Node): this;
|
|
45
|
+
setNode(node: Node): this;
|
|
46
|
+
getNode(): Node<import("../Node.js").NodeConfig>;
|
|
47
47
|
_getEventNamespace(): string;
|
|
48
48
|
setNodes(nodes?: Array<Node>): this;
|
|
49
49
|
_proxyDrag(node: Node): void;
|
|
50
|
-
getNodes(): Node<import("../Node").NodeConfig>[];
|
|
50
|
+
getNodes(): Node<import("../Node.js").NodeConfig>[];
|
|
51
51
|
getActiveAnchor(): string;
|
|
52
52
|
detach(): void;
|
|
53
53
|
_resetTransformCache(): void;
|
|
@@ -164,7 +164,14 @@ export class Transformer extends Group {
|
|
|
164
164
|
if (this._nodes && this._nodes.length) {
|
|
165
165
|
this.detach();
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
const filteredNodes = nodes.filter((node) => {
|
|
168
|
+
if (node.isAncestorOf(this)) {
|
|
169
|
+
Util.error('Konva.Transformer cannot be an a child of the node you are trying to attach');
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
return true;
|
|
173
|
+
});
|
|
174
|
+
this._nodes = nodes = filteredNodes;
|
|
168
175
|
if (nodes.length === 1 && this.useSingleNodeRotation()) {
|
|
169
176
|
this.rotation(nodes[0].getAbsoluteRotation());
|
|
170
177
|
}
|
package/lib/shapes/Wedge.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Context } from '../Context.js';
|
|
2
|
+
import { Shape, ShapeConfig } from '../Shape.js';
|
|
3
|
+
import { GetSet } from '../types.js';
|
|
3
4
|
export interface WedgeConfig extends ShapeConfig {
|
|
4
5
|
angle: number;
|
|
5
6
|
radius: number;
|
|
6
7
|
clockwise?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare class Wedge extends Shape<WedgeConfig> {
|
|
9
|
-
_sceneFunc(context:
|
|
10
|
+
_sceneFunc(context: Context): void;
|
|
10
11
|
getWidth(): number;
|
|
11
12
|
getHeight(): number;
|
|
12
|
-
setWidth(width:
|
|
13
|
-
setHeight(height:
|
|
13
|
+
setWidth(width: number): void;
|
|
14
|
+
setHeight(height: number): void;
|
|
14
15
|
radius: GetSet<number, this>;
|
|
15
16
|
angle: GetSet<number, this>;
|
|
16
17
|
clockwise: GetSet<boolean, this>;
|