Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

konva

Package Overview
Dependencies
Maintainers
1
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

konva - npm Package Compare versions

Comparing version 9.2.0 to 9.2.1

84

lib/_CoreInternals.d.ts

@@ -31,5 +31,5 @@ import { Transform } from './Util.js';

_pointerInDblClickWindow: boolean;
_mouseDblClickPointerId: any;
_touchDblClickPointerId: any;
_pointerDblClickPointerId: any;
_mouseDblClickPointerId: null;
_touchDblClickPointerId: null;
_pointerDblClickPointerId: null;
pixelRatio: number;

@@ -66,16 +66,56 @@ dragDistance: number;

getRGB(color: string): import("./types.js").RGB;
colorToRGBA(str: string): import("./types.js").RGBA;
colorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_namedColorToRBA(str: string): {
r: any;
g: any;
b: any;
r: number;
g: number;
b: number;
a: number;
};
_rgbColorToRGBA(str: string): import("./types.js").RGBA;
_rgbaColorToRGBA(str: string): import("./types.js").RGBA;
_hex8ColorToRGBA(str: string): import("./types.js").RGBA;
_hex6ColorToRGBA(str: string): import("./types.js").RGBA;
_hex4ColorToRGBA(str: string): import("./types.js").RGBA;
_hex3ColorToRGBA(str: string): import("./types.js").RGBA;
_hslColorToRGBA(str: string): import("./types.js").RGBA;
} | null;
_rgbColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_rgbaColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex8ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex6ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex4ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex3ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hslColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
haveIntersection(r1: import("./types").IRect, r2: import("./types.js").IRect): boolean;

@@ -88,3 +128,3 @@ cloneObject<Any>(obj: Any): Any;

_radToDeg(rad: number): number;
_getRotation(radians: any): any;
_getRotation(radians: number): number;
_capitalize(str: string): string;

@@ -94,7 +134,7 @@ throw(str: string): never;

warn(str: string): void;
each(obj: any, func: any): void;
_inRange(val: any, left: any, right: any): boolean;
each(obj: Object, func: Function): void;
_inRange(val: number, left: number, right: number): boolean;
_getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[];
_getProjectionToLine(pt: import("./types").Vector2d, line: any, isClosed: any): import("./types.js").Vector2d;
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): any[];
_getProjectionToLine(pt: import("./types").Vector2d, line: import("./types").Vector2d[], isClosed: boolean): import("./types.js").Vector2d;
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[];
_prepareToStringify(obj: any): any;

@@ -117,3 +157,3 @@ _assign<T, U>(target: T, source: U): T & U;

justDragged: boolean;
readonly node: Node<import("./Node.js").NodeConfig>;
readonly node: Node<import("./Node.js").NodeConfig> | undefined;
_dragElements: Map<number, {

@@ -123,3 +163,3 @@ node: Node<import("./Node.js").NodeConfig>;

offset: import("./types.js").Vector2d;
pointerId?: number;
pointerId?: number | undefined;
dragStatus: "stopped" | "ready" | "dragging";

@@ -126,0 +166,0 @@ }>;

@@ -36,5 +36,5 @@ import { Arc } from './shapes/Arc.js';

_pointerInDblClickWindow: boolean;
_mouseDblClickPointerId: any;
_touchDblClickPointerId: any;
_pointerDblClickPointerId: any;
_mouseDblClickPointerId: null;
_touchDblClickPointerId: null;
_pointerDblClickPointerId: null;
pixelRatio: number;

@@ -71,16 +71,56 @@ dragDistance: number;

getRGB(color: string): import("./types.js").RGB;
colorToRGBA(str: string): import("./types.js").RGBA;
colorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_namedColorToRBA(str: string): {
r: any;
g: any;
b: any;
r: number;
g: number;
b: number;
a: number;
};
_rgbColorToRGBA(str: string): import("./types.js").RGBA;
_rgbaColorToRGBA(str: string): import("./types.js").RGBA;
_hex8ColorToRGBA(str: string): import("./types.js").RGBA;
_hex6ColorToRGBA(str: string): import("./types.js").RGBA;
_hex4ColorToRGBA(str: string): import("./types.js").RGBA;
_hex3ColorToRGBA(str: string): import("./types.js").RGBA;
_hslColorToRGBA(str: string): import("./types.js").RGBA;
} | null;
_rgbColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_rgbaColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex8ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex6ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex4ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex3ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hslColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
haveIntersection(r1: import("./types").IRect, r2: import("./types.js").IRect): boolean;

@@ -93,3 +133,3 @@ cloneObject<Any>(obj: Any): Any;

_radToDeg(rad: number): number;
_getRotation(radians: any): any;
_getRotation(radians: number): number;
_capitalize(str: string): string;

@@ -99,7 +139,7 @@ throw(str: string): never;

warn(str: string): void;
each(obj: any, func: any): void;
_inRange(val: any, left: any, right: any): boolean;
each(obj: Object, func: Function): void;
_inRange(val: number, left: number, right: number): boolean;
_getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[];
_getProjectionToLine(pt: import("./types").Vector2d, line: any, isClosed: any): import("./types.js").Vector2d;
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): any[];
_getProjectionToLine(pt: import("./types").Vector2d, line: import("./types").Vector2d[], isClosed: boolean): import("./types.js").Vector2d;
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[];
_prepareToStringify(obj: any): any;

@@ -122,3 +162,3 @@ _assign<T, U>(target: T, source: U): T & U;

justDragged: boolean;
readonly node: import("./Node").Node<import("./Node.js").NodeConfig>;
readonly node: import("./Node").Node<import("./Node.js").NodeConfig> | undefined;
_dragElements: Map<number, {

@@ -128,3 +168,3 @@ node: import("./Node").Node<import("./Node.js").NodeConfig>;

offset: import("./types.js").Vector2d;
pointerId?: number;
pointerId?: number | undefined;
dragStatus: "stopped" | "ready" | "dragging";

@@ -131,0 +171,0 @@ }>;

@@ -9,10 +9,10 @@ import { Layer } from './Layer.js';

constructor(func: AnimationFn, layers?: any);
setLayers(layers: any): this;
setLayers(layers: null | Layer | Layer[]): this;
getLayers(): Layer[];
addLayer(layer: any): boolean;
addLayer(layer: Layer): boolean;
isRunning(): boolean;
start(): this;
stop(): this;
_updateFrameObject(time: any): void;
static animations: any[];
_updateFrameObject(time: number): void;
static animations: Array<Animation>;
static animIdCounter: number;

