Skip to content

Releases: github/image-crop-element

v3.0.3

07 Aug 17:01
1f25dec
Compare
Choose a tag to compare
  • Merge pull request #23 from github/publish-to-gpr-as-well 0267bac
  • publish to GPR as a postpublish step b9191e0

v3.0.2...v3.0.3

3.0.3

07 Aug 17:01
0267bac
Compare
Choose a tag to compare

<image-crop-element>

This loads an image and creates a crop area that user can modify. An event is fired with x, y, width, and height as the crop area changes.

Installation

$ npm install --save @github/image-crop-element

Usage

Plain

<image-crop src="/avatar.jpg"></image-crop>

With loading state

<image-crop src="/avatar.jpg">
  <img src="spinner.gif" alt="" data-loading-slot>
</image-crop>

With autoupdate inputs

<image-crop src="/avatar.jpg">
  <input type="hidden" data-image-crop-input="x" name="x">
  <input type="hidden" data-image-crop-input="y" name="y">
  <input type="hidden" data-image-crop-input="width" name="width">
  <input type="hidden" data-image-crop-input="height" name="height">
</image-crop>

Listen to the change event

document.addEventListener('image-crop-change', function (event){
  console.log(
    'Crop area changed.',
    event.detail.x,
    event.detail.y,
    event.detail.width,
    event.detail.height
  )
})

Browser support

Browsers without native custom element support require a polyfill. Legacy browsers require various other polyfills. See examples/index.html for details.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

v3.0.2

01 Aug 09:21
a35fe5b
Compare
Choose a tag to compare
  • Merge pull request #22 from github/dependabot/npm_and_yarn/lodash-4.17.15 4435ccc
  • Bump lodash from 4.17.11 to 4.17.15 c80aa01
  • Merge pull request #21 from notlmn/fix-examples 8809470
  • Add in suggestions, drop polyfill.html e87d30d
  • Fix links in example files ada1549

v3.0.1...v3.0.2

v3.0.1

02 Jul 09:26
06128e7
Compare
Choose a tag to compare
  • Merge pull request #19 from github/update-deps 2f072ef
  • update eslint, eslint-plugin-github and flow-bin manually to latest versiosn 7f5361c
  • run npm update dadbefe

v3.0.0...v3.0.1