react-resizable-panels 0.0.47 → 0.0.49
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/CHANGELOG.md +6 -0
- package/dist/declarations/src/Panel.d.ts +24 -0
- package/dist/declarations/src/PanelGroup.d.ts +30 -0
- package/dist/declarations/src/PanelResizeHandle.d.ts +12 -0
- package/dist/declarations/src/index.d.ts +8 -0
- package/dist/declarations/src/types.d.ts +27 -0
- package/dist/declarations/src/vendor/react.d.ts +6 -0
- package/dist/react-resizable-panels.cjs.d.mts +2 -0
- package/dist/react-resizable-panels.cjs.d.mts.map +1 -0
- package/dist/react-resizable-panels.cjs.d.ts +2 -0
- package/dist/react-resizable-panels.cjs.d.ts.map +1 -0
- package/dist/react-resizable-panels.cjs.js +1396 -0
- package/dist/react-resizable-panels.cjs.mjs +5 -0
- package/dist/react-resizable-panels.development.cjs.js +1408 -0
- package/dist/react-resizable-panels.development.esm.js +1382 -0
- package/dist/react-resizable-panels.esm.js +1370 -0
- package/package.json +27 -5
- package/src/PanelGroup.ts +13 -11
- package/src/env-conditions/development.ts +1 -0
- package/src/env-conditions/production.ts +1 -0
- package/src/index.ts +11 -1
- package/dist/react-resizable-panels.d.ts +0 -61
- package/dist/react-resizable-panels.d.ts.map +0 -1
- package/dist/react-resizable-panels.js +0 -1162
- package/dist/react-resizable-panels.js.map +0 -1
- package/dist/react-resizable-panels.module.js +0 -1156
- package/dist/react-resizable-panels.module.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.49
|
|
4
|
+
* Improved development warnings and props validation checks in `PanelGroup`.
|
|
5
|
+
|
|
6
|
+
## 0.0.48
|
|
7
|
+
* [148](https://github.com/bvaughn/react-resizable-panels/pull/148): Build release bundle with Preconstruct
|
|
8
|
+
|
|
3
9
|
## 0.0.47
|
|
4
10
|
* Mimic VS COde behavior; collapse a panel if it's smaller than half of its min-size
|
|
5
11
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CSSProperties, ElementType, ReactNode } from "./vendor/react";
|
|
2
|
+
import { PanelOnCollapse, PanelOnResize } from "./types";
|
|
3
|
+
export type PanelProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
collapsible?: boolean;
|
|
7
|
+
defaultSize?: number | null;
|
|
8
|
+
id?: string | null;
|
|
9
|
+
maxSize?: number;
|
|
10
|
+
minSize?: number;
|
|
11
|
+
onCollapse?: PanelOnCollapse | null;
|
|
12
|
+
onResize?: PanelOnResize | null;
|
|
13
|
+
order?: number | null;
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
tagName?: ElementType;
|
|
16
|
+
};
|
|
17
|
+
export type ImperativePanelHandle = {
|
|
18
|
+
collapse: () => void;
|
|
19
|
+
expand: () => void;
|
|
20
|
+
getCollapsed(): boolean;
|
|
21
|
+
getSize(): number;
|
|
22
|
+
resize: (percentage: number) => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const Panel: import("react").ForwardRefExoticComponent<PanelProps & import("react").RefAttributes<ImperativePanelHandle>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CSSProperties, ElementType, ReactNode } from "./vendor/react";
|
|
2
|
+
import { Direction, PanelData, PanelGroupOnLayout, PanelGroupStorage } from "./types";
|
|
3
|
+
export type CommittedValues = {
|
|
4
|
+
direction: Direction;
|
|
5
|
+
panels: Map<string, PanelData>;
|
|
6
|
+
sizes: number[];
|
|
7
|
+
};
|
|
8
|
+
export type PanelDataMap = Map<string, PanelData>;
|
|
9
|
+
export type InitialDragState = {
|
|
10
|
+
dragHandleRect: DOMRect;
|
|
11
|
+
dragOffset: number;
|
|
12
|
+
sizes: number[];
|
|
13
|
+
};
|
|
14
|
+
export type PanelGroupProps = {
|
|
15
|
+
autoSaveId?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
direction: Direction;
|
|
19
|
+
disablePointerEventsDuringResize?: boolean;
|
|
20
|
+
id?: string | null;
|
|
21
|
+
onLayout?: PanelGroupOnLayout;
|
|
22
|
+
storage?: PanelGroupStorage;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
tagName?: ElementType;
|
|
25
|
+
};
|
|
26
|
+
export type ImperativePanelGroupHandle = {
|
|
27
|
+
getLayout: () => number[];
|
|
28
|
+
setLayout: (panelSizes: number[]) => void;
|
|
29
|
+
};
|
|
30
|
+
export declare const PanelGroup: import("react").ForwardRefExoticComponent<PanelGroupProps & import("react").RefAttributes<ImperativePanelGroupHandle>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties, ElementType, ReactNode } from "./vendor/react";
|
|
2
|
+
import type { PanelResizeHandleOnDragging } from "./types";
|
|
3
|
+
export type PanelResizeHandleProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
id?: string | null;
|
|
8
|
+
onDragging?: PanelResizeHandleOnDragging;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
tagName?: ElementType;
|
|
11
|
+
};
|
|
12
|
+
export declare function PanelResizeHandle({ children, className: classNameFromProps, disabled, id: idFromProps, onDragging, style: styleFromProps, tagName: Type, }: PanelResizeHandleProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Panel } from "./Panel";
|
|
2
|
+
import { PanelGroup } from "./PanelGroup";
|
|
3
|
+
import { PanelResizeHandle } from "./PanelResizeHandle";
|
|
4
|
+
import type { ImperativePanelHandle, PanelProps } from "./Panel";
|
|
5
|
+
import type { ImperativePanelGroupHandle, PanelGroupProps } from "./PanelGroup";
|
|
6
|
+
import type { PanelResizeHandleProps } from "./PanelResizeHandle";
|
|
7
|
+
import type { PanelGroupOnLayout, PanelGroupStorage, PanelOnCollapse, PanelOnResize, PanelResizeHandleOnDragging } from "./types";
|
|
8
|
+
export { ImperativePanelGroupHandle, ImperativePanelHandle, Panel, PanelOnCollapse, PanelOnResize, PanelGroup, PanelGroupOnLayout, PanelGroupProps, PanelGroupStorage, PanelProps, PanelResizeHandle, PanelResizeHandleOnDragging, PanelResizeHandleProps, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RefObject } from "./vendor/react";
|
|
2
|
+
export type Direction = "horizontal" | "vertical";
|
|
3
|
+
export type PanelGroupStorage = {
|
|
4
|
+
getItem(name: string): string | null;
|
|
5
|
+
setItem(name: string, value: string): void;
|
|
6
|
+
};
|
|
7
|
+
export type PanelGroupOnLayout = (sizes: number[]) => void;
|
|
8
|
+
export type PanelOnCollapse = (collapsed: boolean) => void;
|
|
9
|
+
export type PanelOnResize = (size: number) => void;
|
|
10
|
+
export type PanelResizeHandleOnDragging = (isDragging: boolean) => void;
|
|
11
|
+
export type PanelCallbackRef = RefObject<{
|
|
12
|
+
onCollapse: PanelOnCollapse | null;
|
|
13
|
+
onResize: PanelOnResize | null;
|
|
14
|
+
}>;
|
|
15
|
+
export type PanelData = {
|
|
16
|
+
current: {
|
|
17
|
+
callbacksRef: PanelCallbackRef;
|
|
18
|
+
collapsible: boolean;
|
|
19
|
+
defaultSize: number | null;
|
|
20
|
+
id: string;
|
|
21
|
+
maxSize: number;
|
|
22
|
+
minSize: number;
|
|
23
|
+
order: number | null;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type ResizeEvent = KeyboardEvent | MouseEvent | TouchEvent;
|
|
27
|
+
export type ResizeHandler = (event: ResizeEvent) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
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;
|
|
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, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-resizable-panels.cjs.d.mts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-resizable-panels.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|