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
@@ -7,25 +7,25 @@
7
7
  // so here we just need to define full API of Konva manually
8
8
 
9
9
  // filters
10
- import { Blur } from './filters/Blur';
11
- import { Brighten } from './filters/Brighten';
12
- import { Contrast } from './filters/Contrast';
13
- import { Emboss } from './filters/Emboss';
14
- import { Enhance } from './filters/Enhance';
15
- import { Grayscale } from './filters/Grayscale';
16
- import { HSL } from './filters/HSL';
17
- import { HSV } from './filters/HSV';
18
- import { Invert } from './filters/Invert';
19
- import { Kaleidoscope } from './filters/Kaleidoscope';
20
- import { Mask } from './filters/Mask';
21
- import { Noise } from './filters/Noise';
22
- import { Pixelate } from './filters/Pixelate';
23
- import { Posterize } from './filters/Posterize';
24
- import { RGB } from './filters/RGB';
25
- import { RGBA } from './filters/RGBA';
26
- import { Sepia } from './filters/Sepia';
27
- import { Solarize } from './filters/Solarize';
28
- import { Threshold } from './filters/Threshold';
10
+ import { Blur } from './filters/Blur.js';
11
+ import { Brighten } from './filters/Brighten.js';
12
+ import { Contrast } from './filters/Contrast.js';
13
+ import { Emboss } from './filters/Emboss.js';
14
+ import { Enhance } from './filters/Enhance.js';
15
+ import { Grayscale } from './filters/Grayscale.js';
16
+ import { HSL } from './filters/HSL.js';
17
+ import { HSV } from './filters/HSV.js';
18
+ import { Invert } from './filters/Invert.js';
19
+ import { Kaleidoscope } from './filters/Kaleidoscope.js';
20
+ import { Mask } from './filters/Mask.js';
21
+ import { Noise } from './filters/Noise.js';
22
+ import { Pixelate } from './filters/Pixelate.js';
23
+ import { Posterize } from './filters/Posterize.js';
24
+ import { RGB } from './filters/RGB.js';
25
+ import { RGBA } from './filters/RGBA.js';
26
+ import { Sepia } from './filters/Sepia.js';
27
+ import { Solarize } from './filters/Solarize.js';
28
+ import { Threshold } from './filters/Threshold.js';
29
29
 
