update CHANGELOG with new version

This commit is contained in:
Anton Lavrenov 2021-05-21 18:20:52 -05:00
parent 76bfb69899
commit c4ae3a1880
4 changed files with 7 additions and 22 deletions

View File

@ -25,7 +25,7 @@ group.find('Shape').forEach((shape) => shape.visible(false));
**New features:** **New features:**
- All updates on canvas will do automatic redraw with `layer.batchDraw()`. This features is configurable with `Konva.autoDrawEnbaled` property. - All updates on canvas will do automatic redraw with `layer.batchDraw()`. This features is configurable with `Konva.autoDrawEnabled` property. Konva will automatically redraw layer when you change any property, remove or add nodes, do caching. So you don't need to call `layer.draw()` or `layer.batchDraw()` in most of the cases.
- New method `layer.getNativeCanvasElement()` - New method `layer.getNativeCanvasElement()`
- new `flipEnabled` property for `Konva.Transformer` - new `flipEnabled` property for `Konva.Transformer`
- new `node.isClientRectOnScreen()` method - new `node.isClientRectOnScreen()` method

View File

@ -21,7 +21,7 @@ This repository began as a GitHub fork of [ericdrowell/KineticJS](https://github
# Quick Look # Quick Look
```html ```html
<script src="https://unpkg.com/konva@7.2.5/konva.min.js"></script> <script src="https://unpkg.com/konva@8/konva.min.js"></script>
<div id="container"></div> <div id="container"></div>
<script> <script>
var stage = new Konva.Stage({ var stage = new Konva.Stage({
@ -47,8 +47,6 @@ This repository began as a GitHub fork of [ericdrowell/KineticJS](https://github
}); });
layer.add(box); layer.add(box);
layer.draw();
// add cursor styling // add cursor styling
box.on('mouseover', function () { box.on('mouseover', function () {
document.body.style.cursor = 'pointer'; document.body.style.cursor = 'pointer';
@ -72,10 +70,10 @@ Konva supports UMD loading. So you can use all possible variants to load the fra
### 1 Load Konva via classical `<script>` tag: ### 1 Load Konva via classical `<script>` tag:
```html ```html
<script src="https://unpkg.com/konva@7.2.5/konva.min.js"></script> <script src="https://unpkg.com/konva@8/konva.min.js"></script>
``` ```
You can also use a CDN: [https://unpkg.com/konva@7.2.5/konva.min.js](https://unpkg.com/konva@7.2.5/konva.min.js) You can also use a CDN: [https://unpkg.com/konva@8/konva.min.js](https://unpkg.com/konva@8/konva.min.js)
### 2 Install with npm: ### 2 Install with npm:
@ -84,21 +82,17 @@ npm install konva --save
``` ```
```javascript ```javascript
// The old way (e.g. a CommonJS-style import)
var Konva = require('konva');
// The modern way (e.g. an ES6-style import for webpack, parcel) // The modern way (e.g. an ES6-style import for webpack, parcel)
import Konva from 'konva'; import Konva from 'konva';
``` ```
#### Typescript usage #### Typescript usage
Add DOM definitions into your `tsconfig.json` and set `esModuleInterop` to `true`: Add DOM definitions into your `tsconfig.json`:
``` ```
{ {
"compilerOptions": { "compilerOptions": {
"esModuleInterop": true,
"lib": [ "lib": [
"es6", "es6",
"dom" "dom"
@ -107,12 +101,6 @@ Add DOM definitions into your `tsconfig.json` and set `esModuleInterop` to `true
} }
``` ```
Then use it:
```javascript
import Konva from 'konva';
```
### 3 Minimal bundle ### 3 Minimal bundle
```javascript ```javascript

View File

@ -6,14 +6,12 @@
"README.md", "README.md",
"konva.js", "konva.js",
"konva.min.js", "konva.min.js",
"konva.d.ts",
"types",
"lib" "lib"
], ],
"type": "module", "type": "module",
"main": "./lib/index-node.js", "main": "./lib/index-node.js",
"browser": "./lib/index.js", "browser": "./lib/index.js",
"typings": "./types/index-types.d.ts", "typings": "./lib/index-types.d.ts",
"scripts": { "scripts": {
"start": "npm run test:watch", "start": "npm run test:watch",
"compile": "npm run clean && npm run tsc && cp ./src/index-types.d.ts ./lib/index-types.d.ts && npm run rollup", "compile": "npm run clean && npm run tsc && cp ./src/index-types.d.ts ./lib/index-types.d.ts && npm run rollup",

View File

@ -105,8 +105,7 @@ var ABSOLUTE_OPACITY = 'absoluteOpacity',
'offsetXChange.konva', 'offsetXChange.konva',
'offsetYChange.konva', 'offsetYChange.konva',
'transformsEnabledChange.konva', 'transformsEnabledChange.konva',
].join(SPACE), ].join(SPACE);
SCALE_CHANGE_STR = ['scaleXChange.konva', 'scaleYChange.konva'].join(SPACE);
let idCounter = 1; let idCounter = 1;