scratch-paint 0.2.0 → 1.0.2

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 (41) hide show
  1. package/.circleci/config.yml +113 -0
  2. package/.editorconfig +1 -1
  3. package/.gitattributes +1 -0
  4. package/.husky/.gitattributes +1 -0
  5. package/.husky/commit-msg +4 -0
  6. package/CHANGELOG.md +81 -0
  7. package/commitlint.config.js +4 -0
  8. package/dist/scratch-paint.js +2650 -4086
  9. package/dist/scratch-paint.js.map +1 -1
  10. package/pack/scratch-paint-1.0.2.tgz +0 -0
  11. package/package.json +62 -42
  12. package/release.config.js +13 -0
  13. package/renovate.json5 +7 -0
  14. package/src/.eslintrc.js +3 -1
  15. package/src/components/color-picker/color-picker.jsx +11 -1
  16. package/src/components/fixed-tools/fixed-tools.jsx +1 -2
  17. package/src/components/forms/slider.jsx +21 -4
  18. package/src/components/mode-tools/mode-tools.jsx +1 -2
  19. package/src/components/paint-editor/paint-editor.jsx +1 -2
  20. package/src/containers/color-indicator.jsx +1 -2
  21. package/src/containers/fixed-tools.jsx +1 -2
  22. package/src/containers/line-mode.jsx +1 -2
  23. package/src/containers/mode-tools.jsx +1 -2
  24. package/src/containers/paint-editor.jsx +4 -5
  25. package/src/containers/paper-canvas.jsx +5 -2
  26. package/src/containers/stroke-color-indicator.jsx +1 -2
  27. package/src/containers/stroke-width-indicator.jsx +4 -4
  28. package/src/helper/bit-tools/brush-tool.js +1 -2
  29. package/src/helper/bit-tools/line-tool.js +1 -2
  30. package/src/helper/bitmap.js +7 -3
  31. package/src/helper/selection-tools/move-tool.js +6 -6
  32. package/src/helper/style-path.js +2 -4
  33. package/src/helper/tools/fill-tool.js +11 -1
  34. package/src/helper/undo.js +1 -2
  35. package/src/hocs/copy-paste-hoc.jsx +1 -2
  36. package/src/hocs/keyboard-shortcuts-hoc.jsx +1 -2
  37. package/src/hocs/undo-hoc.jsx +4 -3
  38. package/src/hocs/update-image-hoc.jsx +6 -6
  39. package/src/playground/playground.jsx +3 -0
  40. package/webpack.config.js +1 -3
  41. package/.travis.yml +0 -80
@@ -6,11 +6,12 @@ import {connect} from 'react-redux';
6
6
 
7
7
  import {getSelectedLeafItems} from '../helper/selection';
8
8
  import {setSelectedItems} from '../reducers/selected-items';
9
- import {performUndo, performRedo, shouldShowUndo, shouldShowRedo} from '../helper/undo';
9
+ import {
10
+ performUndo, performRedo, shouldShowUndo, shouldShowRedo
11
+ } from '../helper/undo';
10
12
  import {undo, redo} from '../reducers/undo';
11
13
 
12
- import {isBitmap} from '../lib/format';
13
- import Formats from '../lib/format';
14
+ import Formats, {isBitmap} from '../lib/format';
14
15
 
