react-resizable-panels 4.3.1 → 4.3.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.
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
3
|
+
import { useState as K, useCallback as Pe, useId as Ue, useLayoutEffect as We, useEffect as Re, useRef as k, createContext as Be, useImperativeHandle as Ce, useMemo as ae, useSyncExternalStore as Ke, useContext as Xe } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function V({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
12
|
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function le(e, t) {
|
|
15
15
|
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? qe : Ye
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function qe(e, t) {
|
|
20
20
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
21
21
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Ye(e, t) {
|
|
24
24
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
25
25
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
26
26
|
}
|
|
@@ -39,7 +39,7 @@ function Ee(e, t) {
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Je({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -55,8 +55,8 @@ function et({
|
|
|
55
55
|
}
|
|
56
56
|
return z(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, a =
|
|
58
|
+
function ke(e) {
|
|
59
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, a = le(
|
|
60
60
|
n,
|
|
61
61
|
Array.from(t.children).filter(Me).map((f) => ({ element: f }))
|
|
62
62
|
).map(({ element: f }) => f), l = [];
|
|
@@ -64,36 +64,36 @@ function Ie(e) {
|
|
|
64
64
|
for (const f of a)
|
|
65
65
|
if (f.hasAttribute("data-panel")) {
|
|
66
66
|
const p = o.find(
|
|
67
|
-
(
|
|
67
|
+
(h) => h.element === f
|
|
68
68
|
);
|
|
69
69
|
if (p) {
|
|
70
70
|
if (s) {
|
|
71
|
-
const
|
|
71
|
+
const h = s.element.getBoundingClientRect(), m = f.getBoundingClientRect();
|
|
72
72
|
let c;
|
|
73
73
|
if (r) {
|
|
74
|
-
const d = n === "horizontal" ? new DOMRect(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const d = n === "horizontal" ? new DOMRect(h.right, h.top, 0, h.height) : new DOMRect(
|
|
75
|
+
h.left,
|
|
76
|
+
h.bottom,
|
|
77
|
+
h.width,
|
|
78
78
|
0
|
|
79
|
-
),
|
|
79
|
+
), S = n === "horizontal" ? new DOMRect(m.left, m.top, 0, m.height) : new DOMRect(m.left, m.top, m.width, 0);
|
|
80
80
|
switch (u.length) {
|
|
81
81
|
case 0: {
|
|
82
82
|
c = [
|
|
83
83
|
d,
|
|
84
|
-
|
|
84
|
+
S
|
|
85
85
|
];
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
case 1: {
|
|
89
|
-
const
|
|
89
|
+
const y = u[0], v = Je({
|
|
90
90
|
orientation: n,
|
|
91
|
-
rects: [
|
|
92
|
-
targetRect:
|
|
91
|
+
rects: [h, m],
|
|
92
|
+
targetRect: y.element.getBoundingClientRect()
|
|
93
93
|
});
|
|
94
94
|
c = [
|
|
95
|
-
|
|
96
|
-
v ===
|
|
95
|
+
y,
|
|
96
|
+
v === h ? S : d
|
|
97
97
|
];
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
@@ -105,21 +105,21 @@ function Ie(e) {
|
|
|
105
105
|
} else
|
|
106
106
|
u.length ? c = u : c = [
|
|
107
107
|
n === "horizontal" ? new DOMRect(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
h.right,
|
|
109
|
+
m.top,
|
|
110
|
+
m.left - h.right,
|
|
111
|
+
m.height
|
|
112
112
|
) : new DOMRect(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
m.left,
|
|
114
|
+
h.bottom,
|
|
115
|
+
m.width,
|
|
116
|
+
m.top - h.bottom
|
|
117
117
|
)
|
|
118
118
|
];
|
|
119
119
|
for (const d of c)
|
|
120
120
|
l.push({
|
|
121
121
|
group: e,
|
|
122
|
-
groupSize:
|
|
122
|
+
groupSize: V({ group: e }),
|
|
123
123
|
panels: [s, p],
|
|
124
124
|
separator: "width" in d ? void 0 : d,
|
|
125
125
|
rect: "width" in d ? d : d.element.getBoundingClientRect()
|
|
@@ -129,28 +129,28 @@ function Ie(e) {
|
|
|
129
129
|
}
|
|
130
130
|
} else if (f.hasAttribute("data-separator")) {
|
|
131
131
|
const p = i.find(
|
|
132
|
-
(
|
|
132
|
+
(h) => h.element === f
|
|
133
133
|
);
|
|
134
134
|
p ? u.push(p) : (s = void 0, u = []);
|
|
135
135
|
} else
|
|
136
136
|
r = !0;
|
|
137
137
|
return l;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Ze(e, t) {
|
|
140
140
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
141
141
|
return t * o;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Qe(e, t) {
|
|
144
144
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
145
145
|
return t * o;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function et(e) {
|
|
148
148
|
return e / 100 * window.innerHeight;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function tt(e) {
|
|
151
151
|
return e / 100 * window.innerWidth;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function nt(e) {
|
|
154
154
|
switch (typeof e) {
|
|
155
155
|
case "number":
|
|
156
156
|
return [e, "px"];
|
|
@@ -160,13 +160,13 @@ function it(e) {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Z({
|
|
164
164
|
groupSize: e,
|
|
165
165
|
panelElement: t,
|
|
166
166
|
styleProp: n
|
|
167
167
|
}) {
|
|
168
168
|
let o;
|
|
169
|
-
const [i, a] =
|
|
169
|
+
const [i, a] = nt(n);
|
|
170
170
|
switch (a) {
|
|
171
171
|
case "%": {
|
|
172
172
|
o = i / 100 * e;
|
|
@@ -177,19 +177,19 @@ function Q({
|
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
case "rem": {
|
|
180
|
-
o =
|
|
180
|
+
o = Qe(t, i);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
case "em": {
|
|
184
|
-
o =
|
|
184
|
+
o = Ze(t, i);
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "vh": {
|
|
188
|
-
o =
|
|
188
|
+
o = et(i);
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
case "vw": {
|
|
192
|
-
o =
|
|
192
|
+
o = tt(i);
|
|
193
193
|
break;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
@@ -199,7 +199,7 @@ function G(e) {
|
|
|
199
199
|
return parseFloat(e.toFixed(3));
|
|
200
200
|
}
|
|
201
201
|
function pe(e) {
|
|
202
|
-
const { panels: t } = e, n =
|
|
202
|
+
const { panels: t } = e, n = V({ group: e });
|
|
203
203
|
return n === 0 ? t.map((o) => ({
|
|
204
204
|
collapsedSize: 0,
|
|
205
205
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -211,7 +211,7 @@ function pe(e) {
|
|
|
211
211
|
const { element: i, panelConstraints: a } = o;
|
|
212
212
|
let l = 0;
|
|
213
213
|
if (a.collapsedSize) {
|
|
214
|
-
const f =
|
|
214
|
+
const f = Z({
|
|
215
215
|
groupSize: n,
|
|
216
216
|
panelElement: i,
|
|
217
217
|
styleProp: a.collapsedSize
|
|
@@ -220,7 +220,7 @@ function pe(e) {
|
|
|
220
220
|
}
|
|
221
221
|
let r;
|
|
222
222
|
if (a.defaultSize) {
|
|
223
|
-
const f =
|
|
223
|
+
const f = Z({
|
|
224
224
|
groupSize: n,
|
|
225
225
|
panelElement: i,
|
|
226
226
|
styleProp: a.defaultSize
|
|
@@ -229,7 +229,7 @@ function pe(e) {
|
|
|
229
229
|
}
|
|
230
230
|
let s = 0;
|
|
231
231
|
if (a.minSize) {
|
|
232
|
-
const f =
|
|
232
|
+
const f = Z({
|
|
233
233
|
groupSize: n,
|
|
234
234
|
panelElement: i,
|
|
235
235
|
styleProp: a.minSize
|
|
@@ -238,7 +238,7 @@ function pe(e) {
|
|
|
238
238
|
}
|
|
239
239
|
let u = 100;
|
|
240
240
|
if (a.maxSize) {
|
|
241
|
-
const f =
|
|
241
|
+
const f = Z({
|
|
242
242
|
groupSize: n,
|
|
243
243
|
panelElement: i,
|
|
244
244
|
styleProp: a.maxSize
|
|
@@ -255,7 +255,7 @@ function pe(e) {
|
|
|
255
255
|
};
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class ot {
|
|
259
259
|
#e = {};
|
|
260
260
|
addListener(t, n) {
|
|
261
261
|
const o = this.#e[t];
|
|
@@ -294,37 +294,37 @@ class st {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function M(e, t, n = 0) {
|
|
298
298
|
return Math.abs(G(e) - G(t)) <= n;
|
|
299
299
|
}
|
|
300
|
-
let
|
|
300
|
+
let E = {
|
|
301
301
|
cursorFlags: 0,
|
|
302
302
|
interactionState: {
|
|
303
303
|
state: "inactive"
|
|
304
304
|
},
|
|
305
305
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
306
306
|
};
|
|
307
|
-
const
|
|
307
|
+
const A = new ot();
|
|
308
308
|
function D() {
|
|
309
|
-
return
|
|
309
|
+
return E;
|
|
310
310
|
}
|
|
311
311
|
function I(e) {
|
|
312
|
-
const t = typeof e == "function" ? e(
|
|
313
|
-
if (
|
|
314
|
-
return
|
|
315
|
-
const n =
|
|
316
|
-
return
|
|
317
|
-
...
|
|
312
|
+
const t = typeof e == "function" ? e(E) : e;
|
|
313
|
+
if (E === t)
|
|
314
|
+
return E;
|
|
315
|
+
const n = E;
|
|
316
|
+
return E = {
|
|
317
|
+
...E,
|
|
318
318
|
...t
|
|
319
|
-
}, t.cursorFlags !== void 0 &&
|
|
319
|
+
}, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange", E.cursorFlags), t.interactionState !== void 0 && A.emit("interactionStateChange", E.interactionState), t.mountedGroups !== void 0 && (E.mountedGroups.forEach((o, i) => {
|
|
320
320
|
o.derivedPanelConstraints.forEach((a) => {
|
|
321
321
|
if (a.collapsible) {
|
|
322
322
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
323
323
|
if (l) {
|
|
324
|
-
const r =
|
|
324
|
+
const r = M(
|
|
325
325
|
a.collapsedSize,
|
|
326
326
|
o.layout[a.panelId]
|
|
327
|
-
), s =
|
|
327
|
+
), s = M(
|
|
328
328
|
a.collapsedSize,
|
|
329
329
|
l[a.panelId]
|
|
330
330
|
);
|
|
@@ -332,9 +332,9 @@ function I(e) {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
|
-
}),
|
|
335
|
+
}), A.emit("mountedGroupsChange", E.mountedGroups)), E;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function rt(e, t) {
|
|
338
338
|
if (e.length !== t.length)
|
|
339
339
|
return !1;
|
|
340
340
|
for (let n = 0; n < e.length; n++)
|
|
@@ -342,8 +342,8 @@ function at(e, t) {
|
|
|
342
342
|
return !1;
|
|
343
343
|
return !0;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
345
|
+
function X(e, t) {
|
|
346
|
+
return M(e, t) ? 0 : e > t ? 1 : -1;
|
|
347
347
|
}
|
|
348
348
|
function H({
|
|
349
349
|
panelConstraints: e,
|
|
@@ -355,15 +355,15 @@ function H({
|
|
|
355
355
|
maxSize: i = 100,
|
|
356
356
|
minSize: a = 0
|
|
357
357
|
} = e;
|
|
358
|
-
if (
|
|
358
|
+
if (X(t, a) < 0)
|
|
359
359
|
if (o) {
|
|
360
360
|
const l = (n + a) / 2;
|
|
361
|
-
|
|
361
|
+
X(t, l) < 0 ? t = n : t = a;
|
|
362
362
|
} else
|
|
363
363
|
t = a;
|
|
364
364
|
return t = Math.min(i, t), t = G(t), t;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function q({
|
|
367
367
|
delta: e,
|
|
368
368
|
initialLayout: t,
|
|
369
369
|
panelConstraints: n,
|
|
@@ -371,7 +371,7 @@ function Z({
|
|
|
371
371
|
prevLayout: i,
|
|
372
372
|
trigger: a
|
|
373
373
|
}) {
|
|
374
|
-
if (
|
|
374
|
+
if (M(e, 0))
|
|
375
375
|
return t;
|
|
376
376
|
const l = Object.values(t), r = Object.values(i), s = [...l], [u, f] = o;
|
|
377
377
|
z(u != null, "Invalid first pivot index"), z(f != null, "Invalid second pivot index");
|
|
@@ -384,18 +384,18 @@ function Z({
|
|
|
384
384
|
`Panel constraints not found for index ${c}`
|
|
385
385
|
);
|
|
386
386
|
const {
|
|
387
|
-
collapsedSize:
|
|
388
|
-
collapsible:
|
|
387
|
+
collapsedSize: S = 0,
|
|
388
|
+
collapsible: y,
|
|
389
389
|
minSize: v = 0
|
|
390
390
|
} = d;
|
|
391
|
-
if (
|
|
391
|
+
if (y) {
|
|
392
392
|
const x = l[c];
|
|
393
393
|
if (z(
|
|
394
394
|
x != null,
|
|
395
395
|
`Previous layout not found for panel index ${c}`
|
|
396
|
-
),
|
|
397
|
-
const
|
|
398
|
-
|
|
396
|
+
), M(x, S)) {
|
|
397
|
+
const g = v - x;
|
|
398
|
+
X(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
@@ -406,61 +406,61 @@ function Z({
|
|
|
406
406
|
`No panel constraints found for index ${c}`
|
|
407
407
|
);
|
|
408
408
|
const {
|
|
409
|
-
collapsedSize:
|
|
410
|
-
collapsible:
|
|
409
|
+
collapsedSize: S = 0,
|
|
410
|
+
collapsible: y,
|
|
411
411
|
minSize: v = 0
|
|
412
412
|
} = d;
|
|
413
|
-
if (
|
|
413
|
+
if (y) {
|
|
414
414
|
const x = l[c];
|
|
415
415
|
if (z(
|
|
416
416
|
x != null,
|
|
417
417
|
`Previous layout not found for panel index ${c}`
|
|
418
|
-
),
|
|
419
|
-
const
|
|
420
|
-
|
|
418
|
+
), M(x, v)) {
|
|
419
|
+
const g = x - S;
|
|
420
|
+
X(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
{
|
|
426
426
|
const c = e < 0 ? 1 : -1;
|
|
427
|
-
let d = e < 0 ? f : u,
|
|
427
|
+
let d = e < 0 ? f : u, S = 0;
|
|
428
428
|
for (; ; ) {
|
|
429
429
|
const v = l[d];
|
|
430
430
|
z(
|
|
431
431
|
v != null,
|
|
432
432
|
`Previous layout not found for panel index ${d}`
|
|
433
433
|
);
|
|
434
|
-
const
|
|
434
|
+
const g = H({
|
|
435
435
|
panelConstraints: n[d],
|
|
436
436
|
size: 100
|
|
437
437
|
}) - v;
|
|
438
|
-
if (
|
|
438
|
+
if (S += g, d += c, d < 0 || d >= n.length)
|
|
439
439
|
break;
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
e = e < 0 ? 0 -
|
|
441
|
+
const y = Math.min(Math.abs(e), Math.abs(S));
|
|
442
|
+
e = e < 0 ? 0 - y : y;
|
|
443
443
|
}
|
|
444
444
|
{
|
|
445
445
|
let d = e < 0 ? u : f;
|
|
446
446
|
for (; d >= 0 && d < n.length; ) {
|
|
447
|
-
const
|
|
447
|
+
const S = Math.abs(e) - Math.abs(p), y = l[d];
|
|
448
448
|
z(
|
|
449
|
-
|
|
449
|
+
y != null,
|
|
450
450
|
`Previous layout not found for panel index ${d}`
|
|
451
451
|
);
|
|
452
|
-
const v =
|
|
452
|
+
const v = y - S, x = H({
|
|
453
453
|
panelConstraints: n[d],
|
|
454
454
|
size: v
|
|
455
455
|
});
|
|
456
|
-
if (!
|
|
456
|
+
if (!M(y, x) && (p += y - x, s[d] = x, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
457
457
|
numeric: !0
|
|
458
458
|
}) >= 0))
|
|
459
459
|
break;
|
|
460
460
|
e < 0 ? d-- : d++;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
if (
|
|
463
|
+
if (rt(r, s))
|
|
464
464
|
return i;
|
|
465
465
|
{
|
|
466
466
|
const c = e < 0 ? f : u, d = l[c];
|
|
@@ -468,38 +468,38 @@ function Z({
|
|
|
468
468
|
d != null,
|
|
469
469
|
`Previous layout not found for panel index ${c}`
|
|
470
470
|
);
|
|
471
|
-
const
|
|
471
|
+
const S = d + p, y = H({
|
|
472
472
|
panelConstraints: n[c],
|
|
473
|
-
size:
|
|
473
|
+
size: S
|
|
474
474
|
});
|
|
475
|
-
if (s[c] =
|
|
476
|
-
let v =
|
|
477
|
-
for (;
|
|
478
|
-
const
|
|
475
|
+
if (s[c] = y, !M(y, S)) {
|
|
476
|
+
let v = S - y, g = e < 0 ? f : u;
|
|
477
|
+
for (; g >= 0 && g < n.length; ) {
|
|
478
|
+
const L = s[g];
|
|
479
479
|
z(
|
|
480
|
-
|
|
481
|
-
`Previous layout not found for panel index ${
|
|
480
|
+
L != null,
|
|
481
|
+
`Previous layout not found for panel index ${g}`
|
|
482
482
|
);
|
|
483
|
-
const
|
|
484
|
-
panelConstraints: n[
|
|
485
|
-
size:
|
|
483
|
+
const P = L + v, R = H({
|
|
484
|
+
panelConstraints: n[g],
|
|
485
|
+
size: P
|
|
486
486
|
});
|
|
487
|
-
if (
|
|
487
|
+
if (M(L, R) || (v -= R - L, s[g] = R), M(v, 0))
|
|
488
488
|
break;
|
|
489
|
-
e > 0 ?
|
|
489
|
+
e > 0 ? g-- : g++;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
const
|
|
493
|
+
const h = Object.values(s).reduce(
|
|
494
494
|
(c, d) => d + c,
|
|
495
495
|
0
|
|
496
496
|
);
|
|
497
|
-
if (!
|
|
497
|
+
if (!M(h, 100, 0.1))
|
|
498
498
|
return i;
|
|
499
|
-
const
|
|
500
|
-
return s.reduce((c, d,
|
|
499
|
+
const m = Object.keys(i);
|
|
500
|
+
return s.reduce((c, d, S) => (c[m[S]] = d, c), {});
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function ee(e) {
|
|
503
503
|
const { mountedGroups: t } = D();
|
|
504
504
|
for (const [n] of t)
|
|
505
505
|
if (n.separators.some(
|
|
@@ -508,15 +508,15 @@ function te(e) {
|
|
|
508
508
|
return n;
|
|
509
509
|
throw Error("Could not find parent Group for separator element");
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function U(e, t) {
|
|
512
512
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
513
513
|
return !1;
|
|
514
514
|
for (const n in e)
|
|
515
|
-
if (t[n] === void 0 ||
|
|
515
|
+
if (t[n] === void 0 || X(e[n], t[n]) !== 0)
|
|
516
516
|
return !1;
|
|
517
517
|
return !0;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function F({
|
|
520
520
|
layout: e,
|
|
521
521
|
panelConstraints: t
|
|
522
522
|
}) {
|
|
@@ -528,7 +528,7 @@ function _({
|
|
|
528
528
|
throw Error(
|
|
529
529
|
`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
|
|
530
530
|
);
|
|
531
|
-
if (!
|
|
531
|
+
if (!M(i, 100) && o.length > 0)
|
|
532
532
|
for (let r = 0; r < t.length; r++) {
|
|
533
533
|
const s = o[r];
|
|
534
534
|
z(s != null, `No layout data found for index ${r}`);
|
|
@@ -545,7 +545,7 @@ function _({
|
|
|
545
545
|
});
|
|
546
546
|
s != u && (a += s - u, o[r] = u);
|
|
547
547
|
}
|
|
548
|
-
if (!
|
|
548
|
+
if (!M(a, 0))
|
|
549
549
|
for (let r = 0; r < t.length; r++) {
|
|
550
550
|
const s = o[r];
|
|
551
551
|
z(s != null, `No layout data found for index ${r}`);
|
|
@@ -553,13 +553,13 @@ function _({
|
|
|
553
553
|
panelConstraints: t[r],
|
|
554
554
|
size: u
|
|
555
555
|
});
|
|
556
|
-
if (s !== f && (a -= f - s, o[r] = f,
|
|
556
|
+
if (s !== f && (a -= f - s, o[r] = f, M(a, 0)))
|
|
557
557
|
break;
|
|
558
558
|
}
|
|
559
559
|
const l = Object.keys(e);
|
|
560
560
|
return o.reduce((r, s, u) => (r[l[u]] = s, r), {});
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Ie({
|
|
563
563
|
groupId: e
|
|
564
564
|
}) {
|
|
565
565
|
const t = () => {
|
|
@@ -581,11 +581,11 @@ function ke({
|
|
|
581
581
|
group: a,
|
|
582
582
|
layout: l,
|
|
583
583
|
separatorToPanels: r
|
|
584
|
-
} = t(), s =
|
|
584
|
+
} = t(), s = F({
|
|
585
585
|
layout: n,
|
|
586
586
|
panelConstraints: i
|
|
587
587
|
});
|
|
588
|
-
return o ? l : (
|
|
588
|
+
return o ? l : (U(l, s) || I((u) => ({
|
|
589
589
|
mountedGroups: new Map(u.mountedGroups).set(a, {
|
|
590
590
|
defaultLayoutDeferred: o,
|
|
591
591
|
derivedPanelConstraints: i,
|
|
@@ -600,25 +600,25 @@ function Ge(e) {
|
|
|
600
600
|
const { mountedGroups: t } = D(), n = t.get(e);
|
|
601
601
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
const n =
|
|
603
|
+
function _(e, t) {
|
|
604
|
+
const n = ee(e), o = Ge(n), i = n.separators.find(
|
|
605
605
|
(p) => p.element === e
|
|
606
606
|
);
|
|
607
607
|
z(i, "Matching separator not found");
|
|
608
608
|
const a = o.separatorToPanels.get(i);
|
|
609
609
|
z(a, "Matching panels not found");
|
|
610
|
-
const l = a.map((p) => n.panels.indexOf(p)), s =
|
|
610
|
+
const l = a.map((p) => n.panels.indexOf(p)), s = Ie({ groupId: n.id }).getLayout(), u = q({
|
|
611
611
|
delta: t,
|
|
612
612
|
initialLayout: s,
|
|
613
613
|
panelConstraints: o.derivedPanelConstraints,
|
|
614
614
|
pivotIndices: l,
|
|
615
615
|
prevLayout: s,
|
|
616
616
|
trigger: "keyboard"
|
|
617
|
-
}), f =
|
|
617
|
+
}), f = F({
|
|
618
618
|
layout: u,
|
|
619
619
|
panelConstraints: o.derivedPanelConstraints
|
|
620
620
|
});
|
|
621
|
-
|
|
621
|
+
U(s, f) || I((p) => ({
|
|
622
622
|
mountedGroups: new Map(p.mountedGroups).set(n, {
|
|
623
623
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
624
624
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -627,35 +627,35 @@ function O(e, t) {
|
|
|
627
627
|
})
|
|
628
628
|
}));
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function he(e) {
|
|
631
631
|
if (e.defaultPrevented)
|
|
632
632
|
return;
|
|
633
|
-
const t = e.currentTarget, n =
|
|
633
|
+
const t = e.currentTarget, n = ee(t);
|
|
634
634
|
if (!n.disabled)
|
|
635
635
|
switch (e.key) {
|
|
636
636
|
case "ArrowDown": {
|
|
637
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
637
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, 5);
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
640
|
case "ArrowLeft": {
|
|
641
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
641
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
|
|
642
642
|
break;
|
|
643
643
|
}
|
|
644
644
|
case "ArrowRight": {
|
|
645
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
645
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
|
|
646
646
|
break;
|
|
647
647
|
}
|
|
648
648
|
case "ArrowUp": {
|
|
649
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
649
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, -5);
|
|
650
650
|
break;
|
|
651
651
|
}
|
|
652
652
|
case "End": {
|
|
653
|
-
e.preventDefault(),
|
|
653
|
+
e.preventDefault(), _(t, 100);
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
656
|
case "Enter": {
|
|
657
657
|
e.preventDefault();
|
|
658
|
-
const o =
|
|
658
|
+
const o = ee(t), { derivedPanelConstraints: i, layout: a, separatorToPanels: l } = Ge(o), r = o.separators.find(
|
|
659
659
|
(p) => p.element === t
|
|
660
660
|
);
|
|
661
661
|
z(r, "Matching separator not found");
|
|
@@ -665,14 +665,14 @@ function me(e) {
|
|
|
665
665
|
(p) => p.panelId === u.id
|
|
666
666
|
);
|
|
667
667
|
if (z(f, "Panel metadata not found"), f.collapsible) {
|
|
668
|
-
const p = a[u.id],
|
|
669
|
-
|
|
668
|
+
const p = a[u.id], h = f.collapsedSize === p ? o.inMemoryLastExpandedPanelSizes[u.id] ?? f.minSize : f.collapsedSize;
|
|
669
|
+
_(t, h - p);
|
|
670
670
|
}
|
|
671
671
|
break;
|
|
672
672
|
}
|
|
673
673
|
case "F6": {
|
|
674
674
|
e.preventDefault();
|
|
675
|
-
const i =
|
|
675
|
+
const i = ee(t).separators.map(
|
|
676
676
|
(s) => s.element
|
|
677
677
|
), a = Array.from(i).findIndex(
|
|
678
678
|
(s) => s === e.currentTarget
|
|
@@ -683,17 +683,17 @@ function me(e) {
|
|
|
683
683
|
break;
|
|
684
684
|
}
|
|
685
685
|
case "Home": {
|
|
686
|
-
e.preventDefault(),
|
|
686
|
+
e.preventDefault(), _(t, -100);
|
|
687
687
|
break;
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
const
|
|
692
|
-
}, De = 1, Oe = 2, Te = 4, Ne = 8,
|
|
691
|
+
const it = (e) => e, ie = () => {
|
|
692
|
+
}, De = 1, Oe = 2, Te = 4, Ne = 8, me = {
|
|
693
693
|
coarse: 10,
|
|
694
694
|
precise: 5
|
|
695
695
|
};
|
|
696
|
-
function
|
|
696
|
+
function st(e, t, n) {
|
|
697
697
|
let o, i = {
|
|
698
698
|
x: 1 / 0,
|
|
699
699
|
y: 1 / 0
|
|
@@ -716,14 +716,14 @@ function ut(e, t, n) {
|
|
|
716
716
|
hitRegion: o
|
|
717
717
|
} : void 0;
|
|
718
718
|
}
|
|
719
|
-
let
|
|
720
|
-
function
|
|
721
|
-
return
|
|
719
|
+
let Q;
|
|
720
|
+
function at() {
|
|
721
|
+
return Q === void 0 && (typeof matchMedia == "function" ? Q = !!matchMedia("(pointer:coarse)").matches : Q = !1), Q;
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function lt(e) {
|
|
724
724
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function ut(e, t) {
|
|
727
727
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
728
728
|
const n = {
|
|
729
729
|
a: Se(e),
|
|
@@ -754,20 +754,20 @@ function dt(e, t) {
|
|
|
754
754
|
}
|
|
755
755
|
return Math.sign(i.a - i.b);
|
|
756
756
|
}
|
|
757
|
-
const
|
|
758
|
-
function
|
|
757
|
+
const ct = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
758
|
+
function ft(e) {
|
|
759
759
|
const t = getComputedStyle(_e(e) ?? e).display;
|
|
760
760
|
return t === "flex" || t === "inline-flex";
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function dt(e) {
|
|
763
763
|
const t = getComputedStyle(e);
|
|
764
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
764
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ft(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || ct.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
765
765
|
}
|
|
766
766
|
function ye(e) {
|
|
767
767
|
let t = e.length;
|
|
768
768
|
for (; t--; ) {
|
|
769
769
|
const n = e[t];
|
|
770
|
-
if (z(n, "Missing node"),
|
|
770
|
+
if (z(n, "Missing node"), dt(n)) return n;
|
|
771
771
|
}
|
|
772
772
|
return null;
|
|
773
773
|
}
|
|
@@ -782,24 +782,24 @@ function Se(e) {
|
|
|
782
782
|
}
|
|
783
783
|
function _e(e) {
|
|
784
784
|
const { parentNode: t } = e;
|
|
785
|
-
return
|
|
785
|
+
return lt(t) ? t.host : t;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function pt(e, t) {
|
|
788
788
|
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function ht({
|
|
791
791
|
groupElement: e,
|
|
792
792
|
hitRegion: t,
|
|
793
793
|
pointerEventTarget: n
|
|
794
794
|
}) {
|
|
795
795
|
if (!Me(n) || n.contains(e) || e.contains(n))
|
|
796
796
|
return !0;
|
|
797
|
-
if (
|
|
797
|
+
if (ut(n, e) > 0) {
|
|
798
798
|
let o = n;
|
|
799
799
|
for (; o; ) {
|
|
800
800
|
if (o.contains(e))
|
|
801
801
|
return !0;
|
|
802
|
-
if (
|
|
802
|
+
if (pt(o.getBoundingClientRect(), t))
|
|
803
803
|
return !1;
|
|
804
804
|
o = o.parentElement;
|
|
805
805
|
}
|
|
@@ -811,11 +811,11 @@ function Ae(e, t) {
|
|
|
811
811
|
return t.forEach((o, i) => {
|
|
812
812
|
if (i.disabled)
|
|
813
813
|
return;
|
|
814
|
-
const a =
|
|
814
|
+
const a = at() ? me.coarse : me.precise, l = ke(i), r = st(i.orientation, l, {
|
|
815
815
|
x: e.clientX,
|
|
816
816
|
y: e.clientY
|
|
817
817
|
});
|
|
818
|
-
r && r.distance.x <= a && r.distance.y <= a &&
|
|
818
|
+
r && r.distance.x <= a && r.distance.y <= a && ht({
|
|
819
819
|
groupElement: i.element,
|
|
820
820
|
hitRegion: r.hitRegion.rect,
|
|
821
821
|
pointerEventTarget: e.target
|
|
@@ -844,7 +844,7 @@ function ve(e) {
|
|
|
844
844
|
}
|
|
845
845
|
}), n.length && e.preventDefault();
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function mt({
|
|
848
848
|
cursorFlags: e,
|
|
849
849
|
groups: t,
|
|
850
850
|
state: n
|
|
@@ -888,7 +888,7 @@ function St({
|
|
|
888
888
|
return o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
889
889
|
}
|
|
890
890
|
const xe = /* @__PURE__ */ new WeakMap();
|
|
891
|
-
function
|
|
891
|
+
function ue(e) {
|
|
892
892
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
893
893
|
return;
|
|
894
894
|
let { prevStyle: t, styleSheet: n } = xe.get(e) ?? {};
|
|
@@ -897,7 +897,7 @@ function se(e) {
|
|
|
897
897
|
switch (i.state) {
|
|
898
898
|
case "active":
|
|
899
899
|
case "hover": {
|
|
900
|
-
const a =
|
|
900
|
+
const a = mt({
|
|
901
901
|
cursorFlags: o,
|
|
902
902
|
groups: i.hitRegions.map((r) => r.group),
|
|
903
903
|
state: i.state
|
|
@@ -917,7 +917,7 @@ function se(e) {
|
|
|
917
917
|
styleSheet: n
|
|
918
918
|
});
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function Fe({
|
|
921
921
|
document: e,
|
|
922
922
|
event: t,
|
|
923
923
|
hitRegions: n,
|
|
@@ -928,27 +928,27 @@ function $e({
|
|
|
928
928
|
let l = 0;
|
|
929
929
|
const r = new Map(i);
|
|
930
930
|
n.forEach((s) => {
|
|
931
|
-
const { group: u, groupSize: f } = s, { disableCursor: p, orientation:
|
|
931
|
+
const { group: u, groupSize: f } = s, { disableCursor: p, orientation: h, panels: m } = u;
|
|
932
932
|
let c = 0;
|
|
933
|
-
a ?
|
|
933
|
+
a ? h === "horizontal" ? c = (t.clientX - a.x) / f * 100 : c = (t.clientY - a.y) / f * 100 : h === "horizontal" ? c = t.clientX < 0 ? -100 : 100 : c = t.clientY < 0 ? -100 : 100;
|
|
934
934
|
const d = o.get(u), {
|
|
935
|
-
defaultLayoutDeferred:
|
|
936
|
-
derivedPanelConstraints:
|
|
935
|
+
defaultLayoutDeferred: S,
|
|
936
|
+
derivedPanelConstraints: y,
|
|
937
937
|
layout: v,
|
|
938
938
|
separatorToPanels: x
|
|
939
939
|
} = i.get(u) ?? { defaultLayoutDeferred: !1 };
|
|
940
|
-
if (
|
|
941
|
-
const
|
|
940
|
+
if (y && d && v && x) {
|
|
941
|
+
const g = q({
|
|
942
942
|
delta: c,
|
|
943
943
|
initialLayout: d,
|
|
944
|
-
panelConstraints:
|
|
945
|
-
pivotIndices: s.panels.map((
|
|
944
|
+
panelConstraints: y,
|
|
945
|
+
pivotIndices: s.panels.map((L) => m.indexOf(L)),
|
|
946
946
|
prevLayout: v,
|
|
947
947
|
trigger: "mouse-or-touch"
|
|
948
948
|
});
|
|
949
|
-
if (
|
|
949
|
+
if (U(g, v)) {
|
|
950
950
|
if (c !== 0 && !p)
|
|
951
|
-
switch (
|
|
951
|
+
switch (h) {
|
|
952
952
|
case "horizontal": {
|
|
953
953
|
l |= c < 0 ? De : Oe;
|
|
954
954
|
break;
|
|
@@ -960,25 +960,25 @@ function $e({
|
|
|
960
960
|
}
|
|
961
961
|
} else {
|
|
962
962
|
r.set(s.group, {
|
|
963
|
-
defaultLayoutDeferred:
|
|
964
|
-
derivedPanelConstraints:
|
|
965
|
-
layout:
|
|
963
|
+
defaultLayoutDeferred: S,
|
|
964
|
+
derivedPanelConstraints: y,
|
|
965
|
+
layout: g,
|
|
966
966
|
separatorToPanels: x
|
|
967
967
|
});
|
|
968
|
-
const
|
|
969
|
-
s.group.inMemoryLayouts[
|
|
968
|
+
const L = s.group.panels.map(({ id: P }) => P).join(",");
|
|
969
|
+
s.group.inMemoryLayouts[L] = g;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
}), I({
|
|
973
973
|
cursorFlags: l,
|
|
974
974
|
mountedGroups: r
|
|
975
|
-
}),
|
|
975
|
+
}), ue(e);
|
|
976
976
|
}
|
|
977
977
|
function ze(e) {
|
|
978
978
|
const { interactionState: t, mountedGroups: n } = D();
|
|
979
979
|
switch (t.state) {
|
|
980
980
|
case "active":
|
|
981
|
-
|
|
981
|
+
Fe({
|
|
982
982
|
document: e.currentTarget,
|
|
983
983
|
event: e,
|
|
984
984
|
hitRegions: t.hitRegions,
|
|
@@ -1007,7 +1007,7 @@ function be(e) {
|
|
|
1007
1007
|
);
|
|
1008
1008
|
return;
|
|
1009
1009
|
}
|
|
1010
|
-
|
|
1010
|
+
Fe({
|
|
1011
1011
|
document: e.currentTarget,
|
|
1012
1012
|
event: e,
|
|
1013
1013
|
hitRegions: t.hitRegions,
|
|
@@ -1026,7 +1026,7 @@ function be(e) {
|
|
|
1026
1026
|
hitRegions: o,
|
|
1027
1027
|
state: "hover"
|
|
1028
1028
|
}
|
|
1029
|
-
}),
|
|
1029
|
+
}), ue(e.currentTarget);
|
|
1030
1030
|
break;
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
@@ -1045,7 +1045,7 @@ function we(e) {
|
|
|
1045
1045
|
interactionState: {
|
|
1046
1046
|
state: "inactive"
|
|
1047
1047
|
}
|
|
1048
|
-
}),
|
|
1048
|
+
}), ue(e.currentTarget);
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
1051
|
function Le(e) {
|
|
@@ -1066,19 +1066,19 @@ function Le(e) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
return o;
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1069
|
+
function yt(e, t, n) {
|
|
1070
1070
|
if (!n[0])
|
|
1071
1071
|
return;
|
|
1072
1072
|
const i = e.panels.find((u) => u.element === t);
|
|
1073
1073
|
if (!i || !i.onResize)
|
|
1074
1074
|
return;
|
|
1075
|
-
const a =
|
|
1075
|
+
const a = V({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, s = {
|
|
1076
1076
|
asPercentage: G(l / a * 100),
|
|
1077
1077
|
inPixels: l
|
|
1078
1078
|
};
|
|
1079
1079
|
i.mutableValues.prevSize = s, i.onResize(s, i.id, r);
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function gt(e, t) {
|
|
1082
1082
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1083
1083
|
return !1;
|
|
1084
1084
|
for (const o in e)
|
|
@@ -1086,7 +1086,7 @@ function xt(e, t) {
|
|
|
1086
1086
|
return !1;
|
|
1087
1087
|
return !0;
|
|
1088
1088
|
}
|
|
1089
|
-
function
|
|
1089
|
+
function St(e, t) {
|
|
1090
1090
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1091
1091
|
if (n.length !== o.length)
|
|
1092
1092
|
return !1;
|
|
@@ -1096,7 +1096,7 @@ function zt(e, t) {
|
|
|
1096
1096
|
return !0;
|
|
1097
1097
|
}
|
|
1098
1098
|
const j = /* @__PURE__ */ new Map();
|
|
1099
|
-
function
|
|
1099
|
+
function vt(e) {
|
|
1100
1100
|
let t = !0;
|
|
1101
1101
|
z(
|
|
1102
1102
|
e.element.ownerDocument.defaultView,
|
|
@@ -1104,27 +1104,27 @@ function bt(e) {
|
|
|
1104
1104
|
);
|
|
1105
1105
|
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = new n((c) => {
|
|
1106
1106
|
for (const d of c) {
|
|
1107
|
-
const { borderBoxSize:
|
|
1108
|
-
if (
|
|
1107
|
+
const { borderBoxSize: S, target: y } = d;
|
|
1108
|
+
if (y === e.element) {
|
|
1109
1109
|
if (t) {
|
|
1110
|
-
if (
|
|
1110
|
+
if (V({ group: e }) === 0)
|
|
1111
1111
|
return;
|
|
1112
1112
|
I((x) => {
|
|
1113
|
-
const
|
|
1114
|
-
if (
|
|
1115
|
-
const
|
|
1116
|
-
layout:
|
|
1117
|
-
panelConstraints:
|
|
1113
|
+
const g = x.mountedGroups.get(e);
|
|
1114
|
+
if (g) {
|
|
1115
|
+
const L = pe(e), P = g.defaultLayoutDeferred ? Le(L) : g.layout, R = F({
|
|
1116
|
+
layout: P,
|
|
1117
|
+
panelConstraints: L
|
|
1118
1118
|
});
|
|
1119
|
-
return !
|
|
1120
|
-
|
|
1121
|
-
|
|
1119
|
+
return !g.defaultLayoutDeferred && U(P, R) && gt(
|
|
1120
|
+
g.derivedPanelConstraints,
|
|
1121
|
+
L
|
|
1122
1122
|
) ? x : {
|
|
1123
1123
|
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1124
1124
|
defaultLayoutDeferred: !1,
|
|
1125
|
-
derivedPanelConstraints:
|
|
1126
|
-
layout:
|
|
1127
|
-
separatorToPanels:
|
|
1125
|
+
derivedPanelConstraints: L,
|
|
1126
|
+
layout: R,
|
|
1127
|
+
separatorToPanels: g.separatorToPanels
|
|
1128
1128
|
})
|
|
1129
1129
|
};
|
|
1130
1130
|
}
|
|
@@ -1132,7 +1132,7 @@ function bt(e) {
|
|
|
1132
1132
|
});
|
|
1133
1133
|
}
|
|
1134
1134
|
} else
|
|
1135
|
-
|
|
1135
|
+
yt(e, y, S);
|
|
1136
1136
|
}
|
|
1137
1137
|
});
|
|
1138
1138
|
a.observe(e.element), e.panels.forEach((c) => {
|
|
@@ -1141,20 +1141,20 @@ function bt(e) {
|
|
|
1141
1141
|
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1142
1142
|
), o.add(c.id), c.onResize && a.observe(c.element);
|
|
1143
1143
|
});
|
|
1144
|
-
const l =
|
|
1144
|
+
const l = V({ group: e }), r = pe(e), s = e.panels.map(({ id: c }) => c).join(",");
|
|
1145
1145
|
let u = e.defaultLayout;
|
|
1146
|
-
u && (
|
|
1147
|
-
const f = e.inMemoryLayouts[s] ?? u ?? Le(r), p =
|
|
1146
|
+
u && (St(e.panels, u) || (u = void 0));
|
|
1147
|
+
const f = e.inMemoryLayouts[s] ?? u ?? Le(r), p = F({
|
|
1148
1148
|
layout: f,
|
|
1149
1149
|
panelConstraints: r
|
|
1150
|
-
}),
|
|
1150
|
+
}), h = ke(e), m = e.element.ownerDocument;
|
|
1151
1151
|
return I((c) => {
|
|
1152
1152
|
const d = /* @__PURE__ */ new Map();
|
|
1153
1153
|
return j.set(
|
|
1154
|
-
|
|
1155
|
-
(j.get(
|
|
1156
|
-
),
|
|
1157
|
-
|
|
1154
|
+
m,
|
|
1155
|
+
(j.get(m) ?? 0) + 1
|
|
1156
|
+
), h.forEach((S) => {
|
|
1157
|
+
S.separator && d.set(S.separator, S.panels);
|
|
1158
1158
|
}), {
|
|
1159
1159
|
mountedGroups: new Map(c.mountedGroups).set(e, {
|
|
1160
1160
|
defaultLayoutDeferred: l === 0,
|
|
@@ -1167,43 +1167,43 @@ function bt(e) {
|
|
|
1167
1167
|
z(
|
|
1168
1168
|
!i.has(c.id),
|
|
1169
1169
|
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1170
|
-
), i.add(c.id), c.element.addEventListener("keydown",
|
|
1171
|
-
}), j.get(
|
|
1170
|
+
), i.add(c.id), c.element.addEventListener("keydown", he);
|
|
1171
|
+
}), j.get(m) === 1 && (m.addEventListener("pointerdown", ve, !0), m.addEventListener("pointerleave", ze), m.addEventListener("pointermove", be), m.addEventListener("pointerup", we, !0)), function() {
|
|
1172
1172
|
t = !1, j.set(
|
|
1173
|
-
|
|
1174
|
-
Math.max(0, (j.get(
|
|
1173
|
+
m,
|
|
1174
|
+
Math.max(0, (j.get(m) ?? 0) - 1)
|
|
1175
1175
|
), I((d) => {
|
|
1176
|
-
const
|
|
1177
|
-
return
|
|
1176
|
+
const S = new Map(d.mountedGroups);
|
|
1177
|
+
return S.delete(e), { mountedGroups: S };
|
|
1178
1178
|
}), e.separators.forEach((d) => {
|
|
1179
|
-
d.element.removeEventListener("keydown",
|
|
1180
|
-
}), j.get(
|
|
1179
|
+
d.element.removeEventListener("keydown", he);
|
|
1180
|
+
}), j.get(m) || (m.removeEventListener(
|
|
1181
1181
|
"pointerdown",
|
|
1182
1182
|
ve,
|
|
1183
1183
|
!0
|
|
1184
|
-
),
|
|
1184
|
+
), m.removeEventListener("pointerleave", ze), m.removeEventListener("pointermove", be), m.removeEventListener("pointerup", we, !0)), a.disconnect();
|
|
1185
1185
|
};
|
|
1186
1186
|
}
|
|
1187
|
-
function
|
|
1188
|
-
const [e, t] =
|
|
1187
|
+
function $e() {
|
|
1188
|
+
const [e, t] = K({}), n = Pe(() => t({}), []);
|
|
1189
1189
|
return [e, n];
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1192
|
-
const t =
|
|
1191
|
+
function ce(e) {
|
|
1192
|
+
const t = Ue();
|
|
1193
1193
|
return `${e ?? t}`;
|
|
1194
1194
|
}
|
|
1195
|
-
const
|
|
1196
|
-
function
|
|
1197
|
-
const t =
|
|
1198
|
-
return
|
|
1195
|
+
const $ = typeof window < "u" ? We : Re;
|
|
1196
|
+
function te(e) {
|
|
1197
|
+
const t = k(e);
|
|
1198
|
+
return $(() => {
|
|
1199
1199
|
t.current = e;
|
|
1200
1200
|
}, [e]), Pe(
|
|
1201
1201
|
(...n) => t.current?.(...n),
|
|
1202
1202
|
[t]
|
|
1203
1203
|
);
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1206
|
-
return
|
|
1205
|
+
function fe(...e) {
|
|
1206
|
+
return te((t) => {
|
|
1207
1207
|
e.forEach((n) => {
|
|
1208
1208
|
if (n)
|
|
1209
1209
|
switch (typeof n) {
|
|
@@ -1219,32 +1219,27 @@ function ue(...e) {
|
|
|
1219
1219
|
});
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1223
|
-
const t =
|
|
1224
|
-
return
|
|
1222
|
+
function xt(e) {
|
|
1223
|
+
const t = k({ ...e });
|
|
1224
|
+
return $(() => {
|
|
1225
1225
|
for (const n in e)
|
|
1226
1226
|
t.current[n] = e[n];
|
|
1227
1227
|
}, [e]), t.current;
|
|
1228
1228
|
}
|
|
1229
|
-
const
|
|
1230
|
-
function
|
|
1231
|
-
const n =
|
|
1232
|
-
return `--react-resizable-panels--${n}--${o}`;
|
|
1233
|
-
}
|
|
1234
|
-
const je = qe(null);
|
|
1235
|
-
function Pt(e, t) {
|
|
1236
|
-
const n = E({
|
|
1229
|
+
const je = Be(null);
|
|
1230
|
+
function zt(e, t) {
|
|
1231
|
+
const n = k({
|
|
1237
1232
|
getLayout: () => ({}),
|
|
1238
|
-
setLayout:
|
|
1233
|
+
setLayout: it
|
|
1239
1234
|
});
|
|
1240
|
-
Ce(t, () => n.current, []),
|
|
1235
|
+
Ce(t, () => n.current, []), $(() => {
|
|
1241
1236
|
Object.assign(
|
|
1242
1237
|
n.current,
|
|
1243
|
-
|
|
1238
|
+
Ie({ groupId: e })
|
|
1244
1239
|
);
|
|
1245
1240
|
});
|
|
1246
1241
|
}
|
|
1247
|
-
function
|
|
1242
|
+
function bt({
|
|
1248
1243
|
children: e,
|
|
1249
1244
|
className: t,
|
|
1250
1245
|
defaultLayout: n,
|
|
@@ -1258,121 +1253,133 @@ function Rt({
|
|
|
1258
1253
|
style: f,
|
|
1259
1254
|
...p
|
|
1260
1255
|
}) {
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
}), c =
|
|
1256
|
+
const h = k({}), m = te((b) => {
|
|
1257
|
+
U(h.current, b) || (h.current = b, s?.(b));
|
|
1258
|
+
}), c = ce(r), d = k(null), [S, y] = $e(), v = k({
|
|
1264
1259
|
lastExpandedPanelSizes: {},
|
|
1265
1260
|
layouts: {},
|
|
1266
1261
|
panels: [],
|
|
1267
1262
|
separators: []
|
|
1268
|
-
}),
|
|
1269
|
-
|
|
1270
|
-
const
|
|
1263
|
+
}), x = fe(d, a);
|
|
1264
|
+
zt(c, l);
|
|
1265
|
+
const g = te(
|
|
1266
|
+
(b, w) => {
|
|
1267
|
+
const { interactionState: C, mountedGroups: O } = D();
|
|
1268
|
+
for (const T of O.keys())
|
|
1269
|
+
if (T.id === b) {
|
|
1270
|
+
const N = O.get(T);
|
|
1271
|
+
if (N) {
|
|
1272
|
+
let Y = !1;
|
|
1273
|
+
switch (C.state) {
|
|
1274
|
+
case "active": {
|
|
1275
|
+
Y = C.hitRegions.some(
|
|
1276
|
+
(ne) => ne.group === T
|
|
1277
|
+
);
|
|
1278
|
+
break;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
return {
|
|
1282
|
+
flexGrow: N.layout[w] ?? 1,
|
|
1283
|
+
pointerEvents: Y ? "none" : void 0
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
return {
|
|
1288
|
+
flexGrow: n?.[w] ?? 1
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
), L = ae(
|
|
1271
1292
|
() => ({
|
|
1293
|
+
getPanelStyles: g,
|
|
1272
1294
|
id: c,
|
|
1273
1295
|
orientation: u,
|
|
1274
|
-
registerPanel: (
|
|
1275
|
-
const
|
|
1276
|
-
return
|
|
1277
|
-
...
|
|
1278
|
-
|
|
1279
|
-
]),
|
|
1280
|
-
|
|
1281
|
-
(
|
|
1282
|
-
),
|
|
1296
|
+
registerPanel: (b) => {
|
|
1297
|
+
const w = v.current;
|
|
1298
|
+
return w.panels = le(u, [
|
|
1299
|
+
...w.panels,
|
|
1300
|
+
b
|
|
1301
|
+
]), y(), () => {
|
|
1302
|
+
w.panels = w.panels.filter(
|
|
1303
|
+
(C) => C !== b
|
|
1304
|
+
), y();
|
|
1283
1305
|
};
|
|
1284
1306
|
},
|
|
1285
|
-
registerSeparator: (
|
|
1286
|
-
const
|
|
1287
|
-
return
|
|
1288
|
-
...
|
|
1289
|
-
|
|
1290
|
-
]),
|
|
1291
|
-
|
|
1292
|
-
(
|
|
1293
|
-
),
|
|
1307
|
+
registerSeparator: (b) => {
|
|
1308
|
+
const w = v.current;
|
|
1309
|
+
return w.separators = le(u, [
|
|
1310
|
+
...w.separators,
|
|
1311
|
+
b
|
|
1312
|
+
]), y(), () => {
|
|
1313
|
+
w.separators = w.separators.filter(
|
|
1314
|
+
(C) => C !== b
|
|
1315
|
+
), y();
|
|
1294
1316
|
};
|
|
1295
1317
|
}
|
|
1296
1318
|
}),
|
|
1297
|
-
[c,
|
|
1298
|
-
),
|
|
1319
|
+
[g, c, y, u]
|
|
1320
|
+
), P = xt({
|
|
1299
1321
|
defaultLayout: n,
|
|
1300
1322
|
disableCursor: o
|
|
1301
|
-
}),
|
|
1302
|
-
|
|
1303
|
-
const
|
|
1304
|
-
if (
|
|
1323
|
+
}), R = k(null);
|
|
1324
|
+
return $(() => {
|
|
1325
|
+
const b = d.current;
|
|
1326
|
+
if (b === null)
|
|
1305
1327
|
return;
|
|
1306
|
-
const
|
|
1307
|
-
defaultLayout:
|
|
1308
|
-
disableCursor: !!
|
|
1328
|
+
const w = v.current, C = {
|
|
1329
|
+
defaultLayout: P.defaultLayout,
|
|
1330
|
+
disableCursor: !!P.disableCursor,
|
|
1309
1331
|
disabled: !!i,
|
|
1310
|
-
element:
|
|
1332
|
+
element: b,
|
|
1311
1333
|
id: c,
|
|
1312
|
-
inMemoryLastExpandedPanelSizes:
|
|
1313
|
-
inMemoryLayouts:
|
|
1334
|
+
inMemoryLastExpandedPanelSizes: v.current.lastExpandedPanelSizes,
|
|
1335
|
+
inMemoryLayouts: v.current.layouts,
|
|
1314
1336
|
orientation: u,
|
|
1315
|
-
panels:
|
|
1316
|
-
separators:
|
|
1337
|
+
panels: w.panels,
|
|
1338
|
+
separators: w.separators
|
|
1317
1339
|
};
|
|
1318
|
-
|
|
1319
|
-
const
|
|
1320
|
-
if (
|
|
1321
|
-
const { defaultLayoutDeferred:
|
|
1322
|
-
!
|
|
1340
|
+
R.current = C;
|
|
1341
|
+
const O = vt(C), N = D().mountedGroups.get(C);
|
|
1342
|
+
if (N) {
|
|
1343
|
+
const { defaultLayoutDeferred: W, derivedPanelConstraints: J, layout: oe } = N;
|
|
1344
|
+
!W && J.length > 0 && (m?.(oe), w.panels.forEach((re) => {
|
|
1345
|
+
re.scheduleUpdate();
|
|
1346
|
+
}));
|
|
1323
1347
|
}
|
|
1324
|
-
const
|
|
1348
|
+
const Y = A.addListener(
|
|
1325
1349
|
"interactionStateChange",
|
|
1326
|
-
(
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
F.hitRegions.some(
|
|
1331
|
-
(V) => V.group === k
|
|
1332
|
-
)
|
|
1333
|
-
);
|
|
1334
|
-
break;
|
|
1335
|
-
}
|
|
1336
|
-
default: {
|
|
1337
|
-
g(!1);
|
|
1338
|
-
break;
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1350
|
+
() => {
|
|
1351
|
+
w.panels.forEach((W) => {
|
|
1352
|
+
W.scheduleUpdate();
|
|
1353
|
+
});
|
|
1341
1354
|
}
|
|
1342
|
-
),
|
|
1355
|
+
), ne = A.addListener(
|
|
1343
1356
|
"mountedGroupsChange",
|
|
1344
|
-
(
|
|
1345
|
-
const
|
|
1346
|
-
if (
|
|
1347
|
-
const { defaultLayoutDeferred:
|
|
1348
|
-
if (
|
|
1357
|
+
(W) => {
|
|
1358
|
+
const J = W.get(C);
|
|
1359
|
+
if (J) {
|
|
1360
|
+
const { defaultLayoutDeferred: oe, derivedPanelConstraints: re, layout: He } = J;
|
|
1361
|
+
if (oe || re.length === 0)
|
|
1349
1362
|
return;
|
|
1350
|
-
|
|
1363
|
+
m?.(He), w.panels.forEach((Ve) => {
|
|
1364
|
+
Ve.scheduleUpdate();
|
|
1365
|
+
});
|
|
1351
1366
|
}
|
|
1352
1367
|
}
|
|
1353
1368
|
);
|
|
1354
1369
|
return () => {
|
|
1355
|
-
|
|
1370
|
+
R.current = null, O(), Y(), ne();
|
|
1356
1371
|
};
|
|
1357
1372
|
}, [
|
|
1358
1373
|
i,
|
|
1359
1374
|
c,
|
|
1360
|
-
|
|
1375
|
+
m,
|
|
1361
1376
|
u,
|
|
1362
1377
|
S,
|
|
1363
|
-
|
|
1378
|
+
P
|
|
1364
1379
|
]), Re(() => {
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1367
|
-
})
|
|
1368
|
-
const X = {
|
|
1369
|
-
[Fe]: y ? "none" : void 0
|
|
1370
|
-
};
|
|
1371
|
-
for (const L in v) {
|
|
1372
|
-
const P = Ve(c, L), k = v[L];
|
|
1373
|
-
X[P] = k;
|
|
1374
|
-
}
|
|
1375
|
-
return /* @__PURE__ */ q(je.Provider, { value: U, children: /* @__PURE__ */ q(
|
|
1380
|
+
const b = R.current;
|
|
1381
|
+
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1382
|
+
}), /* @__PURE__ */ B(je.Provider, { value: L, children: /* @__PURE__ */ B(
|
|
1376
1383
|
"div",
|
|
1377
1384
|
{
|
|
1378
1385
|
...p,
|
|
@@ -1381,13 +1388,12 @@ function Rt({
|
|
|
1381
1388
|
"data-group": !0,
|
|
1382
1389
|
"data-testid": c,
|
|
1383
1390
|
id: c,
|
|
1384
|
-
ref:
|
|
1391
|
+
ref: x,
|
|
1385
1392
|
style: {
|
|
1386
1393
|
height: "100%",
|
|
1387
1394
|
width: "100%",
|
|
1388
1395
|
overflow: "hidden",
|
|
1389
1396
|
...f,
|
|
1390
|
-
...X,
|
|
1391
1397
|
display: "flex",
|
|
1392
1398
|
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1393
1399
|
flexWrap: "nowrap"
|
|
@@ -1396,8 +1402,8 @@ function Rt({
|
|
|
1396
1402
|
}
|
|
1397
1403
|
) });
|
|
1398
1404
|
}
|
|
1399
|
-
|
|
1400
|
-
function
|
|
1405
|
+
bt.displayName = "Group";
|
|
1406
|
+
function wt(e, t = 10) {
|
|
1401
1407
|
let n = null;
|
|
1402
1408
|
return (o) => {
|
|
1403
1409
|
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -1405,57 +1411,57 @@ function Ct(e, t = 10) {
|
|
|
1405
1411
|
}, t);
|
|
1406
1412
|
};
|
|
1407
1413
|
}
|
|
1408
|
-
function
|
|
1414
|
+
function se(e, t) {
|
|
1409
1415
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1410
1416
|
}
|
|
1411
|
-
function
|
|
1417
|
+
function Dt({
|
|
1412
1418
|
debounceSaveMs: e = 100,
|
|
1413
1419
|
panelIds: t,
|
|
1414
1420
|
storage: n = localStorage,
|
|
1415
1421
|
...o
|
|
1416
1422
|
}) {
|
|
1417
|
-
const i = t !== void 0, a = "id" in o ? o.id : o.groupId, l =
|
|
1418
|
-
|
|
1423
|
+
const i = t !== void 0, a = "id" in o ? o.id : o.groupId, l = se(a, t ?? []), r = Ke(
|
|
1424
|
+
Lt,
|
|
1419
1425
|
() => n.getItem(l),
|
|
1420
1426
|
() => n.getItem(l)
|
|
1421
|
-
), s =
|
|
1427
|
+
), s = ae(
|
|
1422
1428
|
() => r ? JSON.parse(r) : void 0,
|
|
1423
1429
|
[r]
|
|
1424
|
-
), u =
|
|
1430
|
+
), u = ae(() => {
|
|
1425
1431
|
const f = (p) => {
|
|
1426
|
-
let
|
|
1427
|
-
i ?
|
|
1432
|
+
let h;
|
|
1433
|
+
i ? h = se(a, Object.keys(p)) : h = se(a, []);
|
|
1428
1434
|
try {
|
|
1429
|
-
n.setItem(
|
|
1430
|
-
} catch (
|
|
1431
|
-
console.error(
|
|
1435
|
+
n.setItem(h, JSON.stringify(p));
|
|
1436
|
+
} catch (m) {
|
|
1437
|
+
console.error(m);
|
|
1432
1438
|
}
|
|
1433
1439
|
};
|
|
1434
|
-
return e > 0 ?
|
|
1440
|
+
return e > 0 ? wt(f, e) : f;
|
|
1435
1441
|
}, [e, i, a, n]);
|
|
1436
1442
|
return {
|
|
1437
1443
|
defaultLayout: s,
|
|
1438
1444
|
onLayoutChange: u
|
|
1439
1445
|
};
|
|
1440
1446
|
}
|
|
1441
|
-
function
|
|
1447
|
+
function Lt() {
|
|
1442
1448
|
return function() {
|
|
1443
1449
|
};
|
|
1444
1450
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return
|
|
1451
|
+
function Ot() {
|
|
1452
|
+
return K(null);
|
|
1447
1453
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1454
|
+
function Tt() {
|
|
1455
|
+
return k(null);
|
|
1450
1456
|
}
|
|
1451
|
-
function
|
|
1452
|
-
const e =
|
|
1457
|
+
function de() {
|
|
1458
|
+
const e = Xe(je);
|
|
1453
1459
|
return z(
|
|
1454
1460
|
e,
|
|
1455
1461
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1456
1462
|
), e;
|
|
1457
1463
|
}
|
|
1458
|
-
function
|
|
1464
|
+
function Pt({
|
|
1459
1465
|
groupId: e,
|
|
1460
1466
|
panelId: t
|
|
1461
1467
|
}) {
|
|
@@ -1467,7 +1473,7 @@ function Et({
|
|
|
1467
1473
|
defaultLayoutDeferred: u,
|
|
1468
1474
|
derivedPanelConstraints: f,
|
|
1469
1475
|
layout: p,
|
|
1470
|
-
separatorToPanels:
|
|
1476
|
+
separatorToPanels: h
|
|
1471
1477
|
}
|
|
1472
1478
|
] of r)
|
|
1473
1479
|
if (s.id === e)
|
|
@@ -1476,7 +1482,7 @@ function Et({
|
|
|
1476
1482
|
derivedPanelConstraints: f,
|
|
1477
1483
|
group: s,
|
|
1478
1484
|
layout: p,
|
|
1479
|
-
separatorToPanels:
|
|
1485
|
+
separatorToPanels: h
|
|
1480
1486
|
};
|
|
1481
1487
|
throw Error(`Group ${e} not found`);
|
|
1482
1488
|
}, o = () => {
|
|
@@ -1504,25 +1510,25 @@ function Et({
|
|
|
1504
1510
|
defaultLayoutDeferred: u,
|
|
1505
1511
|
derivedPanelConstraints: f,
|
|
1506
1512
|
group: p,
|
|
1507
|
-
layout:
|
|
1508
|
-
separatorToPanels:
|
|
1509
|
-
} = n(), c = p.panels.findIndex((v) => v.id === t), d = c === p.panels.length - 1,
|
|
1513
|
+
layout: h,
|
|
1514
|
+
separatorToPanels: m
|
|
1515
|
+
} = n(), c = p.panels.findIndex((v) => v.id === t), d = c === p.panels.length - 1, S = q({
|
|
1510
1516
|
delta: d ? s - r : r - s,
|
|
1511
|
-
initialLayout:
|
|
1517
|
+
initialLayout: h,
|
|
1512
1518
|
panelConstraints: f,
|
|
1513
1519
|
pivotIndices: d ? [c - 1, c] : [c, c + 1],
|
|
1514
|
-
prevLayout:
|
|
1520
|
+
prevLayout: h,
|
|
1515
1521
|
trigger: "imperative-api"
|
|
1516
|
-
}),
|
|
1517
|
-
layout:
|
|
1522
|
+
}), y = F({
|
|
1523
|
+
layout: S,
|
|
1518
1524
|
panelConstraints: f
|
|
1519
1525
|
});
|
|
1520
|
-
|
|
1526
|
+
U(h, y) || I((v) => ({
|
|
1521
1527
|
mountedGroups: new Map(v.mountedGroups).set(p, {
|
|
1522
1528
|
defaultLayoutDeferred: u,
|
|
1523
1529
|
derivedPanelConstraints: f,
|
|
1524
|
-
layout:
|
|
1525
|
-
separatorToPanels:
|
|
1530
|
+
layout: y,
|
|
1531
|
+
separatorToPanels: m
|
|
1526
1532
|
})
|
|
1527
1533
|
}));
|
|
1528
1534
|
};
|
|
@@ -1534,8 +1540,8 @@ function Et({
|
|
|
1534
1540
|
expand: () => {
|
|
1535
1541
|
const { collapsible: r, collapsedSize: s, minSize: u } = o(), { mutableValues: f } = i(), p = a();
|
|
1536
1542
|
if (r && p === s) {
|
|
1537
|
-
let
|
|
1538
|
-
|
|
1543
|
+
let h = f.expandToSize ?? u;
|
|
1544
|
+
h === 0 && (h = 1), l(h);
|
|
1539
1545
|
}
|
|
1540
1546
|
},
|
|
1541
1547
|
getSize: () => {
|
|
@@ -1547,14 +1553,14 @@ function Et({
|
|
|
1547
1553
|
},
|
|
1548
1554
|
isCollapsed: () => {
|
|
1549
1555
|
const { collapsible: r, collapsedSize: s } = o(), u = a();
|
|
1550
|
-
return r &&
|
|
1556
|
+
return r && M(s, u);
|
|
1551
1557
|
},
|
|
1552
1558
|
resize: (r) => {
|
|
1553
1559
|
if (a() !== r) {
|
|
1554
1560
|
let u;
|
|
1555
1561
|
switch (typeof r) {
|
|
1556
1562
|
case "number": {
|
|
1557
|
-
const { group: f } = n(), p =
|
|
1563
|
+
const { group: f } = n(), p = V({ group: f });
|
|
1558
1564
|
u = G(r / p * 100);
|
|
1559
1565
|
break;
|
|
1560
1566
|
}
|
|
@@ -1568,25 +1574,25 @@ function Et({
|
|
|
1568
1574
|
}
|
|
1569
1575
|
};
|
|
1570
1576
|
}
|
|
1571
|
-
function
|
|
1572
|
-
const { id: n } =
|
|
1573
|
-
collapse:
|
|
1574
|
-
expand:
|
|
1577
|
+
function Rt(e, t) {
|
|
1578
|
+
const { id: n } = de(), o = k({
|
|
1579
|
+
collapse: ie,
|
|
1580
|
+
expand: ie,
|
|
1575
1581
|
getSize: () => ({
|
|
1576
1582
|
asPercentage: 0,
|
|
1577
1583
|
inPixels: 0
|
|
1578
1584
|
}),
|
|
1579
1585
|
isCollapsed: () => !1,
|
|
1580
|
-
resize:
|
|
1586
|
+
resize: ie
|
|
1581
1587
|
});
|
|
1582
|
-
Ce(t, () => o.current, []),
|
|
1588
|
+
Ce(t, () => o.current, []), $(() => {
|
|
1583
1589
|
Object.assign(
|
|
1584
1590
|
o.current,
|
|
1585
|
-
|
|
1591
|
+
Pt({ groupId: n, panelId: e })
|
|
1586
1592
|
);
|
|
1587
1593
|
});
|
|
1588
1594
|
}
|
|
1589
|
-
function
|
|
1595
|
+
function Ct({
|
|
1590
1596
|
children: e,
|
|
1591
1597
|
className: t,
|
|
1592
1598
|
collapsedSize: n = "0%",
|
|
@@ -1599,66 +1605,65 @@ function kt({
|
|
|
1599
1605
|
onResize: u,
|
|
1600
1606
|
panelRef: f,
|
|
1601
1607
|
style: p,
|
|
1602
|
-
...
|
|
1608
|
+
...h
|
|
1603
1609
|
}) {
|
|
1604
|
-
const
|
|
1605
|
-
(w, C
|
|
1606
|
-
u?.(
|
|
1610
|
+
const m = !!l, c = ce(l), d = k(null), S = fe(d, a), [, y] = $e(), { getPanelStyles: v, id: x, registerPanel: g } = de(), L = u !== null, P = te(
|
|
1611
|
+
(b, w, C) => {
|
|
1612
|
+
u?.(b, l, C);
|
|
1607
1613
|
}
|
|
1608
1614
|
);
|
|
1609
|
-
|
|
1610
|
-
const
|
|
1611
|
-
if (
|
|
1612
|
-
return
|
|
1613
|
-
element:
|
|
1615
|
+
$(() => {
|
|
1616
|
+
const b = d.current;
|
|
1617
|
+
if (b !== null)
|
|
1618
|
+
return g({
|
|
1619
|
+
element: b,
|
|
1614
1620
|
id: c,
|
|
1615
|
-
idIsStable:
|
|
1621
|
+
idIsStable: m,
|
|
1616
1622
|
mutableValues: {
|
|
1617
1623
|
expandToSize: void 0,
|
|
1618
1624
|
prevSize: void 0
|
|
1619
1625
|
},
|
|
1620
|
-
onResize:
|
|
1626
|
+
onResize: L ? P : void 0,
|
|
1621
1627
|
panelConstraints: {
|
|
1622
1628
|
collapsedSize: n,
|
|
1623
1629
|
collapsible: o,
|
|
1624
1630
|
defaultSize: i,
|
|
1625
1631
|
maxSize: r,
|
|
1626
1632
|
minSize: s
|
|
1627
|
-
}
|
|
1633
|
+
},
|
|
1634
|
+
scheduleUpdate: y
|
|
1628
1635
|
});
|
|
1629
1636
|
}, [
|
|
1630
1637
|
n,
|
|
1631
1638
|
o,
|
|
1632
1639
|
i,
|
|
1633
|
-
|
|
1640
|
+
y,
|
|
1641
|
+
L,
|
|
1634
1642
|
c,
|
|
1635
|
-
|
|
1643
|
+
m,
|
|
1636
1644
|
r,
|
|
1637
1645
|
s,
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
]),
|
|
1641
|
-
const
|
|
1642
|
-
return /* @__PURE__ */
|
|
1646
|
+
P,
|
|
1647
|
+
g
|
|
1648
|
+
]), Rt(c, f);
|
|
1649
|
+
const R = v(x, c);
|
|
1650
|
+
return /* @__PURE__ */ B(
|
|
1643
1651
|
"div",
|
|
1644
1652
|
{
|
|
1645
|
-
...
|
|
1653
|
+
...h,
|
|
1646
1654
|
"data-panel": !0,
|
|
1647
1655
|
"data-testid": c,
|
|
1648
1656
|
id: c,
|
|
1649
|
-
ref:
|
|
1657
|
+
ref: S,
|
|
1650
1658
|
style: {
|
|
1651
|
-
...
|
|
1659
|
+
...Mt,
|
|
1652
1660
|
flexBasis: 0,
|
|
1653
|
-
flexGrow: `var(${b}, 1)`,
|
|
1654
1661
|
flexShrink: 1,
|
|
1655
1662
|
// Prevent Panel content from interfering with panel size
|
|
1656
1663
|
overflow: "hidden",
|
|
1657
|
-
|
|
1658
|
-
// This avoid edge cases like nested iframes
|
|
1659
|
-
pointerEvents: `var(${Fe})`
|
|
1664
|
+
...R
|
|
1660
1665
|
},
|
|
1661
|
-
children: /* @__PURE__ */
|
|
1666
|
+
children: /* @__PURE__ */ B(
|
|
1662
1667
|
"div",
|
|
1663
1668
|
{
|
|
1664
1669
|
className: t,
|
|
@@ -1673,8 +1678,8 @@ function kt({
|
|
|
1673
1678
|
}
|
|
1674
1679
|
);
|
|
1675
1680
|
}
|
|
1676
|
-
|
|
1677
|
-
const
|
|
1681
|
+
Ct.displayName = "Panel";
|
|
1682
|
+
const Mt = {
|
|
1678
1683
|
minHeight: 0,
|
|
1679
1684
|
maxHeight: "100%",
|
|
1680
1685
|
height: "auto",
|
|
@@ -1686,13 +1691,13 @@ const Gt = {
|
|
|
1686
1691
|
padding: 0,
|
|
1687
1692
|
margin: 0
|
|
1688
1693
|
};
|
|
1689
|
-
function
|
|
1690
|
-
return
|
|
1694
|
+
function Nt() {
|
|
1695
|
+
return K(null);
|
|
1691
1696
|
}
|
|
1692
|
-
function
|
|
1693
|
-
return
|
|
1697
|
+
function _t() {
|
|
1698
|
+
return k(null);
|
|
1694
1699
|
}
|
|
1695
|
-
function
|
|
1700
|
+
function Et({
|
|
1696
1701
|
layout: e,
|
|
1697
1702
|
panelConstraints: t,
|
|
1698
1703
|
panelId: n,
|
|
@@ -1704,8 +1709,8 @@ function Dt({
|
|
|
1704
1709
|
);
|
|
1705
1710
|
if (r) {
|
|
1706
1711
|
const s = r.maxSize, u = a = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
|
|
1707
|
-
a =
|
|
1708
|
-
layout:
|
|
1712
|
+
a = F({
|
|
1713
|
+
layout: q({
|
|
1709
1714
|
delta: u - l,
|
|
1710
1715
|
initialLayout: e,
|
|
1711
1716
|
panelConstraints: t,
|
|
@@ -1714,8 +1719,8 @@ function Dt({
|
|
|
1714
1719
|
trigger: "keyboard"
|
|
1715
1720
|
}),
|
|
1716
1721
|
panelConstraints: t
|
|
1717
|
-
})[n], i =
|
|
1718
|
-
layout:
|
|
1722
|
+
})[n], i = F({
|
|
1723
|
+
layout: q({
|
|
1719
1724
|
delta: s - l,
|
|
1720
1725
|
initialLayout: e,
|
|
1721
1726
|
panelConstraints: t,
|
|
@@ -1733,7 +1738,7 @@ function Dt({
|
|
|
1733
1738
|
valueNow: l
|
|
1734
1739
|
};
|
|
1735
1740
|
}
|
|
1736
|
-
function
|
|
1741
|
+
function kt({
|
|
1737
1742
|
children: e,
|
|
1738
1743
|
className: t,
|
|
1739
1744
|
elementRef: n,
|
|
@@ -1741,41 +1746,41 @@ function Ot({
|
|
|
1741
1746
|
style: i,
|
|
1742
1747
|
...a
|
|
1743
1748
|
}) {
|
|
1744
|
-
const l =
|
|
1745
|
-
id:
|
|
1749
|
+
const l = ce(o), [r, s] = K({}), [u, f] = K("inactive"), p = k(null), h = fe(p, n), {
|
|
1750
|
+
id: m,
|
|
1746
1751
|
orientation: c,
|
|
1747
1752
|
registerSeparator: d
|
|
1748
|
-
} =
|
|
1749
|
-
return
|
|
1750
|
-
const
|
|
1751
|
-
if (
|
|
1753
|
+
} = de(), S = c === "horizontal" ? "vertical" : "horizontal";
|
|
1754
|
+
return $(() => {
|
|
1755
|
+
const y = p.current;
|
|
1756
|
+
if (y !== null) {
|
|
1752
1757
|
const v = {
|
|
1753
|
-
element:
|
|
1758
|
+
element: y,
|
|
1754
1759
|
id: l
|
|
1755
|
-
}, x = d(v),
|
|
1760
|
+
}, x = d(v), g = A.addListener(
|
|
1756
1761
|
"interactionStateChange",
|
|
1757
|
-
(
|
|
1762
|
+
(P) => {
|
|
1758
1763
|
f(
|
|
1759
|
-
|
|
1760
|
-
(
|
|
1761
|
-
) ?
|
|
1764
|
+
P.state !== "inactive" && P.hitRegions.some(
|
|
1765
|
+
(R) => R.separator === v
|
|
1766
|
+
) ? P.state : "inactive"
|
|
1762
1767
|
);
|
|
1763
1768
|
}
|
|
1764
|
-
),
|
|
1769
|
+
), L = A.addListener(
|
|
1765
1770
|
"mountedGroupsChange",
|
|
1766
|
-
(
|
|
1767
|
-
|
|
1768
|
-
({ derivedPanelConstraints:
|
|
1769
|
-
if (
|
|
1770
|
-
const
|
|
1771
|
-
if (
|
|
1772
|
-
const
|
|
1771
|
+
(P) => {
|
|
1772
|
+
P.forEach(
|
|
1773
|
+
({ derivedPanelConstraints: R, layout: b, separatorToPanels: w }, C) => {
|
|
1774
|
+
if (C.id === m) {
|
|
1775
|
+
const O = w.get(v);
|
|
1776
|
+
if (O) {
|
|
1777
|
+
const T = O[0], N = C.panels.indexOf(T);
|
|
1773
1778
|
s(
|
|
1774
|
-
|
|
1775
|
-
layout:
|
|
1776
|
-
panelConstraints:
|
|
1777
|
-
panelId:
|
|
1778
|
-
panelIndex:
|
|
1779
|
+
Et({
|
|
1780
|
+
layout: b,
|
|
1781
|
+
panelConstraints: R,
|
|
1782
|
+
panelId: T.id,
|
|
1783
|
+
panelIndex: N
|
|
1779
1784
|
})
|
|
1780
1785
|
);
|
|
1781
1786
|
}
|
|
@@ -1785,15 +1790,15 @@ function Ot({
|
|
|
1785
1790
|
}
|
|
1786
1791
|
);
|
|
1787
1792
|
return () => {
|
|
1788
|
-
|
|
1793
|
+
g(), L(), x();
|
|
1789
1794
|
};
|
|
1790
1795
|
}
|
|
1791
|
-
}, [
|
|
1796
|
+
}, [m, l, d]), /* @__PURE__ */ B(
|
|
1792
1797
|
"div",
|
|
1793
1798
|
{
|
|
1794
1799
|
...a,
|
|
1795
1800
|
"aria-controls": r.valueControls,
|
|
1796
|
-
"aria-orientation":
|
|
1801
|
+
"aria-orientation": S,
|
|
1797
1802
|
"aria-valuemax": r.valueMax,
|
|
1798
1803
|
"aria-valuemin": r.valueMin,
|
|
1799
1804
|
"aria-valuenow": r.valueNow,
|
|
@@ -1802,7 +1807,7 @@ function Ot({
|
|
|
1802
1807
|
"data-separator": u,
|
|
1803
1808
|
"data-testid": l,
|
|
1804
1809
|
id: l,
|
|
1805
|
-
ref:
|
|
1810
|
+
ref: h,
|
|
1806
1811
|
role: "separator",
|
|
1807
1812
|
style: {
|
|
1808
1813
|
flexBasis: "auto",
|
|
@@ -1814,15 +1819,15 @@ function Ot({
|
|
|
1814
1819
|
}
|
|
1815
1820
|
);
|
|
1816
1821
|
}
|
|
1817
|
-
|
|
1822
|
+
kt.displayName = "Separator";
|
|
1818
1823
|
export {
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1824
|
+
bt as Group,
|
|
1825
|
+
Ct as Panel,
|
|
1826
|
+
kt as Separator,
|
|
1827
|
+
Dt as useDefaultLayout,
|
|
1828
|
+
Ot as useGroupCallbackRef,
|
|
1829
|
+
Tt as useGroupRef,
|
|
1830
|
+
Nt as usePanelCallbackRef,
|
|
1831
|
+
_t as usePanelRef
|
|
1827
1832
|
};
|
|
1828
1833
|
//# sourceMappingURL=react-resizable-panels.js.map
|