react-resizable-panels 4.23.0 → 4.24.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.
@@ -261,7 +261,9 @@ export declare type ExternalDragResult = {
261
261
  *
262
262
  * ℹ️ Floating tabsets can always be collapsed (with the imperative API, e.g. `useParentTabset().collapse()`), so they don't have the `collapsible` flag.
263
263
  * A collapsed floating tabset is only as large as its header across it (e.g. as tall as its tabs, when they're placed on top), and can only be resized along it;
264
- * its `width` and `height` are the size it expands to. Like tabsets in the layout, clicking a tab (or the empty space in the header) of a collapsed floating tabset expands it.
264
+ * its `width` and `height` are the size it expands to. Like tabsets in the layout, clicking a tab (or the empty space in the header) of a collapsed floating tabset expands it (unless the workspace is `disabled`),
265
+ * and clicking the selected tab of an expanded one (or pressing Enter or Space on it) collapses it (unless the workspace is `disabled`);
266
+ * but when another floating tabset is shown over part of it, clicking its selected tab only brings it to the front.
265
267
  */
266
268
  export declare type FloatingTabsetNode<TabData = unknown, TabsetData = unknown> = Omit<TabsetNode<TabData, TabsetData>, "collapsible" | "size"> & FloatingTabsetRect;
267
269
 
@@ -1704,6 +1706,9 @@ export declare type TabDropRegion = "bottom" | "center" | "left" | "right" | "to
1704
1706
  * - At an `index` within a tabset's tab list (in the order of its `tabs`, which run from right to left in a right-to-left layout)
1705
1707
  * - Within a `region` of a tabset's content area; edges split the tabset, and the center adds the tab to it
1706
1708
  * - At an `edge` of the workspace, beside all of the other tabsets (filling the workspace's height or width)
1709
+ *
1710
+ * ℹ️ A tab dropped at an edge of the workspace that a collapsed tabset lines (where it's dropped) is added to the end of that tabset's tab list instead,
1711
+ * so its target has an `index` (e.g. a sidebar collapsed to a strip of tabs, or a collapsed bottom panel).
1707
1712
  */
1708
1713
  export declare type TabDropTarget = {
1709
1714
  index: number;
@@ -1799,7 +1804,7 @@ export declare type TabRenderProps = Pick<HTMLAttributes<HTMLElement>, "aria-con
1799
1804
  *
1800
1805
  * To keep the tabset as it is, call `event.preventDefault()` in an `onClick` handler.
1801
1806
  *
1802
- * ℹ️ Clicking a tab of a collapsed tabset also expands it.
1807
+ * ℹ️ Clicking a tab of a collapsed tabset also expands it (unless the workspace is `disabled`, which doesn't restrict this button).
1803
1808
  */
1804
1809
  export declare const TabsetCollapseButton: typeof TabsetCollapseButtonComponent & {
1805
1810
  displayName: string;
@@ -2006,7 +2011,11 @@ export declare type TabsetNode<TabData = unknown, TabsetData = unknown> = {
2006
2011
  *
2007
2012
  * ℹ️ Tabsets are collapsed by dragging a separator past their minimum size (like collapsible Panels),
2008
2013
  * or with the imperative API (e.g. a button rendered by `renderTabsetToolbar`, see `useParentTabset`);
2009
- * clicking a tab (or the empty space in the header) of a collapsed tabset expands it, as does dropping tabs into it from another tabset.
2014
+ * clicking a tab (or the empty space in the header) of a collapsed tabset expands it (unless the workspace is `disabled`), as does dropping tabs into it from another tabset.
2015
+ * Clicking the selected tab of an expanded tabset (or pressing Enter or Space on it) collapses it, unless it's maximized or the workspace is `disabled`.
2016
+ *
2017
+ * ℹ️ Tabs dropped at an edge of the workspace that a collapsed tabset lines (e.g. a sidebar collapsed to a strip of tabs) are added to that tabset,
2018
+ * rather than beside all of the other tabsets (see `TabDropTarget`).
2010
2019
  *
2011
2020
  * ℹ️ The only tabset in a workspace (the root) can't be collapsed, and neither can a tabset whose siblings are all collapsed.
2012
2021
  *
@@ -2394,8 +2403,8 @@ export declare type ValueOrFunction<Value, State> = Value | ((state: State) => V
2394
2403
  * Workspaces are uncontrolled: provide an initial model with the `defaultModel` prop, save changes from the `onModelChanged` callback,
2395
2404
  * and make changes using the imperative API (see `WorkspaceImperativeHandle`).
2396
2405
  *
2397
- * ℹ️ Tab content is not remounted when a tab is moved.
2398
- * Its elements are moved within the document, though, which resets some browser state (e.g. iframes are reloaded).
2406
+ * ℹ️ Tab content is not remounted when a tab is moved, and its browser state (e.g. iframes, playing media, and focus) is preserved where possible;
2407
+ * browsers that don't support `moveBefore` (e.g. Safari) reset some of that state (e.g. iframes are reloaded).
2399
2408
  *
2400
2409
  * Workspace elements always include the following attributes:
2401
2410
  *
@@ -2925,7 +2934,8 @@ export declare type WorkspaceProps<TabData = unknown, TabsetData = unknown> = Om
2925
2934
  copyTabset?: ((tabset: TabsetNode<TabData, TabsetData>, copyTab: (tab: TabNode<TabData>) => TabNode<TabData>, target: TabDropTarget) => TabsetNode<TabData, TabsetData> | null | undefined) | undefined;
2926
2935
  /**
2927
2936
  * Locks the arrangement: tabs cannot be resized, dragged, dropped, or closed by the user.
2928
- * Selecting tabs and maximizing tabsets still work.
2937
+ * Selecting tabs and maximizing tabsets still work, but tabsets aren't collapsed or expanded by clicking their tabs (or the empty space in their headers);
2938
+ * clicking a tab of a collapsed tabset only selects it. A `TabsetCollapseButton` isn't restricted by `disabled`; to keep tabsets from being collapsed or expanded, don't render one.
2929
2939
  *
2930
2940
  * ℹ️ This prop overrides the `disableClose` and `disableDrag` flags of individual tabs.
2931
2941
  */
@@ -2950,6 +2960,7 @@ export declare type WorkspaceProps<TabData = unknown, TabsetData = unknown> = Om
2950
2960
  * ℹ️ 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
2951
2961
  * (except over tabset headers, where the tab lists are) or within its root element's padding.
2952
2962
  * These targets have an `edge` rather than a `tabsetId`; `disableDrop={({ target }) => "edge" in target}` turns them off.
2963
+ * (Where a collapsed tabset lines an edge, drops there are added to the end of its tab list, so those targets have an `index` and `tabsetId` instead.)
2953
2964
  */
2954
2965
  disableDrop?: boolean | ((args: DisableDropArgs<TabData, TabsetData>) => boolean) | undefined;
2955
2966
  /**
@@ -2999,8 +3010,9 @@ export declare type WorkspaceProps<TabData = unknown, TabsetData = unknown> = Om
2999
3010
  *
3000
3011
  * ℹ️ Moving a tab never remounts its content (unless the move hides it and `hiddenTabBehavior` is `"unmount"`).
3001
3012
  *
3002
- * ⚠️ Its React state is preserved, but its elements are moved within the document, which resets some browser state:
3003
- * iframes are reloaded, playing media is paused, and focused elements are blurred.
3013
+ * ℹ️ Its React state is preserved, and where possible its elements are moved within the document using `moveBefore`, which preserves browser state (iframes aren't reloaded, playing media isn't paused, and focused elements stay focused).
3014
+ *
3015
+ * ⚠️ Browsers that don't support `moveBefore` (e.g. Safari) reset some of that state when a tab moves: iframes are reloaded, playing media is paused, and focused elements are blurred.
3004
3016
  *
3005
3017
  * @default "keep-mounted"
3006
3018
  */