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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-resizable-panels",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"description": "React components for resizable panel groups/layouts",
|
|
5
5
|
"author": "Brian Vaughn <brian.david.vaughn@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,11 +9,33 @@
|
|
|
9
9
|
"url": "git+https://github.com/bvaughn/react-resizable-panels.git"
|
|
10
10
|
},
|
|
11
11
|
"source": "src/index.ts",
|
|
12
|
-
"main": "dist/react-resizable-panels.js",
|
|
13
|
-
"module": "dist/react-resizable-panels.
|
|
14
|
-
"
|
|
12
|
+
"main": "dist/react-resizable-panels.cjs.js",
|
|
13
|
+
"module": "dist/react-resizable-panels.esm.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": {
|
|
17
|
+
"import": "./dist/react-resizable-panels.cjs.mjs",
|
|
18
|
+
"default": "./dist/react-resizable-panels.cjs.js"
|
|
19
|
+
},
|
|
20
|
+
"development": {
|
|
21
|
+
"module": "./dist/react-resizable-panels.development.esm.js",
|
|
22
|
+
"import": "./dist/react-resizable-panels.development.cjs.mjs",
|
|
23
|
+
"default": "./dist/react-resizable-panels.development.cjs.js"
|
|
24
|
+
},
|
|
25
|
+
"module": "./dist/react-resizable-panels.esm.js",
|
|
26
|
+
"import": "./dist/react-resizable-panels.cjs.mjs",
|
|
27
|
+
"default": "./dist/react-resizable-panels.cjs.js"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"imports": {
|
|
32
|
+
"#is-development": {
|
|
33
|
+
"development": "./src/env-conditions/development.ts",
|
|
34
|
+
"default": "./src/env-conditions/production.ts"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"types": "dist/react-resizable-panels.cjs.d.ts",
|
|
15
38
|
"scripts": {
|
|
16
|
-
"build": "parcel build",
|
|
17
39
|
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
18
40
|
"watch": "parcel watch --port=2345"
|
|
19
41
|
},
|
package/src/PanelGroup.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isDevelopment } from "#is-development";
|
|
1
2
|
import {
|
|
2
3
|
createElement,
|
|
3
4
|
CSSProperties,
|
|
@@ -291,14 +292,13 @@ function PanelGroupWithForwardedRef({
|
|
|
291
292
|
}
|
|
292
293
|
});
|
|
293
294
|
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
if (
|
|
296
|
+
totalDefaultSize > 100 ||
|
|
297
|
+
(panelsWithNullDefaultSize === 0 && totalDefaultSize !== 100)
|
|
298
|
+
) {
|
|
299
|
+
throw new Error(`Invalid default sizes specified for panels`);
|
|
298
300
|
} else if (totalMinSize > 100) {
|
|
299
|
-
throw new Error(
|
|
300
|
-
`The sum of the minSize of all panels in a group cannot exceed 100.`
|
|
301
|
-
);
|
|
301
|
+
throw new Error(`Invalid minimum sizes specified for panels`);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
setSizes(
|
|
@@ -338,10 +338,12 @@ function PanelGroupWithForwardedRef({
|
|
|
338
338
|
// This includes server rendering.
|
|
339
339
|
// At this point the best we can do is render everything with the same size.
|
|
340
340
|
if (panels.size === 0) {
|
|
341
|
-
if (
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
if (isDevelopment) {
|
|
342
|
+
if (isServerRendering() && defaultSize == null) {
|
|
343
|
+
console.warn(
|
|
344
|
+
`WARNING: Panel defaultSize prop recommended to avoid layout shift after server rendering`
|
|
345
|
+
);
|
|
346
|
+
}
|
|
345
347
|
}
|
|
346
348
|
|
|
347
349
|
return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isDevelopment = true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isDevelopment = false;
|
package/src/index.ts
CHANGED
|
@@ -5,17 +5,27 @@ import { PanelResizeHandle } from "./PanelResizeHandle";
|
|
|
5
5
|
import type { ImperativePanelHandle, PanelProps } from "./Panel";
|
|
6
6
|
import type { ImperativePanelGroupHandle, PanelGroupProps } from "./PanelGroup";
|
|
7
7
|
import type { PanelResizeHandleProps } from "./PanelResizeHandle";
|
|
8
|
-
import type {
|
|
8
|
+
import type {
|
|
9
|
+
PanelGroupOnLayout,
|
|
10
|
+
PanelGroupStorage,
|
|
11
|
+
PanelOnCollapse,
|
|
12
|
+
PanelOnResize,
|
|
13
|
+
PanelResizeHandleOnDragging,
|
|
14
|
+
} from "./types";
|
|
9
15
|
|
|
10
16
|
export {
|
|
11
17
|
// TypeScript types
|
|
12
18
|
ImperativePanelGroupHandle,
|
|
13
19
|
ImperativePanelHandle,
|
|
14
20
|
Panel,
|
|
21
|
+
PanelOnCollapse,
|
|
22
|
+
PanelOnResize,
|
|
15
23
|
PanelGroup,
|
|
24
|
+
PanelGroupOnLayout,
|
|
16
25
|
PanelGroupProps,
|
|
17
26
|
PanelGroupStorage,
|
|
18
27
|
PanelProps,
|
|
19
28
|
PanelResizeHandle,
|
|
29
|
+
PanelResizeHandleOnDragging,
|
|
20
30
|
PanelResizeHandleProps,
|
|
21
31
|
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ElementType, ReactNode } from "react";
|
|
2
|
-
type Direction = "horizontal" | "vertical";
|
|
3
|
-
export type PanelGroupStorage = {
|
|
4
|
-
getItem(name: string): string | null;
|
|
5
|
-
setItem(name: string, value: string): void;
|
|
6
|
-
};
|
|
7
|
-
type PanelGroupOnLayout = (sizes: number[]) => void;
|
|
8
|
-
type PanelOnCollapse = (collapsed: boolean) => void;
|
|
9
|
-
type PanelOnResize = (size: number) => void;
|
|
10
|
-
type PanelResizeHandleOnDragging = (isDragging: boolean) => void;
|
|
11
|
-
export type PanelProps = {
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
className?: string;
|
|
14
|
-
collapsible?: boolean;
|
|
15
|
-
defaultSize?: number | null;
|
|
16
|
-
id?: string | null;
|
|
17
|
-
maxSize?: number;
|
|
18
|
-
minSize?: number;
|
|
19
|
-
onCollapse?: PanelOnCollapse | null;
|
|
20
|
-
onResize?: PanelOnResize | null;
|
|
21
|
-
order?: number | null;
|
|
22
|
-
style?: CSSProperties;
|
|
23
|
-
tagName?: ElementType;
|
|
24
|
-
};
|
|
25
|
-
export type ImperativePanelHandle = {
|
|
26
|
-
collapse: () => void;
|
|
27
|
-
expand: () => void;
|
|
28
|
-
getCollapsed(): boolean;
|
|
29
|
-
getSize(): number;
|
|
30
|
-
resize: (percentage: number) => void;
|
|
31
|
-
};
|
|
32
|
-
export const Panel: import("react").ForwardRefExoticComponent<PanelProps & import("react").RefAttributes<ImperativePanelHandle>>;
|
|
33
|
-
export type PanelGroupProps = {
|
|
34
|
-
autoSaveId?: string;
|
|
35
|
-
children?: ReactNode;
|
|
36
|
-
className?: string;
|
|
37
|
-
direction: Direction;
|
|
38
|
-
disablePointerEventsDuringResize?: boolean;
|
|
39
|
-
id?: string | null;
|
|
40
|
-
onLayout?: PanelGroupOnLayout;
|
|
41
|
-
storage?: PanelGroupStorage;
|
|
42
|
-
style?: CSSProperties;
|
|
43
|
-
tagName?: ElementType;
|
|
44
|
-
};
|
|
45
|
-
export type ImperativePanelGroupHandle = {
|
|
46
|
-
getLayout: () => number[];
|
|
47
|
-
setLayout: (panelSizes: number[]) => void;
|
|
48
|
-
};
|
|
49
|
-
export const PanelGroup: import("react").ForwardRefExoticComponent<PanelGroupProps & import("react").RefAttributes<ImperativePanelGroupHandle>>;
|
|
50
|
-
export type PanelResizeHandleProps = {
|
|
51
|
-
children?: ReactNode;
|
|
52
|
-
className?: string;
|
|
53
|
-
disabled?: boolean;
|
|
54
|
-
id?: string | null;
|
|
55
|
-
onDragging?: PanelResizeHandleOnDragging;
|
|
56
|
-
style?: CSSProperties;
|
|
57
|
-
tagName?: ElementType;
|
|
58
|
-
};
|
|
59
|
-
export function PanelResizeHandle({ children, className: classNameFromProps, disabled, id: idFromProps, onDragging, style: styleFromProps, tagName: Type, }: PanelResizeHandleProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
60
|
-
|
|
61
|
-
//# sourceMappingURL=react-resizable-panels.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AGEA,iBAAwB,YAAY,GAAG,UAAU,CAAC;AAElD,gCAAgC;IAC9B,OA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C,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,yCAAyC;IACvC,SAAS,EAAE,MAAM,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3C,CAAC;AAklBF,OAAO,MAAM,kIAKZ,CAAC;ACtsBF,qCAAqC;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,kCAAkC,EAChC,QAAe,EACf,SAAS,EAAE,kBAAuB,EAClC,QAAgB,EAChB,EAAE,EAAE,WAAkB,EACtB,UAAU,EACV,KAAK,EAAE,cAAmB,EAC1B,OAAO,EAAE,IAAY,GACtB,EAAE,sBAAsB,0FAoJxB","sources":["packages/react-resizable-panels/src/src/vendor/react.ts","packages/react-resizable-panels/src/src/hooks/useIsomorphicEffect.ts","packages/react-resizable-panels/src/src/hooks/useUniqueId.ts","packages/react-resizable-panels/src/src/types.ts","packages/react-resizable-panels/src/src/PanelContexts.ts","packages/react-resizable-panels/src/src/Panel.ts","packages/react-resizable-panels/src/src/constants.ts","packages/react-resizable-panels/src/src/utils/group.ts","packages/react-resizable-panels/src/src/utils/assert.ts","packages/react-resizable-panels/src/src/hooks/useWindowSplitterBehavior.ts","packages/react-resizable-panels/src/src/utils/arrays.ts","packages/react-resizable-panels/src/src/utils/coordinates.ts","packages/react-resizable-panels/src/src/utils/cursor.ts","packages/react-resizable-panels/src/src/utils/debounce.ts","packages/react-resizable-panels/src/src/utils/serialization.ts","packages/react-resizable-panels/src/src/utils/ssr.ts","packages/react-resizable-panels/src/src/PanelGroup.ts","packages/react-resizable-panels/src/src/PanelResizeHandle.ts","packages/react-resizable-panels/src/src/index.ts","packages/react-resizable-panels/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"import { Panel } from \"./Panel\";\nimport { PanelGroup } from \"./PanelGroup\";\nimport { PanelResizeHandle } from \"./PanelResizeHandle\";\n\nimport type { ImperativePanelHandle, PanelProps } from \"./Panel\";\nimport type { ImperativePanelGroupHandle, PanelGroupProps } from \"./PanelGroup\";\nimport type { PanelResizeHandleProps } from \"./PanelResizeHandle\";\nimport type { PanelGroupStorage } from \"./types\";\n\nexport {\n // TypeScript types\n ImperativePanelGroupHandle,\n ImperativePanelHandle,\n Panel,\n PanelGroup,\n PanelGroupProps,\n PanelGroupStorage,\n PanelProps,\n PanelResizeHandle,\n PanelResizeHandleProps,\n};\n"],"names":[],"version":3,"file":"react-resizable-panels.d.ts.map"}
|