react-resizable-panels 0.0.59 → 0.0.61

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.
@@ -19,6 +19,7 @@ import useIsomorphicLayoutEffect from "./useIsomorphicEffect";
19
19
 
20
20
  export function useWindowSplitterPanelGroupBehavior({
21
21
  committedValuesRef,
22
+ eagerValuesRef,
22
23
  groupId,
23
24
  layout,
24
25
  panelDataArray,
@@ -26,6 +27,8 @@ export function useWindowSplitterPanelGroupBehavior({
26
27
  }: {
27
28
  committedValuesRef: RefObject<{
28
29
  direction: Direction;
30
+ }>;
31
+ eagerValuesRef: RefObject<{
29
32
  panelDataArray: PanelData[];
30
33
  }>;
31
34
  groupId: string;
@@ -95,7 +98,7 @@ export function useWindowSplitterPanelGroupBehavior({
95
98
  }, [groupId, layout, panelDataArray]);
96
99
 
97
100
  useEffect(() => {
98
- const { panelDataArray } = committedValuesRef.current!;
101
+ const { panelDataArray } = eagerValuesRef.current!;
99
102
 
100
103
  const groupElement = getPanelGroupElement(groupId);
101
104
  assert(groupElement != null, `No group found for id "${groupId}"`);
@@ -181,5 +184,12 @@ export function useWindowSplitterPanelGroupBehavior({
181
184
  return () => {
182
185
  cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
183
186
  };
184
- }, [committedValuesRef, groupId, layout, panelDataArray, setLayout]);
187
+ }, [
188
+ committedValuesRef,
189
+ eagerValuesRef,
190
+ groupId,
191
+ layout,
192
+ panelDataArray,
193
+ setLayout,
194
+ ]);
185
195
  }
@@ -0,0 +1,5 @@
1
+ export function getPanelElementsForGroup(groupId: string): HTMLDivElement[] {
2
+ return Array.from(
3
+ document.querySelectorAll(`[data-panel][data-panel-group-id="${groupId}"]`)
4
+ );
5
+ }