mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fix test
This commit is contained in:
parent
dff085fb60
commit
b6e8afec6e
20
.travis.yml
20
.travis.yml
@ -1,20 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- node
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install -g gulp
|
||||
script:
|
||||
- npm run full-build
|
||||
deploy:
|
||||
provider: npm
|
||||
email: lavrton@gmail.com
|
||||
api_key:
|
||||
secure: rYqyBhn3K8tnt/XK6RFodBiIsIqwmUuPBEAOQxRt/elK4F7BVC+ba7/xgsvdFLP+Bqn4sS8b/YjfxUqm0lfxoph3qvvyKZ+qjuGCXBtvbY8EgGqX3FJKq/LJp8Vu4encCUOpI3PWXQEB+0OrC8ntKnBn1L1WP6lzDbRHj49e9ew=
|
||||
on:
|
||||
tags: true
|
||||
all_branches: true
|
||||
repo: konvajs/konva
|
@ -16,7 +16,7 @@ This repository began as a GitHub fork of [ericdrowell/KineticJS](https://github
|
||||
|
||||
- **Visit:** The [Home Page](http://konvajs.org/) and follow on [Twitter](https://twitter.com/lavrton)
|
||||
- **Discover:** [Tutorials](http://konvajs.org/docs), [API Documentation](http://konvajs.org/api)
|
||||
- **Help:** [StackOverflow](http://stackoverflow.com/questions/tagged/konvajs), [Chat](https://gitter.im/konvajs/konva)
|
||||
- **Help:** [StackOverflow](http://stackoverflow.com/questions/tagged/konvajs), [Discord Chat](https://discord.gg/8FqZwVT)
|
||||
|
||||
# Quick Look
|
||||
|
||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -19,7 +19,7 @@
|
||||
"compile": "npm run clean && npm run tsc && cp ./src/index-types.d.ts ./lib/index-types.d.ts && npm run rollup",
|
||||
"build": "npm run compile && cp ./src/index-types.d.ts ./lib && gulp build",
|
||||
"full-build": "npm run build && npm t",
|
||||
"test": "node ./test/import-test.js && npm run test:browser && npm run test:node",
|
||||
"test": "node ./test/import-test.js && npm run test:browser",
|
||||
"test:build": "parcel build ./test/unit-tests.html --dist-dir test-build --target none --public-url ./ --no-source-maps",
|
||||
"test:browser": "npm run test:build && mocha-headless-chrome -f ./test-build/unit-tests.html -a disable-web-security",
|
||||
"test:node": "env TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha -r ts-node/register test/unit/**/*.ts --exit",
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { glob } from './Global.js';
|
||||
import { Layer } from './Layer.js';
|
||||
import { glob } from './Global';
|
||||
import { Layer } from './Layer';
|
||||
import { IFrame, AnimationFn } from './types';
|
||||
import { Util } from './Util.js';
|
||||
import { Util } from './Util';
|
||||
|
||||
var now = (function (): () => number {
|
||||
if (glob.performance && glob.performance.now) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Util } from './Util.js';
|
||||
import { SceneContext, HitContext, Context } from './Context.js';
|
||||
import { Konva } from './Global.js';
|
||||
import { Factory } from './Factory.js';
|
||||
import { getNumberValidator } from './Validators.js';
|
||||
import { Util } from './Util';
|
||||
import { SceneContext, HitContext, Context } from './Context';
|
||||
import { Konva } from './Global';
|
||||
import { Factory } from './Factory';
|
||||
import { getNumberValidator } from './Validators';
|
||||
|
||||
// calculate pixel ratio
|
||||
var _pixelRatio;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Factory } from './Factory.js';
|
||||
import { Node, NodeConfig } from './Node.js';
|
||||
import { getNumberValidator } from './Validators.js';
|
||||
import { Factory } from './Factory';
|
||||
import { Node, NodeConfig } from './Node';
|
||||
import { getNumberValidator } from './Validators';
|
||||
|
||||
import { GetSet, IRect } from './types';
|
||||
import { Shape } from './Shape.js';
|
||||
import { HitCanvas, SceneCanvas } from './Canvas.js';
|
||||
import { Shape } from './Shape';
|
||||
import { HitCanvas, SceneCanvas } from './Canvas';
|
||||
|
||||
export interface ContainerConfig extends NodeConfig {
|
||||
clearBeforeDraw?: boolean;
|
||||
@ -309,15 +309,15 @@ export abstract class Container<
|
||||
|
||||
return arr;
|
||||
}
|
||||
_clearSelfAndDescendantCache(attr?: string, forceEvent?: boolean) {
|
||||
super._clearSelfAndDescendantCache(attr, forceEvent);
|
||||
_clearSelfAndDescendantCache(attr?: string) {
|
||||
super._clearSelfAndDescendantCache(attr);
|
||||
// skip clearing if node is cached with canvas
|
||||
// for performance reasons !!!
|
||||
if (this.isCached()) {
|
||||
return;
|
||||
}
|
||||
this.children?.forEach(function (node) {
|
||||
node._clearSelfAndDescendantCache(attr, forceEvent);
|
||||
node._clearSelfAndDescendantCache(attr);
|
||||
});
|
||||
}
|
||||
_setChildrenIndices() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Util } from './Util.js';
|
||||
import { Konva } from './Global.js';
|
||||
import { Canvas } from './Canvas.js';
|
||||
import { Shape } from './Shape.js';
|
||||
import { Util } from './Util';
|
||||
import { Konva } from './Global';
|
||||
import { Canvas } from './Canvas';
|
||||
import { Shape } from './Shape';
|
||||
|
||||
var COMMA = ',',
|
||||
OPEN_PAREN = '(',
|
||||
|
@ -1,5 +1,5 @@
|
||||
// enter file of limited Konva version with only core functions
|
||||
export { Konva } from './_CoreInternals.js';
|
||||
import { Konva } from './_CoreInternals.js';
|
||||
export { Konva } from './_CoreInternals';
|
||||
import { Konva } from './_CoreInternals';
|
||||
|
||||
export default Konva;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Konva } from './Global.js';
|
||||
import { Node } from './Node.js';
|
||||
import { Konva } from './Global';
|
||||
import { Node } from './Node';
|
||||
import { Vector2d } from './types';
|
||||
import { Util } from './Util.js';
|
||||
import { Util } from './Util';
|
||||
|
||||
export const DD = {
|
||||
get isDragging() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Util } from './Util.js';
|
||||
import { getComponentValidator } from './Validators.js';
|
||||
import { Util } from './Util';
|
||||
import { getComponentValidator } from './Validators';
|
||||
|
||||
var GET = 'get',
|
||||
SET = 'set';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Util } from './Util.js';
|
||||
import { Layer } from './Layer.js';
|
||||
import { _registerNode } from './Global.js';
|
||||
import { Util } from './Util';
|
||||
import { Layer } from './Layer';
|
||||
import { _registerNode } from './Global';
|
||||
|
||||
/**
|
||||
* FastLayer constructor. **DEPRECATED!** Please use `Konva.Layer({ listening: false})` instead. Layers are tied to their own canvas element and are used
|
||||
|
10
src/Group.ts
10
src/Group.ts
@ -1,8 +1,8 @@
|
||||
import { Util } from './Util.js';
|
||||
import { Container } from './Container.js';
|
||||
import { _registerNode } from './Global.js';
|
||||
import { Node } from './Node.js';
|
||||
import { Shape } from './Shape.js';
|
||||
import { Util } from './Util';
|
||||
import { Container } from './Container';
|
||||
import { _registerNode } from './Global';
|
||||
import { Node } from './Node';
|
||||
import { Shape } from './Shape';
|
||||
|
||||
/**
|
||||
* Group constructor. Groups are used to contain shapes or other groups.
|
||||
|
20
src/Layer.ts
20
src/Layer.ts
@ -1,15 +1,15 @@
|
||||
import { Util } from './Util.js';
|
||||
import { Container, ContainerConfig } from './Container.js';
|
||||
import { Node } from './Node.js';
|
||||
import { Factory } from './Factory.js';
|
||||
import { SceneCanvas, HitCanvas } from './Canvas.js';
|
||||
import { Stage } from './Stage.js';
|
||||
import { getBooleanValidator } from './Validators.js';
|
||||
import { Util } from './Util';
|
||||
import { Container, ContainerConfig } from './Container';
|
||||
import { Node } from './Node';
|
||||
import { Factory } from './Factory';
|
||||
import { SceneCanvas, HitCanvas } from './Canvas';
|
||||
import { Stage } from './Stage';
|
||||
import { getBooleanValidator } from './Validators';
|
||||
|
||||
import { GetSet, Vector2d } from './types';
|
||||
import { Group } from './Group.js';
|
||||
import { Shape, shapes } from './Shape.js';
|
||||
import { _registerNode } from './Global.js';
|
||||
import { Group } from './Group';
|
||||
import { Shape, shapes } from './Shape';
|
||||
import { _registerNode } from './Global';
|
||||
|
||||
export interface LayerConfig extends ContainerConfig {
|
||||
clearBeforeDraw?: boolean;
|
||||
|
28
src/Node.ts
28
src/Node.ts
@ -1,19 +1,19 @@
|
||||
import { Util, Transform } from './Util.js';
|
||||
import { Factory } from './Factory.js';
|
||||
import { SceneCanvas, HitCanvas, Canvas } from './Canvas.js';
|
||||
import { Konva } from './Global.js';
|
||||
import { Container } from './Container.js';
|
||||
import { Util, Transform } from './Util';
|
||||
import { Factory } from './Factory';
|
||||
import { SceneCanvas, HitCanvas, Canvas } from './Canvas';
|
||||
import { Konva } from './Global';
|
||||
import { Container } from './Container';
|
||||
import { GetSet, Vector2d, IRect } from './types';
|
||||
import { DD } from './DragAndDrop.js';
|
||||
import { DD } from './DragAndDrop';
|
||||
import {
|
||||
getNumberValidator,
|
||||
getStringValidator,
|
||||
getBooleanValidator,
|
||||
} from './Validators.js';
|
||||
import { Stage } from './Stage.js';
|
||||
import { Context } from './Context.js';
|
||||
import { Shape } from './Shape.js';
|
||||
import { Layer } from './Layer.js';
|
||||
} from './Validators';
|
||||
import { Stage } from './Stage';
|
||||
import { Context } from './Context';
|
||||
import { Shape } from './Shape';
|
||||
import { Layer } from './Layer';
|
||||
|
||||
export const ids: any = {};
|
||||
export const names: any = {};
|
||||
@ -1162,7 +1162,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
this._batchingTransformChange = false;
|
||||
if (this._needClearTransformCache) {
|
||||
this._clearCache(TRANSFORM);
|
||||
this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM, true);
|
||||
this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);
|
||||
}
|
||||
this._needClearTransformCache = false;
|
||||
}
|
||||
@ -1208,7 +1208,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
if (haveCachedParent && !top) {
|
||||
// make fake top element
|
||||
// "true" is not a node, but it will just allow skip all caching
|
||||
top = true;
|
||||
top = true as any;
|
||||
}
|
||||
var absoluteMatrix = this.getAbsoluteTransform(top).getMatrix(),
|
||||
absoluteTransform = new Transform(),
|
||||
@ -1553,7 +1553,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
* // get one of the parent group
|
||||
* var parentGroups = node.findAncestors('Group');
|
||||
*/
|
||||
findAncestors(selector: string, includeSelf?: boolean, stopNode?: Container) {
|
||||
findAncestors(selector: string, includeSelf?: boolean, stopNode?: Node) {
|
||||
var res: Array<Node> = [];
|
||||
|
||||
if (includeSelf && this._isMatch(selector)) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { KonvaEventObject } from './Node.js';
|
||||
import { Konva } from './Global.js';
|
||||
import { KonvaEventObject } from './Node';
|
||||
import { Konva } from './Global';
|
||||
|
||||
import { Shape } from './Shape.js';
|
||||
import { Stage } from './Stage.js';
|
||||
import { Shape } from './Shape';
|
||||
import { Stage } from './Stage';
|
||||
|
||||
const Captures = new Map<number, Shape | Stage>();
|
||||
|
||||
|
16
src/Shape.ts
16
src/Shape.ts
@ -1,20 +1,20 @@
|
||||
import { Util } from './Util.js';
|
||||
import { Factory } from './Factory.js';
|
||||
import { Node, NodeConfig } from './Node.js';
|
||||
import { Util } from './Util';
|
||||
import { Factory } from './Factory';
|
||||
import { Node, NodeConfig } from './Node';
|
||||
import {
|
||||
getNumberValidator,
|
||||
getNumberOrAutoValidator,
|
||||
getStringValidator,
|
||||
getBooleanValidator,
|
||||
getStringOrGradientValidator,
|
||||
} from './Validators.js';
|
||||
} from './Validators';
|
||||
|
||||
import { Context, SceneContext } from './Context.js';
|
||||
import { _registerNode } from './Global.js';
|
||||
import * as PointerEvents from './PointerEvents.js';
|
||||
import { Context, SceneContext } from './Context';
|
||||
import { _registerNode } from './Global';
|
||||
import * as PointerEvents from './PointerEvents';
|
||||
|
||||
import { GetSet, Vector2d } from './types';
|
||||
import { HitCanvas, SceneCanvas } from './Canvas.js';
|
||||
import { HitCanvas, SceneCanvas } from './Canvas';
|
||||
|
||||
// hack from here https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types/52668133#52668133
|
||||
export type ShapeConfigHandler<TTarget> = {
|
||||
|
21
src/Stage.ts
21
src/Stage.ts
@ -1,14 +1,14 @@
|
||||
import { Util } from './Util.js';
|
||||
import { Factory } from './Factory.js';
|
||||
import { Container, ContainerConfig } from './Container.js';
|
||||
import { Konva } from './Global.js';
|
||||
import { SceneCanvas, HitCanvas } from './Canvas.js';
|
||||
import { Util } from './Util';
|
||||
import { Factory } from './Factory';
|
||||
import { Container, ContainerConfig } from './Container';
|
||||
import { Konva } from './Global';
|
||||
import { SceneCanvas, HitCanvas } from './Canvas';
|
||||
import { GetSet, Vector2d } from './types';
|
||||
import { Shape } from './Shape.js';
|
||||
import { Layer } from './Layer.js';
|
||||
import { DD } from './DragAndDrop.js';
|
||||
import { _registerNode } from './Global.js';
|
||||
import * as PointerEvents from './PointerEvents.js';
|
||||
import { Shape } from './Shape';
|
||||
import { Layer } from './Layer';
|
||||
import { DD } from './DragAndDrop';
|
||||
import { _registerNode } from './Global';
|
||||
import * as PointerEvents from './PointerEvents';
|
||||
|
||||
export interface StageConfig extends ContainerConfig {
|
||||
container: HTMLDivElement | string;
|
||||
@ -464,7 +464,6 @@ export class Stage extends Container<Layer> {
|
||||
this._fire(CONTENT_MOUSEOUT, { evt: evt });
|
||||
}
|
||||
_mousemove(evt) {
|
||||
|
||||
this.setPointersPositions(evt);
|
||||
var pointerId = Util._getFirstPointerId(evt);
|
||||
var targetShape = this.targetShape?.getStage() ? this.targetShape : null;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Util } from './Util.js';
|
||||
import { Animation } from './Animation.js';
|
||||
import { Node, NodeConfig } from './Node.js';
|
||||
import { Konva } from './Global.js';
|
||||
import { Util } from './Util';
|
||||
import { Animation } from './Animation';
|
||||
import { Node, NodeConfig } from './Node';
|
||||
import { Konva } from './Global';
|
||||
import { Line } from './shapes/Line';
|
||||
|
||||
var blacklist = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Konva } from './Global.js';
|
||||
import { Konva } from './Global';
|
||||
import { IRect, RGB, RGBA, Vector2d } from './types';
|
||||
|
||||
/*
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Konva } from './Global.js';
|
||||
import { Util } from './Util.js';
|
||||
import { Konva } from './Global';
|
||||
import { Util } from './Util';
|
||||
|
||||
function _formatValue(val: any) {
|
||||
if (Util._isString(val)) {
|
||||
|
@ -1,26 +1,26 @@
|
||||
// what is core parts of Konva?
|
||||
import { Konva as Global } from './Global.js';
|
||||
import { Konva as Global } from './Global';
|
||||
|
||||
import { Util, Transform } from './Util.js';
|
||||
import { Node, ids, names } from './Node.js';
|
||||
import { Container } from './Container.js';
|
||||
import { Util, Transform } from './Util';
|
||||
import { Node, ids, names } from './Node';
|
||||
import { Container } from './Container';
|
||||
|
||||
import { Stage, stages } from './Stage.js';
|
||||
import { Stage, stages } from './Stage';
|
||||
|
||||
import { Layer } from './Layer.js';
|
||||
import { FastLayer } from './FastLayer.js';
|
||||
import { Layer } from './Layer';
|
||||
import { FastLayer } from './FastLayer';
|
||||
|
||||
import { Group } from './Group.js';
|
||||
import { Group } from './Group';
|
||||
|
||||
import { DD } from './DragAndDrop.js';
|
||||
import { DD } from './DragAndDrop';
|
||||
|
||||
import { Shape, shapes } from './Shape.js';
|
||||
import { Shape, shapes } from './Shape';
|
||||
|
||||
import { Animation } from './Animation.js';
|
||||
import { Tween, Easings } from './Tween.js';
|
||||
import { Animation } from './Animation';
|
||||
import { Tween, Easings } from './Tween';
|
||||
|
||||
import { Context } from './Context.js';
|
||||
import { Canvas } from './Canvas.js';
|
||||
import { Context } from './Context';
|
||||
import { Canvas } from './Canvas';
|
||||
|
||||
export const Konva = Util._assign(Global, {
|
||||
Util,
|
||||
|
@ -1,46 +1,46 @@
|
||||
// we need to import core of the Konva and then extend it with all additional objects
|
||||
|
||||
import { Konva as Core } from './_CoreInternals.js';
|
||||
import { Konva as Core } from './_CoreInternals';
|
||||
|
||||
// shapes
|
||||
import { Arc } from './shapes/Arc.js';
|
||||
import { Arrow } from './shapes/Arrow.js';
|
||||
import { Circle } from './shapes/Circle.js';
|
||||
import { Ellipse } from './shapes/Ellipse.js';
|
||||
import { Image } from './shapes/Image.js';
|
||||
import { Label, Tag } from './shapes/Label.js';
|
||||
import { Line } from './shapes/Line.js';
|
||||
import { Path } from './shapes/Path.js';
|
||||
import { Rect } from './shapes/Rect.js';
|
||||
import { RegularPolygon } from './shapes/RegularPolygon.js';
|
||||
import { Ring } from './shapes/Ring.js';
|
||||
import { Sprite } from './shapes/Sprite.js';
|
||||
import { Star } from './shapes/Star.js';
|
||||
import { Text } from './shapes/Text.js';
|
||||
import { TextPath } from './shapes/TextPath.js';
|
||||
import { Transformer } from './shapes/Transformer.js';
|
||||
import { Wedge } from './shapes/Wedge.js';
|
||||
import { Arc } from './shapes/Arc';
|
||||
import { Arrow } from './shapes/Arrow';
|
||||
import { Circle } from './shapes/Circle';
|
||||
import { Ellipse } from './shapes/Ellipse';
|
||||
import { Image } from './shapes/Image';
|
||||
import { Label, Tag } from './shapes/Label';
|
||||
import { Line } from './shapes/Line';
|
||||
import { Path } from './shapes/Path';
|
||||
import { Rect } from './shapes/Rect';
|
||||
import { RegularPolygon } from './shapes/RegularPolygon';
|
||||
import { Ring } from './shapes/Ring';
|
||||
import { Sprite } from './shapes/Sprite';
|
||||
import { Star } from './shapes/Star';
|
||||
import { Text } from './shapes/Text';
|
||||
import { TextPath } from './shapes/TextPath';
|
||||
import { Transformer } from './shapes/Transformer';
|
||||
import { Wedge } from './shapes/Wedge';
|
||||
|
||||
// filters
|
||||
import { Blur } from './filters/Blur.js';
|
||||
import { Brighten } from './filters/Brighten.js';
|
||||
import { Contrast } from './filters/Contrast.js';
|
||||
import { Emboss } from './filters/Emboss.js';
|
||||
import { Enhance } from './filters/Enhance.js';
|
||||
import { Grayscale } from './filters/Grayscale.js';
|
||||
import { HSL } from './filters/HSL.js';
|
||||
import { HSV } from './filters/HSV.js';
|
||||
import { Invert } from './filters/Invert.js';
|
||||
import { Kaleidoscope } from './filters/Kaleidoscope.js';
|
||||
import { Mask } from './filters/Mask.js';
|
||||
import { Noise } from './filters/Noise.js';
|
||||
import { Pixelate } from './filters/Pixelate.js';
|
||||
import { Posterize } from './filters/Posterize.js';
|
||||
import { RGB } from './filters/RGB.js';
|
||||
import { RGBA } from './filters/RGBA.js';
|
||||
import { Sepia } from './filters/Sepia.js';
|
||||
import { Solarize } from './filters/Solarize.js';
|
||||
import { Threshold } from './filters/Threshold.js';
|
||||
import { Blur } from './filters/Blur';
|
||||
import { Brighten } from './filters/Brighten';
|
||||
import { Contrast } from './filters/Contrast';
|
||||
import { Emboss } from './filters/Emboss';
|
||||
import { Enhance } from './filters/Enhance';
|
||||
import { Grayscale } from './filters/Grayscale';
|
||||
import { HSL } from './filters/HSL';
|
||||
import { HSV } from './filters/HSV';
|
||||
import { Invert } from './filters/Invert';
|
||||
import { Kaleidoscope } from './filters/Kaleidoscope';
|
||||
import { Mask } from './filters/Mask';
|
||||
import { Noise } from './filters/Noise';
|
||||
import { Pixelate } from './filters/Pixelate';
|
||||
import { Posterize } from './filters/Posterize';
|
||||
import { RGB } from './filters/RGB';
|
||||
import { RGBA } from './filters/RGBA';
|
||||
import { Sepia } from './filters/Sepia';
|
||||
import { Solarize } from './filters/Solarize';
|
||||
import { Threshold } from './filters/Threshold';
|
||||
|
||||
export const Konva = Core.Util._assign(Core, {
|
||||
Arc,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
/*
|
||||
the Gauss filter
|
||||
master repo: https://github.com/pavelpower/kineticjsGaussFilter
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
|
||||
/**
|
||||
* Brighten Filter.
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
/**
|
||||
* Contrast Filter.
|
||||
* @function
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { Util } from '../Util.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { Util } from '../Util';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
/**
|
||||
* Emboss Filter.
|
||||
* Pixastic Lib - Emboss filter - v0.1.0
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
|
||||
function remap(fromValue, fromMin, fromMax, toMin, toMax) {
|
||||
// Compute the range of the data
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Filter } from '../Node.js';
|
||||
import { Filter } from '../Node';
|
||||
|
||||
/**
|
||||
* Grayscale Filter
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
|
||||
Factory.addGetterSetter(
|
||||
Node,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
|
||||
/**
|
||||
* HSV Filter. Adjusts the hue, saturation and value
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Filter } from '../Node.js';
|
||||
import { Filter } from '../Node';
|
||||
/**
|
||||
* Invert Filter
|
||||
* @function
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { Util } from '../Util.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { Util } from '../Util';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
|
||||
/*
|
||||
* ToPolar Filter. Converts image data to polar coordinates. Performs
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
|
||||
function pixelAt(idata, x, y) {
|
||||
var idx = (y * idata.width + x) * 4;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
|
||||
/**
|
||||
* Noise Filter. Randomly adds or substracts to the color channels
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*eslint-disable max-depth */
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Util } from '../Util.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Util } from '../Util';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
|
||||
/**
|
||||
* Pixelate Filter. Averages groups of pixels and redraws
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
/**
|
||||
* Posterize Filter. Adjusts the channels so that there are no more
|
||||
* than n different values for that channel. This is also applied
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { RGBComponent } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { RGBComponent } from '../Validators';
|
||||
|
||||
/**
|
||||
* RGB Filter
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { RGBComponent } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { RGBComponent } from '../Validators';
|
||||
|
||||
/**
|
||||
* RGBA Filter
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Filter } from '../Node.js';
|
||||
import { Filter } from '../Node';
|
||||
|
||||
// based on https://stackoverflow.com/questions/1061093/how-is-a-sepia-tone-created
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Filter } from '../Node.js';
|
||||
import { Filter } from '../Node';
|
||||
/**
|
||||
* Solarize Filter
|
||||
* Pixastic Lib - Solarize filter - v0.1.0
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node, Filter } from '../Node.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node, Filter } from '../Node';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
/**
|
||||
* Threshold Filter. Pushes any value above the mid point to
|
||||
* the max and any value below the mid point to the min.
|
||||
|
@ -1,5 +1,5 @@
|
||||
// main entry for umd build for rollup
|
||||
import { Konva } from './_FullInternals.js';
|
||||
import { Konva } from './_FullInternals';
|
||||
import * as canvas from 'canvas';
|
||||
|
||||
const isNode = typeof global.document === 'undefined';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Konva } from '../Global.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { Konva } from '../Global';
|
||||
import { GetSet } from '../types';
|
||||
import { getNumberValidator, getBooleanValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { getNumberValidator, getBooleanValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
export interface ArcConfig extends ShapeConfig {
|
||||
angle: number;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Line, LineConfig } from './Line.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Line, LineConfig } from './Line';
|
||||
import { GetSet } from '../types';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
export interface ArrowConfig extends LineConfig {
|
||||
points: number[];
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { GetSet } from '../types';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
export interface CircleConfig extends ShapeConfig {
|
||||
radius?: number;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet, Vector2d } from '../types';
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Util } from '../Util.js';
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Util } from '../Util';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet, IRect } from '../types';
|
||||
import { Context } from '../Context.js';
|
||||
import { Context } from '../Context';
|
||||
|
||||
export interface ImageConfig extends ShapeConfig {
|
||||
image: CanvasImageSource | undefined;
|
||||
|
@ -1,15 +1,15 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Group } from '../Group.js';
|
||||
import { ContainerConfig } from '../Container.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { Group } from '../Group';
|
||||
import { ContainerConfig } from '../Container';
|
||||
import {
|
||||
getNumberOrArrayOfNumbersValidator,
|
||||
getNumberValidator,
|
||||
} from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
} from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet } from '../types';
|
||||
import { Text } from './Text.js';
|
||||
import { Text } from './Text';
|
||||
|
||||
export interface LabelConfig extends ContainerConfig {}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Util } from '../Util.js';
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { getNumberValidator, getNumberArrayValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Util } from '../Util';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { getNumberValidator, getNumberArrayValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet } from '../types';
|
||||
import { Context } from '../Context.js';
|
||||
import { Context } from '../Context';
|
||||
|
||||
export interface LineConfig extends ShapeConfig {
|
||||
points?: number[];
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet } from '../types';
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet } from '../types';
|
||||
import { getNumberOrArrayOfNumbersValidator } from '../Validators.js';
|
||||
import { getNumberOrArrayOfNumbersValidator } from '../Validators';
|
||||
export interface RectConfig extends ShapeConfig {
|
||||
cornerRadius?: number | number[];
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { GetSet } from '../types';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
export interface RegularPolygonConfig extends ShapeConfig {
|
||||
sides: number;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { GetSet } from '../types';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
export interface RingConfig extends ShapeConfig {
|
||||
innerRadius: number;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Animation } from '../Animation.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { Animation } from '../Animation';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet } from '../types';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet } from '../types';
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
import { Util } from '../Util.js';
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Konva } from '../Global.js';
|
||||
import { Util } from '../Util';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { Konva } from '../Global';
|
||||
import {
|
||||
getNumberValidator,
|
||||
getStringValidator,
|
||||
getNumberOrAutoValidator,
|
||||
getBooleanValidator,
|
||||
} from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
} from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet } from '../types';
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Util } from '../Util.js';
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Path } from './Path.js';
|
||||
import { Text, stringToArray } from './Text.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Util } from '../Util';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { Path } from './Path';
|
||||
import { Text, stringToArray } from './Text';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet, Vector2d } from '../types';
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { Util, Transform } from '../Util.js';
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Node } from '../Node.js';
|
||||
import { Shape } from '../Shape.js';
|
||||
import { Rect } from './Rect.js';
|
||||
import { Group } from '../Group.js';
|
||||
import { ContainerConfig } from '../Container.js';
|
||||
import { Konva } from '../Global.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Util, Transform } from '../Util';
|
||||
import { Factory } from '../Factory';
|
||||
import { Node } from '../Node';
|
||||
import { Shape } from '../Shape';
|
||||
import { Rect } from './Rect';
|
||||
import { Group } from '../Group';
|
||||
import { ContainerConfig } from '../Container';
|
||||
import { Konva } from '../Global';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet, IRect, Vector2d } from '../types';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Factory } from '../Factory.js';
|
||||
import { Shape, ShapeConfig } from '../Shape.js';
|
||||
import { Konva } from '../Global.js';
|
||||
import { getNumberValidator } from '../Validators.js';
|
||||
import { _registerNode } from '../Global.js';
|
||||
import { Factory } from '../Factory';
|
||||
import { Shape, ShapeConfig } from '../Shape';
|
||||
import { Konva } from '../Global';
|
||||
import { getNumberValidator } from '../Validators';
|
||||
import { _registerNode } from '../Global';
|
||||
|
||||
import { GetSet } from '../types';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai';
|
||||
import KonvaModule from '../../src/index';
|
||||
import '../../src/index-node';
|
||||
import KonvaModule from '../../lib/index';
|
||||
import '../../lib/index-node';
|
||||
|
||||
export const Konva = KonvaModule;
|
||||
|
||||
@ -10,8 +10,8 @@ Konva.enableTrace = true;
|
||||
Konva.showWarnings = true;
|
||||
|
||||
import { imagediff } from './imagediff';
|
||||
import { Layer } from '../../src/Layer.js';
|
||||
import { Stage } from '../../src/Stage.js';
|
||||
import { Layer } from '../../lib/Layer.js';
|
||||
import { Stage } from '../../lib/Stage.js';
|
||||
|
||||
// reset some data
|
||||
beforeEach(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user