react-lasso-select 2.0.1 → 2.0.3
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 +24 -10
- package/dist/index.js +3 -4
- package/package.json +24 -12
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
|
|
@@ -119,4 +116,21 @@ There are some extra features made to improve user experience.
|
|
|
119
116
|
|
|
120
117
|
Feel free to post any PR or issues. Be here for information on features, bug fixes, or documentation.
|
|
121
118
|
|
|
122
|
-
|
|
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/dist/index.js
CHANGED
|
@@ -67,10 +67,9 @@ class C {
|
|
|
67
67
|
return s;
|
|
68
68
|
}
|
|
69
69
|
getCTM() {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return t;
|
|
70
|
+
const e = this.getSvg().querySelector('rect[visibility="hidden"]').getCTM();
|
|
71
|
+
if (!e) throw new Error("CTM is null");
|
|
72
|
+
return e;
|
|
74
73
|
}
|
|
75
74
|
getViewboxSize() {
|
|
76
75
|
return this.getSvg().viewBox.baseVal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-lasso-select",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
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,28 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"type": "module",
|
|
38
|
+
"scripts": {
|
|
39
|
+
"preinstall": "npx only-allow pnpm",
|
|
40
|
+
"build": "tsc -b && vite build",
|
|
41
|
+
"build:ci": "pnpm run build -m build:ci",
|
|
42
|
+
"dev": "rimraf dist && vite",
|
|
43
|
+
"prod": "pnpm run build && vite",
|
|
44
|
+
"lint": "eslint .",
|
|
45
|
+
"format": "prettier -c .",
|
|
46
|
+
"test": "vitest",
|
|
47
|
+
"preview": "vite preview",
|
|
48
|
+
"prepare": "husky",
|
|
49
|
+
"prepublishOnly": "pnpm run build"
|
|
50
|
+
},
|
|
51
|
+
"packageManager": "pnpm@10.15.1+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67",
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": "^22.10.6",
|
|
54
|
+
"pnpm": "^10.15.1"
|
|
55
|
+
},
|
|
38
56
|
"peerDependencies": {
|
|
39
57
|
"prop-types": "^15.8.1",
|
|
40
|
-
"react": "
|
|
41
|
-
"react-dom": "
|
|
58
|
+
"react": ">=18.3.1",
|
|
59
|
+
"react-dom": ">=18.3.1"
|
|
42
60
|
},
|
|
43
61
|
"devDependencies": {
|
|
44
62
|
"@eslint/js": "^9.17.0",
|
|
@@ -54,11 +72,13 @@
|
|
|
54
72
|
"husky": "^9.1.7",
|
|
55
73
|
"lint-staged": "^15.3.0",
|
|
56
74
|
"prettier": "^3.4.2",
|
|
75
|
+
"rimraf": "^6.0.1",
|
|
57
76
|
"typescript": "~5.6.2",
|
|
58
77
|
"typescript-eslint": "^8.18.2",
|
|
59
78
|
"vite": "^6.0.5",
|
|
60
79
|
"vite-plugin-dts": "^4.5.0",
|
|
61
80
|
"vite-plugin-eslint2": "^5.0.3",
|
|
81
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
62
82
|
"vitest": "^2.1.8"
|
|
63
83
|
},
|
|
64
84
|
"husky": {
|
|
@@ -69,13 +89,5 @@
|
|
|
69
89
|
"lint-staged": {
|
|
70
90
|
"*.{ts,tsx}": "eslint --fix",
|
|
71
91
|
"*.{js,jsx,ts,tsx,md,html,css}": "prettier --write"
|
|
72
|
-
},
|
|
73
|
-
"scripts": {
|
|
74
|
-
"dev": "vite",
|
|
75
|
-
"build": "tsc -b && vite build",
|
|
76
|
-
"lint": "eslint .",
|
|
77
|
-
"format": "prettier -c .",
|
|
78
|
-
"test": "vitest",
|
|
79
|
-
"preview": "vite preview"
|
|
80
92
|
}
|
|
81
|
-
}
|
|
93
|
+
}
|