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.2 to 5.4.0

2

dist/targetToCanvas/index.js

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

const elementToCanvas_1 = require("./elementToCanvas");
const html2canvas = _html2canvas;
const html2canvas = _html2canvas.default;
const targetToCanvas = (target) => {

@@ -11,0 +11,0 @@ if (!(target instanceof HTMLElement)) {

@@ -16,2 +16,5 @@ export declare type RgbObj = {

cursorInactive?: string;
onPickStart?: () => void;
onPickEnd?: () => void;
onPickCancel?: () => void;
};

@@ -18,0 +21,0 @@ export declare type PickingMode = {

@@ -7,3 +7,3 @@ import { HookOptions } from './types';

declare type ReturnValue = [typeof initialStateColors, () => void, () => void];
export declare const useEyeDrop: ({ once, pickRadius, cursorActive, cursorInactive, }?: HookOptions) => ReturnValue;
export declare const useEyeDrop: ({ once, pickRadius, cursorActive, cursorInactive, onPickStart, onPickEnd, onPickCancel, }?: HookOptions) => ReturnValue;
export {};

@@ -21,9 +21,15 @@ "use strict";

const initialStateColors = { rgb: '', hex: '' };
const useEyeDrop = ({ once, pickRadius, cursorActive = 'copy', cursorInactive = 'auto', } = {}) => {
const useEyeDrop = ({ once, pickRadius, cursorActive = 'copy', cursorInactive = 'auto', onPickStart, onPickEnd, onPickCancel, } = {}) => {
const [colors, setColors] = useState(initialStateColors);
const [pickingColorFromDocument, setPickingColorFromDocument] = useState(false);
const pickColor = () => {
if (onPickStart) {
onPickStart();
}
setPickingColorFromDocument(true);
};
const cancelPickColor = () => {
if (onPickCancel) {
onPickCancel();
}
setPickingColorFromDocument(false);

@@ -47,2 +53,5 @@ };

once && setPickingColorFromDocument(false);
if (onPickEnd) {
onPickEnd();
}
}), [once, setPickingColorFromDocument]);

@@ -49,0 +58,0 @@ useEffect(() => {

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

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

@@ -262,3 +262,6 @@ # React EyeDrop

cursorActive: CSS Cursors,
cursorInactive: CSS Cursors
cursorInactive: CSS Cursors,
onPickStart?: () => void
onPickEnd?: () => void
onPickCancel?: () => void
})

@@ -265,0 +268,0 @@ ```

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