@@ -19,0 +19,0 @@ static animRunning: boolean;

@@ -6,3 +6,3 @@ "use strict";

const Util_1 = require("./Util");
var now = (function () {
const now = (function () {
if (Global_1.glob.performance && Global_1.glob.performance.now) {

@@ -30,12 +30,6 @@ return function () {

setLayers(layers) {
var lays = [];
if (!layers) {
lays = [];
let lays = [];
if (layers) {
lays = Array.isArray(layers) ? layers : [layers];
}
else if (layers.length > 0) {
lays = layers;
}
else {
lays = [layers];
}
this.layers = lays;

@@ -48,4 +42,5 @@ return this;

addLayer(layer) {
var layers = this.layers, len = layers.length, n;
for (n = 0; n < len; n++) {
const layers = this.layers;
const len = layers.length;
for (let n = 0; n < len; n++) {
if (layers[n]._id === layer._id) {

@@ -59,4 +54,6 @@ return false;

isRunning() {
var a = Animation, animations = a.animations, len = animations.length, n;
for (n = 0; n < len; n++) {
const a = Animation;
const animations = a.animations;
const len = animations.length;
for (let n = 0; n < len; n++) {
if (animations[n].id === this.id) {

@@ -90,4 +87,6 @@ return true;

static _removeAnimation(anim) {
var id = anim.id, animations = this.animations, len = animations.length, n;
for (n = 0; n < len; n++) {
const id = anim.id;
const animations = this.animations;
const len = animations.length;
for (let n = 0; n < len; n++) {
if (animations[n].id === id) {

@@ -100,9 +99,11 @@ this.animations.splice(n, 1);

static _runFrames() {
var layerHash = {}, animations = this.animations, anim, layers, func, n, i, layersLen, layer, key, needRedraw;
for (n = 0; n < animations.length; n++) {
anim = animations[n];
layers = anim.layers;
func = anim.func;
const layerHash = {};
const animations = this.animations;
for (let n = 0; n < animations.length; n++) {
const anim = animations[n];
const layers = anim.layers;
const func = anim.func;
anim._updateFrameObject(now());
layersLen = layers.length;
const layersLen = layers.length;
let needRedraw;
if (func) {

@@ -117,4 +118,4 @@ needRedraw = func.call(anim, anim.frame) !== false;

}
for (i = 0; i < layersLen; i++) {
layer = layers[i];
for (let i = 0; i < layersLen; i++) {
const layer = layers[i];
if (layer._id !== undefined) {

@@ -125,3 +126,3 @@ layerHash[layer._id] = layer;

}
for (key in layerHash) {
for (let key in layerHash) {
if (!layerHash.hasOwnProperty(key)) {

@@ -134,3 +135,3 @@ continue;

static _animationLoop() {
var Anim = Animation;
const Anim = Animation;
if (Anim.animations.length) {

@@ -137,0 +138,0 @@ Anim._runFrames();

import { Node, NodeConfig } from './Node.js';
import { GetSet, IRect } from './types.js';
import { Shape } from './Shape.js';
import { HitCanvas, SceneCanvas } from './Canvas.js';

@@ -15,3 +16,3 @@ import { SceneContext } from './Context.js';

export declare abstract class Container<ChildType extends Node = Node> extends Node<ContainerConfig> {
children: Array<ChildType> | undefined;
children: Array<ChildType>;
getChildren(filterFunc?: (item: Node) => boolean): ChildType[];

@@ -24,5 +25,5 @@ hasChildren(): boolean;

destroy(): this;
find<ChildNode extends Node = Node>(selector: any): Array<ChildNode>;
findOne<ChildNode extends Node = Node>(selector: string | Function): ChildNode;
_generalFind<ChildNode extends Node = Node>(selector: string | Function, findOne: boolean): ChildNode[];
find<ChildNode extends Node>(selector: any): Array<ChildNode>;
findOne<ChildNode extends Node = Node>(selector: string | Function): ChildNode | undefined;
_generalFind<ChildNode extends Node>(selector: string | Function, findOne: boolean): ChildNode[];
private _descendants;

@@ -32,3 +33,3 @@ toObject(): any;

clone(obj?: any): this;
getAllIntersections(pos: any): any[];
getAllIntersections(pos: any): Shape<import("./Shape.js").ShapeConfig>[];
_clearSelfAndDescendantCache(attr?: string): void;

@@ -50,3 +51,3 @@ _setChildrenIndices(): void;

clipHeight: GetSet<number, this>;
clipFunc: GetSet<(ctx: CanvasRenderingContext2D, shape: Container<ChildType>) => ClipFuncOutput, this>;
clipFunc: GetSet<(ctx: CanvasRenderingContext2D, shape: Container) => ClipFuncOutput, this>;
}

@@ -147,3 +147,3 @@ "use strict";

var arr = [];
this.find('Shape').forEach(function (shape) {
this.find('Shape').forEach((shape) => {
if (shape.isVisible() && shape.intersects(pos)) {

@@ -247,5 +247,4 @@ arr.push(shape);

}
getClientRect(config) {
getClientRect(config = {}) {
var _a;
config = config || {};
var skipTransform = config.skipTransform;

@@ -252,0 +251,0 @@ var relativeTo = config.relativeTo;

@@ -26,16 +26,16 @@ import { Canvas } from './Canvas.js';

setAttr(attr: string, val: any): void;
arc(a0: number, a1: number, a2: number, a3: number, a4: number, a5?: boolean): void;
arcTo(a0: number, a1: number, a2: number, a3: number, a4: number): void;
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterClockwise?: boolean): void;
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
beginPath(): void;
bezierCurveTo(a0: number, a1: number, a2: number, a3: number, a4: number, a5: number): void;
clearRect(a0: number, a1: number, a2: number, a3: number): void;
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
clearRect(x: number, y: number, width: number, height: number): void;
clip(fillRule?: CanvasFillRule): void;
clip(path: Path2D, fillRule?: CanvasFillRule): void;
closePath(): void;
createImageData(a0: any, a1: any): ImageData;
createLinearGradient(a0: number, a1: number, a2: number, a3: number): CanvasGradient;
createPattern(a0: CanvasImageSource, a1: string | null): CanvasPattern;
createRadialGradient(a0: number, a1: number, a2: number, a3: number, a4: number, a5: number): CanvasGradient;
drawImage(a0: CanvasImageSource, a1: number, a2: number, a3?: number, a4?: number, a5?: number, a6?: number, a7?: number, a8?: number): void;
ellipse(a0: number, a1: number, a2: number, a3: number, a4: number, a5: number, a6: number, a7?: boolean): void;
createImageData(width: any, height: any): ImageData | undefined;
createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;
createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
drawImage(image: CanvasImageSource, sx: number, sy: number, sWidth?: number, sHeight?: number, dx?: number, dy?: number, dWidth?: number, dHeight?: number): void;
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
isPointInPath(x: number, y: number, path?: Path2D, fillRule?: CanvasFillRule): boolean;

@@ -48,19 +48,19 @@ fill(fillRule?: CanvasFillRule): void;

measureText(text: string): TextMetrics;
getImageData(a0: number, a1: number, a2: number, a3: number): ImageData;
lineTo(a0: number, a1: number): void;
moveTo(a0: number, a1: number): void;
rect(a0: number, a1: number, a2: number, a3: number): void;
putImageData(a0: ImageData, a1: number, a2: number): void;
quadraticCurveTo(a0: number, a1: number, a2: number, a3: number): void;
getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;
lineTo(x: number, y: number): void;
moveTo(x: number, y: number): void;
rect(x: number, y: number, width: number, height: number): void;
putImageData(imageData: ImageData, dx: number, dy: number): void;
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
restore(): void;
rotate(a0: number): void;
rotate(angle: number): void;
save(): void;
scale(a0: number, a1: number): void;
setLineDash(a0: number[]): void;
scale(x: number, y: number): void;
setLineDash(segments: number[]): void;
getLineDash(): number[];
setTransform(a0: number, a1: number, a2: number, a3: number, a4: number, a5: number): void;
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
stroke(path2d?: Path2D): void;
strokeText(a0: string, a1: number, a2: number, a3?: number): void;
transform(a0: number, a1: number, a2: number, a3: number, a4: number, a5: number): void;
translate(a0: number, a1: number): void;
strokeText(text: string, x: number, y: number, maxWidth?: number): void;
transform(a: number, b: number, c: number, d: number, e: number, f: number): void;
translate(x: number, y: number): void;
_enableTrace(): void;

@@ -74,3 +74,3 @@ _applyGlobalCompositeOperation(node: any): void;

constructor(canvas: Canvas, { willReadFrequently }?: {
willReadFrequently?: boolean;
willReadFrequently?: boolean | undefined;
});

@@ -77,0 +77,0 @@ _fillColor(shape: Shape): void;

@@ -186,7 +186,7 @@ "use strict";

}
arc(a0, a1, a2, a3, a4, a5) {
this._context.arc(a0, a1, a2, a3, a4, a5);
arc(x, y, radius, startAngle, endAngle, counterClockwise) {
this._context.arc(x, y, radius, startAngle, endAngle, counterClockwise);
}
arcTo(a0, a1, a2, a3, a4) {
this._context.arcTo(a0, a1, a2, a3, a4);
arcTo(x1, y1, x2, y2, radius) {
this._context.arcTo(x1, y1, x2, y2, radius);
}

@@ -196,7 +196,7 @@ beginPath() {

}
bezierCurveTo(a0, a1, a2, a3, a4, a5) {
this._context.bezierCurveTo(a0, a1, a2, a3, a4, a5);
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
}
clearRect(a0, a1, a2, a3) {
this._context.clearRect(a0, a1, a2, a3);
clearRect(x, y, width, height) {
this._context.clearRect(x, y, width, height);
}

@@ -209,34 +209,34 @@ clip(...args) {

}
createImageData(a0, a1) {
createImageData(width, height) {
var a = arguments;
if (a.length === 2) {
return this._context.createImageData(a0, a1);
return this._context.createImageData(width, height);
}
else if (a.length === 1) {
return this._context.createImageData(a0);
return this._context.createImageData(width);
}
}
createLinearGradient(a0, a1, a2, a3) {
return this._context.createLinearGradient(a0, a1, a2, a3);
createLinearGradient(x0, y0, x1, y1) {
return this._context.createLinearGradient(x0, y0, x1, y1);
}
createPattern(a0, a1) {
return this._context.createPattern(a0, a1);
createPattern(image, repetition) {
return this._context.createPattern(image, repetition);
}
createRadialGradient(a0, a1, a2, a3, a4, a5) {
return this._context.createRadialGradient(a0, a1, a2, a3, a4, a5);
createRadialGradient(x0, y0, r0, x1, y1, r1) {
return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);
}
drawImage(a0, a1, a2, a3, a4, a5, a6, a7, a8) {
drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {
var a = arguments, _context = this._context;
if (a.length === 3) {
_context.drawImage(a0, a1, a2);
_context.drawImage(image, sx, sy);
}
else if (a.length === 5) {
_context.drawImage(a0, a1, a2, a3, a4);
_context.drawImage(image, sx, sy, sWidth, sHeight);
}
else if (a.length === 9) {
_context.drawImage(a0, a1, a2, a3, a4, a5, a6, a7, a8);
_context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
}
}
ellipse(a0, a1, a2, a3, a4, a5, a6, a7) {
this._context.ellipse(a0, a1, a2, a3, a4, a5, a6, a7);
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {
this._context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise);
}

@@ -269,19 +269,19 @@ isPointInPath(x, y, path, fillRule) {

}
getImageData(a0, a1, a2, a3) {
return this._context.getImageData(a0, a1, a2, a3);
getImageData(sx, sy, sw, sh) {
return this._context.getImageData(sx, sy, sw, sh);
}
lineTo(a0, a1) {
this._context.lineTo(a0, a1);
lineTo(x, y) {
this._context.lineTo(x, y);
}
moveTo(a0, a1) {
this._context.moveTo(a0, a1);
moveTo(x, y) {
this._context.moveTo(x, y);
}
rect(a0, a1, a2, a3) {
this._context.rect(a0, a1, a2, a3);
rect(x, y, width, height) {
this._context.rect(x, y, width, height);
}
putImageData(a0, a1, a2) {
this._context.putImageData(a0, a1, a2);
putImageData(imageData, dx, dy) {
this._context.putImageData(imageData, dx, dy);
}
quadraticCurveTo(a0, a1, a2, a3) {
this._context.quadraticCurveTo(a0, a1, a2, a3);
quadraticCurveTo(cpx, cpy, x, y) {
this._context.quadraticCurveTo(cpx, cpy, x, y);
}

@@ -291,4 +291,4 @@ restore() {

}
rotate(a0) {
this._context.rotate(a0);
rotate(angle) {
this._context.rotate(angle);
}

@@ -298,14 +298,14 @@ save() {

}
scale(a0, a1) {
this._context.scale(a0, a1);
scale(x, y) {
this._context.scale(x, y);
}
setLineDash(a0) {
setLineDash(segments) {
if (this._context.setLineDash) {
this._context.setLineDash(a0);
this._context.setLineDash(segments);
}
else if ('mozDash' in this._context) {
this._context['mozDash'] = a0;
this._context['mozDash'] = segments;
}
else if ('webkitLineDash' in this._context) {
this._context['webkitLineDash'] = a0;
this._context['webkitLineDash'] = segments;
}

@@ -316,4 +316,4 @@ }

}
setTransform(a0, a1, a2, a3, a4, a5) {
this._context.setTransform(a0, a1, a2, a3, a4, a5);
setTransform(a, b, c, d, e, f) {
this._context.setTransform(a, b, c, d, e, f);
}

@@ -328,10 +328,10 @@ stroke(path2d) {

}
strokeText(a0, a1, a2, a3) {
this._context.strokeText(a0, a1, a2, a3);
strokeText(text, x, y, maxWidth) {
this._context.strokeText(text, x, y, maxWidth);
}
transform(a0, a1, a2, a3, a4, a5) {
this._context.transform(a0, a1, a2, a3, a4, a5);
transform(a, b, c, d, e, f) {
this._context.transform(a, b, c, d, e, f);
}
translate(a0, a1) {
this._context.translate(a0, a1);
translate(x, y) {
this._context.translate(x, y);
}

@@ -338,0 +338,0 @@ _enableTrace() {

@@ -6,3 +6,3 @@ import { Node } from './Node.js';

justDragged: boolean;
readonly node: Node<import("./Node.js").NodeConfig>;
readonly node: Node<import("./Node.js").NodeConfig> | undefined;
_dragElements: Map<number, {

@@ -12,3 +12,3 @@ node: Node;

offset: Vector2d;
pointerId?: number;
pointerId?: number | undefined;
dragStatus: 'ready' | 'dragging' | 'stopped';

@@ -15,0 +15,0 @@ }>;

@@ -0,1 +1,2 @@

import { Node } from './Node.js';
export declare const Factory: {

@@ -10,3 +11,3 @@ addGetterSetter(constructor: any, attr: any, def?: any, validator?: any, after?: any): void;

backCompat(constructor: any, methods: any): void;
afterSetFilter(): void;
afterSetFilter(this: Node): void;
};

@@ -15,514 +15,35 @@ "use strict";

var mul_table = [
512,
512,
456,
512,
328,
456,
335,
512,
405,
328,
271,
456,
388,
335,
292,
512,
454,
405,
364,
328,
298,
271,
496,
456,
420,
388,
360,
335,
312,
292,
273,
512,
482,
454,
428,
405,
383,
364,
345,
328,
312,
298,
284,
271,
259,
496,
475,
456,
437,
420,
404,
388,
374,
360,
347,
335,
323,
312,
302,
292,
282,
273,
265,
512,
497,
482,
468,
454,
441,
428,
417,
405,
394,
383,
373,
364,
354,
345,
337,
328,
320,
312,
305,
298,
291,
284,
278,
271,
265,
259,
507,
496,
485,
475,
465,
456,
446,
437,
428,
420,
412,
404,
396,
388,
381,
374,
367,
360,
354,
347,
341,
335,
329,
323,
318,
312,
307,
302,
297,
292,
287,
282,
278,
273,
269,
265,
261,
512,
505,
497,
489,
482,
475,
468,
461,
454,
447,
441,
435,
428,
422,
417,
411,
405,
399,
394,
389,
383,
378,
373,
368,
364,
359,
354,
350,
345,
341,
337,
332,
328,
324,
320,
316,
312,
309,
305,
301,
298,
294,
291,
287,
284,
281,
278,
274,
271,
268,
265,
262,
259,
257,
507,
501,
496,
491,
485,
480,
475,
470,
465,
460,
456,
451,
446,
442,
437,
433,
428,
424,
420,
416,
412,
408,
404,
400,
396,
392,
388,
385,
381,
377,
374,
370,
367,
363,
360,
357,
354,
350,
347,
344,
341,
338,
335,
332,
329,
326,
323,
320,
318,
315,
312,
310,
307,
304,
302,
299,
297,
294,
292,
289,
287,
285,
282,
280,
278,
275,
273,
271,
269,
267,
265,
263,
261,
259,
512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292,
512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292,
273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259,
496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292,
282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373,
364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259,
507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381,
374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292,
287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461,
454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373,
368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309,
305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259,
257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442,
437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381,
377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332,
329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292,
289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259,
];
var shg_table = [
9,
11,
12,
13,
13,
14,
14,
15,
15,
15,
15,
16,
16,
16,
16,
17,
17,
17,
17,
17,
17,
17,
18,
18,
18,
18,
18,
18,
18,
18,
18,
19,
19,
19,
19,
19,
19,
19,
19,
19,
19,
19,
19,
19,
19,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
20,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
21,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
22,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
23,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
24,
9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17,
17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22,
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24,
];

@@ -542,3 +63,11 @@ function filterGaussBlurRGBA(imageData, radius) {

for (y = 0; y < height; y++) {
r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0;
r_in_sum =
g_in_sum =
b_in_sum =
a_in_sum =
r_sum =
g_sum =
b_sum =
a_sum =
0;
r_out_sum = radiusPlus1 * (pr = pixels[yi]);

@@ -617,3 +146,11 @@ g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]);

for (x = 0; x < width; x++) {
g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0;
g_in_sum =
b_in_sum =
a_in_sum =
r_in_sum =
g_sum =
b_sum =
a_sum =
r_sum =
0;
yi = x << 2;

@@ -620,0 +157,0 @@ r_out_sum = radiusPlus1 * (pr = pixels[yi]);

@@ -20,5 +20,5 @@ export declare const glob: any;

_pointerInDblClickWindow: boolean;
_mouseDblClickPointerId: any;
_touchDblClickPointerId: any;
_pointerDblClickPointerId: any;
_mouseDblClickPointerId: null;
_touchDblClickPointerId: null;
_pointerDblClickPointerId: null;
pixelRatio: number;

@@ -25,0 +25,0 @@ dragDistance: number;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports._registerNode = exports.Konva = exports.glob = void 0;
var PI_OVER_180 = Math.PI / 180;
const PI_OVER_180 = Math.PI / 180;
function detectBrowser() {

@@ -19,3 +19,3 @@ return (typeof window !== 'undefined' &&

_global: exports.glob,
version: '9.2.0',
version: '9.2.1',
isBrowser: detectBrowser(),

@@ -22,0 +22,0 @@ isUnminified: /param/.test(function (param) { }.toString()),

@@ -37,11 +37,11 @@ import { Container, ContainerConfig } from './Container.js';

_validateAdd(child: any): void;
_toKonvaCanvas(config: any): any;
_toKonvaCanvas(config: any): SceneCanvas;
_checkVisibility(): void;
_setSmoothEnabled(): void;
getWidth(): number;
getWidth(): number | undefined;
setWidth(): void;
getHeight(): number;
getHeight(): number | undefined;
setHeight(): void;
batchDraw(): this;
getIntersection(pos: Vector2d): Shape<import("./Shape.js").ShapeConfig>;
getIntersection(pos: Vector2d): Shape<import("./Shape.js").ShapeConfig> | null;
_getIntersection(pos: Vector2d): {

@@ -48,0 +48,0 @@ shape?: Shape;

@@ -61,6 +61,6 @@ import { Transform } from './Util.js';

_allEventListeners: null | Array<Function>;
parent: Container<Node> | null;
parent: Container | null;
_cache: Map<string, any>;
_attachedDepsListeners: Map<string, boolean>;
_lastPos: Vector2d;
_lastPos: Vector2d | null;
_attrsAffectingSize: string[];

@@ -93,3 +93,3 @@ _batchingTransformChange: boolean;

hitCanvasPixelRatio?: number;
}): this;
}): this | undefined;
isCached(): boolean;

@@ -102,3 +102,3 @@ abstract drawScene(canvas?: Canvas, top?: Node): void;

skipStroke?: boolean;
relativeTo?: Container<Node>;
relativeTo?: Container;
}): {

@@ -110,3 +110,3 @@ x: number;

};
_transformedRect(rect: IRect, top: Node): {
_transformedRect(rect: IRect, top?: Node | null): {
x: number;

@@ -120,3 +120,3 @@ y: number;

_getCachedSceneCanvas(): any;
on<K extends keyof NodeEventMap>(evtStr: K, handler: KonvaEventListener<this, NodeEventMap[K]>): any;
on<K extends keyof NodeEventMap>(evtStr: K, handler: KonvaEventListener<this, NodeEventMap[K]>): void | this;
off(evtStr?: string, callback?: Function): this;

@@ -139,3 +139,3 @@ dispatchEvent(evt: any): this;

_isVisible(relativeTo?: Node): boolean;
shouldDrawHit(top?: Node, skipDragCheck?: boolean): boolean;
shouldDrawHit(top?: Node, skipDragCheck?: boolean): any;
show(): this;

@@ -155,3 +155,3 @@ hide(): this;

y: number;
};
} | null;
getAbsolutePosition(top?: Node): {

@@ -187,12 +187,12 @@ x: number;

toJSON(): string;
getParent(): Container<Node<NodeConfig>>;
findAncestors(selector: string, includeSelf?: boolean, stopNode?: Node): Node<NodeConfig>[];
getParent(): Container<Node<NodeConfig>> | null;
findAncestors(selector: string | Function, includeSelf?: boolean, stopNode?: Node): Node<NodeConfig>[];
isAncestorOf(node: Node): boolean;
findAncestor(selector?: string, includeSelf?: boolean, stopNode?: Container): any;
findAncestor(selector: string | Function, includeSelf?: boolean, stopNode?: Container): Node<NodeConfig>;
_isMatch(selector: string | Function): any;
getLayer(): Layer | null;
getStage(): Stage | null;
_getStage(): Stage | undefined;
_getStage(): Stage | null;
fire(eventType: string, evt?: any, bubble?: boolean): this;
getAbsoluteTransform(top?: Node): Transform;
getAbsoluteTransform(top?: Node | null): Transform;
_getAbsoluteTransform(top?: Node): Transform;

@@ -237,3 +237,3 @@ getAbsoluteScale(top?: Node): {

quality?: number;
callback?: (blob: Blob) => void;
callback?: (blob: Blob | null) => void;
}): Promise<unknown>;

@@ -292,3 +292,3 @@ setSize(size: any): this;

value: GetSet<number, this>;
dragBoundFunc: GetSet<(this: Node, pos: Vector2d) => Vector2d, this>;
dragBoundFunc: GetSet<(this: Node, pos: Vector2d, event: any) => Vector2d, this>;
draggable: GetSet<boolean, this>;

@@ -295,0 +295,0 @@ dragDistance: GetSet<number, this>;

@@ -106,3 +106,3 @@ "use strict";

skipTransform: true,
relativeTo: this.getParent(),
relativeTo: this.getParent() || undefined,
});

@@ -186,3 +186,3 @@ }

];
var minX, minY, maxX, maxY;
var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
var trans = this.getAbsoluteTransform(top);

@@ -487,4 +487,5 @@ points.forEach(function (point) {

}
if (that.nodeType !== UPPER_STAGE) {
addChildren(that.getStage().getChildren());
const stage = this.getStage();
if (that.nodeType !== UPPER_STAGE && stage) {
addChildren(stage.getChildren());
}

@@ -525,6 +526,7 @@ return index;

getRelativePointerPosition() {
if (!this.getStage()) {
const stage = this.getStage();
if (!stage) {
return null;
}
var pos = this.getStage().getPointerPosition();
var pos = stage.getPointerPosition();
if (!pos) {

@@ -556,7 +558,5 @@ return null;

setAbsolutePosition(pos) {
var origTrans = this._clearTransform();
this.attrs.x = origTrans.x;
this.attrs.y = origTrans.y;
delete origTrans.x;
delete origTrans.y;
const { x, y, ...origTrans } = this._clearTransform();
this.attrs.x = x;
this.attrs.y = y;
this._clearCache(TRANSFORM);

@@ -823,3 +823,3 @@ var it = this._getAbsoluteTransform().copy();

else {
return undefined;
return null;
}

@@ -1207,2 +1207,5 @@ }

var ap = this.getAbsolutePosition();
if (!stage) {
return;
}
var pos = stage._getPointerById(pointerId) ||

@@ -1209,0 +1212,0 @@ stage._changedPointerPositions[0] ||

@@ -7,3 +7,3 @@ import { KonvaEventObject } from './Node.js';

}
export declare function getCapturedShape(pointerId: number): Shape<import("./Shape.js").ShapeConfig> | Stage;
export declare function getCapturedShape(pointerId: number): Stage | Shape<import("./Shape.js").ShapeConfig> | undefined;
export declare function createEvent(evt: PointerEvent): KonvaPointerEvent;

@@ -10,0 +10,0 @@ export declare function hasPointerCapture(pointerId: number, shape: Shape | Stage): boolean;

@@ -91,9 +91,9 @@ import { Node, NodeConfig } from './Node.js';

_getFillPattern(): any;
__getFillPattern(): CanvasPattern;
__getFillPattern(): CanvasPattern | null | undefined;
_getLinearGradient(): any;
__getLinearGradient(): CanvasGradient;
__getLinearGradient(): CanvasGradient | undefined;
_getRadialGradient(): any;
__getRadialGradient(): CanvasGradient;
__getRadialGradient(): CanvasGradient | undefined;
getShadowRGBA(): any;
_getShadowRGBA(): string;
_getShadowRGBA(): string | undefined;
hasFill(): any;

@@ -114,4 +114,4 @@ hasStroke(): any;

getClientRect(config?: ShapeGetClientRectConfig): {
width: number;
height: number;
width: any;
height: any;
x: number;

@@ -118,0 +118,0 @@ y: number;

@@ -212,6 +212,10 @@ "use strict";

intersects(point) {
var stage = this.getStage(), bufferHitCanvas = stage.bufferHitCanvas, p;
var stage = this.getStage();
if (!stage) {
return false;
}
const bufferHitCanvas = stage.bufferHitCanvas;
bufferHitCanvas.getContext().clear();
this.drawHit(bufferHitCanvas, null, true);
p = bufferHitCanvas.context.getImageData(Math.round(point.x), Math.round(point.y), 1, 1).data;
this.drawHit(bufferHitCanvas, undefined, true);
const p = bufferHitCanvas.context.getImageData(Math.round(point.x), Math.round(point.y), 1, 1).data;
return p[3] > 0;

@@ -305,3 +309,4 @@ }

drawScene(can, top) {
var layer = this.getLayer(), canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferCanvas, bufferContext;
var layer = this.getLayer();
var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferCanvas, bufferContext;
var skipBuffer = canvas.isCache;

@@ -308,0 +313,0 @@ var cachingSelf = top === this;

@@ -7,3 +7,3 @@ import { Shape, ShapeConfig } from '../Shape.js';

export declare class Path extends Shape<PathConfig> {
dataArray: any[];
dataArray: PathSegment[];
pathLength: number;

@@ -14,4 +14,4 @@ constructor(config?: PathConfig);

getSelfRect(): {
x: any;
y: any;
x: number;
y: number;
width: number;

@@ -35,5 +35,5 @@ height: number;

};
static getPointOnEllipticalArc(cx: any, cy: any, rx: any, ry: any, theta: any, psi: any): {
x: any;
y: any;
static getPointOnEllipticalArc(cx: number, cy: number, rx: number, ry: number, theta: number, psi: number): {
x: number;
y: number;
};

@@ -40,0 +40,0 @@ static parsePathData(data: any): PathSegment[];

@@ -344,3 +344,3 @@ "use strict";

}
var cmd = null;
var cmd = '';
var points = [];

@@ -347,0 +347,0 @@ var startX = cpx, startY = cpy;

import { Shape, ShapeConfig } from '../Shape.js';
import { GetSet } from '../types.js';
import { GetSet, Vector2d } from '../types.js';
import { Context } from '../Context.js';

@@ -10,6 +10,6 @@ export interface RegularPolygonConfig extends ShapeConfig {

_sceneFunc(context: Context): void;
_getPoints(): any[];
_getPoints(): Vector2d[];
getSelfRect(): {
x: any;
y: any;
x: number;
y: number;
width: number;

@@ -16,0 +16,0 @@ height: number;

@@ -50,2 +50,3 @@ import { Context } from '../Context.js';

getStrokeScaleEnabled(): boolean;
_useBufferCanvas(): boolean;
fontFamily: GetSet<string, this>;

@@ -52,0 +53,0 @@ fontSize: GetSet<number, this>;

@@ -346,2 +346,11 @@ "use strict";

}
_useBufferCanvas() {
const hasLine = this.textDecoration().indexOf('underline') !== -1 ||
this.textDecoration().indexOf('line-through') !== -1;
const hasShadow = this.hasShadow();
if (hasLine && hasShadow) {
return true;
}
return super._useBufferCanvas();
}
}

@@ -348,0 +357,0 @@ exports.Text = Text;

import { Context } from '../Context.js';
import { Shape, ShapeConfig } from '../Shape.js';
import { GetSet, Vector2d } from '../types.js';
import { Text } from './Text.js';
import { GetSet, PathSegment, Vector2d } from '../types.js';
export interface TextPathConfig extends ShapeConfig {

@@ -14,3 +15,3 @@ text?: string;

dummyCanvas: HTMLCanvasElement;
dataArray: any[];
dataArray: PathSegment[];
glyphInfo: Array<{

@@ -36,4 +37,4 @@ transposeX: number;

getTextHeight(): number;
setText(text: string): any;
_getContextFont(): any;
setText(text: string): Text;
_getContextFont(): string;
_getTextSize(text: string): {

@@ -43,3 +44,3 @@ width: number;

};
_setTextData(): any;
_setTextData(): null | undefined;
getSelfRect(): {

@@ -46,0 +47,0 @@ x: number;

@@ -16,2 +16,3 @@ import { Transform } from '../Util.js';

rotateAnchorOffset?: number;
rotateAnchorCursor?: string;
borderEnabled?: boolean;

@@ -39,3 +40,3 @@ borderStroke?: string;

_nodes: Array<Node>;
_movingAnchorName: string;
_movingAnchorName: string | null;
_transforming: boolean;

@@ -54,3 +55,3 @@ _anchorDragOffset: Vector2d;

getNodes(): Node<import("../Node.js").NodeConfig>[];
getActiveAnchor(): string;
getActiveAnchor(): string | null;
detach(): void;

@@ -103,2 +104,3 @@ _resetTransformCache(): void;

rotationSnapTolerance: GetSet<number, this>;
rotateAnchorCursor: GetSet<string, this>;
padding: GetSet<number, this>;

@@ -105,0 +107,0 @@ borderEnabled: GetSet<boolean, this>;

@@ -58,5 +58,5 @@ "use strict";

const TOUCH_DEVICE = 'ontouchstart' in Global_1.Konva._global;
function getCursor(anchorName, rad) {
function getCursor(anchorName, rad, rotateCursor) {
if (anchorName === 'rotater') {
return 'crosshair';
return rotateCursor;
}

@@ -122,4 +122,8 @@ rad += Util_1.Util.degToRad(ANGLES[anchorName] || 0);

(shape.y - point.y) * Math.cos(angleRad);
return Object.assign(Object.assign({}, shape), { rotation: shape.rotation + angleRad, x,
y });
return {
...shape,
rotation: shape.rotation + angleRad,
x,
y,
};
}

@@ -145,2 +149,3 @@ function rotateAroundCenter(shape, deltaRad) {

super(config);
this._movingAnchorName = null;
this._transforming = false;

@@ -324,3 +329,3 @@ this._createElements();

tr.rotate(-Global_1.Konva.getAngle(this.rotation()));
var minX, minY, maxX, maxY;
var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
totalPoints.forEach(function (point) {

@@ -361,5 +366,5 @@ var transformed = tr.point(point);

this._createBack();
ANCHORS_NAMES.forEach(function (name) {
ANCHORS_NAMES.forEach((name) => {
this._createAnchor(name);
}.bind(this));
});
this._createAnchor('rotater');

@@ -390,3 +395,4 @@ }

var rad = Global_1.Konva.getAngle(this.rotation());
var cursor = getCursor(name, rad);
var rotateCursor = this.rotateAnchorCursor();
var cursor = getCursor(name, rad, rotateCursor);
anchor.getStage().content &&

@@ -409,12 +415,12 @@ (anchor.getStage().content.style.cursor = cursor);

draggable: true,
sceneFunc(ctx) {
var tr = this.getParent();
sceneFunc(ctx, shape) {
var tr = shape.getParent();
var padding = tr.padding();
ctx.beginPath();
ctx.rect(-padding, -padding, this.width() + padding * 2, this.height() + padding * 2);
ctx.moveTo(this.width() / 2, -padding);
ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);
ctx.moveTo(shape.width() / 2, -padding);
if (tr.rotateEnabled()) {
ctx.lineTo(this.width() / 2, -tr.rotateAnchorOffset() * Util_1.Util._sign(this.height()) - padding);
ctx.lineTo(shape.width() / 2, -tr.rotateAnchorOffset() * Util_1.Util._sign(shape.height()) - padding);
}
ctx.fillStrokeShape(this);
ctx.fillStrokeShape(shape);
},

@@ -973,2 +979,3 @@ hitFunc: (ctx, shape) => {

Factory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorOffset', 50, (0, Validators_1.getNumberValidator)());
Factory_1.Factory.addGetterSetter(Transformer, 'rotateAnchorCursor', 'crosshair');
Factory_1.Factory.addGetterSetter(Transformer, 'rotationSnapTolerance', 5, (0, Validators_1.getNumberValidator)());

@@ -975,0 +982,0 @@ Factory_1.Factory.addGetterSetter(Transformer, 'borderEnabled', true);

@@ -39,10 +39,10 @@ import { Container, ContainerConfig } from './Container.js';

clear(): this;
clone(obj?: any): any;
clone(obj?: any): this;
destroy(): this;
getPointerPosition(): Vector2d | null;
_getPointerById(id?: number): Vector2d & {
id?: number;
};
_getPointerById(id?: number): (Vector2d & {
id?: number | undefined;
}) | undefined;
getPointersPositions(): (Vector2d & {
id?: number;
id?: number | undefined;
})[];

@@ -52,7 +52,7 @@ getStage(): this;

_toKonvaCanvas(config: any): SceneCanvas;
getIntersection(pos: Vector2d): Shape<import("./Shape.js").ShapeConfig>;
getIntersection(pos: Vector2d): Shape<import("./Shape.js").ShapeConfig> | null;
_resizeDOM(): void;
add(layer: Layer, ...rest: any[]): this;
getParent(): any;
getLayer(): any;
getParent(): null;
getLayer(): null;
hasPointerCapture(pointerId: number): boolean;

@@ -63,5 +63,5 @@ setPointerCapture(pointerId: number): void;

_bindContentEvents(): void;
_pointerenter(evt: any): void;
_pointerenter(evt: PointerEvent): void;
_pointerover(evt: any): void;
_getTargetShape(evenType: any): Shape<import("./Shape.js").ShapeConfig>;
_getTargetShape(evenType: any): Shape<import("./Shape.js").ShapeConfig> | null;
_pointerleave(evt: any): void;

@@ -68,0 +68,0 @@ _pointerdown(evt: TouchEvent | MouseEvent | PointerEvent): void;

@@ -315,7 +315,9 @@ "use strict";

const events = getEventsMap(evt.type);
this._fire(events.pointerenter, {
evt: evt,
target: this,
currentTarget: this,
});
if (events) {
this._fire(events.pointerenter, {
evt: evt,
target: this,
currentTarget: this,
});
}
}

@@ -325,7 +327,9 @@ _pointerover(evt) {

const events = getEventsMap(evt.type);
this._fire(events.pointerover, {
evt: evt,
target: this,
currentTarget: this,
});
if (events) {
this._fire(events.pointerover, {
evt: evt,
target: this,
currentTarget: this,
});
}
}

@@ -370,3 +374,3 @@ _getTargetShape(evenType) {

}
this.pointerPos = undefined;
this.pointerPos = null;
this._pointerPositions = [];

@@ -386,4 +390,3 @@ }

Global_1.Konva['_' + eventType + 'ListenClick'] = true;
const hasShape = shape && shape.isListening();
if (!hasShape) {
if (!shape || !shape.isListening()) {
return;

@@ -438,4 +441,4 @@ }

if (differentTarget && targetShape) {
targetShape._fireAndBubble(events.pointerout, Object.assign({}, event), shape);
targetShape._fireAndBubble(events.pointerleave, Object.assign({}, event), shape);
targetShape._fireAndBubble(events.pointerout, { ...event }, shape);
targetShape._fireAndBubble(events.pointerleave, { ...event }, shape);
}

@@ -451,7 +454,7 @@ if (shape) {

if (differentTarget) {
shape._fireAndBubble(events.pointerover, Object.assign({}, event), targetShape);
shape._fireAndBubble(events.pointerenter, Object.assign({}, event), targetShape);
shape._fireAndBubble(events.pointerover, { ...event }, targetShape);
shape._fireAndBubble(events.pointerenter, { ...event }, targetShape);
this[eventType + 'targetShape'] = shape;
}
shape._fireAndBubble(events.pointermove, Object.assign({}, event));
shape._fireAndBubble(events.pointermove, { ...event });
}

@@ -517,9 +520,9 @@ else {

this[eventType + 'ClickEndShape'] = shape;
shape._fireAndBubble(events.pointerup, Object.assign({}, event));
shape._fireAndBubble(events.pointerup, { ...event });
if (Global_1.Konva['_' + eventType + 'ListenClick'] &&
clickStartShape &&
clickStartShape === shape) {
shape._fireAndBubble(events.pointerclick, Object.assign({}, event));
shape._fireAndBubble(events.pointerclick, { ...event });
if (fireDblClick && clickEndShape && clickEndShape === shape) {
shape._fireAndBubble(events.pointerdblclick, Object.assign({}, event));
shape._fireAndBubble(events.pointerdblclick, { ...event });
}

@@ -526,0 +529,0 @@ }

@@ -53,5 +53,5 @@ import { Animation } from './Animation.js';

_id: number;
onFinish: Function;
onReset: Function;
onUpdate: Function;
onFinish: Function | undefined;
onReset: Function | undefined;
onUpdate: Function | undefined;
constructor(config: TweenConfig);

@@ -58,0 +58,0 @@ _addAttr(key: any, end: any): void;

@@ -12,3 +12,3 @@ export interface GetSet<Type, This> {

start: Vector2d;
points: Vector2d[];
points: number[];
pathLength: number;

@@ -15,0 +15,0 @@ }

import { Context } from './Context.js';
import { IRect, RGB, RGBA, Vector2d } from './types.js';
import { IRect, RGB, Vector2d } from './types.js';
export declare class Transform {

@@ -55,16 +55,56 @@ m: Array<number>;

getRGB(color: string): RGB;
colorToRGBA(str: string): RGBA;
colorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_namedColorToRBA(str: string): {
r: any;
g: any;
b: any;
r: number;
g: number;
b: number;
a: number;
};
_rgbColorToRGBA(str: string): RGBA;
_rgbaColorToRGBA(str: string): RGBA;
_hex8ColorToRGBA(str: string): RGBA;
_hex6ColorToRGBA(str: string): RGBA;
_hex4ColorToRGBA(str: string): RGBA;
_hex3ColorToRGBA(str: string): RGBA;
_hslColorToRGBA(str: string): RGBA;
} | null;
_rgbColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_rgbaColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex8ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex6ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex4ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex3ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hslColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
haveIntersection(r1: IRect, r2: IRect): boolean;

@@ -77,3 +117,3 @@ cloneObject<Any>(obj: Any): Any;

_radToDeg(rad: number): number;
_getRotation(radians: any): any;
_getRotation(radians: number): number;
_capitalize(str: string): string;

@@ -83,7 +123,7 @@ throw(str: string): never;

warn(str: string): void;
each(obj: any, func: any): void;
_inRange(val: any, left: any, right: any): boolean;
each(obj: Object, func: Function): void;
_inRange(val: number, left: number, right: number): boolean;
_getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[];
_getProjectionToLine(pt: Vector2d, line: any, isClosed: any): Vector2d;
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): any[];
_getProjectionToLine(pt: Vector2d, line: Array<Vector2d>, isClosed: boolean): Vector2d;
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[];
_prepareToStringify(obj: any): any;

@@ -90,0 +130,0 @@ _assign<T, U>(target: T, source: U): T & U;

@@ -772,3 +772,3 @@ "use strict";

return;
canvases.forEach(c => {
canvases.forEach((c) => {
c.width = 0;

@@ -784,3 +784,7 @@ c.height = 0;

if (typeof cornerRadius === 'number') {
topLeft = topRight = bottomLeft = bottomRight = Math.min(cornerRadius, width / 2, height / 2);
topLeft =
topRight =
bottomLeft =
bottomRight =
Math.min(cornerRadius, width / 2, height / 2);
}

@@ -802,3 +806,3 @@ else {

context.arc(topLeft, topLeft, topLeft, Math.PI, (Math.PI * 3) / 2, false);
}
},
};
export declare function RGBComponent(val: number): number;
export declare function alphaComponent(val: number): number;
export declare function getNumberValidator(): <T>(val: T, attr: string) => void | T;
export declare function getNumberOrArrayOfNumbersValidator(noOfElements: number): <T>(val: T, attr: string) => void | T;
export declare function getNumberOrAutoValidator(): <T extends string>(val: T, attr: string) => void | T;
export declare function getStringValidator(): (val: any, attr: string) => any;
export declare function getStringOrGradientValidator(): (val: any, attr: string) => any;
export declare function getFunctionValidator(): (val: any, attr: string) => any;
export declare function getNumberArrayValidator(): (val: any, attr: string) => any;
export declare function getBooleanValidator(): (val: any, attr: string) => any;
export declare function getComponentValidator(components: any): (val: any, attr: string) => any;
export declare function getNumberValidator(): (<T>(val: T, attr: string) => void | T) | undefined;
export declare function getNumberOrArrayOfNumbersValidator(noOfElements: number): (<T>(val: T, attr: string) => void | T) | undefined;
export declare function getNumberOrAutoValidator(): (<T extends string>(val: T, attr: string) => void | T) | undefined;
export declare function getStringValidator(): ((val: any, attr: string) => any) | undefined;
export declare function getStringOrGradientValidator(): ((val: any, attr: string) => any) | undefined;
export declare function getFunctionValidator(): ((val: any, attr: string) => any) | undefined;
export declare function getNumberArrayValidator(): ((val: any, attr: string) => any) | undefined;
export declare function getBooleanValidator(): ((val: any, attr: string) => any) | undefined;
export declare function getComponentValidator(components: any): ((val: any, attr: string) => any) | undefined;
{
"name": "konva",
"version": "9.2.0",
"version": "9.2.1",
"author": "Anton Lavrenov",

@@ -62,7 +62,7 @@ "files": [

"devDependencies": {
"@parcel/transformer-image": "2.8.3",
"@size-limit/preset-big-lib": "^8.2.4",
"@parcel/transformer-image": "2.9.3",
"@size-limit/preset-big-lib": "^8.2.6",
"@types/mocha": "^10.0.1",
"canvas": "^2.11.2",
"chai": "4.3.7",
"chai": "4.3.8",
"filehound": "^1.17.6",

@@ -82,13 +82,13 @@ "gulp": "^4.0.2",

"mocha-headless-chrome": "^4.0.0",
"parcel": "2.8.3",
"parcel": "2.9.3",
"process": "^0.11.10",
"rollup": "^3.20.2",
"rollup": "^3.28.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.34.1",
"size-limit": "^8.2.4",
"rollup-plugin-typescript2": "^0.35.0",
"size-limit": "^8.2.6",
"ts-mocha": "^10.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
"typescript": "^5.2.2"
},

@@ -95,0 +95,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc