konva 8.4.2 → 9.0.0

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 (242) hide show
  1. package/README.md +1 -9
  2. package/konva.js +17669 -16968
  3. package/konva.min.js +3 -3
  4. package/lib/Animation.d.ts +2 -2
  5. package/lib/Animation.js +11 -7
  6. package/lib/BezierFunctions.d.ts +6 -0
  7. package/lib/BezierFunctions.js +791 -0
  8. package/lib/Canvas.d.ts +2 -1
  9. package/lib/Canvas.js +26 -18
  10. package/lib/Container.d.ts +4 -4
  11. package/lib/Container.js +16 -12
  12. package/lib/Context.d.ts +16 -13
  13. package/lib/Context.js +27 -19
  14. package/lib/Core.d.ts +2 -2
  15. package/lib/Core.js +7 -3
  16. package/lib/DragAndDrop.d.ts +3 -3
  17. package/lib/DragAndDrop.js +25 -22
  18. package/lib/Factory.js +27 -24
  19. package/lib/FastLayer.d.ts +1 -1
  20. package/lib/FastLayer.js +10 -6
  21. package/lib/Global.js +16 -12
  22. package/lib/Group.d.ts +3 -3
  23. package/lib/Group.js +10 -6
  24. package/lib/Layer.d.ts +9 -9
  25. package/lib/Layer.js +37 -33
  26. package/lib/Node.d.ts +8 -8
  27. package/lib/Node.js +95 -90
  28. package/lib/PointerEvents.d.ts +4 -4
  29. package/lib/PointerEvents.js +15 -7
  30. package/lib/Shape.d.ts +6 -4
  31. package/lib/Shape.js +90 -86
  32. package/lib/Stage.d.ts +7 -7
  33. package/lib/Stage.js +51 -47
  34. package/lib/Tween.d.ts +2 -2
  35. package/lib/Tween.js +26 -22
  36. package/lib/Util.d.ts +2 -2
  37. package/lib/Util.js +29 -25
  38. package/lib/Validators.js +58 -44
  39. package/lib/_CoreInternals.d.ts +29 -29
  40. package/lib/_CoreInternals.js +36 -33
  41. package/lib/_FullInternals.d.ts +67 -67
  42. package/lib/_FullInternals.js +78 -75
  43. package/lib/filters/Blur.d.ts +1 -1
  44. package/lib/filters/Blur.js +9 -5
  45. package/lib/filters/Brighten.d.ts +1 -1
  46. package/lib/filters/Brighten.js +9 -5
  47. package/lib/filters/Contrast.d.ts +1 -1
  48. package/lib/filters/Contrast.js +9 -5
  49. package/lib/filters/Emboss.d.ts +1 -1
  50. package/lib/filters/Emboss.js +14 -10
  51. package/lib/filters/Enhance.d.ts +1 -1
  52. package/lib/filters/Enhance.js +9 -5
  53. package/lib/filters/Grayscale.d.ts +1 -1
  54. package/lib/filters/Grayscale.js +5 -1
  55. package/lib/filters/HSL.d.ts +1 -1
  56. package/lib/filters/HSL.js +11 -7
  57. package/lib/filters/HSV.d.ts +1 -1
  58. package/lib/filters/HSV.js +11 -7
  59. package/lib/filters/Invert.d.ts +1 -1
  60. package/lib/filters/Invert.js +5 -1
  61. package/lib/filters/Kaleidoscope.d.ts +1 -1
  62. package/lib/filters/Kaleidoscope.js +13 -9
  63. package/lib/filters/Mask.d.ts +1 -1
  64. package/lib/filters/Mask.js +9 -5
  65. package/lib/filters/Noise.d.ts +1 -1
  66. package/lib/filters/Noise.js +9 -5
  67. package/lib/filters/Pixelate.d.ts +1 -1
  68. package/lib/filters/Pixelate.js +11 -7
  69. package/lib/filters/Posterize.d.ts +1 -1
  70. package/lib/filters/Posterize.js +9 -5
  71. package/lib/filters/RGB.d.ts +1 -1
  72. package/lib/filters/RGB.js +11 -7
  73. package/lib/filters/RGBA.d.ts +1 -1
  74. package/lib/filters/RGBA.js +12 -8
  75. package/lib/filters/Sepia.d.ts +1 -1
  76. package/lib/filters/Sepia.js +5 -1
  77. package/lib/filters/Solarize.d.ts +1 -1
  78. package/lib/filters/Solarize.js +5 -1
  79. package/lib/filters/Threshold.d.ts +1 -1
  80. package/lib/filters/Threshold.js +9 -5
  81. package/lib/index-node.d.ts +1 -1
  82. package/lib/index-node.js +7 -5
  83. package/lib/index-types.d.ts +124 -124
  84. package/lib/index.d.ts +1 -1
  85. package/lib/index.js +4 -2
  86. package/lib/shapes/Arc.d.ts +6 -5
  87. package/lib/shapes/Arc.js +17 -13
  88. package/lib/shapes/Arrow.d.ts +5 -4
  89. package/lib/shapes/Arrow.js +17 -13
  90. package/lib/shapes/Circle.d.ts +6 -5
  91. package/lib/shapes/Circle.js +11 -7
  92. package/lib/shapes/Ellipse.d.ts +6 -5
  93. package/lib/shapes/Ellipse.js +13 -9
  94. package/lib/shapes/Image.d.ts +5 -5
  95. package/lib/shapes/Image.js +21 -17
  96. package/lib/shapes/Label.d.ts +8 -7
  97. package/lib/shapes/Label.js +18 -13
  98. package/lib/shapes/Line.d.ts +3 -3
  99. package/lib/shapes/Line.js +14 -10
  100. package/lib/shapes/Path.d.ts +6 -3
  101. package/lib/shapes/Path.js +44 -43
  102. package/lib/shapes/Rect.d.ts +3 -3
  103. package/lib/shapes/Rect.js +13 -9
  104. package/lib/shapes/RegularPolygon.d.ts +6 -5
  105. package/lib/shapes/RegularPolygon.js +12 -8
  106. package/lib/shapes/Ring.d.ts +6 -5
  107. package/lib/shapes/Ring.js +12 -8
  108. package/lib/shapes/Sprite.d.ts +7 -6
  109. package/lib/shapes/Sprite.js +19 -15
  110. package/lib/shapes/Star.d.ts +6 -5
  111. package/lib/shapes/Star.js +13 -9
  112. package/lib/shapes/Text.d.ts +8 -7
  113. package/lib/shapes/Text.js +31 -26
  114. package/lib/shapes/TextPath.d.ts +12 -7
  115. package/lib/shapes/TextPath.js +82 -188
  116. package/lib/shapes/Transformer.d.ts +10 -10
  117. package/lib/shapes/Transformer.js +92 -81
  118. package/lib/shapes/Wedge.d.ts +6 -5
  119. package/lib/shapes/Wedge.js +16 -12
  120. package/lib/types.d.ts +6 -0
  121. package/lib/types.js +5 -2
  122. package/package.json +13 -42
  123. package/cmj/Animation.d.ts +0 -24
  124. package/cmj/Animation.js +0 -145
  125. package/cmj/Canvas.d.ts +0 -32
  126. package/cmj/Canvas.js +0 -114
  127. package/cmj/Container.d.ts +0 -47
  128. package/cmj/Container.js +0 -325
  129. package/cmj/Context.d.ts +0 -84
  130. package/cmj/Context.js +0 -538
  131. package/cmj/Core.d.ts +0 -3
  132. package/cmj/Core.js +0 -7
  133. package/cmj/DragAndDrop.d.ts +0 -17
  134. package/cmj/DragAndDrop.js +0 -111
  135. package/cmj/Factory.d.ts +0 -11
  136. package/cmj/Factory.js +0 -125
  137. package/cmj/FastLayer.d.ts +0 -4
  138. package/cmj/FastLayer.js +0 -16
  139. package/cmj/Global.d.ts +0 -34
  140. package/cmj/Global.js +0 -61
  141. package/cmj/Group.d.ts +0 -8
  142. package/cmj/Group.js +0 -17
  143. package/cmj/Layer.d.ts +0 -61
  144. package/cmj/Layer.js +0 -309
  145. package/cmj/Node.d.ts +0 -328
  146. package/cmj/Node.js +0 -1420
  147. package/cmj/PointerEvents.d.ts +0 -11
  148. package/cmj/PointerEvents.js +0 -45
  149. package/cmj/Shape.d.ts +0 -184
  150. package/cmj/Shape.js +0 -521
  151. package/cmj/Stage.d.ts +0 -85
  152. package/cmj/Stage.js +0 -692
  153. package/cmj/Tween.d.ts +0 -86
  154. package/cmj/Tween.js +0 -520
  155. package/cmj/Util.d.ts +0 -91
  156. package/cmj/Util.js +0 -801
  157. package/cmj/Validators.d.ts +0 -11
  158. package/cmj/Validators.js +0 -192
  159. package/cmj/_CoreInternals.d.ts +0 -152
  160. package/cmj/_CoreInternals.js +0 -37
  161. package/cmj/_FullInternals.d.ts +0 -196
  162. package/cmj/_FullInternals.js +0 -81
  163. package/cmj/filters/Blur.d.ts +0 -2
  164. package/cmj/filters/Blur.js +0 -701
  165. package/cmj/filters/Brighten.d.ts +0 -2
  166. package/cmj/filters/Brighten.js +0 -16
  167. package/cmj/filters/Contrast.d.ts +0 -2
  168. package/cmj/filters/Contrast.js +0 -38
  169. package/cmj/filters/Emboss.d.ts +0 -2
  170. package/cmj/filters/Emboss.js +0 -106
  171. package/cmj/filters/Enhance.d.ts +0 -2
  172. package/cmj/filters/Enhance.js +0 -87
  173. package/cmj/filters/Grayscale.d.ts +0 -2
  174. package/cmj/filters/Grayscale.js +0 -13
  175. package/cmj/filters/HSL.d.ts +0 -2
  176. package/cmj/filters/HSL.js +0 -28
  177. package/cmj/filters/HSV.d.ts +0 -2
  178. package/cmj/filters/HSV.js +0 -28
  179. package/cmj/filters/Invert.d.ts +0 -2
  180. package/cmj/filters/Invert.js +0 -12
  181. package/cmj/filters/Kaleidoscope.d.ts +0 -2
  182. package/cmj/filters/Kaleidoscope.js +0 -137
  183. package/cmj/filters/Mask.d.ts +0 -2
  184. package/cmj/filters/Mask.js +0 -144
  185. package/cmj/filters/Noise.d.ts +0 -2
  186. package/cmj/filters/Noise.js +0 -16
  187. package/cmj/filters/Pixelate.d.ts +0 -2
  188. package/cmj/filters/Pixelate.js +0 -64
  189. package/cmj/filters/Posterize.d.ts +0 -2
  190. package/cmj/filters/Posterize.js +0 -14
  191. package/cmj/filters/RGB.d.ts +0 -2
  192. package/cmj/filters/RGB.js +0 -43
  193. package/cmj/filters/RGBA.d.ts +0 -2
  194. package/cmj/filters/RGBA.js +0 -53
  195. package/cmj/filters/Sepia.d.ts +0 -2
  196. package/cmj/filters/Sepia.js +0 -15
  197. package/cmj/filters/Solarize.d.ts +0 -2
  198. package/cmj/filters/Solarize.js +0 -29
  199. package/cmj/filters/Threshold.d.ts +0 -2
  200. package/cmj/filters/Threshold.js +0 -14
  201. package/cmj/index-node.d.ts +0 -2
  202. package/cmj/index-node.js +0 -21
  203. package/cmj/index-types.d.ts +0 -181
  204. package/cmj/index.d.ts +0 -2
  205. package/cmj/index.js +0 -4
  206. package/cmj/package.json +0 -6
  207. package/cmj/shapes/Arc.d.ts +0 -25
  208. package/cmj/shapes/Arc.js +0 -59
  209. package/cmj/shapes/Arrow.d.ts +0 -25
  210. package/cmj/shapes/Arrow.js +0 -103
  211. package/cmj/shapes/Circle.d.ts +0 -13
  212. package/cmj/shapes/Circle.js +0 -37
  213. package/cmj/shapes/Ellipse.d.ts +0 -16
  214. package/cmj/shapes/Ellipse.js +0 -41
  215. package/cmj/shapes/Image.d.ts +0 -25
  216. package/cmj/shapes/Image.js +0 -117
  217. package/cmj/shapes/Label.d.ts +0 -35
  218. package/cmj/shapes/Label.js +0 -178
  219. package/cmj/shapes/Line.d.ts +0 -28
  220. package/cmj/shapes/Line.js +0 -159
  221. package/cmj/shapes/Path.d.ts +0 -37
  222. package/cmj/shapes/Path.js +0 -631
  223. package/cmj/shapes/Rect.d.ts +0 -10
  224. package/cmj/shapes/Rect.js +0 -26
  225. package/cmj/shapes/RegularPolygon.d.ts +0 -22
  226. package/cmj/shapes/RegularPolygon.js +0 -69
  227. package/cmj/shapes/Ring.d.ts +0 -15
  228. package/cmj/shapes/Ring.js +0 -37
  229. package/cmj/shapes/Sprite.d.ts +0 -30
  230. package/cmj/shapes/Sprite.js +0 -112
  231. package/cmj/shapes/Star.d.ts +0 -17
  232. package/cmj/shapes/Star.js +0 -42
  233. package/cmj/shapes/Text.d.ts +0 -62
  234. package/cmj/shapes/Text.js +0 -373
  235. package/cmj/shapes/TextPath.d.ts +0 -55
  236. package/cmj/shapes/TextPath.js +0 -351
  237. package/cmj/shapes/Transformer.d.ts +0 -116
  238. package/cmj/shapes/Transformer.js +0 -964
  239. package/cmj/shapes/Wedge.d.ts +0 -17
  240. package/cmj/shapes/Wedge.js +0 -42
  241. package/cmj/types.d.ts +0 -50
  242. package/cmj/types.js +0 -25
