Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-cropper

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cropper - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

19

dist/react-cropper.js
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var React = require('react');

@@ -72,2 +74,11 @@ var $ = require('jquery');

componentWillUnmount: function componentWillUnmount() {
if (this.$img) {
// Destroy the cropper, this makes sure events such as resize are cleaned up and do not leak
this.$img.cropper('destroy');
// While we're at it remove our reference to the jQuery instance
delete this.$img;
}
},
move: function move(offsetX, offsetY) {

@@ -105,6 +116,2 @@ return this.$img.cropper('move', offsetX, offsetY);

destroy: function destroy() {
return this.$img.cropper('destroy');
},
getData: function getData() {

@@ -157,3 +164,3 @@ return this.$img.cropper('getData');

'div',
this.props,
_extends({}, this.props, { src: null }),
React.createElement('img', {

@@ -170,2 +177,2 @@ crossOrigin: 'anonymous',

module.exports = Cropper;
module.exports = Cropper;
{
"name": "react-cropper",
"version": "0.1.6",
"version": "0.1.7",
"description": "",

@@ -12,3 +12,3 @@ "main": "dist/react-cropper.js",

"prebuild": "npm run lint",
"example": "webpack example/index.jsx --config example/webpack.config.js"
"example": "webpack example/index.jsx --config example/webpack.config.js --output-path example/assets"
},

@@ -33,7 +33,7 @@ "author": "Fong Kuanghuei <waneblade@gmail.com>",

"cropper": "^0.9.3",
"jquery": "^2.1.4"
"jquery": "^1.11.3 || ^2.1.4"
},
"peerDependencies": {
"react": ">= 0.12.0, < 0.14.0",
"jquery": "^2.1.4"
"react": ">= 0.12.0 || =0.14.0-alpha3",
"jquery": "^1.11.3 || ^2.1.4"
},

@@ -44,3 +44,3 @@ "devDependencies": {

"css-loader": "^0.12.0",
"eslint": "^0.20.0",
"eslint": "^0.23.0",
"eslint-plugin-react": "^2.2.0",

@@ -53,4 +53,3 @@ "extract-text-webpack-plugin": "^0.7.1",

"load-grunt-tasks": "^3.1.0",
"react": ">= 0.12.0, < 0.14.0",
"react-tools": "^0.13.2",
"react": ">= 0.12.0",
"style-loader": "^0.12.1",

@@ -57,0 +56,0 @@ "webpack": "^1.8.11"

# [react-cropper](http://roadmanfong.github.io/react-cropper/)
Cropper as React components
[![NPM](https://nodei.co/npm/react-cropper.png?downloads=true)](https://www.npmjs.com/package/react-cropper)
[Cropper](https://github.com/fengyuanchen/cropper) as React components
[Demo](http://roadmanfong.github.io/react-cropper/example/)

@@ -14,13 +17,32 @@

```
```shell
npm install --save react-cropper
```
### Webpack User
You also need a couple of loaders for webpack
```
```shell
npm install style-loader css-loader
```
### Browserify User
https://github.com/cheton/browserify-css
```shell
npm i --save-dev browserify-css
```
Compile your project with command line like
```shell
browserify -t reactify -g browserify-css index.jsx > bundle.js
```
## Todo
* Unit test
* Put demo in [http://roadmanfong.github.io/react-cropper/](http://roadmanfong.github.io/react-cropper/)
## Quick Example

@@ -27,0 +49,0 @@ ```js

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc