fabric 4.5.0 → 4.6.0

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 (44) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/CONTRIBUTING.md +14 -0
  3. package/HEADER.js +1 -1
  4. package/README.md +2 -0
  5. package/build.js +1 -0
  6. package/dist/fabric.js +546 -306
  7. package/dist/fabric.min.js +1 -1
  8. package/package.json +5 -1
  9. package/publish-next.js +15 -0
  10. package/publish.js +3 -0
  11. package/src/brushes/base_brush.class.js +1 -3
  12. package/src/brushes/pencil_brush.class.js +16 -33
  13. package/src/canvas.class.js +18 -40
  14. package/src/filters/saturate_filter.class.js +9 -1
  15. package/src/filters/vibrance_filter.class.js +122 -0
  16. package/src/mixins/animation.mixin.js +4 -4
  17. package/src/mixins/canvas_events.mixin.js +3 -3
  18. package/src/mixins/canvas_grouping.mixin.js +4 -4
  19. package/src/mixins/collection.mixin.js +11 -2
  20. package/src/mixins/eraser_brush.mixin.js +269 -160
  21. package/src/mixins/itext_key_behavior.mixin.js +7 -1
  22. package/src/mixins/object_geometry.mixin.js +2 -1
  23. package/src/mixins/object_interactivity.mixin.js +18 -7
  24. package/src/mixins/observable.mixin.js +22 -0
  25. package/src/parser.js +1 -1
  26. package/src/shapes/circle.class.js +2 -2
  27. package/src/shapes/ellipse.class.js +2 -2
  28. package/src/shapes/group.class.js +11 -7
  29. package/src/shapes/image.class.js +0 -22
  30. package/src/shapes/itext.class.js +10 -0
  31. package/src/shapes/line.class.js +5 -21
  32. package/src/shapes/object.class.js +24 -15
  33. package/src/shapes/path.class.js +4 -9
  34. package/src/shapes/polygon.class.js +2 -9
  35. package/src/shapes/polyline.class.js +0 -15
  36. package/src/shapes/rect.class.js +0 -18
  37. package/src/shapes/text.class.js +97 -45
  38. package/src/shapes/triangle.class.js +0 -15
  39. package/src/static_canvas.class.js +29 -14
  40. package/src/util/animate.js +11 -2
  41. package/src/util/animate_color.js +2 -1
  42. package/src/util/lang_object.js +5 -1
  43. package/src/util/misc.js +5 -2
  44. package/src/util/path.js +96 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.6.0]
