mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 08:40:13 +08:00
update deps, change defualt dragDistance to 3px
This commit is contained in:
parent
2fd798649b
commit
460feab0ae
@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [Not released][Not released]
|
||||
|
||||
### Changed
|
||||
- Default value for `dragDistance` is changed to 3px.
|
||||
|
||||
## [1.6.8][2017-08-19]
|
||||
|
||||
### Changed
|
||||
|
67
gulpfile.js
67
gulpfile.js
@ -1,20 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
var gulp = require('gulp');
|
||||
var rename = require('gulp-rename');
|
||||
var uglify = require('gulp-uglify');
|
||||
var concat = require('gulp-concat');
|
||||
var replace = require('gulp-replace');
|
||||
var mochaPhantomJS = require('gulp-mocha-phantomjs');
|
||||
var jsdoc = require('gulp-jsdoc');
|
||||
var jsdoc = require('gulp-jsdoc3');
|
||||
var connect = require('gulp-connect');
|
||||
var jscpd = require('gulp-jscpd');
|
||||
var eslint = require('gulp-eslint');
|
||||
|
||||
var fs = require('fs');
|
||||
var NodeParams = fs.readFileSync('./resources/doc-includes/NodeParams.txt').toString();
|
||||
var ContainerParams = fs.readFileSync('./resources/doc-includes/ContainerParams.txt').toString();
|
||||
var ShapeParams = fs.readFileSync('./resources/doc-includes/ShapeParams.txt').toString();
|
||||
var NodeParams = fs
|
||||
.readFileSync('./resources/doc-includes/NodeParams.txt')
|
||||
.toString();
|
||||
var ContainerParams = fs
|
||||
.readFileSync('./resources/doc-includes/ContainerParams.txt')
|
||||
.toString();
|
||||
var ShapeParams = fs
|
||||
.readFileSync('./resources/doc-includes/ShapeParams.txt')
|
||||
.toString();
|
||||
|
||||
var conf = require('./package.json');
|
||||
|
||||
@ -79,7 +83,8 @@ var sourceFiles = [
|
||||
];
|
||||
|
||||
function build() {
|
||||
return gulp.src(sourceFiles)
|
||||
return gulp
|
||||
.src(sourceFiles)
|
||||
.pipe(concat('konva-dev.js'))
|
||||
.pipe(replace('@@shapeParams', ShapeParams))
|
||||
.pipe(replace('@@nodeParams', NodeParams))
|
||||
@ -88,31 +93,28 @@ function build() {
|
||||
.pipe(replace('@@date', new Date().toDateString()));
|
||||
}
|
||||
|
||||
|
||||
// create development build
|
||||
gulp.task('dev-build', function() {
|
||||
return build()
|
||||
.pipe(gulp.dest('./dist/'));
|
||||
return build().pipe(gulp.dest('./dist/'));
|
||||
});
|
||||
|
||||
|
||||
// create usual build konva.js and konva.min.js
|
||||
gulp.task('build', function() {
|
||||
return build()
|
||||
.pipe(rename('konva.js'))
|
||||
.pipe(gulp.dest('./'))
|
||||
.pipe(uglify({
|
||||
.pipe(
|
||||
uglify({
|
||||
preserveComments: 'some'
|
||||
}))
|
||||
})
|
||||
)
|
||||
.pipe(rename('konva.min.js'))
|
||||
.pipe(gulp.dest('./'));
|
||||
});
|
||||
|
||||
// tun tests
|
||||
gulp.task('test', ['dev-build'], function () {
|
||||
return gulp
|
||||
.src('test/runner.html')
|
||||
.pipe(mochaPhantomJS());
|
||||
gulp.task('test', ['dev-build'], function() {
|
||||
return gulp.src('test/runner.html').pipe(mochaPhantomJS());
|
||||
});
|
||||
|
||||
// local server for better development
|
||||
@ -122,37 +124,44 @@ gulp.task('server', function() {
|
||||
|
||||
// lint files
|
||||
gulp.task('lint', function() {
|
||||
return gulp.src('./src/**/*.js')
|
||||
.pipe(eslint({
|
||||
return (gulp
|
||||
.src('./src/**/*.js')
|
||||
.pipe(
|
||||
eslint({
|
||||
configFile: './.eslintrc'
|
||||
}))
|
||||
})
|
||||
)
|
||||
// eslint.format() outputs the lint results to the console.
|
||||
// Alternatively use eslint.formatEach() (see Docs).
|
||||
.pipe(eslint.format())
|
||||
// To have the process exit with an error code (1) on
|
||||
// lint error, return the stream and pipe to failOnError last.
|
||||
.pipe(eslint.failOnError());
|
||||
.pipe(eslint.failOnError()) );
|
||||
});
|
||||
|
||||
// check code for duplication
|
||||
gulp.task('inspect', function() {
|
||||
return gulp.src('./src/**/*.js')
|
||||
.pipe(jscpd({
|
||||
return gulp.src('./src/**/*.js').pipe(
|
||||
jscpd({
|
||||
'min-lines': 10,
|
||||
verbose: true
|
||||
}));
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
// generate documentation
|
||||
// // generate documentation
|
||||
gulp.task('api', function() {
|
||||
return gulp.src('./src/**/*.js')
|
||||
.pipe(jsdoc('./api'));
|
||||
return gulp.src('./src/**/*.js').pipe(
|
||||
jsdoc({
|
||||
opts: {
|
||||
destination: './api'
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('watch', function() {
|
||||
gulp.watch(['src/**/*.js'], ['dev-build']);
|
||||
});
|
||||
|
||||
|
||||
gulp.task('default', ['dev-build', 'watch', 'server']);
|
||||
|
8
konva.js
8
konva.js
@ -2,7 +2,7 @@
|
||||
* Konva JavaScript Framework v1.6.8
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT or GPL Version 2 licenses.
|
||||
* Date: Sat Aug 19 2017
|
||||
* Date: Thu Aug 24 2017
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - 2017 by Anton Lavrenov (Konva)
|
||||
@ -10567,7 +10567,7 @@
|
||||
*/
|
||||
})();
|
||||
|
||||
(function() {
|
||||
(function(Konva) {
|
||||
'use strict';
|
||||
/**
|
||||
* BaseLayer constructor.
|
||||
@ -10604,8 +10604,6 @@
|
||||
* @param {Number} [config.clipHeight] set clip height
|
||||
* @param {Function} [config.clipFunc] set clip func
|
||||
|
||||
* @example
|
||||
* var layer = new Konva.Layer();
|
||||
*/
|
||||
Konva.BaseLayer = function(config) {
|
||||
this.___init(config);
|
||||
@ -10840,7 +10838,7 @@
|
||||
*/
|
||||
|
||||
Konva.Collection.mapMethods(Konva.BaseLayer);
|
||||
})();
|
||||
})(Konva);
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
12
konva.min.js
vendored
12
konva.min.js
vendored
File diff suppressed because one or more lines are too long
31
package.json
31
package.json
@ -2,13 +2,7 @@
|
||||
"name": "konva",
|
||||
"version": "1.6.8",
|
||||
"author": "Anton Lavrenov",
|
||||
"files": [
|
||||
"README.md",
|
||||
"konva.js",
|
||||
"konva.min.js",
|
||||
"src",
|
||||
"konva.d.ts"
|
||||
],
|
||||
"files": ["README.md", "konva.js", "konva.min.js", "src", "konva.d.ts"],
|
||||
"main": "konva.js",
|
||||
"typings": "./konva.d.ts",
|
||||
"scripts": {
|
||||
@ -20,27 +14,22 @@
|
||||
"prettier": "prettier --write \"src/**/*.js\" \"test/**/*.js\" --single-quote"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "3.5.0",
|
||||
"chai": "4.1.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-connect": "^5.0.0",
|
||||
"gulp-eslint": "^3.0.1",
|
||||
"gulp-jscpd": "0.0.7",
|
||||
"gulp-jsdoc": "^0.1.5",
|
||||
"gulp-eslint": "^4.0.0",
|
||||
"gulp-jscpd": "0.0.8",
|
||||
"gulp-jsdoc3": "^1.0.1",
|
||||
"gulp-mocha-phantomjs": "^0.12.1",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-uglify": "^2.1.2",
|
||||
"gulp-replace": "^0.6.1",
|
||||
"gulp-uglify": "^3.0.0",
|
||||
"gulp-util": "^3.0.8",
|
||||
"mocha": "3.3.0",
|
||||
"prettier": "^1.2.2"
|
||||
"mocha": "3.5.0",
|
||||
"prettier": "^1.5.3"
|
||||
},
|
||||
"keywords": [
|
||||
"canvas",
|
||||
"animations",
|
||||
"graphic",
|
||||
"html5"
|
||||
],
|
||||
"keywords": ["canvas", "animations", "graphic", "html5"],
|
||||
"browser": {
|
||||
"canvas": false,
|
||||
"jsdom": false
|
||||
|
@ -1,4 +1,4 @@
|
||||
(function() {
|
||||
(function(Konva) {
|
||||
'use strict';
|
||||
/**
|
||||
* BaseLayer constructor.
|
||||
@ -10,8 +10,6 @@
|
||||
* to clear the canvas before each layer draw. The default value is true.
|
||||
* @@nodeParams
|
||||
* @@containerParams
|
||||
* @example
|
||||
* var layer = new Konva.Layer();
|
||||
*/
|
||||
Konva.BaseLayer = function(config) {
|
||||
this.___init(config);
|
||||
@ -246,4 +244,4 @@
|
||||
*/
|
||||
|
||||
Konva.Collection.mapMethods(Konva.BaseLayer);
|
||||
})();
|
||||
})(Konva);
|
||||
|
@ -65,14 +65,14 @@
|
||||
pixelRatio: undefined,
|
||||
/**
|
||||
* Drag distance property. If you start to drag a node you may want to wait until pointer is moved to some distance from start point,
|
||||
* only then start dragging.
|
||||
* only then start dragging. Default is 3px.
|
||||
* @property dragDistance
|
||||
* @default 0
|
||||
* @memberof Konva
|
||||
* @example
|
||||
* Konva.dragDistance = 10;
|
||||
*/
|
||||
dragDistance: 0,
|
||||
dragDistance: 3,
|
||||
/**
|
||||
* Use degree values for angle properties. You may set this property to false if you want to use radiant values.
|
||||
* @property angleDeg
|
||||
|
@ -1712,7 +1712,7 @@ suite('Node', function() {
|
||||
layer.add(rect1).add(group);
|
||||
stage.add(layer);
|
||||
|
||||
assert.equal(rect1.dragDistance(), 0);
|
||||
assert.equal(rect1.dragDistance(), Konva.dragDistance);
|
||||
assert.equal(group.dragDistance(), 2);
|
||||
assert.equal(rect2.dragDistance(), 2);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user