react-resizable-panels 0.0.55 → 0.0.57
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/.eslintrc.cjs +26 -0
- package/CHANGELOG.md +238 -90
- package/README.md +55 -49
- package/dist/declarations/src/Panel.d.ts +75 -20
- package/dist/declarations/src/PanelGroup.d.ts +29 -25
- package/dist/declarations/src/PanelResizeHandle.d.ts +1 -1
- package/dist/declarations/src/index.d.ts +5 -6
- package/dist/declarations/src/types.d.ts +3 -26
- package/dist/declarations/src/vendor/react.d.ts +4 -4
- package/dist/react-resizable-panels.browser.cjs.js +1276 -1043
- package/dist/react-resizable-panels.browser.cjs.mjs +1 -2
- package/dist/react-resizable-panels.browser.development.cjs.js +1410 -1097
- package/dist/react-resizable-panels.browser.development.cjs.mjs +1 -2
- package/dist/react-resizable-panels.browser.development.esm.js +1411 -1097
- package/dist/react-resizable-panels.browser.esm.js +1277 -1043
- package/dist/react-resizable-panels.cjs.js +1276 -1043
- package/dist/react-resizable-panels.cjs.js.map +1 -1
- package/dist/react-resizable-panels.cjs.mjs +1 -2
- package/dist/react-resizable-panels.development.cjs.js +1415 -1102
- package/dist/react-resizable-panels.development.cjs.mjs +1 -2
- package/dist/react-resizable-panels.development.esm.js +1416 -1102
- package/dist/react-resizable-panels.development.node.cjs.js +1179 -947
- package/dist/react-resizable-panels.development.node.cjs.mjs +1 -2
- package/dist/react-resizable-panels.development.node.esm.js +1180 -947
- package/dist/react-resizable-panels.esm.js +1277 -1043
- package/dist/react-resizable-panels.esm.js.map +1 -1
- package/dist/react-resizable-panels.node.cjs.js +1068 -910
- package/dist/react-resizable-panels.node.cjs.mjs +1 -2
- package/dist/react-resizable-panels.node.esm.js +1069 -910
- package/jest.config.js +10 -0
- package/package.json +5 -1
- package/src/Panel.test.tsx +308 -0
- package/src/Panel.ts +175 -123
- package/src/PanelGroup.test.tsx +210 -0
- package/src/PanelGroup.ts +730 -667
- package/src/PanelGroupContext.ts +33 -0
- package/src/PanelResizeHandle.ts +21 -17
- package/src/hooks/useUniqueId.ts +1 -1
- package/src/hooks/useWindowSplitterBehavior.ts +9 -164
- package/src/hooks/useWindowSplitterPanelGroupBehavior.ts +185 -0
- package/src/index.ts +19 -14
- package/src/types.ts +3 -30
- package/src/utils/adjustLayoutByDelta.test.ts +1808 -0
- package/src/utils/adjustLayoutByDelta.ts +211 -0
- package/src/utils/calculateAriaValues.test.ts +111 -0
- package/src/utils/calculateAriaValues.ts +67 -0
- package/src/utils/calculateDeltaPercentage.ts +68 -0
- package/src/utils/calculateDragOffsetPercentage.ts +30 -0
- package/src/utils/calculateUnsafeDefaultLayout.test.ts +92 -0
- package/src/utils/calculateUnsafeDefaultLayout.ts +55 -0
- package/src/utils/callPanelCallbacks.ts +81 -0
- package/src/utils/compareLayouts.test.ts +9 -0
- package/src/utils/compareLayouts.ts +12 -0
- package/src/utils/computePanelFlexBoxStyle.ts +44 -0
- package/src/utils/computePercentagePanelConstraints.test.ts +98 -0
- package/src/utils/computePercentagePanelConstraints.ts +56 -0
- package/src/utils/convertPercentageToPixels.test.ts +9 -0
- package/src/utils/convertPercentageToPixels.ts +6 -0
- package/src/utils/convertPixelConstraintsToPercentages.test.ts +47 -0
- package/src/utils/convertPixelConstraintsToPercentages.ts +72 -0
- package/src/utils/convertPixelsToPercentage.test.ts +9 -0
- package/src/utils/convertPixelsToPercentage.ts +6 -0
- package/src/utils/determinePivotIndices.ts +10 -0
- package/src/utils/dom/calculateAvailablePanelSizeInPixels.ts +29 -0
- package/src/utils/dom/getAvailableGroupSizePixels.ts +29 -0
- package/src/utils/dom/getPanelElement.ts +7 -0
- package/src/utils/dom/getPanelGroupElement.ts +9 -0
- package/src/utils/dom/getResizeHandleElement.ts +9 -0
- package/src/utils/dom/getResizeHandleElementIndex.ts +12 -0
- package/src/utils/dom/getResizeHandleElementsForGroup.ts +9 -0
- package/src/utils/dom/getResizeHandlePanelIds.ts +18 -0
- package/src/utils/events.ts +13 -0
- package/src/utils/getPercentageSizeFromMixedSizes.test.ts +47 -0
- package/src/utils/getPercentageSizeFromMixedSizes.ts +15 -0
- package/src/utils/getResizeEventCursorPosition.ts +19 -0
- package/src/utils/initializeDefaultStorage.ts +26 -0
- package/src/utils/numbers/fuzzyCompareNumbers.test.ts +16 -0
- package/src/utils/numbers/fuzzyCompareNumbers.ts +17 -0
- package/src/utils/numbers/fuzzyNumbersEqual.ts +9 -0
- package/src/utils/resizePanel.test.ts +45 -0
- package/src/utils/resizePanel.ts +60 -0
- package/src/utils/serialization.ts +9 -4
- package/src/utils/shouldMonitorPixelBasedConstraints.test.ts +23 -0
- package/src/utils/shouldMonitorPixelBasedConstraints.ts +13 -0
- package/src/utils/test-utils.ts +136 -0
- package/src/utils/validatePanelConstraints.test.ts +151 -0
- package/src/utils/validatePanelConstraints.ts +103 -0
- package/src/utils/validatePanelGroupLayout.test.ts +233 -0
- package/src/utils/validatePanelGroupLayout.ts +88 -0
- package/src/vendor/react.ts +4 -0
- package/.eslintrc.json +0 -22
- package/dist/declarations/src/utils/group.d.ts +0 -29
- package/src/PanelContexts.ts +0 -22
- package/src/utils/coordinates.ts +0 -149
- package/src/utils/group.ts +0 -614
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# react-resizable-panels
|
|
2
|
+
|
|
2
3
|
React components for resizable panel groups/layouts
|
|
3
4
|
|
|
4
5
|
```jsx
|
|
5
6
|
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
|
6
7
|
|
|
7
8
|
<PanelGroup autoSaveId="example" direction="horizontal">
|
|
8
|
-
<Panel
|
|
9
|
+
<Panel defaultSizePercentage={25}>
|
|
9
10
|
<SourcesExplorer />
|
|
10
11
|
</Panel>
|
|
11
12
|
<PanelResizeHandle />
|
|
@@ -13,10 +14,10 @@ import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
|
|
13
14
|
<SourceViewer />
|
|
14
15
|
</Panel>
|
|
15
16
|
<PanelResizeHandle />
|
|
16
|
-
<Panel
|
|
17
|
+
<Panel defaultSizePercentage={25}>
|
|
17
18
|
<Console />
|
|
18
19
|
</Panel>
|
|
19
|
-
</PanelGroup
|
|
20
|
+
</PanelGroup>;
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
### If you like this project, 🎉 [become a sponsor](https://github.com/sponsors/bvaughn/) or ☕ [buy me a coffee](http://givebrian.coffee/)
|
|
@@ -24,68 +25,73 @@ import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
|
|
24
25
|
## Props
|
|
25
26
|
|
|
26
27
|
### `PanelGroup`
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
28
|
+
|
|
29
|
+
| prop | type | description |
|
|
30
|
+
| :--------------------------------- | :--------------------------- | :---------------------------------------------------------------- |
|
|
31
|
+
| `autoSaveId` | `?string` | Unique id used to auto-save group arrangement via `localStorage` |
|
|
32
|
+
| `children` | `ReactNode` | Arbitrary React element(s) |
|
|
33
|
+
| `className` | `?string` | Class name to attach to root element |
|
|
34
|
+
| `direction` | `"horizontal" \| "vertical"` | Group orientation |
|
|
35
|
+
| `disablePointerEventsDuringResize` | `?boolean = false` | Disable pointer events inside `Panel`s during resize <sup>2</sup> |
|
|
36
|
+
| `id` | `?string` | Group id; falls back to `useId` when not provided |
|
|
37
|
+
| `onLayout` | `?(sizes: number[]) => void` | Called when group layout changes |
|
|
38
|
+
| `storage` | `?PanelGroupStorage` | Custom storage API; defaults to `localStorage` <sup>1</sup> |
|
|
39
|
+
| `style` | `?CSSProperties` | CSS style to attach to root element |
|
|
40
|
+
| `tagName` | `?string = "div"` | HTML element tag name for root element |
|
|
39
41
|
|
|
40
42
|
<sup>1</sup>: Storage API must define the following _synchronous_ methods:
|
|
41
|
-
* `getItem: (name:string) => string`
|
|
42
|
-
* `setItem: (name: string, value: string) => void`
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
- `getItem: (name:string) => string`
|
|
45
|
+
- `setItem: (name: string, value: string) => void`
|
|
46
|
+
|
|
47
|
+
<sup>2</sup>: This behavior is disabled by default because it can interfere with scrollbar styles, but it can be useful in the edge case where a `Panel` contains an `<iframe>`
|
|
45
48
|
|
|
46
49
|
`PanelGroup` components also expose an imperative API for manual resizing:
|
|
47
|
-
| method
|
|
50
|
+
| method | description
|
|
48
51
|
| :-------------------------------- | :---
|
|
49
52
|
| `setLayout(panelSizes: number[])` | Resize panel group to the specified _panelSizes_ (`[1 - 100, ...]`).
|
|
50
53
|
|
|
51
54
|
### `Panel`
|
|
52
|
-
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
55
|
+
|
|
56
|
+
| prop | type | description |
|
|
57
|
+
| :-------------- | :------------------------------ | :-------------------------------------------------------------------------------------------- |
|
|
58
|
+
| `children` | `ReactNode` | Arbitrary React element(s) |
|
|
59
|
+
| `className` | `?string` | Class name to attach to root element |
|
|
60
|
+
| `collapsedSize` | `?number=0` | Panel should collapse to this size |
|
|
61
|
+
| `collapsible` | `?boolean=false` | Panel should collapse when resized beyond its `minSize` |
|
|
62
|
+
| `defaultSize` | `?number` | Initial size of panel (numeric value between 1-100) |
|
|
63
|
+
| `id` | `?string` | Panel id (unique within group); falls back to `useId` when not provided |
|
|
64
|
+
| `maxSize` | `?number = 100` | Maximum allowable size of panel (numeric value between 1-100); defaults to `100` |
|
|
65
|
+
| `minSize` | `?number = 10` | Minimum allowable size of panel (numeric value between 1-100); defaults to `10` |
|
|
66
|
+
| `onCollapse` | `?(collapsed: boolean) => void` | Called when panel is collapsed; `collapsed` boolean parameter reflecting the new state |
|
|
67
|
+
| `onResize` | `?(size: number) => void` | Called when panel is resized; `size` parameter is a numeric value between 1-100. <sup>1</sup> |
|
|
68
|
+
| `order` | `?number` | Order of panel within group; required for groups with conditionally rendered panels |
|
|
69
|
+
| `style` | `?CSSProperties` | CSS style to attach to root element |
|
|
70
|
+
| `tagName` | `?string = "div"` | HTML element tag name for root element |
|
|
67
71
|
|
|
68
72
|
<sup>1</sup>: If any `Panel` has an `onResize` callback, the `order` prop should be provided for all `Panel`s.
|
|
69
73
|
|
|
70
74
|
`Panel` components also expose an imperative API for manual resizing:
|
|
71
|
-
| method
|
|
75
|
+
| method | description
|
|
72
76
|
| :--------------------------- | :---
|
|
73
|
-
| `collapse()`
|
|
74
|
-
| `expand()`
|
|
75
|
-
| `getCollapsed(): boolean`
|
|
76
|
-
| `getSize(): number`
|
|
77
|
+
| `collapse()` | If panel is `collapsible`, collapse it fully.
|
|
78
|
+
| `expand()` | If panel is currently _collapsed_, expand it to its most recent size.
|
|
79
|
+
| `getCollapsed(): boolean` | Returns `true` if the panel is currently _collapsed_ (`size === 0`).
|
|
80
|
+
| `getSize(): number` | Returns the most recently commited size of the panel as a percentage (`1 - 100`).
|
|
77
81
|
| `resize(percentage: number)` | Resize panel to the specified _percentage_ (`1 - 100`).
|
|
78
82
|
|
|
79
83
|
### `PanelResizeHandle`
|
|
80
|
-
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
84
|
+
|
|
85
|
+
| prop | type | description |
|
|
86
|
+
| :----------- | :------------------------------- | :------------------------------------------------------------------------------ |
|
|
87
|
+
| `children` | `?ReactNode` | Custom drag UI; can be any arbitrary React element(s) |
|
|
88
|
+
| `className` | `?string` | Class name to attach to root element |
|
|
89
|
+
| `disabled` | `?boolean` | Disable drag handle |
|
|
90
|
+
| `id` | `?string` | Resize handle id (unique within group); falls back to `useId` when not provided |
|
|
91
|
+
| `onDragging` | `?(isDragging: boolean) => void` | Called when group layout changes |
|
|
92
|
+
| `style` | `?CSSProperties` | CSS style to attach to root element |
|
|
93
|
+
| `tagName` | `?string = "div"` | HTML element tag name for root element |
|
|
94
|
+
|
|
89
95
|
---
|
|
90
96
|
|
|
91
|
-
#### If you like this project, [buy me a coffee](http://givebrian.coffee/).
|
|
97
|
+
#### If you like this project, [buy me a coffee](http://givebrian.coffee/).
|
|
@@ -1,26 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { MixedSizes } from "./types.js";
|
|
2
|
+
import { ElementType, ForwardedRef, PropsWithChildren } from "./vendor/react.js";
|
|
3
|
+
export type PanelOnCollapse = () => void;
|
|
4
|
+
export type PanelOnExpand = () => void;
|
|
5
|
+
export type PanelOnResize = (mixedSizes: MixedSizes, prevMixedSizes: MixedSizes) => void;
|
|
6
|
+
export type PanelCallbacks = {
|
|
7
|
+
onCollapse?: PanelOnCollapse;
|
|
8
|
+
onExpand?: PanelOnExpand;
|
|
9
|
+
onResize?: PanelOnResize;
|
|
10
|
+
};
|
|
11
|
+
export type PanelConstraints = {
|
|
12
|
+
collapsedSizePercentage?: number | undefined;
|
|
13
|
+
collapsedSizePixels?: number | undefined;
|
|
14
|
+
collapsible?: boolean | undefined;
|
|
15
|
+
defaultSizePercentage?: number | undefined;
|
|
16
|
+
defaultSizePixels?: number | undefined;
|
|
17
|
+
maxSizePercentage?: number | undefined;
|
|
18
|
+
maxSizePixels?: number | undefined;
|
|
19
|
+
minSizePercentage?: number | undefined;
|
|
20
|
+
minSizePixels?: number | undefined;
|
|
21
|
+
};
|
|
22
|
+
export type PanelData = {
|
|
23
|
+
callbacks: PanelCallbacks;
|
|
24
|
+
constraints: PanelConstraints;
|
|
25
|
+
id: string;
|
|
26
|
+
idIsFromProps: boolean;
|
|
27
|
+
order: number | undefined;
|
|
17
28
|
};
|
|
18
29
|
export type ImperativePanelHandle = {
|
|
19
30
|
collapse: () => void;
|
|
20
31
|
expand: () => void;
|
|
21
|
-
getCollapsed(): boolean;
|
|
22
32
|
getId(): string;
|
|
23
|
-
getSize(
|
|
24
|
-
resize: (
|
|
33
|
+
getSize(): MixedSizes;
|
|
34
|
+
resize: (size: Partial<MixedSizes>) => void;
|
|
25
35
|
};
|
|
26
|
-
export
|
|
36
|
+
export type PanelProps = PropsWithChildren<{
|
|
37
|
+
className?: string;
|
|
38
|
+
collapsedSizePercentage?: number | undefined;
|
|
39
|
+
collapsedSizePixels?: number | undefined;
|
|
40
|
+
collapsible?: boolean | undefined;
|
|
41
|
+
defaultSizePercentage?: number | undefined;
|
|
42
|
+
defaultSizePixels?: number | undefined;
|
|
43
|
+
id?: string;
|
|
44
|
+
maxSizePercentage?: number | undefined;
|
|
45
|
+
maxSizePixels?: number | undefined;
|
|
46
|
+
minSizePercentage?: number | undefined;
|
|
47
|
+
minSizePixels?: number | undefined;
|
|
48
|
+
onCollapse?: PanelOnCollapse;
|
|
49
|
+
onExpand?: PanelOnExpand;
|
|
50
|
+
onResize?: PanelOnResize;
|
|
51
|
+
order?: number;
|
|
52
|
+
style?: object;
|
|
53
|
+
tagName?: ElementType;
|
|
54
|
+
}>;
|
|
55
|
+
export declare function PanelWithForwardedRef({ children, className: classNameFromProps, collapsedSizePercentage, collapsedSizePixels, collapsible, defaultSizePercentage, defaultSizePixels, forwardedRef, id: idFromProps, maxSizePercentage, maxSizePixels, minSizePercentage, minSizePixels, onCollapse, onExpand, onResize, order, style: styleFromProps, tagName: Type, }: PanelProps & {
|
|
56
|
+
forwardedRef: ForwardedRef<ImperativePanelHandle>;
|
|
57
|
+
}): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
58
|
+
export declare namespace PanelWithForwardedRef {
|
|
59
|
+
var displayName: string;
|
|
60
|
+
}
|
|
61
|
+
export declare const Panel: import("react").ForwardRefExoticComponent<{
|
|
62
|
+
className?: string | undefined;
|
|
63
|
+
collapsedSizePercentage?: number | undefined;
|
|
64
|
+
collapsedSizePixels?: number | undefined;
|
|
65
|
+
collapsible?: boolean | undefined;
|
|
66
|
+
defaultSizePercentage?: number | undefined;
|
|
67
|
+
defaultSizePixels?: number | undefined;
|
|
68
|
+
id?: string | undefined;
|
|
69
|
+
maxSizePercentage?: number | undefined;
|
|
70
|
+
maxSizePixels?: number | undefined;
|
|
71
|
+
minSizePercentage?: number | undefined;
|
|
72
|
+
minSizePixels?: number | undefined;
|
|
73
|
+
onCollapse?: PanelOnCollapse | undefined;
|
|
74
|
+
onExpand?: PanelOnExpand | undefined;
|
|
75
|
+
onResize?: PanelOnResize | undefined;
|
|
76
|
+
order?: number | undefined;
|
|
77
|
+
style?: object | undefined;
|
|
78
|
+
tagName?: ElementType | undefined;
|
|
79
|
+
} & {
|
|
80
|
+
children?: import("react").ReactNode;
|
|
81
|
+
} & import("react").RefAttributes<ImperativePanelHandle>>;
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
sizes: number[];
|
|
8
|
-
units: Units;
|
|
1
|
+
import { Direction, MixedSizes } from "./types.js";
|
|
2
|
+
import { CSSProperties, ElementType, PropsWithChildren } from "./vendor/react.js";
|
|
3
|
+
export type ImperativePanelGroupHandle = {
|
|
4
|
+
getId: () => string;
|
|
5
|
+
getLayout: () => MixedSizes[];
|
|
6
|
+
setLayout: (layout: Partial<MixedSizes>[]) => void;
|
|
9
7
|
};
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
dragOffset: number;
|
|
14
|
-
sizes: number[];
|
|
8
|
+
export type PanelGroupStorage = {
|
|
9
|
+
getItem(name: string): string | null;
|
|
10
|
+
setItem(name: string, value: string): void;
|
|
15
11
|
};
|
|
16
|
-
export type
|
|
12
|
+
export type PanelGroupOnLayout = (layout: MixedSizes[]) => void;
|
|
13
|
+
export type PanelGroupProps = PropsWithChildren<{
|
|
17
14
|
autoSaveId?: string;
|
|
18
|
-
children?: ReactNode;
|
|
19
15
|
className?: string;
|
|
20
16
|
direction: Direction;
|
|
21
|
-
disablePointerEventsDuringResize?: boolean;
|
|
22
17
|
id?: string | null;
|
|
23
|
-
|
|
18
|
+
keyboardResizeByPercentage?: number | null;
|
|
19
|
+
keyboardResizeByPixels?: number | null;
|
|
20
|
+
onLayout?: PanelGroupOnLayout | null;
|
|
24
21
|
storage?: PanelGroupStorage;
|
|
25
22
|
style?: CSSProperties;
|
|
26
23
|
tagName?: ElementType;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
}>;
|
|
25
|
+
export declare const PanelGroup: import("react").ForwardRefExoticComponent<{
|
|
26
|
+
autoSaveId?: string | undefined;
|
|
27
|
+
className?: string | undefined;
|
|
28
|
+
direction: Direction;
|
|
29
|
+
id?: string | null | undefined;
|
|
30
|
+
keyboardResizeByPercentage?: number | null | undefined;
|
|
31
|
+
keyboardResizeByPixels?: number | null | undefined;
|
|
32
|
+
onLayout?: PanelGroupOnLayout | null | undefined;
|
|
33
|
+
storage?: PanelGroupStorage | undefined;
|
|
34
|
+
style?: CSSProperties | undefined;
|
|
35
|
+
tagName?: ElementType | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
children?: import("react").ReactNode;
|
|
38
|
+
} & import("react").RefAttributes<ImperativePanelGroupHandle>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ElementType, ReactNode } from "./vendor/react.js";
|
|
2
|
-
|
|
2
|
+
export type PanelResizeHandleOnDragging = (isDragging: boolean) => void;
|
|
3
3
|
export type PanelResizeHandleProps = {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
className?: string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Panel } from "./Panel.js";
|
|
2
2
|
import { PanelGroup } from "./PanelGroup.js";
|
|
3
3
|
import { PanelResizeHandle } from "./PanelResizeHandle.js";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export { ImperativePanelGroupHandle, ImperativePanelHandle, PanelOnCollapse, PanelOnResize, PanelGroupOnLayout, PanelGroupProps, PanelGroupStorage, PanelProps, PanelResizeHandleOnDragging, PanelResizeHandleProps, Units, Panel, PanelGroup, PanelResizeHandle, getAvailableGroupSizePixels, };
|
|
4
|
+
import type { MixedSizes } from "./types.js";
|
|
5
|
+
import type { ImperativePanelHandle, PanelOnCollapse, PanelOnExpand, PanelOnResize, PanelProps } from "./Panel.js";
|
|
6
|
+
import type { ImperativePanelGroupHandle, PanelGroupOnLayout, PanelGroupProps, PanelGroupStorage } from "./PanelGroup.js";
|
|
7
|
+
import type { PanelResizeHandleOnDragging, PanelResizeHandleProps } from "./PanelResizeHandle.js";
|
|
8
|
+
export { ImperativePanelGroupHandle, ImperativePanelHandle, MixedSizes, PanelGroupOnLayout, PanelGroupProps, PanelGroupStorage, PanelOnCollapse, PanelOnExpand, PanelOnResize, PanelProps, PanelResizeHandleOnDragging, PanelResizeHandleProps, Panel, PanelGroup, PanelResizeHandle, };
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import { RefObject } from "./vendor/react.js";
|
|
2
1
|
export type Direction = "horizontal" | "vertical";
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
setItem(name: string, value: string): void;
|
|
7
|
-
};
|
|
8
|
-
export type PanelGroupOnLayout = (sizes: number[]) => void;
|
|
9
|
-
export type PanelOnCollapse = (collapsed: boolean) => void;
|
|
10
|
-
export type PanelOnResize = (size: number, prevSize: number) => void;
|
|
11
|
-
export type PanelResizeHandleOnDragging = (isDragging: boolean) => void;
|
|
12
|
-
export type PanelCallbackRef = RefObject<{
|
|
13
|
-
onCollapse: PanelOnCollapse | null;
|
|
14
|
-
onResize: PanelOnResize | null;
|
|
15
|
-
}>;
|
|
16
|
-
export type PanelData = {
|
|
17
|
-
current: {
|
|
18
|
-
callbacksRef: PanelCallbackRef;
|
|
19
|
-
collapsedSize: number;
|
|
20
|
-
collapsible: boolean;
|
|
21
|
-
defaultSize: number | null;
|
|
22
|
-
id: string;
|
|
23
|
-
idWasAutoGenerated: boolean;
|
|
24
|
-
maxSize: number | null;
|
|
25
|
-
minSize: number;
|
|
26
|
-
order: number | null;
|
|
27
|
-
};
|
|
2
|
+
export type MixedSizes = {
|
|
3
|
+
sizePercentage: number;
|
|
4
|
+
sizePixels: number;
|
|
28
5
|
};
|
|
29
6
|
export type ResizeEvent = KeyboardEvent | MouseEvent | TouchEvent;
|
|
30
7
|
export type ResizeHandler = (event: ResizeEvent) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { CSSProperties, ElementType, ForwardedRef, MouseEvent, ReactNode, RefObject, TouchEvent } from "react";
|
|
3
|
-
declare const createElement: typeof React.createElement, createContext: typeof React.createContext, forwardRef: typeof React.forwardRef, useCallback: typeof React.useCallback, useContext: typeof React.useContext, useEffect: typeof React.useEffect, useImperativeHandle: typeof React.useImperativeHandle, useLayoutEffect: typeof React.useLayoutEffect, useMemo: typeof React.useMemo, useRef: typeof React.useRef, useState: typeof React.useState;
|
|
2
|
+
import type { CSSProperties, ElementType, ForwardedRef, MouseEvent, PropsWithChildren, ReactNode, RefObject, TouchEvent } from "react";
|
|
3
|
+
declare const createElement: typeof React.createElement, createContext: typeof React.createContext, createRef: typeof React.createRef, forwardRef: typeof React.forwardRef, useCallback: typeof React.useCallback, useContext: typeof React.useContext, useEffect: typeof React.useEffect, useImperativeHandle: typeof React.useImperativeHandle, useLayoutEffect: typeof React.useLayoutEffect, useMemo: typeof React.useMemo, useRef: typeof React.useRef, useState: typeof React.useState;
|
|
4
4
|
declare const useId: () => string;
|
|
5
|
-
export { createElement, createContext, forwardRef, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, };
|
|
6
|
-
export type { CSSProperties, ElementType, ForwardedRef, MouseEvent, ReactNode, RefObject, TouchEvent, };
|
|
5
|
+
export { createElement, createContext, createRef, forwardRef, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, };
|
|
6
|
+
export type { CSSProperties, ElementType, ForwardedRef, MouseEvent, PropsWithChildren, ReactNode, RefObject, TouchEvent, };
|