react-resizable-panels 4.19.0 → 4.20.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.
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ None
|
|
|
71
71
|
<td>id</td>
|
|
72
72
|
<td><p>Uniquely identifies this group within an application.
|
|
73
73
|
Falls back to <code>useId</code> when not provided.</p>
|
|
74
|
-
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes
|
|
74
|
+
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes (an explicit <code>data-testid</code> prop will take precedence).</p>
|
|
75
75
|
</td>
|
|
76
76
|
</tr>
|
|
77
77
|
<tr>
|
|
@@ -116,7 +116,7 @@ Use this prop to disable that behavior for Panels and Separators in this group.<
|
|
|
116
116
|
<li><code>getLayout(): Layout</code></li>
|
|
117
117
|
<li><code>setLayout(layout: Layout): Layout</code></li>
|
|
118
118
|
</ul>
|
|
119
|
-
<p>ℹ️ The <code>useGroupRef</code> and <code>useGroupCallbackRef</code> hooks are exported for convenience
|
|
119
|
+
<p>ℹ️ The <code>useGroupRef</code> and <code>useGroupCallbackRef</code> hooks are exported for convenience in TypeScript projects.</p>
|
|
120
120
|
</td>
|
|
121
121
|
</tr>
|
|
122
122
|
<tr>
|
|
@@ -129,8 +129,8 @@ For most cases, it is recommended to use the <code>onLayoutChanged</code> callba
|
|
|
129
129
|
<tr>
|
|
130
130
|
<td>onLayoutChanged</td>
|
|
131
131
|
<td><p>Called after the Group's layout has been changed.</p>
|
|
132
|
-
<p>ℹ️ For layout changes caused by pointer events, this
|
|
133
|
-
This
|
|
132
|
+
<p>ℹ️ For layout changes caused by pointer events, this callback is not called until the pointer has been released.
|
|
133
|
+
This callback is recommended for saving layouts to storage.</p>
|
|
134
134
|
<p>ℹ️ The second argument contains meta information about the layout change.
|
|
135
135
|
The <code>isUserInteraction</code> attribute signals whether the resize was caused by direct user input.
|
|
136
136
|
It is true for resizes caused by pointer or keyboard input
|
|
@@ -227,7 +227,7 @@ None
|
|
|
227
227
|
<td><p>Uniquely identifies this panel within the parent group.
|
|
228
228
|
Falls back to <code>useId</code> when not provided.</p>
|
|
229
229
|
<p>ℹ️ This prop is used to associate persisted group layouts with the original panel.</p>
|
|
230
|
-
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes
|
|
230
|
+
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes (an explicit <code>data-testid</code> prop will take precedence).</p>
|
|
231
231
|
</td>
|
|
232
232
|
</tr>
|
|
233
233
|
<tr>
|
|
@@ -337,7 +337,7 @@ Defaults to <code>preserve-relative-size</code>.</p>
|
|
|
337
337
|
<li><code>isCollapsed(): boolean</code></li>
|
|
338
338
|
<li><code>resize(size: number | string): void</code></li>
|
|
339
339
|
</ul>
|
|
340
|
-
<p>ℹ️ The <code>usePanelRef</code> and <code>usePanelCallbackRef</code> hooks are exported for convenience
|
|
340
|
+
<p>ℹ️ The <code>usePanelRef</code> and <code>usePanelCallbackRef</code> hooks are exported for convenience in TypeScript projects.</p>
|
|
341
341
|
</td>
|
|
342
342
|
</tr>
|
|
343
343
|
</tbody>
|
|
@@ -392,7 +392,7 @@ None
|
|
|
392
392
|
<td>id</td>
|
|
393
393
|
<td><p>Uniquely identifies the separator within the parent group.
|
|
394
394
|
Falls back to <code>useId</code> when not provided.</p>
|
|
395
|
-
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes
|
|
395
|
+
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes (an explicit <code>data-testid</code> prop will take precedence).</p>
|
|
396
396
|
</td>
|
|
397
397
|
</tr>
|
|
398
398
|
<tr>
|
|
@@ -499,7 +499,7 @@ Grid elements always include the following attributes:
|
|
|
499
499
|
<td>id</td>
|
|
500
500
|
<td><p>Uniquely identifies this grid within an application.
|
|
501
501
|
Falls back to <code>useId</code> when not provided.</p>
|
|
502
|
-
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes
|
|
502
|
+
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes (an explicit <code>data-testid</code> prop will take precedence).</p>
|
|
503
503
|
</td>
|
|
504
504
|
</tr>
|
|
505
505
|
<tr>
|
|
@@ -545,7 +545,7 @@ Use this prop to disable that behavior for this grid.</p>
|
|
|
545
545
|
<li><code>getTrackByIndex(axis: "column" | "row", index: number): GridTrackImperativeHandle</code></li>
|
|
546
546
|
<li><code>setLayout(layout: Partial<GridLayout>): GridLayout</code></li>
|
|
547
547
|
</ul>
|
|
548
|
-
<p>ℹ️ The <code>useGridRef</code> and <code>useGridCallbackRef</code> hooks are exported for convenience
|
|
548
|
+
<p>ℹ️ The <code>useGridRef</code> and <code>useGridCallbackRef</code> hooks are exported for convenience in TypeScript projects.</p>
|
|
549
549
|
</td>
|
|
550
550
|
</tr>
|
|
551
551
|
<tr>
|
|
@@ -558,8 +558,8 @@ For most cases, it is recommended to use the <code>onLayoutChanged</code> callba
|
|
|
558
558
|
<tr>
|
|
559
559
|
<td>onLayoutChanged</td>
|
|
560
560
|
<td><p>Called after the Grid's layout has been changed.</p>
|
|
561
|
-
<p>ℹ️ For layout changes caused by pointer events, this
|
|
562
|
-
This
|
|
561
|
+
<p>ℹ️ For layout changes caused by pointer events, this callback is not called until the pointer has been released.
|
|
562
|
+
This callback is recommended for saving layouts to storage.</p>
|
|
563
563
|
</td>
|
|
564
564
|
</tr>
|
|
565
565
|
<tr>
|
|
@@ -639,7 +639,7 @@ Cell elements always include the following attributes:
|
|
|
639
639
|
<td>id</td>
|
|
640
640
|
<td><p>Uniquely identifies this cell within the parent grid.
|
|
641
641
|
Falls back to <code>useId</code> when not provided.</p>
|
|
642
|
-
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes
|
|
642
|
+
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes (an explicit <code>data-testid</code> prop will take precedence).</p>
|
|
643
643
|
</td>
|
|
644
644
|
</tr>
|
|
645
645
|
<tr>
|
|
@@ -696,7 +696,7 @@ For example:
|
|
|
696
696
|
```
|
|
697
697
|
|
|
698
698
|
A gridline should not be rendered alongside of a Cell that spans across its boundary
|
|
699
|
-
(this includes disabled gridlines; an error will be logged to the console);
|
|
699
|
+
(this includes disabled gridlines; in development builds, an error will be logged to the console);
|
|
700
700
|
render multiple gridlines along the same boundary instead (e.g. before and after the spanning Cell).
|
|
701
701
|
|
|
702
702
|
ℹ️ Once a boundary contains a gridline, it can only be resized using gridlines;
|
|
@@ -894,7 +894,7 @@ so it should be memoized (e.g. with <code>useCallback</code>) when tab content i
|
|
|
894
894
|
<td>id</td>
|
|
895
895
|
<td><p>Uniquely identifies this workspace within an application.
|
|
896
896
|
Falls back to <code>useId</code> when not provided.</p>
|
|
897
|
-
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes
|
|
897
|
+
<p>ℹ️ This value will also be assigned to the <code>id</code> and <code>data-testid</code> attributes (an explicit <code>data-testid</code> prop will take precedence).</p>
|
|
898
898
|
</td>
|
|
899
899
|
</tr>
|
|
900
900
|
<tr>
|
|
@@ -913,7 +913,7 @@ Falls back to <code>useId</code> when not provided.</p>
|
|
|
913
913
|
<li><code>toolbar</code>: contains the content returned by <code>renderTabsetToolbar</code> (<code>data-tabset-toolbar</code>)</li>
|
|
914
914
|
<li><code>tabPanels</code>: contains a tabset's tab content (<code>data-tab-panels</code>)</li>
|
|
915
915
|
<li><code>tabContent</code>: the element each tab's content is rendered into (<code>data-tab-content</code>)</li>
|
|
916
|
-
<li><code>dropIndicator</code>: shows where a dragged tab will be dropped within a tabset's panels (<code>data-drop-indicator</code>)</li>
|
|
916
|
+
<li><code>dropIndicator</code>: shows where a dragged tab will be dropped within a tabset's panels, or at an edge of the workspace (<code>data-drop-indicator</code>)</li>
|
|
917
917
|
<li><code>dragPreview</code>: follows the pointer while a tab or tabset is dragged (<code>data-drag-preview</code>)</li>
|
|
918
918
|
</ul>
|
|
919
919
|
<p>ℹ️ Elements expose their state as data attributes (e.g. <code>data-tab-selected</code>, or <code>data-tabset-dragging</code> while a tabset is dragged), which can be used for styling.
|
|
@@ -921,7 +921,8 @@ Elements within a collapsed tabset have a <code>data-tabset-collapsed</code> att
|
|
|
921
921
|
Elements within a tabset also have a <code>data-tab-placement</code> attribute (see <code>tabPlacement</code>).</p>
|
|
922
922
|
<p>ℹ️ The drop indicator is the same element for the whole drag (rendered within the workspace's root element),
|
|
923
923
|
so it can be animated between regions and tabsets (e.g. <code>transition: inset 250ms</code>).
|
|
924
|
-
Its <code>data-region</code> attribute is the region
|
|
924
|
+
Its <code>data-region</code> attribute is the region of a tabset's panels it covers, or its <code>data-edge</code> attribute is the edge of the workspace it's at;
|
|
925
|
+
while a tab isn't over either, it has neither and isn't shown (<code>opacity: 0</code>).</p>
|
|
925
926
|
<p>ℹ️ Like the render props, this object is part of what tabsets re-render for;
|
|
926
927
|
in large workspaces, define it outside of the component (or memoize it) rather than inline.</p>
|
|
927
928
|
</td>
|
|
@@ -948,6 +949,9 @@ Workspaces in popout windows rendered by this copy of the application (with port
|
|
|
948
949
|
returning <code>true</code> rejects the target.</p>
|
|
949
950
|
<p>ℹ️ While a tabset is dragged, this function is called for each of its tabs (see <code>DisableDropArgs</code>),
|
|
950
951
|
so restrictions on where tabs can be dropped apply to dragged tabsets too.</p>
|
|
952
|
+
<p>ℹ️ Tabs can also be dropped at the edges of the workspace (beside all of the other tabsets), within a few pixels of the edges of its layout
|
|
953
|
+
(except over tabset headers, where the tab lists are) or within its root element's padding.
|
|
954
|
+
These targets have an <code>edge</code> rather than a <code>tabsetId</code>; <code>disableDrop={({ target }) => "edge" in target}</code> turns them off.</p>
|
|
951
955
|
</td>
|
|
952
956
|
</tr>
|
|
953
957
|
<tr>
|
|
@@ -990,8 +994,8 @@ iframes are reloaded, playing media is paused, and focused elements are blurred.
|
|
|
990
994
|
<tr>
|
|
991
995
|
<td>onModelChanged</td>
|
|
992
996
|
<td><p>Called after the model has changed (e.g. a tab was moved, selected, or closed, or a tabset was resized).</p>
|
|
993
|
-
<p>ℹ️ For changes caused by pointer events, this
|
|
994
|
-
This
|
|
997
|
+
<p>ℹ️ For changes caused by pointer events, this callback is not called until the pointer has been released.
|
|
998
|
+
This callback is recommended for saving models to storage.</p>
|
|
995
999
|
</td>
|
|
996
1000
|
</tr>
|
|
997
1001
|
<tr>
|
|
@@ -1137,7 +1141,7 @@ so they're restored with the rest of the layout.</p>
|
|
|
1137
1141
|
<tr>
|
|
1138
1142
|
<td>workspaceRef</td>
|
|
1139
1143
|
<td><p>Exposes the imperative API (see <code>WorkspaceImperativeHandle</code>).</p>
|
|
1140
|
-
<p>ℹ️ The <code>useWorkspaceRef</code> and <code>useWorkspaceCallbackRef</code> hooks are exported for convenience
|
|
1144
|
+
<p>ℹ️ The <code>useWorkspaceRef</code> and <code>useWorkspaceCallbackRef</code> hooks are exported for convenience in TypeScript projects.</p>
|
|
1141
1145
|
</td>
|
|
1142
1146
|
</tr>
|
|
1143
1147
|
</tbody>
|