30
30
  declare namespace Konva {
31
31
  export let enableTrace: number;
@@ -40,120 +40,120 @@ declare namespace Konva {
40
40
  export const isDragging: () => boolean;
41
41
  export const isDragReady: () => boolean;
42
42
 
43
- export type Vector2d = import('./types').Vector2d;
43
+ export type Vector2d = import('./types.js').Vector2d;
44
44
 
45
- export const Node: typeof import('./Node').Node;
46
- export type Node = import('./Node').Node;
47
- export type NodeConfig = import('./Node').NodeConfig;
45
+ export const Node: typeof import('./Node.js').Node;
46
+ export type Node = import('./Node.js').Node;
47
+ export type NodeConfig = import('./Node.js').NodeConfig;
48
48
 
49
49
  export type KonvaEventObject<
50
50
  EventType
51
- > = import('./Node').KonvaEventObject<EventType>;
51
+ > = import('./Node.js').KonvaEventObject<EventType>;
52
52
 
53
- export type KonvaPointerEvent = import('./PointerEvents').KonvaPointerEvent;
53
+ export type KonvaPointerEvent = import('./PointerEvents.js').KonvaPointerEvent;
54
54
 
55
55
  export type KonvaEventListener<
56
56
  This,
57
57
  EventType
58
- > = import('./Node').KonvaEventListener<This, EventType>;
59
-
60
- export const Container: typeof import('./Container').Container;
61
- export type Container = import('./Container').Container<Node>;
62
- export type ContainerConfig = import('./Container').ContainerConfig;
63
-
64
- export const Transform: typeof import('./Util').Transform;
65
- export type Transform = import('./Util').Transform;
66
-
67
- export const Util: typeof import('./Util').Util;
68
-
69
- export const Context: typeof import('./Context').Context;
70
- export type Context = import('./Context').Context;
71
-
72
- export const Stage: typeof import('./Stage').Stage;
73
- export type Stage = import('./Stage').Stage;
74
- export type StageConfig = import('./Stage').StageConfig;
75
- export const stages: typeof import('./Stage').stages;
76
-
77
- export const Layer: typeof import('./Layer').Layer;
78
- export type Layer = import('./Layer').Layer;
79
- export type LayerConfig = import('./Layer').LayerConfig;
80
-
81
- export const FastLayer: typeof import('./FastLayer').FastLayer;
82
- export type FastLayer = import('./FastLayer').FastLayer;
83
-
84
- export const Group: typeof import('./Group').Group;
85
- export type Group = import('./Group').Group;
86
- export type GroupConfig = import('./Group').GroupConfig;
87
-
88
- export const DD: typeof import('./DragAndDrop').DD;
89
-
90
- export const Shape: typeof import('./Shape').Shape;
91
- export type Shape = import('./Shape').Shape;
92
- export type ShapeConfig = import('./Shape').ShapeConfig;
93
- export const shapes: typeof import('./Shape').shapes;
94
-
95
- export const Animation: typeof import('./Animation').Animation;
96
- export type Animation = import('./Animation').Animation;
97
-
98
- export const Tween: typeof import('./Tween').Tween;
99
- export type Tween = import('./Tween').Tween;
100
- export type TweenConfig = import('./Tween').TweenConfig;
101
- export const Easings: typeof import('./Tween').Easings;
102
-
103
- export const Arc: typeof import('./shapes/Arc').Arc;
104
- export type Arc = import('./shapes/Arc').Arc;
105
- export type ArcConfig = import('./shapes/Arc').ArcConfig;
106
- export const Arrow: typeof import('./shapes/Arrow').Arrow;
107
- export type Arrow = import('./shapes/Arrow').Arrow;
108
- export type ArrowConfig = import('./shapes/Arrow').ArrowConfig;
109
- export const Circle: typeof import('./shapes/Circle').Circle;
110
- export type Circle = import('./shapes/Circle').Circle;
111
- export type CircleConfig = import('./shapes/Circle').CircleConfig;
112
- export const Ellipse: typeof import('./shapes/Ellipse').Ellipse;
113
- export type Ellipse = import('./shapes/Ellipse').Ellipse;
114
- export type EllipseConfig = import('./shapes/Ellipse').EllipseConfig;
115
- export const Image: typeof import('./shapes/Image').Image;
116
- export type Image = import('./shapes/Image').Image;
117
- export type ImageConfig = import('./shapes/Image').ImageConfig;
118
- export const Label: typeof import('./shapes/Label').Label;
119
- export type Label = import('./shapes/Label').Label;
120
- export type LabelConfig = import('./shapes/Label').LabelConfig;
121
- export const Tag: typeof import('./shapes/Label').Tag;
122
- export type Tag = import('./shapes/Label').Tag;
123
- export type TagConfig = import('./shapes/Label').TagConfig;
124
- export const Line: typeof import('./shapes/Line').Line;
125
- export type Line = import('./shapes/Line').Line;
126
- export type LineConfig = import('./shapes/Line').LineConfig;
127
- export const Path: typeof import('./shapes/Path').Path;
128
- export type Path = import('./shapes/Path').Path;
129
- export type PathConfig = import('./shapes/Path').PathConfig;
130
- export const Rect: typeof import('./shapes/Rect').Rect;
131
- export type Rect = import('./shapes/Rect').Rect;
132
- export type RectConfig = import('./shapes/Rect').RectConfig;
133
- export const RegularPolygon: typeof import('./shapes/RegularPolygon').RegularPolygon;
134
- export type RegularPolygon = import('./shapes/RegularPolygon').RegularPolygon;
135
- export type RegularPolygonConfig = import('./shapes/RegularPolygon').RegularPolygonConfig;
136
- export const Ring: typeof import('./shapes/Ring').Ring;
137
- export type Ring = import('./shapes/Ring').Ring;
138
- export type RingConfig = import('./shapes/Ring').RingConfig;
139
- export const Sprite: typeof import('./shapes/Sprite').Sprite;
140
- export type Sprite = import('./shapes/Sprite').Sprite;
141
- export type SpriteConfig = import('./shapes/Sprite').SpriteConfig;
142
- export const Star: typeof import('./shapes/Star').Star;
143
- export type Star = import('./shapes/Star').Star;
144
- export type StarConfig = import('./shapes/Star').StarConfig;
145
- export const Text: typeof import('./shapes/Text').Text;
146
- export type Text = import('./shapes/Text').Text;
147
- export type TextConfig = import('./shapes/Text').TextConfig;
148
- export const TextPath: typeof import('./shapes/TextPath').TextPath;
149
- export type TextPath = import('./shapes/TextPath').TextPath;
150
- export type TextPathConfig = import('./shapes/TextPath').TextPathConfig;
151
- export const Transformer: typeof import('./shapes/Transformer').Transformer;
152
- export type Transformer = import('./shapes/Transformer').Transformer;
153
- export type TransformerConfig = import('./shapes/Transformer').TransformerConfig;
154
- export const Wedge: typeof import('./shapes/Wedge').Wedge;
155
- export type Wedge = import('./shapes/Wedge').Wedge;
156
- export type WedgeConfig = import('./shapes/Wedge').WedgeConfig;
58
+ > = import('./Node.js').KonvaEventListener<This, EventType>;
59
+
60
+ export const Container: typeof import('./Container.js').Container;
61
+ export type Container = import('./Container.js').Container<Node>;
62
+ export type ContainerConfig = import('./Container.js').ContainerConfig;
63
+
64
+ export const Transform: typeof import('./Util.js').Transform;
65
+ export type Transform = import('./Util.js').Transform;
66
+
67
+ export const Util: typeof import('./Util.js').Util;
68
+
69
+ export const Context: typeof import('./Context.js').Context;
70
+ export type Context = import('./Context.js').Context;
71
+
72
+ export const Stage: typeof import('./Stage.js').Stage;
73
+ export type Stage = import('./Stage.js').Stage;
74
+ export type StageConfig = import('./Stage.js').StageConfig;
75
+ export const stages: typeof import('./Stage.js').stages;
76
+
77
+ export const Layer: typeof import('./Layer.js').Layer;
78
+ export type Layer = import('./Layer.js').Layer;
79
+ export type LayerConfig = import('./Layer.js').LayerConfig;
80
+
81
+ export const FastLayer: typeof import('./FastLayer.js').FastLayer;
82
+ export type FastLayer = import('./FastLayer.js').FastLayer;
83
+
84
+ export const Group: typeof import('./Group.js').Group;
85
+ export type Group = import('./Group.js').Group;
86
+ export type GroupConfig = import('./Group.js').GroupConfig;
87
+
88
+ export const DD: typeof import('./DragAndDrop.js').DD;
89
+
90
+ export const Shape: typeof import('./Shape.js').Shape;
91
+ export type Shape = import('./Shape.js').Shape;
92
+ export type ShapeConfig = import('./Shape.js').ShapeConfig;
93
+ export const shapes: typeof import('./Shape.js').shapes;
94
+
95
+ export const Animation: typeof import('./Animation.js').Animation;
96
+ export type Animation = import('./Animation.js').Animation;
97
+
98
+ export const Tween: typeof import('./Tween.js').Tween;
99
+ export type Tween = import('./Tween.js').Tween;
100
+ export type TweenConfig = import('./Tween.js').TweenConfig;
101
+ export const Easings: typeof import('./Tween.js').Easings;
102
+
103
+ export const Arc: typeof import('./shapes/Arc.js').Arc;
104
+ export type Arc = import('./shapes/Arc.js').Arc;
105
+ export type ArcConfig = import('./shapes/Arc.js').ArcConfig;
106
+ export const Arrow: typeof import('./shapes/Arrow.js').Arrow;
107
+ export type Arrow = import('./shapes/Arrow.js').Arrow;
108
+ export type ArrowConfig = import('./shapes/Arrow.js').ArrowConfig;
109
+ export const Circle: typeof import('./shapes/Circle.js').Circle;
110
+ export type Circle = import('./shapes/Circle.js').Circle;
111
+ export type CircleConfig = import('./shapes/Circle.js').CircleConfig;
112
+ export const Ellipse: typeof import('./shapes/Ellipse.js').Ellipse;
113
+ export type Ellipse = import('./shapes/Ellipse.js').Ellipse;
114
+ export type EllipseConfig = import('./shapes/Ellipse.js').EllipseConfig;
115
+ export const Image: typeof import('./shapes/Image.js').Image;
116
+ export type Image = import('./shapes/Image.js').Image;
117
+ export type ImageConfig = import('./shapes/Image.js').ImageConfig;
118
+ export const Label: typeof import('./shapes/Label.js').Label;
119
+ export type Label = import('./shapes/Label.js').Label;
120
+ export type LabelConfig = import('./shapes/Label.js').LabelConfig;
121
+ export const Tag: typeof import('./shapes/Label.js').Tag;
122
+ export type Tag = import('./shapes/Label.js').Tag;
123
+ export type TagConfig = import('./shapes/Label.js').TagConfig;
124
+ export const Line: typeof import('./shapes/Line.js').Line;
125
+ export type Line = import('./shapes/Line.js').Line;
126
+ export type LineConfig = import('./shapes/Line.js').LineConfig;
127
+ export const Path: typeof import('./shapes/Path.js').Path;
128
+ export type Path = import('./shapes/Path.js').Path;
129
+ export type PathConfig = import('./shapes/Path.js').PathConfig;
130
+ export const Rect: typeof import('./shapes/Rect.js').Rect;
131
+ export type Rect = import('./shapes/Rect.js').Rect;
132
+ export type RectConfig = import('./shapes/Rect.js').RectConfig;
133
+ export const RegularPolygon: typeof import('./shapes/RegularPolygon.js').RegularPolygon;
134
+ export type RegularPolygon = import('./shapes/RegularPolygon.js').RegularPolygon;
135
+ export type RegularPolygonConfig = import('./shapes/RegularPolygon.js').RegularPolygonConfig;
136
+ export const Ring: typeof import('./shapes/Ring.js').Ring;
137
+ export type Ring = import('./shapes/Ring.js').Ring;
138
+ export type RingConfig = import('./shapes/Ring.js').RingConfig;
139
+ export const Sprite: typeof import('./shapes/Sprite.js').Sprite;
140
+ export type Sprite = import('./shapes/Sprite.js').Sprite;
141
+ export type SpriteConfig = import('./shapes/Sprite.js').SpriteConfig;
142
+ export const Star: typeof import('./shapes/Star.js').Star;
143
+ export type Star = import('./shapes/Star.js').Star;
144
+ export type StarConfig = import('./shapes/Star.js').StarConfig;
145
+ export const Text: typeof import('./shapes/Text.js').Text;
146
+ export type Text = import('./shapes/Text.js').Text;
147
+ export type TextConfig = import('./shapes/Text.js').TextConfig;
148
+ export const TextPath: typeof import('./shapes/TextPath.js').TextPath;
149
+ export type TextPath = import('./shapes/TextPath.js').TextPath;
150
+ export type TextPathConfig = import('./shapes/TextPath.js').TextPathConfig;
151
+ export const Transformer: typeof import('./shapes/Transformer.js').Transformer;
152
+ export type Transformer = import('./shapes/Transformer.js').Transformer;
153
+ export type TransformerConfig = import('./shapes/Transformer.js').TransformerConfig;
154
+ export const Wedge: typeof import('./shapes/Wedge.js').Wedge;
155
+ export type Wedge = import('./shapes/Wedge.js').Wedge;
156
+ export type WedgeConfig = import('./shapes/Wedge.js').WedgeConfig;
157
157
 
158
158
  export const Filters: {
159
159
  Blur: typeof Blur;
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { Konva } from './_FullInternals';
1
+ import { Konva } from './_FullInternals.js';
2
2
  export default Konva;
package/lib/index.js CHANGED
@@ -1,2 +1,4 @@
1
- import { Konva } from './_FullInternals.js';
2
- export default Konva;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _FullInternals_1 = require("./_FullInternals");
4
+ module.exports = _FullInternals_1.Konva;
@@ -1,5 +1,6 @@
1
- import { Shape, ShapeConfig } from '../Shape';
2
- import { GetSet } from '../types';
1
+ import { Shape, ShapeConfig } from '../Shape.js';
2
+ import { GetSet } from '../types.js';
3
+ import { Context } from '../Context.js';
3
4
  export interface ArcConfig extends ShapeConfig {
4
5
  angle: number;
5
6
  innerRadius: number;
@@ -7,11 +8,11 @@ export interface ArcConfig extends ShapeConfig {
7
8
  clockwise?: boolean;
8
9
  }
9
10
  export declare class Arc extends Shape<ArcConfig> {
10
- _sceneFunc(context: any): void;
11
+ _sceneFunc(context: Context): void;
11
12
  getWidth(): number;
12
13
  getHeight(): number;
13
- setWidth(width: any): void;
14
- setHeight(height: any): void;
14
+ setWidth(width: number): void;
15
+ setHeight(height: number): void;
15
16
  getSelfRect(): {
16
17
  x: number;
17
18
  y: number;
package/lib/shapes/Arc.js CHANGED
@@ -1,11 +1,14 @@
1
- import { Factory } from '../Factory.js';
2
- import { Shape } from '../Shape.js';
3
- import { Konva } from '../Global.js';
4
- import { getNumberValidator, getBooleanValidator } from '../Validators.js';
5
- import { _registerNode } from '../Global.js';
6
- export class Arc extends Shape {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Arc = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Shape_1 = require("../Shape");
6
+ const Global_1 = require("../Global");
7
+ const Validators_1 = require("../Validators");
8
+ const Global_2 = require("../Global");
9
+ class Arc extends Shape_1.Shape {
7
10
  _sceneFunc(context) {
8
- var angle = Konva.getAngle(this.angle()), clockwise = this.clockwise();
11
+ var angle = Global_1.Konva.getAngle(this.angle()), clockwise = this.clockwise();
9
12
  context.beginPath();
10
13
  context.arc(0, 0, this.outerRadius(), 0, angle, clockwise);
11
14
  context.arc(0, 0, this.innerRadius(), angle, 0, !clockwise);
@@ -28,7 +31,7 @@ export class Arc extends Shape {
28
31
  const innerRadius = this.innerRadius();
29
32
  const outerRadius = this.outerRadius();
30
33
  const clockwise = this.clockwise();
31
- const angle = Konva.getAngle(clockwise ? 360 - this.angle() : this.angle());
34
+ const angle = Global_1.Konva.getAngle(clockwise ? 360 - this.angle() : this.angle());
32
35
  const boundLeftRatio = Math.cos(Math.min(angle, Math.PI));
33
36
  const boundRightRatio = 1;
34
37
  const boundTopRatio = Math.sin(Math.min(Math.max(Math.PI, angle), (3 * Math.PI) / 2));
@@ -45,11 +48,12 @@ export class Arc extends Shape {
45
48
  };
46
49
  }
47
50
  }
51
+ exports.Arc = Arc;
48
52
  Arc.prototype._centroid = true;
49
53
  Arc.prototype.className = 'Arc';
50
54
  Arc.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];
51
- _registerNode(Arc);
52
- Factory.addGetterSetter(Arc, 'innerRadius', 0, getNumberValidator());
53
- Factory.addGetterSetter(Arc, 'outerRadius', 0, getNumberValidator());
54
- Factory.addGetterSetter(Arc, 'angle', 0, getNumberValidator());
55
- Factory.addGetterSetter(Arc, 'clockwise', false, getBooleanValidator());
55
+ (0, Global_2._registerNode)(Arc);
56
+ Factory_1.Factory.addGetterSetter(Arc, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());
57
+ Factory_1.Factory.addGetterSetter(Arc, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());
58
+ Factory_1.Factory.addGetterSetter(Arc, 'angle', 0, (0, Validators_1.getNumberValidator)());
59
+ Factory_1.Factory.addGetterSetter(Arc, 'clockwise', false, (0, Validators_1.getBooleanValidator)());
@@ -1,5 +1,6 @@
1
- import { Line, LineConfig } from './Line';
2
- import { GetSet } from '../types';
1
+ import { Line, LineConfig } from './Line.js';
2
+ import { GetSet } from '../types.js';
3
+ import { Context } from '../Context.js';
3
4
  export interface ArrowConfig extends LineConfig {
4
5
  points: number[];
5
6
  tension?: number;
@@ -10,8 +11,8 @@ export interface ArrowConfig extends LineConfig {
10
11
  pointerAtEnding?: boolean;
11
12
  }
12
13
  export declare class Arrow extends Line<ArrowConfig> {
13
- _sceneFunc(ctx: any): void;
14
- __fillStroke(ctx: any): void;
14
+ _sceneFunc(ctx: Context): void;
15
+ __fillStroke(ctx: Context): void;
15
16
  getSelfRect(): {
16
17
  x: number;
17
18
  y: number;
@@ -1,9 +1,12 @@
1
- import { Factory } from '../Factory.js';
2
- import { Line } from './Line.js';
3
- import { getNumberValidator } from '../Validators.js';
4
- import { _registerNode } from '../Global.js';
5
- import { Path } from './Path.js';
6
- export class Arrow extends Line {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Arrow = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Line_1 = require("./Line");
6
+ const Validators_1 = require("../Validators");
7
+ const Global_1 = require("../Global");
8
+ const Path_1 = require("./Path");
9
+ class Arrow extends Line_1.Line {
7
10
  _sceneFunc(ctx) {
8
11
  super._sceneFunc(ctx);
9
12
  var PI2 = Math.PI * 2;
@@ -25,8 +28,8 @@ export class Arrow extends Line {
25
28
  points[n - 2],
26
29
  points[n - 1],
27
30
  ];
28
- const lastLength = Path.calcLength(tp[tp.length - 4], tp[tp.length - 3], 'C', lp);
29
- const previous = Path.getPointOnQuadraticBezier(Math.min(1, 1 - length / lastLength), lp[0], lp[1], lp[2], lp[3], lp[4], lp[5]);
31
+ const lastLength = Path_1.Path.calcLength(tp[tp.length - 4], tp[tp.length - 3], 'C', lp);
32
+ const previous = Path_1.Path.getPointOnQuadraticBezier(Math.min(1, 1 - length / lastLength), lp[0], lp[1], lp[2], lp[3], lp[4], lp[5]);
30
33
  dx = points[n - 2] - previous.x;
31
34
  dy = points[n - 1] - previous.y;
32
35
  }
@@ -91,9 +94,10 @@ export class Arrow extends Line {
91
94
  };
92
95
  }
93
96
  }
97
+ exports.Arrow = Arrow;
94
98
  Arrow.prototype.className = 'Arrow';
95
- _registerNode(Arrow);
96
- Factory.addGetterSetter(Arrow, 'pointerLength', 10, getNumberValidator());
97
- Factory.addGetterSetter(Arrow, 'pointerWidth', 10, getNumberValidator());
98
- Factory.addGetterSetter(Arrow, 'pointerAtBeginning', false);
99
- Factory.addGetterSetter(Arrow, 'pointerAtEnding', true);
99
+ (0, Global_1._registerNode)(Arrow);
100
+ Factory_1.Factory.addGetterSetter(Arrow, 'pointerLength', 10, (0, Validators_1.getNumberValidator)());
101
+ Factory_1.Factory.addGetterSetter(Arrow, 'pointerWidth', 10, (0, Validators_1.getNumberValidator)());
102
+ Factory_1.Factory.addGetterSetter(Arrow, 'pointerAtBeginning', false);
103
+ Factory_1.Factory.addGetterSetter(Arrow, 'pointerAtEnding', true);
@@ -1,13 +1,14 @@
1
- import { Shape, ShapeConfig } from '../Shape';
2
- import { GetSet } from '../types';
1
+ import { Shape, ShapeConfig } from '../Shape.js';
2
+ import { GetSet } from '../types.js';
3
+ import { Context } from '../Context.js';
3
4
  export interface CircleConfig extends ShapeConfig {
4
5
  radius?: number;
5
6
  }
6
7
  export declare class Circle extends Shape<CircleConfig> {
7
- _sceneFunc(context: any): void;
8
+ _sceneFunc(context: Context): void;
8
9
  getWidth(): number;
9
10
  getHeight(): number;
10
- setWidth(width: any): void;
11
- setHeight(height: any): void;
11
+ setWidth(width: number): void;
12
+ setHeight(height: number): void;
12
13
  radius: GetSet<number, this>;
13
14
  }
@@ -1,8 +1,11 @@
1
- import { Factory } from '../Factory.js';
2
- import { Shape } from '../Shape.js';
3
- import { getNumberValidator } from '../Validators.js';
4
- import { _registerNode } from '../Global.js';
5
- export class Circle extends Shape {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Circle = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Shape_1 = require("../Shape");
6
+ const Validators_1 = require("../Validators");
7
+ const Global_1 = require("../Global");
8
+ class Circle extends Shape_1.Shape {
6
9
  _sceneFunc(context) {
7
10
  context.beginPath();
8
11
  context.arc(0, 0, this.attrs.radius || 0, 0, Math.PI * 2, false);
@@ -26,8 +29,9 @@ export class Circle extends Shape {
26
29
  }
27
30
  }
28
31
  }
32
+ exports.Circle = Circle;
29
33
  Circle.prototype._centroid = true;
30
34
  Circle.prototype.className = 'Circle';
31
35
  Circle.prototype._attrsAffectingSize = ['radius'];
32
- _registerNode(Circle);
33
- Factory.addGetterSetter(Circle, 'radius', 0, getNumberValidator());
36
+ (0, Global_1._registerNode)(Circle);
37
+ Factory_1.Factory.addGetterSetter(Circle, 'radius', 0, (0, Validators_1.getNumberValidator)());
@@ -1,15 +1,16 @@
1
- import { Shape, ShapeConfig } from '../Shape';
2
- import { GetSet, Vector2d } from '../types';
1
+ import { Shape, ShapeConfig } from '../Shape.js';
2
+ import { Context } from '../Context.js';
3
+ import { GetSet, Vector2d } from '../types.js';
3
4
  export interface EllipseConfig extends ShapeConfig {
4
5
  radiusX: number;
5
6
  radiusY: number;
6
7
  }
7
8
  export declare class Ellipse extends Shape<EllipseConfig> {
8
- _sceneFunc(context: any): void;
9
+ _sceneFunc(context: Context): void;
9
10
  getWidth(): number;
10
11
  getHeight(): number;
11
- setWidth(width: any): void;
12
- setHeight(height: any): void;
12
+ setWidth(width: number): void;
13
+ setHeight(height: number): void;
13
14
  radius: GetSet<Vector2d, this>;
14
15
  radiusX: GetSet<number, this>;
15
16
  radiusY: GetSet<number, this>;
@@ -1,8 +1,11 @@
1
- import { Factory } from '../Factory.js';
2
- import { Shape } from '../Shape.js';
3
- import { getNumberValidator } from '../Validators.js';
4
- import { _registerNode } from '../Global.js';
5
- export class Ellipse extends Shape {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Ellipse = void 0;
4
+ const Factory_1 = require("../Factory");
5
+ const Shape_1 = require("../Shape");
6
+ const Validators_1 = require("../Validators");
7
+ const Global_1 = require("../Global");
8
+ class Ellipse extends Shape_1.Shape {
6
9
  _sceneFunc(context) {
7
10
  var rx = this.radiusX(), ry = this.radiusY();
8
11
  context.beginPath();
@@ -28,10 +31,11 @@ export class Ellipse extends Shape {
28
31
  this.radiusY(height / 2);
29
32
  }
30
33
  }
34
+ exports.Ellipse = Ellipse;
31
35
  Ellipse.prototype.className = 'Ellipse';
32
36
  Ellipse.prototype._centroid = true;
33
37
  Ellipse.prototype._attrsAffectingSize = ['radiusX', 'radiusY'];
34
- _registerNode(Ellipse);
35
- Factory.addComponentsGetterSetter(Ellipse, 'radius', ['x', 'y']);
36
- Factory.addGetterSetter(Ellipse, 'radiusX', 0, getNumberValidator());
37
- Factory.addGetterSetter(Ellipse, 'radiusY', 0, getNumberValidator());
38
+ (0, Global_1._registerNode)(Ellipse);
39
+ Factory_1.Factory.addComponentsGetterSetter(Ellipse, 'radius', ['x', 'y']);
40
+ Factory_1.Factory.addGetterSetter(Ellipse, 'radiusX', 0, (0, Validators_1.getNumberValidator)());
41
+ Factory_1.Factory.addGetterSetter(Ellipse, 'radiusY', 0, (0, Validators_1.getNumberValidator)());
@@ -1,6 +1,6 @@
1
- import { Shape, ShapeConfig } from '../Shape';
2
- import { GetSet, IRect } from '../types';
3
- import { Context } from '../Context';
1
+ import { Shape, ShapeConfig } from '../Shape.js';
2
+ import { GetSet, IRect } from '../types.js';
3
+ import { Context } from '../Context.js';
4
4
  export interface ImageConfig extends ShapeConfig {
5
5
  image: CanvasImageSource | undefined;
6
6
  crop?: IRect;
@@ -11,10 +11,10 @@ export declare class Image extends Shape<ImageConfig> {
11
11
  _setImageLoad(): void;
12
12
  _useBufferCanvas(): boolean;
13
13
  _sceneFunc(context: Context): void;
14
- _hitFunc(context: any): void;
14
+ _hitFunc(context: Context): void;
15
15
  getWidth(): any;
16
16
  getHeight(): any;
17
- static fromURL(url: any, callback: any, onError?: any): void;
17
+ static fromURL(url: string, callback: (img: Image) => void, onError?: OnErrorEventHandler): void;
18
18
  image: GetSet<CanvasImageSource | undefined, this>;
19
19
  crop: GetSet<IRect, this>;
20
20
  cropX: GetSet<number, this>;
@@ -1,9 +1,12 @@
1
- import { Util } from '../Util.js';
2
- import { Factory } from '../Factory.js';
3
- import { Shape } from '../Shape.js';
4
- import { _registerNode } from '../Global.js';
5
- import { getNumberOrArrayOfNumbersValidator, getNumberValidator, } from '../Validators.js';
6
- export class Image extends Shape {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Image = void 0;
4
+ const Util_1 = require("../Util");
5
+ const Factory_1 = require("../Factory");
6
+ const Shape_1 = require("../Shape");
7
+ const Global_1 = require("../Global");
8
+ const Validators_1 = require("../Validators");
9
+ class Image extends Shape_1.Shape {
7
10
  constructor(attrs) {
8
11
  super(attrs);
9
12
  this.on('imageChange.konva', () => {
@@ -57,7 +60,7 @@ export class Image extends Shape {
57
60
  if (this.hasFill() || this.hasStroke() || cornerRadius) {
58
61
  context.beginPath();
59
62
  cornerRadius
60
- ? Util.drawRoundedRectPath(context, width, height, cornerRadius)
63
+ ? Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius)
61
64
  : context.rect(0, 0, width, height);
62
65
  context.closePath();
63
66
  context.fillStrokeShape(this);
@@ -76,7 +79,7 @@ export class Image extends Shape {
76
79
  context.rect(0, 0, width, height);
77
80
  }
78
81
  else {
79
- Util.drawRoundedRectPath(context, width, height, cornerRadius);
82
+ Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);
80
83
  }
81
84
  context.closePath();
82
85
  context.fillStrokeShape(this);
@@ -90,7 +93,7 @@ export class Image extends Shape {
90
93
  return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;
91
94
  }
92
95
  static fromURL(url, callback, onError = null) {
93
- var img = Util.createImageElement();
96
+ var img = Util_1.Util.createImageElement();
94
97
  img.onload = function () {
95
98
  var image = new Image({
96
99
  image: img,
@@ -102,12 +105,13 @@ export class Image extends Shape {
102
105
  img.src = url;
103
106
  }
104
107
  }
108
+ exports.Image = Image;
105
109
  Image.prototype.className = 'Image';
106
- _registerNode(Image);
107
- Factory.addGetterSetter(Image, 'cornerRadius', 0, getNumberOrArrayOfNumbersValidator(4));
108
- Factory.addGetterSetter(Image, 'image');
109
- Factory.addComponentsGetterSetter(Image, 'crop', ['x', 'y', 'width', 'height']);
110
- Factory.addGetterSetter(Image, 'cropX', 0, getNumberValidator());
111
- Factory.addGetterSetter(Image, 'cropY', 0, getNumberValidator());
112
- Factory.addGetterSetter(Image, 'cropWidth', 0, getNumberValidator());
113
- Factory.addGetterSetter(Image, 'cropHeight', 0, getNumberValidator());
110
+ (0, Global_1._registerNode)(Image);
111
+ Factory_1.Factory.addGetterSetter(Image, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));
112
+ Factory_1.Factory.addGetterSetter(Image, 'image');
113
+ Factory_1.Factory.addComponentsGetterSetter(Image, 'crop', ['x', 'y', 'width', 'height']);
114
+ Factory_1.Factory.addGetterSetter(Image, 'cropX', 0, (0, Validators_1.getNumberValidator)());
115
+ Factory_1.Factory.addGetterSetter(Image, 'cropY', 0, (0, Validators_1.getNumberValidator)());
116
+ Factory_1.Factory.addGetterSetter(Image, 'cropWidth', 0, (0, Validators_1.getNumberValidator)());
117
+ Factory_1.Factory.addGetterSetter(Image, 'cropHeight', 0, (0, Validators_1.getNumberValidator)());