konva 10.0.2 → 10.0.4
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 -1
- package/konva.js +35 -9
- package/konva.min.js +4 -4
- package/lib/Container.d.ts +2 -2
- package/lib/DragAndDrop.d.ts +27 -1
- package/lib/Global.js +2 -2
- package/lib/Layer.d.ts +1 -1
- package/lib/Node.d.ts +135 -47
- package/lib/PointerEvents.d.ts +1 -1
- package/lib/Shape.d.ts +2 -2
- package/lib/Stage.d.ts +3 -3
- package/lib/Tween.d.ts +3 -0
- package/lib/Util.d.ts +1 -0
- package/lib/_CoreInternals.d.ts +28 -2
- package/lib/_FullInternals.d.ts +28 -2
- package/lib/shapes/Rect.d.ts +3 -3
- package/lib/shapes/TextPath.d.ts +7 -0
- package/lib/shapes/TextPath.js +24 -4
- package/lib/shapes/Transformer.d.ts +54 -2
- package/package.json +4 -3
package/README.md
CHANGED
package/konva.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
})(this, (function () { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
* Konva JavaScript Framework v10.0.
|
|
8
|
+
* Konva JavaScript Framework v10.0.4
|
|
9
9
|
* http://konvajs.org/
|
|
10
10
|
* Licensed under the MIT
|
|
11
|
-
* Date:
|
|
11
|
+
* Date: Tue Oct 21 2025
|
|
12
12
|
*
|
|
13
13
|
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
|
14
14
|
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
: {};
|
|
36
36
|
const Konva$2 = {
|
|
37
37
|
_global: glob,
|
|
38
|
-
version: '10.0.
|
|
38
|
+
version: '10.0.4',
|
|
39
39
|
isBrowser: detectBrowser(),
|
|
40
40
|
isUnminified: /param/.test(function (param) { }.toString()),
|
|
41
41
|
dblClickWindow: 400,
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
// it is required for npm packages
|
|
190
190
|
_injectGlobal(Konva) {
|
|
191
191
|
if (typeof glob.Konva !== 'undefined') {
|
|
192
|
-
console.error('
|
|
192
|
+
console.error('Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment.');
|
|
193
193
|
}
|
|
194
194
|
glob.Konva = Konva;
|
|
195
195
|
},
|
|
@@ -15642,7 +15642,9 @@ js: import "konva/skia-backend";
|
|
|
15642
15642
|
const fill = this.fill();
|
|
15643
15643
|
const fontSize = this.fontSize();
|
|
15644
15644
|
const glyphInfo = this.glyphInfo;
|
|
15645
|
-
|
|
15645
|
+
const hasUnderline = textDecoration.indexOf('underline') !== -1;
|
|
15646
|
+
const hasLineThrough = textDecoration.indexOf('line-through') !== -1;
|
|
15647
|
+
if (hasUnderline) {
|
|
15646
15648
|
context.beginPath();
|
|
15647
15649
|
}
|
|
15648
15650
|
for (let i = 0; i < glyphInfo.length; i++) {
|
|
@@ -15652,11 +15654,11 @@ js: import "konva/skia-backend";
|
|
|
15652
15654
|
context.rotate(glyphInfo[i].rotation);
|
|
15653
15655
|
this.partialText = glyphInfo[i].text;
|
|
15654
15656
|
context.fillStrokeShape(this);
|
|
15655
|
-
if (
|
|
15657
|
+
if (hasUnderline) {
|
|
15656
15658
|
if (i === 0) {
|
|
15657
15659
|
context.moveTo(0, fontSize / 2 + 1);
|
|
15658
15660
|
}
|
|
15659
|
-
context.lineTo(
|
|
15661
|
+
context.lineTo(glyphInfo[i].width, fontSize / 2 + 1);
|
|
15660
15662
|
}
|
|
15661
15663
|
context.restore();
|
|
15662
15664
|
//// To assist with debugging visually, uncomment following
|
|
@@ -15668,7 +15670,24 @@ js: import "konva/skia-backend";
|
|
|
15668
15670
|
// context.lineTo(p1.x, p1.y);
|
|
15669
15671
|
// context.stroke();
|
|
15670
15672
|
}
|
|
15671
|
-
if (
|
|
15673
|
+
if (hasUnderline) {
|
|
15674
|
+
context.strokeStyle = fill;
|
|
15675
|
+
context.lineWidth = fontSize / 20;
|
|
15676
|
+
context.stroke();
|
|
15677
|
+
}
|
|
15678
|
+
if (hasLineThrough) {
|
|
15679
|
+
context.beginPath();
|
|
15680
|
+
for (let i = 0; i < glyphInfo.length; i++) {
|
|
15681
|
+
context.save();
|
|
15682
|
+
const p0 = glyphInfo[i].p0;
|
|
15683
|
+
context.translate(p0.x, p0.y);
|
|
15684
|
+
context.rotate(glyphInfo[i].rotation);
|
|
15685
|
+
if (i === 0) {
|
|
15686
|
+
context.moveTo(0, 0);
|
|
15687
|
+
}
|
|
15688
|
+
context.lineTo(glyphInfo[i].width, 0);
|
|
15689
|
+
context.restore();
|
|
15690
|
+
}
|
|
15672
15691
|
context.strokeStyle = fill;
|
|
15673
15692
|
context.lineWidth = fontSize / 20;
|
|
15674
15693
|
context.stroke();
|
|
@@ -15793,6 +15812,7 @@ js: import "konva/skia-backend";
|
|
|
15793
15812
|
rotation: rotation,
|
|
15794
15813
|
p0: charStartPoint,
|
|
15795
15814
|
p1: charEndPoint,
|
|
15815
|
+
width: width,
|
|
15796
15816
|
});
|
|
15797
15817
|
offsetToGlyph += glyphWidth;
|
|
15798
15818
|
}
|
|
@@ -15979,7 +15999,7 @@ js: import "konva/skia-backend";
|
|
|
15979
15999
|
*/
|
|
15980
16000
|
Factory.addGetterSetter(TextPath, 'text', EMPTY_STRING);
|
|
15981
16001
|
/**
|
|
15982
|
-
* get/set text decoration of a text. Can be '' or 'underline'.
|
|
16002
|
+
* get/set text decoration of a text. Can be '', 'underline', 'line-through', or a combination like 'underline line-through'.
|
|
15983
16003
|
* @name Konva.TextPath#textDecoration
|
|
15984
16004
|
* @method
|
|
15985
16005
|
* @param {String} textDecoration
|
|
@@ -15990,6 +16010,12 @@ js: import "konva/skia-backend";
|
|
|
15990
16010
|
*
|
|
15991
16011
|
* // underline text
|
|
15992
16012
|
* shape.textDecoration('underline');
|
|
16013
|
+
*
|
|
16014
|
+
* // line-through text
|
|
16015
|
+
* shape.textDecoration('line-through');
|
|
16016
|
+
*
|
|
16017
|
+
* // combine both
|
|
16018
|
+
* shape.textDecoration('underline line-through');
|
|
15993
16019
|
*/
|
|
15994
16020
|
Factory.addGetterSetter(TextPath, 'textDecoration', '');
|
|
15995
16021
|
/**
|