konva 10.5.0 → 10.7.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.
- package/README.md +16 -12
- package/konva.js +3623 -3819
- package/konva.min.js +4 -4
- package/lib/Animation.d.ts +2 -2
- package/lib/Animation.js +2 -2
- package/lib/BezierFunctions.d.ts +1 -1
- package/lib/BezierFunctions.js +76 -116
- package/lib/Canvas.d.ts +10 -3
- package/lib/Canvas.js +91 -10
- package/lib/Container.d.ts +3 -2
- package/lib/Container.js +31 -17
- package/lib/Context.d.ts +9 -7
- package/lib/Context.js +99 -73
- package/lib/DragAndDrop.d.ts +4 -3
- package/lib/DragAndDrop.js +39 -25
- package/lib/Factory.d.ts +3 -2
- package/lib/Factory.js +10 -9
- package/lib/Global.d.ts +2 -7
- package/lib/Global.js +8 -9
- package/lib/Group.d.ts +7 -1
- package/lib/Group.js +61 -0
- package/lib/Layer.d.ts +1 -1
- package/lib/Layer.js +13 -8
- package/lib/Node.d.ts +25 -19
- package/lib/Node.js +178 -169
- package/lib/PointerEvents.d.ts +1 -2
- package/lib/PointerEvents.js +20 -18
- package/lib/Shape.d.ts +9 -15
- package/lib/Shape.js +190 -86
- package/lib/Stage.d.ts +19 -15
- package/lib/Stage.js +184 -99
- package/lib/Tween.js +59 -66
- package/lib/Util.d.ts +3 -2
- package/lib/Util.js +46 -16
- package/lib/_CoreInternals.d.ts +23 -11
- package/lib/_FullInternals.d.ts +23 -11
- package/lib/filters/Blur.js +16 -12
- package/lib/filters/Brighten.d.ts +1 -0
- package/lib/filters/Brighten.js +1 -0
- package/lib/filters/Brightness.d.ts +2 -1
- package/lib/filters/Brightness.js +4 -4
- package/lib/filters/Emboss.js +16 -58
- package/lib/filters/Kaleidoscope.js +8 -15
- package/lib/filters/Mask.js +8 -8
- package/lib/filters/Pixelate.js +16 -29
- package/lib/filters/Threshold.d.ts +1 -1
- package/lib/filters/Threshold.js +1 -1
- package/lib/shapes/Arc.js +8 -6
- package/lib/shapes/Arrow.d.ts +3 -6
- package/lib/shapes/Arrow.js +75 -47
- package/lib/shapes/Circle.d.ts +1 -0
- package/lib/shapes/Circle.js +4 -1
- package/lib/shapes/Ellipse.d.ts +1 -0
- package/lib/shapes/Ellipse.js +4 -1
- package/lib/shapes/Image.d.ts +2 -1
- package/lib/shapes/Image.js +22 -22
- package/lib/shapes/Label.d.ts +2 -3
- package/lib/shapes/Label.js +25 -41
- package/lib/shapes/Line.d.ts +2 -1
- package/lib/shapes/Line.js +5 -2
- package/lib/shapes/Path.d.ts +11 -2
- package/lib/shapes/Path.js +133 -143
- package/lib/shapes/Rect.d.ts +1 -0
- package/lib/shapes/Rect.js +4 -1
- package/lib/shapes/RegularPolygon.js +2 -2
- package/lib/shapes/Ring.d.ts +7 -0
- package/lib/shapes/Ring.js +8 -1
- package/lib/shapes/Sprite.d.ts +2 -1
- package/lib/shapes/Sprite.js +8 -9
- package/lib/shapes/Star.d.ts +6 -0
- package/lib/shapes/Star.js +5 -1
- package/lib/shapes/Text.d.ts +16 -5
- package/lib/shapes/Text.js +134 -65
- package/lib/shapes/TextPath.d.ts +11 -3
- package/lib/shapes/TextPath.js +56 -27
- package/lib/shapes/Transformer.js +95 -96
- package/lib/shapes/Wedge.js +1 -1
- package/lib/types.d.ts +2 -2
- package/package.json +5 -20
package/README.md
CHANGED
|
@@ -30,12 +30,12 @@ This repository began as a GitHub fork of [ericdrowell/KineticJS](https://github
|
|
|
30
30
|
|
|
31
31
|
## Framework integrations
|
|
32
32
|
|
|
33
|
-
| Framework | Package
|
|
34
|
-
|
|
35
|
-
| React
|
|
36
|
-
| Vue
|
|
37
|
-
| Svelte
|
|
38
|
-
| Angular
|
|
33
|
+
| Framework | Package | Documentation |
|
|
34
|
+
| --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
|
35
|
+
| React | [`react-konva`](https://www.npmjs.com/package/react-konva) | [React guide](https://konvajs.org/docs/react/index.html) |
|
|
36
|
+
| Vue | [`vue-konva`](https://www.npmjs.com/package/vue-konva) | [Vue guide](https://konvajs.org/docs/vue/index.html) |
|
|
37
|
+
| Svelte | [`svelte-konva`](https://www.npmjs.com/package/svelte-konva) | [Svelte guide](https://konvajs.org/docs/svelte/index.html) |
|
|
38
|
+
| Angular | [`ng2-konva`](https://www.npmjs.com/package/ng2-konva) | [Angular guide](https://konvajs.org/docs/angular/index.html) |
|
|
39
39
|
|
|
40
40
|
# Quick Look
|
|
41
41
|
|
|
@@ -48,8 +48,12 @@ document.body.appendChild(container);
|
|
|
48
48
|
const stage = new Konva.Stage({ container, width: 600, height: 400 });
|
|
49
49
|
const layer = new Konva.Layer();
|
|
50
50
|
const box = new Konva.Rect({
|
|
51
|
-
x: 50,
|
|
52
|
-
|
|
51
|
+
x: 50,
|
|
52
|
+
y: 50,
|
|
53
|
+
width: 120,
|
|
54
|
+
height: 80,
|
|
55
|
+
fill: '#00a8e8',
|
|
56
|
+
draggable: true,
|
|
53
57
|
});
|
|
54
58
|
|
|
55
59
|
layer.add(box);
|
|
@@ -133,7 +137,7 @@ npm install konva canvas
|
|
|
133
137
|
npm install konva skia-canvas
|
|
134
138
|
```
|
|
135
139
|
|
|
136
|
-
|
|
140
|
+
Use the same scene graph API for server-side rendering and omit the stage's `container` attribute. DOM events require a browser, and canvas feature support depends on the selected backend.
|
|
137
141
|
|
|
138
142
|
```js
|
|
139
143
|
import Konva from 'konva';
|
|
@@ -143,7 +147,7 @@ const stage = new Konva.Stage({
|
|
|
143
147
|
width: 500,
|
|
144
148
|
height: 500,
|
|
145
149
|
});
|
|
146
|
-
//
|
|
150
|
+
// Add shapes and export the stage with the usual Konva drawing API.
|
|
147
151
|
```
|
|
148
152
|
|
|
149
153
|
# Backers
|
|
@@ -172,11 +176,11 @@ Konva uses Mocha for testing.
|
|
|
172
176
|
- While developing it is easy to use `npm start`. Just run it and go to [http://localhost:1234/unit-tests.html](http://localhost:1234/unit-tests.html). The watcher will rebuild the bundle on any change.
|
|
173
177
|
|
|
174
178
|
Konva is covered with hundreds of tests and well over a thousand assertions.
|
|
175
|
-
|
|
179
|
+
For each feature or bug fix, write a failing test first, implement the behavior, then verify that the test passes (test-driven development).
|
|
176
180
|
|
|
177
181
|
## Generate documentation
|
|
178
182
|
|
|
179
|
-
Run `npx gulp api`
|
|
183
|
+
Run `npm run build`, then `npx gulp api` to generate documentation from the current bundle in the `api` folder.
|
|
180
184
|
|
|
181
185
|
# Pull Requests
|
|
182
186
|
|