react-best-gradient-color-picker
Advanced tools
Comparing version 3.0.10-beta.9 to 3.0.10-beta.10
@@ -62,2 +62,3 @@ "use strict"; | ||
const [coverUp, setCoverUp] = (0, react_1.useState)(false); | ||
const [isPicking, setIsPicking] = (0, react_1.useState)(false); | ||
const takePick = () => { | ||
@@ -87,5 +88,7 @@ const root = document.getElementById('root'); | ||
} | ||
setIsPicking(false); | ||
setCoverUp(false); | ||
}; | ||
const getEyeDrop = () => { | ||
setIsPicking(true); | ||
// @ts-expect-error - ts does not evaluate for window.EyeDropper | ||
@@ -105,5 +108,7 @@ if (!window.EyeDropper) { | ||
onSelect(`rgba(${r}, ${g}, ${b}, 1)`); | ||
setIsPicking(false); | ||
}) | ||
.catch((e) => { | ||
console.log(e); | ||
setIsPicking(false); | ||
}); | ||
@@ -117,3 +122,3 @@ } | ||
} }, | ||
react_1.default.createElement(DropperIcon, { color: coverUp ? 'rgb(86, 140, 245)' : '' })), | ||
react_1.default.createElement(DropperIcon, { color: isPicking ? 'rgb(86, 140, 245)' : '' })), | ||
coverUp && (react_1.default.createElement(Portal_js_1.default, null, | ||
@@ -120,0 +125,0 @@ react_1.default.createElement("div", { onClick: (e) => getColorLegacy(e), style: defaultStyles.rbgcpEyedropperCover }))))); |
"use strict"; | ||
'use client'; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -3,0 +4,0 @@ if (k2 === undefined) k2 = k; |
@@ -34,2 +34,3 @@ /* eslint-disable react/jsx-no-leaked-render */ | ||
const [coverUp, setCoverUp] = useState(false); | ||
const [isPicking, setIsPicking] = useState(false); | ||
const takePick = () => { | ||
@@ -59,5 +60,7 @@ const root = document.getElementById('root'); | ||
} | ||
setIsPicking(false); | ||
setCoverUp(false); | ||
}; | ||
const getEyeDrop = () => { | ||
setIsPicking(true); | ||
// @ts-expect-error - ts does not evaluate for window.EyeDropper | ||
@@ -77,5 +80,7 @@ if (!window.EyeDropper) { | ||
onSelect(`rgba(${r}, ${g}, ${b}, 1)`); | ||
setIsPicking(false); | ||
}) | ||
.catch((e) => { | ||
console.log(e); | ||
setIsPicking(false); | ||
}); | ||
@@ -89,3 +94,3 @@ } | ||
} }, | ||
React.createElement(DropperIcon, { color: coverUp ? 'rgb(86, 140, 245)' : '' })), | ||
React.createElement(DropperIcon, { color: isPicking ? 'rgb(86, 140, 245)' : '' })), | ||
coverUp && (React.createElement(Portal, null, | ||
@@ -92,0 +97,0 @@ React.createElement("div", { onClick: (e) => getColorLegacy(e), style: defaultStyles.rbgcpEyedropperCover }))))); |
@@ -0,1 +1,2 @@ | ||
'use client'; | ||
import React, { useRef } from 'react'; | ||
@@ -2,0 +3,0 @@ import PickerContextWrapper from '../context.js'; |
{ | ||
"name": "react-best-gradient-color-picker", | ||
"version": "3.0.10-beta.9", | ||
"version": "3.0.10-beta.10", | ||
"description": "An easy to use color/gradient picker for React.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
405803
11033