4
+
5
+ - feat(fabric.util): added fabric.util.transformPath to add transformations to path points [#7300](https://github.com/fabricjs/fabric.js/pull/7300)
6
+ - feat(fabric.util): added fabric.util.joinPath, the opposite of fabric.util.parsePath [#7300](https://github.com/fabricjs/fabric.js/pull/7300)
7
+ - fix(fabric.util): use integers iterators [#7233](https://github.com/fabricjs/fabric.js/pull/7233)
8
+ - feat(fabric.Text) add path rendering to text on path [#7328](https://github.com/fabricjs/fabric.js/pull/7328)
9
+ - feat(fabric.iText): Add optional hiddenTextareaContainer to contain hiddenTextarea [#7314](https://github.com/fabricjs/fabric.js/pull/7314)
10
+ - fix(fabric.Text) added pathStartOffset and pathSide to props lists for object export [#7318](https://github.com/fabricjs/fabric.js/pull/7318)
11
+ - feat(animate): add imperative abort option for animations [#7275](https://github.com/fabricjs/fabric.js/pull/7275)
12
+ - fix(Fabric.text): account for fontSize in textpath cache dimensions ( to avoid clipping ) [#7298](https://github.com/fabricjs/fabric.js/pull/7298)
13
+ - feat(Observable.once): Add once event handler [#7317](https://github.com/fabricjs/fabric.js/pull/7317)
14
+ - feat(fabric.Object): Improve drawing of controls in group. [#7119](https://github.com/fabricjs/fabric.js/pull/7119)
15
+ - fix(EraserBrush): intersectsWithObject edge cases [#7290](https://github.com/fabricjs/fabric.js/pull/7290)
16
+ - fix(EraserBrush): dump canvas bg/overlay color support [#7289](https://github.com/fabricjs/fabric.js/pull/7289)
17
+ - feat(fabric.Text) added pathSide property to text on path [#7259](https://github.com/fabricjs/fabric.js/pull/7259)
18
+ - fix(EraserBrush) force fill value [#7269](https://github.com/fabricjs/fabric.js/pull/7269)
19
+ - fix(fabric.StaticCanvas) properly remove objects on canvas.clear [#6937](https://github.com/fabricjs/fabric.js/pull/6937)
20
+ - feat(fabric.EraserBrush): improved erasing:end event [#7258](https://github.com/fabricjs/fabric.js/pull/7258)
21
+ - fix(shapes): fabric.Object._fromObject never should return [#7201](https://github.com/fabricjs/fabric.js/pull/7201)
22
+ - feat(fabric.filters) Added vibrance filter (for increasing saturation of muted colors) [#7189](https://github.com/fabricjs/fabric.js/pull/7189)
23
+ - fix(fabric.StaticCanvas): restore canvas size when disposing [#7181](https://github.com/fabricjs/fabric.js/pull/7181)
24
+ - feat(fabric.util): added `convertPointsToSVGPath` that will convert from a list of points to a smooth curve. [#7140](https://github.com/fabricjs/fabric.js/pull/7140)
25
+ - fix(fabric.Object): fix cache invalidation issue when objects are rotating [#7183](https://github.com/fabricjs/fabric.js/pull/7183)
26
+ - fix(fabric.Canvas): rectangle selection works with changing viewport [#7088](https://github.com/fabricjs/fabric.js/pull/7088)
27
+ - feat(fabric.Text): textPath now support textAlign [#7156](https://github.com/fabricjs/fabric.js/pull/7156)
28
+ - fix(fabric.EraserBrush): test eraser intersection with objects taking into account canvas viewport transform [#7147](https://github.com/fabricjs/fabric.js/pull/7147)
29
+ - fix(fabric.Object): support `excludeFromExport` set on `clipPath` [#7148](https://github.com/fabricjs/fabric.js/pull/7148).
30
+ - fix(fabric.Group): support `excludeFromExport` set on objects [#7148](https://github.com/fabricjs/fabric.js/pull/7148).
31
+ - fix(fabric.StaticCanvas): support `excludeFromExport` set on `backgroundColor`, `overlayColor`, `clipPath` [#7148](https://github.com/fabricjs/fabric.js/pull/7148).
32
+ - fix(fabric.EraserBrush): support object resizing (needed for eraser) [#7100](https://github.com/fabricjs/fabric.js/pull/7100).
33
+ - fix(fabric.EraserBrush): support canvas resizing (overlay/background drawables) [#7100](https://github.com/fabricjs/fabric.js/pull/7100).
34
+ - fix(fabric.EraserBrush): propagate `clipPath` of group to erased objects when necessary so it is correct when ungrouping/removing from group [#7100](https://github.com/fabricjs/fabric.js/pull/7100).
35
+ - fix(fabric.EraserBrush): introduce `erasable = deep` option for `fabric.Group` [#7100](https://github.com/fabricjs/fabric.js/pull/7100).
36
+ - feat(fabric.Collection): the `contains` method now accepts a second boolean parameter `deep`, checking all descendants, `collection.contains(obj, true)` [#7139](https://github.com/fabricjs/fabric.js/pull/7139).
37
+ - fix(fabric.StaticCanvas): disposing canvas now restores canvas size and style to original state.
38
+
39
+ ## [4.5.1]
40
+
41
+ - fix(fabric.Text): fixes decoration rendering when there is a single rendering for full text line [#7104](https://github.com/fabricjs/fabric.js/pull/7104)
42
+ - fix(fabric.Text): spell error which made the gradientTransform not working [#7059](https://github.com/fabricjs/fabric.js/pull/7059)
43
+ - fix(fabric.util): unwanted mutation in fabric.util.rotatePoint [#7117](https://github.com/fabricjs/fabric.js/pull/7117)
44
+ - fix(svg parser): Ensure that applyViewboxTransform returns an object and not undefined/null [#7030](https://github.com/fabricjs/fabric.js/pull/7030)
45
+ - fix(fabric.Text): support firefox with ctx.textAlign for RTL text [#7126](https://github.com/fabricjs/fabric.js/pull/7126)
46
+
3
47
  ## [4.5.0]
4
48
 
5
49
  - fix(fabric.PencilBrush) decimate deleting end of a freedrawing line [#6966](https://github.com/fabricjs/fabric.js/pull/6966)
package/CONTRIBUTING.md CHANGED
@@ -46,6 +46,20 @@ Contribute to fabricjs using a fully featured online development environment tha
46
46
 
47
47
  [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
48
48
 
49
+ ### Setting up a local environment
50
+
51
+ Coming Soon!
52
+
53
+ ### Working on fabricjs.com
54
+
55
+ To develop fabric's site you need to clone [`fabricjs.com`](https://github.com/fabricjs/fabricjs.com) in the same parent folder of [`fabric.js`](https://github.com/fabricjs/fabric.js), so that `fabric.js` and `fabricjs.com` are siblings.
56
+ To start the dev server run `npm start` inside the `fabricjs.com` directory (after installing dependecies).
57
+ If you are working on windows, check out [`jekyll` docs](https://jekyllrb.com/docs/installation/) for futher instructions.
58
+
59
+ **Adding a DEMO**:
60
+ Take a look at an existing [demo file](https://github.com/fabricjs/fabricjs.com/blob/gh-pages/posts/demos/_posts/2020-2-15-custom-control-render.md).
61
+ Create a new file in the same directory (`posts/demos/_posts`) and you're good to go.
62
+
49
63
  ### Pull request guidelines
50
64
 
51
65
  Here are a few notes you should take into account:
package/HEADER.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
2
2
 
3
- var fabric = fabric || { version: '4.5.0' };
3
+ var fabric = fabric || { version: '4.6.0' };
4
4
  if (typeof exports !== 'undefined') {
5
5
  exports.fabric = fabric;
6
6
  }
package/README.md CHANGED
@@ -201,6 +201,7 @@ These are the optional modules that could be specified for inclusion, when build
201
201
  - **easing** — Adds support for animation easing functions
202
202
  - **node** — Adds support for running fabric under node.js, with help of [jsdom](https://github.com/tmpvar/jsdom) and [node-canvas](https://github.com/learnboost/node-canvas) libraries.
203
203
  - **freedrawing** — Adds support for free drawing
204
+ - **erasing** — Adds support for object erasing using an eraser brush
204
205
  - **gestures** — Adds support for multitouch gestures with help of [Event.js](https://github.com/mudcube/Event.js)
205
206
  - **object_straightening** — Adds support for rotating an object to one of 0, 90, 180, 270, etc. depending on which is angle is closer.
206
207
  - **animation** — Adds support for animation (`fabric.util.animate`, `fabric.util.requestAnimFrame`, `fabric.Object#animate`, `fabric.Canvas#fxCenterObjectH/#fxCenterObjectV/#fxRemove`)
@@ -250,6 +251,7 @@ For example:
250
251
 
251
252
  - [Fabric on Bountysource](https://www.bountysource.com/trackers/23217-fabric-js)
252
253
  - [Fabric on CodeTriage](http://www.codetriage.com/kangax/fabric.js)
254
+ - [Contributing](./CONTRIBUTING.md)
253
255
 
254
256
  ### Staying in touch
255
257
 
package/build.js CHANGED
@@ -216,6 +216,7 @@ var filesToInclude = [
216
216
  ifSpecifiedInclude('image_filters', 'src/filters/resize_filter.class.js'),
217
217
  ifSpecifiedInclude('image_filters', 'src/filters/contrast_filter.class.js'),
218
218
  ifSpecifiedInclude('image_filters', 'src/filters/saturate_filter.class.js'),
219
+ ifSpecifiedInclude('image_filters', 'src/filters/vibrance_filter.class.js'),
219
220
  ifSpecifiedInclude('image_filters', 'src/filters/blur_filter.class.js'),
220
221
  ifSpecifiedInclude('image_filters', 'src/filters/gamma_filter.class.js'),
221
222
  ifSpecifiedInclude('image_filters', 'src/filters/composed_filter.class.js'),