paper 0.16.0 → 0.17.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 (63) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/dist/docs/assets/js/paper.js +4565 -733
  3. package/dist/docs/classes/AreaText.html +720 -242
  4. package/dist/docs/classes/ChangeFlag.html +1 -1
  5. package/dist/docs/classes/Color.html +218 -21
  6. package/dist/docs/classes/CompoundPath.html +1146 -296
  7. package/dist/docs/classes/Curve.html +1 -1
  8. package/dist/docs/classes/CurveLocation.html +1 -1
  9. package/dist/docs/classes/DrawEvent.html +69 -0
  10. package/dist/docs/classes/Effect.html +434 -0
  11. package/dist/docs/classes/EffectInstance.html +304 -0
  12. package/dist/docs/classes/Event.html +1 -1
  13. package/dist/docs/classes/Gradient.html +1 -1
  14. package/dist/docs/classes/GradientStop.html +1 -1
  15. package/dist/docs/classes/Group.html +792 -243
  16. package/dist/docs/classes/HitResult.html +1 -1
  17. package/dist/docs/classes/HostItem.html +720 -242
  18. package/dist/docs/classes/Item.html +777 -242
  19. package/dist/docs/classes/Key.html +1 -1
  20. package/dist/docs/classes/KeyEvent.html +1 -1
  21. package/dist/docs/classes/Layer.html +734 -185
  22. package/dist/docs/classes/Matrix.html +1 -1
  23. package/dist/docs/classes/MouseEvent.html +1 -1
  24. package/dist/docs/classes/PaperScope.html +1 -1
  25. package/dist/docs/classes/PaperScript.html +4 -2
  26. package/dist/docs/classes/Path.html +1195 -252
  27. package/dist/docs/classes/PathItem.html +1148 -298
  28. package/dist/docs/classes/PathText.html +720 -242
  29. package/dist/docs/classes/PatternDefinition.html +367 -0
  30. package/dist/docs/classes/Point.html +1 -1
  31. package/dist/docs/classes/PointText.html +720 -242
  32. package/dist/docs/classes/Project.html +177 -7
  33. package/dist/docs/classes/Raster.html +720 -242
  34. package/dist/docs/classes/Rectangle.html +1 -1
  35. package/dist/docs/classes/Segment.html +3 -3
  36. package/dist/docs/classes/Shape.html +720 -242
  37. package/dist/docs/classes/Size.html +1 -1
  38. package/dist/docs/classes/StrokeProfileStop.html +346 -0
  39. package/dist/docs/classes/Style.html +1 -1
  40. package/dist/docs/classes/SymbolDefinition.html +28 -2
  41. package/dist/docs/classes/SymbolItem.html +720 -242
  42. package/dist/docs/classes/TextItem.html +720 -242
  43. package/dist/docs/classes/TextRange.html +1 -1
  44. package/dist/docs/classes/TextStory.html +1 -1
  45. package/dist/docs/classes/Tool.html +2 -2
  46. package/dist/docs/classes/ToolEvent.html +1 -1
  47. package/dist/docs/classes/Tween.html +1 -1
  48. package/dist/docs/classes/View.html +2 -2
  49. package/dist/docs/classes/global.html +1 -1
  50. package/dist/docs/classes/index.html +2 -2
  51. package/dist/docs/index.html +1 -1
  52. package/dist/node/browser.js +15 -0
  53. package/dist/paper-core.js +4476 -674
  54. package/dist/paper-core.min.js +3 -3
  55. package/dist/paper-full.js +4565 -733
  56. package/dist/paper-full.min.js +3 -3
  57. package/dist/paper-hosted.js +5111 -823
  58. package/dist/paper.d.ts +898 -47
  59. package/examples/Paperjs.org/LiveEffects.html +366 -0
  60. package/examples/Paperjs.org/Offsetting.html +379 -0
  61. package/examples/Paperjs.org/StrokeProfiles.html +706 -0
  62. package/examples/Scripts/Patterns.html +57 -0
  63. package/package.json +5 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,96 @@
1
1
  # Change Log
2
2
 
