camunda-bpmn-js 4.12.1 → 4.14.0

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.
@@ -98500,6 +98500,24 @@
98500
98500
  return T$1((...args) => callbackRef.current(...args), []);
98501
98501
  }
98502
98502
 
98503
+ function useElementVisible(element) {
98504
+ const [visible, setVisible] = h(!!element && !!element.clientHeight);
98505
+ y(() => {
98506
+ if (!element) return;
98507
+ const resizeObserver = new ResizeObserver(([entry]) => {
98508
+ requestAnimationFrame(() => {
98509
+ const newVisible = !!entry.contentRect.height;
98510
+ if (newVisible !== visible) {
98511
+ setVisible(newVisible);
98512
+ }
98513
+ });
98514
+ });
98515
+ resizeObserver.observe(element);
98516
+ return () => resizeObserver.disconnect();
98517
+ }, [element, visible]);
98518
+ return visible;
98519
+ }
98520
+
98503
98521
  function Group(props) {
98504
98522
  const {
98505
98523
  element,
@@ -100362,6 +100380,7 @@
100362
100380
  } = props;
100363
100381
  const [localValue, setLocalValue] = h(value);
100364
100382
  const ref = useShowEntryEvent(id);
100383
+ const visible = useElementVisible(ref.current);
100365
100384
  const handleInputCallback = F$1(() => {
100366
100385
  return debounce(target => onInput(target.value.length ? target.value : undefined));
100367
100386
  }, [onInput, debounce]);
@@ -100373,6 +100392,9 @@
100373
100392
  y(() => {
100374
100393
  autoResize && resizeToContents(ref.current);
100375
100394
  }, []);
100395
+ y(() => {
100396
+ visible && autoResize && resizeToContents(ref.current);
100397
+ }, [visible]);
100376
100398
  p(() => {
100377
100399
  if (value === localValue) {
100378
100400
  return;