Skip to content
This repository was archived by the owner on Aug 1, 2022. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: embiem/react-canvas-draw
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: develop
Choose a base ref
...
head repository: win11react/react-canvas-draw
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 14 commits
  • 5 files changed
  • 2 contributors

Commits on Apr 5, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    de49103 View commit details

Commits on Apr 22, 2022

  1. dirty bump

    andrewstech authored Apr 22, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4f07de4 View commit details
  2. custom version

    andrewstech authored Apr 22, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b792774 View commit details
  3. Create .npmrc

    andrewstech authored Apr 22, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    018e39d View commit details
  4. Update package.json

    andrewstech authored Apr 22, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0d1c5b0 View commit details
  5. Update npm-publish.yml

    andrewstech authored Apr 22, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4723a83 View commit details
  6. Update package.json

    andrewstech authored Apr 22, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    19e712c View commit details
  7. Update package.json

    andrewstech authored Apr 22, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6957613 View commit details

Commits on May 18, 2022

  1. Delete .npmrc

    andrewstech authored May 18, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4b79f52 View commit details
  2. Create npms-publish.yml

    andrewstech authored May 18, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eb87769 View commit details
  3. Update npms-publish.yml

    andrewstech authored May 18, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    772b39a View commit details
  4. Update npms-publish.yml

    andrewstech authored May 18, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7eb511d View commit details
  5. Update README.md

    andrewstech authored May 18, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bae6e9f View commit details
  6. Update package.json

    andrewstech authored May 18, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    116aad3 View commit details
Showing with 47 additions and 47 deletions.
  1. +17 −37 .github/workflows/npm-publish.yml
  2. +23 −0 .github/workflows/npms-publish.yml
  3. +2 −2 README.md
  4. +4 −7 package.json
  5. +1 −1 src/index.js
54 changes: 17 additions & 37 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

name: Publish package to GitHub Packages
on:
push:
# Sequence of patterns matched against refs/heads
branches:
# Push events on main branch
- master

release:
types: [created]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Install and Build 🔧
run: |
npm install
npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
- uses: actions/checkout@v3
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v3
with:
branch: gh-pages # The branch the action should deploy to.
folder: demo/dist # The folder the action should deploy.

publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@win11react'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.BOT }}
23 changes: 23 additions & 0 deletions .github/workflows/npms-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]
workflow_dispatch:

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -17,13 +17,13 @@
Install via NPM:

```
npm install react-canvas-draw --save
npm install @win11react/react-canvas-draw --save
```

or YARN:

```
yarn add react-canvas-draw
yarn add @win11react/react-canvas-draw
```

## Usage
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-canvas-draw",
"version": "1.2.1",
"name": "@win11react/react-canvas-draw",
"version": "1.2.2",
"description": "A simple yet powerful canvas-drawing component for React.",
"main": "lib/index.js",
"module": "es/index.js",
@@ -29,7 +29,7 @@
"resize-observer-polyfill": "^1.5.0"
},
"peerDependencies": {
"react": "16.x || 17.x"
"react": "16.x || 17.x || 18.x"
},
"devDependencies": {
"all-contributors-cli": "^6.15.0",
@@ -57,10 +57,7 @@
},
"homepage": "https://embiem.github.io/react-canvas-draw/",
"license": "MIT",
"repository": "https://github.com/embiem/react-canvas-draw",
"bugs": {
"url": "https://github.com/embiem/react-canvas-draw/issues"
},
"repository":"https://github.com/win11react/react-canvas-draw",
"keywords": [
"react-component",
"react",
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -615,7 +615,7 @@ export default class CanvasDraw extends PureComponent {
};

loop = ({ once = false } = {}) => {
if (this.mouseHasMoved || this.valuesChanged) {
if (this.lazy && (this.mouseHasMoved || this.valuesChanged)) {
const pointer = this.lazy.getPointerCoordinates();
const brush = this.lazy.getBrushCoordinates();