Skip to content

Commit

Permalink
Merge pull request #3 from DaAnda97/feat/scroll-on-touch-sync
Browse files Browse the repository at this point in the history
feat(scroll-on-touch): syncs head
  • Loading branch information
DaAnda97 authored Jan 30, 2023
2 parents 74ddf26 + 17f70e1 commit 2ef217a
Show file tree
Hide file tree
Showing 91 changed files with 8,649 additions and 23,432 deletions.
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["documentation", "tests"]
}
14 changes: 14 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"documentation": "1.0.0",
"eslint-config-custom": "0.0.0",
"react-sketch-canvas": "6.2.0",
"tests": "1.0.0",
"tsconfig": "0.0.0"
},
"changesets": [
"serious-bobcats-burn"
]
}
6 changes: 6 additions & 0 deletions .changeset/serious-bobcats-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"react-sketch-canvas": major
---

- Add option to use Windows surface pen button as eraser
- Memoize functions to reduce re-rendering
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
root: true,
// This tells ESLint to load the config from the package `eslint-config-custom`
extends: ["custom"],
settings: {
next: {
rootDir: ["apps/*/"],
},
},
ignorePatterns: ["*.config.js"],
};
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ coverage/
jest-coverage/
cypress-coverage/
reports/
packages/tests/cypress/screenshots/
packages/tests/cypress/videos/
packages/tests/.nyc_output/
packages/tests/coverage/
packages/tests/cypress/downloads/
.idea/
6 changes: 6 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["development"],
"hints": {
"no-inline-styles": "off"
}
}
5 changes: 5 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"report-dir": "packages/tests/coverage",
"temp-dir": "packages/tests/.nyc_output",
"reporter": ["lcov", "text"]
}
20 changes: 0 additions & 20 deletions .release-it.json

This file was deleted.

28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<p align="center">
<p style="text-align: center;">
<img src="https://i.imgur.com/ajs39FC.png" height="150" alt="React Sketch Canvas" />
</p>
<br/>
<h3 align="center">
<h3 style="text-align: center;">
Freehand vector drawing component for React using SVG as canvas 🖌
</h3>
<br/>
<br/>
<div align="center">
<div style="text-align: center;">

![npm](https://img.shields.io/npm/v/react-sketch-canvas?style=flat-square) &nbsp;&nbsp; ![NPM](https://img.shields.io/npm/l/react-sketch-canvas?style=flat-square) &nbsp;&nbsp; ![npm](https://img.shields.io/npm/dm/react-sketch-canvas?style=flat-square) <br/>
![npm bundle size](https://img.shields.io/bundlephobia/min/react-sketch-canvas?style=flat-square) &nbsp;&nbsp; ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-sketch-canvas?style=flat-square) <br/>
[![codecov](https://codecov.io/gh/vinothpandian/react-sketch-canvas/branch/master/graph/badge.svg?token=NJcqGRgbSa)](https://codecov.io/gh/vinothpandian/react-sketch-canvas)
<br/>
This project was generated using [DTS](https://github.com/weiran-zsd/dts-cli).
This project was built using [Turborepo](https://turbo.build/).

</div>

Expand All @@ -26,7 +26,7 @@ This project was generated using [DTS](https://github.com/weiran-zsd/dts-cli).

### Requirements

- **<span style="color:red">**Requires React >= 16.4**</span>**
- **<span style="color:red">**Requires React >= 16.8**</span>**

### Wanna test React Sketch Canvas before using it?

Expand All @@ -51,12 +51,12 @@ yarn add react-sketch-canvas
Common usage example

```javascript
import * as React from 'react';
import { ReactSketchCanvas } from 'react-sketch-canvas';
import * as React from "react";
import { ReactSketchCanvas } from "react-sketch-canvas";

const styles = {
border: '0.0625rem solid #9c9c9c',
borderRadius: '0.25rem',
border: "0.0625rem solid #9c9c9c",
borderRadius: "0.25rem",
};

const Canvas = () => {
Expand All @@ -80,7 +80,7 @@ import { ReactSketchCanvas } from "react-sketch-canvas";

const styles = {
border: "0.0625rem solid #9c9c9c",
borderRadius: "0.25rem"
borderRadius: "0.25rem",
};

const Canvas = class extends React.Component {
Expand All @@ -100,12 +100,12 @@ const Canvas = class extends React.Component {
/>
<button
onClick={() => {
this.canvas.current.
this.canvas.current
.exportImage("png")
.then(data => {
.then((data) => {
console.log(data);
})
.catch(e => {
.catch((e) => {
console.log(e);
});
}}
Expand Down Expand Up @@ -169,7 +169,7 @@ _Use ref to access the element and call the following functions to export image_
## Types

```ts
type ExportImageType = 'jpeg' | 'png';
type ExportImageType = "jpeg" | "png";

interface Point {
x: number;
Expand Down
24 changes: 24 additions & 0 deletions apps/documentation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
19 changes: 19 additions & 0 deletions apps/documentation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--suppress HtmlUnknownTarget -->

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link href="/vite.svg" rel="icon" type="image/svg+xml" />
<link crossorigin="anonymous"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
rel="stylesheet">
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<title>ReactSketchCanvas</title>
</head>
<body>
<div id="root"></div>
<script src="/src/main.tsx" type="module"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions apps/documentation/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "documentation",
"private": true,
"version": "1.0.0",
"homepage": "http://vinoth.info/react-sketch-canvas",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"ci:build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-sketch-canvas": "workspace:*"
},
"devDependencies": {
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@vitejs/plugin-react-swc": "^3.0.0",
"typescript": "^4.9.3",
"vite": "^4.0.0",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*"
}
}
19 changes: 19 additions & 0 deletions apps/documentation/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2ef217a

Please sign in to comment.