@superatomai/application-react 0.0.5 → 0.0.6

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.js CHANGED
@@ -1,5 +1,6 @@
1
- import React6, { Component, useState, useEffect, forwardRef, memo, useMemo, useRef, useCallback, createElement, lazy as lazy$1, Suspense, useSyncExternalStore } from 'react';
1
+ import React6, { Component, useState, useEffect, forwardRef, memo, useMemo, useRef, useCallback, createElement, lazy as lazy$1, Suspense } from 'react';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
+ import { useSyncExternalStore } from 'use-sync-external-store/shim';
3
4
  import { createPortal } from 'react-dom';
4
5
 
5
6
  var __create = Object.create;
@@ -70575,14 +70576,17 @@ function ChatInput({
70575
70576
  return () => cancelAnimationFrame(frame);
70576
70577
  }
70577
70578
  let width = textarea.clientWidth;
70579
+ let pending = 0;
70578
70580
  const observer = new ResizeObserver(() => {
70579
70581
  if (textarea.clientWidth === width) return;
70580
70582
  width = textarea.clientWidth;
70581
- resize();
70583
+ cancelAnimationFrame(pending);
70584
+ pending = requestAnimationFrame(resize);
70582
70585
  });
70583
70586
  observer.observe(textarea);
70584
70587
  return () => {
70585
70588
  cancelAnimationFrame(frame);
70589
+ cancelAnimationFrame(pending);
70586
70590
  observer.disconnect();
70587
70591
  };
70588
70592
  }, [resize]);