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

react-eyedrop

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-eyedrop - npm Package Compare versions

Comparing version 5.3.1 to 5.3.2

11

dist/eyeDropper.js

@@ -75,4 +75,6 @@ "use strict";

const { target } = e;
if (!target)
return;
const targetCanvas = yield (0, targetToCanvas_1.targetToCanvas)(target);
const rgbColor = (0, getColor_1.getColor)(pickRadius, targetCanvas, e);
const rgbColor = (0, getColor_1.getColor)(targetCanvas, e, pickRadius);
updateColors(rgbColor);

@@ -105,2 +107,9 @@ once && deactivateColorPicking();

}, [pickingColorFromDocument, exitPickByEscKey]);
useEffect(() => {
return () => {
if (document.body) {
document.body.style.cursor = cursorInactive;
}
};
}, []);
const shouldColorsPassThrough = colorsPassThrough ? { [colorsPassThrough]: colors } : {};

@@ -107,0 +116,0 @@ return (React.createElement("div", { style: styles.eyedropperWrapper, className: wrapperClasses }, CustomComponent ? (React.createElement(CustomComponent, Object.assign({ onClick: pickColor }, shouldColorsPassThrough, { customProps: customProps, disabled: buttonDisabled }))) : (React.createElement(React.Fragment, null,

2

dist/getColor/index.d.ts

@@ -1,1 +0,1 @@

export declare const getColor: (pickRadius: number, targetCanvas: HTMLCanvasElement, e: MouseEvent) => any;
export declare const getColor: (targetCanvas: HTMLCanvasElement, e: MouseEvent, pickRadius?: number) => any;

@@ -7,3 +7,3 @@ "use strict";

const calcAverageColor_1 = require("./calcAverageColor");
const getColor = (pickRadius, targetCanvas, e) => {
const getColor = (targetCanvas, e, pickRadius) => {
const { offsetX, offsetY } = e;

@@ -10,0 +10,0 @@ if (pickRadius === undefined || pickRadius === 0) {

@@ -40,4 +40,6 @@ "use strict";

const { target } = e;
if (!target)
return;
const targetCanvas = yield (0, targetToCanvas_1.targetToCanvas)(target);
const rgbColor = (0, getColor_1.getColor)(pickRadius, targetCanvas, e);
const rgbColor = (0, getColor_1.getColor)(targetCanvas, e, pickRadius);
updateColors(rgbColor);

@@ -64,3 +66,3 @@ once && setPickingColorFromDocument(false);

useEffect(() => {
if (document.body) {
if (document.body && (cursorActive && cursorInactive)) {
document.body.style.cursor = pickingColorFromDocument ? cursorActive : cursorInactive;

@@ -67,0 +69,0 @@ }

{
"name": "react-eyedrop",
"version": "5.3.1",
"version": "5.3.2",
"description": "A reusable ColorPick EyeDropper written in React & TypeScript.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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