@@ -1,34 +1,37 @@
1
- import { Konva as Global } from './Global.js';
2
- import { Util, Transform } from './Util.js';
3
- import { Node } from './Node.js';
4
- import { Container } from './Container.js';
5
- import { Stage, stages } from './Stage.js';
6
- import { Layer } from './Layer.js';
7
- import { FastLayer } from './FastLayer.js';
8
- import { Group } from './Group.js';
9
- import { DD } from './DragAndDrop.js';
10
- import { Shape, shapes } from './Shape.js';
11
- import { Animation } from './Animation.js';
12
- import { Tween, Easings } from './Tween.js';
13
- import { Context } from './Context.js';
14
- import { Canvas } from './Canvas.js';
15
- export const Konva = Util._assign(Global, {
16
- Util,
17
- Transform,
18
- Node,
19
- Container,
20
- Stage,
21
- stages,
22
- Layer,
23
- FastLayer,
24
- Group,
25
- DD,
26
- Shape,
27
- shapes,
28
- Animation,
29
- Tween,
30
- Easings,
31
- Context,
32
- Canvas,
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Konva = void 0;
4
+ const Global_1 = require("./Global");
5
+ const Util_1 = require("./Util");
6
+ const Node_1 = require("./Node");
7
+ const Container_1 = require("./Container");
8
+ const Stage_1 = require("./Stage");
9
+ const Layer_1 = require("./Layer");
10
+ const FastLayer_1 = require("./FastLayer");
11
+ const Group_1 = require("./Group");
12
+ const DragAndDrop_1 = require("./DragAndDrop");
13
+ const Shape_1 = require("./Shape");
14
+ const Animation_1 = require("./Animation");
15
+ const Tween_1 = require("./Tween");
16
+ const Context_1 = require("./Context");
17
+ const Canvas_1 = require("./Canvas");
18
+ exports.Konva = Util_1.Util._assign(Global_1.Konva, {
19
+ Util: Util_1.Util,
20
+ Transform: Util_1.Transform,
21
+ Node: Node_1.Node,
22
+ Container: Container_1.Container,
23
+ Stage: Stage_1.Stage,
24
+ stages: Stage_1.stages,
25
+ Layer: Layer_1.Layer,
26
+ FastLayer: FastLayer_1.FastLayer,
27
+ Group: Group_1.Group,
28
+ DD: DragAndDrop_1.DD,
29
+ Shape: Shape_1.Shape,
30
+ shapes: Shape_1.shapes,
31
+ Animation: Animation_1.Animation,
32
+ Tween: Tween_1.Tween,
33
+ Easings: Tween_1.Easings,
34
+ Context: Context_1.Context,
35
+ Canvas: Canvas_1.Canvas,
33
36
  });
34
- export default Konva;
37
+ exports.default = exports.Konva;
@@ -1,20 +1,20 @@
1
- import { Arc } from './shapes/Arc';
2
- import { Arrow } from './shapes/Arrow';
3
- import { Circle } from './shapes/Circle';
4
- import { Ellipse } from './shapes/Ellipse';
5
- import { Image } from './shapes/Image';
6
- import { Label, Tag } from './shapes/Label';
7
- import { Line } from './shapes/Line';
8
- import { Path } from './shapes/Path';
9
- import { Rect } from './shapes/Rect';
10
- import { RegularPolygon } from './shapes/RegularPolygon';
11
- import { Ring } from './shapes/Ring';
12
- import { Sprite } from './shapes/Sprite';
13
- import { Star } from './shapes/Star';
14
- import { Text } from './shapes/Text';
15
- import { TextPath } from './shapes/TextPath';
16
- import { Transformer } from './shapes/Transformer';
17
- import { Wedge } from './shapes/Wedge';
1
+ import { Arc } from './shapes/Arc.js';
2
+ import { Arrow } from './shapes/Arrow.js';
3
+ import { Circle } from './shapes/Circle.js';
4
+ import { Ellipse } from './shapes/Ellipse.js';
5
+ import { Image } from './shapes/Image.js';
6
+ import { Label, Tag } from './shapes/Label.js';
7
+ import { Line } from './shapes/Line.js';
8
+ import { Path } from './shapes/Path.js';
9
+ import { Rect } from './shapes/Rect.js';
10
+ import { RegularPolygon } from './shapes/RegularPolygon.js';
11
+ import { Ring } from './shapes/Ring.js';
12
+ import { Sprite } from './shapes/Sprite.js';
13
+ import { Star } from './shapes/Star.js';
14
+ import { Text } from './shapes/Text.js';
15
+ import { TextPath } from './shapes/TextPath.js';
16
+ import { Transformer } from './shapes/Transformer.js';
17
+ import { Wedge } from './shapes/Wedge.js';
18
18
  export declare const Konva: {
19
19
  _global: any;
20
20
  version: string;
@@ -64,24 +64,24 @@ export declare const Konva: {
64
64
  _isInDocument(el: any): boolean;
65
65
  _urlToImage(url: string, callback: Function): void;
66
66
  _rgbToHex(r: number, g: number, b: number): string;
67
- _hexToRgb(hex: string): import("./types").RGB;
67
+ _hexToRgb(hex: string): import("./types.js").RGB;
68
68
  getRandomColor(): string;
69
- getRGB(color: string): import("./types").RGB;
70
- colorToRGBA(str: string): import("./types").RGBA;
69
+ getRGB(color: string): import("./types.js").RGB;
70
+ colorToRGBA(str: string): import("./types.js").RGBA;
71
71
  _namedColorToRBA(str: string): {
72
72
  r: any;
73
73
  g: any;
74
74
  b: any;
75
75
  a: number;
76
76
  };
77
- _rgbColorToRGBA(str: string): import("./types").RGBA;
78
- _rgbaColorToRGBA(str: string): import("./types").RGBA;
79
- _hex8ColorToRGBA(str: string): import("./types").RGBA;
80
- _hex6ColorToRGBA(str: string): import("./types").RGBA;
81
- _hex4ColorToRGBA(str: string): import("./types").RGBA;
82
- _hex3ColorToRGBA(str: string): import("./types").RGBA;
83
- _hslColorToRGBA(str: string): import("./types").RGBA;
84
- haveIntersection(r1: import("./types").IRect, r2: import("./types").IRect): boolean;
77
+ _rgbColorToRGBA(str: string): import("./types.js").RGBA;
78
+ _rgbaColorToRGBA(str: string): import("./types.js").RGBA;
79
+ _hex8ColorToRGBA(str: string): import("./types.js").RGBA;
80
+ _hex6ColorToRGBA(str: string): import("./types.js").RGBA;
81
+ _hex4ColorToRGBA(str: string): import("./types.js").RGBA;
82
+ _hex3ColorToRGBA(str: string): import("./types.js").RGBA;
83
+ _hslColorToRGBA(str: string): import("./types.js").RGBA;
84
+ haveIntersection(r1: import("./types").IRect, r2: import("./types.js").IRect): boolean;
85
85
  cloneObject<Any>(obj: Any): Any;
86
86
  cloneArray(arr: any[]): any[];
87
87
  degToRad(deg: number): number;
@@ -96,30 +96,30 @@ export declare const Konva: {
96
96
  each(obj: any, func: any): void;
97
97
  _inRange(val: any, left: any, right: any): boolean;
98
98
  _getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[];
99
- _getProjectionToLine(pt: import("./types").Vector2d, line: any, isClosed: any): import("./types").Vector2d;
99
+ _getProjectionToLine(pt: import("./types").Vector2d, line: any, isClosed: any): import("./types.js").Vector2d;
100
100
  _prepareArrayForTween(startArray: any, endArray: any, isClosed: any): any[];
101
101
  _prepareToStringify(obj: any): any;
102
102
  _assign<T, U>(target: T, source: U): T & U;
103
103
  _getFirstPointerId(evt: any): any;
104
104
  releaseCanvas(...canvases: HTMLCanvasElement[]): void;
105
- drawRoundedRectPath(context: import("./Context").Context, width: number, height: number, cornerRadius: number | number[]): void;
105
+ drawRoundedRectPath(context: import("./Context.js").Context, width: number, height: number, cornerRadius: number | number[]): void;
106
106
  };
107
- Transform: typeof import("./Util").Transform;
108
- Node: typeof import("./Node").Node;
109
- Container: typeof import("./Container").Container;
110
- Stage: typeof import("./Stage").Stage;
111
- stages: import("./Stage").Stage[];
112
- Layer: typeof import("./Layer").Layer;
113
- FastLayer: typeof import("./FastLayer").FastLayer;
114
- Group: typeof import("./Group").Group;
107
+ Transform: typeof import("./Util.js").Transform;
108
+ Node: typeof import("./Node.js").Node;
109
+ Container: typeof import("./Container.js").Container;
110
+ Stage: typeof import("./Stage.js").Stage;
111
+ stages: import("./Stage.js").Stage[];
112
+ Layer: typeof import("./Layer.js").Layer;
113
+ FastLayer: typeof import("./FastLayer.js").FastLayer;
114
+ Group: typeof import("./Group.js").Group;
115
115
  DD: {
116
116
  readonly isDragging: boolean;
117
117
  justDragged: boolean;
118
- readonly node: import("./Node").Node<import("./Node").NodeConfig>;
118
+ readonly node: import("./Node").Node<import("./Node.js").NodeConfig>;
119
119
  _dragElements: Map<number, {
120
- node: import("./Node").Node<import("./Node").NodeConfig>;
121
- startPointerPos: import("./types").Vector2d;
122
- offset: import("./types").Vector2d;
120
+ node: import("./Node").Node<import("./Node.js").NodeConfig>;
121
+ startPointerPos: import("./types.js").Vector2d;
122
+ offset: import("./types.js").Vector2d;
123
123
  pointerId?: number;
124
124
  dragStatus: "stopped" | "ready" | "dragging";
125
125
  }>;
@@ -127,12 +127,12 @@ export declare const Konva: {
127
127
  _endDragBefore(evt?: any): void;
128
128
  _endDragAfter(evt: any): void;
129
129
  };
130
- Shape: typeof import("./Shape").Shape;
130
+ Shape: typeof import("./Shape.js").Shape;
131
131
  shapes: {
132
- [key: string]: import("./Shape").Shape<import("./Shape").ShapeConfig>;
132
+ [key: string]: import("./Shape").Shape<import("./Shape.js").ShapeConfig>;
133
133
  };
134
- Animation: typeof import("./Animation").Animation;
135
- Tween: typeof import("./Tween").Tween;
134
+ Animation: typeof import("./Animation.js").Animation;
135
+ Tween: typeof import("./Tween.js").Tween;
136
136
  Easings: {
137
137
  BackEaseIn(t: any, b: any, c: any, d: any): any;
138
138
  BackEaseOut(t: any, b: any, c: any, d: any): any;
@@ -151,8 +151,8 @@ export declare const Konva: {
151
151
  StrongEaseInOut(t: any, b: any, c: any, d: any): any;
152
152
  Linear(t: any, b: any, c: any, d: any): any;
153
153
  };
154
- Context: typeof import("./Context").Context;
155
- Canvas: typeof import("./Canvas").Canvas;
154
+ Context: typeof import("./Context.js").Context;
155
+ Canvas: typeof import("./Canvas.js").Canvas;
156
156
  } & {
157
157
  Arc: typeof Arc;
158
158
  Arrow: typeof Arrow;
@@ -173,24 +173,24 @@ export declare const Konva: {
173
173
  Transformer: typeof Transformer;
174
174
  Wedge: typeof Wedge;
175
175
  Filters: {
176
- Blur: import("./Node").Filter;
177
- Brighten: import("./Node").Filter;
178
- Contrast: import("./Node").Filter;
179
- Emboss: import("./Node").Filter;
180
- Enhance: import("./Node").Filter;
181
- Grayscale: import("./Node").Filter;
182
- HSL: import("./Node").Filter;
183
- HSV: import("./Node").Filter;
184
- Invert: import("./Node").Filter;
185
- Kaleidoscope: import("./Node").Filter;
186
- Mask: import("./Node").Filter;
187
- Noise: import("./Node").Filter;
188
- Pixelate: import("./Node").Filter;
189
- Posterize: import("./Node").Filter;
190
- RGB: import("./Node").Filter;
191
- RGBA: import("./Node").Filter;
192
- Sepia: import("./Node").Filter;
193
- Solarize: import("./Node").Filter;
194
- Threshold: import("./Node").Filter;
176
+ Blur: import("./Node.js").Filter;
177
+ Brighten: import("./Node.js").Filter;
178
+ Contrast: import("./Node.js").Filter;
179
+ Emboss: import("./Node.js").Filter;
180
+ Enhance: import("./Node.js").Filter;
181
+ Grayscale: import("./Node.js").Filter;
182
+ HSL: import("./Node.js").Filter;
183
+ HSV: import("./Node.js").Filter;
184
+ Invert: import("./Node.js").Filter;
185
+ Kaleidoscope: import("./Node.js").Filter;
186
+ Mask: import("./Node.js").Filter;
187
+ Noise: import("./Node.js").Filter;
188
+ Pixelate: import("./Node.js").Filter;
189
+ Posterize: import("./Node.js").Filter;
190
+ RGB: import("./Node.js").Filter;
191
+ RGBA: import("./Node.js").Filter;
192
+ Sepia: import("./Node.js").Filter;
193
+ Solarize: import("./Node.js").Filter;
194
+ Threshold: import("./Node.js").Filter;
195
195
  };
196
196
  };
@@ -1,78 +1,81 @@
1
- import { Konva as Core } from './_CoreInternals.js';
2
- import { Arc } from './shapes/Arc.js';
3
- import { Arrow } from './shapes/Arrow.js';
4
- import { Circle } from './shapes/Circle.js';
5
- import { Ellipse } from './shapes/Ellipse.js';
6
- import { Image } from './shapes/Image.js';
7
- import { Label, Tag } from './shapes/Label.js';
8
- import { Line } from './shapes/Line.js';
9
- import { Path } from './shapes/Path.js';
10
- import { Rect } from './shapes/Rect.js';
11
- import { RegularPolygon } from './shapes/RegularPolygon.js';
12
- import { Ring } from './shapes/Ring.js';
13
- import { Sprite } from './shapes/Sprite.js';
14
- import { Star } from './shapes/Star.js';
15
- import { Text } from './shapes/Text.js';
16
- import { TextPath } from './shapes/TextPath.js';
17
- import { Transformer } from './shapes/Transformer.js';
18
- import { Wedge } from './shapes/Wedge.js';
19
- import { Blur } from './filters/Blur.js';
20
- import { Brighten } from './filters/Brighten.js';
21
- import { Contrast } from './filters/Contrast.js';
22
- import { Emboss } from './filters/Emboss.js';
23
- import { Enhance } from './filters/Enhance.js';
24
- import { Grayscale } from './filters/Grayscale.js';
25
- import { HSL } from './filters/HSL.js';
26
- import { HSV } from './filters/HSV.js';
27
- import { Invert } from './filters/Invert.js';
28
- import { Kaleidoscope } from './filters/Kaleidoscope.js';
29
- import { Mask } from './filters/Mask.js';
30
- import { Noise } from './filters/Noise.js';
31
- import { Pixelate } from './filters/Pixelate.js';
32
- import { Posterize } from './filters/Posterize.js';
33
- import { RGB } from './filters/RGB.js';
34
- import { RGBA } from './filters/RGBA.js';
35
- import { Sepia } from './filters/Sepia.js';
36
- import { Solarize } from './filters/Solarize.js';
37
- import { Threshold } from './filters/Threshold.js';
38
- export const Konva = Core.Util._assign(Core, {
39
- Arc,
40
- Arrow,
41
- Circle,
42
- Ellipse,
43
- Image,
44
- Label,
45
- Tag,
46
- Line,
47
- Path,
48
- Rect,
49
- RegularPolygon,
50
- Ring,
51
- Sprite,
52
- Star,
53
- Text,
54
- TextPath,
55
- Transformer,
56
- Wedge,
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Konva = void 0;
4
+ const _CoreInternals_1 = require("./_CoreInternals");
5
+ const Arc_1 = require("./shapes/Arc");
6
+ const Arrow_1 = require("./shapes/Arrow");
7
+ const Circle_1 = require("./shapes/Circle");
8
+ const Ellipse_1 = require("./shapes/Ellipse");
9
+ const Image_1 = require("./shapes/Image");
10
+ const Label_1 = require("./shapes/Label");
11
+ const Line_1 = require("./shapes/Line");
12
+ const Path_1 = require("./shapes/Path");
13
+ const Rect_1 = require("./shapes/Rect");
14
+ const RegularPolygon_1 = require("./shapes/RegularPolygon");
15
+ const Ring_1 = require("./shapes/Ring");
16
+ const Sprite_1 = require("./shapes/Sprite");
17
+ const Star_1 = require("./shapes/Star");
18
+ const Text_1 = require("./shapes/Text");
19
+ const TextPath_1 = require("./shapes/TextPath");
20
+ const Transformer_1 = require("./shapes/Transformer");
21
+ const Wedge_1 = require("./shapes/Wedge");
22
+ const Blur_1 = require("./filters/Blur");
23
+ const Brighten_1 = require("./filters/Brighten");
24
+ const Contrast_1 = require("./filters/Contrast");
25
+ const Emboss_1 = require("./filters/Emboss");
26
+ const Enhance_1 = require("./filters/Enhance");
27
+ const Grayscale_1 = require("./filters/Grayscale");
28
+ const HSL_1 = require("./filters/HSL");
29
+ const HSV_1 = require("./filters/HSV");
30
+ const Invert_1 = require("./filters/Invert");
31
+ const Kaleidoscope_1 = require("./filters/Kaleidoscope");
32
+ const Mask_1 = require("./filters/Mask");
33
+ const Noise_1 = require("./filters/Noise");
34
+ const Pixelate_1 = require("./filters/Pixelate");
35
+ const Posterize_1 = require("./filters/Posterize");
36
+ const RGB_1 = require("./filters/RGB");
37
+ const RGBA_1 = require("./filters/RGBA");
38
+ const Sepia_1 = require("./filters/Sepia");
39
+ const Solarize_1 = require("./filters/Solarize");
40
+ const Threshold_1 = require("./filters/Threshold");
41
+ exports.Konva = _CoreInternals_1.Konva.Util._assign(_CoreInternals_1.Konva, {
42
+ Arc: Arc_1.Arc,
43
+ Arrow: Arrow_1.Arrow,
44
+ Circle: Circle_1.Circle,
45
+ Ellipse: Ellipse_1.Ellipse,
46
+ Image: Image_1.Image,
47
+ Label: Label_1.Label,
48
+ Tag: Label_1.Tag,
49
+ Line: Line_1.Line,
50
+ Path: Path_1.Path,
51
+ Rect: Rect_1.Rect,
52
+ RegularPolygon: RegularPolygon_1.RegularPolygon,
53
+ Ring: Ring_1.Ring,
54
+ Sprite: Sprite_1.Sprite,
55
+ Star: Star_1.Star,
56
+ Text: Text_1.Text,
57
+ TextPath: TextPath_1.TextPath,
58
+ Transformer: Transformer_1.Transformer,
59
+ Wedge: Wedge_1.Wedge,
57
60
  Filters: {
58
- Blur,
59
- Brighten,
60
- Contrast,
61
- Emboss,
62
- Enhance,
63
- Grayscale,
64
- HSL,
65
- HSV,
66
- Invert,
67
- Kaleidoscope,
68
- Mask,
69
- Noise,
70
- Pixelate,
71
- Posterize,
72
- RGB,
73
- RGBA,
74
- Sepia,
75
- Solarize,
76
- Threshold,
61
+ Blur: Blur_1.Blur,
62
+ Brighten: Brighten_1.Brighten,
63
+ Contrast: Contrast_1.Contrast,
64
+ Emboss: Emboss_1.Emboss,
65
+ Enhance: Enhance_1.Enhance,
66
+ Grayscale: Grayscale_1.Grayscale,
67
+ HSL: HSL_1.HSL,
68
+ HSV: HSV_1.HSV,
69
+ Invert: Invert_1.Invert,
70
+ Kaleidoscope: Kaleidoscope_1.Kaleidoscope,
71
+ Mask: Mask_1.Mask,
72
+ Noise: Noise_1.Noise,
73
+ Pixelate: Pixelate_1.Pixelate,
74
+ Posterize: Posterize_1.Posterize,
75
+ RGB: RGB_1.RGB,
76
+ RGBA: RGBA_1.RGBA,
77
+ Sepia: Sepia_1.Sepia,
78
+ Solarize: Solarize_1.Solarize,
79
+ Threshold: Threshold_1.Threshold,
77
80
  },
78
81
  });
@@ -1,2 +1,2 @@
1
- import { Filter } from '../Node';
1
+ import { Filter } from '../Node.js';
2
2
  export declare const Blur: Filter;
@@ -1,6 +1,9 @@
1
- import { Factory } from '../Factory.js';
2
- import { Node } from '../Node.js';
3
- import { getNumberValidator } from '../Validators.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Blur = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Node_1 = require("../Node");
6
+ const Validators_1 = require("../Validators");
4
7
  function BlurStack() {
5
8
  this.r = 0;
6
9
  this.g = 0;
@@ -688,10 +691,11 @@ function filterGaussBlurRGBA(imageData, radius) {
688
691
  }
689
692
  }
690
693
  }
691
- export const Blur = function Blur(imageData) {
694
+ const Blur = function Blur(imageData) {
692
695
  var radius = Math.round(this.blurRadius());
693
696
  if (radius > 0) {
694
697
  filterGaussBlurRGBA(imageData, radius);
695
698
  }
696
699
  };
697
- Factory.addGetterSetter(Node, 'blurRadius', 0, getNumberValidator(), Factory.afterSetFilter);
700
+ exports.Blur = Blur;
701
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'blurRadius', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
@@ -1,2 +1,2 @@
1
- import { Filter } from '../Node';
1
+ import { Filter } from '../Node.js';
2
2
  export declare const Brighten: Filter;
@@ -1,7 +1,10 @@
1
- import { Factory } from '../Factory.js';
2
- import { Node } from '../Node.js';
3
- import { getNumberValidator } from '../Validators.js';
4
- export const Brighten = function (imageData) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Brighten = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Node_1 = require("../Node");
6
+ const Validators_1 = require("../Validators");
7
+ const Brighten = function (imageData) {
5
8
  var brightness = this.brightness() * 255, data = imageData.data, len = data.length, i;
6
9
  for (i = 0; i < len; i += 4) {
7
10
  data[i] += brightness;
@@ -9,4 +12,5 @@ export const Brighten = function (imageData) {
9
12
  data[i + 2] += brightness;
10
13
  }
11
14
  };
12
- Factory.addGetterSetter(Node, 'brightness', 0, getNumberValidator(), Factory.afterSetFilter);
15
+ exports.Brighten = Brighten;
16
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'brightness', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
@@ -1,2 +1,2 @@
1
- import { Filter } from '../Node';
1
+ import { Filter } from '../Node.js';
2
2
  export declare const Contrast: Filter;
@@ -1,7 +1,10 @@
1
- import { Factory } from '../Factory.js';
2
- import { Node } from '../Node.js';
3
- import { getNumberValidator } from '../Validators.js';
4
- export const Contrast = function (imageData) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Contrast = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Node_1 = require("../Node");
6
+ const Validators_1 = require("../Validators");
7
+ const Contrast = function (imageData) {
5
8
  var adjust = Math.pow((this.contrast() + 100) / 100, 2);
6
9
  var data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;
7
10
  for (i = 0; i < nPixels; i += 4) {
@@ -31,4 +34,5 @@ export const Contrast = function (imageData) {
31
34
  data[i + 2] = blue;
32
35
  }
33
36
  };
34
- Factory.addGetterSetter(Node, 'contrast', 0, getNumberValidator(), Factory.afterSetFilter);
37
+ exports.Contrast = Contrast;
38
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'contrast', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
@@ -1,2 +1,2 @@
1
- import { Filter } from '../Node';
1
+ import { Filter } from '../Node.js';
2
2
  export declare const Emboss: Filter;
@@ -1,8 +1,11 @@
1
- import { Factory } from '../Factory.js';
2
- import { Node } from '../Node.js';
3
- import { Util } from '../Util.js';
4
- import { getNumberValidator } from '../Validators.js';
5
- export const Emboss = function (imageData) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Emboss = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Node_1 = require("../Node");
6
+ const Util_1 = require("../Util");
7
+ const Validators_1 = require("../Validators");
8
+ const Emboss = function (imageData) {
6
9
  var strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;
7
10
  switch (direction) {
8
11
  case 'top-left':
@@ -38,7 +41,7 @@ export const Emboss = function (imageData) {
38
41
  dirX = -1;
39
42
  break;
40
43
  default:
41
- Util.error('Unknown emboss direction: ' + direction);
44
+ Util_1.Util.error('Unknown emboss direction: ' + direction);
42
45
  }
43
46
  do {
44
47
  var offsetY = (y - 1) * w4;
@@ -96,7 +99,8 @@ export const Emboss = function (imageData) {
96
99
  } while (--x);
97
100
  } while (--y);
98
101
  };
99
- Factory.addGetterSetter(Node, 'embossStrength', 0.5, getNumberValidator(), Factory.afterSetFilter);
100
- Factory.addGetterSetter(Node, 'embossWhiteLevel', 0.5, getNumberValidator(), Factory.afterSetFilter);
101
- Factory.addGetterSetter(Node, 'embossDirection', 'top-left', null, Factory.afterSetFilter);
102
- Factory.addGetterSetter(Node, 'embossBlend', false, null, Factory.afterSetFilter);
102
+ exports.Emboss = Emboss;
103
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
104
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
105
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', null, Factory_1.Factory.afterSetFilter);
106
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, null, Factory_1.Factory.afterSetFilter);
@@ -1,2 +1,2 @@
1
- import { Filter } from '../Node';
1
+ import { Filter } from '../Node.js';
2
2
  export declare const Enhance: Filter;
@@ -1,6 +1,9 @@
1
- import { Factory } from '../Factory.js';
2
- import { Node } from '../Node.js';
3
- import { getNumberValidator } from '../Validators.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Enhance = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Node_1 = require("../Node");
6
+ const Validators_1 = require("../Validators");
4
7
  function remap(fromValue, fromMin, fromMax, toMin, toMax) {
5
8
  var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;
6
9
  if (fromRange === 0) {
@@ -13,7 +16,7 @@ function remap(fromValue, fromMin, fromMax, toMin, toMax) {
13
16
  toValue = toRange * toValue + toMin;
14
17
  return toValue;
15
18
  }
16
- export const Enhance = function (imageData) {
19
+ const Enhance = function (imageData) {
17
20
  var data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;
18
21
  var enhanceAmount = this.enhance();
19
22
  if (enhanceAmount === 0) {
@@ -80,4 +83,5 @@ export const Enhance = function (imageData) {
80
83
  data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);
81
84
  }
82
85
  };
83
- Factory.addGetterSetter(Node, 'enhance', 0, getNumberValidator(), Factory.afterSetFilter);
86
+ exports.Enhance = Enhance;
87
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'enhance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
@@ -1,2 +1,2 @@
1
- import { Filter } from '../Node';
1
+ import { Filter } from '../Node.js';
2
2
  export declare const Grayscale: Filter;
@@ -1,4 +1,7 @@
1
- export const Grayscale = function (imageData) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Grayscale = void 0;
4
+ const Grayscale = function (imageData) {
2
5
  var data = imageData.data, len = data.length, i, brightness;
3
6
  for (i = 0; i < len; i += 4) {
4
7
  brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
@@ -7,3 +10,4 @@ export const Grayscale = function (imageData) {
7
10
  data[i + 2] = brightness;
8
11
  }
9
12
  };
13
+ exports.Grayscale = Grayscale;
@@ -1,2 +1,2 @@
1
- import { Filter } from '../Node';
1
+ import { Filter } from '../Node.js';
2
2
  export declare const HSL: Filter;