New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@scratch/paper

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scratch/paper - npm Package Compare versions

Comparing version 0.11.20200518180122 to 0.11.20200529164220

dist/docs/classes/Tween.html

4

AUTHORS.md
## Authors
- Jürg Lehni <juerg@scratchdisk.com>
- Jonathan Puckey <jonathan@studiomoniker.com>
- Jonathan Puckey <jonathan@puckey.studio>

@@ -9,3 +9,3 @@ ## Contributors

- Harikrishnan Gopalakrishnan <hari.exeption@gmail.com>
- Jan Bösenberg <development@iconexperience.com>
- Jan Bösenberg <jan.boesenberg@gmail.com>
- Jt Whissel <jtwhissel@gmail.com>

@@ -12,0 +12,0 @@ - Andrew Roles <jaroles58@gmail.com>

# Change Log
## `0.12.7`
### Fixed
- PaperScript: Actually make `options.paperFeatures.moduleExports` work
independently from `options.paperFeatures.operatorOverloading`.
## `0.12.6`
### Added
- PaperScript: Add option `options.paperFeatures.moduleExports` to control
module exports conversion.
## `0.12.5`
### Added
- PaperScript: Add option `options.paperFeatures.operatorOverloading` to control
operator overloading.
### Fixed
- Fix `new Raster(HTMLCanvasElement)` constructor (#1745).
- Handle `CurveLocation` on paths with only one segment.
- Fix recently introduced error in `CompoundPath.compare()` (#1769).
- Clamp opacity values to [0, 1] (#1814).
- Support closed `Path` items with blend mode and no segments (#1763).
- Fix error in `getCrossingSegments()` (#1773).
- SVG Import: Support SVG strings with leading line-breaks (#1813).
- Docs: Improve documentation for `Raster#drawImage(CanvasImageSource)` (#1784).
### Changed
- Use `'paper-'` prefix in generated view ids.
## `0.12.4`
### Added
- Allow paper core import in TypeScript (#1713).
- Boolean: Improve performance from `O(n^2)` to nearly `O(n)` by the use of the
sweep and prune algorithm (#1737).
- Docs: Add support for nullable values.
### Fixed
- Fix `PathItem#getCrossing()` to not return overlaps (#1409).
- Fix regression in `Curve.getIntersections()` (#1638).
- Fix edge cases in `CurveLocation.isCrossing()` (#1419, #1263).
- Fix `SymbolItem#hitTestAll()` to return only one match per symbol item
(#1680).
- Fix handling of negative `Shape` sizes (#1733).
- Fix parsing of RGB `Color` strings with percentages (#1736).
- Fix `Shape` bounds when passing position in constructor (#1686).
- Prevent nested group matrix from reset when transforming parent (#1711).
- Boolean: Fix edge cases in overlap detection (#1262).
- Boolean: Add check for paths with only one segment (#1351).
- Boolean: Correctly handle open filled paths (#1647).
- Boolean: Avoid winding number edge cases (#1619).
- Docs: Fix some documentation return types (#1679).
## `0.12.3`
### Added
- Add documentation for `Item#internalBounds`.
### Fixed
- Fix regression in `Color` change propagation (#1672, #1674).
- SVG Export: Fix viewport size of exported `Symbol` (#1668).
- Handle non-invertible matrices in `Item#contains()` (#1651).
- Improve documentation for `Item#clipMask` (#1673).
- Improve TypeScript definitions (#1659, #1663, #1664, #1667).
## `0.12.2`
### Fixed
- Fix drawing with compound-paths as clip-items (#1361).
- Fix drawing of path selection with small handle size (#1327).
- Do not ignore `Group#clipItem.matrix` in `Group#internalBounds` (#1427).
- Correctly calculate bounds with nested empty items (#1467).
- Fix color change propagation on groups (#1152).
- Fix `Path#arcTo()` where `from` and `to` points are equal (#1613).
- Improve `new Raster(size[, position])` constructor (#1621).
- SVG Export: Fix error when `Item#matrix` is not invertible (#1580).
- SVG Export: Include missing viewBox attribute (#1576).
- SVG Import: Use correct default values for gradients (#1632, #1660).
- SVG Import: Add basic `<switch/>` support (#1597).
- JSON Import: Prevent `Item#insert()` method from being overridden (#1392).
- PaperScript: Fix issues with increment/decrement operators (#1450, #1611).
## `0.12.1`
### Added
- Add TypeScript definition, automatically generated from JSDoc comments
(#1612).
- Support `new Raster(size[, position])` constructor.
- Expose `Raster#context` accessor.
- Implement `Raster#clear()` method to clear associated canvas context.
- Node.js: Add support for Node.js v11 and v12.
### Fixed
- Fix parsing of CSS colors with spaces in parentheses (#1629).
- Improve `Color.random()` documentation.
- Fix `Tween#then()` documentation.
### Removed
- Node.js: Remove support for Node.js v6.
## `0.12.0`
### News
Another release, another new member on the team: Please welcome
[@arnoson](https://github.com/arnoson), who has worked hard on the all new
animation support, exposed through the `Tween` class and its various methods on
the `Item` class, see below for details:
### Added
- Add new `Tween` class and related methods on `Item`, to animate and
interpolate their various properties, including colors, sub-properties, etc.:
`Item#tween(from, to, options)`, `Item#tween(to, options)`,
`Item#tween(options)`, `Item#tweenFrom(from, options)`,
`Item#tweenTo(to, options)`
### Fixed
- Only draw Raster if image is not empty (#1320).
- Emit mousedrag events on correct items when covered by other items (#1465).
- Fix drawing issues of bounds and position with `Group#selectedColor` (#1571).
- Fix `Item.once()` to actually only emit event once.
- Various documentation fixes and improvements (#1399).
## `0.11.8`

@@ -62,2 +202,3 @@

### Fixed
- Fix `Curve#isSelected()` to correctly reflect the state of `#handle1` (#1378).

@@ -75,2 +216,3 @@ - Key Events: Fix auto-filling issue on Chrome (#1358, #1365).

### Changed
- Node.js: Add support for v8, and keep testing v4, v6, v7 in Travis CI.

@@ -81,8 +223,7 @@

### Fixed
- Mouse Events: Fix item-based `doubleclick` events (#1316).
- Overhaul the caching of bounds and matrix decomposition, improving reliability
of `Item#rotation` and `#scaling` and fixing situations caused by wrongly
caching `Item#position` and `#bounds` values.
- Prevent consumed properties in object literal constructors from being set on

@@ -92,2 +233,3 @@ the instance.

### Changed
- Make all functions and accessors enumerable on all Paper.js classes.

@@ -98,2 +240,3 @@

### Fixed
- PaperScript: Fix a parsing error in math operations without white-space

@@ -105,2 +248,3 @@ (#1314).

### Fixed
- Bring back deactivation of Node.js modules on browsers. This has most probably

@@ -112,2 +256,3 @@ broken Webpack bundling in `0.11.0`.

### Changed
- Separate `paper` module on NPM into: `paper`, `paper-jsdom` and

@@ -125,2 +270,3 @@ `paper-jsdom-canvas` (#1252):

### Added
- PaperScript: Support newer, external versions of Acorn.js for PaperScript

@@ -132,2 +278,3 @@ parsing, opening the doors to ES 2015 (#1183, #1275).

### Fixed
- Intersections: Bring back special handling of curve end-points (#1284).

@@ -166,2 +313,3 @@ - Intersections: Correctly handle `Item#applyMatrix = false` (#1289).

### Changed
- Node.js: Support v7, and keep testing v4 up to v7 in Travis CI.

@@ -191,2 +339,3 @@ - Node.js: Loosely couple Node.js / Electron code to `Canvas` module, and treat

### Added
- Implement `Path#divideAt(location)`, in analogy to `Curve#divideAt(location)`.

@@ -210,2 +359,3 @@ - Add `PathItem#compare()` as a way to compare the geometry of two paths to see

### Fixed
- Many improvements to boolean operations:

@@ -251,2 +401,3 @@ - Improve performance of boolean operations when there no actual crossings

### Removed
- Remove `Numerical.TOLERANCE = 1e-6` as there is no internal use for it

@@ -258,2 +409,3 @@ anymore.

### Fixed
- Get published version to work correctly in Bower again.

@@ -264,2 +416,3 @@

### Fixed
- Correct a few issues with documentation and NPM publishing that slipped

@@ -302,2 +455,3 @@ through in the `0.10.0` release.

### Changed
- Significant overhaul and improvements of boolean path operations

@@ -319,3 +473,3 @@ `PathItem#unite()`, `#subtract()`, `#intersect()`, `#exclude()`, `#divide()`:

- `Curve#getPointAt(time, true)` → `#getPointAtTime(time)`
- `Curve#getTangentAt(time, true)` → `#getTangenttTime(time)`
- `Curve#getTangentAt(time, true)` → `#getTangentAtTime(time)`
- `Curve#getNormalAt(time, true)` → `#getNormalAtTime(time)`

@@ -380,2 +534,3 @@ - `Curve#getCurvatureAt(time, true)` → `#getCurvatureAtTime(time)`

### Added
- Use unified code-base for browsers, Node.js, Electron, and anything

@@ -445,2 +600,3 @@ in-between, and enable npm install for browser use (#739).

### Fixed
- Fix calculations of `Item#strokeBounds` for all possible combinations of

@@ -524,6 +680,7 @@ `Item#strokeScaling` and `Item#applyMatrix` for `Path`, `Shape` and

### Removed
- Canvas attributes "resize" and "data-paper-resize" no longer cause paper to
resize the canvas when the viewport size changes; Additional CSS styles are
required since `0.9.22`, e.g.:
```css

@@ -543,2 +700,3 @@ /* Scale canvas with resize attribute to full size */

### Deprecated
- `#windingRule` on `Item` and `Style` → `#fillRule`

@@ -551,3 +709,3 @@ - `Curve#getNormalAt(time, true)` → `#getNormalAtTime(true)`

- `Curve#getPointAt(time, true)` → `#getPointAtTime(time)`
- `Curve#getTangentAt(time, true)` → `#getTangenttTime(time)`
- `Curve#getTangentAt(time, true)` → `#getTangentAtTime(time)`
- `Curve#getNormalAt(time, true)` → `#getNormalAtTime(time)`

@@ -554,0 +712,0 @@ - `Curve#getCurvatureAt(time, true)` → `#getCurvatureAtTime(time)`

@@ -5,4 +5,4 @@ /*

*
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
* http://juerglehni.com/ & https://puckey.studio/
*

@@ -22,3 +22,3 @@ * Distributed under the MIT license. See LICENSE file for details.

try {
Canvas = require('canvas');
Canvas = require('canvas').Canvas;
} catch(error) {

@@ -25,0 +25,0 @@ // Remove `self.window`, so we still have the global `self` reference,

@@ -5,4 +5,4 @@ /*

*
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
* http://juerglehni.com/ & https://puckey.studio/
*

@@ -9,0 +9,0 @@ * Distributed under the MIT license. See LICENSE file for details.

@@ -5,4 +5,4 @@ /*

*
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
* http://juerglehni.com/ & https://puckey.studio/
*

@@ -41,11 +41,9 @@ * Distributed under the MIT license. See LICENSE file for details.

/* global document:true, window:true */
var document = jsdom.jsdom('<html><body></body></html>', {
var document = new jsdom.JSDOM('<html><body></body></html>', {
// Use the current working directory as the document's origin, so
// requests to local files work correctly with CORS.
url: 'file://' + process.cwd() + '/',
features: {
FetchExternalResources: ['img', 'script']
}
resources: 'usable'
});
self = document.defaultView;
self = document.window;
require('./canvas.js')(self, requireName);

@@ -52,0 +50,0 @@ require('./xml.js')(self);

@@ -5,4 +5,4 @@ /*

*
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
* http://juerglehni.com/ & https://puckey.studio/
*

@@ -9,0 +9,0 @@ * Distributed under the MIT license. See LICENSE file for details.

@@ -27,3 +27,3 @@ // Please note: When loading paper as a normal module installed in node_modules,

var svg = new paper.XMLSerializer().serializeToString(project.exportSVG());
fs.writeFile(path.resolve('./out.svg'),svg, function (err) {
fs.writeFile(path.resolve('./out.svg'), svg, function (err) {
if (err) throw err;

@@ -30,0 +30,0 @@ console.log('Saved!');

@@ -48,3 +48,3 @@ // Please note: When loading paper as a normal module installed in node_modules,

fs.writeFile(path.resolve('./out.svg'),svg, function (err) {
fs.writeFile(path.resolve('./out.svg'), svg, function (err) {
if (err) throw err;

@@ -51,0 +51,0 @@ console.log('Saved!');

@@ -1,3 +0,3 @@

Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
http://scratchdisk.com/ & http://jonathanpuckey.com/
Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
http://juerglehni.com/ & https://puckey.studio/
All rights reserved.

@@ -4,0 +4,0 @@

{
"name": "@scratch/paper",
"version": "0.11.20200518180122",
"version": "0.11.20200529164220",
"description": "The Swiss Army Knife of Vector Graphics Scripting",

@@ -14,8 +14,7 @@ "license": "MIT",

"Jürg Lehni <juerg@scratchdisk.com> (http://scratchdisk.com)",
"Jonathan Puckey <jonathan@studiomoniker.com> (http://studiomoniker.com)"
"Jonathan Puckey <jonathan@puckey.studio> (http://studiomoniker.com)"
],
"main": "dist/paper-full.js",
"types": "dist/paper.d.ts",
"scripts": {
"precommit": "gulp jshint --branch develop",
"prepush": "gulp test --branch develop",
"build": "gulp build",

@@ -38,17 +37,31 @@ "dist": "gulp dist",

"engines": {
"node": ">=4.0.0"
"node": ">=8.0.0"
},
"husky": {
"hooks": {
"pre-commit": "gulp jshint --ensure-branch develop",
"pre-push": "gulp test --ensure-branch develop"
}
},
"browser": {
"canvas": false,
"jsdom": false,
"jsdom/lib/jsdom/living/generated/utils": false,
"source-map-support": false,
"./dist/node/self.js": false,
"./dist/node/extend.js": false
},
"devDependencies": {
"acorn": "~0.5.0",
"canvas-prebuilt": "^2.0.0-alpha.14",
"del": "^2.2.1",
"canvas": "^2.6.0",
"del": "^4.1.0",
"gulp": "^3.9.1",
"gulp-cached": "^1.1.0",
"gulp-git-streamed": "^2.8.1",
"gulp-jshint": "^2.0.0",
"gulp-json-editor": "^2.2.1",
"gulp-git-streamed": "^2.10.1",
"gulp-jshint": "^2.1.0",
"gulp-json-editor": "^2.5.2",
"gulp-prepro": "^2.4.0",
"gulp-qunits": "^2.1.1",
"gulp-rename": "^1.2.2",
"gulp-shell": "^0.5.2",
"gulp-qunits": "^2.1.2",
"gulp-rename": "^1.4.0",
"gulp-shell": "^0.7.0",
"gulp-symlink": "^2.1.4",

@@ -61,25 +74,19 @@ "gulp-uglify": "^1.5.4",

"gulp-zip": "^3.2.0",
"husky": "^0.11.4",
"jsdom": "^9.4.0",
"jshint": "^2.9.2",
"husky": "^2.3.0",
"jsdom": "^15.1.1",
"jshint": "^2.10.2",
"jshint-summary": "^0.4.0",
"merge-stream": "^1.0.0",
"merge-stream": "^2.0.0",
"minimist": "^1.2.0",
"mustache": "^3.0.1",
"prepro": "^2.4.0",
"qunitjs": "^1.23.0",
"require-dir": "^0.3.0",
"resemblejs": "^2.2.1",
"run-sequence": "^1.2.2",
"source-map-support": "^0.4.0",
"stats.js": "0.16.0",
"straps": "^3.0.1"
"require-dir": "^1.2.0",
"resemblejs": "^3.1.0",
"run-sequence": "^2.2.1",
"source-map-support": "^0.5.12",
"stats.js": "0.17.0",
"straps": "^3.0.1",
"typescript": "^3.1.6"
},
"browser": {
"canvas": false,
"jsdom": false,
"jsdom/lib/jsdom/living/generated/utils": false,
"source-map-support": false,
"./dist/node/self.js": false,
"./dist/node/extend.js": false
},
"keywords": [

@@ -86,0 +93,0 @@ "vector",

@@ -1,2 +0,2 @@

# Paper.js - The Swiss Army Knife of Vector Graphics Scripting [![Build Status](https://travis-ci.org/paperjs/paper.js.svg?branch=develop)](https://travis-ci.org/paperjs/paper.js) [![NPM](https://img.shields.io/npm/v/paper.svg)](https://www.npmjs.com/package/paper) ![Bower](https://img.shields.io/bower/v/paper.svg)
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting [![Build Status](https://travis-ci.org/paperjs/paper.js.svg?branch=develop)](https://travis-ci.org/paperjs/paper.js) [![NPM](https://img.shields.io/npm/v/paper.svg)](https://www.npmjs.com/package/paper)

@@ -7,2 +7,3 @@ If you want to work with Paper.js, simply download the latest "stable" version

- Website: <http://paperjs.org/>
- Questions: <https://stackoverflow.com/questions/tagged/paperjs>
- Discussion forum: <https://groups.google.com/group/paperjs>

@@ -21,15 +22,13 @@ - Mainline source code: <https://github.com/paperjs/paper.js>

project is through the [Node.js Package Manager (NPM)](https://www.npmjs.com/)
for browsers, Node.js or Electron, as well as through Bower for browsers.
for browsers, Node.js or Electron.
If NPM or Bower is already installed, simply type one of these
commands in your project folder:
If NPM is already installed, simply type one of these commands in your project
folder:
```sh
npm install paper
# Or:
bower install paper
```
Upon execution, you will find a `paper` folder inside the project's
`node_modules` / `bower_components` folder.
`node_modules` folder.

@@ -39,3 +38,3 @@ For more information on how to install Node.js and NPM, read the chapter

### Which Version to Use?
### Which Version to Use

@@ -74,3 +73,3 @@ The various distributions come with two different pre-build versions of

### Installing Paper.js for Node.js
### Installing Paper.js Using NPM

@@ -92,7 +91,14 @@ Paper.js comes in three different versions on NPM: `paper`, `paper-jsdom` and

##### Installing Cairo and Pango on macOS:
### Installing Native Dependencies
The easiest way to install Cairo is through [Homebrew](https://brew.sh/), by
issuing the command:
Paper.js relies on [Node-Canvas](https://github.com/Automattic/node-canvas) for
rendering, which in turn relies on the native libraries
[Cairo](https://cairographics.org/) and [Pango](https://www.pango.org/).
#### Installing Native Dependencies on macOS
Paper.js relies on Node-Canvas for rendering, which in turn relies on Cairo and
Pango. The easiest way to install Cairo is through
[Homebrew](https://brew.sh/), by issuing the command:
brew install cairo pango

@@ -120,3 +126,3 @@

##### Installing Cairo, Pango and all other dependencies on Debian/Ubuntu Linux:
#### Installing Native Dependencies on Debian/Ubuntu Linux

@@ -130,4 +136,14 @@ sudo apt-get install pkg-config libcairo2-dev libpango1.0-dev libssl-dev libjpeg62-dev libgif-dev

##### After Cairo has been installed:
#### Installing Native Dependencies for Electron
In order to build Node-Canvas for use of `paper-jsdom-canvas` in Electron, which
is likely to use a different version of V8 than the Node binary installed in
your system, you need to manually specify the location of Electron’s headers.
Follow these steps to do so:
[Electron — Using Native Node
Modules](https://electron.atom.io/docs/tutorial/using-native-node-modules/)
#### After Native Dependencies have been installed
You should now be able to install the Paper.js module with jsdom and Canvas

@@ -138,13 +154,2 @@ rendering from NPM:

### Installing Paper.js with Node-Canvas for Electron
[Node-Canvas](https://github.com/Automattic/node-canvas) is a native dependency.
In order to build it for use of `paper-jsdom-canvas` in Electron, which is
likely to use a different version of V8 than the Node binary installed in your
system, you need to manually specify the location of Electron’s headers. Follow
these steps to do so:
[Electron — Using Native Node
Modules](https://electron.atom.io/docs/tutorial/using-native-node-modules/)
## Development

@@ -174,4 +179,4 @@

As of 2016, Paper.js uses [Gulp.js](https://gulpjs.com/) for building, and has a
couple of dependencies as Bower and NPM modules. Read the chapter [Installing
Node.js, NPM and Bower](#installing-nodejs-npm-and-bower) if you still need to
couple of dependencies as NPM modules. Read the chapter [Installing
Node.js and NPM](#installing-nodejs-and-npm) if you still need to
install these.

@@ -178,0 +183,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc