@nasser-sw/fabric 7.0.1-beta8 → 7.0.1-beta9

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.
Files changed (138) hide show
  1. package/debug/konva-master/CHANGELOG.md +1475 -0
  2. package/debug/konva-master/LICENSE +22 -0
  3. package/debug/konva-master/README.md +209 -0
  4. package/debug/konva-master/gulpfile.mjs +110 -0
  5. package/debug/konva-master/package.json +139 -0
  6. package/debug/konva-master/release.sh +62 -0
  7. package/debug/konva-master/resources/doc-includes/ContainerParams.txt +6 -0
  8. package/debug/konva-master/resources/doc-includes/NodeParams.txt +20 -0
  9. package/debug/konva-master/resources/doc-includes/ShapeParams.txt +53 -0
  10. package/debug/konva-master/resources/jsdoc.conf.json +28 -0
  11. package/debug/konva-master/rollup.config.mjs +32 -0
  12. package/debug/konva-master/src/Animation.ts +237 -0
  13. package/debug/konva-master/src/BezierFunctions.ts +826 -0
  14. package/debug/konva-master/src/Canvas.ts +230 -0
  15. package/debug/konva-master/src/Container.ts +649 -0
  16. package/debug/konva-master/src/Context.ts +1017 -0
  17. package/debug/konva-master/src/Core.ts +5 -0
  18. package/debug/konva-master/src/DragAndDrop.ts +173 -0
  19. package/debug/konva-master/src/Factory.ts +246 -0
  20. package/debug/konva-master/src/FastLayer.ts +29 -0
  21. package/debug/konva-master/src/Global.ts +210 -0
  22. package/debug/konva-master/src/Group.ts +31 -0
  23. package/debug/konva-master/src/Layer.ts +546 -0
  24. package/debug/konva-master/src/Node.ts +3477 -0
  25. package/debug/konva-master/src/PointerEvents.ts +67 -0
  26. package/debug/konva-master/src/Shape.ts +2081 -0
  27. package/debug/konva-master/src/Stage.ts +1000 -0
  28. package/debug/konva-master/src/Tween.ts +811 -0
  29. package/debug/konva-master/src/Util.ts +1123 -0
  30. package/debug/konva-master/src/Validators.ts +210 -0
  31. package/debug/konva-master/src/_CoreInternals.ts +85 -0
  32. package/debug/konva-master/src/_FullInternals.ts +171 -0
  33. package/debug/konva-master/src/canvas-backend.ts +36 -0
  34. package/debug/konva-master/src/filters/Blur.ts +388 -0
  35. package/debug/konva-master/src/filters/Brighten.ts +48 -0
  36. package/debug/konva-master/src/filters/Brightness.ts +30 -0
  37. package/debug/konva-master/src/filters/Contrast.ts +75 -0
  38. package/debug/konva-master/src/filters/Emboss.ts +207 -0
  39. package/debug/konva-master/src/filters/Enhance.ts +154 -0
  40. package/debug/konva-master/src/filters/Grayscale.ts +25 -0
  41. package/debug/konva-master/src/filters/HSL.ts +108 -0
  42. package/debug/konva-master/src/filters/HSV.ts +106 -0
  43. package/debug/konva-master/src/filters/Invert.ts +23 -0
  44. package/debug/konva-master/src/filters/Kaleidoscope.ts +274 -0
  45. package/debug/konva-master/src/filters/Mask.ts +220 -0
  46. package/debug/konva-master/src/filters/Noise.ts +44 -0
  47. package/debug/konva-master/src/filters/Pixelate.ts +107 -0
  48. package/debug/konva-master/src/filters/Posterize.ts +46 -0
  49. package/debug/konva-master/src/filters/RGB.ts +82 -0
  50. package/debug/konva-master/src/filters/RGBA.ts +103 -0
  51. package/debug/konva-master/src/filters/Sepia.ts +27 -0
  52. package/debug/konva-master/src/filters/Solarize.ts +29 -0
  53. package/debug/konva-master/src/filters/Threshold.ts +44 -0
  54. package/debug/konva-master/src/index.ts +3 -0
  55. package/debug/konva-master/src/shapes/Arc.ts +176 -0
  56. package/debug/konva-master/src/shapes/Arrow.ts +231 -0
  57. package/debug/konva-master/src/shapes/Circle.ts +76 -0
  58. package/debug/konva-master/src/shapes/Ellipse.ts +121 -0
  59. package/debug/konva-master/src/shapes/Image.ts +319 -0
  60. package/debug/konva-master/src/shapes/Label.ts +386 -0
  61. package/debug/konva-master/src/shapes/Line.ts +364 -0
  62. package/debug/konva-master/src/shapes/Path.ts +1013 -0
  63. package/debug/konva-master/src/shapes/Rect.ts +79 -0
  64. package/debug/konva-master/src/shapes/RegularPolygon.ts +167 -0
  65. package/debug/konva-master/src/shapes/Ring.ts +94 -0
  66. package/debug/konva-master/src/shapes/Sprite.ts +370 -0
  67. package/debug/konva-master/src/shapes/Star.ts +125 -0
  68. package/debug/konva-master/src/shapes/Text.ts +1065 -0
  69. package/debug/konva-master/src/shapes/TextPath.ts +583 -0
  70. package/debug/konva-master/src/shapes/Transformer.ts +1889 -0
  71. package/debug/konva-master/src/shapes/Wedge.ts +129 -0
  72. package/debug/konva-master/src/skia-backend.ts +35 -0
  73. package/debug/konva-master/src/types.ts +84 -0
  74. package/debug/konva-master/tsconfig.json +31 -0
  75. package/debug/konva-master/tsconfig.test.json +7 -0
  76. package/dist/index.js +915 -23
  77. package/dist/index.js.map +1 -1
  78. package/dist/index.min.js +1 -1
  79. package/dist/index.min.js.map +1 -1
  80. package/dist/index.min.mjs +1 -1
  81. package/dist/index.min.mjs.map +1 -1
  82. package/dist/index.mjs +915 -23
  83. package/dist/index.mjs.map +1 -1
  84. package/dist/index.node.cjs +915 -23
  85. package/dist/index.node.cjs.map +1 -1
  86. package/dist/index.node.mjs +915 -23
  87. package/dist/index.node.mjs.map +1 -1
  88. package/dist/package.json.min.mjs +1 -1
  89. package/dist/package.json.mjs +1 -1
  90. package/dist/src/shapes/Text/Text.d.ts +19 -0
  91. package/dist/src/shapes/Text/Text.d.ts.map +1 -1
  92. package/dist/src/shapes/Text/Text.min.mjs +1 -1
  93. package/dist/src/shapes/Text/Text.min.mjs.map +1 -1
  94. package/dist/src/shapes/Text/Text.mjs +238 -4
  95. package/dist/src/shapes/Text/Text.mjs.map +1 -1
  96. package/dist/src/shapes/Textbox.d.ts +38 -1
  97. package/dist/src/shapes/Textbox.d.ts.map +1 -1
  98. package/dist/src/shapes/Textbox.min.mjs +1 -1
  99. package/dist/src/shapes/Textbox.min.mjs.map +1 -1
  100. package/dist/src/shapes/Textbox.mjs +497 -15
  101. package/dist/src/shapes/Textbox.mjs.map +1 -1
  102. package/dist/src/text/examples/arabicTextExample.d.ts +60 -0
  103. package/dist/src/text/examples/arabicTextExample.d.ts.map +1 -0
  104. package/dist/src/text/measure.d.ts +9 -0
  105. package/dist/src/text/measure.d.ts.map +1 -1
  106. package/dist/src/text/measure.min.mjs +1 -1
  107. package/dist/src/text/measure.min.mjs.map +1 -1
  108. package/dist/src/text/measure.mjs +175 -4
  109. package/dist/src/text/measure.mjs.map +1 -1
  110. package/dist/src/text/overlayEditor.d.ts.map +1 -1
  111. package/dist/src/text/overlayEditor.min.mjs +1 -1
  112. package/dist/src/text/overlayEditor.min.mjs.map +1 -1
  113. package/dist/src/text/overlayEditor.mjs +7 -0
  114. package/dist/src/text/overlayEditor.mjs.map +1 -1
  115. package/dist/src/text/scriptUtils.d.ts +142 -0
  116. package/dist/src/text/scriptUtils.d.ts.map +1 -0
  117. package/dist/src/text/scriptUtils.min.mjs +2 -0
  118. package/dist/src/text/scriptUtils.min.mjs.map +1 -0
  119. package/dist/src/text/scriptUtils.mjs +212 -0
  120. package/dist/src/text/scriptUtils.mjs.map +1 -0
  121. package/dist-extensions/src/shapes/Text/Text.d.ts +19 -0
  122. package/dist-extensions/src/shapes/Text/Text.d.ts.map +1 -1
  123. package/dist-extensions/src/shapes/Textbox.d.ts +38 -1
  124. package/dist-extensions/src/shapes/Textbox.d.ts.map +1 -1
  125. package/dist-extensions/src/text/measure.d.ts +9 -0
  126. package/dist-extensions/src/text/measure.d.ts.map +1 -1
  127. package/dist-extensions/src/text/overlayEditor.d.ts.map +1 -1
  128. package/dist-extensions/src/text/scriptUtils.d.ts +142 -0
  129. package/dist-extensions/src/text/scriptUtils.d.ts.map +1 -0
  130. package/fabric-test-editor.html +2401 -46
  131. package/fonts/STV Bold.ttf +0 -0
  132. package/fonts/STV Light.ttf +0 -0
  133. package/fonts/STV Regular.ttf +0 -0
  134. package/package.json +1 -1
  135. package/src/shapes/Text/Text.ts +238 -5
  136. package/src/shapes/Textbox.ts +521 -11
  137. package/src/text/measure.ts +200 -50
  138. package/src/text/overlayEditor.ts +7 -0
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
4
+ Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,209 @@
1
+ <p align="center">
2
+ <img src="https://konvajs.org/android-chrome-192x192.png" alt="Konva logo" height="180" />
3
+ </p>
4
+
5
+ <h1 align="center">Konva</h1>
6
+
7
+ [![Financial Contributors on Open Collective](https://opencollective.com/konva/all/badge.svg?label=financial+contributors)](https://opencollective.com/konva)
8
+ [![npm version](https://badge.fury.io/js/konva.svg)](http://badge.fury.io/js/konva)
9
+ [![Build Status](https://github.com/konvajs/konva/actions/workflows/test-browser.yml/badge.svg)](https://github.com/konvajs/konva/actions/workflows/test-browser.ym)
10
+ [![Build Status](https://github.com/konvajs/konva/actions/workflows/test-node.yml/badge.svg)](https://github.com/konvajs/konva/actions/workflows/test-node.ym)[![CDNJS version](https://img.shields.io/cdnjs/v/konva.svg)](https://cdnjs.com/libraries/konva)
11
+
12
+ Konva is an HTML5 Canvas JavaScript framework that enables high performance animations, transitions, node nesting, layering, filtering, caching, event handling for desktop and mobile applications, and much more.
13
+
14
+ You can draw things onto the stage, add event listeners to them, move them, scale them, and rotate them independently from other shapes to support high performance animations, even if your application uses thousands of shapes. Served hot with a side of awesomeness.
15
+
16
+ This repository began as a GitHub fork of [ericdrowell/KineticJS](https://github.com/ericdrowell/KineticJS).
17
+
18
+ - **Visit:** The [Home Page](http://konvajs.org/) and follow on [Twitter](https://twitter.com/lavrton)
19
+ - **Discover:** [Tutorials](http://konvajs.org/docs/index.html), [API Documentation](http://konvajs.org/api/Konva.html)
20
+ - **Help:** [StackOverflow](http://stackoverflow.com/questions/tagged/konvajs), [Discord Chat](https://discord.gg/8FqZwVT)
21
+
22
+ # Quick Look
23
+
24
+ ```html
25
+ <script src="https://unpkg.com/konva@10.0.0-1/konva.min.js"></script>
26
+ <div id="container"></div>
27
+ <script>
28
+ var stage = new Konva.Stage({
29
+ container: 'container',
30
+ width: window.innerWidth,
31
+ height: window.innerHeight,
32
+ });
33
+
34
+ // add canvas element
35
+ var layer = new Konva.Layer();
36
+ stage.add(layer);
37
+
38
+ // create shape
39
+ var box = new Konva.Rect({
40
+ x: 50,
41
+ y: 50,
42
+ width: 100,
43
+ height: 50,
44
+ fill: '#00D2FF',
45
+ stroke: 'black',
46
+ strokeWidth: 4,
47
+ draggable: true,
48
+ });
49
+ layer.add(box);
50
+
51
+ // add cursor styling
52
+ box.on('mouseover', function () {
53
+ document.body.style.cursor = 'pointer';
54
+ });
55
+ box.on('mouseout', function () {
56
+ document.body.style.cursor = 'default';
57
+ });
58
+ </script>
59
+ ```
60
+
61
+ # Browsers support
62
+
63
+ Konva works in all modern mobile and desktop browsers. A browser need to be capable to run javascript code from ES2015 spec. For older browsers you may need polyfills for missing functions.
64
+
65
+ At the current moment `Konva` doesn't work in IE11 directly. To make it work you just need to provide some polyfills such as `Array.prototype.find`, `String.prototype.trimLeft`, `String.prototype.trimRight`, `Array.from`.
66
+
67
+ # Debugging
68
+
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.
70
+
71
+ # Loading and installing Konva
72
+
73
+ Konva supports UMD loading. So you can use all possible variants to load the framework into your project:
74
+
75
+ ### Load Konva via classical `<script>` tag from CDN:
76
+
77
+ ```html
78
+ <script src="https://unpkg.com/konva@10.0.0-1/konva.min.js"></script>
79
+ ```
80
+
81
+ ### Install with npm:
82
+
83
+ ```bash
84
+ npm install konva --save
85
+ ```
86
+
87
+ ```javascript
88
+ // The modern way (e.g. an ES6-style import for webpack, parcel)
89
+ import Konva from 'konva';
90
+ ```
91
+
92
+ #### Typescript usage
93
+
94
+ Add DOM definitions into your `tsconfig.json`:
95
+
96
+ ```
97
+ {
98
+ "compilerOptions": {
99
+ "lib": [
100
+ "es6",
101
+ "dom"
102
+ ]
103
+ }
104
+ }
105
+ ```
106
+
107
+ ### 3 Minimal bundle
108
+
109
+ ```javascript
110
+ import Konva from 'konva/lib/Core';
111
+ // Now you have a Konva object with Stage, Layer, FastLayer, Group, Shape and some additional utils function.
112
+ // Also core currently already have support for drag&drop and animations.
113
+ // BUT there are no shapes (rect, circle, etc), no filters.
114
+
115
+ // but you can simply add anything you need:
116
+ import { Rect } from 'konva/lib/shapes/Rect';
117
+ // importing a shape will automatically inject it into Konva object
118
+
119
+ var rect1 = new Rect();
120
+ // or:
121
+ var shape = new Konva.Rect();
122
+
123
+ // for filters you can use this:
124
+ import { Blur } from 'konva/lib/filters/Blur';
125
+ ```
126
+
127
+ ### 4 NodeJS env
128
+
129
+ In order to run `konva` in nodejs environment you also need to install `canvas` or `skia-canvas` package manually for rendering backend.
130
+
131
+ ```bash
132
+ # node-canvas backend
133
+ npm install konva canvas
134
+ # skia-canvas backend
135
+ npm install konva skia-canvas
136
+ ```
137
+
138
+ Then you can use the same Konva API and all Konva demos will work just fine. You just don't need to use `container` attribute in your stage.
139
+
140
+ ```js
141
+ import Konva from 'konva';
142
+ import 'konva/canvas-backend'; // or import 'konva/skia-backend';
143
+
144
+ const stage = new Konva.Stage({
145
+ width: 500,
146
+ height: 500,
147
+ });
148
+ // then all regular Konva code will work
149
+ ```
150
+
151
+ # Backers
152
+
153
+ ![https://simpleshow.com](https://avatars.githubusercontent.com/u/99720652?s=200&v=4 'https://simpleshow.com')
154
+ ![https://www.notably.ai/](https://avatars.githubusercontent.com/u/80046841?s=200&v=4 'https://www.notably.ai/')
155
+
156
+ - [myposter GmbH](https://www.myposter.de/)
157
+ - [queue.gg](https://queue.gg/)
158
+
159
+ # Change log
160
+
161
+ See [CHANGELOG.md](https://github.com/konvajs/konva/blob/master/CHANGELOG.md).
162
+
163
+ ## Building the Konva Framework
164
+
165
+ To make a full build run `npm run build`. The command will compile all typescript files, combine then into one bundle and run minifier.
166
+
167
+ ## Testing
168
+
169
+ Konva uses Mocha for testing.
170
+
171
+ - If you need run test only one time run `npm run test`.
172
+ - 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
+
174
+ Konva is covered with hundreds of tests and well over a thousand assertions.
175
+ Konva uses TDD (test driven development) which means that every new feature or bug fix is accompanied with at least one new test.
176
+
177
+ ## Generate documentation
178
+
179
+ Run `npx gulp api` which will build the documentation files and place them in the `api` folder.
180
+
181
+ # Pull Requests
182
+
183
+ I'd be happy to review any pull requests that may better the Konva project,
184
+ in particular if you have a bug fix, enhancement, or a new shape (see `src/shapes` for examples). Before doing so, please first make sure that all of the tests pass (`npm run test`).
185
+
186
+ ## Contributors
187
+
188
+ ### Financial Contributors
189
+
190
+ Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/konva/contribute)]
191
+
192
+ #### Individuals
193
+
194
+ <a href="https://opencollective.com/konva"><img src="https://opencollective.com/konva/individuals.svg?width=890"></a>
195
+
196
+ #### Organizations
197
+
198
+ Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/konva/contribute)]
199
+
200
+ <a href="https://opencollective.com/konva/organization/0/website"><img src="https://opencollective.com/konva/organization/0/avatar.svg"></a>
201
+ <a href="https://opencollective.com/konva/organization/1/website"><img src="https://opencollective.com/konva/organization/1/avatar.svg"></a>
202
+ <a href="https://opencollective.com/konva/organization/2/website"><img src="https://opencollective.com/konva/organization/2/avatar.svg"></a>
203
+ <a href="https://opencollective.com/konva/organization/3/website"><img src="https://opencollective.com/konva/organization/3/avatar.svg"></a>
204
+ <a href="https://opencollective.com/konva/organization/4/website"><img src="https://opencollective.com/konva/organization/4/avatar.svg"></a>
205
+ <a href="https://opencollective.com/konva/organization/5/website"><img src="https://opencollective.com/konva/organization/5/avatar.svg"></a>
206
+ <a href="https://opencollective.com/konva/organization/6/website"><img src="https://opencollective.com/konva/organization/6/avatar.svg"></a>
207
+ <a href="https://opencollective.com/konva/organization/7/website"><img src="https://opencollective.com/konva/organization/7/avatar.svg"></a>
208
+ <a href="https://opencollective.com/konva/organization/8/website"><img src="https://opencollective.com/konva/organization/8/avatar.svg"></a>
209
+ <a href="https://opencollective.com/konva/organization/9/website"><img src="https://opencollective.com/konva/organization/9/avatar.svg"></a>
@@ -0,0 +1,110 @@
1
+ import gulp from 'gulp';
2
+ import rename from 'gulp-rename';
3
+ import uglify from 'gulp-uglify-es';
4
+ import replace from 'gulp-replace';
5
+ import jsdoc from 'gulp-jsdoc3';
6
+ import connect from 'gulp-connect';
7
+ import gutil from 'gulp-util';
8
+
9
+ import fs from 'fs';
10
+ var NodeParams = fs
11
+ .readFileSync('./resources/doc-includes/NodeParams.txt')
12
+ .toString();
13
+ var ContainerParams = fs
14
+ .readFileSync('./resources/doc-includes/ContainerParams.txt')
15
+ .toString();
16
+ var ShapeParams = fs
17
+ .readFileSync('./resources/doc-includes/ShapeParams.txt')
18
+ .toString();
19
+
20
+ const conf = JSON.parse(fs.readFileSync('./package.json'));
21
+
22
+ function build() {
23
+ return gulp
24
+ .src(['./konva.js'])
25
+ .pipe(replace('@@shapeParams', ShapeParams))
26
+ .pipe(replace('@@nodeParams', NodeParams))
27
+ .pipe(replace('@@containerParams', ContainerParams))
28
+ .pipe(replace('@@version', conf.version))
29
+ .pipe(replace('@@date', new Date().toDateString()));
30
+ }
31
+
32
+ gulp.task('update-version-lib', function () {
33
+ return gulp
34
+ .src(['./lib/Global.js'])
35
+ .pipe(replace('@@version', conf.version))
36
+ .pipe(rename('Global.js'))
37
+ .pipe(gulp.dest('./lib'));
38
+ });
39
+
40
+ gulp.task('update-version-cmj', function () {
41
+ return gulp
42
+ .src(['./cmj/Global.js'])
43
+ .pipe(replace('@@version', conf.version))
44
+ .pipe(rename('Global.js'))
45
+ .pipe(gulp.dest('./cmj'));
46
+ });
47
+
48
+ gulp.task('update-version-es-to-cmj-index', function () {
49
+ return gulp
50
+ .src(['./lib/index.js'])
51
+ .pipe(
52
+ replace(`import { Konva } from './_F`, `import { Konva } from '../cmj/_F`)
53
+ )
54
+ .pipe(rename('index.js'))
55
+ .pipe(gulp.dest('./lib'));
56
+ });
57
+
58
+ gulp.task('update-version-es-to-cmj-node', function () {
59
+ return gulp
60
+ .src(['./lib/index-node.js'])
61
+ .pipe(
62
+ replace(`import { Konva } from './_F`, `import { Konva } from '../cmj/_F`)
63
+ )
64
+ .pipe(rename('index-node.js'))
65
+ .pipe(gulp.dest('./lib'));
66
+ });
67
+
68
+ // create usual build konva.js and konva.min.js
69
+ gulp.task('pre-build', function () {
70
+ return build()
71
+ .pipe(rename('konva.js'))
72
+ .pipe(gulp.dest('./'))
73
+ .pipe(
74
+ uglify.default({ output: { comments: /^!|@preserve|@license|@cc_on/i } })
75
+ )
76
+ .on('error', function (err) {
77
+ gutil.log(gutil.colors.red('[Error]'), err.toString());
78
+ })
79
+ .pipe(rename('konva.min.js'))
80
+ .pipe(gulp.dest('./'));
81
+ });
82
+
83
+ gulp.task(
84
+ 'build',
85
+ gulp.parallel([
86
+ 'update-version-lib',
87
+ // 'update-version-cmj',
88
+ // 'update-version-es-to-cmj-index',
89
+ // 'update-version-es-to-cmj-node',
90
+ 'pre-build',
91
+ ])
92
+ );
93
+
94
+ // local server for better development
95
+ gulp.task('server', function () {
96
+ connect.server();
97
+ });
98
+
99
+ // // generate documentation
100
+ gulp.task('api', function () {
101
+ return gulp.src('./konva.js').pipe(
102
+ jsdoc({
103
+ opts: {
104
+ destination: './api',
105
+ },
106
+ })
107
+ );
108
+ });
109
+
110
+ gulp.task('default', gulp.parallel(['server']));
@@ -0,0 +1,139 @@
1
+ {
2
+ "name": "konva",
3
+ "version": "10.0.0",
4
+ "description": "HTML5 2d canvas library.",
5
+ "author": "Anton Lavrenov",
6
+ "type": "module",
7
+ "files": [
8
+ "README.md",
9
+ "konva.js",
10
+ "konva.min.js",
11
+ "lib"
12
+ ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./lib/index.d.ts",
16
+ "default": "./lib/index.js"
17
+ },
18
+ "./lib/*": {
19
+ "types": "./lib/*.d.ts",
20
+ "default": "./lib/*.js"
21
+ },
22
+ "./lib/*.js": {
23
+ "types": "./lib/*.d.ts",
24
+ "default": "./lib/*.js"
25
+ },
26
+ "./canvas-backend": {
27
+ "types": "./lib/canvas-backend.d.ts",
28
+ "default": "./lib/canvas-backend.js"
29
+ },
30
+ "./skia-backend": {
31
+ "types": "./lib/skia-backend.d.ts",
32
+ "default": "./lib/skia-backend.js"
33
+ }
34
+ },
35
+ "main": "./lib/index.js",
36
+ "types": "./lib/index.d.ts",
37
+ "scripts": {
38
+ "start": "npm run test:watch",
39
+ "compile": "npm run clean && npm run tsc && npm run rollup",
40
+ "build": "npm run compile && gulp build",
41
+ "fmt": "prettier --write .",
42
+ "fmt:check": "prettier --check .",
43
+ "test:import": "npm run build && node ./test/import-test.cjs && node ./test/import-test.mjs",
44
+ "test": "npm run test:browser && npm run test:node && npm run test:import",
45
+ "test:build": "PARCEL_WORKER_BACKEND=process parcel build ./test/unit-tests.html --dist-dir ./test-build --target none --public-url ./ --no-source-maps",
46
+ "test:browser": "npm run test:build && mocha-headless-chrome -f ./test-build/unit-tests.html -a disable-web-security -a no-sandbox -a disable-setuid-sandbox",
47
+ "test:watch": "rm -rf ./.parcel-cache && PARCEL_WORKERS=0 parcel serve ./test/unit-tests.html ./test/manual-tests.html ./test/sandbox.html ./test/text-paths.html ./test/bunnies.html",
48
+ "test:node:canvas": "mocha -r tsx -r ./test/node-canvas-global-setup.mjs --extension ts --recursive './test/unit/' --exit",
49
+ "test:node:skia": "mocha -r tsx -r ./test/node-skia-global-setup.mjs --extension ts --recursive './test/unit/' --exit",
50
+ "test:node": "npm run test:node:canvas && npm run test:node:skia",
51
+ "tsc": "tsc --removeComments",
52
+ "rollup": "rollup -c",
53
+ "clean": "rm -rf ./lib && rm -rf ./types && rm -rf ./cmj && rm -rf ./test-build",
54
+ "watch": "rollup -c -w",
55
+ "size": "size-limit"
56
+ },
57
+ "targets": {
58
+ "none": {}
59
+ },
60
+ "funding": [
61
+ {
62
+ "type": "patreon",
63
+ "url": "https://www.patreon.com/lavrton"
64
+ },
65
+ {
66
+ "type": "opencollective",
67
+ "url": "https://opencollective.com/konva"
68
+ },
69
+ {
70
+ "type": "github",
71
+ "url": "https://github.com/sponsors/lavrton"
72
+ }
73
+ ],
74
+ "size-limit": [
75
+ {
76
+ "limit": "45 KB",
77
+ "path": "./lib/index.js"
78
+ },
79
+ {
80
+ "limit": "26 KB",
81
+ "path": "./lib/Core.js"
82
+ },
83
+ {
84
+ "path": "./konva.min.js"
85
+ }
86
+ ],
87
+ "devDependencies": {
88
+ "@parcel/transformer-image": "2.15.4",
89
+ "@size-limit/preset-big-lib": "^11.2.0",
90
+ "@types/mocha": "^10.0.10",
91
+ "canvas": "^3.2.0",
92
+ "chai": "6.0.1",
93
+ "filehound": "^1.17.6",
94
+ "gulp": "^5.0.1",
95
+ "gulp-concat": "^2.6.1",
96
+ "gulp-connect": "^5.7.0",
97
+ "gulp-exec": "^5.0.0",
98
+ "gulp-jsdoc3": "^3.0.0",
99
+ "gulp-rename": "^2.1.0",
100
+ "gulp-replace": "^1.1.4",
101
+ "gulp-typescript": "^5.0.1",
102
+ "gulp-uglify": "^3.0.2",
103
+ "gulp-uglify-es": "^3.0.0",
104
+ "gulp-util": "^3.0.8",
105
+ "mocha": "^10",
106
+ "mocha-headless-chrome": "^4.0.0",
107
+ "parcel": "2.15.4",
108
+ "prettier": "^3.6.2",
109
+ "process": "^0.11.10",
110
+ "rollup": "^4.48.0",
111
+ "rollup-plugin-typescript2": "^0.36.0",
112
+ "size-limit": "^11.2.0",
113
+ "skia-canvas": "^3.0.4",
114
+ "ts-mocha": "^11.1.0",
115
+ "ts-node": "^10.9.2",
116
+ "tsx": "^4.20.5",
117
+ "typescript": "^5.9.2"
118
+ },
119
+ "keywords": [
120
+ "canvas",
121
+ "animations",
122
+ "graphic",
123
+ "html5"
124
+ ],
125
+ "prettier": {
126
+ "singleQuote": true,
127
+ "trailingComma": "es5"
128
+ },
129
+ "bugs": {
130
+ "url": "https://github.com/konvajs/konva/issues"
131
+ },
132
+ "homepage": "http://konvajs.org/",
133
+ "readmeFilename": "README.md",
134
+ "repository": {
135
+ "type": "git",
136
+ "url": "git://github.com/konvajs/konva.git"
137
+ },
138
+ "license": "MIT"
139
+ }
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+ old_version="$(git describe --abbrev=0 --tags)"
5
+ new_version=$1
6
+
7
+
8
+ old_cdn_min="https://unpkg.com/konva@${old_version}/konva.min.js"
9
+ new_cdn_min="https://unpkg.com/konva@${new_version}/konva.min.js"
10
+
11
+ # make sure new version parameter is passed
12
+ if [ -z "$1" ]
13
+ then
14
+ echo "ERROR - pass new version. usage release.sh 0.11.0"
15
+ exit 2
16
+ fi
17
+
18
+ # make sure changle log updated
19
+ while true; do
20
+ read -p "Did you update CHANGELOG.md? " yn
21
+ case $yn in
22
+ [Yy]* ) break;;
23
+ [Nn]* ) exit;;
24
+ * ) echo "Please answer yes or no.";;
25
+ esac
26
+ done
27
+
28
+ echo "Old version: ${old_version}"
29
+ echo "New version: ${new_version}"
30
+
31
+ echo "Pulling"
32
+ git pull >/dev/null
33
+
34
+ echo "build and test"
35
+ npm run build >/dev/null
36
+ # npm run test
37
+
38
+
39
+ echo "commit change log updates"
40
+ git commit -am "update CHANGELOG with new version" --allow-empty >/dev/null
41
+
42
+ echo "npm version $1 --no-git-tag-version"
43
+ npm version $1 --no-git-tag-version --allow-same-version >/dev/null
44
+
45
+ echo "build for $1"
46
+ npm run build >/dev/null
47
+ git commit -am "build for $1" --allow-empty >/dev/null
48
+
49
+ echo "update CDN link in README"
50
+ perl -i -pe "s|${old_cdn_min}|${new_cdn_min}|g" ./README.md >/dev/null
51
+ git commit -am "update cdn link" --allow-empty >/dev/null
52
+
53
+ echo "create new git tag"
54
+ git tag $1 >/dev/null
55
+
56
+ cd ../konva
57
+ git push >/dev/null
58
+ git push --tags >/dev/null
59
+ npm publish
60
+
61
+
62
+ echo "DONE!"
@@ -0,0 +1,6 @@
1
+ * @param {Object} [config.clip] set clip
2
+ * @param {Number} [config.clipX] set clip x
3
+ * @param {Number} [config.clipY] set clip y
4
+ * @param {Number} [config.clipWidth] set clip width
5
+ * @param {Number} [config.clipHeight] set clip height
6
+ * @param {Function} [config.clipFunc] set clip func
@@ -0,0 +1,20 @@
1
+ @param {Number} [config.x]
2
+ * @param {Number} [config.y]
3
+ * @param {Number} [config.width]
4
+ * @param {Number} [config.height]
5
+ * @param {Boolean} [config.visible]
6
+ * @param {Boolean} [config.listening] whether or not the node is listening for events
7
+ * @param {String} [config.id] unique id
8
+ * @param {String} [config.name] non-unique name
9
+ * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1
10
+ * @param {Object} [config.scale] set scale
11
+ * @param {Number} [config.scaleX] set scale x
12
+ * @param {Number} [config.scaleY] set scale y
13
+ * @param {Number} [config.rotation] rotation in degrees
14
+ * @param {Object} [config.offset] offset from center point and rotation point
15
+ * @param {Number} [config.offsetX] set offset x
16
+ * @param {Number} [config.offsetY] set offset y
17
+ * @param {Boolean} [config.draggable] makes the node draggable. When stages are draggable, you can drag and drop
18
+ * the entire stage by dragging any portion of the stage
19
+ * @param {Number} [config.dragDistance]
20
+ * @param {Function} [config.dragBoundFunc]
@@ -0,0 +1,53 @@
1
+ @param {String} [config.fill] fill color
2
+ * @param {Image} [config.fillPatternImage] fill pattern image
3
+ * @param {Number} [config.fillPatternX]
4
+ * @param {Number} [config.fillPatternY]
5
+ * @param {Object} [config.fillPatternOffset] object with x and y component
6
+ * @param {Number} [config.fillPatternOffsetX]
7
+ * @param {Number} [config.fillPatternOffsetY]
8
+ * @param {Object} [config.fillPatternScale] object with x and y component
9
+ * @param {Number} [config.fillPatternScaleX]
10
+ * @param {Number} [config.fillPatternScaleY]
11
+ * @param {Number} [config.fillPatternRotation]
12
+ * @param {String} [config.fillPatternRepeat] can be "repeat", "repeat-x", "repeat-y", or "no-repeat". The default is "no-repeat"
13
+ * @param {Object} [config.fillLinearGradientStartPoint] object with x and y component
14
+ * @param {Number} [config.fillLinearGradientStartPointX]
15
+ * @param {Number} [config.fillLinearGradientStartPointY]
16
+ * @param {Object} [config.fillLinearGradientEndPoint] object with x and y component
17
+ * @param {Number} [config.fillLinearGradientEndPointX]
18
+ * @param {Number} [config.fillLinearGradientEndPointY]
19
+ * @param {Array} [config.fillLinearGradientColorStops] array of color stops
20
+ * @param {Object} [config.fillRadialGradientStartPoint] object with x and y component
21
+ * @param {Number} [config.fillRadialGradientStartPointX]
22
+ * @param {Number} [config.fillRadialGradientStartPointY]
23
+ * @param {Object} [config.fillRadialGradientEndPoint] object with x and y component
24
+ * @param {Number} [config.fillRadialGradientEndPointX]
25
+ * @param {Number} [config.fillRadialGradientEndPointY]
26
+ * @param {Number} [config.fillRadialGradientStartRadius]
27
+ * @param {Number} [config.fillRadialGradientEndRadius]
28
+ * @param {Array} [config.fillRadialGradientColorStops] array of color stops
29
+ * @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true
30
+ * @param {String} [config.fillPriority] can be color, linear-gradient, radial-graident, or pattern. The default value is color. The fillPriority property makes it really easy to toggle between different fill types. For example, if you want to toggle between a fill color style and a fill pattern style, simply set the fill property and the fillPattern properties, and then use setFillPriority('color') to render the shape with a color fill, or use setFillPriority('pattern') to render the shape with the pattern fill configuration
31
+ * @param {String} [config.stroke] stroke color
32
+ * @param {Number} [config.strokeWidth] stroke width
33
+ * @param {Boolean} [config.fillAfterStrokeEnabled]. Should we draw fill AFTER stroke? Default is false.
34
+ * @param {Number} [config.hitStrokeWidth] size of the stroke on hit canvas. The default is "auto" - equals to strokeWidth
35
+ * @param {Boolean} [config.strokeHitEnabled] flag which enables or disables stroke hit region. The default is true
36
+ * @param {Boolean} [config.perfectDrawEnabled] flag which enables or disables using buffer canvas. The default is true
37
+ * @param {Boolean} [config.shadowForStrokeEnabled] flag which enables or disables shadow for stroke. The default is true
38
+ * @param {Boolean} [config.strokeScaleEnabled] flag which enables or disables stroke scale. The default is true
39
+ * @param {Boolean} [config.strokeEnabled] flag which enables or disables the stroke. The default value is true
40
+ * @param {String} [config.lineJoin] can be miter, round, or bevel. The default
41
+ * is miter
42
+ * @param {String} [config.lineCap] can be butt, round, or square. The default
43
+ * is butt
44
+ * @param {String} [config.shadowColor]
45
+ * @param {Number} [config.shadowBlur]
46
+ * @param {Object} [config.shadowOffset] object with x and y component
47
+ * @param {Number} [config.shadowOffsetX]
48
+ * @param {Number} [config.shadowOffsetY]
49
+ * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number
50
+ * between 0 and 1
51
+ * @param {Boolean} [config.shadowEnabled] flag which enables or disables the shadow. The default value is true
52
+ * @param {Array} [config.dash]
53
+ * @param {Boolean} [config.dashEnabled] flag which enables or disables the dashArray. The default value is true
@@ -0,0 +1,28 @@
1
+ {
2
+ "path": "ink-docstrap",
3
+ "tags": {
4
+ "allowUnknownTags": true
5
+ },
6
+ "plugins": ["plugins/markdown"],
7
+
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
+ }
28
+ }