15
16
  const UndoHOC = function (WrappedComponent) {
16
17
  class UndoWrapper extends React.Component {
@@ -16,13 +16,13 @@ import {commitRectToBitmap, commitOvalToBitmap, commitSelectionToBitmap, getHitB
16
16
  import {performSnapshot} from '../helper/undo';
17
17
  import {scaleWithStrokes} from '../helper/math';
18
18
 
19
- import {ART_BOARD_WIDTH, ART_BOARD_HEIGHT, SVG_ART_BOARD_WIDTH, SVG_ART_BOARD_HEIGHT} from '../helper/view';
20
- import {setWorkspaceBounds} from '../helper/view';
19
+ import {
20
+ ART_BOARD_WIDTH, ART_BOARD_HEIGHT, SVG_ART_BOARD_WIDTH, SVG_ART_BOARD_HEIGHT,
21
+ setWorkspaceBounds
22
+ } from '../helper/view';
21
23
 
22
- import Modes from '../lib/modes';
23
- import {BitmapModes} from '../lib/modes';
24
- import Formats from '../lib/format';
25
- import {isBitmap, isVector} from '../lib/format';
24
+ import Modes, {BitmapModes} from '../lib/modes';
25
+ import Formats, {isBitmap, isVector} from '../lib/format';
26
26
 
27
27
  const UpdateImageHOC = function (WrappedComponent) {
28
28
  class UpdateImageWrapper extends React.Component {
@@ -7,6 +7,9 @@ import {createStore} from 'redux';
7
7
  import reducer from './reducers/combine-reducers';
8
8
  import {intlInitialState, IntlProvider} from './reducers/intl.js';
9
9
  import styles from './playground.css';
10
+ // scratch-render-fonts is a playground-only dep. Fonts are expected to be imported
11
+ // as a peer dependency, otherwise there will be two copies of them.
12
+ import {FONTS} from 'scratch-render-fonts';
10
13
 
11
14
  const appTarget = document.createElement('div');
12
15
  appTarget.setAttribute('class', styles.playgroundContainer);
package/webpack.config.js CHANGED
@@ -44,9 +44,7 @@ const base = {
44
44
  return [
45
45
  postcssImport,
46
46
  postcssVars,
47
- autoprefixer({
48
- browsers: ['last 3 versions', 'Safari >= 8', 'iOS >= 8']
49
- })
47
+ autoprefixer()
50
48
  ];
51
49
  }
52
50
  }
package/.travis.yml DELETED
@@ -1,80 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - 8
4
- env:
5
- global:
6
- - NODE_ENV=production
7
- - NPM_TAG=latest
8
- - RELEASE_TIMESTAMP="$(date +'%Y%m%d%H%M%S')"
9
- matrix:
10
- - NPM_SCRIPT="unit"
11
- cache:
12
- directories:
13
- - node_modules
14
- install:
15
- - npm --production=false install
16
- - npm --production=false update
17
- script: npm run $NPM_SCRIPT
18
- jobs:
19
- include:
20
- - env: NPM_SCRIPT=lint
21
- - env: NPM_SCRIPT=build
22
- if: not (type != pull_request AND (branch =~ /^(develop|master|hotfix\/)/))
23
- - stage: release
24
- env: NPM_SCRIPT=build
25
- before_deploy:
26
- - >
27
- if [ -z "$BEFORE_DEPLOY_RAN" ]; then
28
- VPKG=$($(npm bin)/json -f package.json version)
29
- export RELEASE_VERSION=${VPKG}-prerelease.${RELEASE_TIMESTAMP}
30
- npm --no-git-tag-version version $RELEASE_VERSION
31
- if [[ "$TRAVIS_BRANCH" == hotfix/* ]]; then # double brackets are important for matching the wildcard
32
- export NPM_TAG=hotfix
33
- fi
34
- git config --global user.email "$(git log --pretty=format:"%ae" -n1)"
35
- git config --global user.name "$(git log --pretty=format:"%an" -n1)"
36
- export BEFORE_DEPLOY_RAN=true
37
- fi
38
- deploy:
39
- - provider: script
40
- on:
41
- all_branches: true
42
- condition: $TRAVIS_BRANCH != develop && $TRAVIS_EVENT_TYPE != cron
43
- skip_cleanup: true
44
- script: npm run deploy -- -x -e $TRAVIS_BRANCH -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
45
- - provider: script
46
- on:
47
- branch: develop
48
- condition: $TRAVIS_EVENT_TYPE != cron
49
- skip_cleanup: true
50
- script: npm run --silent deploy -- -x -a -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
51
- - provider: npm
52
- on:
53
- branch:
54
- - master
55
- - develop
56
- - hotfix/*
57
- condition: $TRAVIS_EVENT_TYPE != cron
58
- skip_cleanup: true
59
- email: $NPM_EMAIL
60
- api_key: $NPM_TOKEN
61
- tag: $NPM_TAG
62
- - provider: script
63
- on:
64
- branch:
65
- - master
66
- - develop
67
- - hotfix/*
68
- condition: $TRAVIS_EVENT_TYPE != cron
69
- skip_cleanup: true
70
- script: if npm info | grep -q $RELEASE_VERSION; then git tag $RELEASE_VERSION && git push https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git $RELEASE_VERSION; fi
71
- - provider: script
72
- on:
73
- branch: develop
74
- condition: $TRAVIS_EVENT_TYPE == cron
75
- skip_cleanup: true
76
- script: npm run i18n:src && npm run i18n:push
77
- stages:
78
- - test
79
- - name: release
80
- if: type != pull_request AND (branch =~ /^(develop|master|hotfix\/)/)