react-resizable-panels 4.0.8-alpha.1 → 4.0.8
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.
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useId as
|
|
2
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
3
|
+
import { useId as Ne, useLayoutEffect as _e, useEffect as Fe, useRef as T, useCallback as ze, createContext as He, useImperativeHandle as be, useState as G, useMemo as Le, useSyncExternalStore as We, useContext as je } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
+
function H({
|
|
9
|
+
group: e
|
|
10
|
+
}) {
|
|
11
|
+
const { orientation: t, panels: n } = e;
|
|
12
|
+
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
13
|
+
}
|
|
8
14
|
function re(e, t) {
|
|
9
15
|
return t.sort(
|
|
10
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? Be : Ue
|
|
11
17
|
);
|
|
12
18
|
}
|
|
13
|
-
function
|
|
19
|
+
function Be(e, t) {
|
|
14
20
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
15
21
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
16
22
|
}
|
|
17
|
-
function
|
|
23
|
+
function Ue(e, t) {
|
|
18
24
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
19
25
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
20
26
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
}) {
|
|
24
|
-
const { orientation: t, panels: n } = e;
|
|
25
|
-
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
26
|
-
}
|
|
27
|
-
function Pe(e) {
|
|
28
|
-
const { element: t, orientation: n, panels: o, separators: r } = e, s = re(
|
|
27
|
+
function we(e) {
|
|
28
|
+
const { element: t, orientation: n, panels: o, separators: r } = e, a = re(
|
|
29
29
|
n,
|
|
30
30
|
Array.from(t.children).filter((l) => l instanceof HTMLElement).map((l) => ({ element: l }))
|
|
31
|
-
).map(({ element: l }) => l),
|
|
32
|
-
let i,
|
|
33
|
-
for (const l of
|
|
34
|
-
const
|
|
35
|
-
(
|
|
31
|
+
).map(({ element: l }) => l), u = [];
|
|
32
|
+
let i, s;
|
|
33
|
+
for (const l of a) {
|
|
34
|
+
const c = o.find(
|
|
35
|
+
(d) => d.element === l
|
|
36
36
|
);
|
|
37
|
-
if (
|
|
37
|
+
if (c) {
|
|
38
38
|
if (i) {
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const d = i.element.getBoundingClientRect(), x = l.getBoundingClientRect();
|
|
40
|
+
u.push({
|
|
41
41
|
group: e,
|
|
42
|
-
groupSize:
|
|
43
|
-
panels: [i,
|
|
44
|
-
separator:
|
|
42
|
+
groupSize: H({ group: e }),
|
|
43
|
+
panels: [i, c],
|
|
44
|
+
separator: s,
|
|
45
45
|
rect: n === "horizontal" ? new DOMRect(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
d.right,
|
|
47
|
+
x.top,
|
|
48
|
+
x.left - d.right,
|
|
49
|
+
x.height
|
|
50
50
|
) : new DOMRect(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
x.left,
|
|
52
|
+
d.bottom,
|
|
53
|
+
x.width,
|
|
54
|
+
x.top - d.bottom
|
|
55
55
|
)
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
i =
|
|
58
|
+
i = c, s = void 0;
|
|
59
59
|
} else {
|
|
60
|
-
const
|
|
61
|
-
(
|
|
60
|
+
const d = r.find(
|
|
61
|
+
(x) => x.element === l
|
|
62
62
|
);
|
|
63
|
-
|
|
63
|
+
d ? s = d : (i = void 0, s = void 0);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return u;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Ke(e, t) {
|
|
69
69
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
70
70
|
return t * o;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Ve(e, t) {
|
|
73
73
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
74
74
|
return t * o;
|
|
75
75
|
}
|
|
@@ -89,14 +89,14 @@ function qe(e) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Q({
|
|
93
93
|
groupSize: e,
|
|
94
94
|
panelElement: t,
|
|
95
95
|
styleProp: n
|
|
96
96
|
}) {
|
|
97
97
|
let o;
|
|
98
|
-
const [r,
|
|
99
|
-
switch (
|
|
98
|
+
const [r, a] = qe(n);
|
|
99
|
+
switch (a) {
|
|
100
100
|
case "%": {
|
|
101
101
|
o = r / 100 * e;
|
|
102
102
|
break;
|
|
@@ -106,11 +106,11 @@ function Z({
|
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
case "rem": {
|
|
109
|
-
o =
|
|
109
|
+
o = Ve(t, r);
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
case "em": {
|
|
113
|
-
o =
|
|
113
|
+
o = Ke(t, r);
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
case "vh": {
|
|
@@ -127,8 +127,8 @@ function Z({
|
|
|
127
127
|
function I(e) {
|
|
128
128
|
return parseFloat(e.toFixed(3));
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
const { panels: t } = e, n =
|
|
130
|
+
function pe(e) {
|
|
131
|
+
const { panels: t } = e, n = H({ group: e });
|
|
132
132
|
return n === 0 ? t.map((o) => ({
|
|
133
133
|
collapsedSize: 0,
|
|
134
134
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -137,48 +137,48 @@ function me(e) {
|
|
|
137
137
|
maxSize: 100,
|
|
138
138
|
panelId: o.id
|
|
139
139
|
})) : t.map((o) => {
|
|
140
|
-
const { element: r, panelConstraints:
|
|
141
|
-
let
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
140
|
+
const { element: r, panelConstraints: a } = o;
|
|
141
|
+
let u = 0;
|
|
142
|
+
if (a.collapsedSize) {
|
|
143
|
+
const c = Q({
|
|
144
144
|
groupSize: n,
|
|
145
145
|
panelElement: r,
|
|
146
|
-
styleProp:
|
|
146
|
+
styleProp: a.collapsedSize
|
|
147
147
|
});
|
|
148
|
-
|
|
148
|
+
u = I(c / n * 100);
|
|
149
149
|
}
|
|
150
150
|
let i;
|
|
151
|
-
if (
|
|
152
|
-
const
|
|
151
|
+
if (a.defaultSize) {
|
|
152
|
+
const c = Q({
|
|
153
153
|
groupSize: n,
|
|
154
154
|
panelElement: r,
|
|
155
|
-
styleProp:
|
|
155
|
+
styleProp: a.defaultSize
|
|
156
156
|
});
|
|
157
|
-
i = I(
|
|
157
|
+
i = I(c / n * 100);
|
|
158
158
|
}
|
|
159
|
-
let
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
159
|
+
let s = 0;
|
|
160
|
+
if (a.minSize) {
|
|
161
|
+
const c = Q({
|
|
162
162
|
groupSize: n,
|
|
163
163
|
panelElement: r,
|
|
164
|
-
styleProp:
|
|
164
|
+
styleProp: a.minSize
|
|
165
165
|
});
|
|
166
|
-
|
|
166
|
+
s = I(c / n * 100);
|
|
167
167
|
}
|
|
168
168
|
let l = 100;
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
169
|
+
if (a.maxSize) {
|
|
170
|
+
const c = Q({
|
|
171
171
|
groupSize: n,
|
|
172
172
|
panelElement: r,
|
|
173
|
-
styleProp:
|
|
173
|
+
styleProp: a.maxSize
|
|
174
174
|
});
|
|
175
|
-
l = I(
|
|
175
|
+
l = I(c / n * 100);
|
|
176
176
|
}
|
|
177
177
|
return {
|
|
178
|
-
collapsedSize:
|
|
179
|
-
collapsible:
|
|
178
|
+
collapsedSize: u,
|
|
179
|
+
collapsible: a.collapsible === !0,
|
|
180
180
|
defaultSize: i,
|
|
181
|
-
minSize:
|
|
181
|
+
minSize: s,
|
|
182
182
|
maxSize: l,
|
|
183
183
|
panelId: o.id
|
|
184
184
|
};
|
|
@@ -198,18 +198,18 @@ class Ze {
|
|
|
198
198
|
if (o.length === 1)
|
|
199
199
|
o[0].call(null, n);
|
|
200
200
|
else {
|
|
201
|
-
let r = !1,
|
|
202
|
-
const
|
|
203
|
-
for (let i = 0; i <
|
|
204
|
-
const
|
|
201
|
+
let r = !1, a = null;
|
|
202
|
+
const u = Array.from(o);
|
|
203
|
+
for (let i = 0; i < u.length; i++) {
|
|
204
|
+
const s = u[i];
|
|
205
205
|
try {
|
|
206
|
-
|
|
206
|
+
s.call(null, n);
|
|
207
207
|
} catch (l) {
|
|
208
|
-
|
|
208
|
+
a === null && (r = !0, a = l);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
if (r)
|
|
212
|
-
throw
|
|
212
|
+
throw a;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
removeAllListeners() {
|
|
@@ -223,7 +223,7 @@ class Ze {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function P(e, t, n = 0) {
|
|
227
227
|
return Math.abs(I(e) - I(t)) <= n;
|
|
228
228
|
}
|
|
229
229
|
let R = {
|
|
@@ -246,25 +246,25 @@ function C(e) {
|
|
|
246
246
|
...R,
|
|
247
247
|
...t
|
|
248
248
|
}, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange", R.cursorFlags), t.interactionState !== void 0 && A.emit("interactionStateChange", R.interactionState), t.mountedGroups !== void 0 && (R.mountedGroups.forEach((o, r) => {
|
|
249
|
-
o.derivedPanelConstraints.forEach((
|
|
250
|
-
if (
|
|
251
|
-
const { layout:
|
|
252
|
-
if (
|
|
253
|
-
const i =
|
|
254
|
-
|
|
255
|
-
o.layout[
|
|
256
|
-
),
|
|
257
|
-
|
|
258
|
-
|
|
249
|
+
o.derivedPanelConstraints.forEach((a) => {
|
|
250
|
+
if (a.collapsible) {
|
|
251
|
+
const { layout: u } = n.mountedGroups.get(r) ?? {};
|
|
252
|
+
if (u) {
|
|
253
|
+
const i = P(
|
|
254
|
+
a.collapsedSize,
|
|
255
|
+
o.layout[a.panelId]
|
|
256
|
+
), s = P(
|
|
257
|
+
a.collapsedSize,
|
|
258
|
+
u[a.panelId]
|
|
259
259
|
);
|
|
260
|
-
i && !
|
|
260
|
+
i && !s && (r.inMemoryLastExpandedPanelSizes[a.panelId] = u[a.panelId]);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
}), A.emit("mountedGroupsChange", R.mountedGroups)), R;
|
|
265
265
|
}
|
|
266
266
|
const Je = (e) => e, ie = () => {
|
|
267
|
-
},
|
|
267
|
+
}, Pe = 1, Ee = 2, Re = 4, Ce = 8, me = {
|
|
268
268
|
coarse: 10,
|
|
269
269
|
precise: 5
|
|
270
270
|
};
|
|
@@ -277,9 +277,9 @@ function Qe({
|
|
|
277
277
|
switch (n) {
|
|
278
278
|
case "active":
|
|
279
279
|
case "hover":
|
|
280
|
-
t.forEach((
|
|
281
|
-
if (!
|
|
282
|
-
switch (
|
|
280
|
+
t.forEach((a) => {
|
|
281
|
+
if (!a.disableCursor)
|
|
282
|
+
switch (a.orientation) {
|
|
283
283
|
case "horizontal": {
|
|
284
284
|
o++;
|
|
285
285
|
break;
|
|
@@ -295,15 +295,15 @@ function Qe({
|
|
|
295
295
|
return null;
|
|
296
296
|
switch (n) {
|
|
297
297
|
case "active": {
|
|
298
|
-
const
|
|
298
|
+
const a = (e & Pe) !== 0, u = (e & Ee) !== 0, i = (e & Re) !== 0, s = (e & Ce) !== 0;
|
|
299
299
|
if (e) {
|
|
300
|
-
if (
|
|
301
|
-
return i ? "se-resize" :
|
|
302
|
-
if (
|
|
303
|
-
return i ? "sw-resize" :
|
|
300
|
+
if (a)
|
|
301
|
+
return i ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
302
|
+
if (u)
|
|
303
|
+
return i ? "sw-resize" : s ? "nw-resize" : "w-resize";
|
|
304
304
|
if (i)
|
|
305
305
|
return "s-resize";
|
|
306
|
-
if (
|
|
306
|
+
if (s)
|
|
307
307
|
return "n-resize";
|
|
308
308
|
}
|
|
309
309
|
break;
|
|
@@ -342,8 +342,8 @@ function et(e, t) {
|
|
|
342
342
|
return !1;
|
|
343
343
|
return !0;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
345
|
+
function U(e, t) {
|
|
346
|
+
return P(e, t) ? 0 : e > t ? 1 : -1;
|
|
347
347
|
}
|
|
348
348
|
function F({
|
|
349
349
|
panelConstraints: e,
|
|
@@ -353,215 +353,215 @@ function F({
|
|
|
353
353
|
collapsedSize: n = 0,
|
|
354
354
|
collapsible: o,
|
|
355
355
|
maxSize: r = 100,
|
|
356
|
-
minSize:
|
|
356
|
+
minSize: a = 0
|
|
357
357
|
} = e;
|
|
358
|
-
if (
|
|
358
|
+
if (U(t, a) < 0)
|
|
359
359
|
if (o) {
|
|
360
|
-
const
|
|
361
|
-
|
|
360
|
+
const u = (n + a) / 2;
|
|
361
|
+
U(t, u) < 0 ? t = n : t = a;
|
|
362
362
|
} else
|
|
363
|
-
t =
|
|
363
|
+
t = a;
|
|
364
364
|
return t = Math.min(r, t), t = I(t), t;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function K({
|
|
367
367
|
delta: e,
|
|
368
368
|
initialLayout: t,
|
|
369
369
|
panelConstraints: n,
|
|
370
370
|
pivotIndices: o,
|
|
371
371
|
prevLayout: r,
|
|
372
|
-
trigger:
|
|
372
|
+
trigger: a
|
|
373
373
|
}) {
|
|
374
|
-
if (
|
|
374
|
+
if (P(e, 0))
|
|
375
375
|
return t;
|
|
376
|
-
const
|
|
377
|
-
z(l != null, "Invalid first pivot index"), z(
|
|
378
|
-
let
|
|
379
|
-
if (
|
|
376
|
+
const u = Object.values(t), i = Object.values(r), s = [...u], [l, c] = o;
|
|
377
|
+
z(l != null, "Invalid first pivot index"), z(c != null, "Invalid second pivot index");
|
|
378
|
+
let d = 0;
|
|
379
|
+
if (a === "keyboard") {
|
|
380
380
|
{
|
|
381
|
-
const
|
|
381
|
+
const f = e < 0 ? c : l, p = n[f];
|
|
382
382
|
z(
|
|
383
383
|
p,
|
|
384
|
-
`Panel constraints not found for index ${
|
|
384
|
+
`Panel constraints not found for index ${f}`
|
|
385
385
|
);
|
|
386
386
|
const {
|
|
387
|
-
collapsedSize:
|
|
388
|
-
collapsible:
|
|
389
|
-
minSize:
|
|
387
|
+
collapsedSize: h = 0,
|
|
388
|
+
collapsible: g,
|
|
389
|
+
minSize: S = 0
|
|
390
390
|
} = p;
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
391
|
+
if (g) {
|
|
392
|
+
const y = u[f];
|
|
393
393
|
if (z(
|
|
394
|
-
|
|
395
|
-
`Previous layout not found for panel index ${
|
|
396
|
-
),
|
|
397
|
-
const
|
|
398
|
-
|
|
394
|
+
y != null,
|
|
395
|
+
`Previous layout not found for panel index ${f}`
|
|
396
|
+
), P(y, h)) {
|
|
397
|
+
const v = S - y;
|
|
398
|
+
U(v, Math.abs(e)) > 0 && (e = e < 0 ? 0 - v : v);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
{
|
|
403
|
-
const
|
|
403
|
+
const f = e < 0 ? l : c, p = n[f];
|
|
404
404
|
z(
|
|
405
405
|
p,
|
|
406
|
-
`No panel constraints found for index ${
|
|
406
|
+
`No panel constraints found for index ${f}`
|
|
407
407
|
);
|
|
408
408
|
const {
|
|
409
|
-
collapsedSize:
|
|
410
|
-
collapsible:
|
|
411
|
-
minSize:
|
|
409
|
+
collapsedSize: h = 0,
|
|
410
|
+
collapsible: g,
|
|
411
|
+
minSize: S = 0
|
|
412
412
|
} = p;
|
|
413
|
-
if (
|
|
414
|
-
const
|
|
413
|
+
if (g) {
|
|
414
|
+
const y = u[f];
|
|
415
415
|
if (z(
|
|
416
|
-
|
|
417
|
-
`Previous layout not found for panel index ${
|
|
418
|
-
),
|
|
419
|
-
const
|
|
420
|
-
|
|
416
|
+
y != null,
|
|
417
|
+
`Previous layout not found for panel index ${f}`
|
|
418
|
+
), P(y, S)) {
|
|
419
|
+
const v = y - h;
|
|
420
|
+
U(v, Math.abs(e)) > 0 && (e = e < 0 ? 0 - v : v);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
{
|
|
426
|
-
const
|
|
427
|
-
let p = e < 0 ?
|
|
426
|
+
const f = e < 0 ? 1 : -1;
|
|
427
|
+
let p = e < 0 ? c : l, h = 0;
|
|
428
428
|
for (; ; ) {
|
|
429
|
-
const
|
|
429
|
+
const S = u[p];
|
|
430
430
|
z(
|
|
431
|
-
|
|
431
|
+
S != null,
|
|
432
432
|
`Previous layout not found for panel index ${p}`
|
|
433
433
|
);
|
|
434
|
-
const
|
|
434
|
+
const v = F({
|
|
435
435
|
panelConstraints: n[p],
|
|
436
436
|
size: 100
|
|
437
|
-
}) -
|
|
438
|
-
if (
|
|
437
|
+
}) - S;
|
|
438
|
+
if (h += v, p += f, p < 0 || p >= n.length)
|
|
439
439
|
break;
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
e = e < 0 ? 0 -
|
|
441
|
+
const g = Math.min(Math.abs(e), Math.abs(h));
|
|
442
|
+
e = e < 0 ? 0 - g : g;
|
|
443
443
|
}
|
|
444
444
|
{
|
|
445
|
-
let p = e < 0 ? l :
|
|
445
|
+
let p = e < 0 ? l : c;
|
|
446
446
|
for (; p >= 0 && p < n.length; ) {
|
|
447
|
-
const
|
|
447
|
+
const h = Math.abs(e) - Math.abs(d), g = u[p];
|
|
448
448
|
z(
|
|
449
|
-
|
|
449
|
+
g != null,
|
|
450
450
|
`Previous layout not found for panel index ${p}`
|
|
451
451
|
);
|
|
452
|
-
const
|
|
452
|
+
const S = g - h, y = F({
|
|
453
453
|
panelConstraints: n[p],
|
|
454
|
-
size:
|
|
454
|
+
size: S
|
|
455
455
|
});
|
|
456
|
-
if (!
|
|
456
|
+
if (!P(g, y) && (d += g - y, s[p] = y, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
457
457
|
numeric: !0
|
|
458
458
|
}) >= 0))
|
|
459
459
|
break;
|
|
460
460
|
e < 0 ? p-- : p++;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
if (et(i,
|
|
463
|
+
if (et(i, s))
|
|
464
464
|
return r;
|
|
465
465
|
{
|
|
466
|
-
const
|
|
466
|
+
const f = e < 0 ? c : l, p = u[f];
|
|
467
467
|
z(
|
|
468
468
|
p != null,
|
|
469
|
-
`Previous layout not found for panel index ${
|
|
469
|
+
`Previous layout not found for panel index ${f}`
|
|
470
470
|
);
|
|
471
|
-
const
|
|
472
|
-
panelConstraints: n[
|
|
473
|
-
size:
|
|
471
|
+
const h = p + d, g = F({
|
|
472
|
+
panelConstraints: n[f],
|
|
473
|
+
size: h
|
|
474
474
|
});
|
|
475
|
-
if (
|
|
476
|
-
let
|
|
477
|
-
for (;
|
|
478
|
-
const L =
|
|
475
|
+
if (s[f] = g, !P(g, h)) {
|
|
476
|
+
let S = h - g, v = e < 0 ? c : l;
|
|
477
|
+
for (; v >= 0 && v < n.length; ) {
|
|
478
|
+
const L = s[v];
|
|
479
479
|
z(
|
|
480
480
|
L != null,
|
|
481
|
-
`Previous layout not found for panel index ${
|
|
481
|
+
`Previous layout not found for panel index ${v}`
|
|
482
482
|
);
|
|
483
|
-
const
|
|
484
|
-
panelConstraints: n[
|
|
485
|
-
size:
|
|
483
|
+
const w = L + S, E = F({
|
|
484
|
+
panelConstraints: n[v],
|
|
485
|
+
size: w
|
|
486
486
|
});
|
|
487
|
-
if (
|
|
487
|
+
if (P(L, E) || (S -= E - L, s[v] = E), P(S, 0))
|
|
488
488
|
break;
|
|
489
|
-
e > 0 ?
|
|
489
|
+
e > 0 ? v-- : v++;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
(
|
|
493
|
+
const x = Object.values(s).reduce(
|
|
494
|
+
(f, p) => p + f,
|
|
495
495
|
0
|
|
496
496
|
);
|
|
497
|
-
if (!
|
|
497
|
+
if (!P(x, 100, 0.1))
|
|
498
498
|
return r;
|
|
499
|
-
const
|
|
500
|
-
return
|
|
499
|
+
const m = Object.keys(r);
|
|
500
|
+
return s.reduce((f, p, h) => (f[m[h]] = p, f), {});
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function W(e, t) {
|
|
503
503
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
504
504
|
return !1;
|
|
505
505
|
for (const n in e)
|
|
506
|
-
if (
|
|
506
|
+
if (U(e[n], t[n]) !== 0)
|
|
507
507
|
return !1;
|
|
508
508
|
return !0;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Me({
|
|
511
511
|
event: e,
|
|
512
512
|
hitRegions: t,
|
|
513
513
|
initialLayoutMap: n,
|
|
514
514
|
mountedGroups: o,
|
|
515
515
|
pointerDownAtPoint: r
|
|
516
516
|
}) {
|
|
517
|
-
let
|
|
518
|
-
const
|
|
517
|
+
let a = 0;
|
|
518
|
+
const u = new Map(o);
|
|
519
519
|
t.forEach((i) => {
|
|
520
|
-
const { group:
|
|
521
|
-
let
|
|
522
|
-
r ?
|
|
523
|
-
const
|
|
520
|
+
const { group: s, groupSize: l } = i, { disableCursor: c, orientation: d, panels: x } = s;
|
|
521
|
+
let m = 0;
|
|
522
|
+
r ? d === "horizontal" ? m = (e.clientX - r.x) / l * 100 : m = (e.clientY - r.y) / l * 100 : d === "horizontal" ? m = e.clientX < 0 ? -100 : 100 : m = e.clientY < 0 ? -100 : 100;
|
|
523
|
+
const f = n.get(s), {
|
|
524
524
|
derivedPanelConstraints: p,
|
|
525
|
-
layout:
|
|
526
|
-
separatorToPanels:
|
|
527
|
-
} = o.get(
|
|
528
|
-
if (p &&
|
|
529
|
-
const
|
|
530
|
-
delta:
|
|
531
|
-
initialLayout:
|
|
525
|
+
layout: h,
|
|
526
|
+
separatorToPanels: g
|
|
527
|
+
} = o.get(s) ?? {};
|
|
528
|
+
if (p && f && h && g) {
|
|
529
|
+
const S = K({
|
|
530
|
+
delta: m,
|
|
531
|
+
initialLayout: f,
|
|
532
532
|
panelConstraints: p,
|
|
533
|
-
pivotIndices: i.panels.map((
|
|
534
|
-
prevLayout:
|
|
533
|
+
pivotIndices: i.panels.map((y) => x.indexOf(y)),
|
|
534
|
+
prevLayout: h,
|
|
535
535
|
trigger: "mouse-or-touch"
|
|
536
536
|
});
|
|
537
|
-
if (
|
|
538
|
-
if (
|
|
539
|
-
switch (
|
|
537
|
+
if (W(S, h)) {
|
|
538
|
+
if (m !== 0 && !c)
|
|
539
|
+
switch (d) {
|
|
540
540
|
case "horizontal": {
|
|
541
|
-
|
|
541
|
+
a |= m < 0 ? Pe : Ee;
|
|
542
542
|
break;
|
|
543
543
|
}
|
|
544
544
|
case "vertical": {
|
|
545
|
-
|
|
545
|
+
a |= m < 0 ? Re : Ce;
|
|
546
546
|
break;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
} else {
|
|
550
|
-
|
|
550
|
+
u.set(i.group, {
|
|
551
551
|
derivedPanelConstraints: p,
|
|
552
|
-
layout:
|
|
553
|
-
separatorToPanels:
|
|
552
|
+
layout: S,
|
|
553
|
+
separatorToPanels: g
|
|
554
554
|
});
|
|
555
|
-
const
|
|
556
|
-
i.group.inMemoryLayouts[
|
|
555
|
+
const y = i.group.panels.map(({ id: v }) => v).join(",");
|
|
556
|
+
i.group.inMemoryLayouts[y] = S;
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
}), C({
|
|
560
|
-
cursorFlags:
|
|
561
|
-
mountedGroups:
|
|
560
|
+
cursorFlags: a,
|
|
561
|
+
mountedGroups: u
|
|
562
562
|
}), le();
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function he(e) {
|
|
565
565
|
if (e.defaultPrevented)
|
|
566
566
|
return;
|
|
567
567
|
if (e.relatedTarget !== null)
|
|
@@ -572,7 +572,7 @@ function ve(e) {
|
|
|
572
572
|
switch (t.state) {
|
|
573
573
|
case "active":
|
|
574
574
|
t.hitRegions.forEach((o) => {
|
|
575
|
-
e.currentTarget === o.group.element &&
|
|
575
|
+
e.currentTarget === o.group.element && Me({
|
|
576
576
|
event: e,
|
|
577
577
|
hitRegions: t.hitRegions,
|
|
578
578
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -581,7 +581,7 @@ function ve(e) {
|
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function te(e) {
|
|
585
585
|
const t = e.parentElement;
|
|
586
586
|
z(t, "Parent group element not found");
|
|
587
587
|
const { mountedGroups: n } = O();
|
|
@@ -595,45 +595,45 @@ function $({
|
|
|
595
595
|
panelConstraints: t
|
|
596
596
|
}) {
|
|
597
597
|
const o = [...Object.values(e)], r = o.reduce(
|
|
598
|
-
(i,
|
|
598
|
+
(i, s) => i + s,
|
|
599
599
|
0
|
|
600
600
|
);
|
|
601
601
|
if (o.length !== t.length)
|
|
602
602
|
throw Error(
|
|
603
603
|
`Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
|
|
604
604
|
);
|
|
605
|
-
if (!
|
|
605
|
+
if (!P(r, 100) && o.length > 0)
|
|
606
606
|
for (let i = 0; i < t.length; i++) {
|
|
607
|
-
const
|
|
608
|
-
z(
|
|
609
|
-
const l = 100 / r *
|
|
607
|
+
const s = o[i];
|
|
608
|
+
z(s != null, `No layout data found for index ${i}`);
|
|
609
|
+
const l = 100 / r * s;
|
|
610
610
|
o[i] = l;
|
|
611
611
|
}
|
|
612
|
-
let
|
|
612
|
+
let a = 0;
|
|
613
613
|
for (let i = 0; i < t.length; i++) {
|
|
614
|
-
const
|
|
615
|
-
z(
|
|
614
|
+
const s = o[i];
|
|
615
|
+
z(s != null, `No layout data found for index ${i}`);
|
|
616
616
|
const l = F({
|
|
617
617
|
panelConstraints: t[i],
|
|
618
|
-
size:
|
|
618
|
+
size: s
|
|
619
619
|
});
|
|
620
|
-
|
|
620
|
+
s != l && (a += s - l, o[i] = l);
|
|
621
621
|
}
|
|
622
|
-
if (!
|
|
622
|
+
if (!P(a, 0))
|
|
623
623
|
for (let i = 0; i < t.length; i++) {
|
|
624
|
-
const
|
|
625
|
-
z(
|
|
626
|
-
const l =
|
|
624
|
+
const s = o[i];
|
|
625
|
+
z(s != null, `No layout data found for index ${i}`);
|
|
626
|
+
const l = s + a, c = F({
|
|
627
627
|
panelConstraints: t[i],
|
|
628
628
|
size: l
|
|
629
629
|
});
|
|
630
|
-
if (
|
|
630
|
+
if (s !== c && (a -= c - s, o[i] = c, P(a, 0)))
|
|
631
631
|
break;
|
|
632
632
|
}
|
|
633
|
-
const
|
|
634
|
-
return o.reduce((i,
|
|
633
|
+
const u = Object.keys(e);
|
|
634
|
+
return o.reduce((i, s, l) => (i[u[l]] = s, i), {});
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function Ge({
|
|
637
637
|
groupId: e
|
|
638
638
|
}) {
|
|
639
639
|
const t = () => {
|
|
@@ -652,56 +652,56 @@ function Ie({
|
|
|
652
652
|
const {
|
|
653
653
|
derivedPanelConstraints: o,
|
|
654
654
|
group: r,
|
|
655
|
-
layout:
|
|
656
|
-
separatorToPanels:
|
|
655
|
+
layout: a,
|
|
656
|
+
separatorToPanels: u
|
|
657
657
|
} = t(), i = $({
|
|
658
658
|
layout: n,
|
|
659
659
|
panelConstraints: o
|
|
660
660
|
});
|
|
661
|
-
return
|
|
662
|
-
mountedGroups: new Map(
|
|
661
|
+
return W(a, i) || C((s) => ({
|
|
662
|
+
mountedGroups: new Map(s.mountedGroups).set(r, {
|
|
663
663
|
derivedPanelConstraints: o,
|
|
664
664
|
layout: i,
|
|
665
|
-
separatorToPanels:
|
|
665
|
+
separatorToPanels: u
|
|
666
666
|
})
|
|
667
667
|
})), i;
|
|
668
668
|
}
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function Ie(e) {
|
|
672
672
|
const { mountedGroups: t } = O(), n = t.get(e);
|
|
673
673
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
674
674
|
}
|
|
675
675
|
function D(e, t) {
|
|
676
|
-
const n =
|
|
677
|
-
(
|
|
676
|
+
const n = te(e), o = Ie(n), r = n.separators.find(
|
|
677
|
+
(d) => d.element === e
|
|
678
678
|
);
|
|
679
679
|
z(r, "Matching separator not found");
|
|
680
|
-
const
|
|
681
|
-
z(
|
|
682
|
-
const
|
|
680
|
+
const a = o.separatorToPanels.get(r);
|
|
681
|
+
z(a, "Matching panels not found");
|
|
682
|
+
const u = a.map((d) => n.panels.indexOf(d)), s = Ge({ groupId: n.id }).getLayout(), l = K({
|
|
683
683
|
delta: t,
|
|
684
|
-
initialLayout:
|
|
684
|
+
initialLayout: s,
|
|
685
685
|
panelConstraints: o.derivedPanelConstraints,
|
|
686
|
-
pivotIndices:
|
|
687
|
-
prevLayout:
|
|
686
|
+
pivotIndices: u,
|
|
687
|
+
prevLayout: s,
|
|
688
688
|
trigger: "keyboard"
|
|
689
|
-
}),
|
|
689
|
+
}), c = $({
|
|
690
690
|
layout: l,
|
|
691
691
|
panelConstraints: o.derivedPanelConstraints
|
|
692
692
|
});
|
|
693
|
-
|
|
694
|
-
mountedGroups: new Map(
|
|
693
|
+
W(s, c) || C((d) => ({
|
|
694
|
+
mountedGroups: new Map(d.mountedGroups).set(n, {
|
|
695
695
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
696
|
-
layout:
|
|
696
|
+
layout: c,
|
|
697
697
|
separatorToPanels: o.separatorToPanels
|
|
698
698
|
})
|
|
699
699
|
}));
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function ve(e) {
|
|
702
702
|
if (e.defaultPrevented)
|
|
703
703
|
return;
|
|
704
|
-
const t = e.currentTarget, n =
|
|
704
|
+
const t = e.currentTarget, n = te(t);
|
|
705
705
|
if (!n.disabled)
|
|
706
706
|
switch (e.key) {
|
|
707
707
|
case "ArrowDown": {
|
|
@@ -726,31 +726,31 @@ function ye(e) {
|
|
|
726
726
|
}
|
|
727
727
|
case "Enter": {
|
|
728
728
|
e.preventDefault();
|
|
729
|
-
const o =
|
|
730
|
-
(
|
|
729
|
+
const o = te(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: u } = Ie(o), i = o.separators.find(
|
|
730
|
+
(d) => d.element === t
|
|
731
731
|
);
|
|
732
732
|
z(i, "Matching separator not found");
|
|
733
|
-
const
|
|
734
|
-
z(
|
|
735
|
-
const l =
|
|
736
|
-
(
|
|
733
|
+
const s = u.get(i);
|
|
734
|
+
z(s, "Matching panels not found");
|
|
735
|
+
const l = s[0], c = r.find(
|
|
736
|
+
(d) => d.panelId === l.id
|
|
737
737
|
);
|
|
738
|
-
if (z(
|
|
739
|
-
const
|
|
740
|
-
D(t,
|
|
738
|
+
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
739
|
+
const d = a[l.id], x = c.collapsedSize === d ? o.inMemoryLastExpandedPanelSizes[l.id] ?? c.minSize : c.collapsedSize;
|
|
740
|
+
D(t, x - d);
|
|
741
741
|
}
|
|
742
742
|
break;
|
|
743
743
|
}
|
|
744
744
|
case "F6": {
|
|
745
745
|
e.preventDefault();
|
|
746
|
-
const r =
|
|
747
|
-
(
|
|
748
|
-
),
|
|
749
|
-
(
|
|
746
|
+
const r = te(t).separators.map(
|
|
747
|
+
(s) => s.element
|
|
748
|
+
), a = Array.from(r).findIndex(
|
|
749
|
+
(s) => s === e.currentTarget
|
|
750
750
|
);
|
|
751
|
-
z(
|
|
752
|
-
const
|
|
753
|
-
r[
|
|
751
|
+
z(a !== null, "Index not found");
|
|
752
|
+
const u = e.shiftKey ? a > 0 ? a - 1 : r.length - 1 : a + 1 < r.length ? a + 1 : 0;
|
|
753
|
+
r[u].focus();
|
|
754
754
|
break;
|
|
755
755
|
}
|
|
756
756
|
case "Home": {
|
|
@@ -776,15 +776,15 @@ function nt(e, t, n) {
|
|
|
776
776
|
x: 1 / 0,
|
|
777
777
|
y: 1 / 0
|
|
778
778
|
};
|
|
779
|
-
for (const
|
|
780
|
-
const
|
|
779
|
+
for (const a of t) {
|
|
780
|
+
const u = tt(n, a.rect);
|
|
781
781
|
switch (e) {
|
|
782
782
|
case "horizontal": {
|
|
783
|
-
|
|
783
|
+
u.x <= r.x && (o = a, r = u);
|
|
784
784
|
break;
|
|
785
785
|
}
|
|
786
786
|
case "vertical": {
|
|
787
|
-
|
|
787
|
+
u.y <= r.y && (o = a, r = u);
|
|
788
788
|
break;
|
|
789
789
|
}
|
|
790
790
|
}
|
|
@@ -794,43 +794,43 @@ function nt(e, t, n) {
|
|
|
794
794
|
hitRegion: o
|
|
795
795
|
} : void 0;
|
|
796
796
|
}
|
|
797
|
-
let
|
|
797
|
+
let ee;
|
|
798
798
|
function ot() {
|
|
799
|
-
return
|
|
799
|
+
return ee === void 0 && (typeof matchMedia == "function" ? ee = !!matchMedia("(pointer:coarse)").matches : ee = !1), ee;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function ke(e, t) {
|
|
802
802
|
const n = [];
|
|
803
803
|
return t.forEach((o, r) => {
|
|
804
804
|
if (r.disabled)
|
|
805
805
|
return;
|
|
806
|
-
const
|
|
806
|
+
const a = ot() ? me.coarse : me.precise, u = we(r), i = nt(r.orientation, u, {
|
|
807
807
|
x: e.clientX,
|
|
808
808
|
y: e.clientY
|
|
809
809
|
});
|
|
810
|
-
i && i.distance.x <=
|
|
810
|
+
i && i.distance.x <= a && i.distance.y <= a && n.push(i.hitRegion);
|
|
811
811
|
}), n;
|
|
812
812
|
}
|
|
813
813
|
function ge(e) {
|
|
814
814
|
if (e.defaultPrevented)
|
|
815
815
|
return;
|
|
816
|
-
const { mountedGroups: t } = O(), n =
|
|
816
|
+
const { mountedGroups: t } = O(), n = ke(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
|
|
817
817
|
let i = !1;
|
|
818
|
-
n.forEach((
|
|
819
|
-
o.add(
|
|
820
|
-
r.add(
|
|
821
|
-
}),
|
|
822
|
-
const l = t.get(
|
|
823
|
-
l &&
|
|
818
|
+
n.forEach((s) => {
|
|
819
|
+
o.add(s.group), s.panels.forEach((c) => {
|
|
820
|
+
r.add(c);
|
|
821
|
+
}), s.separator && (a.add(s.separator), i || (i = !0, s.separator.element.focus()));
|
|
822
|
+
const l = t.get(s.group);
|
|
823
|
+
l && u.set(s.group, l.layout);
|
|
824
824
|
}), C({
|
|
825
825
|
interactionState: {
|
|
826
826
|
hitRegions: n,
|
|
827
|
-
initialLayoutMap:
|
|
827
|
+
initialLayoutMap: u,
|
|
828
828
|
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
829
829
|
state: "active"
|
|
830
830
|
}
|
|
831
831
|
}), n.length && e.preventDefault();
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function ye(e) {
|
|
834
834
|
if (e.defaultPrevented)
|
|
835
835
|
return;
|
|
836
836
|
const { interactionState: t, mountedGroups: n } = O();
|
|
@@ -850,7 +850,7 @@ function Se(e) {
|
|
|
850
850
|
);
|
|
851
851
|
return;
|
|
852
852
|
}
|
|
853
|
-
|
|
853
|
+
Me({
|
|
854
854
|
event: e,
|
|
855
855
|
hitRegions: t.hitRegions,
|
|
856
856
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -860,7 +860,7 @@ function Se(e) {
|
|
|
860
860
|
break;
|
|
861
861
|
}
|
|
862
862
|
default: {
|
|
863
|
-
const o =
|
|
863
|
+
const o = ke(e, n);
|
|
864
864
|
o.length === 0 ? t.state !== "inactive" && C({
|
|
865
865
|
interactionState: { state: "inactive" }
|
|
866
866
|
}) : C({
|
|
@@ -873,7 +873,7 @@ function Se(e) {
|
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Se(e) {
|
|
877
877
|
if (e.defaultPrevented)
|
|
878
878
|
return;
|
|
879
879
|
e.preventDefault();
|
|
@@ -888,117 +888,128 @@ function xe(e) {
|
|
|
888
888
|
}), le();
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function xe(e) {
|
|
892
892
|
let t = 0, n = 0;
|
|
893
893
|
const o = {};
|
|
894
|
-
for (const
|
|
895
|
-
if (
|
|
894
|
+
for (const a of e)
|
|
895
|
+
if (a.defaultSize !== void 0) {
|
|
896
896
|
t++;
|
|
897
|
-
const
|
|
898
|
-
n +=
|
|
897
|
+
const u = I(a.defaultSize);
|
|
898
|
+
n += u, o[a.panelId] = u;
|
|
899
899
|
} else
|
|
900
|
-
o[
|
|
900
|
+
o[a.panelId] = void 0;
|
|
901
901
|
const r = e.length - t;
|
|
902
902
|
if (r !== 0) {
|
|
903
|
-
const
|
|
904
|
-
for (const
|
|
905
|
-
|
|
903
|
+
const a = I((100 - n) / r);
|
|
904
|
+
for (const u of e)
|
|
905
|
+
u.defaultSize === void 0 && (o[u.panelId] = a);
|
|
906
906
|
}
|
|
907
907
|
return o;
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function it(e, t, n) {
|
|
910
910
|
const o = n[0];
|
|
911
911
|
if (!o)
|
|
912
912
|
return;
|
|
913
|
-
const r = e.panels.find((
|
|
913
|
+
const r = e.panels.find((u) => u.element === t);
|
|
914
914
|
if (!r || !r.onResize)
|
|
915
915
|
return;
|
|
916
|
-
const
|
|
916
|
+
const a = H({ group: e });
|
|
917
917
|
r.onResize(
|
|
918
918
|
{
|
|
919
919
|
asPercentage: I(
|
|
920
|
-
o.inlineSize /
|
|
920
|
+
o.inlineSize / a * 100
|
|
921
921
|
),
|
|
922
922
|
inPixels: o.inlineSize
|
|
923
923
|
},
|
|
924
924
|
r.id
|
|
925
925
|
);
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function st(e) {
|
|
928
928
|
let t = !0;
|
|
929
929
|
z(
|
|
930
930
|
e.separators.length === 0 || e.separators.length < e.panels.length,
|
|
931
931
|
"Invalid Group configuration; too many Separator components"
|
|
932
932
|
);
|
|
933
|
-
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((
|
|
934
|
-
for (const
|
|
935
|
-
const { borderBoxSize:
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
933
|
+
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((m) => {
|
|
934
|
+
for (const f of m) {
|
|
935
|
+
const { borderBoxSize: p, target: h } = f;
|
|
936
|
+
if (h === e.element) {
|
|
937
|
+
if (t) {
|
|
938
|
+
if (H({ group: e }) === 0)
|
|
939
|
+
return;
|
|
940
|
+
C((S) => {
|
|
941
|
+
const y = S.mountedGroups.get(e);
|
|
942
|
+
if (y) {
|
|
943
|
+
const v = pe(e), L = y.defaultLayoutDeferred ? xe(v) : y.layout, w = $({
|
|
944
|
+
layout: L,
|
|
945
|
+
panelConstraints: v
|
|
946
|
+
});
|
|
947
|
+
return !y.defaultLayoutDeferred && W(L, w) ? S : {
|
|
948
|
+
mountedGroups: new Map(S.mountedGroups).set(e, {
|
|
949
|
+
derivedPanelConstraints: v,
|
|
950
|
+
layout: w,
|
|
951
|
+
separatorToPanels: y.separatorToPanels
|
|
952
|
+
})
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
return S;
|
|
942
956
|
});
|
|
943
|
-
return {
|
|
944
|
-
mountedGroups: new Map(p.mountedGroups).set(e, {
|
|
945
|
-
derivedPanelConstraints: m,
|
|
946
|
-
layout: S,
|
|
947
|
-
separatorToPanels: v.separatorToPanels
|
|
948
|
-
})
|
|
949
|
-
};
|
|
950
957
|
}
|
|
951
|
-
|
|
952
|
-
|
|
958
|
+
} else
|
|
959
|
+
it(e, h, p);
|
|
953
960
|
}
|
|
954
961
|
});
|
|
955
|
-
r.observe(e.element), e.panels.forEach((
|
|
962
|
+
r.observe(e.element), e.panels.forEach((m) => {
|
|
956
963
|
z(
|
|
957
|
-
!n.has(
|
|
958
|
-
`Panel ids must be unique; id "${
|
|
959
|
-
), n.add(
|
|
964
|
+
!n.has(m.id),
|
|
965
|
+
`Panel ids must be unique; id "${m.id}" was used more than once`
|
|
966
|
+
), n.add(m.id), m.onResize && r.observe(m.element);
|
|
960
967
|
});
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
+
const a = H({ group: e }), u = pe(e), i = e.panels.map(({ id: m }) => m).join(",");
|
|
969
|
+
let s = e.defaultLayout;
|
|
970
|
+
s && e.panels.length !== Object.keys(s).length && (s = void 0);
|
|
971
|
+
const l = e.inMemoryLayouts[i] ?? s ?? xe(u), c = $({
|
|
972
|
+
layout: l,
|
|
973
|
+
panelConstraints: u
|
|
974
|
+
}), d = we(e), x = C((m) => ({
|
|
975
|
+
mountedGroups: new Map(m.mountedGroups).set(e, {
|
|
976
|
+
defaultLayoutDeferred: a === 0,
|
|
977
|
+
derivedPanelConstraints: u,
|
|
978
|
+
layout: c,
|
|
968
979
|
separatorToPanels: new Map(
|
|
969
|
-
|
|
980
|
+
d.filter((f) => f.separator).map((f) => [f.separator, f.panels])
|
|
970
981
|
)
|
|
971
982
|
})
|
|
972
983
|
}));
|
|
973
|
-
return e.element.addEventListener("pointerleave",
|
|
984
|
+
return e.element.addEventListener("pointerleave", he), e.separators.forEach((m) => {
|
|
974
985
|
z(
|
|
975
|
-
!o.has(
|
|
976
|
-
`Separator ids must be unique; id "${
|
|
977
|
-
), o.add(
|
|
978
|
-
}),
|
|
986
|
+
!o.has(m.id),
|
|
987
|
+
`Separator ids must be unique; id "${m.id}" was used more than once`
|
|
988
|
+
), o.add(m.id), m.element.addEventListener("keydown", ve);
|
|
989
|
+
}), x.mountedGroups.size === 1 && (window.addEventListener("pointerdown", ge), window.addEventListener("pointermove", ye), window.addEventListener("pointerup", Se)), function() {
|
|
979
990
|
t = !1;
|
|
980
|
-
const
|
|
981
|
-
const
|
|
982
|
-
return
|
|
991
|
+
const f = C((p) => {
|
|
992
|
+
const h = new Map(p.mountedGroups);
|
|
993
|
+
return h.delete(e), { mountedGroups: h };
|
|
983
994
|
});
|
|
984
|
-
e.element.removeEventListener("pointerleave",
|
|
985
|
-
|
|
986
|
-
}),
|
|
995
|
+
e.element.removeEventListener("pointerleave", he), e.separators.forEach((p) => {
|
|
996
|
+
p.element.removeEventListener("keydown", ve);
|
|
997
|
+
}), f.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", ge), window.removeEventListener("pointermove", ye), window.removeEventListener("pointerup", Se)), r.disconnect();
|
|
987
998
|
};
|
|
988
999
|
}
|
|
989
|
-
function
|
|
990
|
-
const t =
|
|
1000
|
+
function ue(e) {
|
|
1001
|
+
const t = Ne();
|
|
991
1002
|
return `${e ?? t}`;
|
|
992
1003
|
}
|
|
993
|
-
const
|
|
994
|
-
function
|
|
1004
|
+
const j = typeof window < "u" ? _e : Fe;
|
|
1005
|
+
function ce(e) {
|
|
995
1006
|
const t = T(e);
|
|
996
|
-
return
|
|
1007
|
+
return j(() => {
|
|
997
1008
|
t.current = e;
|
|
998
1009
|
}, [e]), ze((n) => t.current?.(n), [t]);
|
|
999
1010
|
}
|
|
1000
1011
|
function fe(...e) {
|
|
1001
|
-
return
|
|
1012
|
+
return ce((t) => {
|
|
1002
1013
|
e.forEach((n) => {
|
|
1003
1014
|
if (n)
|
|
1004
1015
|
switch (typeof n) {
|
|
@@ -1014,151 +1025,134 @@ function fe(...e) {
|
|
|
1014
1025
|
});
|
|
1015
1026
|
});
|
|
1016
1027
|
}
|
|
1017
|
-
const
|
|
1018
|
-
function
|
|
1028
|
+
const Oe = "--react-resizable-panels--panel--pointer-events";
|
|
1029
|
+
function Te(e, t) {
|
|
1019
1030
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1020
1031
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1021
1032
|
}
|
|
1022
|
-
const
|
|
1023
|
-
function
|
|
1033
|
+
const De = He(null);
|
|
1034
|
+
function rt(e, t) {
|
|
1024
1035
|
const n = T({
|
|
1025
1036
|
getLayout: () => ({}),
|
|
1026
1037
|
setLayout: Je
|
|
1027
1038
|
});
|
|
1028
|
-
be(t, () => n.current, []),
|
|
1039
|
+
be(t, () => n.current, []), j(() => {
|
|
1029
1040
|
Object.assign(
|
|
1030
1041
|
n.current,
|
|
1031
|
-
|
|
1042
|
+
Ge({ groupId: e })
|
|
1032
1043
|
);
|
|
1033
1044
|
});
|
|
1034
1045
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return we(
|
|
1037
|
-
(t) => (e?.addEventListener(
|
|
1038
|
-
"contentvisibilityautostatechange",
|
|
1039
|
-
t
|
|
1040
|
-
), () => {
|
|
1041
|
-
e?.removeEventListener(
|
|
1042
|
-
"contentvisibilityautostatechange",
|
|
1043
|
-
t
|
|
1044
|
-
);
|
|
1045
|
-
}),
|
|
1046
|
-
() => typeof e?.checkVisibility == "function" ? e.checkVisibility() : !0,
|
|
1047
|
-
() => !0
|
|
1048
|
-
);
|
|
1049
|
-
}
|
|
1050
|
-
function yt({
|
|
1046
|
+
function ht({
|
|
1051
1047
|
children: e,
|
|
1052
1048
|
className: t,
|
|
1053
1049
|
defaultLayout: n,
|
|
1054
1050
|
disableCursor: o,
|
|
1055
1051
|
disabled: r,
|
|
1056
|
-
elementRef:
|
|
1057
|
-
groupRef:
|
|
1052
|
+
elementRef: a,
|
|
1053
|
+
groupRef: u,
|
|
1058
1054
|
id: i,
|
|
1059
|
-
onLayoutChange:
|
|
1055
|
+
onLayoutChange: s,
|
|
1060
1056
|
orientation: l = "horizontal",
|
|
1061
|
-
style:
|
|
1062
|
-
...
|
|
1057
|
+
style: c,
|
|
1058
|
+
...d
|
|
1063
1059
|
}) {
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1066
|
-
}),
|
|
1067
|
-
|
|
1068
|
-
const
|
|
1060
|
+
const x = T({}), m = ce((b) => {
|
|
1061
|
+
W(x.current, b) || (x.current = b, s?.(b));
|
|
1062
|
+
}), f = ue(i), [p, h] = G(!1), [g, S] = G(null), [y, v] = G(n ?? {}), [L, w] = G([]), [E, V] = G([]), ne = T({}), X = T({}), Y = fe(S, a);
|
|
1063
|
+
rt(f, u);
|
|
1064
|
+
const q = Le(
|
|
1069
1065
|
() => ({
|
|
1070
|
-
id:
|
|
1066
|
+
id: f,
|
|
1071
1067
|
orientation: l,
|
|
1072
|
-
registerPanel: (b) => (
|
|
1073
|
-
|
|
1068
|
+
registerPanel: (b) => (w((M) => re(l, [...M, b])), () => {
|
|
1069
|
+
w((M) => M.filter((N) => N !== b));
|
|
1074
1070
|
}),
|
|
1075
|
-
registerSeparator: (b) => (
|
|
1071
|
+
registerSeparator: (b) => (V(
|
|
1076
1072
|
(M) => re(l, [...M, b])
|
|
1077
1073
|
), () => {
|
|
1078
|
-
|
|
1074
|
+
V(
|
|
1079
1075
|
(M) => M.filter((N) => N !== b)
|
|
1080
1076
|
);
|
|
1081
1077
|
})
|
|
1082
1078
|
}),
|
|
1083
|
-
[
|
|
1079
|
+
[f, l]
|
|
1084
1080
|
);
|
|
1085
|
-
|
|
1086
|
-
if (
|
|
1081
|
+
j(() => {
|
|
1082
|
+
if (g === null || L.length === 0)
|
|
1087
1083
|
return;
|
|
1088
1084
|
const b = {
|
|
1089
1085
|
defaultLayout: n,
|
|
1090
1086
|
disableCursor: !!o,
|
|
1091
1087
|
disabled: !!r,
|
|
1092
|
-
element:
|
|
1093
|
-
id:
|
|
1094
|
-
inMemoryLastExpandedPanelSizes:
|
|
1088
|
+
element: g,
|
|
1089
|
+
id: f,
|
|
1090
|
+
inMemoryLastExpandedPanelSizes: ne.current,
|
|
1095
1091
|
inMemoryLayouts: X.current,
|
|
1096
1092
|
orientation: l,
|
|
1097
1093
|
panels: L,
|
|
1098
1094
|
separators: E
|
|
1099
|
-
}, M =
|
|
1100
|
-
oe && (
|
|
1101
|
-
const
|
|
1095
|
+
}, M = st(b), oe = O().mountedGroups.get(b);
|
|
1096
|
+
oe && (v(oe.layout), m?.(oe.layout));
|
|
1097
|
+
const Ae = A.addListener(
|
|
1102
1098
|
"interactionStateChange",
|
|
1103
|
-
(
|
|
1104
|
-
switch (
|
|
1099
|
+
(J) => {
|
|
1100
|
+
switch (J.state) {
|
|
1105
1101
|
case "active": {
|
|
1106
|
-
|
|
1107
|
-
|
|
1102
|
+
h(
|
|
1103
|
+
J.hitRegions.some(
|
|
1108
1104
|
(_) => _.group === b
|
|
1109
1105
|
)
|
|
1110
1106
|
);
|
|
1111
1107
|
break;
|
|
1112
1108
|
}
|
|
1113
1109
|
default: {
|
|
1114
|
-
|
|
1110
|
+
h(!1);
|
|
1115
1111
|
break;
|
|
1116
1112
|
}
|
|
1117
1113
|
}
|
|
1118
1114
|
}
|
|
1119
|
-
),
|
|
1115
|
+
), $e = A.addListener(
|
|
1120
1116
|
"mountedGroupsChange",
|
|
1121
|
-
(
|
|
1122
|
-
const _ =
|
|
1123
|
-
_ && _.derivedPanelConstraints.length > 0 && (
|
|
1117
|
+
(J) => {
|
|
1118
|
+
const _ = J.get(b);
|
|
1119
|
+
_ && _.derivedPanelConstraints.length > 0 && (v(_.layout), m?.(_.layout));
|
|
1124
1120
|
}
|
|
1125
1121
|
);
|
|
1126
1122
|
return () => {
|
|
1127
|
-
M(),
|
|
1123
|
+
M(), Ae(), $e();
|
|
1128
1124
|
};
|
|
1129
1125
|
}, [
|
|
1130
1126
|
n,
|
|
1131
1127
|
o,
|
|
1132
1128
|
r,
|
|
1129
|
+
g,
|
|
1130
|
+
f,
|
|
1133
1131
|
m,
|
|
1134
|
-
d,
|
|
1135
|
-
te,
|
|
1136
|
-
y,
|
|
1137
1132
|
l,
|
|
1138
1133
|
L,
|
|
1139
1134
|
E
|
|
1140
1135
|
]);
|
|
1141
|
-
const
|
|
1142
|
-
[
|
|
1136
|
+
const Z = {
|
|
1137
|
+
[Oe]: p ? "none" : void 0
|
|
1143
1138
|
};
|
|
1144
|
-
for (const b in
|
|
1145
|
-
const M =
|
|
1146
|
-
|
|
1139
|
+
for (const b in y) {
|
|
1140
|
+
const M = Te(f, b), N = y[b];
|
|
1141
|
+
Z[M] = N;
|
|
1147
1142
|
}
|
|
1148
|
-
return /* @__PURE__ */
|
|
1143
|
+
return /* @__PURE__ */ B(De.Provider, { value: q, children: /* @__PURE__ */ B(
|
|
1149
1144
|
"div",
|
|
1150
1145
|
{
|
|
1151
|
-
...
|
|
1146
|
+
...d,
|
|
1152
1147
|
"aria-orientation": l,
|
|
1153
1148
|
className: t,
|
|
1154
1149
|
"data-group": !0,
|
|
1155
|
-
"data-testid":
|
|
1156
|
-
id:
|
|
1150
|
+
"data-testid": f,
|
|
1151
|
+
id: f,
|
|
1157
1152
|
ref: Y,
|
|
1158
1153
|
style: {
|
|
1159
|
-
...
|
|
1160
|
-
...
|
|
1161
|
-
contentVisibility: "auto",
|
|
1154
|
+
...c,
|
|
1155
|
+
...Z,
|
|
1162
1156
|
display: "flex",
|
|
1163
1157
|
flexDirection: l === "horizontal" ? "row" : "column",
|
|
1164
1158
|
flexWrap: "nowrap"
|
|
@@ -1170,7 +1164,7 @@ function yt({
|
|
|
1170
1164
|
function ae(e) {
|
|
1171
1165
|
return `react-resizable-panels:${e}`;
|
|
1172
1166
|
}
|
|
1173
|
-
function
|
|
1167
|
+
function at({
|
|
1174
1168
|
id: e,
|
|
1175
1169
|
layout: t,
|
|
1176
1170
|
storage: n
|
|
@@ -1182,21 +1176,21 @@ function ct({
|
|
|
1182
1176
|
console.error(o);
|
|
1183
1177
|
}
|
|
1184
1178
|
}
|
|
1185
|
-
function
|
|
1179
|
+
function vt({
|
|
1186
1180
|
groupId: e,
|
|
1187
1181
|
storage: t
|
|
1188
1182
|
}) {
|
|
1189
|
-
const n =
|
|
1190
|
-
|
|
1183
|
+
const n = We(
|
|
1184
|
+
lt,
|
|
1191
1185
|
() => t.getItem(ae(e)),
|
|
1192
1186
|
() => t.getItem(ae(e))
|
|
1193
1187
|
), o = Le(
|
|
1194
1188
|
() => n ? JSON.parse(n) : void 0,
|
|
1195
1189
|
[n]
|
|
1196
1190
|
), r = ze(
|
|
1197
|
-
(
|
|
1191
|
+
(a) => at({
|
|
1198
1192
|
id: e,
|
|
1199
|
-
layout:
|
|
1193
|
+
layout: a,
|
|
1200
1194
|
storage: t
|
|
1201
1195
|
}),
|
|
1202
1196
|
[e, t]
|
|
@@ -1206,108 +1200,108 @@ function gt({
|
|
|
1206
1200
|
onLayoutChange: r
|
|
1207
1201
|
};
|
|
1208
1202
|
}
|
|
1209
|
-
function
|
|
1203
|
+
function lt() {
|
|
1210
1204
|
return function() {
|
|
1211
1205
|
};
|
|
1212
1206
|
}
|
|
1213
|
-
function
|
|
1207
|
+
function gt() {
|
|
1214
1208
|
return G(null);
|
|
1215
1209
|
}
|
|
1216
|
-
function
|
|
1210
|
+
function yt() {
|
|
1217
1211
|
return T(null);
|
|
1218
1212
|
}
|
|
1219
1213
|
function de() {
|
|
1220
|
-
const e = je(
|
|
1214
|
+
const e = je(De);
|
|
1221
1215
|
return z(
|
|
1222
1216
|
e,
|
|
1223
1217
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1224
1218
|
), e;
|
|
1225
1219
|
}
|
|
1226
|
-
function
|
|
1220
|
+
function ut({
|
|
1227
1221
|
groupId: e,
|
|
1228
1222
|
panelId: t
|
|
1229
1223
|
}) {
|
|
1230
1224
|
const n = () => {
|
|
1231
1225
|
const { mountedGroups: i } = O();
|
|
1232
1226
|
for (const [
|
|
1233
|
-
|
|
1234
|
-
{ derivedPanelConstraints: l, layout:
|
|
1227
|
+
s,
|
|
1228
|
+
{ derivedPanelConstraints: l, layout: c, separatorToPanels: d }
|
|
1235
1229
|
] of i)
|
|
1236
|
-
if (
|
|
1237
|
-
return { derivedPanelConstraints: l, group:
|
|
1230
|
+
if (s.id === e)
|
|
1231
|
+
return { derivedPanelConstraints: l, group: s, layout: c, separatorToPanels: d };
|
|
1238
1232
|
throw Error(`Group ${e} not found`);
|
|
1239
1233
|
}, o = () => {
|
|
1240
1234
|
const i = n().derivedPanelConstraints.find(
|
|
1241
|
-
(
|
|
1235
|
+
(s) => s.panelId === t
|
|
1242
1236
|
);
|
|
1243
1237
|
if (i !== void 0)
|
|
1244
1238
|
return i;
|
|
1245
1239
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
1246
1240
|
}, r = () => {
|
|
1247
|
-
const i = n().group.panels.find((
|
|
1241
|
+
const i = n().group.panels.find((s) => s.id === t);
|
|
1248
1242
|
if (i !== void 0)
|
|
1249
1243
|
return i;
|
|
1250
1244
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1251
|
-
},
|
|
1245
|
+
}, a = () => {
|
|
1252
1246
|
const i = n().layout[t];
|
|
1253
1247
|
if (i !== void 0)
|
|
1254
1248
|
return i;
|
|
1255
1249
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1256
|
-
},
|
|
1257
|
-
const
|
|
1258
|
-
if (i ===
|
|
1250
|
+
}, u = (i) => {
|
|
1251
|
+
const s = a();
|
|
1252
|
+
if (i === s)
|
|
1259
1253
|
return;
|
|
1260
1254
|
const {
|
|
1261
1255
|
derivedPanelConstraints: l,
|
|
1262
|
-
group:
|
|
1263
|
-
layout:
|
|
1264
|
-
separatorToPanels:
|
|
1265
|
-
} = n(),
|
|
1266
|
-
delta:
|
|
1267
|
-
initialLayout:
|
|
1256
|
+
group: c,
|
|
1257
|
+
layout: d,
|
|
1258
|
+
separatorToPanels: x
|
|
1259
|
+
} = n(), m = c.panels.findIndex((g) => g.id === t), f = m === c.panels.length - 1, p = K({
|
|
1260
|
+
delta: f ? s - i : i - s,
|
|
1261
|
+
initialLayout: d,
|
|
1268
1262
|
panelConstraints: l,
|
|
1269
|
-
pivotIndices:
|
|
1270
|
-
prevLayout:
|
|
1263
|
+
pivotIndices: f ? [m - 1, m] : [m, m + 1],
|
|
1264
|
+
prevLayout: d,
|
|
1271
1265
|
trigger: "imperative-api"
|
|
1272
|
-
}),
|
|
1266
|
+
}), h = $({
|
|
1273
1267
|
layout: p,
|
|
1274
1268
|
panelConstraints: l
|
|
1275
1269
|
});
|
|
1276
|
-
|
|
1277
|
-
mountedGroups: new Map(
|
|
1270
|
+
W(d, h) || C((g) => ({
|
|
1271
|
+
mountedGroups: new Map(g.mountedGroups).set(c, {
|
|
1278
1272
|
derivedPanelConstraints: l,
|
|
1279
|
-
layout:
|
|
1280
|
-
separatorToPanels:
|
|
1273
|
+
layout: h,
|
|
1274
|
+
separatorToPanels: x
|
|
1281
1275
|
})
|
|
1282
1276
|
}));
|
|
1283
1277
|
};
|
|
1284
1278
|
return {
|
|
1285
1279
|
collapse: () => {
|
|
1286
|
-
const { collapsible: i, collapsedSize:
|
|
1287
|
-
i && l !==
|
|
1280
|
+
const { collapsible: i, collapsedSize: s } = o(), l = a();
|
|
1281
|
+
i && l !== s && u(s);
|
|
1288
1282
|
},
|
|
1289
1283
|
expand: () => {
|
|
1290
|
-
const { collapsible: i, collapsedSize:
|
|
1291
|
-
i &&
|
|
1284
|
+
const { collapsible: i, collapsedSize: s, minSize: l } = o(), c = a();
|
|
1285
|
+
i && c === s && u(l);
|
|
1292
1286
|
},
|
|
1293
1287
|
getSize: () => {
|
|
1294
|
-
const { group: i } = n(),
|
|
1288
|
+
const { group: i } = n(), s = a(), { element: l } = r(), c = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
|
|
1295
1289
|
return {
|
|
1296
|
-
asPercentage:
|
|
1297
|
-
inPixels:
|
|
1290
|
+
asPercentage: s,
|
|
1291
|
+
inPixels: c
|
|
1298
1292
|
};
|
|
1299
1293
|
},
|
|
1300
1294
|
isCollapsed: () => {
|
|
1301
|
-
const { collapsible: i, collapsedSize:
|
|
1302
|
-
return i &&
|
|
1295
|
+
const { collapsible: i, collapsedSize: s } = o(), l = a();
|
|
1296
|
+
return i && P(s, l);
|
|
1303
1297
|
},
|
|
1304
1298
|
resize: (i) => {
|
|
1305
|
-
if (
|
|
1299
|
+
if (a() !== i) {
|
|
1306
1300
|
let l;
|
|
1307
1301
|
switch (typeof i) {
|
|
1308
1302
|
case "number": {
|
|
1309
|
-
const { group:
|
|
1310
|
-
l = I(i /
|
|
1303
|
+
const { group: c } = n(), d = H({ group: c });
|
|
1304
|
+
l = I(i / d * 100);
|
|
1311
1305
|
break;
|
|
1312
1306
|
}
|
|
1313
1307
|
case "string": {
|
|
@@ -1315,12 +1309,12 @@ function ft({
|
|
|
1315
1309
|
break;
|
|
1316
1310
|
}
|
|
1317
1311
|
}
|
|
1318
|
-
|
|
1312
|
+
u(l);
|
|
1319
1313
|
}
|
|
1320
1314
|
}
|
|
1321
1315
|
};
|
|
1322
1316
|
}
|
|
1323
|
-
function
|
|
1317
|
+
function ct(e, t) {
|
|
1324
1318
|
const { id: n } = de(), o = T({
|
|
1325
1319
|
collapse: ie,
|
|
1326
1320
|
expand: ie,
|
|
@@ -1331,44 +1325,44 @@ function dt(e, t) {
|
|
|
1331
1325
|
isCollapsed: () => !1,
|
|
1332
1326
|
resize: ie
|
|
1333
1327
|
});
|
|
1334
|
-
be(t, () => o.current, []),
|
|
1328
|
+
be(t, () => o.current, []), j(() => {
|
|
1335
1329
|
Object.assign(
|
|
1336
1330
|
o.current,
|
|
1337
|
-
|
|
1331
|
+
ut({ groupId: n, panelId: e })
|
|
1338
1332
|
);
|
|
1339
1333
|
});
|
|
1340
1334
|
}
|
|
1341
|
-
function
|
|
1335
|
+
function St({
|
|
1342
1336
|
children: e,
|
|
1343
1337
|
className: t,
|
|
1344
1338
|
collapsedSize: n = "0%",
|
|
1345
1339
|
collapsible: o = !1,
|
|
1346
1340
|
defaultSize: r,
|
|
1347
|
-
elementRef:
|
|
1348
|
-
id:
|
|
1341
|
+
elementRef: a,
|
|
1342
|
+
id: u,
|
|
1349
1343
|
maxSize: i = "100%",
|
|
1350
|
-
minSize:
|
|
1344
|
+
minSize: s = "0%",
|
|
1351
1345
|
onResize: l,
|
|
1352
|
-
panelRef:
|
|
1353
|
-
style:
|
|
1354
|
-
...
|
|
1346
|
+
panelRef: c,
|
|
1347
|
+
style: d,
|
|
1348
|
+
...x
|
|
1355
1349
|
}) {
|
|
1356
|
-
const
|
|
1357
|
-
l?.(E,
|
|
1350
|
+
const m = !!u, f = ue(u), [p, h] = G(null), g = fe(h, a), { id: S, registerPanel: y } = de(), v = l !== null, L = ce((E) => {
|
|
1351
|
+
l?.(E, u);
|
|
1358
1352
|
});
|
|
1359
|
-
|
|
1353
|
+
j(() => {
|
|
1360
1354
|
if (p !== null)
|
|
1361
|
-
return
|
|
1355
|
+
return y({
|
|
1362
1356
|
element: p,
|
|
1363
|
-
id:
|
|
1364
|
-
idIsStable:
|
|
1365
|
-
onResize:
|
|
1357
|
+
id: f,
|
|
1358
|
+
idIsStable: m,
|
|
1359
|
+
onResize: v ? L : void 0,
|
|
1366
1360
|
panelConstraints: {
|
|
1367
1361
|
collapsedSize: n,
|
|
1368
1362
|
collapsible: o,
|
|
1369
1363
|
defaultSize: r,
|
|
1370
1364
|
maxSize: i,
|
|
1371
|
-
minSize:
|
|
1365
|
+
minSize: s
|
|
1372
1366
|
}
|
|
1373
1367
|
});
|
|
1374
1368
|
}, [
|
|
@@ -1376,42 +1370,42 @@ function zt({
|
|
|
1376
1370
|
o,
|
|
1377
1371
|
r,
|
|
1378
1372
|
p,
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1373
|
+
v,
|
|
1374
|
+
f,
|
|
1375
|
+
m,
|
|
1382
1376
|
i,
|
|
1383
|
-
|
|
1377
|
+
s,
|
|
1384
1378
|
L,
|
|
1385
|
-
|
|
1386
|
-
]),
|
|
1387
|
-
const
|
|
1388
|
-
return /* @__PURE__ */
|
|
1379
|
+
y
|
|
1380
|
+
]), ct(f, c);
|
|
1381
|
+
const w = Te(S, f);
|
|
1382
|
+
return /* @__PURE__ */ B(
|
|
1389
1383
|
"div",
|
|
1390
1384
|
{
|
|
1391
|
-
...
|
|
1385
|
+
...x,
|
|
1392
1386
|
"data-panel": !0,
|
|
1393
|
-
"data-testid":
|
|
1394
|
-
id:
|
|
1395
|
-
ref:
|
|
1387
|
+
"data-testid": f,
|
|
1388
|
+
id: f,
|
|
1389
|
+
ref: g,
|
|
1396
1390
|
style: {
|
|
1397
|
-
...
|
|
1391
|
+
...ft,
|
|
1398
1392
|
flexBasis: 0,
|
|
1399
|
-
flexGrow: `var(${
|
|
1393
|
+
flexGrow: `var(${w}, 1)`,
|
|
1400
1394
|
flexShrink: 1,
|
|
1401
1395
|
// Prevent Panel content from interfering with panel size
|
|
1402
1396
|
overflow: "hidden",
|
|
1403
1397
|
// Disable pointer events inside of a panel during resize
|
|
1404
1398
|
// This avoid edge cases like nested iframes
|
|
1405
|
-
pointerEvents: `var(${
|
|
1399
|
+
pointerEvents: `var(${Oe})`
|
|
1406
1400
|
},
|
|
1407
|
-
children: /* @__PURE__ */
|
|
1401
|
+
children: /* @__PURE__ */ B(
|
|
1408
1402
|
"div",
|
|
1409
1403
|
{
|
|
1410
1404
|
className: t,
|
|
1411
1405
|
style: {
|
|
1412
1406
|
width: "100%",
|
|
1413
1407
|
height: "100%",
|
|
1414
|
-
...
|
|
1408
|
+
...d
|
|
1415
1409
|
},
|
|
1416
1410
|
children: e
|
|
1417
1411
|
}
|
|
@@ -1419,7 +1413,7 @@ function zt({
|
|
|
1419
1413
|
}
|
|
1420
1414
|
);
|
|
1421
1415
|
}
|
|
1422
|
-
const
|
|
1416
|
+
const ft = {
|
|
1423
1417
|
minHeight: "unset",
|
|
1424
1418
|
maxHeight: "unset",
|
|
1425
1419
|
height: "unset",
|
|
@@ -1435,40 +1429,40 @@ const pt = {
|
|
|
1435
1429
|
padding: "unset",
|
|
1436
1430
|
margin: "unset"
|
|
1437
1431
|
};
|
|
1438
|
-
function
|
|
1432
|
+
function xt() {
|
|
1439
1433
|
return G(null);
|
|
1440
1434
|
}
|
|
1441
|
-
function
|
|
1435
|
+
function zt() {
|
|
1442
1436
|
return T(null);
|
|
1443
1437
|
}
|
|
1444
|
-
function
|
|
1438
|
+
function dt({
|
|
1445
1439
|
layout: e,
|
|
1446
1440
|
panelConstraints: t,
|
|
1447
1441
|
panelId: n,
|
|
1448
1442
|
panelIndex: o
|
|
1449
1443
|
}) {
|
|
1450
|
-
let r,
|
|
1451
|
-
const
|
|
1452
|
-
(
|
|
1444
|
+
let r, a;
|
|
1445
|
+
const u = e[n], i = t.find(
|
|
1446
|
+
(s) => s.panelId === n
|
|
1453
1447
|
);
|
|
1454
1448
|
if (i) {
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1457
|
-
layout:
|
|
1458
|
-
delta: l -
|
|
1449
|
+
const s = i.maxSize, l = a = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
|
|
1450
|
+
a = $({
|
|
1451
|
+
layout: K({
|
|
1452
|
+
delta: l - u,
|
|
1459
1453
|
initialLayout: e,
|
|
1460
1454
|
panelConstraints: t,
|
|
1461
|
-
pivotIndices:
|
|
1455
|
+
pivotIndices: c,
|
|
1462
1456
|
prevLayout: e,
|
|
1463
1457
|
trigger: "keyboard"
|
|
1464
1458
|
}),
|
|
1465
1459
|
panelConstraints: t
|
|
1466
1460
|
})[n], r = $({
|
|
1467
|
-
layout:
|
|
1468
|
-
delta:
|
|
1461
|
+
layout: K({
|
|
1462
|
+
delta: s - u,
|
|
1469
1463
|
initialLayout: e,
|
|
1470
1464
|
panelConstraints: t,
|
|
1471
|
-
pivotIndices:
|
|
1465
|
+
pivotIndices: c,
|
|
1472
1466
|
prevLayout: e,
|
|
1473
1467
|
trigger: "keyboard"
|
|
1474
1468
|
}),
|
|
@@ -1478,52 +1472,52 @@ function mt({
|
|
|
1478
1472
|
return {
|
|
1479
1473
|
valueControls: n,
|
|
1480
1474
|
valueMax: r,
|
|
1481
|
-
valueMin:
|
|
1482
|
-
valueNow:
|
|
1475
|
+
valueMin: a,
|
|
1476
|
+
valueNow: u
|
|
1483
1477
|
};
|
|
1484
1478
|
}
|
|
1485
|
-
function
|
|
1479
|
+
function bt({
|
|
1486
1480
|
children: e,
|
|
1487
1481
|
className: t,
|
|
1488
1482
|
elementRef: n,
|
|
1489
1483
|
id: o,
|
|
1490
1484
|
style: r,
|
|
1491
|
-
...
|
|
1485
|
+
...a
|
|
1492
1486
|
}) {
|
|
1493
|
-
const
|
|
1494
|
-
id:
|
|
1487
|
+
const u = ue(o), [i, s] = G({}), [l, c] = G("inactive"), [d, x] = G(null), m = fe(x, n), {
|
|
1488
|
+
id: f,
|
|
1495
1489
|
orientation: p,
|
|
1496
|
-
registerSeparator:
|
|
1497
|
-
} = de(),
|
|
1498
|
-
return
|
|
1499
|
-
if (
|
|
1500
|
-
const
|
|
1501
|
-
element:
|
|
1502
|
-
id:
|
|
1503
|
-
},
|
|
1490
|
+
registerSeparator: h
|
|
1491
|
+
} = de(), g = p === "horizontal" ? "vertical" : "horizontal";
|
|
1492
|
+
return j(() => {
|
|
1493
|
+
if (d !== null) {
|
|
1494
|
+
const S = {
|
|
1495
|
+
element: d,
|
|
1496
|
+
id: u
|
|
1497
|
+
}, y = h(S), v = A.addListener(
|
|
1504
1498
|
"interactionStateChange",
|
|
1505
|
-
(
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
(E) => E.separator ===
|
|
1509
|
-
) ?
|
|
1499
|
+
(w) => {
|
|
1500
|
+
c(
|
|
1501
|
+
w.state !== "inactive" && w.hitRegions.some(
|
|
1502
|
+
(E) => E.separator === S
|
|
1503
|
+
) ? w.state : "inactive"
|
|
1510
1504
|
);
|
|
1511
1505
|
}
|
|
1512
1506
|
), L = A.addListener(
|
|
1513
1507
|
"mountedGroupsChange",
|
|
1514
|
-
(
|
|
1515
|
-
|
|
1516
|
-
({ derivedPanelConstraints: E, layout:
|
|
1517
|
-
if (
|
|
1518
|
-
const
|
|
1519
|
-
if (
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
layout:
|
|
1508
|
+
(w) => {
|
|
1509
|
+
w.forEach(
|
|
1510
|
+
({ derivedPanelConstraints: E, layout: V, separatorToPanels: ne }, X) => {
|
|
1511
|
+
if (X.id === f) {
|
|
1512
|
+
const Y = ne.get(S);
|
|
1513
|
+
if (Y) {
|
|
1514
|
+
const q = Y[0], Z = X.panels.indexOf(q);
|
|
1515
|
+
s(
|
|
1516
|
+
dt({
|
|
1517
|
+
layout: V,
|
|
1524
1518
|
panelConstraints: E,
|
|
1525
|
-
panelId:
|
|
1526
|
-
panelIndex:
|
|
1519
|
+
panelId: q.id,
|
|
1520
|
+
panelIndex: Z
|
|
1527
1521
|
})
|
|
1528
1522
|
);
|
|
1529
1523
|
}
|
|
@@ -1533,24 +1527,24 @@ function Lt({
|
|
|
1533
1527
|
}
|
|
1534
1528
|
);
|
|
1535
1529
|
return () => {
|
|
1536
|
-
|
|
1530
|
+
v(), L(), y();
|
|
1537
1531
|
};
|
|
1538
1532
|
}
|
|
1539
|
-
}, [
|
|
1533
|
+
}, [d, f, u, h]), /* @__PURE__ */ B(
|
|
1540
1534
|
"div",
|
|
1541
1535
|
{
|
|
1542
|
-
...
|
|
1536
|
+
...a,
|
|
1543
1537
|
"aria-controls": i.valueControls,
|
|
1544
|
-
"aria-orientation":
|
|
1538
|
+
"aria-orientation": g,
|
|
1545
1539
|
"aria-valuemax": i.valueMax,
|
|
1546
1540
|
"aria-valuemin": i.valueMin,
|
|
1547
1541
|
"aria-valuenow": i.valueNow,
|
|
1548
1542
|
children: e,
|
|
1549
1543
|
className: t,
|
|
1550
1544
|
"data-separator": l,
|
|
1551
|
-
"data-testid":
|
|
1552
|
-
id:
|
|
1553
|
-
ref:
|
|
1545
|
+
"data-testid": u,
|
|
1546
|
+
id: u,
|
|
1547
|
+
ref: m,
|
|
1554
1548
|
role: "separator",
|
|
1555
1549
|
style: {
|
|
1556
1550
|
flexBasis: "auto",
|
|
@@ -1563,13 +1557,13 @@ function Lt({
|
|
|
1563
1557
|
);
|
|
1564
1558
|
}
|
|
1565
1559
|
export {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1560
|
+
ht as Group,
|
|
1561
|
+
St as Panel,
|
|
1562
|
+
bt as Separator,
|
|
1563
|
+
vt as useDefaultLayout,
|
|
1564
|
+
gt as useGroupCallbackRef,
|
|
1565
|
+
yt as useGroupRef,
|
|
1566
|
+
xt as usePanelCallbackRef,
|
|
1567
|
+
zt as usePanelRef
|
|
1574
1568
|
};
|
|
1575
1569
|
//# sourceMappingURL=react-resizable-panels.js.map
|