Comparing version
@@ -19,3 +19,3 @@ "use strict"; | ||
_global: exports.glob, | ||
version: '9.3.14', | ||
version: '9.3.15', | ||
isBrowser: detectBrowser(), | ||
@@ -22,0 +22,0 @@ isUnminified: /param/.test(function (param) { }.toString()), |
@@ -42,3 +42,3 @@ import { Transform } from './Util.js'; | ||
}; | ||
export interface KonvaEventObject<EventType> { | ||
export interface KonvaEventObject<EventType, This = Node> { | ||
type: string; | ||
@@ -48,7 +48,7 @@ target: Shape | Stage; | ||
pointerId: number; | ||
currentTarget: Node; | ||
currentTarget: This; | ||
cancelBubble: boolean; | ||
child?: Node; | ||
} | ||
export type KonvaEventListener<This, EventType> = (this: This, ev: KonvaEventObject<EventType>) => void; | ||
export type KonvaEventListener<This, EventType> = (this: This, ev: KonvaEventObject<EventType, This>) => void; | ||
export declare abstract class Node<Config extends NodeConfig = NodeConfig> { | ||
@@ -55,0 +55,0 @@ _id: number; |
@@ -20,4 +20,4 @@ import { Shape, ShapeConfig } from '../Shape.js'; | ||
getPointAtLength(length: any): { | ||
x: any; | ||
y: any; | ||
x: number; | ||
y: number; | ||
} | null; | ||
@@ -27,9 +27,9 @@ data: GetSet<string, this>; | ||
static getPathLength(dataArray: PathSegment[]): number; | ||
static getPointAtLengthOfDataArray(length: number, dataArray: any): { | ||
x: any; | ||
y: any; | ||
static getPointAtLengthOfDataArray(length: number, dataArray: PathSegment[]): { | ||
x: number; | ||
y: number; | ||
} | null; | ||
static getPointOnLine(dist: any, P1x: any, P1y: any, P2x: any, P2y: any, fromX?: any, fromY?: any): { | ||
x: any; | ||
y: any; | ||
static getPointOnLine(dist: number, P1x: number, P1y: number, P2x: number, P2y: number, fromX?: number, fromY?: number): { | ||
x: number; | ||
y: number; | ||
}; | ||
@@ -36,0 +36,0 @@ static getPointOnCubicBezier(pct: any, P1x: any, P1y: any, P2x: any, P2y: any, P3x: any, P3y: any, P4x: any, P4y: any): { |
@@ -143,3 +143,3 @@ "use strict"; | ||
static getPointAtLengthOfDataArray(length, dataArray) { | ||
var point, i = 0, ii = dataArray.length; | ||
var points, i = 0, ii = dataArray.length; | ||
if (!ii) { | ||
@@ -153,13 +153,13 @@ return null; | ||
if (i === ii) { | ||
point = dataArray[i - 1].points.slice(-2); | ||
points = dataArray[i - 1].points.slice(-2); | ||
return { | ||
x: point[0], | ||
y: point[1], | ||
x: points[0], | ||
y: points[1], | ||
}; | ||
} | ||
if (length < 0.01) { | ||
point = dataArray[i].points.slice(0, 2); | ||
points = dataArray[i].points.slice(0, 2); | ||
return { | ||
x: point[0], | ||
y: point[1], | ||
x: points[0], | ||
y: points[1], | ||
}; | ||
@@ -166,0 +166,0 @@ } |
@@ -40,15 +40,15 @@ import { Context } from '../Context.js'; | ||
getTextHeight(): number; | ||
measureSize(text: any): { | ||
actualBoundingBoxAscent: any; | ||
actualBoundingBoxDescent: any; | ||
actualBoundingBoxLeft: any; | ||
actualBoundingBoxRight: any; | ||
alphabeticBaseline: any; | ||
emHeightAscent: any; | ||
emHeightDescent: any; | ||
fontBoundingBoxAscent: any; | ||
fontBoundingBoxDescent: any; | ||
hangingBaseline: any; | ||
ideographicBaseline: any; | ||
width: any; | ||
measureSize(text: string): { | ||
actualBoundingBoxAscent: number; | ||
actualBoundingBoxDescent: number; | ||
actualBoundingBoxLeft: number; | ||
actualBoundingBoxRight: number; | ||
alphabeticBaseline: number; | ||
emHeightAscent: number; | ||
emHeightDescent: number; | ||
fontBoundingBoxAscent: number; | ||
fontBoundingBoxDescent: number; | ||
hangingBaseline: number; | ||
ideographicBaseline: number; | ||
width: number; | ||
height: number; | ||
@@ -55,0 +55,0 @@ }; |
@@ -11,3 +11,17 @@ "use strict"; | ||
function stringToArray(string) { | ||
return Array.from(string); | ||
return [...string].reduce((acc, char, index, array) => { | ||
if (/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?(?:\u200D\p{Emoji_Presentation})+/u.test(char)) { | ||
acc.push(char); | ||
} | ||
else if (/\p{Regional_Indicator}{2}/u.test(char + (array[index + 1] || ''))) { | ||
acc.push(char + array[index + 1]); | ||
} | ||
else if (index > 0 && /\p{Mn}|\p{Me}|\p{Mc}/u.test(char)) { | ||
acc[acc.length - 1] += char; | ||
} | ||
else { | ||
acc.push(char); | ||
} | ||
return acc; | ||
}, []); | ||
} | ||
@@ -14,0 +28,0 @@ exports.stringToArray = stringToArray; |
@@ -31,4 +31,4 @@ import { Context } from '../Context.js'; | ||
_getPointAtLength(length: number): { | ||
x: any; | ||
y: any; | ||
x: number; | ||
y: number; | ||
} | null; | ||
@@ -35,0 +35,0 @@ _readDataAttribute(): void; |
@@ -7,3 +7,3 @@ import { Container, ContainerConfig } from './Container.js'; | ||
export interface StageConfig extends ContainerConfig { | ||
container: HTMLDivElement | string; | ||
container?: HTMLDivElement | string; | ||
} | ||
@@ -10,0 +10,0 @@ export declare const stages: Stage[]; |
{ | ||
"name": "konva", | ||
"version": "9.3.14", | ||
"version": "9.3.15", | ||
"author": "Anton Lavrenov", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1409772
0.1%32724
0.09%