Skip to content

Commit 139834b

Browse files
committed
chore: apply prettier formatting
1 parent 0d33c2c commit 139834b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1380
-2078
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,6 @@ That changes are private and internal specific. They should not break most of `K
14131413
Differences from last official `KineticJS` release
14141414
14151415
- Bug Fixes
1416-
14171416
- `strokeScaleEnabled = false` is disabled for text as I can not find a way to implement this
14181417
- `strokeScaleEnabled = false` for Line now creates a correct hit graph
14191418
- working "this-example" as name for nodes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ At the current moment `Konva` doesn't work in IE11 directly. To make it work you
6666

6767
# Debugging
6868

69-
The Chrome inspector simply shows the canvas element. To see the Konva objects and their details, install the konva-dev extension at https://github.com/konvajs/konva-devtool.
69+
The Chrome inspector simply shows the canvas element. To see the Konva objects and their details, install the konva-dev extension at https://github.com/konvajs/konva-devtool.
7070

7171
# Loading and installing Konva
7272

gulpfile.mjs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ gulp.task('update-version-es-to-cmj-index', function () {
4949
return gulp
5050
.src(['./lib/index.js'])
5151
.pipe(
52-
replace(`import { Konva } from './_F`, `import { Konva } from '../cmj/_F`)
52+
replace(
53+
`import { Konva } from './_F`,
54+
`import { Konva } from '../cmj/_F`,
55+
),
5356
)
5457
.pipe(rename('index.js'))
5558
.pipe(gulp.dest('./lib'));
@@ -59,7 +62,10 @@ gulp.task('update-version-es-to-cmj-node', function () {
5962
return gulp
6063
.src(['./lib/index-node.js'])
6164
.pipe(
62-
replace(`import { Konva } from './_F`, `import { Konva } from '../cmj/_F`)
65+
replace(
66+
`import { Konva } from './_F`,
67+
`import { Konva } from '../cmj/_F`,
68+
),
6369
)
6470
.pipe(rename('index-node.js'))
6571
.pipe(gulp.dest('./lib'));
@@ -71,7 +77,7 @@ gulp.task('pre-build', function () {
7177
.pipe(rename('konva.js'))
7278
.pipe(gulp.dest('./'))
7379
.pipe(
74-
uglify.default({ output: { comments: /^!|@preserve|@license|@cc_on/i } })
80+
uglify.default({ output: { comments: /^!|@preserve|@license|@cc_on/i } }),
7581
)
7682
.on('error', function (err) {
7783
gutil.log(gutil.colors.red('[Error]'), err.toString());
@@ -88,7 +94,7 @@ gulp.task(
8894
// 'update-version-es-to-cmj-index',
8995
// 'update-version-es-to-cmj-node',
9096
'pre-build',
91-
])
97+
]),
9298
);
9399

94100
// local server for better development
@@ -103,7 +109,7 @@ gulp.task('api', function () {
103109
opts: {
104110
destination: './api',
105111
},
106-
})
112+
}),
107113
);
108114
});
109115

