konva 10.0.8 → 10.0.10

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.
Files changed (127) hide show
  1. package/konva.js +95 -48
  2. package/konva.min.js +4 -4
  3. package/package.json +1 -1
  4. package/lib/Animation.d.ts +0 -24
  5. package/lib/Animation.js +0 -142
  6. package/lib/BezierFunctions.d.ts +0 -6
  7. package/lib/BezierFunctions.js +0 -784
  8. package/lib/Canvas.d.ts +0 -33
  9. package/lib/Canvas.js +0 -137
  10. package/lib/Container.d.ts +0 -54
  11. package/lib/Container.js +0 -316
  12. package/lib/Context.d.ts +0 -95
  13. package/lib/Context.js +0 -561
  14. package/lib/Core.d.ts +0 -3
  15. package/lib/Core.js +0 -3
  16. package/lib/DragAndDrop.d.ts +0 -17
  17. package/lib/DragAndDrop.js +0 -110
  18. package/lib/Factory.d.ts +0 -22
  19. package/lib/Factory.js +0 -123
  20. package/lib/FastLayer.d.ts +0 -4
  21. package/lib/FastLayer.js +0 -12
  22. package/lib/Global.d.ts +0 -37
  23. package/lib/Global.js +0 -66
  24. package/lib/Group.d.ts +0 -9
  25. package/lib/Group.js +0 -13
  26. package/lib/Layer.d.ts +0 -62
  27. package/lib/Layer.js +0 -305
  28. package/lib/Node.d.ts +0 -323
  29. package/lib/Node.js +0 -1532
  30. package/lib/PointerEvents.d.ts +0 -11
  31. package/lib/PointerEvents.js +0 -37
  32. package/lib/Shape.d.ts +0 -196
  33. package/lib/Shape.js +0 -548
  34. package/lib/Stage.d.ts +0 -86
  35. package/lib/Stage.js +0 -715
  36. package/lib/Tween.d.ts +0 -90
  37. package/lib/Tween.js +0 -531
  38. package/lib/Util.d.ts +0 -133
  39. package/lib/Util.js +0 -866
  40. package/lib/Validators.d.ts +0 -11
  41. package/lib/Validators.js +0 -178
  42. package/lib/_CoreInternals.d.ts +0 -220
  43. package/lib/_CoreInternals.js +0 -34
  44. package/lib/_FullInternals.d.ts +0 -302
  45. package/lib/_FullInternals.js +0 -80
  46. package/lib/canvas-backend.d.ts +0 -2
  47. package/lib/canvas-backend.js +0 -27
  48. package/lib/filters/Blur.d.ts +0 -2
  49. package/lib/filters/Blur.js +0 -235
  50. package/lib/filters/Brighten.d.ts +0 -2
  51. package/lib/filters/Brighten.js +0 -12
  52. package/lib/filters/Brightness.d.ts +0 -2
  53. package/lib/filters/Brightness.js +0 -8
  54. package/lib/filters/Contrast.d.ts +0 -2
  55. package/lib/filters/Contrast.js +0 -35
  56. package/lib/filters/Emboss.d.ts +0 -2
  57. package/lib/filters/Emboss.js +0 -101
  58. package/lib/filters/Enhance.d.ts +0 -2
  59. package/lib/filters/Enhance.js +0 -84
  60. package/lib/filters/Grayscale.d.ts +0 -2
  61. package/lib/filters/Grayscale.js +0 -9
  62. package/lib/filters/HSL.d.ts +0 -2
  63. package/lib/filters/HSL.js +0 -24
  64. package/lib/filters/HSV.d.ts +0 -2
  65. package/lib/filters/HSV.js +0 -23
  66. package/lib/filters/Invert.d.ts +0 -2
  67. package/lib/filters/Invert.js +0 -8
  68. package/lib/filters/Kaleidoscope.d.ts +0 -2
  69. package/lib/filters/Kaleidoscope.js +0 -133
  70. package/lib/filters/Mask.d.ts +0 -2
  71. package/lib/filters/Mask.js +0 -151
  72. package/lib/filters/Noise.d.ts +0 -2
  73. package/lib/filters/Noise.js +0 -12
  74. package/lib/filters/Pixelate.d.ts +0 -2
  75. package/lib/filters/Pixelate.js +0 -60
  76. package/lib/filters/Posterize.d.ts +0 -2
  77. package/lib/filters/Posterize.js +0 -10
  78. package/lib/filters/RGB.d.ts +0 -2
  79. package/lib/filters/RGB.js +0 -38
  80. package/lib/filters/RGBA.d.ts +0 -2
  81. package/lib/filters/RGBA.js +0 -49
  82. package/lib/filters/Sepia.d.ts +0 -2
  83. package/lib/filters/Sepia.js +0 -11
  84. package/lib/filters/Solarize.d.ts +0 -2
  85. package/lib/filters/Solarize.js +0 -14
  86. package/lib/filters/Threshold.d.ts +0 -2
  87. package/lib/filters/Threshold.js +0 -10
  88. package/lib/index.d.ts +0 -2
  89. package/lib/index.js +0 -2
  90. package/lib/shapes/Arc.d.ts +0 -27
  91. package/lib/shapes/Arc.js +0 -60
  92. package/lib/shapes/Arrow.d.ts +0 -27
  93. package/lib/shapes/Arrow.js +0 -99
  94. package/lib/shapes/Circle.d.ts +0 -15
  95. package/lib/shapes/Circle.js +0 -33
  96. package/lib/shapes/Ellipse.d.ts +0 -18
  97. package/lib/shapes/Ellipse.js +0 -37
  98. package/lib/shapes/Image.d.ts +0 -29
  99. package/lib/shapes/Image.js +0 -131
  100. package/lib/shapes/Label.d.ts +0 -39
  101. package/lib/shapes/Label.js +0 -173
  102. package/lib/shapes/Line.d.ts +0 -29
  103. package/lib/shapes/Line.js +0 -156
  104. package/lib/shapes/Path.d.ts +0 -50
  105. package/lib/shapes/Path.js +0 -670
  106. package/lib/shapes/Rect.d.ts +0 -11
  107. package/lib/shapes/Rect.js +0 -22
  108. package/lib/shapes/RegularPolygon.d.ts +0 -26
  109. package/lib/shapes/RegularPolygon.js +0 -72
  110. package/lib/shapes/Ring.d.ts +0 -17
  111. package/lib/shapes/Ring.js +0 -33
  112. package/lib/shapes/Sprite.d.ts +0 -32
  113. package/lib/shapes/Sprite.js +0 -108
  114. package/lib/shapes/Star.d.ts +0 -19
  115. package/lib/shapes/Star.js +0 -38
  116. package/lib/shapes/Text.d.ts +0 -90
  117. package/lib/shapes/Text.js +0 -460
  118. package/lib/shapes/TextPath.d.ts +0 -72
  119. package/lib/shapes/TextPath.js +0 -268
  120. package/lib/shapes/Transformer.d.ts +0 -130
  121. package/lib/shapes/Transformer.js +0 -1009
  122. package/lib/shapes/Wedge.d.ts +0 -19
  123. package/lib/shapes/Wedge.js +0 -38
  124. package/lib/skia-backend.d.ts +0 -2
  125. package/lib/skia-backend.js +0 -24
  126. package/lib/types.d.ts +0 -56
  127. package/lib/types.js +0 -21
