Skip to content

Releases: sekoyo/react-image-crop

6.0.1

24 Oct 07:57
Compare
Choose a tag to compare

No functional changes, this is to fix some issues with importing the library.

  • Remove jsnext:main as most compilers do not transpile node_modules and this was causing exceptions trying to read es6/7 code.
  • Declare prop-types as an external peer dependency.

6.0.0

26 Sep 22:25
Compare
Choose a tag to compare
  • Typescript package is installed alongside for you convenience
  • Module is exported using ES6 exports to resolve eslint issues #178, TypeScript issue with needing to enable allowSyntheticDefaultImports, and to enable you to import non-default imports with braces {}. You should import the default export and any non-defaults in braces like this:
import ReactCrop, { getPixelCrop } from 'react-image-crop'

You shouldn't import the module like this unless you want all the exports in an object:

import * as ReactCrop from 'react-image-crop'

If you use this module globally via a <script> tag, you should now use ReactCrop.Component instead of just ReactCrop.

5.0.0

10 Sep 20:05
Compare
Choose a tag to compare
  • makeAspectCrop is no longer necessary, simply pass your incomplete crop (missing width or height) and onChange will be called with the completed crop for you to set to state. 🎉
  • Fix exception caused by 4.0.4 change when not initially passing a crop #193
  • Fix long-standing issue of crop continuing to move upwards once it's already hit the image boundary and dragging continues when in fixed aspect mode dragging NE or NW handle.

Breaking changes:

  • Exported function containCrop now takes previousCrop as the first parameter. containCrop(previousCrop, crop, imageAspect).

4.0.4

08 Sep 11:07
Compare
Choose a tag to compare
  • Add pixelCrop to onImageLoaded #192.
  • Add className prop #171.

4.0.3

06 Aug 17:39
Compare
Choose a tag to compare
  • Fix to global/window export. Regression fix from 4.0.2 regarding how the module was exported specifically if you were consuming this module as a global (e.g. from a CDN).

4.0.2

29 Jul 11:38
Compare
Choose a tag to compare
  • Add image onError handler onImageError (#185)
  • Add valid aspect check in makeAspectCrop (#186)
  • Fix autoprefixer warning (#176)

4.0.1

23 May 07:56
Compare
Choose a tag to compare
  • Use css stretch property rather than deprecated fill-available for image max-height

4.0.0

22 May 19:08
Compare
Choose a tag to compare
  • Fixed clicking/touching an unfocused cropping image causing a scroll jump in certain situations #173
  • $mobile-media-query is now (max-width: 768px), (pointer: coarse) by default which catches modern touch devices above 768px.
  • The cropped image has a max-height: fill-available so that the image is contained by it's container's height as well as width (in modern browsers) #174

Note: This release is only a breaking change if you've overridden the $mobile-media-query scss variable, due to it now being the whole query instead of just a single value without brackets (max-width: 768px).

3.0.11

27 Mar 08:26
Compare
Choose a tag to compare
  • Fixed pixelCrop sometimes exceeding the bounds of the image due to number rounding. getPixelCrop(image, percentCrop) is also now exposed for some edge use cases. #167

3.0.10

25 Jan 20:23
Compare
Choose a tag to compare

Fixes

  • Set { passive: false } to prevent some modern mobile browsers from defaulting it to true and breaking the use of event.preventDefault #157