Skip to content

Commit

Permalink
Export using ES6 to solve a number of issues e.g. #178
Browse files Browse the repository at this point in the history
  • Loading branch information
sekoyo committed Sep 26, 2018
1 parent f94a372 commit 4c494b2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 30 deletions.
15 changes: 11 additions & 4 deletions dist/ReactCrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ module.exports = ReactPropTypesSecret;
"use strict";


Object.defineProperty(exports, "__esModule", {
value: true
});
exports.containCrop = exports.makeAspectCrop = exports.getPixelCrop = exports.Component = exports.default = exports.ReactCrop = undefined;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

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; }; /* globals document, window */
Expand Down Expand Up @@ -1143,10 +1148,12 @@ ReactCrop.defaultProps = {
imageStyle: undefined
};

module.exports = ReactCrop;
module.exports.getPixelCrop = getPixelCrop;
module.exports.makeAspectCrop = makeAspectCrop;
module.exports.containCrop = containCrop;
exports.ReactCrop = ReactCrop;
exports.default = ReactCrop;
exports.Component = ReactCrop;
exports.getPixelCrop = getPixelCrop;
exports.makeAspectCrop = makeAspectCrop;
exports.containCrop = containCrop;

/***/ }),
/* 3 */
Expand Down
2 changes: 1 addition & 1 deletion dist/ReactCrop.min.js

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions lib/ReactCrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ class ReactCrop extends PureComponent {
onTouchStart={this.onCropMouseTouchDown}
role="presentation"
>
{!disabled &&
{!disabled && (
<div className="ReactCrop__drag-elements">
<div className="ReactCrop__drag-bar ord-n" data-ord="n" />
<div className="ReactCrop__drag-bar ord-e" data-ord="e" />
Expand All @@ -621,7 +621,7 @@ class ReactCrop extends PureComponent {
<div className="ReactCrop__drag-handle ord-sw" data-ord="sw" />
<div className="ReactCrop__drag-handle ord-w" data-ord="w" />
</div>
}
)}
</div>
);
}
Expand Down Expand Up @@ -802,7 +802,11 @@ ReactCrop.defaultProps = {
imageStyle: undefined,
};

module.exports = ReactCrop;
module.exports.getPixelCrop = getPixelCrop;
module.exports.makeAspectCrop = makeAspectCrop;
module.exports.containCrop = containCrop;
export {
ReactCrop,
ReactCrop as default,
ReactCrop as Component,
getPixelCrop,
makeAspectCrop,
containCrop,
};
40 changes: 23 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-image-crop",
"version": "5.0.0",
"version": "6.0.0",
"description": "A responsive image cropping tool for React",
"repository": "https://github.com/DominicTobias/react-image-crop",
"main": "index.js",
Expand Down Expand Up @@ -34,7 +34,7 @@
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"cross-env": "^5.2.0",
"eslint": "^5.5.0",
"eslint": "^5.6.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
Expand Down

0 comments on commit 4c494b2

Please sign in to comment.