@@ -1,19 +0,0 @@
1
- import type { Context } from '../Context.ts';
2
- import type { ShapeConfig } from '../Shape.ts';
3
- import { Shape } from '../Shape.ts';
4
- import type { GetSet } from '../types.ts';
5
- export interface WedgeConfig extends ShapeConfig {
6
- angle: number;
7
- radius: number;
8
- clockwise?: boolean;
9
- }
10
- export declare class Wedge extends Shape<WedgeConfig> {
11
- _sceneFunc(context: Context): void;
12
- getWidth(): number;
13
- getHeight(): number;
14
- setWidth(width: number): void;
15
- setHeight(height: number): void;
16
- radius: GetSet<number, this>;
17
- angle: GetSet<number, this>;
18
- clockwise: GetSet<boolean, this>;
19
- }
@@ -1,38 +0,0 @@
1
- import { Factory } from "../Factory.js";
2
- import { Shape } from "../Shape.js";
3
- import { Konva } from "../Global.js";
4
- import { getNumberValidator } from "../Validators.js";
5
- import { _registerNode } from "../Global.js";
6
- export class Wedge extends Shape {
7
- _sceneFunc(context) {
8
- context.beginPath();
9
- context.arc(0, 0, this.radius(), 0, Konva.getAngle(this.angle()), this.clockwise());
10
- context.lineTo(0, 0);
11
- context.closePath();
12
- context.fillStrokeShape(this);
13
- }
14
- getWidth() {
15
- return this.radius() * 2;
16
- }
17
- getHeight() {
18
- return this.radius() * 2;
19
- }
20
- setWidth(width) {
21
- this.radius(width / 2);
22
- }
23
- setHeight(height) {
24
- this.radius(height / 2);
25
- }
26
- }
27
- Wedge.prototype.className = 'Wedge';
28
- Wedge.prototype._centroid = true;
29
- Wedge.prototype._attrsAffectingSize = ['radius'];
30
- _registerNode(Wedge);
31
- Factory.addGetterSetter(Wedge, 'radius', 0, getNumberValidator());
32
- Factory.addGetterSetter(Wedge, 'angle', 0, getNumberValidator());
33
- Factory.addGetterSetter(Wedge, 'clockwise', false);
34
- Factory.backCompat(Wedge, {
35
- angleDeg: 'angle',
36
- getAngleDeg: 'getAngle',
37
- setAngleDeg: 'setAngle',
38
- });
@@ -1,2 +0,0 @@
1
- import { Konva } from './_CoreInternals.ts';
2
- export default Konva;
@@ -1,24 +0,0 @@
1
- import { Konva } from "./_CoreInternals.js";
2
- import { Canvas, DOMMatrix, Image, Path2D } from 'skia-canvas';
3
- global.DOMMatrix = DOMMatrix;
4
- global.Path2D = Path2D;
5
- Path2D.prototype.toString = () => '[object Path2D]';
6
- Konva.Util['createCanvasElement'] = () => {
7
- const node = new Canvas(300, 300);
8
- if (!node['style']) {
9
- node['style'] = {};
10
- }
11
- node.toString = () => '[object HTMLCanvasElement]';
12
- const ctx = node.getContext('2d');
13
- Object.defineProperty(ctx, 'canvas', {
14
- get: () => node,
15
- });
16
- return node;
17
- };
18
- Konva.Util.createImageElement = () => {
19
- const node = new Image();
20
- node.toString = () => '[object HTMLImageElement]';
21
- return node;
22
- };
23
- Konva._renderBackend = 'skia-canvas';
24
- export default Konva;
package/lib/types.d.ts DELETED
@@ -1,56 +0,0 @@
1
- export interface GetSet<Type, This> {
2
- (): Type;
3
- (v: Type | null | undefined): This;
4
- }
5
- export interface Vector2d {
6
- x: number;
7
- y: number;
8
- }
9
- export interface PathSegment {
10
- command: 'm' | 'M' | 'l' | 'L' | 'v' | 'V' | 'h' | 'H' | 'z' | 'Z' | 'c' | 'C' | 'q' | 'Q' | 't' | 'T' | 's' | 'S' | 'a' | 'A';
11
- start: Vector2d;
12
- points: number[];
13
- pathLength: number;
14
- }
15
- export interface IRect {
16
- x: number;
17
- y: number;
18
- width: number;
19
- height: number;
20
- }
21
- export interface IFrame {
22
- time: number;
23
- timeDiff: number;
24
- lastTime: number;
25
- frameRate: number;
26
- }
27
- export type AnimationFn = (frame: IFrame) => boolean | void;
28
- export declare const KonvaNodeEvent: {
29
- readonly mouseover: "mouseover";
30
- readonly mouseout: "mouseout";
31
- readonly mousemove: "mousemove";
32
- readonly mouseleave: "mouseleave";
33
- readonly mouseenter: "mouseenter";
34
- readonly mousedown: "mousedown";
35
- readonly mouseup: "mouseup";
36
- readonly wheel: "wheel";
37
- readonly contextmenu: "contextmenu";
38
- readonly click: "click";
39
- readonly dblclick: "dblclick";
40
- readonly touchstart: "touchstart";
41
- readonly touchmove: "touchmove";
42
- readonly touchend: "touchend";
43
- readonly tap: "tap";
44
- readonly dbltap: "dbltap";
45
- readonly dragstart: "dragstart";
46
- readonly dragmove: "dragmove";
47
- readonly dragend: "dragend";
48
- };
49
- export interface RGB {
50
- r: number;
51
- g: number;
52
- b: number;
53
- }
54
- export interface RGBA extends RGB {
55
- a: number;
56
- }
package/lib/types.js DELETED
@@ -1,21 +0,0 @@
1
- export const KonvaNodeEvent = {
2
- mouseover: 'mouseover',
3
- mouseout: 'mouseout',
4
- mousemove: 'mousemove',
5
- mouseleave: 'mouseleave',
6
- mouseenter: 'mouseenter',
7
- mousedown: 'mousedown',
8
- mouseup: 'mouseup',
9
- wheel: 'wheel',
10
- contextmenu: 'contextmenu',
11
- click: 'click',
12
- dblclick: 'dblclick',
13
- touchstart: 'touchstart',
14
- touchmove: 'touchmove',
15
- touchend: 'touchend',
16
- tap: 'tap',
17
- dbltap: 'dbltap',
18
- dragstart: 'dragstart',
19
- dragmove: 'dragmove',
20
- dragend: 'dragend',
21
- };