react-lasso-select 2.0.0 → 2.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.
- package/README.md +28 -12
- package/package.json +13 -4
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ A responsive react tool for marking irregular areas in images (lasso / free sele
|
|
|
9
9
|
|
|
10
10
|
## Demos
|
|
11
11
|
|
|
12
|
-
See `src/App.tsx`
|
|
12
|
+
See `src/App.tsx` (https://akcyp.github.io/react-lasso-select/)
|
|
13
13
|
|
|
14
14
|
## Features
|
|
15
15
|
|
|
@@ -20,16 +20,13 @@ See `src/App.tsx`
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
With yarn:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
yarn add react-lasso-select
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
With npm:
|
|
30
|
-
|
|
31
23
|
```bash
|
|
24
|
+
# with npm
|
|
32
25
|
npm i react-lasso-select
|
|
26
|
+
# with yarn
|
|
27
|
+
yarn add react-lasso-select
|
|
28
|
+
# with pnpm
|
|
29
|
+
pnpm add react-lasso-select
|
|
33
30
|
```
|
|
34
31
|
|
|
35
32
|
## Usage
|
|
@@ -37,14 +34,16 @@ npm i react-lasso-select
|
|
|
37
34
|
Import the main js module:
|
|
38
35
|
|
|
39
36
|
```js
|
|
40
|
-
import ReactLassoSelect from 'react-lasso-select';
|
|
37
|
+
import { ReactLassoSelect } from 'react-lasso-select';
|
|
41
38
|
```
|
|
42
39
|
|
|
43
40
|
## Example
|
|
44
41
|
|
|
42
|
+
See: [https://github.com/akcyp/react-lasso-select/blob/main/src/App.tsx](https://github.com/akcyp/react-lasso-select/blob/main/src/App.tsx)
|
|
43
|
+
|
|
45
44
|
```jsx
|
|
46
45
|
import { useState } from 'react';
|
|
47
|
-
import ReactLassoSelect,
|
|
46
|
+
import { ReactLassoSelect, getCanvas } from 'react-lasso-select';
|
|
48
47
|
|
|
49
48
|
export default function App() {
|
|
50
49
|
const src = './demo.jpg';
|
|
@@ -117,4 +116,21 @@ There are some extra features made to improve user experience.
|
|
|
117
116
|
|
|
118
117
|
Feel free to post any PR or issues. Be here for information on features, bug fixes, or documentation.
|
|
119
118
|
|
|
120
|
-
|
|
119
|
+
You can help contributing this repository. You may need:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
"engines": {
|
|
123
|
+
"node": "^22.10.6",
|
|
124
|
+
"pnpm": "^10.15.1"
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
To work locally run following commands:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
corepack enable && corepack up # install and use pnpm 10.15.1
|
|
132
|
+
pnpm install
|
|
133
|
+
pnpm run dev
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Before opening a PR, please check if `pnpm run prod` works correctly. Also make sure that `pnpm run test` pass.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-lasso-select",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "A responsive react tool for marking irregular areas in images (lasso / free select)",
|
|
5
5
|
"author": "akcyp",
|
|
6
6
|
"license": "ISC",
|
|
@@ -35,10 +35,14 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"type": "module",
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": "^22.10.6",
|
|
40
|
+
"pnpm": "^10.15.1"
|
|
41
|
+
},
|
|
38
42
|
"peerDependencies": {
|
|
39
43
|
"prop-types": "^15.8.1",
|
|
40
|
-
"react": "
|
|
41
|
-
"react-dom": "
|
|
44
|
+
"react": ">=18.3.1",
|
|
45
|
+
"react-dom": ">=18.3.1"
|
|
42
46
|
},
|
|
43
47
|
"devDependencies": {
|
|
44
48
|
"@eslint/js": "^9.17.0",
|
|
@@ -54,11 +58,13 @@
|
|
|
54
58
|
"husky": "^9.1.7",
|
|
55
59
|
"lint-staged": "^15.3.0",
|
|
56
60
|
"prettier": "^3.4.2",
|
|
61
|
+
"rimraf": "^6.0.1",
|
|
57
62
|
"typescript": "~5.6.2",
|
|
58
63
|
"typescript-eslint": "^8.18.2",
|
|
59
64
|
"vite": "^6.0.5",
|
|
60
65
|
"vite-plugin-dts": "^4.5.0",
|
|
61
66
|
"vite-plugin-eslint2": "^5.0.3",
|
|
67
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
62
68
|
"vitest": "^2.1.8"
|
|
63
69
|
},
|
|
64
70
|
"husky": {
|
|
@@ -71,8 +77,11 @@
|
|
|
71
77
|
"*.{js,jsx,ts,tsx,md,html,css}": "prettier --write"
|
|
72
78
|
},
|
|
73
79
|
"scripts": {
|
|
74
|
-
"
|
|
80
|
+
"preinstall": "npx only-allow pnpm",
|
|
75
81
|
"build": "tsc -b && vite build",
|
|
82
|
+
"build:ci": "pnpm run build -m build:ci",
|
|
83
|
+
"dev": "rimraf dist && vite",
|
|
84
|
+
"prod": "pnpm run build && vite",
|
|
76
85
|
"lint": "eslint .",
|
|
77
86
|
"format": "prettier -c .",
|
|
78
87
|
"test": "vitest",
|