react-resizable-panels 3.0.0 → 3.0.2
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/dist/react-resizable-panels.browser.development.js +12 -4
- package/dist/react-resizable-panels.browser.js +12 -4
- package/dist/{react-resizable-panels.development.node.js → react-resizable-panels.development.edge-light.js} +12 -4
- package/dist/react-resizable-panels.development.js +12 -4
- package/dist/{react-resizable-panels.node.js → react-resizable-panels.edge-light.js} +12 -4
- package/dist/react-resizable-panels.js +12 -4
- package/package.json +15 -7
|
@@ -1081,14 +1081,22 @@ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
|
|
|
1081
1081
|
return index != null ? [index, index + 1] : [-1, -1];
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
|
+
function isHTMLElement(target) {
|
|
1085
|
+
if (target instanceof HTMLElement) {
|
|
1086
|
+
return true;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// Fallback to duck typing to handle edge case of portals within a popup window
|
|
1090
|
+
return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1084
1093
|
function getPanelGroupElement(id, rootElement = document) {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) {
|
|
1094
|
+
// If the root element is the PanelGroup
|
|
1095
|
+
if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
|
|
1088
1096
|
return rootElement;
|
|
1089
1097
|
}
|
|
1090
1098
|
|
|
1091
|
-
//Else query children
|
|
1099
|
+
// Else query children
|
|
1092
1100
|
const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
|
|
1093
1101
|
if (element) {
|
|
1094
1102
|
return element;
|
|
@@ -1075,14 +1075,22 @@ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
|
|
|
1075
1075
|
return index != null ? [index, index + 1] : [-1, -1];
|
|
1076
1076
|
}
|
|
1077
1077
|
|
|
1078
|
+
function isHTMLElement(target) {
|
|
1079
|
+
if (target instanceof HTMLElement) {
|
|
1080
|
+
return true;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// Fallback to duck typing to handle edge case of portals within a popup window
|
|
1084
|
+
return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1078
1087
|
function getPanelGroupElement(id, rootElement = document) {
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) {
|
|
1088
|
+
// If the root element is the PanelGroup
|
|
1089
|
+
if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
|
|
1082
1090
|
return rootElement;
|
|
1083
1091
|
}
|
|
1084
1092
|
|
|
1085
|
-
//Else query children
|
|
1093
|
+
// Else query children
|
|
1086
1094
|
const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
|
|
1087
1095
|
if (element) {
|
|
1088
1096
|
return element;
|
|
@@ -1012,14 +1012,22 @@ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
|
|
|
1012
1012
|
return index != null ? [index, index + 1] : [-1, -1];
|
|
1013
1013
|
}
|
|
1014
1014
|
|
|
1015
|
+
function isHTMLElement(target) {
|
|
1016
|
+
if (target instanceof HTMLElement) {
|
|
1017
|
+
return true;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
// Fallback to duck typing to handle edge case of portals within a popup window
|
|
1021
|
+
return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1015
1024
|
function getPanelGroupElement(id, rootElement = document) {
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) {
|
|
1025
|
+
// If the root element is the PanelGroup
|
|
1026
|
+
if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
|
|
1019
1027
|
return rootElement;
|
|
1020
1028
|
}
|
|
1021
1029
|
|
|
1022
|
-
//Else query children
|
|
1030
|
+
// Else query children
|
|
1023
1031
|
const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
|
|
1024
1032
|
if (element) {
|
|
1025
1033
|
return element;
|
|
@@ -1088,14 +1088,22 @@ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
|
|
|
1088
1088
|
return index != null ? [index, index + 1] : [-1, -1];
|
|
1089
1089
|
}
|
|
1090
1090
|
|
|
1091
|
+
function isHTMLElement(target) {
|
|
1092
|
+
if (target instanceof HTMLElement) {
|
|
1093
|
+
return true;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
// Fallback to duck typing to handle edge case of portals within a popup window
|
|
1097
|
+
return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1091
1100
|
function getPanelGroupElement(id, rootElement = document) {
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) {
|
|
1101
|
+
// If the root element is the PanelGroup
|
|
1102
|
+
if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
|
|
1095
1103
|
return rootElement;
|
|
1096
1104
|
}
|
|
1097
1105
|
|
|
1098
|
-
//Else query children
|
|
1106
|
+
// Else query children
|
|
1099
1107
|
const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
|
|
1100
1108
|
if (element) {
|
|
1101
1109
|
return element;
|
|
@@ -1001,14 +1001,22 @@ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
|
|
|
1001
1001
|
return index != null ? [index, index + 1] : [-1, -1];
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
|
+
function isHTMLElement(target) {
|
|
1005
|
+
if (target instanceof HTMLElement) {
|
|
1006
|
+
return true;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
// Fallback to duck typing to handle edge case of portals within a popup window
|
|
1010
|
+
return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1004
1013
|
function getPanelGroupElement(id, rootElement = document) {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) {
|
|
1014
|
+
// If the root element is the PanelGroup
|
|
1015
|
+
if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
|
|
1008
1016
|
return rootElement;
|
|
1009
1017
|
}
|
|
1010
1018
|
|
|
1011
|
-
//Else query children
|
|
1019
|
+
// Else query children
|
|
1012
1020
|
const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
|
|
1013
1021
|
if (element) {
|
|
1014
1022
|
return element;
|
|
@@ -1077,14 +1077,22 @@ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
|
|
|
1077
1077
|
return index != null ? [index, index + 1] : [-1, -1];
|
|
1078
1078
|
}
|
|
1079
1079
|
|
|
1080
|
+
function isHTMLElement(target) {
|
|
1081
|
+
if (target instanceof HTMLElement) {
|
|
1082
|
+
return true;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
// Fallback to duck typing to handle edge case of portals within a popup window
|
|
1086
|
+
return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1080
1089
|
function getPanelGroupElement(id, rootElement = document) {
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) {
|
|
1090
|
+
// If the root element is the PanelGroup
|
|
1091
|
+
if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
|
|
1084
1092
|
return rootElement;
|
|
1085
1093
|
}
|
|
1086
1094
|
|
|
1087
|
-
//Else query children
|
|
1095
|
+
// Else query children
|
|
1088
1096
|
const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
|
|
1089
1097
|
if (element) {
|
|
1090
1098
|
return element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-resizable-panels",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React components for resizable panel groups/layouts",
|
|
6
6
|
"author": "Brian Vaughn <brian.david.vaughn@gmail.com>",
|
|
@@ -20,12 +20,18 @@
|
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/react-resizable-panels.js",
|
|
22
22
|
"development": {
|
|
23
|
+
"edge-light": "./dist/react-resizable-panels.development.edge-light.js",
|
|
24
|
+
"worker": "./dist/react-resizable-panels.development.edge-light.js",
|
|
25
|
+
"workerd": "./dist/react-resizable-panels.development.edge-light.js",
|
|
23
26
|
"browser": "./dist/react-resizable-panels.browser.development.js",
|
|
24
|
-
"node": "./dist/react-resizable-panels.development.
|
|
27
|
+
"node": "./dist/react-resizable-panels.development.edge-light.js",
|
|
25
28
|
"default": "./dist/react-resizable-panels.development.js"
|
|
26
29
|
},
|
|
30
|
+
"edge-light": "./dist/react-resizable-panels.edge-light.js",
|
|
31
|
+
"worker": "./dist/react-resizable-panels.edge-light.js",
|
|
32
|
+
"workerd": "./dist/react-resizable-panels.edge-light.js",
|
|
27
33
|
"browser": "./dist/react-resizable-panels.browser.js",
|
|
28
|
-
"node": "./dist/react-resizable-panels.
|
|
34
|
+
"node": "./dist/react-resizable-panels.edge-light.js",
|
|
29
35
|
"default": "./dist/react-resizable-panels.js"
|
|
30
36
|
},
|
|
31
37
|
"./package.json": "./package.json"
|
|
@@ -36,12 +42,15 @@
|
|
|
36
42
|
"default": "./src/env-conditions/production.ts"
|
|
37
43
|
},
|
|
38
44
|
"#is-browser": {
|
|
45
|
+
"edge-light": "./src/env-conditions/server.ts",
|
|
46
|
+
"workerd": "./src/env-conditions/server.ts",
|
|
47
|
+
"worker": "./src/env-conditions/server.ts",
|
|
39
48
|
"browser": "./src/env-conditions/browser.ts",
|
|
40
|
-
"node": "./src/env-conditions/
|
|
41
|
-
"default": "./src/env-conditions/
|
|
49
|
+
"node": "./src/env-conditions/server.ts",
|
|
50
|
+
"default": "./src/env-conditions/check-is-browser.ts"
|
|
42
51
|
}
|
|
43
52
|
},
|
|
44
|
-
"types": "dist/react-resizable-panels.
|
|
53
|
+
"types": "dist/react-resizable-panels.d.ts",
|
|
45
54
|
"devDependencies": {
|
|
46
55
|
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
|
47
56
|
"@babel/plugin-proposal-optional-chaining": "7.21.0",
|
|
@@ -51,7 +60,6 @@
|
|
|
51
60
|
"jsdom": "^26.1.0",
|
|
52
61
|
"react": "experimental",
|
|
53
62
|
"react-dom": "experimental",
|
|
54
|
-
"save-dev": "0.0.1-security",
|
|
55
63
|
"vitest": "^3.1.2"
|
|
56
64
|
},
|
|
57
65
|
"peerDependencies": {
|