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

react-avatar-edit

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-avatar-edit - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

2

package.json
{
"name": "react-avatar-edit",
"version": "0.5.5",
"version": "0.5.6",
"description": "ReactJS component to upload, crop, and preview avatars",

@@ -5,0 +5,0 @@ "main": "src/avatar.jsx",

@@ -24,2 +24,3 @@ import React from 'react'

mimeTypes: 'image/jpeg,image/png',
mobileScaleSpeed: 0.5, // experimental
onClose: () => {},

@@ -118,2 +119,6 @@ onCrop: () => {},

get mobileScaleSpeed() {
return this.props.mobileScaleSpeed
}
get cropRadius() {

@@ -240,2 +245,9 @@ return this.state.cropRadius

const onScaleCallback = (scaleY) => {
const scale = scaleY > 0 || isNotOutOfScale(scaleY) ? scaleY : 0
cropStroke.radius(cropStroke.radius() - calcScaleRadius(scale))
crop.radius(crop.radius() - calcScaleRadius(scale))
resize.fire('resize')
}
this.onCropCallback(getPreview())

@@ -262,8 +274,14 @@

resize.on("touchstart", (evt) => {
resize.on("dragmove", (dragEvt) => {
if (dragEvt.evt.type !== 'touchmove') return
const scaleY = (dragEvt.evt.changedTouches['0'].pageY - evt.evt.changedTouches['0'].pageY) || 0
onScaleCallback(scaleY * this.mobileScaleSpeed)
})
})
resize.on("dragmove", (evt) => {
const scaleY = evt.evt.movementY
const scale = scaleY > 0 || isNotOutOfScale(scaleY) ? scaleY : 0
cropStroke.radius(cropStroke.radius() - calcScaleRadius(scale))
crop.radius(crop.radius() - calcScaleRadius(scale))
resize.fire('resize')
if (evt.evt.type === 'touchmove') return
const scaleY = evt.evt.movementY || 0
onScaleCallback(scaleY)
})

@@ -270,0 +288,0 @@ resize.on("dragend", () => this.onCropCallback(getPreview()))

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