3
+ ## `0.17.0`
4
+
5
+ ### Added
6
+
7
+ - Add `PathItem#offset(distance, options)`, which grows, shrinks or offsets
8
+ paths and compound paths with miter, round or bevel corners (#371).
9
+ - Add `PathItem#outline(options)`, which turns the stroke of a path item into a
10
+ filled path item, with its joins, caps and dashes (#371).
11
+ - Add `PathItem#dash(options)`, which cuts a stroke into its dashes as the
12
+ canvas draws them, as a group of open paths.
13
+ - Add stroke profiles, `Path#strokeProfile`: stops along a path that change
14
+ the width, aspect and angle of the pen that draws its stroke, see
15
+ `StrokeProfileStop`. Not yet supported: compound paths, `strokeScaling` off,
16
+ and `offset()`, boolean operations, `interpolate()` and SVG (#2505, #2506,
17
+ #2507).
18
+ - Add live effects, `Item#effects`, which change what an item draws without
19
+ changing the item, starting with `offset` and `outline`. `Effect` defines new
20
+ ones, and `Item#previewBounds` measures what they draw.
21
+ - Add pattern colors from a `PatternDefinition`, which tiles a raster or any
22
+ other item, for fills and strokes, also in SVG and JSON (#829).
23
+ - Add `Color#aspect` for elliptical radial gradients, and transform gradients
24
+ exactly with their items, also when these scale unevenly or shear (#1744).
25
+ - Add `Group#buffered`, which keeps a group's drawing in a canvas until the
26
+ group changes, for large groups that rarely do (#377).
27
+ - Add `Item#onDraw` and `Item#onDrawSelection`, which draw beneath an item or
28
+ its selection, or replace them, also as class-level handlers such as
29
+ `Path.onDraw`.
30
+ - Add `PathItem#arcAround(center, angle)` and `PathItem#arcTowards(to)`
31
+ (#1052).
32
+ - Support `options` in `PathItem#simplify()`, with `tolerance` and a range of
33
+ segments through `from` and `to`, as in `PathItem#smooth()` (#2501).
34
+ - Export and import the names and data of segments in SVG, as a
35
+ `data-paper-segments` attribute (#2398).
36
+ - Add `Project#onActivate` and `Project#onDeactivate`, also as
37
+ `Project.onActivate` and `Project.onDeactivate` for all projects.
38
+ - Pass the import attributes of `import … with { … }` in PaperScript on to the
39
+ loader in `options.load` of `PaperScript.execute()`.
40
+ - Hosted projects, see `Project#host`:
41
+ - Share symbol and pattern definitions between items, referred to by their
42
+ keys in JSON, and let scripts create new ones.
43
+ - Load the pixels of rasters from the host on first access.
44
+ - Load items in full when they move into a project with another host.
45
+ - Call `Item#onDraw` and `Item#onDrawSelection`, through `Project#draw()`.
46
+
47
+ ### Changed
48
+
49
+ - Run the library in strict mode, which makes `Path#getNearestPoint()` about
50
+ 14% and `Item#hitTest()` about 6% faster. PaperScript still runs in sloppy
51
+ mode.
52
+ - Draw items with opacity, blend modes or shadows about twice as fast (#377).
53
+ - Make `PaperScope#project` an accessor, so that PaperScript's `project`
54
+ follows the active project, as `view` does.
55
+ - Emit `deactivate` when the active project or tool is removed.
56
+ - Write the definition of symbol items to JSON as `definition` instead of
57
+ `symbol`, which still loads.
58
+ - Let hosted linked text that moves into a project with another host bring a
59
+ copy of its story along (#2462, #2463).
60
+
61
+ ### Fixed
62
+
63
+ - Fix boolean operations that could lose areas or whole results, at straight
64
+ curves, near-coincident crossings, curves running back and forth along a
65
+ line, shallow crossings and merged vertices.
66
+ - Measure curve lengths precisely near cusps, where `Curve#getLength()` and
67
+ `Path#getPointAt()` were off by up to 6%.
68
+ - Find the nearest point on curves that cover a lot of ground between their
69
+ samples, in `#getNearestPoint()` and the methods using it.
70
+ - Fix `PathItem#smooth()` with a negative `to` on closed paths, which threw.
71
+ - Fix `PathItem#arcTo()` with tiny arcs, which missed their end point.
72
+ - Keep the attributes of compound paths in `CompoundPath#reduce()` when a
73
+ single child is left.
74
+ - Return `false` from `CompoundPath#simplify()` without children.
75
+ - Keep the stripes of linear gradients across them when transforming them
76
+ unevenly (#1744).
77
+ - Export the gradients of items that keep their matrix to SVG in the
78
+ coordinates of their elements (#2410).
79
+ - Honor the `bounds` and `matrix` options of `Item#exportSVG()`.
80
+ - Keep `Group#isolated` and `Group#buffered` in clones.
81
+ - Keep the content of rasters when setting `Raster#size`.
82
+ - Load `new Raster(source)` from a string where there is no document, as in
83
+ workers.
84
+ - Draw the segments of selected paths again by default (#1899).
85
+ - Count the duration of `Item#tween()` from the first frame.
86
+ - PaperScript: compile `++` and `--` correctly wherever they appear, keep
87
+ keywords apart from replaced expressions in minified code, report the right
88
+ lines in stack traces on V8, and return an object from `compile()` for empty
89
+ code.
90
+ - Hosted projects: leave items that moved away out of `Project#takeChanges()`,
91
+ and turn off `View#autoUpdate` when setting `Project#host`.
92
+ - Let Angular's esbuild builder bundle Paper.js for browsers (#2035).
93
+
3
94
  ## `0.16.0`
4
95
 
5
96
  ### Added
@@ -33,6 +124,8 @@
33
124
  new text has defaults of its own, such as a black fill without a stroke.
34
125
  - Add `Point#values`, `Size#values` and `Rectangle#values`, which give their
35
126
  numbers as an array, as `Matrix#values` does.
127
+ - Add `options.evaluate` to `PaperScript.execute()`, for hosts whose engine
128
+ doesn't name code from `Function()` in stack traces, such as JavaScriptCore.
36
129
 
37
130
  ### Changed
38
131
 
@@ -62,6 +155,8 @@
62
155
  - Hit-test the strokes of shapes as those of their paths, which `Shape` only
63
156
  approximated for ellipses and rounded corners, and for non-scaling strokes
64
157
  under non-uniform matrices (#2334).
158
+ - Name PaperScript's url in stack traces also without source maps, and in the
159
+ location of its syntax errors.
65
160
 
66
161
  ## `0.15.0`
67
162