react-resizable-panels 4.2.1 → 4.2.2-issue-572
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.
|
@@ -7,7 +7,9 @@ import { Ref } from 'react';
|
|
|
7
7
|
import { RefObject } from 'react';
|
|
8
8
|
import { SetStateAction } from 'react';
|
|
9
9
|
|
|
10
|
-
declare type
|
|
10
|
+
declare type BasePanelAttributes = Omit<HTMLAttributes<HTMLDivElement>, "onResize">;
|
|
11
|
+
|
|
12
|
+
declare type BaseSeparatorAttributes = Omit<HTMLAttributes<HTMLDivElement>, "role" | "tabIndex">;
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* A Group wraps a set of resizable Panel components.
|
|
@@ -213,7 +215,7 @@ export declare interface PanelImperativeHandle {
|
|
|
213
215
|
resize: (size: number | string) => void;
|
|
214
216
|
}
|
|
215
217
|
|
|
216
|
-
export declare type PanelProps =
|
|
218
|
+
export declare type PanelProps = BasePanelAttributes & {
|
|
217
219
|
/**
|
|
218
220
|
* CSS class name.
|
|
219
221
|
*
|
|
@@ -308,7 +310,7 @@ export declare namespace Separator {
|
|
|
308
310
|
var displayName: string;
|
|
309
311
|
}
|
|
310
312
|
|
|
311
|
-
export declare type SeparatorProps =
|
|
313
|
+
export declare type SeparatorProps = BaseSeparatorAttributes & {
|
|
312
314
|
/**
|
|
313
315
|
* CSS class name.
|
|
314
316
|
*
|
|
@@ -340,6 +342,10 @@ export declare type SeparatorProps = BaseAttributes & {
|
|
|
340
342
|
|
|
341
343
|
export declare type SizeUnit = "px" | "%" | "em" | "rem" | "vh" | "vw";
|
|
342
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Saves and restores group layouts between page loads.
|
|
347
|
+
* It can be configured to store values using `localStorage`, `sessionStorage`, cookies, or any other persistence layer that makes sense for your application.
|
|
348
|
+
*/
|
|
343
349
|
export declare function useDefaultLayout({ debounceSaveMs, panelIds, storage, ...rest }: {
|
|
344
350
|
/**
|
|
345
351
|
* Debounce save operation by the specified number of milliseconds; defaults to 100ms
|
|
@@ -348,14 +354,17 @@ export declare function useDefaultLayout({ debounceSaveMs, panelIds, storage, ..
|
|
|
348
354
|
/**
|
|
349
355
|
* For Groups that contain conditionally-rendered Panels, this prop can be used to save and restore multiple layouts.
|
|
350
356
|
*
|
|
357
|
+
* ℹ️ This prevents layout shift for server-rendered apps.
|
|
358
|
+
*
|
|
351
359
|
* ⚠️ Panel ids must match the Panels rendered within the Group during mount or the initial layout will be incorrect.
|
|
352
360
|
*/
|
|
353
361
|
panelIds?: string[] | undefined;
|
|
354
362
|
/**
|
|
355
363
|
* Storage implementation; supports localStorage, sessionStorage, and custom implementations
|
|
356
364
|
* Refer to documentation site for example integrations.
|
|
365
|
+
*
|
|
357
366
|
*/
|
|
358
|
-
storage
|
|
367
|
+
storage?: LayoutStorage;
|
|
359
368
|
} & ({
|
|
360
369
|
/**
|
|
361
370
|
* Group id; must be unique in order for layouts to be saved separately.
|
|
@@ -364,7 +373,7 @@ export declare function useDefaultLayout({ debounceSaveMs, panelIds, storage, ..
|
|
|
364
373
|
groupId: string;
|
|
365
374
|
} | {
|
|
366
375
|
/**
|
|
367
|
-
*
|
|
376
|
+
* Uniquely identifies a specific group/layout.
|
|
368
377
|
*/
|
|
369
378
|
id: string;
|
|
370
379
|
})): {
|