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 CHANGED
@@ -7195,69 +7195,13 @@ var IroColorPicker = forwardRef(function (_a, ref) {
7195
7195
  useEffect(function () {
7196
7196
  if (!width)
7197
7197
  return;
7198
- var retryCount = 0;
7199
- var maxRetries = 3;
7200
- var createWithRetry = function () {
7201
- // Longer initial delay to ensure DOM is completely ready
7202
- var timeoutId = setTimeout(function () {
7203
- try {
7204
- var result = createColorPicker(width);
7205
- if (!result &&
7206
- colorPickerRef.current === null &&
7207
- retryCount < maxRetries) {
7208
- retryCount++;
7209
- // Exponential backoff: 100ms, 200ms, 400ms
7210
- setTimeout(createWithRetry, 100 * Math.pow(2, retryCount - 1));
7211
- }
7212
- }
7213
- catch (error) {
7214
- if (retryCount < maxRetries) {
7215
- retryCount++;
7216
- setTimeout(createWithRetry, 100 * Math.pow(2, retryCount - 1));
7217
- }
7218
- }
7219
- }, 100); // Increased from 50ms to 100ms
7220
- return function () { return clearTimeout(timeoutId); };
7221
- };
7222
- var cleanupFn = createWithRetry();
7223
- return function () {
7224
- if (cleanupFn)
7225
- cleanupFn();
7226
- };
7198
+ createColorPicker(width);
7227
7199
  }, [width, theme, createColorPicker]);
7228
7200
  // useEffect for when containerWidth is used (internal ResizeObserver)
7229
7201
  useEffect(function () {
7230
7202
  if (width)
7231
7203
  return; // Don't run if width prop is provided
7232
- var retryCount = 0;
7233
- var maxRetries = 3;
7234
- var createWithRetry = function () {
7235
- // Longer initial delay to ensure DOM is completely ready
7236
- var timeoutId = setTimeout(function () {
7237
- try {
7238
- var result = createColorPicker(containerWidth);
7239
- if (!result &&
7240
- colorPickerRef.current === null &&
7241
- retryCount < maxRetries) {
7242
- retryCount++;
7243
- // Exponential backoff: 100ms, 200ms, 400ms
7244
- setTimeout(createWithRetry, 100 * Math.pow(2, retryCount - 1));
7245
- }
7246
- }
7247
- catch (error) {
7248
- if (retryCount < maxRetries) {
7249
- retryCount++;
7250
- setTimeout(createWithRetry, 100 * Math.pow(2, retryCount - 1));
7251
- }
7252
- }
7253
- }, 100); // Increased from 50ms to 100ms
7254
- return function () { return clearTimeout(timeoutId); };
7255
- };
7256
- var cleanupFn = createWithRetry();
7257
- return function () {
7258
- if (cleanupFn)
7259
- cleanupFn();
7260
- };
7204
+ createColorPicker(containerWidth);
7261
7205
  }, [containerWidth, theme, createColorPicker, width]);
7262
7206
  // Update color when prop changes
7263
7207
  useEffect(function () {