react-image-upload
Advanced tools
Comparing version 2.0.1 to 3.0.0
{ | ||
"name": "react-image-upload", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "react library for uploading images", | ||
@@ -8,8 +8,5 @@ "author": "chimdie", | ||
"repository": "chimdie/react-image-upload", | ||
"main": "dist/index.js", | ||
"module": "dist/index.es.js", | ||
"source": "src/index.js", | ||
"engines": { | ||
"node": ">=10" | ||
}, | ||
"source": "src/index.tsx", | ||
"private": false, | ||
"type": "module", | ||
"keywords": [ | ||
@@ -21,54 +18,28 @@ "react", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"start": "rollup -c -w", | ||
"build": "tsc && vite build", | ||
"dev": "vite", | ||
"test": "echo \"No test specified\"", | ||
"test:lint": "eslint .", | ||
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom", | ||
"test:watch": "react-scripts test --env=jsdom", | ||
"lint": "npm run format && npm run lint:fix", | ||
"lint:fix": "eslint ./src --ext .jsx,.js,.ts,.tsx --quiet --fix --ignore-path ./.gitignore", | ||
"format": "prettier --loglevel warn --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\" ", | ||
"predeploy": "cd example && npm install && npm run build", | ||
"deploy": "gh-pages -d example/build" | ||
"deploy": "gh-pages -d example/build", | ||
"prepack": "json -f package.json -I -e \"delete this.devDependencies; delete this.dependencies\"" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.0.0" | ||
"react": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.16.0", | ||
"@babel/preset-react": "^7.16.0", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^21.0.1", | ||
"@rollup/plugin-node-resolve": "^13.0.6", | ||
"babel-eslint": "^10.0.3", | ||
"babel-plugin-styled-components": "^1.13.3", | ||
"core-js": "^3.19.1", | ||
"cross-env": "^7.0.2", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.7.0", | ||
"eslint-config-standard": "^14.1.0", | ||
"eslint-config-standard-react": "^9.2.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-react": "^7.17.0", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"gh-pages": "^2.2.0", | ||
"microbundle-crl": "^0.13.10", | ||
"npm-run-all": "^4.1.5", | ||
"postcss": "^8.3.11", | ||
"prettier": "^2.0.4", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"react-scripts": "^3.4.1", | ||
"rollup": "^2.59.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"rollup-plugin-postcss": "^4.0.1", | ||
"rollup-plugin-styles": "^3.14.1", | ||
"rollup-plugin-terser": "^7.0.2" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"dependencies": { | ||
"@rollup/plugin-image": "^2.1.1" | ||
"main": "./dist/index.umd.js", | ||
"module": "./dist/index.es.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.es.js", | ||
"require": "./dist/index.umd.js" | ||
}, | ||
"./dist/style.css": "./dist/style.css" | ||
} | ||
} |
@@ -23,5 +23,7 @@ # react-image-upload | ||
} | ||
function runAfterImageDelete(file) { | ||
console.log({ file }) | ||
} | ||
return ( | ||
@@ -43,19 +45,4 @@ <ImageUploader | ||
style={{ height: 200, width: 200, background: 'rgb(0 182 255)' }} | ||
deleteIcon={ | ||
<img | ||
src='https://img.icons8.com/ios-glyphs/30/000000/delete-sign.png' | ||
alt='' | ||
/> | ||
} | ||
uploadIcon={ | ||
<svg | ||
className='svg-circleplus' | ||
viewBox='0 0 100 100' | ||
style={{ height: '40px', stroke: '#000' }} | ||
> | ||
<circle cx='50' cy='50' r='45' fill='none' strokeWidth='7.5'></circle> | ||
<line x1='32.5' y1='50' x2='67.5' y2='50' strokeWidth='5'></line> | ||
<line x1='50' y1='32.5' x2='50' y2='67.5' strokeWidth='5'></line> | ||
</svg> | ||
} | ||
deleteIcon={<RiDeleteRow />} | ||
uploadIcon={<BsCamera />} | ||
/> | ||
@@ -66,9 +53,9 @@ ``` | ||
| Property | Type | Default | Description | | ||
| :------------ | :--: | -------- | --------------------------------------------------------------- | | ||
| style | obj | optional | style the file with css | | ||
| deleteIcon | func | optional | adds your delete icon or html element | | ||
| uploadIcon | func | optional | adds your upload icon or html element | | ||
| onFileAdded | func | optional | runs after file has been selected and returns the selected file | | ||
| onFileRemoved | func | optional | runs after file has been removed and returns the removed file | | ||
| Property | Type | Default | Description | | ||
| :------------ | :--: | -------- | ------------------------------------------------------------------------------- | | ||
| style | obj | optional | Write your custom css | | ||
| deleteIcon | ele | optional | The icon used to delete file | | ||
| uploadIcon | ele | optional | The icon used to upload file | | ||
| onFileAdded | func | optional | A function that runs after file has been uploaded and returns the uploaded file | | ||
| onFileRemoved | func | optional | A function that runs after file has been removed and returns the removed file | | ||
@@ -75,0 +62,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
46154
1
0
836
Yes
62
7
1
+ Addedreact@18.3.1(transitive)
- Removed@rollup/plugin-image@^2.1.1
- Removed@rollup/plugin-image@2.1.1(transitive)
- Removed@rollup/pluginutils@3.1.0(transitive)
- Removed@types/estree@0.0.39(transitive)
- Removedestree-walker@1.0.1(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedmini-svg-data-uri@1.4.4(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@16.14.0(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedrollup@2.79.2(transitive)