react-resizable-panels 4.1.1 → 4.2.0
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,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as X } from "react/jsx-runtime";
|
|
3
3
|
import { useId as Ke, useLayoutEffect as Xe, useEffect as Ce, useRef as I, useCallback as qe, createContext as Ye, useImperativeHandle as Ee, useState as D, useMemo as se, useSyncExternalStore as Ze, 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
|
|
8
|
+
function U({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
|
-
return n.reduce((o,
|
|
12
|
+
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
14
|
function ae(e, t) {
|
|
15
15
|
return t.sort(
|
|
@@ -48,35 +48,35 @@ function tt({
|
|
|
48
48
|
x: n.x + n.width / 2,
|
|
49
49
|
y: n.y + n.height / 2
|
|
50
50
|
};
|
|
51
|
-
let
|
|
51
|
+
let r, s = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x:
|
|
54
|
-
u < s && (s = u,
|
|
53
|
+
const { x: i, y: a } = Ie(o, l), u = e === "horizontal" ? i : a;
|
|
54
|
+
u < s && (s = u, r = l);
|
|
55
55
|
}
|
|
56
|
-
return z(
|
|
56
|
+
return z(r, "No rect found"), r;
|
|
57
57
|
}
|
|
58
58
|
function ke(e) {
|
|
59
|
-
const { element: t, orientation: n, panels: o, separators:
|
|
59
|
+
const { element: t, orientation: n, panels: o, separators: r } = e, s = ae(
|
|
60
60
|
n,
|
|
61
61
|
Array.from(t.children).filter(Me).map((f) => ({ element: f }))
|
|
62
62
|
).map(({ element: f }) => f), l = [];
|
|
63
|
-
let
|
|
63
|
+
let i = !1, a, u = [];
|
|
64
64
|
for (const f of s)
|
|
65
65
|
if (f.hasAttribute("data-panel")) {
|
|
66
66
|
const p = o.find(
|
|
67
|
-
(
|
|
67
|
+
(m) => m.element === f
|
|
68
68
|
);
|
|
69
69
|
if (p) {
|
|
70
70
|
if (a) {
|
|
71
|
-
const
|
|
71
|
+
const m = a.element.getBoundingClientRect(), h = f.getBoundingClientRect();
|
|
72
72
|
let c;
|
|
73
|
-
if (
|
|
74
|
-
const d = n === "horizontal" ? new DOMRect(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
if (i) {
|
|
74
|
+
const d = n === "horizontal" ? new DOMRect(m.right, m.top, 0, m.height) : new DOMRect(
|
|
75
|
+
m.left,
|
|
76
|
+
m.bottom,
|
|
77
|
+
m.width,
|
|
78
78
|
0
|
|
79
|
-
), y = n === "horizontal" ? new DOMRect(
|
|
79
|
+
), y = n === "horizontal" ? new DOMRect(h.left, h.top, 0, h.height) : new DOMRect(h.left, h.top, h.width, 0);
|
|
80
80
|
switch (u.length) {
|
|
81
81
|
case 0: {
|
|
82
82
|
c = [
|
|
@@ -88,12 +88,12 @@ function ke(e) {
|
|
|
88
88
|
case 1: {
|
|
89
89
|
const v = u[0], S = tt({
|
|
90
90
|
orientation: n,
|
|
91
|
-
rects: [
|
|
91
|
+
rects: [m, h],
|
|
92
92
|
targetRect: v.element.getBoundingClientRect()
|
|
93
93
|
});
|
|
94
94
|
c = [
|
|
95
95
|
v,
|
|
96
|
-
S ===
|
|
96
|
+
S === m ? y : d
|
|
97
97
|
];
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
@@ -105,35 +105,35 @@ function ke(e) {
|
|
|
105
105
|
} else
|
|
106
106
|
u.length ? c = u : c = [
|
|
107
107
|
n === "horizontal" ? new DOMRect(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
m.right,
|
|
109
|
+
h.top,
|
|
110
|
+
h.left - m.right,
|
|
111
|
+
h.height
|
|
112
112
|
) : new DOMRect(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
h.left,
|
|
114
|
+
m.bottom,
|
|
115
|
+
h.width,
|
|
116
|
+
h.top - m.bottom
|
|
117
117
|
)
|
|
118
118
|
];
|
|
119
119
|
for (const d of c)
|
|
120
120
|
l.push({
|
|
121
121
|
group: e,
|
|
122
|
-
groupSize:
|
|
122
|
+
groupSize: U({ group: e }),
|
|
123
123
|
panels: [a, p],
|
|
124
124
|
separator: "width" in d ? void 0 : d,
|
|
125
125
|
rect: "width" in d ? d : d.element.getBoundingClientRect()
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
|
|
128
|
+
i = !1, a = p, u = [];
|
|
129
129
|
}
|
|
130
130
|
} else if (f.hasAttribute("data-separator")) {
|
|
131
|
-
const p =
|
|
132
|
-
(
|
|
131
|
+
const p = r.find(
|
|
132
|
+
(m) => m.element === f
|
|
133
133
|
);
|
|
134
134
|
p ? u.push(p) : (a = void 0, u = []);
|
|
135
135
|
} else
|
|
136
|
-
|
|
136
|
+
i = !0;
|
|
137
137
|
return l;
|
|
138
138
|
}
|
|
139
139
|
function nt(e, t) {
|
|
@@ -144,10 +144,10 @@ function ot(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 it(e) {
|
|
148
148
|
return e / 100 * window.innerHeight;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function rt(e) {
|
|
151
151
|
return e / 100 * window.innerWidth;
|
|
152
152
|
}
|
|
153
153
|
function st(e) {
|
|
@@ -166,30 +166,30 @@ function ee({
|
|
|
166
166
|
styleProp: n
|
|
167
167
|
}) {
|
|
168
168
|
let o;
|
|
169
|
-
const [
|
|
169
|
+
const [r, s] = st(n);
|
|
170
170
|
switch (s) {
|
|
171
171
|
case "%": {
|
|
172
|
-
o =
|
|
172
|
+
o = r / 100 * e;
|
|
173
173
|
break;
|
|
174
174
|
}
|
|
175
175
|
case "px": {
|
|
176
|
-
o =
|
|
176
|
+
o = r;
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
case "rem": {
|
|
180
|
-
o = ot(t,
|
|
180
|
+
o = ot(t, r);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
case "em": {
|
|
184
|
-
o = nt(t,
|
|
184
|
+
o = nt(t, r);
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "vh": {
|
|
188
|
-
o =
|
|
188
|
+
o = it(r);
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
case "vw": {
|
|
192
|
-
o =
|
|
192
|
+
o = rt(r);
|
|
193
193
|
break;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
@@ -198,8 +198,8 @@ function ee({
|
|
|
198
198
|
function k(e) {
|
|
199
199
|
return parseFloat(e.toFixed(3));
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
const { panels: t } = e, n =
|
|
201
|
+
function he(e) {
|
|
202
|
+
const { panels: t } = e, n = U({ group: e });
|
|
203
203
|
return n === 0 ? t.map((o) => ({
|
|
204
204
|
collapsedSize: 0,
|
|
205
205
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -208,30 +208,30 @@ function me(e) {
|
|
|
208
208
|
maxSize: 100,
|
|
209
209
|
panelId: o.id
|
|
210
210
|
})) : t.map((o) => {
|
|
211
|
-
const { element:
|
|
211
|
+
const { element: r, panelConstraints: s } = o;
|
|
212
212
|
let l = 0;
|
|
213
213
|
if (s.collapsedSize) {
|
|
214
214
|
const f = ee({
|
|
215
215
|
groupSize: n,
|
|
216
|
-
panelElement:
|
|
216
|
+
panelElement: r,
|
|
217
217
|
styleProp: s.collapsedSize
|
|
218
218
|
});
|
|
219
219
|
l = k(f / n * 100);
|
|
220
220
|
}
|
|
221
|
-
let
|
|
221
|
+
let i;
|
|
222
222
|
if (s.defaultSize) {
|
|
223
223
|
const f = ee({
|
|
224
224
|
groupSize: n,
|
|
225
|
-
panelElement:
|
|
225
|
+
panelElement: r,
|
|
226
226
|
styleProp: s.defaultSize
|
|
227
227
|
});
|
|
228
|
-
|
|
228
|
+
i = k(f / n * 100);
|
|
229
229
|
}
|
|
230
230
|
let a = 0;
|
|
231
231
|
if (s.minSize) {
|
|
232
232
|
const f = ee({
|
|
233
233
|
groupSize: n,
|
|
234
|
-
panelElement:
|
|
234
|
+
panelElement: r,
|
|
235
235
|
styleProp: s.minSize
|
|
236
236
|
});
|
|
237
237
|
a = k(f / n * 100);
|
|
@@ -240,7 +240,7 @@ function me(e) {
|
|
|
240
240
|
if (s.maxSize) {
|
|
241
241
|
const f = ee({
|
|
242
242
|
groupSize: n,
|
|
243
|
-
panelElement:
|
|
243
|
+
panelElement: r,
|
|
244
244
|
styleProp: s.maxSize
|
|
245
245
|
});
|
|
246
246
|
u = k(f / n * 100);
|
|
@@ -248,7 +248,7 @@ function me(e) {
|
|
|
248
248
|
return {
|
|
249
249
|
collapsedSize: l,
|
|
250
250
|
collapsible: s.collapsible === !0,
|
|
251
|
-
defaultSize:
|
|
251
|
+
defaultSize: i,
|
|
252
252
|
minSize: a,
|
|
253
253
|
maxSize: u,
|
|
254
254
|
panelId: o.id
|
|
@@ -269,17 +269,17 @@ class at {
|
|
|
269
269
|
if (o.length === 1)
|
|
270
270
|
o[0].call(null, n);
|
|
271
271
|
else {
|
|
272
|
-
let
|
|
272
|
+
let r = !1, s = null;
|
|
273
273
|
const l = Array.from(o);
|
|
274
|
-
for (let
|
|
275
|
-
const a = l[
|
|
274
|
+
for (let i = 0; i < l.length; i++) {
|
|
275
|
+
const a = l[i];
|
|
276
276
|
try {
|
|
277
277
|
a.call(null, n);
|
|
278
278
|
} catch (u) {
|
|
279
|
-
s === null && (
|
|
279
|
+
s === null && (r = !0, s = u);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
if (
|
|
282
|
+
if (r)
|
|
283
283
|
throw s;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
@@ -289,8 +289,8 @@ class at {
|
|
|
289
289
|
removeListener(t, n) {
|
|
290
290
|
const o = this.#e[t];
|
|
291
291
|
if (o !== void 0) {
|
|
292
|
-
const
|
|
293
|
-
|
|
292
|
+
const r = o.indexOf(n);
|
|
293
|
+
r >= 0 && o.splice(r, 1);
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
}
|
|
@@ -316,19 +316,19 @@ function M(e) {
|
|
|
316
316
|
return E = {
|
|
317
317
|
...E,
|
|
318
318
|
...t
|
|
319
|
-
}, t.cursorFlags !== void 0 && _.emit("cursorFlagsChange", E.cursorFlags), t.interactionState !== void 0 && _.emit("interactionStateChange", E.interactionState), t.mountedGroups !== void 0 && (E.mountedGroups.forEach((o,
|
|
319
|
+
}, t.cursorFlags !== void 0 && _.emit("cursorFlagsChange", E.cursorFlags), t.interactionState !== void 0 && _.emit("interactionStateChange", E.interactionState), t.mountedGroups !== void 0 && (E.mountedGroups.forEach((o, r) => {
|
|
320
320
|
o.derivedPanelConstraints.forEach((s) => {
|
|
321
321
|
if (s.collapsible) {
|
|
322
|
-
const { layout: l } = n.mountedGroups.get(
|
|
322
|
+
const { layout: l } = n.mountedGroups.get(r) ?? {};
|
|
323
323
|
if (l) {
|
|
324
|
-
const
|
|
324
|
+
const i = R(
|
|
325
325
|
s.collapsedSize,
|
|
326
326
|
o.layout[s.panelId]
|
|
327
327
|
), a = R(
|
|
328
328
|
s.collapsedSize,
|
|
329
329
|
l[s.panelId]
|
|
330
330
|
);
|
|
331
|
-
|
|
331
|
+
i && !a && (r.inMemoryLastExpandedPanelSizes[s.panelId] = l[s.panelId]);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
});
|
|
@@ -342,38 +342,38 @@ function lt(e, t) {
|
|
|
342
342
|
return !1;
|
|
343
343
|
return !0;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function q(e, t) {
|
|
346
346
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function W({
|
|
349
349
|
panelConstraints: e,
|
|
350
350
|
size: t
|
|
351
351
|
}) {
|
|
352
352
|
const {
|
|
353
353
|
collapsedSize: n = 0,
|
|
354
354
|
collapsible: o,
|
|
355
|
-
maxSize:
|
|
355
|
+
maxSize: r = 100,
|
|
356
356
|
minSize: s = 0
|
|
357
357
|
} = e;
|
|
358
|
-
if (
|
|
358
|
+
if (q(t, s) < 0)
|
|
359
359
|
if (o) {
|
|
360
360
|
const l = (n + s) / 2;
|
|
361
|
-
|
|
361
|
+
q(t, l) < 0 ? t = n : t = s;
|
|
362
362
|
} else
|
|
363
363
|
t = s;
|
|
364
|
-
return t = Math.min(
|
|
364
|
+
return t = Math.min(r, t), t = k(t), t;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Y({
|
|
367
367
|
delta: e,
|
|
368
368
|
initialLayout: t,
|
|
369
369
|
panelConstraints: n,
|
|
370
370
|
pivotIndices: o,
|
|
371
|
-
prevLayout:
|
|
371
|
+
prevLayout: r,
|
|
372
372
|
trigger: s
|
|
373
373
|
}) {
|
|
374
374
|
if (R(e, 0))
|
|
375
375
|
return t;
|
|
376
|
-
const l = Object.values(t),
|
|
376
|
+
const l = Object.values(t), i = Object.values(r), a = [...l], [u, f] = o;
|
|
377
377
|
z(u != null, "Invalid first pivot index"), z(f != null, "Invalid second pivot index");
|
|
378
378
|
let p = 0;
|
|
379
379
|
if (s === "keyboard") {
|
|
@@ -395,7 +395,7 @@ function q({
|
|
|
395
395
|
`Previous layout not found for panel index ${c}`
|
|
396
396
|
), R(x, y)) {
|
|
397
397
|
const g = S - x;
|
|
398
|
-
|
|
398
|
+
q(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
@@ -417,7 +417,7 @@ function q({
|
|
|
417
417
|
`Previous layout not found for panel index ${c}`
|
|
418
418
|
), R(x, S)) {
|
|
419
419
|
const g = x - y;
|
|
420
|
-
|
|
420
|
+
q(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
}
|
|
@@ -431,7 +431,7 @@ function q({
|
|
|
431
431
|
S != null,
|
|
432
432
|
`Previous layout not found for panel index ${d}`
|
|
433
433
|
);
|
|
434
|
-
const g =
|
|
434
|
+
const g = W({
|
|
435
435
|
panelConstraints: n[d],
|
|
436
436
|
size: 100
|
|
437
437
|
}) - S;
|
|
@@ -449,7 +449,7 @@ function q({
|
|
|
449
449
|
v != null,
|
|
450
450
|
`Previous layout not found for panel index ${d}`
|
|
451
451
|
);
|
|
452
|
-
const S = v - y, x =
|
|
452
|
+
const S = v - y, x = W({
|
|
453
453
|
panelConstraints: n[d],
|
|
454
454
|
size: S
|
|
455
455
|
});
|
|
@@ -460,15 +460,15 @@ function q({
|
|
|
460
460
|
e < 0 ? d-- : d++;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
if (lt(
|
|
464
|
-
return
|
|
463
|
+
if (lt(i, a))
|
|
464
|
+
return r;
|
|
465
465
|
{
|
|
466
466
|
const c = e < 0 ? f : u, d = l[c];
|
|
467
467
|
z(
|
|
468
468
|
d != null,
|
|
469
469
|
`Previous layout not found for panel index ${c}`
|
|
470
470
|
);
|
|
471
|
-
const y = d + p, v =
|
|
471
|
+
const y = d + p, v = W({
|
|
472
472
|
panelConstraints: n[c],
|
|
473
473
|
size: y
|
|
474
474
|
});
|
|
@@ -480,7 +480,7 @@ function q({
|
|
|
480
480
|
b != null,
|
|
481
481
|
`Previous layout not found for panel index ${g}`
|
|
482
482
|
);
|
|
483
|
-
const w = b + S, C =
|
|
483
|
+
const w = b + S, C = W({
|
|
484
484
|
panelConstraints: n[g],
|
|
485
485
|
size: w
|
|
486
486
|
});
|
|
@@ -490,14 +490,14 @@ function q({
|
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
const
|
|
493
|
+
const m = Object.values(a).reduce(
|
|
494
494
|
(c, d) => d + c,
|
|
495
495
|
0
|
|
496
496
|
);
|
|
497
|
-
if (!R(
|
|
498
|
-
return
|
|
499
|
-
const
|
|
500
|
-
return a.reduce((c, d, y) => (c[
|
|
497
|
+
if (!R(m, 100, 0.1))
|
|
498
|
+
return r;
|
|
499
|
+
const h = Object.keys(r);
|
|
500
|
+
return a.reduce((c, d, y) => (c[h[y]] = d, c), {});
|
|
501
501
|
}
|
|
502
502
|
function ne(e) {
|
|
503
503
|
const t = e.parentElement;
|
|
@@ -508,11 +508,11 @@ function ne(e) {
|
|
|
508
508
|
return o;
|
|
509
509
|
throw Error("Could not find parent Group for separator element");
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function K(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 || q(e[n], t[n]) !== 0)
|
|
516
516
|
return !1;
|
|
517
517
|
return !0;
|
|
518
518
|
}
|
|
@@ -520,53 +520,53 @@ function N({
|
|
|
520
520
|
layout: e,
|
|
521
521
|
panelConstraints: t
|
|
522
522
|
}) {
|
|
523
|
-
const o = [...Object.values(e)],
|
|
524
|
-
(
|
|
523
|
+
const o = [...Object.values(e)], r = o.reduce(
|
|
524
|
+
(i, a) => i + a,
|
|
525
525
|
0
|
|
526
526
|
);
|
|
527
527
|
if (o.length !== t.length)
|
|
528
528
|
throw Error(
|
|
529
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
529
|
+
`Invalid ${t.length} panel layout: ${o.map((i) => `${i}%`).join(", ")}`
|
|
530
530
|
);
|
|
531
|
-
if (!R(
|
|
532
|
-
for (let
|
|
533
|
-
const a = o[
|
|
534
|
-
z(a != null, `No layout data found for index ${
|
|
535
|
-
const u = 100 /
|
|
536
|
-
o[
|
|
531
|
+
if (!R(r, 100) && o.length > 0)
|
|
532
|
+
for (let i = 0; i < t.length; i++) {
|
|
533
|
+
const a = o[i];
|
|
534
|
+
z(a != null, `No layout data found for index ${i}`);
|
|
535
|
+
const u = 100 / r * a;
|
|
536
|
+
o[i] = u;
|
|
537
537
|
}
|
|
538
538
|
let s = 0;
|
|
539
|
-
for (let
|
|
540
|
-
const a = o[
|
|
541
|
-
z(a != null, `No layout data found for index ${
|
|
542
|
-
const u =
|
|
543
|
-
panelConstraints: t[
|
|
539
|
+
for (let i = 0; i < t.length; i++) {
|
|
540
|
+
const a = o[i];
|
|
541
|
+
z(a != null, `No layout data found for index ${i}`);
|
|
542
|
+
const u = W({
|
|
543
|
+
panelConstraints: t[i],
|
|
544
544
|
size: a
|
|
545
545
|
});
|
|
546
|
-
a != u && (s += a - u, o[
|
|
546
|
+
a != u && (s += a - u, o[i] = u);
|
|
547
547
|
}
|
|
548
548
|
if (!R(s, 0))
|
|
549
|
-
for (let
|
|
550
|
-
const a = o[
|
|
551
|
-
z(a != null, `No layout data found for index ${
|
|
552
|
-
const u = a + s, f =
|
|
553
|
-
panelConstraints: t[
|
|
549
|
+
for (let i = 0; i < t.length; i++) {
|
|
550
|
+
const a = o[i];
|
|
551
|
+
z(a != null, `No layout data found for index ${i}`);
|
|
552
|
+
const u = a + s, f = W({
|
|
553
|
+
panelConstraints: t[i],
|
|
554
554
|
size: u
|
|
555
555
|
});
|
|
556
|
-
if (a !== f && (s -= f - a, o[
|
|
556
|
+
if (a !== f && (s -= f - a, o[i] = f, R(s, 0)))
|
|
557
557
|
break;
|
|
558
558
|
}
|
|
559
559
|
const l = Object.keys(e);
|
|
560
|
-
return o.reduce((
|
|
560
|
+
return o.reduce((i, a, u) => (i[l[u]] = a, i), {});
|
|
561
561
|
}
|
|
562
562
|
function Ge({
|
|
563
563
|
groupId: e
|
|
564
564
|
}) {
|
|
565
565
|
const t = () => {
|
|
566
566
|
const { mountedGroups: n } = G();
|
|
567
|
-
for (const [o,
|
|
567
|
+
for (const [o, r] of n)
|
|
568
568
|
if (o.id === e)
|
|
569
|
-
return { group: o, ...
|
|
569
|
+
return { group: o, ...r };
|
|
570
570
|
throw Error(`Could not find Group with id "${e}"`);
|
|
571
571
|
};
|
|
572
572
|
return {
|
|
@@ -577,20 +577,20 @@ function Ge({
|
|
|
577
577
|
setLayout(n) {
|
|
578
578
|
const {
|
|
579
579
|
defaultLayoutDeferred: o,
|
|
580
|
-
derivedPanelConstraints:
|
|
580
|
+
derivedPanelConstraints: r,
|
|
581
581
|
group: s,
|
|
582
582
|
layout: l,
|
|
583
|
-
separatorToPanels:
|
|
583
|
+
separatorToPanels: i
|
|
584
584
|
} = t(), a = N({
|
|
585
585
|
layout: n,
|
|
586
|
-
panelConstraints:
|
|
586
|
+
panelConstraints: r
|
|
587
587
|
});
|
|
588
|
-
return o ? l : (
|
|
588
|
+
return o ? l : (K(l, a) || M((u) => ({
|
|
589
589
|
mountedGroups: new Map(u.mountedGroups).set(s, {
|
|
590
590
|
defaultLayoutDeferred: o,
|
|
591
|
-
derivedPanelConstraints:
|
|
591
|
+
derivedPanelConstraints: r,
|
|
592
592
|
layout: a,
|
|
593
|
-
separatorToPanels:
|
|
593
|
+
separatorToPanels: i
|
|
594
594
|
})
|
|
595
595
|
})), a);
|
|
596
596
|
}
|
|
@@ -601,13 +601,13 @@ function De(e) {
|
|
|
601
601
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
602
602
|
}
|
|
603
603
|
function T(e, t) {
|
|
604
|
-
const n = ne(e), o = De(n),
|
|
604
|
+
const n = ne(e), o = De(n), r = n.separators.find(
|
|
605
605
|
(p) => p.element === e
|
|
606
606
|
);
|
|
607
|
-
z(
|
|
608
|
-
const s = o.separatorToPanels.get(
|
|
607
|
+
z(r, "Matching separator not found");
|
|
608
|
+
const s = o.separatorToPanels.get(r);
|
|
609
609
|
z(s, "Matching panels not found");
|
|
610
|
-
const l = s.map((p) => n.panels.indexOf(p)), a = Ge({ groupId: n.id }).getLayout(), u =
|
|
610
|
+
const l = s.map((p) => n.panels.indexOf(p)), a = Ge({ groupId: n.id }).getLayout(), u = Y({
|
|
611
611
|
delta: t,
|
|
612
612
|
initialLayout: a,
|
|
613
613
|
panelConstraints: o.derivedPanelConstraints,
|
|
@@ -618,7 +618,7 @@ function T(e, t) {
|
|
|
618
618
|
layout: u,
|
|
619
619
|
panelConstraints: o.derivedPanelConstraints
|
|
620
620
|
});
|
|
621
|
-
|
|
621
|
+
K(a, f) || M((p) => ({
|
|
622
622
|
mountedGroups: new Map(p.mountedGroups).set(n, {
|
|
623
623
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
624
624
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -655,31 +655,31 @@ function ye(e) {
|
|
|
655
655
|
}
|
|
656
656
|
case "Enter": {
|
|
657
657
|
e.preventDefault();
|
|
658
|
-
const o = ne(t), { derivedPanelConstraints:
|
|
658
|
+
const o = ne(t), { derivedPanelConstraints: r, layout: s, separatorToPanels: l } = De(o), i = o.separators.find(
|
|
659
659
|
(p) => p.element === t
|
|
660
660
|
);
|
|
661
|
-
z(
|
|
662
|
-
const a = l.get(
|
|
661
|
+
z(i, "Matching separator not found");
|
|
662
|
+
const a = l.get(i);
|
|
663
663
|
z(a, "Matching panels not found");
|
|
664
|
-
const u = a[0], f =
|
|
664
|
+
const u = a[0], f = r.find(
|
|
665
665
|
(p) => p.panelId === u.id
|
|
666
666
|
);
|
|
667
667
|
if (z(f, "Panel metadata not found"), f.collapsible) {
|
|
668
|
-
const p = s[u.id],
|
|
669
|
-
T(t,
|
|
668
|
+
const p = s[u.id], m = f.collapsedSize === p ? o.inMemoryLastExpandedPanelSizes[u.id] ?? f.minSize : f.collapsedSize;
|
|
669
|
+
T(t, m - p);
|
|
670
670
|
}
|
|
671
671
|
break;
|
|
672
672
|
}
|
|
673
673
|
case "F6": {
|
|
674
674
|
e.preventDefault();
|
|
675
|
-
const
|
|
675
|
+
const r = ne(t).separators.map(
|
|
676
676
|
(a) => a.element
|
|
677
|
-
), s = Array.from(
|
|
677
|
+
), s = Array.from(r).findIndex(
|
|
678
678
|
(a) => a === e.currentTarget
|
|
679
679
|
);
|
|
680
680
|
z(s !== null, "Index not found");
|
|
681
|
-
const l = e.shiftKey ? s > 0 ? s - 1 :
|
|
682
|
-
|
|
681
|
+
const l = e.shiftKey ? s > 0 ? s - 1 : r.length - 1 : s + 1 < r.length ? s + 1 : 0;
|
|
682
|
+
r[l].focus();
|
|
683
683
|
break;
|
|
684
684
|
}
|
|
685
685
|
case "Home": {
|
|
@@ -688,13 +688,13 @@ function ye(e) {
|
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
const ut = (e) => e,
|
|
691
|
+
const ut = (e) => e, ie = () => {
|
|
692
692
|
}, Oe = 1, Te = 2, _e = 4, Ne = 8, ge = {
|
|
693
693
|
coarse: 10,
|
|
694
694
|
precise: 5
|
|
695
695
|
};
|
|
696
696
|
function ct(e, t, n) {
|
|
697
|
-
let o,
|
|
697
|
+
let o, r = {
|
|
698
698
|
x: 1 / 0,
|
|
699
699
|
y: 1 / 0
|
|
700
700
|
};
|
|
@@ -702,17 +702,17 @@ function ct(e, t, n) {
|
|
|
702
702
|
const l = Ie(n, s.rect);
|
|
703
703
|
switch (e) {
|
|
704
704
|
case "horizontal": {
|
|
705
|
-
l.x <=
|
|
705
|
+
l.x <= r.x && (o = s, r = l);
|
|
706
706
|
break;
|
|
707
707
|
}
|
|
708
708
|
case "vertical": {
|
|
709
|
-
l.y <=
|
|
709
|
+
l.y <= r.y && (o = s, r = l);
|
|
710
710
|
break;
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
return o ? {
|
|
715
|
-
distance:
|
|
715
|
+
distance: r,
|
|
716
716
|
hitRegion: o
|
|
717
717
|
} : void 0;
|
|
718
718
|
}
|
|
@@ -736,32 +736,32 @@ function pt(e, t) {
|
|
|
736
736
|
o,
|
|
737
737
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
738
738
|
);
|
|
739
|
-
const
|
|
739
|
+
const r = {
|
|
740
740
|
a: Se(ve(n.a)),
|
|
741
741
|
b: Se(ve(n.b))
|
|
742
742
|
};
|
|
743
|
-
if (
|
|
743
|
+
if (r.a === r.b) {
|
|
744
744
|
const s = o.childNodes, l = {
|
|
745
745
|
a: n.a.at(-1),
|
|
746
746
|
b: n.b.at(-1)
|
|
747
747
|
};
|
|
748
|
-
let
|
|
749
|
-
for (;
|
|
750
|
-
const a = s[
|
|
748
|
+
let i = s.length;
|
|
749
|
+
for (; i--; ) {
|
|
750
|
+
const a = s[i];
|
|
751
751
|
if (a === l.a) return 1;
|
|
752
752
|
if (a === l.b) return -1;
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
|
-
return Math.sign(
|
|
755
|
+
return Math.sign(r.a - r.b);
|
|
756
756
|
}
|
|
757
|
-
const
|
|
758
|
-
function
|
|
757
|
+
const mt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
758
|
+
function ht(e) {
|
|
759
759
|
const t = getComputedStyle(Ae(e) ?? e).display;
|
|
760
760
|
return t === "flex" || t === "inline-flex";
|
|
761
761
|
}
|
|
762
762
|
function yt(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" || ht(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" || mt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
765
765
|
}
|
|
766
766
|
function ve(e) {
|
|
767
767
|
let t = e.length;
|
|
@@ -808,29 +808,29 @@ function vt({
|
|
|
808
808
|
}
|
|
809
809
|
function $e(e, t) {
|
|
810
810
|
const n = [];
|
|
811
|
-
return t.forEach((o,
|
|
812
|
-
if (
|
|
811
|
+
return t.forEach((o, r) => {
|
|
812
|
+
if (r.disabled)
|
|
813
813
|
return;
|
|
814
|
-
const s = ft() ? ge.coarse : ge.precise, l = ke(
|
|
814
|
+
const s = ft() ? ge.coarse : ge.precise, l = ke(r), i = ct(r.orientation, l, {
|
|
815
815
|
x: e.clientX,
|
|
816
816
|
y: e.clientY
|
|
817
817
|
});
|
|
818
|
-
|
|
819
|
-
groupElement:
|
|
820
|
-
hitRegion:
|
|
818
|
+
i && i.distance.x <= s && i.distance.y <= s && vt({
|
|
819
|
+
groupElement: r.element,
|
|
820
|
+
hitRegion: i.hitRegion.rect,
|
|
821
821
|
pointerEventTarget: e.target
|
|
822
|
-
}) && n.push(
|
|
822
|
+
}) && n.push(i.hitRegion);
|
|
823
823
|
}), n;
|
|
824
824
|
}
|
|
825
825
|
function ze(e) {
|
|
826
826
|
if (e.defaultPrevented)
|
|
827
827
|
return;
|
|
828
|
-
const { mountedGroups: t } = G(), n = $e(e, t), o = /* @__PURE__ */ new Set(),
|
|
829
|
-
let
|
|
828
|
+
const { mountedGroups: t } = G(), n = $e(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
829
|
+
let i = !1;
|
|
830
830
|
n.forEach((a) => {
|
|
831
831
|
o.add(a.group), a.panels.forEach((f) => {
|
|
832
|
-
|
|
833
|
-
}), a.separator && (s.add(a.separator),
|
|
832
|
+
r.add(f);
|
|
833
|
+
}), a.separator && (s.add(a.separator), i || (i = !0, a.separator.element.focus()));
|
|
834
834
|
const u = t.get(a.group);
|
|
835
835
|
u && l.set(a.group, u.layout);
|
|
836
836
|
}), M({
|
|
@@ -847,7 +847,7 @@ function St({
|
|
|
847
847
|
groups: t,
|
|
848
848
|
state: n
|
|
849
849
|
}) {
|
|
850
|
-
let o = 0,
|
|
850
|
+
let o = 0, r = 0;
|
|
851
851
|
switch (n) {
|
|
852
852
|
case "active":
|
|
853
853
|
case "hover":
|
|
@@ -859,23 +859,23 @@ function St({
|
|
|
859
859
|
break;
|
|
860
860
|
}
|
|
861
861
|
case "vertical": {
|
|
862
|
-
|
|
862
|
+
r++;
|
|
863
863
|
break;
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
});
|
|
867
867
|
}
|
|
868
|
-
if (o === 0 &&
|
|
868
|
+
if (o === 0 && r === 0)
|
|
869
869
|
return null;
|
|
870
870
|
switch (n) {
|
|
871
871
|
case "active": {
|
|
872
|
-
const s = (e & Oe) !== 0, l = (e & Te) !== 0,
|
|
872
|
+
const s = (e & Oe) !== 0, l = (e & Te) !== 0, i = (e & _e) !== 0, a = (e & Ne) !== 0;
|
|
873
873
|
if (e) {
|
|
874
874
|
if (s)
|
|
875
|
-
return
|
|
875
|
+
return i ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
876
876
|
if (l)
|
|
877
|
-
return
|
|
878
|
-
if (
|
|
877
|
+
return i ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
878
|
+
if (i)
|
|
879
879
|
return "s-resize";
|
|
880
880
|
if (a)
|
|
881
881
|
return "n-resize";
|
|
@@ -883,7 +883,7 @@ function St({
|
|
|
883
883
|
break;
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
|
-
return o > 0 &&
|
|
886
|
+
return o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
887
887
|
}
|
|
888
888
|
const be = /* @__PURE__ */ new WeakMap();
|
|
889
889
|
function le(e) {
|
|
@@ -891,15 +891,15 @@ function le(e) {
|
|
|
891
891
|
return;
|
|
892
892
|
let { prevStyle: t, styleSheet: n } = be.get(e) ?? {};
|
|
893
893
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets = [n]);
|
|
894
|
-
const { cursorFlags: o, interactionState:
|
|
895
|
-
switch (
|
|
894
|
+
const { cursorFlags: o, interactionState: r } = G();
|
|
895
|
+
switch (r.state) {
|
|
896
896
|
case "active":
|
|
897
897
|
case "hover": {
|
|
898
898
|
const s = St({
|
|
899
899
|
cursorFlags: o,
|
|
900
|
-
groups:
|
|
901
|
-
state:
|
|
902
|
-
}), l = `*{cursor: ${s} !important; ${
|
|
900
|
+
groups: r.hitRegions.map((i) => i.group),
|
|
901
|
+
state: r.state
|
|
902
|
+
}), l = `*{cursor: ${s} !important; ${r.state === "active" ? "touch-action: none;" : ""} }`;
|
|
903
903
|
if (t === l)
|
|
904
904
|
return;
|
|
905
905
|
t = l, s ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
@@ -920,33 +920,33 @@ function Fe({
|
|
|
920
920
|
event: t,
|
|
921
921
|
hitRegions: n,
|
|
922
922
|
initialLayoutMap: o,
|
|
923
|
-
mountedGroups:
|
|
923
|
+
mountedGroups: r,
|
|
924
924
|
pointerDownAtPoint: s
|
|
925
925
|
}) {
|
|
926
926
|
let l = 0;
|
|
927
|
-
const
|
|
927
|
+
const i = new Map(r);
|
|
928
928
|
n.forEach((a) => {
|
|
929
|
-
const { group: u, groupSize: f } = a, { disableCursor: p, orientation:
|
|
929
|
+
const { group: u, groupSize: f } = a, { disableCursor: p, orientation: m, panels: h } = u;
|
|
930
930
|
let c = 0;
|
|
931
|
-
s ?
|
|
931
|
+
s ? m === "horizontal" ? c = (t.clientX - s.x) / f * 100 : c = (t.clientY - s.y) / f * 100 : m === "horizontal" ? c = t.clientX < 0 ? -100 : 100 : c = t.clientY < 0 ? -100 : 100;
|
|
932
932
|
const d = o.get(u), {
|
|
933
933
|
defaultLayoutDeferred: y,
|
|
934
934
|
derivedPanelConstraints: v,
|
|
935
935
|
layout: S,
|
|
936
936
|
separatorToPanels: x
|
|
937
|
-
} =
|
|
937
|
+
} = r.get(u) ?? { defaultLayoutDeferred: !1 };
|
|
938
938
|
if (v && d && S && x) {
|
|
939
|
-
const g =
|
|
939
|
+
const g = Y({
|
|
940
940
|
delta: c,
|
|
941
941
|
initialLayout: d,
|
|
942
942
|
panelConstraints: v,
|
|
943
|
-
pivotIndices: a.panels.map((b) =>
|
|
943
|
+
pivotIndices: a.panels.map((b) => h.indexOf(b)),
|
|
944
944
|
prevLayout: S,
|
|
945
945
|
trigger: "mouse-or-touch"
|
|
946
946
|
});
|
|
947
|
-
if (
|
|
947
|
+
if (K(g, S)) {
|
|
948
948
|
if (c !== 0 && !p)
|
|
949
|
-
switch (
|
|
949
|
+
switch (m) {
|
|
950
950
|
case "horizontal": {
|
|
951
951
|
l |= c < 0 ? Oe : Te;
|
|
952
952
|
break;
|
|
@@ -957,7 +957,7 @@ function Fe({
|
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
} else {
|
|
960
|
-
|
|
960
|
+
i.set(a.group, {
|
|
961
961
|
defaultLayoutDeferred: y,
|
|
962
962
|
derivedPanelConstraints: v,
|
|
963
963
|
layout: g,
|
|
@@ -969,7 +969,7 @@ function Fe({
|
|
|
969
969
|
}
|
|
970
970
|
}), M({
|
|
971
971
|
cursorFlags: l,
|
|
972
|
-
mountedGroups:
|
|
972
|
+
mountedGroups: i
|
|
973
973
|
}), le(e);
|
|
974
974
|
}
|
|
975
975
|
function we(e) {
|
|
@@ -1054,9 +1054,9 @@ function Re(e) {
|
|
|
1054
1054
|
n += l, o[s.panelId] = l;
|
|
1055
1055
|
} else
|
|
1056
1056
|
o[s.panelId] = void 0;
|
|
1057
|
-
const
|
|
1058
|
-
if (
|
|
1059
|
-
const s = k((100 - n) /
|
|
1057
|
+
const r = e.length - t;
|
|
1058
|
+
if (r !== 0) {
|
|
1059
|
+
const s = k((100 - n) / r);
|
|
1060
1060
|
for (const l of e)
|
|
1061
1061
|
l.defaultSize === void 0 && (o[l.panelId] = s);
|
|
1062
1062
|
}
|
|
@@ -1066,19 +1066,16 @@ function xt(e, t, n) {
|
|
|
1066
1066
|
const o = n[0];
|
|
1067
1067
|
if (!o)
|
|
1068
1068
|
return;
|
|
1069
|
-
const
|
|
1070
|
-
if (!
|
|
1069
|
+
const r = e.panels.find((a) => a.element === t);
|
|
1070
|
+
if (!r || !r.onResize)
|
|
1071
1071
|
return;
|
|
1072
|
-
const s =
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
},
|
|
1080
|
-
i.id
|
|
1081
|
-
);
|
|
1072
|
+
const s = U({ group: e }), l = r.mutableValues.prevSize, i = {
|
|
1073
|
+
asPercentage: k(
|
|
1074
|
+
o.inlineSize / s * 100
|
|
1075
|
+
),
|
|
1076
|
+
inPixels: o.inlineSize
|
|
1077
|
+
};
|
|
1078
|
+
r.mutableValues.prevSize = i, r.onResize(i, r.id, l);
|
|
1082
1079
|
}
|
|
1083
1080
|
function zt(e, t) {
|
|
1084
1081
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -1089,11 +1086,11 @@ function zt(e, t) {
|
|
|
1089
1086
|
return !0;
|
|
1090
1087
|
}
|
|
1091
1088
|
function bt(e, t) {
|
|
1092
|
-
const n = e.map((
|
|
1089
|
+
const n = e.map((r) => r.id), o = Object.keys(t);
|
|
1093
1090
|
if (n.length !== o.length)
|
|
1094
1091
|
return !1;
|
|
1095
|
-
for (const
|
|
1096
|
-
if (!o.includes(
|
|
1092
|
+
for (const r of n)
|
|
1093
|
+
if (!o.includes(r))
|
|
1097
1094
|
return !1;
|
|
1098
1095
|
return !0;
|
|
1099
1096
|
}
|
|
@@ -1104,21 +1101,21 @@ function wt(e) {
|
|
|
1104
1101
|
e.element.ownerDocument.defaultView,
|
|
1105
1102
|
"Cannot register an unmounted Group"
|
|
1106
1103
|
);
|
|
1107
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(),
|
|
1104
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = new n((c) => {
|
|
1108
1105
|
for (const d of c) {
|
|
1109
1106
|
const { borderBoxSize: y, target: v } = d;
|
|
1110
1107
|
if (v === e.element) {
|
|
1111
1108
|
if (t) {
|
|
1112
|
-
if (
|
|
1109
|
+
if (U({ group: e }) === 0)
|
|
1113
1110
|
return;
|
|
1114
1111
|
M((x) => {
|
|
1115
1112
|
const g = x.mountedGroups.get(e);
|
|
1116
1113
|
if (g) {
|
|
1117
|
-
const b =
|
|
1114
|
+
const b = he(e), w = g.defaultLayoutDeferred ? Re(b) : g.layout, C = N({
|
|
1118
1115
|
layout: w,
|
|
1119
1116
|
panelConstraints: b
|
|
1120
1117
|
});
|
|
1121
|
-
return !g.defaultLayoutDeferred &&
|
|
1118
|
+
return !g.defaultLayoutDeferred && K(w, C) && zt(
|
|
1122
1119
|
g.derivedPanelConstraints,
|
|
1123
1120
|
b
|
|
1124
1121
|
) ? x : {
|
|
@@ -1143,43 +1140,43 @@ function wt(e) {
|
|
|
1143
1140
|
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1144
1141
|
), o.add(c.id), c.onResize && s.observe(c.element);
|
|
1145
1142
|
});
|
|
1146
|
-
const l =
|
|
1143
|
+
const l = U({ group: e }), i = he(e), a = e.panels.map(({ id: c }) => c).join(",");
|
|
1147
1144
|
let u = e.defaultLayout;
|
|
1148
1145
|
u && (bt(e.panels, u) || (u = void 0));
|
|
1149
|
-
const f = e.inMemoryLayouts[a] ?? u ?? Re(
|
|
1146
|
+
const f = e.inMemoryLayouts[a] ?? u ?? Re(i), p = N({
|
|
1150
1147
|
layout: f,
|
|
1151
|
-
panelConstraints:
|
|
1152
|
-
}),
|
|
1148
|
+
panelConstraints: i
|
|
1149
|
+
}), m = ke(e), h = e.element.ownerDocument;
|
|
1153
1150
|
return M((c) => {
|
|
1154
1151
|
const d = /* @__PURE__ */ new Map();
|
|
1155
1152
|
return B.set(
|
|
1156
|
-
|
|
1157
|
-
(B.get(
|
|
1158
|
-
),
|
|
1153
|
+
h,
|
|
1154
|
+
(B.get(h) ?? 0) + 1
|
|
1155
|
+
), m.forEach((y) => {
|
|
1159
1156
|
y.separator && d.set(y.separator, y.panels);
|
|
1160
1157
|
}), {
|
|
1161
1158
|
mountedGroups: new Map(c.mountedGroups).set(e, {
|
|
1162
1159
|
defaultLayoutDeferred: l === 0,
|
|
1163
|
-
derivedPanelConstraints:
|
|
1160
|
+
derivedPanelConstraints: i,
|
|
1164
1161
|
layout: p,
|
|
1165
1162
|
separatorToPanels: d
|
|
1166
1163
|
})
|
|
1167
1164
|
};
|
|
1168
1165
|
}), e.separators.forEach((c) => {
|
|
1169
1166
|
z(
|
|
1170
|
-
!
|
|
1167
|
+
!r.has(c.id),
|
|
1171
1168
|
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1172
|
-
),
|
|
1173
|
-
}), B.get(
|
|
1169
|
+
), r.add(c.id), c.element.addEventListener("keydown", ye);
|
|
1170
|
+
}), B.get(h) === 1 && (h.addEventListener("pointerdown", ze), h.addEventListener("pointerleave", we), h.addEventListener("pointermove", Le), h.addEventListener("pointerup", Pe)), function() {
|
|
1174
1171
|
t = !1, B.set(
|
|
1175
|
-
|
|
1176
|
-
Math.max(0, (B.get(
|
|
1172
|
+
h,
|
|
1173
|
+
Math.max(0, (B.get(h) ?? 0) - 1)
|
|
1177
1174
|
), M((d) => {
|
|
1178
1175
|
const y = new Map(d.mountedGroups);
|
|
1179
1176
|
return y.delete(e), { mountedGroups: y };
|
|
1180
1177
|
}), e.separators.forEach((d) => {
|
|
1181
1178
|
d.element.removeEventListener("keydown", ye);
|
|
1182
|
-
}), B.get(
|
|
1179
|
+
}), B.get(h) || (h.removeEventListener("pointerdown", ze), h.removeEventListener("pointerleave", we), h.removeEventListener("pointermove", Le), h.removeEventListener("pointerup", Pe)), s.disconnect();
|
|
1183
1180
|
};
|
|
1184
1181
|
}
|
|
1185
1182
|
function ue(e) {
|
|
@@ -1191,7 +1188,10 @@ function ce(e) {
|
|
|
1191
1188
|
const t = I(e);
|
|
1192
1189
|
return A(() => {
|
|
1193
1190
|
t.current = e;
|
|
1194
|
-
}, [e]), qe(
|
|
1191
|
+
}, [e]), qe(
|
|
1192
|
+
(...n) => t.current?.(...n),
|
|
1193
|
+
[t]
|
|
1194
|
+
);
|
|
1195
1195
|
}
|
|
1196
1196
|
function fe(...e) {
|
|
1197
1197
|
return ce((t) => {
|
|
@@ -1222,7 +1222,7 @@ function He(e, t) {
|
|
|
1222
1222
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1223
1223
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1224
1224
|
}
|
|
1225
|
-
const
|
|
1225
|
+
const Ve = Ye(null);
|
|
1226
1226
|
function Pt(e, t) {
|
|
1227
1227
|
const n = I({
|
|
1228
1228
|
getLayout: () => ({}),
|
|
@@ -1240,18 +1240,18 @@ function Tt({
|
|
|
1240
1240
|
className: t,
|
|
1241
1241
|
defaultLayout: n,
|
|
1242
1242
|
disableCursor: o,
|
|
1243
|
-
disabled:
|
|
1243
|
+
disabled: r,
|
|
1244
1244
|
elementRef: s,
|
|
1245
1245
|
groupRef: l,
|
|
1246
|
-
id:
|
|
1246
|
+
id: i,
|
|
1247
1247
|
onLayoutChange: a,
|
|
1248
1248
|
orientation: u = "horizontal",
|
|
1249
1249
|
style: f,
|
|
1250
1250
|
...p
|
|
1251
1251
|
}) {
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1254
|
-
}), c = ue(
|
|
1252
|
+
const m = I({}), h = ce((L) => {
|
|
1253
|
+
K(m.current, L) || (m.current = L, a?.(L));
|
|
1254
|
+
}), c = ue(i), [d, y] = D(!1), v = I(null), [S, x] = D(n ?? {}), [g, b] = D([]), [w, C] = D([]), $ = I({
|
|
1255
1255
|
lastExpandedPanelSizes: {},
|
|
1256
1256
|
layouts: {}
|
|
1257
1257
|
}), oe = fe(v, s);
|
|
@@ -1272,40 +1272,40 @@ function Tt({
|
|
|
1272
1272
|
})
|
|
1273
1273
|
}),
|
|
1274
1274
|
[c, u]
|
|
1275
|
-
),
|
|
1275
|
+
), F = Lt({
|
|
1276
1276
|
defaultLayout: n,
|
|
1277
1277
|
disableCursor: o
|
|
1278
|
-
}),
|
|
1278
|
+
}), j = I(null);
|
|
1279
1279
|
A(() => {
|
|
1280
1280
|
const L = v.current;
|
|
1281
1281
|
if (L === null)
|
|
1282
1282
|
return;
|
|
1283
1283
|
const P = {
|
|
1284
|
-
defaultLayout:
|
|
1285
|
-
disableCursor:
|
|
1286
|
-
disabled: !!
|
|
1284
|
+
defaultLayout: F.defaultLayout,
|
|
1285
|
+
disableCursor: !!F.disableCursor,
|
|
1286
|
+
disabled: !!r,
|
|
1287
1287
|
element: L,
|
|
1288
1288
|
id: c,
|
|
1289
|
-
inMemoryLastExpandedPanelSizes:
|
|
1290
|
-
inMemoryLayouts:
|
|
1289
|
+
inMemoryLastExpandedPanelSizes: $.current.lastExpandedPanelSizes,
|
|
1290
|
+
inMemoryLayouts: $.current.layouts,
|
|
1291
1291
|
orientation: u,
|
|
1292
1292
|
panels: g,
|
|
1293
1293
|
separators: w
|
|
1294
1294
|
};
|
|
1295
|
-
|
|
1295
|
+
j.current = P;
|
|
1296
1296
|
const O = wt(P), pe = G().mountedGroups.get(P);
|
|
1297
1297
|
if (pe) {
|
|
1298
|
-
const { defaultLayoutDeferred:
|
|
1299
|
-
!
|
|
1298
|
+
const { defaultLayoutDeferred: H, derivedPanelConstraints: V, layout: Q } = pe;
|
|
1299
|
+
!H && V.length > 0 && (x(Q), h?.(Q));
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1301
|
+
const Be = _.addListener(
|
|
1302
1302
|
"interactionStateChange",
|
|
1303
|
-
(
|
|
1304
|
-
switch (
|
|
1303
|
+
(H) => {
|
|
1304
|
+
switch (H.state) {
|
|
1305
1305
|
case "active": {
|
|
1306
1306
|
y(
|
|
1307
|
-
|
|
1308
|
-
(
|
|
1307
|
+
H.hitRegions.some(
|
|
1308
|
+
(V) => V.group === P
|
|
1309
1309
|
)
|
|
1310
1310
|
);
|
|
1311
1311
|
break;
|
|
@@ -1318,29 +1318,29 @@ function Tt({
|
|
|
1318
1318
|
}
|
|
1319
1319
|
), We = _.addListener(
|
|
1320
1320
|
"mountedGroupsChange",
|
|
1321
|
-
(
|
|
1322
|
-
const
|
|
1323
|
-
if (
|
|
1324
|
-
const { defaultLayoutDeferred: Q, derivedPanelConstraints: Ue, layout:
|
|
1321
|
+
(H) => {
|
|
1322
|
+
const V = H.get(P);
|
|
1323
|
+
if (V) {
|
|
1324
|
+
const { defaultLayoutDeferred: Q, derivedPanelConstraints: Ue, layout: me } = V;
|
|
1325
1325
|
if (Q || Ue.length === 0)
|
|
1326
1326
|
return;
|
|
1327
|
-
x(
|
|
1327
|
+
x(me), h?.(me);
|
|
1328
1328
|
}
|
|
1329
1329
|
}
|
|
1330
1330
|
);
|
|
1331
1331
|
return () => {
|
|
1332
|
-
|
|
1332
|
+
j.current = null, O(), Be(), We();
|
|
1333
1333
|
};
|
|
1334
1334
|
}, [
|
|
1335
|
-
|
|
1335
|
+
r,
|
|
1336
1336
|
c,
|
|
1337
|
-
|
|
1337
|
+
h,
|
|
1338
1338
|
u,
|
|
1339
1339
|
g,
|
|
1340
1340
|
w,
|
|
1341
|
-
|
|
1341
|
+
F
|
|
1342
1342
|
]), Ce(() => {
|
|
1343
|
-
const L =
|
|
1343
|
+
const L = j.current;
|
|
1344
1344
|
L && (L.defaultLayout = n, L.disableCursor = !!o);
|
|
1345
1345
|
});
|
|
1346
1346
|
const J = {
|
|
@@ -1350,7 +1350,7 @@ function Tt({
|
|
|
1350
1350
|
const P = He(c, L), O = S[L];
|
|
1351
1351
|
J[P] = O;
|
|
1352
1352
|
}
|
|
1353
|
-
return /* @__PURE__ */
|
|
1353
|
+
return /* @__PURE__ */ X(Ve.Provider, { value: Z, children: /* @__PURE__ */ X(
|
|
1354
1354
|
"div",
|
|
1355
1355
|
{
|
|
1356
1356
|
...p,
|
|
@@ -1379,7 +1379,7 @@ function Rt(e, t = 10) {
|
|
|
1379
1379
|
}, t);
|
|
1380
1380
|
};
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1382
|
+
function re(e, t) {
|
|
1383
1383
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1384
1384
|
}
|
|
1385
1385
|
function _t({
|
|
@@ -1388,25 +1388,25 @@ function _t({
|
|
|
1388
1388
|
storage: n,
|
|
1389
1389
|
...o
|
|
1390
1390
|
}) {
|
|
1391
|
-
const
|
|
1391
|
+
const r = t !== void 0, s = "id" in o ? o.id : o.groupId, l = re(s, t ?? []), i = Ze(
|
|
1392
1392
|
Ct,
|
|
1393
1393
|
() => n.getItem(l),
|
|
1394
1394
|
() => n.getItem(l)
|
|
1395
1395
|
), a = se(
|
|
1396
|
-
() =>
|
|
1397
|
-
[
|
|
1396
|
+
() => i ? JSON.parse(i) : void 0,
|
|
1397
|
+
[i]
|
|
1398
1398
|
), u = se(() => {
|
|
1399
1399
|
const f = (p) => {
|
|
1400
|
-
let
|
|
1401
|
-
|
|
1400
|
+
let m;
|
|
1401
|
+
r ? m = re(s, Object.keys(p)) : m = re(s, []);
|
|
1402
1402
|
try {
|
|
1403
|
-
n.setItem(
|
|
1404
|
-
} catch (
|
|
1405
|
-
console.error(
|
|
1403
|
+
n.setItem(m, JSON.stringify(p));
|
|
1404
|
+
} catch (h) {
|
|
1405
|
+
console.error(h);
|
|
1406
1406
|
}
|
|
1407
1407
|
};
|
|
1408
1408
|
return e > 0 ? Rt(f, e) : f;
|
|
1409
|
-
}, [e,
|
|
1409
|
+
}, [e, r, s, n]);
|
|
1410
1410
|
return {
|
|
1411
1411
|
defaultLayout: a,
|
|
1412
1412
|
onLayoutChange: u
|
|
@@ -1423,7 +1423,7 @@ function At() {
|
|
|
1423
1423
|
return I(null);
|
|
1424
1424
|
}
|
|
1425
1425
|
function de() {
|
|
1426
|
-
const e = Je(
|
|
1426
|
+
const e = Je(Ve);
|
|
1427
1427
|
return z(
|
|
1428
1428
|
e,
|
|
1429
1429
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
@@ -1434,106 +1434,106 @@ function Et({
|
|
|
1434
1434
|
panelId: t
|
|
1435
1435
|
}) {
|
|
1436
1436
|
const n = () => {
|
|
1437
|
-
const { mountedGroups:
|
|
1437
|
+
const { mountedGroups: i } = G();
|
|
1438
1438
|
for (const [
|
|
1439
1439
|
a,
|
|
1440
1440
|
{
|
|
1441
1441
|
defaultLayoutDeferred: u,
|
|
1442
1442
|
derivedPanelConstraints: f,
|
|
1443
1443
|
layout: p,
|
|
1444
|
-
separatorToPanels:
|
|
1444
|
+
separatorToPanels: m
|
|
1445
1445
|
}
|
|
1446
|
-
] of
|
|
1446
|
+
] of i)
|
|
1447
1447
|
if (a.id === e)
|
|
1448
1448
|
return {
|
|
1449
1449
|
defaultLayoutDeferred: u,
|
|
1450
1450
|
derivedPanelConstraints: f,
|
|
1451
1451
|
group: a,
|
|
1452
1452
|
layout: p,
|
|
1453
|
-
separatorToPanels:
|
|
1453
|
+
separatorToPanels: m
|
|
1454
1454
|
};
|
|
1455
1455
|
throw Error(`Group ${e} not found`);
|
|
1456
1456
|
}, o = () => {
|
|
1457
|
-
const
|
|
1457
|
+
const i = n().derivedPanelConstraints.find(
|
|
1458
1458
|
(a) => a.panelId === t
|
|
1459
1459
|
);
|
|
1460
|
-
if (
|
|
1461
|
-
return
|
|
1460
|
+
if (i !== void 0)
|
|
1461
|
+
return i;
|
|
1462
1462
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
1463
|
-
},
|
|
1464
|
-
const
|
|
1465
|
-
if (
|
|
1466
|
-
return
|
|
1463
|
+
}, r = () => {
|
|
1464
|
+
const i = n().group.panels.find((a) => a.id === t);
|
|
1465
|
+
if (i !== void 0)
|
|
1466
|
+
return i;
|
|
1467
1467
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1468
1468
|
}, s = () => {
|
|
1469
|
-
const
|
|
1470
|
-
if (
|
|
1471
|
-
return
|
|
1469
|
+
const i = n().layout[t];
|
|
1470
|
+
if (i !== void 0)
|
|
1471
|
+
return i;
|
|
1472
1472
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1473
|
-
}, l = (
|
|
1473
|
+
}, l = (i) => {
|
|
1474
1474
|
const a = s();
|
|
1475
|
-
if (
|
|
1475
|
+
if (i === a)
|
|
1476
1476
|
return;
|
|
1477
1477
|
const {
|
|
1478
1478
|
defaultLayoutDeferred: u,
|
|
1479
1479
|
derivedPanelConstraints: f,
|
|
1480
1480
|
group: p,
|
|
1481
|
-
layout:
|
|
1482
|
-
separatorToPanels:
|
|
1483
|
-
} = n(), c = p.panels.findIndex((S) => S.id === t), d = c === p.panels.length - 1, y =
|
|
1484
|
-
delta: d ? a -
|
|
1485
|
-
initialLayout:
|
|
1481
|
+
layout: m,
|
|
1482
|
+
separatorToPanels: h
|
|
1483
|
+
} = n(), c = p.panels.findIndex((S) => S.id === t), d = c === p.panels.length - 1, y = Y({
|
|
1484
|
+
delta: d ? a - i : i - a,
|
|
1485
|
+
initialLayout: m,
|
|
1486
1486
|
panelConstraints: f,
|
|
1487
1487
|
pivotIndices: d ? [c - 1, c] : [c, c + 1],
|
|
1488
|
-
prevLayout:
|
|
1488
|
+
prevLayout: m,
|
|
1489
1489
|
trigger: "imperative-api"
|
|
1490
1490
|
}), v = N({
|
|
1491
1491
|
layout: y,
|
|
1492
1492
|
panelConstraints: f
|
|
1493
1493
|
});
|
|
1494
|
-
|
|
1494
|
+
K(m, v) || M((S) => ({
|
|
1495
1495
|
mountedGroups: new Map(S.mountedGroups).set(p, {
|
|
1496
1496
|
defaultLayoutDeferred: u,
|
|
1497
1497
|
derivedPanelConstraints: f,
|
|
1498
1498
|
layout: v,
|
|
1499
|
-
separatorToPanels:
|
|
1499
|
+
separatorToPanels: h
|
|
1500
1500
|
})
|
|
1501
1501
|
}));
|
|
1502
1502
|
};
|
|
1503
1503
|
return {
|
|
1504
1504
|
collapse: () => {
|
|
1505
|
-
const { collapsible:
|
|
1506
|
-
|
|
1505
|
+
const { collapsible: i, collapsedSize: a } = o(), { mutableValues: u } = r(), f = s();
|
|
1506
|
+
i && f !== a && (u.expandToSize = f, l(a));
|
|
1507
1507
|
},
|
|
1508
1508
|
expand: () => {
|
|
1509
|
-
const { collapsible:
|
|
1510
|
-
if (
|
|
1511
|
-
let
|
|
1512
|
-
|
|
1509
|
+
const { collapsible: i, collapsedSize: a, minSize: u } = o(), { mutableValues: f } = r(), p = s();
|
|
1510
|
+
if (i && p === a) {
|
|
1511
|
+
let m = f.expandToSize ?? u;
|
|
1512
|
+
m === 0 && (m = 1), l(m);
|
|
1513
1513
|
}
|
|
1514
1514
|
},
|
|
1515
1515
|
getSize: () => {
|
|
1516
|
-
const { group:
|
|
1516
|
+
const { group: i } = n(), a = s(), { element: u } = r(), f = i.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
1517
1517
|
return {
|
|
1518
1518
|
asPercentage: a,
|
|
1519
1519
|
inPixels: f
|
|
1520
1520
|
};
|
|
1521
1521
|
},
|
|
1522
1522
|
isCollapsed: () => {
|
|
1523
|
-
const { collapsible:
|
|
1524
|
-
return
|
|
1523
|
+
const { collapsible: i, collapsedSize: a } = o(), u = s();
|
|
1524
|
+
return i && R(a, u);
|
|
1525
1525
|
},
|
|
1526
|
-
resize: (
|
|
1527
|
-
if (s() !==
|
|
1526
|
+
resize: (i) => {
|
|
1527
|
+
if (s() !== i) {
|
|
1528
1528
|
let u;
|
|
1529
|
-
switch (typeof
|
|
1529
|
+
switch (typeof i) {
|
|
1530
1530
|
case "number": {
|
|
1531
|
-
const { group: f } = n(), p =
|
|
1532
|
-
u = k(
|
|
1531
|
+
const { group: f } = n(), p = U({ group: f });
|
|
1532
|
+
u = k(i / p * 100);
|
|
1533
1533
|
break;
|
|
1534
1534
|
}
|
|
1535
1535
|
case "string": {
|
|
1536
|
-
u = parseFloat(
|
|
1536
|
+
u = parseFloat(i);
|
|
1537
1537
|
break;
|
|
1538
1538
|
}
|
|
1539
1539
|
}
|
|
@@ -1544,14 +1544,14 @@ function Et({
|
|
|
1544
1544
|
}
|
|
1545
1545
|
function Mt(e, t) {
|
|
1546
1546
|
const { id: n } = de(), o = I({
|
|
1547
|
-
collapse:
|
|
1548
|
-
expand:
|
|
1547
|
+
collapse: ie,
|
|
1548
|
+
expand: ie,
|
|
1549
1549
|
getSize: () => ({
|
|
1550
1550
|
asPercentage: 0,
|
|
1551
1551
|
inPixels: 0
|
|
1552
1552
|
}),
|
|
1553
1553
|
isCollapsed: () => !1,
|
|
1554
|
-
resize:
|
|
1554
|
+
resize: ie
|
|
1555
1555
|
});
|
|
1556
1556
|
Ee(t, () => o.current, []), A(() => {
|
|
1557
1557
|
Object.assign(
|
|
@@ -1565,53 +1565,58 @@ function $t({
|
|
|
1565
1565
|
className: t,
|
|
1566
1566
|
collapsedSize: n = "0%",
|
|
1567
1567
|
collapsible: o = !1,
|
|
1568
|
-
defaultSize:
|
|
1568
|
+
defaultSize: r,
|
|
1569
1569
|
elementRef: s,
|
|
1570
1570
|
id: l,
|
|
1571
|
-
maxSize:
|
|
1571
|
+
maxSize: i = "100%",
|
|
1572
1572
|
minSize: a = "0%",
|
|
1573
1573
|
onResize: u,
|
|
1574
1574
|
panelRef: f,
|
|
1575
1575
|
style: p,
|
|
1576
|
-
...
|
|
1576
|
+
...m
|
|
1577
1577
|
}) {
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
|
|
1578
|
+
const h = !!l, c = ue(l), d = I(null), y = fe(d, s), { id: v, registerPanel: S } = de(), x = u !== null, g = ce(
|
|
1579
|
+
(w, C, $) => {
|
|
1580
|
+
u?.(w, l, $);
|
|
1581
|
+
}
|
|
1582
|
+
);
|
|
1581
1583
|
A(() => {
|
|
1582
1584
|
const w = d.current;
|
|
1583
1585
|
if (w !== null)
|
|
1584
1586
|
return S({
|
|
1585
1587
|
element: w,
|
|
1586
|
-
expandToSizeRef: { current: void 0 },
|
|
1587
1588
|
id: c,
|
|
1588
|
-
idIsStable:
|
|
1589
|
+
idIsStable: h,
|
|
1590
|
+
mutableValues: {
|
|
1591
|
+
expandToSize: void 0,
|
|
1592
|
+
prevSize: void 0
|
|
1593
|
+
},
|
|
1589
1594
|
onResize: x ? g : void 0,
|
|
1590
1595
|
panelConstraints: {
|
|
1591
1596
|
collapsedSize: n,
|
|
1592
1597
|
collapsible: o,
|
|
1593
|
-
defaultSize:
|
|
1594
|
-
maxSize:
|
|
1598
|
+
defaultSize: r,
|
|
1599
|
+
maxSize: i,
|
|
1595
1600
|
minSize: a
|
|
1596
1601
|
}
|
|
1597
1602
|
});
|
|
1598
1603
|
}, [
|
|
1599
1604
|
n,
|
|
1600
1605
|
o,
|
|
1601
|
-
|
|
1606
|
+
r,
|
|
1602
1607
|
x,
|
|
1603
1608
|
c,
|
|
1604
|
-
|
|
1605
|
-
|
|
1609
|
+
h,
|
|
1610
|
+
i,
|
|
1606
1611
|
a,
|
|
1607
1612
|
g,
|
|
1608
1613
|
S
|
|
1609
1614
|
]), Mt(c, f);
|
|
1610
1615
|
const b = He(v, c);
|
|
1611
|
-
return /* @__PURE__ */
|
|
1616
|
+
return /* @__PURE__ */ X(
|
|
1612
1617
|
"div",
|
|
1613
1618
|
{
|
|
1614
|
-
...
|
|
1619
|
+
...m,
|
|
1615
1620
|
"data-panel": !0,
|
|
1616
1621
|
"data-testid": c,
|
|
1617
1622
|
id: c,
|
|
@@ -1627,7 +1632,7 @@ function $t({
|
|
|
1627
1632
|
// This avoid edge cases like nested iframes
|
|
1628
1633
|
pointerEvents: `var(${je})`
|
|
1629
1634
|
},
|
|
1630
|
-
children: /* @__PURE__ */
|
|
1635
|
+
children: /* @__PURE__ */ X(
|
|
1631
1636
|
"div",
|
|
1632
1637
|
{
|
|
1633
1638
|
className: t,
|
|
@@ -1670,14 +1675,14 @@ function kt({
|
|
|
1670
1675
|
panelId: n,
|
|
1671
1676
|
panelIndex: o
|
|
1672
1677
|
}) {
|
|
1673
|
-
let
|
|
1674
|
-
const l = e[n],
|
|
1678
|
+
let r, s;
|
|
1679
|
+
const l = e[n], i = t.find(
|
|
1675
1680
|
(a) => a.panelId === n
|
|
1676
1681
|
);
|
|
1677
|
-
if (
|
|
1678
|
-
const a =
|
|
1682
|
+
if (i) {
|
|
1683
|
+
const a = i.maxSize, u = s = i.collapsible ? i.collapsedSize : i.minSize, f = [o, o + 1];
|
|
1679
1684
|
s = N({
|
|
1680
|
-
layout:
|
|
1685
|
+
layout: Y({
|
|
1681
1686
|
delta: u - l,
|
|
1682
1687
|
initialLayout: e,
|
|
1683
1688
|
panelConstraints: t,
|
|
@@ -1686,8 +1691,8 @@ function kt({
|
|
|
1686
1691
|
trigger: "keyboard"
|
|
1687
1692
|
}),
|
|
1688
1693
|
panelConstraints: t
|
|
1689
|
-
})[n],
|
|
1690
|
-
layout:
|
|
1694
|
+
})[n], r = N({
|
|
1695
|
+
layout: Y({
|
|
1691
1696
|
delta: a - l,
|
|
1692
1697
|
initialLayout: e,
|
|
1693
1698
|
panelConstraints: t,
|
|
@@ -1700,7 +1705,7 @@ function kt({
|
|
|
1700
1705
|
}
|
|
1701
1706
|
return {
|
|
1702
1707
|
valueControls: n,
|
|
1703
|
-
valueMax:
|
|
1708
|
+
valueMax: r,
|
|
1704
1709
|
valueMin: s,
|
|
1705
1710
|
valueNow: l
|
|
1706
1711
|
};
|
|
@@ -1710,10 +1715,10 @@ function Ht({
|
|
|
1710
1715
|
className: t,
|
|
1711
1716
|
elementRef: n,
|
|
1712
1717
|
id: o,
|
|
1713
|
-
style:
|
|
1718
|
+
style: r,
|
|
1714
1719
|
...s
|
|
1715
1720
|
}) {
|
|
1716
|
-
const l = ue(o), [
|
|
1721
|
+
const l = ue(o), [i, a] = D({}), [u, f] = D("inactive"), [p, m] = D(null), h = fe(m, n), {
|
|
1717
1722
|
id: c,
|
|
1718
1723
|
orientation: d,
|
|
1719
1724
|
registerSeparator: y
|
|
@@ -1736,16 +1741,16 @@ function Ht({
|
|
|
1736
1741
|
"mountedGroupsChange",
|
|
1737
1742
|
(w) => {
|
|
1738
1743
|
w.forEach(
|
|
1739
|
-
({ derivedPanelConstraints: C, layout:
|
|
1744
|
+
({ derivedPanelConstraints: C, layout: $, separatorToPanels: oe }, Z) => {
|
|
1740
1745
|
if (Z.id === c) {
|
|
1741
|
-
const
|
|
1742
|
-
if (
|
|
1743
|
-
const
|
|
1746
|
+
const F = oe.get(S);
|
|
1747
|
+
if (F) {
|
|
1748
|
+
const j = F[0], J = Z.panels.indexOf(j);
|
|
1744
1749
|
a(
|
|
1745
1750
|
kt({
|
|
1746
|
-
layout:
|
|
1751
|
+
layout: $,
|
|
1747
1752
|
panelConstraints: C,
|
|
1748
|
-
panelId:
|
|
1753
|
+
panelId: j.id,
|
|
1749
1754
|
panelIndex: J
|
|
1750
1755
|
})
|
|
1751
1756
|
);
|
|
@@ -1759,25 +1764,25 @@ function Ht({
|
|
|
1759
1764
|
g(), b(), x();
|
|
1760
1765
|
};
|
|
1761
1766
|
}
|
|
1762
|
-
}, [p, c, l, y]), /* @__PURE__ */
|
|
1767
|
+
}, [p, c, l, y]), /* @__PURE__ */ X(
|
|
1763
1768
|
"div",
|
|
1764
1769
|
{
|
|
1765
1770
|
...s,
|
|
1766
|
-
"aria-controls":
|
|
1771
|
+
"aria-controls": i.valueControls,
|
|
1767
1772
|
"aria-orientation": v,
|
|
1768
|
-
"aria-valuemax":
|
|
1769
|
-
"aria-valuemin":
|
|
1770
|
-
"aria-valuenow":
|
|
1773
|
+
"aria-valuemax": i.valueMax,
|
|
1774
|
+
"aria-valuemin": i.valueMin,
|
|
1775
|
+
"aria-valuenow": i.valueNow,
|
|
1771
1776
|
children: e,
|
|
1772
1777
|
className: t,
|
|
1773
1778
|
"data-separator": u,
|
|
1774
1779
|
"data-testid": l,
|
|
1775
1780
|
id: l,
|
|
1776
|
-
ref:
|
|
1781
|
+
ref: h,
|
|
1777
1782
|
role: "separator",
|
|
1778
1783
|
style: {
|
|
1779
1784
|
flexBasis: "auto",
|
|
1780
|
-
...
|
|
1785
|
+
...r,
|
|
1781
1786
|
flexGrow: 0,
|
|
1782
1787
|
flexShrink: 0
|
|
1783
1788
|
},
|