rename-imports.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ files.then((filePaths) => {
1919
// stupid replacement back
2020
text = text.replace(
2121
"import * as Canvas from 'canvas.js';",
22-
"import * as Canvas from 'canvas';"
22+
"import * as Canvas from 'canvas';",
2323
);
2424

2525
// Handle import("./x/y/z") syntax.

resources/jsdoc.conf.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"path" : "ink-docstrap",
3-
"tags" : {
4-
"allowUnknownTags" : true
5-
},
6-
"plugins" : ["plugins/markdown"],
2+
"path": "ink-docstrap",
3+
"tags": {
4+
"allowUnknownTags": true
5+
},
6+
"plugins": ["plugins/markdown"],
77

8-
"templates" : {
9-
"cleverLinks" : false,
10-
"monospaceLinks" : false,
11-
"dateFormat" : "ddd MMM Do YYYY",
12-
"outputSourceFiles" : true,
13-
"outputSourcePath" : true,
14-
"systemName" : "Konva",
15-
"footer" : "",
16-
"copyright" : "Konva Copyright © 2015 The contributors to the Konva project.",
17-
"navType" : "vertical",
18-
"theme" : "cosmo",
19-
"linenums" : true,
20-
"collapseSymbols" : false,
21-
"inverseNav" : true,
22-
"highlightTutorialCode" : true
23-
},
24-
"markdown" : {
25-
"parser" : "gfm",
26-
"hardwrap" : true
27-
}
8+
"templates": {
9+
"cleverLinks": false,
10+
"monospaceLinks": false,
11+
"dateFormat": "ddd MMM Do YYYY",
12+
"outputSourceFiles": true,
13+
"outputSourcePath": true,
14+
"systemName": "Konva",
15+
"footer": "",
16+
"copyright": "Konva Copyright © 2015 The contributors to the Konva project.",
17+
"navType": "vertical",
18+
"theme": "cosmo",
19+
"linenums": true,
20+
"collapseSymbols": false,
21+
"inverseNav": true,
22+
"highlightTutorialCode": true
23+
},
24+
"markdown": {
25+
"parser": "gfm",
26+
"hardwrap": true
27+
}
2828
}

src/BezierFunctions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ export const getCubicArcLength = (xs: number[], ys: number[], t: number) => {
713713
export const getQuadraticArcLength = (
714714
xs: number[],
715715
ys: number[],
716-
t: number
716+
t: number,
717717
) => {
718718
if (t === undefined) {
719719
t = 1;
@@ -792,7 +792,7 @@ const getDerivative = (derivative: number, t: number, vs: number[]): number => {
792792
export const t2length = (
793793
length: number,
794794
totalLength: number,
795-
func: (t: number) => number
795+
func: (t: number) => number,
796796
): number => {
797797
let error = 1;
798798
let t = length / totalLength;

src/Canvas.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export class Canvas {
111111
this.pixelRatio = pixelRatio;
112112
this.setSize(
113113
this.getWidth() / previousRatio,
114-
this.getHeight() / previousRatio
114+
this.getHeight() / previousRatio,
115115
);
116116
}
117117
setWidth(width) {
@@ -161,7 +161,7 @@ export class Canvas {
161161
Util.error(
162162
'Unable to get data URL. ' +
163163
err.message +
164-
' For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.'
164+
' For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.',
165165
);
166166
return '';
167167
}
@@ -171,7 +171,7 @@ export class Canvas {
171171

172172
export class SceneCanvas extends Canvas {
173173
constructor(
174-
config: ICanvasConfig = { width: 0, height: 0, willReadFrequently: false }
174+
config: ICanvasConfig = { width: 0, height: 0, willReadFrequently: false },
175175
) {
176176
super(config);
177177
this.context = new SceneContext(this, {

src/Container.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface ContainerConfig extends NodeConfig {
3030
* @@containerParams
3131
*/
3232
export abstract class Container<
33-
ChildType extends Node = Node
33+
ChildType extends Node = Node,
3434
> extends Node<ContainerConfig> {
3535
children: Array<ChildType> = [];
3636

@@ -211,14 +211,14 @@ export abstract class Container<
211211
* })
212212
*/
213213
findOne<ChildNode extends Node = Node>(
214-
selector: string | Function
214+
selector: string | Function,
215215
): ChildNode | undefined {
216216
const result = this._generalFind<ChildNode>(selector, true);
217217
return result.length > 0 ? result[0] : undefined;
218218
}
219219
_generalFind<ChildNode extends Node>(
220220
selector: string | Function,
221-
findOne: boolean
221+
findOne: boolean,
222222
) {
223223
const retArr: Array<ChildNode> = [];
224224

@@ -436,7 +436,7 @@ export abstract class Container<
436436
skipShadow?: boolean;
437437
skipStroke?: boolean;
438438
relativeTo?: Container<Node>;
439-
} = {}
439+
} = {},
440440
): IRect {
441441
const skipTransform = config.skipTransform;
442442
const relativeTo = config.relativeTo;
@@ -589,7 +589,7 @@ Factory.addGetterSetter(
589589
Container,
590590
'clipWidth',
591591
undefined,
592-
getNumberValidator()
592+
getNumberValidator(),
593593
);
594594
/**
595595
* get/set clip width
@@ -609,7 +609,7 @@ Factory.addGetterSetter(
609609
Container,
610610
'clipHeight',
611611
undefined,
612-
getNumberValidator()
612+
getNumberValidator(),
613613
);
614614
/**
615615
* get/set clip height

src/Context.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export class Context {
205205
} else {
206206
if (rounded) {
207207
args = args.map((a) =>
208-
typeof a === 'number' ? Math.floor(a) : a
208+
typeof a === 'number' ? Math.floor(a) : a,
209209
);
210210
}
211211
str += OPEN_PAREN + args.join(COMMA) + CLOSE_PAREN;
@@ -275,14 +275,14 @@ export class Context {
275275
bounds.x || 0,
276276
bounds.y || 0,
277277
bounds.width || 0,
278-
bounds.height || 0
278+
bounds.height || 0,
279279
);
280280
} else {
281281
this.clearRect(
282282
0,
283283
0,
284284
canvas.getWidth() / canvas.pixelRatio,
285-
canvas.getHeight() / canvas.pixelRatio
285+
canvas.getHeight() / canvas.pixelRatio,
286286
);
287287
}
288288
}
@@ -320,7 +320,7 @@ export class Context {
320320
radius: number,
321321
startAngle: number,
322322
endAngle: number,
323-
counterClockwise?: boolean
323+
counterClockwise?: boolean,
324324
) {
325325
this._context.arc(x, y, radius, startAngle, endAngle, counterClockwise);
326326
}
@@ -353,7 +353,7 @@ export class Context {
353353
cp2x: number,
354354
cp2y: number,
355355
x: number,
356-
y: number
356+
y: number,
357357
) {
358358
this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
359359
}
@@ -423,7 +423,7 @@ export class Context {
423423
r0: number,
424424
x1: number,
425425
y1: number,
426-
r1: number
426+
r1: number,
427427
) {
428428
return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);
429429
}
@@ -441,7 +441,7 @@ export class Context {
441441
dx?: number,
442442
dy?: number,
443443
dWidth?: number,
444-
dHeight?: number
444+
dHeight?: number,
445445
) {
446446
// this._context.drawImage(...arguments);
447447
const a = arguments,
@@ -460,7 +460,7 @@ export class Context {
460460
dx as number,
461461
dy as number,
462462
dWidth as number,
463-
dHeight as number
463+
dHeight as number,
464464
);
465465
}
466466
}
@@ -477,7 +477,7 @@ export class Context {
477477
rotation: number,
478478
startAngle: number,
479479
endAngle: number,
480-
counterclockwise?: boolean
480+
counterclockwise?: boolean,
481481
) {
482482
this._context.ellipse(
483483
x,
@@ -487,7 +487,7 @@ export class Context {
487487
rotation,
488488
startAngle,
489489
endAngle,
490-
counterclockwise
490+
counterclockwise,
491491
);
492492
}
493493
/**
@@ -499,7 +499,7 @@ export class Context {
499499
x: number,
500500
y: number,
501501
path?: Path2D,
502-
fillRule?: CanvasFillRule
502+
fillRule?: CanvasFillRule,
503503
) {
504504
if (path) {
505505
return this._context.isPointInPath(path, x, y, fillRule);
@@ -595,7 +595,7 @@ export class Context {
595595
y: number,
596596
width: number,
597597
height: number,
598-
radii: number | DOMPointInit | (number | DOMPointInit)[]
598+
radii: number | DOMPointInit | (number | DOMPointInit)[],
599599
) {
600600
this._context.roundRect(x, y, width, height, radii);
601601
}
@@ -685,7 +685,7 @@ export class Context {
685685
c: number,
686686
d: number,
687687
e: number,
688-
f: number
688+
f: number,
689689
) {
690690
this._context.setTransform(a, b, c, d, e, f);
691691
}
@@ -938,7 +938,7 @@ export class SceneContext extends Context {
938938
this.setAttr('shadowColor', color);
939939
this.setAttr(
940940
'shadowBlur',
941-
blur * Math.min(Math.abs(scaleX), Math.abs(scaleY))
941+
blur * Math.min(Math.abs(scaleX), Math.abs(scaleY)),
942942
);
943943
this.setAttr('shadowOffsetX', offset.x * scaleX);
944944
this.setAttr('shadowOffsetY', offset.y * scaleY);

src/DragAndDrop.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const DD = {
5454
elem.pointerId = Util._getFirstPointerId(evt);
5555
}
5656
const pos = stage._changedPointerPositions.find(
57-
(pos) => pos.id === elem.pointerId
57+
(pos) => pos.id === elem.pointerId,
5858
);
5959

6060
// not related pointer
@@ -65,7 +65,7 @@ export const DD = {
6565
const dragDistance = node.dragDistance();
6666
const distance = Math.max(
6767
Math.abs(pos.x - elem.startPointerPos.x),
68-
Math.abs(pos.y - elem.startPointerPos.y)
68+
Math.abs(pos.y - elem.startPointerPos.y),
6969
);
7070
if (distance < dragDistance) {
7171
return;
@@ -88,7 +88,7 @@ export const DD = {
8888
target: node,
8989
evt: evt,
9090
},
91-
true
91+
true,
9292
);
9393
});
9494
},
@@ -106,7 +106,7 @@ export const DD = {
106106
}
107107

108108
const pos = stage._changedPointerPositions.find(
109-
(pos) => pos.id === elem.pointerId
109+
(pos) => pos.id === elem.pointerId,
110110
);
111111

112112
// that pointer is not related
@@ -148,7 +148,7 @@ export const DD = {
148148
target: elem.node,
149149
evt: evt,
150150
},
151-
true
151+
true,
152152
);
153153
}
154154
if (elem.dragStatus !== 'dragging') {

0 commit comments

Comments
 (0)