react-iro-gradient-picker 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2 -58
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -58
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7203,69 +7203,13 @@ var IroColorPicker = React.forwardRef(function (_a, ref) {
|
|
|
7203
7203
|
React.useEffect(function () {
|
|
7204
7204
|
if (!width)
|
|
7205
7205
|
return;
|
|
7206
|
-
|
|
7207
|
-
var maxRetries = 3;
|
|
7208
|
-
var createWithRetry = function () {
|
|
7209
|
-
// Longer initial delay to ensure DOM is completely ready
|
|
7210
|
-
var timeoutId = setTimeout(function () {
|
|
7211
|
-
try {
|
|
7212
|
-
var result = createColorPicker(width);
|
|
7213
|
-
if (!result &&
|
|
7214
|
-
colorPickerRef.current === null &&
|
|
7215
|
-
retryCount < maxRetries) {
|
|
7216
|
-
retryCount++;
|
|
7217
|
-
// Exponential backoff: 100ms, 200ms, 400ms
|
|
7218
|
-
setTimeout(createWithRetry, 100 * Math.pow(2, retryCount - 1));
|
|
7219
|
-
}
|
|
7220
|
-
}
|
|
7221
|
-
catch (error) {
|
|
7222
|
-
if (retryCount < maxRetries) {
|
|
7223
|
-
retryCount++;
|
|
7224
|
-
setTimeout(createWithRetry, 100 * Math.pow(2, retryCount - 1));
|
|
7225
|
-
}
|
|
7226
|
-
}
|
|
7227
|
-
}, 100); // Increased from 50ms to 100ms
|
|
7228
|
-
return function () { return clearTimeout(timeoutId); };
|
|
7229
|
-
};
|
|
7230
|
-
var cleanupFn = createWithRetry();
|
|
7231
|
-
return function () {
|
|
7232
|
-
if (cleanupFn)
|
|
7233
|
-
cleanupFn();
|
|
7234
|
-
};
|
|
7206
|
+
createColorPicker(width);
|
|
7235
7207
|
}, [width, theme, createColorPicker]);
|
|
7236
7208
|
// useEffect for when containerWidth is used (internal ResizeObserver)
|
|
7237
7209
|
React.useEffect(function () {
|
|
7238
7210
|
if (width)
|
|
7239
7211
|
return; // Don't run if width prop is provided
|
|
7240
|
-
|
|
7241
|
-
var maxRetries = 3;
|
|
7242
|
-
var createWithRetry = function () {
|
|
7243
|
-
// Longer initial delay to ensure DOM is completely ready
|
|
7244
|
-
var timeoutId = setTimeout(function () {
|
|
7245
|
-
try {
|
|
7246
|
-
var result = createColorPicker(containerWidth);
|
|
7247
|
-
if (!result &&
|
|
7248
|
-
colorPickerRef.current === null &&
|
|
7249
|
-
retryCount < maxRetries) {
|
|
7250
|
-
retryCount++;
|
|
7251
|
-
// Exponential backoff: 100ms, 200ms, 400ms
|
|
7252
|
-
setTimeout(createWithRetry, 100 * Math.pow(2, retryCount - 1));
|
|
7253
|
-
}
|
|
7254
|
-
}
|
|
7255
|
-
catch (error) {
|
|
7256
|
-
if (retryCount < maxRetries) {
|
|
7257
|
-
retryCount++;
|
|
7258
|
-
setTimeout(createWithRetry, 100 * Math.pow(2, retryCount - 1));
|
|
7259
|
-
}
|
|
7260
|
-
}
|
|
7261
|
-
}, 100); // Increased from 50ms to 100ms
|
|
7262
|
-
return function () { return clearTimeout(timeoutId); };
|
|
7263
|
-
};
|
|
7264
|
-
var cleanupFn = createWithRetry();
|
|
7265
|
-
return function () {
|
|
7266
|
-
if (cleanupFn)
|
|
7267
|
-
cleanupFn();
|
|
7268
|
-
};
|
|
7212
|
+
createColorPicker(containerWidth);
|
|
7269
7213
|
}, [containerWidth, theme, createColorPicker, width]);
|
|
7270
7214
|
// Update color when prop changes
|
|
7271
7215
|
React.useEffect(function () {
|