konva 10.0.2 → 10.0.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/README.md +1 -1
- package/konva.js +37 -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 +26 -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.3
|
|
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.3',
|
|
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,12 @@ 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
|
-
|
|
15661
|
+
console.log('underline log');
|
|
15662
|
+
context.lineTo(glyphInfo[i].width, fontSize / 2 + 1);
|
|
15660
15663
|
}
|
|
15661
15664
|
context.restore();
|
|
15662
15665
|
//// To assist with debugging visually, uncomment following
|
|
@@ -15668,7 +15671,25 @@ js: import "konva/skia-backend";
|
|
|
15668
15671
|
// context.lineTo(p1.x, p1.y);
|
|
15669
15672
|
// context.stroke();
|
|
15670
15673
|
}
|
|
15671
|
-
if (
|
|
15674
|
+
if (hasUnderline) {
|
|
15675
|
+
context.strokeStyle = fill;
|
|
15676
|
+
context.lineWidth = fontSize / 20;
|
|
15677
|
+
console.log('underline log');
|
|
15678
|
+
context.stroke();
|
|
15679
|
+
}
|
|
15680
|
+
if (hasLineThrough) {
|
|
15681
|
+
context.beginPath();
|
|
15682
|
+
for (let i = 0; i < glyphInfo.length; i++) {
|
|
15683
|
+
context.save();
|
|
15684
|
+
const p0 = glyphInfo[i].p0;
|
|
15685
|
+
context.translate(p0.x, p0.y);
|
|
15686
|
+
context.rotate(glyphInfo[i].rotation);
|
|
15687
|
+
if (i === 0) {
|
|
15688
|
+
context.moveTo(0, 0);
|
|
15689
|
+
}
|
|
15690
|
+
context.lineTo(glyphInfo[i].width, 0);
|
|
15691
|
+
context.restore();
|
|
15692
|
+
}
|
|
15672
15693
|
context.strokeStyle = fill;
|
|
15673
15694
|
context.lineWidth = fontSize / 20;
|
|
15674
15695
|
context.stroke();
|
|
@@ -15793,6 +15814,7 @@ js: import "konva/skia-backend";
|
|
|
15793
15814
|
rotation: rotation,
|
|
15794
15815
|
p0: charStartPoint,
|
|
15795
15816
|
p1: charEndPoint,
|
|
15817
|
+
width: width,
|
|
15796
15818
|
});
|
|
15797
15819
|
offsetToGlyph += glyphWidth;
|
|
15798
15820
|
}
|
|
@@ -15979,7 +16001,7 @@ js: import "konva/skia-backend";
|
|
|
15979
16001
|
*/
|
|
15980
16002
|
Factory.addGetterSetter(TextPath, 'text', EMPTY_STRING);
|
|
15981
16003
|
/**
|
|
15982
|
-
* get/set text decoration of a text. Can be '' or 'underline'.
|
|
16004
|
+
* get/set text decoration of a text. Can be '', 'underline', 'line-through', or a combination like 'underline line-through'.
|
|
15983
16005
|
* @name Konva.TextPath#textDecoration
|
|
15984
16006
|
* @method
|
|
15985
16007
|
* @param {String} textDecoration
|
|
@@ -15990,6 +16012,12 @@ js: import "konva/skia-backend";
|
|
|
15990
16012
|
*
|
|
15991
16013
|
* // underline text
|
|
15992
16014
|
* shape.textDecoration('underline');
|
|
16015
|
+
*
|
|
16016
|
+
* // line-through text
|
|
16017
|
+
* shape.textDecoration('line-through');
|
|
16018
|
+
*
|
|
16019
|
+
* // combine both
|
|
16020
|
+
* shape.textDecoration('underline line-through');
|
|
15993
16021
|
*/
|
|
15994
16022
|
Factory.addGetterSetter(TextPath, 'textDecoration', '');
|
|
15995
16023
|
/**
|