diff --git a/package.json b/package.json index 5985c099..5b6084db 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "react-dom": "^16" }, "devDependencies": { + "@scratch/paper": "~0.11.6", "autoprefixer": "7.1.2", "babel-cli": "6.26.0", "babel-core": "^6.23.1", diff --git a/src/containers/blob/blob.js b/src/containers/blob/blob.js index 3d93ebec..5fed2544 100644 --- a/src/containers/blob/blob.js +++ b/src/containers/blob/blob.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import log from '../../log/log'; import BroadBrushHelper from './broad-brush-helper'; import SegmentBrushHelper from './segment-brush-helper'; diff --git a/src/containers/blob/broad-brush-helper.js b/src/containers/blob/broad-brush-helper.js index 7ccef404..40170fca 100644 --- a/src/containers/blob/broad-brush-helper.js +++ b/src/containers/blob/broad-brush-helper.js @@ -1,5 +1,5 @@ // Broadbrush based on http://paperjs.org/tutorials/interaction/working-with-mouse-vectors/ -import paper from 'paper'; +import paper from '@scratch/paper'; import {stylePath} from '../../helper/style-path'; /** diff --git a/src/containers/blob/segment-brush-helper.js b/src/containers/blob/segment-brush-helper.js index aa29ec5f..3ab38466 100644 --- a/src/containers/blob/segment-brush-helper.js +++ b/src/containers/blob/segment-brush-helper.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import {stylePath} from '../../helper/style-path'; /** diff --git a/src/containers/line-mode.jsx b/src/containers/line-mode.jsx index 56cf6dc2..72b435b2 100644 --- a/src/containers/line-mode.jsx +++ b/src/containers/line-mode.jsx @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import PropTypes from 'prop-types'; import React from 'react'; import {connect} from 'react-redux'; diff --git a/src/containers/paint-editor.jsx b/src/containers/paint-editor.jsx index c5154c0f..0b039e8a 100644 --- a/src/containers/paint-editor.jsx +++ b/src/containers/paint-editor.jsx @@ -11,7 +11,7 @@ import {performUndo, performRedo, performSnapshot} from '../helper/undo'; import Modes from '../modes/modes'; import {connect} from 'react-redux'; import bindAll from 'lodash.bindall'; -import paper from 'paper'; +import paper from '@scratch/paper'; class PaintEditor extends React.Component { constructor (props) { diff --git a/src/containers/paper-canvas.jsx b/src/containers/paper-canvas.jsx index 754d57d9..d09046d0 100644 --- a/src/containers/paper-canvas.jsx +++ b/src/containers/paper-canvas.jsx @@ -2,7 +2,7 @@ import bindAll from 'lodash.bindall'; import PropTypes from 'prop-types'; import React from 'react'; import {connect} from 'react-redux'; -import paper from 'paper'; +import paper from '@scratch/paper'; import {performSnapshot} from '../helper/undo'; import {undoSnapshot} from '../reducers/undo'; diff --git a/src/containers/selection-hoc.jsx b/src/containers/selection-hoc.jsx index d81a1c07..dbe59b1a 100644 --- a/src/containers/selection-hoc.jsx +++ b/src/containers/selection-hoc.jsx @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/helper/group.js b/src/helper/group.js index 792753c0..1071021c 100644 --- a/src/helper/group.js +++ b/src/helper/group.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import {getRootItem, isGroupItem} from './item'; import {clearSelection, getSelectedRootItems, setItemSelection} from './selection'; diff --git a/src/helper/guides.js b/src/helper/guides.js index cd0d7481..eea83520 100644 --- a/src/helper/guides.js +++ b/src/helper/guides.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import {getGuideLayer} from './layer'; import {getAllRootItems} from './selection'; diff --git a/src/helper/hover.js b/src/helper/hover.js index eee1b3b5..2ae46e1f 100644 --- a/src/helper/hover.js +++ b/src/helper/hover.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import {isBoundsItem, getRootItem} from './item'; import {hoverBounds, hoverItem} from './guides'; import {isGroupChild} from './group'; diff --git a/src/helper/item.js b/src/helper/item.js index 3083dbf7..51e8e5bf 100644 --- a/src/helper/item.js +++ b/src/helper/item.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; const getRootItem = function (item) { if (item.parent.className === 'Layer') { diff --git a/src/helper/layer.js b/src/helper/layer.js index 0e33649a..2cd811ab 100644 --- a/src/helper/layer.js +++ b/src/helper/layer.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; const getGuideLayer = function () { for (let i = 0; i < paper.project.layers.length; i++) { diff --git a/src/helper/math.js b/src/helper/math.js index a769aa67..06520b5f 100644 --- a/src/helper/math.js +++ b/src/helper/math.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; const checkPointsClose = function (startPos, eventPoint, threshold) { const xOff = Math.abs(startPos.x - eventPoint.x); diff --git a/src/helper/selection-tools/bounding-box-tool.js b/src/helper/selection-tools/bounding-box-tool.js index 9a6018ab..cd44a7e3 100644 --- a/src/helper/selection-tools/bounding-box-tool.js +++ b/src/helper/selection-tools/bounding-box-tool.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import keyMirror from 'keymirror'; import {getSelectedRootItems} from '../selection'; diff --git a/src/helper/selection-tools/point-tool.js b/src/helper/selection-tools/point-tool.js index f964f2eb..0c88d2f9 100644 --- a/src/helper/selection-tools/point-tool.js +++ b/src/helper/selection-tools/point-tool.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import {snapDeltaToAngle} from '../math'; import {clearSelection, getSelectedLeafItems} from '../selection'; diff --git a/src/helper/selection-tools/reshape-tool.js b/src/helper/selection-tools/reshape-tool.js index 460f33e0..cb55fd1b 100644 --- a/src/helper/selection-tools/reshape-tool.js +++ b/src/helper/selection-tools/reshape-tool.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import log from '../../log/log'; import keyMirror from 'keymirror'; diff --git a/src/helper/selection-tools/rotate-tool.js b/src/helper/selection-tools/rotate-tool.js index 902eaf36..66adc89e 100644 --- a/src/helper/selection-tools/rotate-tool.js +++ b/src/helper/selection-tools/rotate-tool.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; /** * Tool to handle rotation when dragging the rotation handle in the bounding box tool. diff --git a/src/helper/selection-tools/scale-tool.js b/src/helper/selection-tools/scale-tool.js index e58e7bd9..5b85db13 100644 --- a/src/helper/selection-tools/scale-tool.js +++ b/src/helper/selection-tools/scale-tool.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; /** * Tool to handle scaling items by pulling on the handles around the edges of the bounding diff --git a/src/helper/selection-tools/select-tool.js b/src/helper/selection-tools/select-tool.js index d2306cd1..a66ee78b 100644 --- a/src/helper/selection-tools/select-tool.js +++ b/src/helper/selection-tools/select-tool.js @@ -4,7 +4,7 @@ import {getHoveredItem} from '../hover'; import {deleteSelection, selectRootItem} from '../selection'; import BoundingBoxTool from './bounding-box-tool'; import SelectionBoxTool from './selection-box-tool'; -import paper from 'paper'; +import paper from '@scratch/paper'; /** * paper.Tool that handles select mode. This is made up of 2 subtools. diff --git a/src/helper/selection.js b/src/helper/selection.js index 95c55984..dde6802f 100644 --- a/src/helper/selection.js +++ b/src/helper/selection.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import Modes from '../modes/modes'; import {getItemsGroup, isGroup} from './group'; diff --git a/src/helper/style-path.js b/src/helper/style-path.js index 6910b573..9711f178 100644 --- a/src/helper/style-path.js +++ b/src/helper/style-path.js @@ -1,4 +1,4 @@ -import paper from 'paper'; +import paper from '@scratch/paper'; import {getSelectedLeafItems} from './selection'; import {isPGTextItem, isPointTextItem} from './item'; import {isGroup} from './group'; diff --git a/src/helper/undo.js b/src/helper/undo.js index 8e0e326e..d7440e50 100644 --- a/src/helper/undo.js +++ b/src/helper/undo.js @@ -1,6 +1,6 @@ // undo functionality // modifed from https://github.com/memononen/stylii -import paper from 'paper'; +import paper from '@scratch/paper'; const performSnapshot = function (dispatchPerformSnapshot) { dispatchPerformSnapshot({