react-region-select
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -62,6 +62,7 @@ 'use strict'; | ||
}; | ||
return _react2.default.createElement( | ||
'div', | ||
{ | ||
style: (0, _objectAssign2.default)({}, _style2.default.Region, localStyle), | ||
style: (0, _objectAssign2.default)({}, _style2.default.Region, localStyle, this.props.customStyle, this.props.data.regionStyle), | ||
onMouseDown: this.props.onCropStart, | ||
@@ -90,5 +91,6 @@ onTouchStart: this.props.onCropStart, | ||
dataRenderer: _propTypes.PropTypes.func, | ||
data: _propTypes.PropTypes.object | ||
data: _propTypes.PropTypes.object, | ||
customStyle: _propTypes.PropTypes.object | ||
}; | ||
module.exports = Region; |
@@ -116,2 +116,16 @@ 'use strict'; | ||
height = Math.abs(y1Pc - y2Pc); | ||
if (this.props.constraint) { | ||
if (x2Pc >= 100) { | ||
x = x1Pc;width = 100 - x1Pc; | ||
} | ||
if (y2Pc >= 100) { | ||
y = y1Pc;height = 100 - y1Pc; | ||
} | ||
if (x2Pc <= 0) { | ||
x = 0;width = x1Pc; | ||
} | ||
if (y2Pc <= 0) { | ||
y = 0;height = y1Pc; | ||
} | ||
} | ||
} else { | ||
@@ -292,2 +306,3 @@ x = (clientPos.x + regionChangeData.clientPosXOffset - regionChangeData.imageOffsetLeft) / regionChangeData.imageWidth * 100; | ||
index: index, | ||
customStyle: this.props.regionStyle, | ||
dataRenderer: this.props.regionRenderer, | ||
@@ -368,3 +383,4 @@ onCropStart: function onCropStart(event) { | ||
className: _propTypes.PropTypes.string, | ||
style: _propTypes.PropTypes.object | ||
style: _propTypes.PropTypes.object, | ||
regionStyle: _propTypes.PropTypes.object | ||
}; | ||
@@ -371,0 +387,0 @@ RegionSelect.defaultProps = { |
{ | ||
"name": "react-region-select", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Multi region selection (i.e. on images)", | ||
@@ -40,14 +40,13 @@ "main": "./lib/RegionSelect.js", | ||
"eslint-plugin-react": "^5.2.2", | ||
"extract-text-webpack-plugin": "^1.0.1", | ||
"extract-text-webpack-plugin": "^2.1.2", | ||
"node-sass": "^3.8.0", | ||
"react-hot-loader": "^1.3.0", | ||
"sass-loader": "^4.0.0", | ||
"react": "^16.3.2", | ||
"react-dom": "^16.3.2", | ||
"react-hot-loader": "^3.1.3", | ||
"style-loader": "^0.13.0", | ||
"webpack": "^1.13.1", | ||
"webpack-dev-server": "^1.12.1", | ||
"react": "^15.x", | ||
"react-dom": "^15.x" | ||
"webpack": "^2.7.0", | ||
"webpack-dev-server": "^2.11.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^0.14.6 || 15.x" | ||
"react": "^0.14.6 || 15.x || 16.x" | ||
}, | ||
@@ -54,0 +53,0 @@ "dependencies": { |
@@ -19,3 +19,4 @@ var path = require('path'); | ||
new webpack.HotModuleReplacementPlugin(), | ||
new ExtractTextPlugin('app.css', { | ||
new ExtractTextPlugin({ | ||
filename: 'app.css', | ||
allChunks: true | ||
@@ -27,8 +28,8 @@ }) | ||
test: /\.js$/, | ||
loaders: ['react-hot', 'babel'], | ||
loaders: ['react-hot-loader/webpack', 'babel-loader'], | ||
include: path.join(__dirname, 'src') | ||
}, | ||
{ | ||
test: /\.scss/, | ||
loaders: ['style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass'] | ||
test: /\.css/, | ||
loaders: ['style-loader', 'css-loader'] | ||
} | ||
@@ -35,0 +36,0 @@ ] |
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
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
715824
18
21
577
2