react-resizable-panels 4.5.9 → 4.6.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,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as J } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Z, useCallback as q, useId as tt, useLayoutEffect as Oe, useEffect as Te, useRef as I, createContext as nt, useImperativeHandle as Ne, useMemo as _e, useSyncExternalStore as Ae, useContext as ot } from "react";
|
|
4
|
+
function b(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function B({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
@@ -48,117 +48,121 @@ function st({
|
|
|
48
48
|
x: n.x + n.width / 2,
|
|
49
49
|
y: n.y + n.height / 2
|
|
50
50
|
};
|
|
51
|
-
let i,
|
|
51
|
+
let i, s = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x:
|
|
54
|
-
|
|
53
|
+
const { x: r, y: a } = $e(o, l), f = e === "horizontal" ? r : a;
|
|
54
|
+
f < s && (s = f, i = l);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return b(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let ie;
|
|
59
59
|
function at() {
|
|
60
60
|
return ie === void 0 && (typeof matchMedia == "function" ? ie = !!matchMedia("(pointer:coarse)").matches : ie = !1), ie;
|
|
61
61
|
}
|
|
62
62
|
function He(e) {
|
|
63
|
-
const { element: t, orientation: n, panels: o, separators: i } = e,
|
|
63
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, s = fe(
|
|
64
64
|
n,
|
|
65
|
-
Array.from(t.children).filter(Fe).map((
|
|
66
|
-
).map(({ element:
|
|
67
|
-
let
|
|
68
|
-
for (const
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
Array.from(t.children).filter(Fe).map((z) => ({ element: z }))
|
|
66
|
+
).map(({ element: z }) => z), l = [];
|
|
67
|
+
let r = !1, a = !1, f = !1, u, m = [];
|
|
68
|
+
for (const z of s)
|
|
69
|
+
if (z.hasAttribute("data-panel")) {
|
|
70
|
+
z.ariaDisabled !== null && (r = !0);
|
|
71
|
+
const S = o.find(
|
|
72
|
+
(c) => c.element === z
|
|
72
73
|
);
|
|
73
|
-
if (
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
let
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
if (S) {
|
|
75
|
+
if (u) {
|
|
76
|
+
const c = u.element.getBoundingClientRect(), d = z.getBoundingClientRect();
|
|
77
|
+
let p;
|
|
78
|
+
if (f) {
|
|
79
|
+
const y = n === "horizontal" ? new DOMRect(c.right, c.top, 0, c.height) : new DOMRect(
|
|
80
|
+
c.left,
|
|
81
|
+
c.bottom,
|
|
82
|
+
c.width,
|
|
82
83
|
0
|
|
83
|
-
),
|
|
84
|
-
switch (
|
|
84
|
+
), h = n === "horizontal" ? new DOMRect(d.left, d.top, 0, d.height) : new DOMRect(d.left, d.top, d.width, 0);
|
|
85
|
+
switch (m.length) {
|
|
85
86
|
case 0: {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
p = [
|
|
88
|
+
y,
|
|
89
|
+
h
|
|
89
90
|
];
|
|
90
91
|
break;
|
|
91
92
|
}
|
|
92
93
|
case 1: {
|
|
93
|
-
const
|
|
94
|
+
const v = m[0], g = st({
|
|
94
95
|
orientation: n,
|
|
95
|
-
rects: [
|
|
96
|
-
targetRect:
|
|
96
|
+
rects: [c, d],
|
|
97
|
+
targetRect: v.element.getBoundingClientRect()
|
|
97
98
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
p = [
|
|
100
|
+
v,
|
|
101
|
+
g === c ? h : y
|
|
101
102
|
];
|
|
102
103
|
break;
|
|
103
104
|
}
|
|
104
105
|
default: {
|
|
105
|
-
|
|
106
|
+
p = m;
|
|
106
107
|
break;
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
} else
|
|
110
|
-
|
|
111
|
+
m.length ? p = m : p = [
|
|
111
112
|
n === "horizontal" ? new DOMRect(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
c.right,
|
|
114
|
+
d.top,
|
|
115
|
+
d.left - c.right,
|
|
116
|
+
d.height
|
|
116
117
|
) : new DOMRect(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
d.left,
|
|
119
|
+
c.bottom,
|
|
120
|
+
d.width,
|
|
121
|
+
d.top - c.bottom
|
|
121
122
|
)
|
|
122
123
|
];
|
|
123
|
-
for (const
|
|
124
|
-
let
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
for (const y of p) {
|
|
125
|
+
let h = "width" in y ? y : y.element.getBoundingClientRect();
|
|
126
|
+
const v = at() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
127
|
+
if (h.width < v) {
|
|
128
|
+
const x = v - h.width;
|
|
129
|
+
h = new DOMRect(
|
|
130
|
+
h.x - x / 2,
|
|
131
|
+
h.y,
|
|
132
|
+
h.width + x,
|
|
133
|
+
h.height
|
|
133
134
|
);
|
|
134
135
|
}
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
if (h.height < v) {
|
|
137
|
+
const x = v - h.height;
|
|
138
|
+
h = new DOMRect(
|
|
139
|
+
h.x,
|
|
140
|
+
h.y - x / 2,
|
|
141
|
+
h.width,
|
|
142
|
+
h.height + x
|
|
142
143
|
);
|
|
143
144
|
}
|
|
145
|
+
const g = !("width" in y);
|
|
144
146
|
l.push({
|
|
147
|
+
disabled: a || r && !g,
|
|
145
148
|
group: e,
|
|
146
|
-
groupSize:
|
|
147
|
-
panels: [
|
|
148
|
-
separator: "width" in
|
|
149
|
-
rect:
|
|
150
|
-
});
|
|
149
|
+
groupSize: B({ group: e }),
|
|
150
|
+
panels: [u, S],
|
|
151
|
+
separator: "width" in y ? void 0 : y,
|
|
152
|
+
rect: h
|
|
153
|
+
}), r = !1, a = !1;
|
|
151
154
|
}
|
|
152
155
|
}
|
|
153
|
-
|
|
156
|
+
f = !1, u = S, m = [];
|
|
154
157
|
}
|
|
155
|
-
} else if (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
} else if (z.hasAttribute("data-separator")) {
|
|
159
|
+
z.ariaDisabled !== null && (a = !0);
|
|
160
|
+
const S = i.find(
|
|
161
|
+
(c) => c.element === z
|
|
158
162
|
);
|
|
159
|
-
|
|
163
|
+
S ? m.push(S) : (u = void 0, m = []);
|
|
160
164
|
} else
|
|
161
|
-
|
|
165
|
+
f = !0;
|
|
162
166
|
return l;
|
|
163
167
|
}
|
|
164
168
|
function lt(e, t) {
|
|
@@ -191,8 +195,8 @@ function re({
|
|
|
191
195
|
styleProp: n
|
|
192
196
|
}) {
|
|
193
197
|
let o;
|
|
194
|
-
const [i,
|
|
195
|
-
switch (
|
|
198
|
+
const [i, s] = dt(n);
|
|
199
|
+
switch (s) {
|
|
196
200
|
case "%": {
|
|
197
201
|
o = i / 100 * e;
|
|
198
202
|
break;
|
|
@@ -220,62 +224,64 @@ function re({
|
|
|
220
224
|
}
|
|
221
225
|
return o;
|
|
222
226
|
}
|
|
223
|
-
function
|
|
227
|
+
function O(e) {
|
|
224
228
|
return parseFloat(e.toFixed(3));
|
|
225
229
|
}
|
|
226
230
|
function Se(e) {
|
|
227
|
-
const { panels: t } = e, n =
|
|
231
|
+
const { panels: t } = e, n = B({ group: e });
|
|
228
232
|
return n === 0 ? t.map((o) => ({
|
|
229
233
|
collapsedSize: 0,
|
|
230
234
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
231
235
|
defaultSize: void 0,
|
|
236
|
+
disabled: o.panelConstraints.disabled,
|
|
232
237
|
minSize: 0,
|
|
233
238
|
maxSize: 100,
|
|
234
239
|
panelId: o.id
|
|
235
240
|
})) : t.map((o) => {
|
|
236
|
-
const { element: i, panelConstraints:
|
|
241
|
+
const { element: i, panelConstraints: s } = o;
|
|
237
242
|
let l = 0;
|
|
238
|
-
if (
|
|
243
|
+
if (s.collapsedSize !== void 0) {
|
|
239
244
|
const u = re({
|
|
240
245
|
groupSize: n,
|
|
241
246
|
panelElement: i,
|
|
242
|
-
styleProp:
|
|
247
|
+
styleProp: s.collapsedSize
|
|
243
248
|
});
|
|
244
|
-
l =
|
|
249
|
+
l = O(u / n * 100);
|
|
245
250
|
}
|
|
246
|
-
let
|
|
247
|
-
if (
|
|
251
|
+
let r;
|
|
252
|
+
if (s.defaultSize !== void 0) {
|
|
248
253
|
const u = re({
|
|
249
254
|
groupSize: n,
|
|
250
255
|
panelElement: i,
|
|
251
|
-
styleProp:
|
|
256
|
+
styleProp: s.defaultSize
|
|
252
257
|
});
|
|
253
|
-
|
|
258
|
+
r = O(u / n * 100);
|
|
254
259
|
}
|
|
255
260
|
let a = 0;
|
|
256
|
-
if (
|
|
261
|
+
if (s.minSize !== void 0) {
|
|
257
262
|
const u = re({
|
|
258
263
|
groupSize: n,
|
|
259
264
|
panelElement: i,
|
|
260
|
-
styleProp:
|
|
265
|
+
styleProp: s.minSize
|
|
261
266
|
});
|
|
262
|
-
a =
|
|
267
|
+
a = O(u / n * 100);
|
|
263
268
|
}
|
|
264
|
-
let
|
|
265
|
-
if (
|
|
269
|
+
let f = 100;
|
|
270
|
+
if (s.maxSize !== void 0) {
|
|
266
271
|
const u = re({
|
|
267
272
|
groupSize: n,
|
|
268
273
|
panelElement: i,
|
|
269
|
-
styleProp:
|
|
274
|
+
styleProp: s.maxSize
|
|
270
275
|
});
|
|
271
|
-
|
|
276
|
+
f = O(u / n * 100);
|
|
272
277
|
}
|
|
273
278
|
return {
|
|
274
279
|
collapsedSize: l,
|
|
275
|
-
collapsible:
|
|
276
|
-
defaultSize:
|
|
280
|
+
collapsible: s.collapsible === !0,
|
|
281
|
+
defaultSize: r,
|
|
282
|
+
disabled: s.disabled,
|
|
277
283
|
minSize: a,
|
|
278
|
-
maxSize:
|
|
284
|
+
maxSize: f,
|
|
279
285
|
panelId: o.id
|
|
280
286
|
};
|
|
281
287
|
});
|
|
@@ -294,18 +300,18 @@ class pt {
|
|
|
294
300
|
if (o.length === 1)
|
|
295
301
|
o[0].call(null, n);
|
|
296
302
|
else {
|
|
297
|
-
let i = !1,
|
|
303
|
+
let i = !1, s = null;
|
|
298
304
|
const l = Array.from(o);
|
|
299
|
-
for (let
|
|
300
|
-
const a = l[
|
|
305
|
+
for (let r = 0; r < l.length; r++) {
|
|
306
|
+
const a = l[r];
|
|
301
307
|
try {
|
|
302
308
|
a.call(null, n);
|
|
303
|
-
} catch (
|
|
304
|
-
|
|
309
|
+
} catch (f) {
|
|
310
|
+
s === null && (i = !0, s = f);
|
|
305
311
|
}
|
|
306
312
|
}
|
|
307
313
|
if (i)
|
|
308
|
-
throw
|
|
314
|
+
throw s;
|
|
309
315
|
}
|
|
310
316
|
}
|
|
311
317
|
removeAllListeners() {
|
|
@@ -319,60 +325,62 @@ class pt {
|
|
|
319
325
|
}
|
|
320
326
|
}
|
|
321
327
|
}
|
|
322
|
-
function
|
|
323
|
-
return Math.abs(
|
|
328
|
+
function M(e, t, n = 0) {
|
|
329
|
+
return Math.abs(O(e) - O(t)) <= n;
|
|
324
330
|
}
|
|
325
|
-
let
|
|
331
|
+
let D = {
|
|
326
332
|
cursorFlags: 0,
|
|
327
333
|
interactionState: {
|
|
328
334
|
state: "inactive"
|
|
329
335
|
},
|
|
330
336
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
337
|
};
|
|
332
|
-
const
|
|
333
|
-
function
|
|
334
|
-
return
|
|
335
|
-
}
|
|
336
|
-
function
|
|
337
|
-
const t = typeof e == "function" ? e(
|
|
338
|
-
if (
|
|
339
|
-
return
|
|
340
|
-
const n =
|
|
341
|
-
return
|
|
342
|
-
...
|
|
338
|
+
const N = new pt();
|
|
339
|
+
function G() {
|
|
340
|
+
return D;
|
|
341
|
+
}
|
|
342
|
+
function E(e) {
|
|
343
|
+
const t = typeof e == "function" ? e(D) : e;
|
|
344
|
+
if (D === t)
|
|
345
|
+
return D;
|
|
346
|
+
const n = D;
|
|
347
|
+
return D = {
|
|
348
|
+
...D,
|
|
343
349
|
...t
|
|
344
|
-
}, t.cursorFlags !== void 0 &&
|
|
345
|
-
o.derivedPanelConstraints.forEach((
|
|
346
|
-
if (
|
|
350
|
+
}, t.cursorFlags !== void 0 && N.emit("cursorFlagsChange", D.cursorFlags), t.interactionState !== void 0 && N.emit("interactionStateChange", D.interactionState), t.mountedGroups !== void 0 && (D.mountedGroups.forEach((o, i) => {
|
|
351
|
+
o.derivedPanelConstraints.forEach((s) => {
|
|
352
|
+
if (s.collapsible) {
|
|
347
353
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
348
354
|
if (l) {
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
o.layout[
|
|
352
|
-
), a =
|
|
353
|
-
|
|
354
|
-
l[
|
|
355
|
+
const r = M(
|
|
356
|
+
s.collapsedSize,
|
|
357
|
+
o.layout[s.panelId]
|
|
358
|
+
), a = M(
|
|
359
|
+
s.collapsedSize,
|
|
360
|
+
l[s.panelId]
|
|
355
361
|
);
|
|
356
|
-
|
|
362
|
+
r && !a && (i.inMemoryLastExpandedPanelSizes[s.panelId] = l[s.panelId]);
|
|
357
363
|
}
|
|
358
364
|
}
|
|
359
365
|
});
|
|
360
|
-
}),
|
|
366
|
+
}), N.emit("mountedGroupsChange", D.mountedGroups)), D;
|
|
361
367
|
}
|
|
362
368
|
function mt(e, t, n) {
|
|
363
369
|
let o, i = {
|
|
364
370
|
x: 1 / 0,
|
|
365
371
|
y: 1 / 0
|
|
366
372
|
};
|
|
367
|
-
for (const
|
|
368
|
-
|
|
373
|
+
for (const s of t) {
|
|
374
|
+
if (s.disabled)
|
|
375
|
+
continue;
|
|
376
|
+
const l = $e(n, s.rect);
|
|
369
377
|
switch (e) {
|
|
370
378
|
case "horizontal": {
|
|
371
|
-
l.x <= i.x && (o =
|
|
379
|
+
l.x <= i.x && (o = s, i = l);
|
|
372
380
|
break;
|
|
373
381
|
}
|
|
374
382
|
case "vertical": {
|
|
375
|
-
l.y <= i.y && (o =
|
|
383
|
+
l.y <= i.y && (o = s, i = l);
|
|
376
384
|
break;
|
|
377
385
|
}
|
|
378
386
|
}
|
|
@@ -394,7 +402,7 @@ function gt(e, t) {
|
|
|
394
402
|
let o;
|
|
395
403
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
396
404
|
o = n.a.pop(), n.b.pop();
|
|
397
|
-
|
|
405
|
+
b(
|
|
398
406
|
o,
|
|
399
407
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
400
408
|
);
|
|
@@ -403,13 +411,13 @@ function gt(e, t) {
|
|
|
403
411
|
b: ze(ve(n.b))
|
|
404
412
|
};
|
|
405
413
|
if (i.a === i.b) {
|
|
406
|
-
const
|
|
414
|
+
const s = o.childNodes, l = {
|
|
407
415
|
a: n.a.at(-1),
|
|
408
416
|
b: n.b.at(-1)
|
|
409
417
|
};
|
|
410
|
-
let
|
|
411
|
-
for (;
|
|
412
|
-
const a = r
|
|
418
|
+
let r = s.length;
|
|
419
|
+
for (; r--; ) {
|
|
420
|
+
const a = s[r];
|
|
413
421
|
if (a === l.a) return 1;
|
|
414
422
|
if (a === l.b) return -1;
|
|
415
423
|
}
|
|
@@ -429,7 +437,7 @@ function ve(e) {
|
|
|
429
437
|
let t = e.length;
|
|
430
438
|
for (; t--; ) {
|
|
431
439
|
const n = e[t];
|
|
432
|
-
if (
|
|
440
|
+
if (b(n, "Missing node"), vt(n)) return n;
|
|
433
441
|
}
|
|
434
442
|
return null;
|
|
435
443
|
}
|
|
@@ -473,7 +481,7 @@ function de(e, t) {
|
|
|
473
481
|
return t.forEach((o, i) => {
|
|
474
482
|
if (i.disabled)
|
|
475
483
|
return;
|
|
476
|
-
const
|
|
484
|
+
const s = He(i), l = mt(i.orientation, s, {
|
|
477
485
|
x: e.clientX,
|
|
478
486
|
y: e.clientY
|
|
479
487
|
});
|
|
@@ -492,343 +500,355 @@ function bt(e, t) {
|
|
|
492
500
|
return !1;
|
|
493
501
|
return !0;
|
|
494
502
|
}
|
|
495
|
-
function
|
|
496
|
-
return
|
|
503
|
+
function T(e, t) {
|
|
504
|
+
return M(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
505
|
}
|
|
498
|
-
function
|
|
506
|
+
function U({
|
|
499
507
|
panelConstraints: e,
|
|
500
|
-
|
|
508
|
+
prevSize: t,
|
|
509
|
+
size: n
|
|
501
510
|
}) {
|
|
502
511
|
const {
|
|
503
|
-
collapsedSize:
|
|
504
|
-
collapsible:
|
|
505
|
-
|
|
512
|
+
collapsedSize: o = 0,
|
|
513
|
+
collapsible: i,
|
|
514
|
+
disabled: s,
|
|
515
|
+
maxSize: l = 100,
|
|
506
516
|
minSize: r = 0
|
|
507
517
|
} = e;
|
|
508
|
-
if (
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
518
|
+
if (s)
|
|
519
|
+
return t;
|
|
520
|
+
if (T(n, r) < 0)
|
|
521
|
+
if (i) {
|
|
522
|
+
const a = (o + r) / 2;
|
|
523
|
+
T(n, a) < 0 ? n = o : n = r;
|
|
512
524
|
} else
|
|
513
|
-
|
|
514
|
-
return
|
|
525
|
+
n = r;
|
|
526
|
+
return n = Math.min(l, n), n = O(n), n;
|
|
515
527
|
}
|
|
516
|
-
function
|
|
528
|
+
function Q({
|
|
517
529
|
delta: e,
|
|
518
530
|
initialLayout: t,
|
|
519
531
|
panelConstraints: n,
|
|
520
532
|
pivotIndices: o,
|
|
521
533
|
prevLayout: i,
|
|
522
|
-
trigger:
|
|
534
|
+
trigger: s
|
|
523
535
|
}) {
|
|
524
|
-
if (
|
|
536
|
+
if (M(e, 0))
|
|
525
537
|
return t;
|
|
526
|
-
const l = Object.values(t),
|
|
527
|
-
|
|
528
|
-
let
|
|
529
|
-
switch (
|
|
538
|
+
const l = Object.values(t), r = Object.values(i), a = [...l], [f, u] = o;
|
|
539
|
+
b(f != null, "Invalid first pivot index"), b(u != null, "Invalid second pivot index");
|
|
540
|
+
let m = 0;
|
|
541
|
+
switch (s) {
|
|
530
542
|
case "keyboard": {
|
|
531
543
|
{
|
|
532
|
-
const
|
|
533
|
-
|
|
544
|
+
const c = e < 0 ? u : f, d = n[c];
|
|
545
|
+
b(
|
|
534
546
|
d,
|
|
535
|
-
`Panel constraints not found for index ${
|
|
547
|
+
`Panel constraints not found for index ${c}`
|
|
536
548
|
);
|
|
537
549
|
const {
|
|
538
550
|
collapsedSize: p = 0,
|
|
539
|
-
collapsible:
|
|
540
|
-
minSize:
|
|
551
|
+
collapsible: y,
|
|
552
|
+
minSize: h = 0
|
|
541
553
|
} = d;
|
|
542
|
-
if (
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
|
|
546
|
-
`Previous layout not found for panel index ${
|
|
547
|
-
),
|
|
548
|
-
const
|
|
549
|
-
|
|
554
|
+
if (y) {
|
|
555
|
+
const v = l[c];
|
|
556
|
+
if (b(
|
|
557
|
+
v != null,
|
|
558
|
+
`Previous layout not found for panel index ${c}`
|
|
559
|
+
), M(v, p)) {
|
|
560
|
+
const g = h - v;
|
|
561
|
+
T(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
550
562
|
}
|
|
551
563
|
}
|
|
552
564
|
}
|
|
553
565
|
{
|
|
554
|
-
const
|
|
555
|
-
|
|
566
|
+
const c = e < 0 ? f : u, d = n[c];
|
|
567
|
+
b(
|
|
556
568
|
d,
|
|
557
|
-
`No panel constraints found for index ${
|
|
569
|
+
`No panel constraints found for index ${c}`
|
|
558
570
|
);
|
|
559
571
|
const {
|
|
560
572
|
collapsedSize: p = 0,
|
|
561
|
-
collapsible:
|
|
562
|
-
minSize:
|
|
573
|
+
collapsible: y,
|
|
574
|
+
minSize: h = 0
|
|
563
575
|
} = d;
|
|
564
|
-
if (
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
567
|
-
|
|
568
|
-
`Previous layout not found for panel index ${
|
|
569
|
-
),
|
|
570
|
-
const
|
|
571
|
-
|
|
576
|
+
if (y) {
|
|
577
|
+
const v = l[c];
|
|
578
|
+
if (b(
|
|
579
|
+
v != null,
|
|
580
|
+
`Previous layout not found for panel index ${c}`
|
|
581
|
+
), M(v, h)) {
|
|
582
|
+
const g = v - p;
|
|
583
|
+
T(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
572
584
|
}
|
|
573
585
|
}
|
|
574
586
|
}
|
|
575
587
|
break;
|
|
576
588
|
}
|
|
577
589
|
default: {
|
|
578
|
-
const
|
|
579
|
-
|
|
590
|
+
const c = e < 0 ? u : f, d = n[c];
|
|
591
|
+
b(
|
|
580
592
|
d,
|
|
581
|
-
`Panel constraints not found for index ${
|
|
593
|
+
`Panel constraints not found for index ${c}`
|
|
582
594
|
);
|
|
583
|
-
const p = l[
|
|
584
|
-
if (
|
|
595
|
+
const p = l[c], { collapsible: y, collapsedSize: h, minSize: v } = d;
|
|
596
|
+
if (y && T(p, v) < 0)
|
|
585
597
|
if (e > 0) {
|
|
586
|
-
const
|
|
587
|
-
|
|
598
|
+
const g = v - h, x = g / 2, C = p + e;
|
|
599
|
+
T(C, v) < 0 && (e = T(e, x) <= 0 ? 0 : g);
|
|
588
600
|
} else {
|
|
589
|
-
const
|
|
590
|
-
|
|
601
|
+
const g = v - h, x = 100 - g / 2, C = p - e;
|
|
602
|
+
T(C, v) < 0 && (e = T(100 + e, x) > 0 ? 0 : -g);
|
|
591
603
|
}
|
|
592
604
|
break;
|
|
593
605
|
}
|
|
594
606
|
}
|
|
595
607
|
{
|
|
596
|
-
const
|
|
597
|
-
let d = e < 0 ? u :
|
|
608
|
+
const c = e < 0 ? 1 : -1;
|
|
609
|
+
let d = e < 0 ? u : f, p = 0;
|
|
598
610
|
for (; ; ) {
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
|
|
611
|
+
const h = l[d];
|
|
612
|
+
b(
|
|
613
|
+
h != null,
|
|
602
614
|
`Previous layout not found for panel index ${d}`
|
|
603
615
|
);
|
|
604
|
-
const
|
|
616
|
+
const g = U({
|
|
605
617
|
panelConstraints: n[d],
|
|
618
|
+
prevSize: h,
|
|
606
619
|
size: 100
|
|
607
|
-
}) -
|
|
608
|
-
if (p +=
|
|
620
|
+
}) - h;
|
|
621
|
+
if (p += g, d += c, d < 0 || d >= n.length)
|
|
609
622
|
break;
|
|
610
623
|
}
|
|
611
|
-
const
|
|
612
|
-
e = e < 0 ? 0 -
|
|
624
|
+
const y = Math.min(Math.abs(e), Math.abs(p));
|
|
625
|
+
e = e < 0 ? 0 - y : y;
|
|
613
626
|
}
|
|
614
627
|
{
|
|
615
|
-
let d = e < 0 ?
|
|
628
|
+
let d = e < 0 ? f : u;
|
|
616
629
|
for (; d >= 0 && d < n.length; ) {
|
|
617
|
-
const p = Math.abs(e) - Math.abs(
|
|
618
|
-
|
|
619
|
-
|
|
630
|
+
const p = Math.abs(e) - Math.abs(m), y = l[d];
|
|
631
|
+
b(
|
|
632
|
+
y != null,
|
|
620
633
|
`Previous layout not found for panel index ${d}`
|
|
621
634
|
);
|
|
622
|
-
const
|
|
635
|
+
const h = y - p, v = U({
|
|
623
636
|
panelConstraints: n[d],
|
|
624
|
-
|
|
637
|
+
prevSize: y,
|
|
638
|
+
size: h
|
|
625
639
|
});
|
|
626
|
-
if (!
|
|
640
|
+
if (!M(y, v) && (m += y - v, a[d] = v, m.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
627
641
|
numeric: !0
|
|
628
642
|
}) >= 0))
|
|
629
643
|
break;
|
|
630
644
|
e < 0 ? d-- : d++;
|
|
631
645
|
}
|
|
632
646
|
}
|
|
633
|
-
if (bt(
|
|
647
|
+
if (bt(r, a))
|
|
634
648
|
return i;
|
|
635
649
|
{
|
|
636
|
-
const
|
|
637
|
-
|
|
650
|
+
const c = e < 0 ? u : f, d = l[c];
|
|
651
|
+
b(
|
|
638
652
|
d != null,
|
|
639
|
-
`Previous layout not found for panel index ${
|
|
653
|
+
`Previous layout not found for panel index ${c}`
|
|
640
654
|
);
|
|
641
|
-
const p = d +
|
|
642
|
-
panelConstraints: n[
|
|
655
|
+
const p = d + m, y = U({
|
|
656
|
+
panelConstraints: n[c],
|
|
657
|
+
prevSize: d,
|
|
643
658
|
size: p
|
|
644
659
|
});
|
|
645
|
-
if (a[
|
|
646
|
-
let
|
|
647
|
-
for (;
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
`Previous layout not found for panel index ${
|
|
660
|
+
if (a[c] = y, !M(y, p)) {
|
|
661
|
+
let h = p - y, g = e < 0 ? u : f;
|
|
662
|
+
for (; g >= 0 && g < n.length; ) {
|
|
663
|
+
const x = a[g];
|
|
664
|
+
b(
|
|
665
|
+
x != null,
|
|
666
|
+
`Previous layout not found for panel index ${g}`
|
|
652
667
|
);
|
|
653
|
-
const C =
|
|
654
|
-
panelConstraints: n[
|
|
668
|
+
const C = x + h, L = U({
|
|
669
|
+
panelConstraints: n[g],
|
|
670
|
+
prevSize: x,
|
|
655
671
|
size: C
|
|
656
672
|
});
|
|
657
|
-
if (
|
|
673
|
+
if (M(x, L) || (h -= L - x, a[g] = L), M(h, 0))
|
|
658
674
|
break;
|
|
659
|
-
e > 0 ?
|
|
675
|
+
e > 0 ? g-- : g++;
|
|
660
676
|
}
|
|
661
677
|
}
|
|
662
678
|
}
|
|
663
|
-
const
|
|
664
|
-
(
|
|
679
|
+
const z = Object.values(a).reduce(
|
|
680
|
+
(c, d) => d + c,
|
|
665
681
|
0
|
|
666
682
|
);
|
|
667
|
-
if (!
|
|
683
|
+
if (!M(z, 100, 0.1))
|
|
668
684
|
return i;
|
|
669
|
-
const
|
|
670
|
-
return a.reduce((
|
|
685
|
+
const S = Object.keys(i);
|
|
686
|
+
return a.reduce((c, d, p) => (c[S[p]] = d, c), {});
|
|
671
687
|
}
|
|
672
|
-
function
|
|
688
|
+
function $(e, t) {
|
|
673
689
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
674
690
|
return !1;
|
|
675
691
|
for (const n in e)
|
|
676
|
-
if (t[n] === void 0 ||
|
|
692
|
+
if (t[n] === void 0 || T(e[n], t[n]) !== 0)
|
|
677
693
|
return !1;
|
|
678
694
|
return !0;
|
|
679
695
|
}
|
|
680
|
-
function
|
|
696
|
+
function H({
|
|
681
697
|
layout: e,
|
|
682
698
|
panelConstraints: t
|
|
683
699
|
}) {
|
|
684
|
-
const
|
|
685
|
-
(
|
|
700
|
+
const n = Object.values(e), o = [...n], i = o.reduce(
|
|
701
|
+
(r, a) => r + a,
|
|
686
702
|
0
|
|
687
703
|
);
|
|
688
704
|
if (o.length !== t.length)
|
|
689
705
|
throw Error(
|
|
690
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
706
|
+
`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
|
|
691
707
|
);
|
|
692
|
-
if (!
|
|
693
|
-
for (let
|
|
694
|
-
const a = o[
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
o[
|
|
708
|
+
if (!M(i, 100) && o.length > 0)
|
|
709
|
+
for (let r = 0; r < t.length; r++) {
|
|
710
|
+
const a = o[r];
|
|
711
|
+
b(a != null, `No layout data found for index ${r}`);
|
|
712
|
+
const f = 100 / i * a;
|
|
713
|
+
o[r] = f;
|
|
698
714
|
}
|
|
699
|
-
let
|
|
700
|
-
for (let
|
|
701
|
-
const a =
|
|
702
|
-
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
|
|
715
|
+
let s = 0;
|
|
716
|
+
for (let r = 0; r < t.length; r++) {
|
|
717
|
+
const a = n[r];
|
|
718
|
+
b(a != null, `No layout data found for index ${r}`);
|
|
719
|
+
const f = o[r];
|
|
720
|
+
b(f != null, `No layout data found for index ${r}`);
|
|
721
|
+
const u = U({
|
|
722
|
+
panelConstraints: t[r],
|
|
723
|
+
prevSize: a,
|
|
724
|
+
size: f
|
|
706
725
|
});
|
|
707
|
-
|
|
726
|
+
f != u && (s += f - u, o[r] = u);
|
|
708
727
|
}
|
|
709
|
-
if (!
|
|
710
|
-
for (let
|
|
711
|
-
const a = o[
|
|
712
|
-
|
|
713
|
-
const
|
|
714
|
-
panelConstraints: t[
|
|
715
|
-
|
|
728
|
+
if (!M(s, 0))
|
|
729
|
+
for (let r = 0; r < t.length; r++) {
|
|
730
|
+
const a = o[r];
|
|
731
|
+
b(a != null, `No layout data found for index ${r}`);
|
|
732
|
+
const f = a + s, u = U({
|
|
733
|
+
panelConstraints: t[r],
|
|
734
|
+
prevSize: a,
|
|
735
|
+
size: f
|
|
716
736
|
});
|
|
717
|
-
if (a !== u && (
|
|
737
|
+
if (a !== u && (s -= u - a, o[r] = u, M(s, 0)))
|
|
718
738
|
break;
|
|
719
739
|
}
|
|
720
740
|
const l = Object.keys(e);
|
|
721
|
-
return o.reduce((
|
|
741
|
+
return o.reduce((r, a, f) => (r[l[f]] = a, r), {});
|
|
722
742
|
}
|
|
723
743
|
function Ve({
|
|
724
744
|
groupId: e,
|
|
725
745
|
panelId: t
|
|
726
746
|
}) {
|
|
727
747
|
const n = () => {
|
|
728
|
-
const { mountedGroups:
|
|
748
|
+
const { mountedGroups: r } = G();
|
|
729
749
|
for (const [
|
|
730
750
|
a,
|
|
731
751
|
{
|
|
732
|
-
defaultLayoutDeferred:
|
|
752
|
+
defaultLayoutDeferred: f,
|
|
733
753
|
derivedPanelConstraints: u,
|
|
734
|
-
layout:
|
|
735
|
-
separatorToPanels:
|
|
754
|
+
layout: m,
|
|
755
|
+
separatorToPanels: z
|
|
736
756
|
}
|
|
737
|
-
] of
|
|
757
|
+
] of r)
|
|
738
758
|
if (a.id === e)
|
|
739
759
|
return {
|
|
740
|
-
defaultLayoutDeferred:
|
|
760
|
+
defaultLayoutDeferred: f,
|
|
741
761
|
derivedPanelConstraints: u,
|
|
742
762
|
group: a,
|
|
743
|
-
layout:
|
|
744
|
-
separatorToPanels:
|
|
763
|
+
layout: m,
|
|
764
|
+
separatorToPanels: z
|
|
745
765
|
};
|
|
746
766
|
throw Error(`Group ${e} not found`);
|
|
747
767
|
}, o = () => {
|
|
748
|
-
const
|
|
768
|
+
const r = n().derivedPanelConstraints.find(
|
|
749
769
|
(a) => a.panelId === t
|
|
750
770
|
);
|
|
751
|
-
if (
|
|
752
|
-
return
|
|
771
|
+
if (r !== void 0)
|
|
772
|
+
return r;
|
|
753
773
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
754
774
|
}, i = () => {
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
757
|
-
return
|
|
775
|
+
const r = n().group.panels.find((a) => a.id === t);
|
|
776
|
+
if (r !== void 0)
|
|
777
|
+
return r;
|
|
758
778
|
throw Error(`Layout not found for Panel ${t}`);
|
|
759
|
-
},
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
762
|
-
return
|
|
779
|
+
}, s = () => {
|
|
780
|
+
const r = n().layout[t];
|
|
781
|
+
if (r !== void 0)
|
|
782
|
+
return r;
|
|
763
783
|
throw Error(`Layout not found for Panel ${t}`);
|
|
764
|
-
}, l = (
|
|
765
|
-
const a =
|
|
766
|
-
if (
|
|
784
|
+
}, l = (r) => {
|
|
785
|
+
const a = s();
|
|
786
|
+
if (r === a)
|
|
767
787
|
return;
|
|
768
788
|
const {
|
|
769
|
-
defaultLayoutDeferred:
|
|
789
|
+
defaultLayoutDeferred: f,
|
|
770
790
|
derivedPanelConstraints: u,
|
|
771
|
-
group:
|
|
772
|
-
layout:
|
|
773
|
-
separatorToPanels:
|
|
774
|
-
} = n(),
|
|
775
|
-
delta: d ? a -
|
|
776
|
-
initialLayout:
|
|
791
|
+
group: m,
|
|
792
|
+
layout: z,
|
|
793
|
+
separatorToPanels: S
|
|
794
|
+
} = n(), c = m.panels.findIndex((h) => h.id === t), d = c === m.panels.length - 1, p = Q({
|
|
795
|
+
delta: d ? a - r : r - a,
|
|
796
|
+
initialLayout: z,
|
|
777
797
|
panelConstraints: u,
|
|
778
|
-
pivotIndices: d ? [
|
|
779
|
-
prevLayout:
|
|
798
|
+
pivotIndices: d ? [c - 1, c] : [c, c + 1],
|
|
799
|
+
prevLayout: z,
|
|
780
800
|
trigger: "imperative-api"
|
|
781
|
-
}),
|
|
801
|
+
}), y = H({
|
|
782
802
|
layout: p,
|
|
783
803
|
panelConstraints: u
|
|
784
804
|
});
|
|
785
|
-
|
|
786
|
-
mountedGroups: new Map(
|
|
787
|
-
defaultLayoutDeferred:
|
|
805
|
+
$(z, y) || E((h) => ({
|
|
806
|
+
mountedGroups: new Map(h.mountedGroups).set(m, {
|
|
807
|
+
defaultLayoutDeferred: f,
|
|
788
808
|
derivedPanelConstraints: u,
|
|
789
|
-
layout:
|
|
790
|
-
separatorToPanels:
|
|
809
|
+
layout: y,
|
|
810
|
+
separatorToPanels: S
|
|
791
811
|
})
|
|
792
812
|
}));
|
|
793
813
|
};
|
|
794
814
|
return {
|
|
795
815
|
collapse: () => {
|
|
796
|
-
const { collapsible:
|
|
797
|
-
|
|
816
|
+
const { collapsible: r, collapsedSize: a } = o(), { mutableValues: f } = i(), u = s();
|
|
817
|
+
r && u !== a && (f.expandToSize = u, l(a));
|
|
798
818
|
},
|
|
799
819
|
expand: () => {
|
|
800
|
-
const { collapsible:
|
|
801
|
-
if (
|
|
802
|
-
let
|
|
803
|
-
|
|
820
|
+
const { collapsible: r, collapsedSize: a, minSize: f } = o(), { mutableValues: u } = i(), m = s();
|
|
821
|
+
if (r && m === a) {
|
|
822
|
+
let z = u.expandToSize ?? f;
|
|
823
|
+
z === 0 && (z = 1), l(z);
|
|
804
824
|
}
|
|
805
825
|
},
|
|
806
826
|
getSize: () => {
|
|
807
|
-
const { group:
|
|
827
|
+
const { group: r } = n(), a = s(), { element: f } = i(), u = r.orientation === "horizontal" ? f.offsetWidth : f.offsetHeight;
|
|
808
828
|
return {
|
|
809
829
|
asPercentage: a,
|
|
810
830
|
inPixels: u
|
|
811
831
|
};
|
|
812
832
|
},
|
|
813
833
|
isCollapsed: () => {
|
|
814
|
-
const { collapsible:
|
|
815
|
-
return
|
|
834
|
+
const { collapsible: r, collapsedSize: a } = o(), f = s();
|
|
835
|
+
return r && M(a, f);
|
|
816
836
|
},
|
|
817
|
-
resize: (
|
|
818
|
-
if (
|
|
819
|
-
let
|
|
820
|
-
switch (typeof
|
|
837
|
+
resize: (r) => {
|
|
838
|
+
if (s() !== r) {
|
|
839
|
+
let f;
|
|
840
|
+
switch (typeof r) {
|
|
821
841
|
case "number": {
|
|
822
|
-
const { group: u } = n(),
|
|
823
|
-
|
|
842
|
+
const { group: u } = n(), m = B({ group: u });
|
|
843
|
+
f = O(r / m * 100);
|
|
824
844
|
break;
|
|
825
845
|
}
|
|
826
846
|
case "string": {
|
|
827
|
-
|
|
847
|
+
f = parseFloat(r);
|
|
828
848
|
break;
|
|
829
849
|
}
|
|
830
850
|
}
|
|
831
|
-
l(
|
|
851
|
+
l(f);
|
|
832
852
|
}
|
|
833
853
|
}
|
|
834
854
|
};
|
|
@@ -836,24 +856,24 @@ function Ve({
|
|
|
836
856
|
function be(e) {
|
|
837
857
|
if (e.defaultPrevented)
|
|
838
858
|
return;
|
|
839
|
-
const { mountedGroups: t } =
|
|
859
|
+
const { mountedGroups: t } = G();
|
|
840
860
|
de(e, t).forEach((o) => {
|
|
841
861
|
if (o.separator) {
|
|
842
862
|
const i = o.panels.find(
|
|
843
|
-
(
|
|
863
|
+
(s) => s.panelConstraints.defaultSize !== void 0
|
|
844
864
|
);
|
|
845
865
|
if (i) {
|
|
846
|
-
const
|
|
866
|
+
const s = i.panelConstraints.defaultSize, l = Ve({
|
|
847
867
|
groupId: o.group.id,
|
|
848
868
|
panelId: i.id
|
|
849
869
|
});
|
|
850
|
-
l &&
|
|
870
|
+
l && s !== void 0 && (l.resize(s), e.preventDefault());
|
|
851
871
|
}
|
|
852
872
|
}
|
|
853
873
|
});
|
|
854
874
|
}
|
|
855
875
|
function ae(e) {
|
|
856
|
-
const { mountedGroups: t } =
|
|
876
|
+
const { mountedGroups: t } = G();
|
|
857
877
|
for (const [n] of t)
|
|
858
878
|
if (n.separators.some(
|
|
859
879
|
(o) => o.element === e
|
|
@@ -865,7 +885,7 @@ function We({
|
|
|
865
885
|
groupId: e
|
|
866
886
|
}) {
|
|
867
887
|
const t = () => {
|
|
868
|
-
const { mountedGroups: n } =
|
|
888
|
+
const { mountedGroups: n } = G();
|
|
869
889
|
for (const [o, i] of n)
|
|
870
890
|
if (o.id === e)
|
|
871
891
|
return { group: o, ...i };
|
|
@@ -880,55 +900,55 @@ function We({
|
|
|
880
900
|
const {
|
|
881
901
|
defaultLayoutDeferred: o,
|
|
882
902
|
derivedPanelConstraints: i,
|
|
883
|
-
group:
|
|
903
|
+
group: s,
|
|
884
904
|
layout: l,
|
|
885
|
-
separatorToPanels:
|
|
886
|
-
} = t(), a =
|
|
905
|
+
separatorToPanels: r
|
|
906
|
+
} = t(), a = H({
|
|
887
907
|
layout: n,
|
|
888
908
|
panelConstraints: i
|
|
889
909
|
});
|
|
890
910
|
if (o)
|
|
891
911
|
return l;
|
|
892
|
-
if (
|
|
893
|
-
|
|
894
|
-
mountedGroups: new Map(u.mountedGroups).set(
|
|
912
|
+
if (!$(l, a)) {
|
|
913
|
+
E((u) => ({
|
|
914
|
+
mountedGroups: new Map(u.mountedGroups).set(s, {
|
|
895
915
|
defaultLayoutDeferred: o,
|
|
896
916
|
derivedPanelConstraints: i,
|
|
897
917
|
layout: a,
|
|
898
|
-
separatorToPanels:
|
|
918
|
+
separatorToPanels: r
|
|
899
919
|
})
|
|
900
920
|
}));
|
|
901
|
-
const
|
|
902
|
-
|
|
921
|
+
const f = s.panels.map(({ id: u }) => u).join(",");
|
|
922
|
+
s.inMemoryLayouts[f] = a;
|
|
903
923
|
}
|
|
904
924
|
return a;
|
|
905
925
|
}
|
|
906
926
|
};
|
|
907
927
|
}
|
|
908
928
|
function Ue(e) {
|
|
909
|
-
const { mountedGroups: t } =
|
|
910
|
-
return
|
|
929
|
+
const { mountedGroups: t } = G(), n = t.get(e);
|
|
930
|
+
return b(n, `Mounted Group ${e.id} not found`), n;
|
|
911
931
|
}
|
|
912
|
-
function
|
|
932
|
+
function F(e, t) {
|
|
913
933
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
914
|
-
(
|
|
934
|
+
(m) => m.element === e
|
|
915
935
|
);
|
|
916
|
-
|
|
917
|
-
const
|
|
918
|
-
|
|
919
|
-
const l =
|
|
936
|
+
b(i, "Matching separator not found");
|
|
937
|
+
const s = o.separatorToPanels.get(i);
|
|
938
|
+
b(s, "Matching panels not found");
|
|
939
|
+
const l = s.map((m) => n.panels.indexOf(m)), a = We({ groupId: n.id }).getLayout(), f = Q({
|
|
920
940
|
delta: t,
|
|
921
941
|
initialLayout: a,
|
|
922
942
|
panelConstraints: o.derivedPanelConstraints,
|
|
923
943
|
pivotIndices: l,
|
|
924
944
|
prevLayout: a,
|
|
925
945
|
trigger: "keyboard"
|
|
926
|
-
}), u =
|
|
927
|
-
layout:
|
|
946
|
+
}), u = H({
|
|
947
|
+
layout: f,
|
|
928
948
|
panelConstraints: o.derivedPanelConstraints
|
|
929
949
|
});
|
|
930
|
-
|
|
931
|
-
mountedGroups: new Map(
|
|
950
|
+
$(a, u) || E((m) => ({
|
|
951
|
+
mountedGroups: new Map(m.mountedGroups).set(n, {
|
|
932
952
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
933
953
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
934
954
|
layout: u,
|
|
@@ -943,39 +963,39 @@ function we(e) {
|
|
|
943
963
|
if (!n.disabled)
|
|
944
964
|
switch (e.key) {
|
|
945
965
|
case "ArrowDown": {
|
|
946
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
966
|
+
e.preventDefault(), n.orientation === "vertical" && F(t, 5);
|
|
947
967
|
break;
|
|
948
968
|
}
|
|
949
969
|
case "ArrowLeft": {
|
|
950
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
970
|
+
e.preventDefault(), n.orientation === "horizontal" && F(t, -5);
|
|
951
971
|
break;
|
|
952
972
|
}
|
|
953
973
|
case "ArrowRight": {
|
|
954
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
974
|
+
e.preventDefault(), n.orientation === "horizontal" && F(t, 5);
|
|
955
975
|
break;
|
|
956
976
|
}
|
|
957
977
|
case "ArrowUp": {
|
|
958
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
978
|
+
e.preventDefault(), n.orientation === "vertical" && F(t, -5);
|
|
959
979
|
break;
|
|
960
980
|
}
|
|
961
981
|
case "End": {
|
|
962
|
-
e.preventDefault(),
|
|
982
|
+
e.preventDefault(), F(t, 100);
|
|
963
983
|
break;
|
|
964
984
|
}
|
|
965
985
|
case "Enter": {
|
|
966
986
|
e.preventDefault();
|
|
967
|
-
const o = ae(t), { derivedPanelConstraints: i, layout:
|
|
968
|
-
(
|
|
987
|
+
const o = ae(t), { derivedPanelConstraints: i, layout: s, separatorToPanels: l } = Ue(o), r = o.separators.find(
|
|
988
|
+
(m) => m.element === t
|
|
969
989
|
);
|
|
970
|
-
|
|
971
|
-
const a = l.get(
|
|
972
|
-
|
|
973
|
-
const
|
|
974
|
-
(
|
|
990
|
+
b(r, "Matching separator not found");
|
|
991
|
+
const a = l.get(r);
|
|
992
|
+
b(a, "Matching panels not found");
|
|
993
|
+
const f = a[0], u = i.find(
|
|
994
|
+
(m) => m.panelId === f.id
|
|
975
995
|
);
|
|
976
|
-
if (
|
|
977
|
-
const
|
|
978
|
-
|
|
996
|
+
if (b(u, "Panel metadata not found"), u.collapsible) {
|
|
997
|
+
const m = s[f.id], z = u.collapsedSize === m ? o.inMemoryLastExpandedPanelSizes[f.id] ?? u.minSize : u.collapsedSize;
|
|
998
|
+
F(t, z - m);
|
|
979
999
|
}
|
|
980
1000
|
break;
|
|
981
1001
|
}
|
|
@@ -983,16 +1003,16 @@ function we(e) {
|
|
|
983
1003
|
e.preventDefault();
|
|
984
1004
|
const i = ae(t).separators.map(
|
|
985
1005
|
(a) => a.element
|
|
986
|
-
),
|
|
1006
|
+
), s = Array.from(i).findIndex(
|
|
987
1007
|
(a) => a === e.currentTarget
|
|
988
1008
|
);
|
|
989
|
-
|
|
990
|
-
const l = e.shiftKey ?
|
|
1009
|
+
b(s !== null, "Index not found");
|
|
1010
|
+
const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
|
|
991
1011
|
i[l].focus();
|
|
992
1012
|
break;
|
|
993
1013
|
}
|
|
994
1014
|
case "Home": {
|
|
995
|
-
e.preventDefault(),
|
|
1015
|
+
e.preventDefault(), F(t, -100);
|
|
996
1016
|
break;
|
|
997
1017
|
}
|
|
998
1018
|
}
|
|
@@ -1002,13 +1022,13 @@ function Le(e) {
|
|
|
1002
1022
|
return;
|
|
1003
1023
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1004
1024
|
return;
|
|
1005
|
-
const { mountedGroups: t } =
|
|
1025
|
+
const { mountedGroups: t } = G(), n = de(e, t), o = /* @__PURE__ */ new Map();
|
|
1006
1026
|
let i = !1;
|
|
1007
|
-
n.forEach((
|
|
1008
|
-
|
|
1009
|
-
const l = t.get(
|
|
1010
|
-
l && o.set(
|
|
1011
|
-
}),
|
|
1027
|
+
n.forEach((s) => {
|
|
1028
|
+
s.separator && (i || (i = !0, s.separator.element.focus()));
|
|
1029
|
+
const l = t.get(s.group);
|
|
1030
|
+
l && o.set(s.group, l.layout);
|
|
1031
|
+
}), E({
|
|
1012
1032
|
interactionState: {
|
|
1013
1033
|
hitRegions: n,
|
|
1014
1034
|
initialLayoutMap: o,
|
|
@@ -1032,9 +1052,9 @@ function Lt({
|
|
|
1032
1052
|
switch (n) {
|
|
1033
1053
|
case "active":
|
|
1034
1054
|
case "hover":
|
|
1035
|
-
t.forEach((
|
|
1036
|
-
if (!
|
|
1037
|
-
switch (
|
|
1055
|
+
t.forEach((s) => {
|
|
1056
|
+
if (!s.disableCursor)
|
|
1057
|
+
switch (s.orientation) {
|
|
1038
1058
|
case "horizontal": {
|
|
1039
1059
|
o++;
|
|
1040
1060
|
break;
|
|
@@ -1046,25 +1066,25 @@ function Lt({
|
|
|
1046
1066
|
}
|
|
1047
1067
|
});
|
|
1048
1068
|
}
|
|
1049
|
-
if (o === 0 && i === 0)
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1069
|
+
if (!(o === 0 && i === 0)) {
|
|
1070
|
+
switch (n) {
|
|
1071
|
+
case "active": {
|
|
1072
|
+
if (e && Re()) {
|
|
1073
|
+
const s = (e & Be) !== 0, l = (e & Ke) !== 0, r = (e & Xe) !== 0, a = (e & qe) !== 0;
|
|
1074
|
+
if (s)
|
|
1075
|
+
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1076
|
+
if (l)
|
|
1077
|
+
return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
1078
|
+
if (r)
|
|
1079
|
+
return "s-resize";
|
|
1080
|
+
if (a)
|
|
1081
|
+
return "n-resize";
|
|
1082
|
+
}
|
|
1083
|
+
break;
|
|
1063
1084
|
}
|
|
1064
|
-
break;
|
|
1065
1085
|
}
|
|
1086
|
+
return Re() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1066
1087
|
}
|
|
1067
|
-
return Re() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1068
1088
|
}
|
|
1069
1089
|
const Me = /* @__PURE__ */ new WeakMap();
|
|
1070
1090
|
function pe(e) {
|
|
@@ -1072,18 +1092,18 @@ function pe(e) {
|
|
|
1072
1092
|
return;
|
|
1073
1093
|
let { prevStyle: t, styleSheet: n } = Me.get(e) ?? {};
|
|
1074
1094
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1075
|
-
const { cursorFlags: o, interactionState: i } =
|
|
1095
|
+
const { cursorFlags: o, interactionState: i } = G();
|
|
1076
1096
|
switch (i.state) {
|
|
1077
1097
|
case "active":
|
|
1078
1098
|
case "hover": {
|
|
1079
|
-
const
|
|
1099
|
+
const s = Lt({
|
|
1080
1100
|
cursorFlags: o,
|
|
1081
|
-
groups: i.hitRegions.map((
|
|
1101
|
+
groups: i.hitRegions.map((r) => r.group),
|
|
1082
1102
|
state: i.state
|
|
1083
|
-
}), l = `*, *:hover {cursor: ${
|
|
1103
|
+
}), l = `*, *:hover {cursor: ${s} !important; ${i.state === "active" ? "touch-action: none;" : ""} }`;
|
|
1084
1104
|
if (t === l)
|
|
1085
1105
|
return;
|
|
1086
|
-
t = l,
|
|
1106
|
+
t = l, s ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
1087
1107
|
break;
|
|
1088
1108
|
}
|
|
1089
1109
|
case "inactive": {
|
|
@@ -1102,62 +1122,62 @@ function Ye({
|
|
|
1102
1122
|
hitRegions: n,
|
|
1103
1123
|
initialLayoutMap: o,
|
|
1104
1124
|
mountedGroups: i,
|
|
1105
|
-
pointerDownAtPoint:
|
|
1125
|
+
pointerDownAtPoint: s,
|
|
1106
1126
|
prevCursorFlags: l
|
|
1107
1127
|
}) {
|
|
1108
|
-
let
|
|
1128
|
+
let r = 0;
|
|
1109
1129
|
const a = new Map(i);
|
|
1110
1130
|
n.forEach((u) => {
|
|
1111
|
-
const { group:
|
|
1131
|
+
const { group: m, groupSize: z } = u, { disableCursor: S, orientation: c, panels: d } = m;
|
|
1112
1132
|
let p = 0;
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1115
|
-
defaultLayoutDeferred:
|
|
1116
|
-
derivedPanelConstraints:
|
|
1117
|
-
layout:
|
|
1118
|
-
separatorToPanels:
|
|
1119
|
-
} = i.get(
|
|
1120
|
-
if (
|
|
1121
|
-
const C =
|
|
1133
|
+
s ? c === "horizontal" ? p = (t.clientX - s.x) / z * 100 : p = (t.clientY - s.y) / z * 100 : c === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
1134
|
+
const y = o.get(m), {
|
|
1135
|
+
defaultLayoutDeferred: h,
|
|
1136
|
+
derivedPanelConstraints: v,
|
|
1137
|
+
layout: g,
|
|
1138
|
+
separatorToPanels: x
|
|
1139
|
+
} = i.get(m) ?? { defaultLayoutDeferred: !1 };
|
|
1140
|
+
if (v && y && g && x) {
|
|
1141
|
+
const C = Q({
|
|
1122
1142
|
delta: p,
|
|
1123
|
-
initialLayout:
|
|
1124
|
-
panelConstraints:
|
|
1125
|
-
pivotIndices: u.panels.map((
|
|
1126
|
-
prevLayout:
|
|
1143
|
+
initialLayout: y,
|
|
1144
|
+
panelConstraints: v,
|
|
1145
|
+
pivotIndices: u.panels.map((L) => d.indexOf(L)),
|
|
1146
|
+
prevLayout: g,
|
|
1127
1147
|
trigger: "mouse-or-touch"
|
|
1128
1148
|
});
|
|
1129
|
-
if (
|
|
1130
|
-
if (p !== 0 && !
|
|
1131
|
-
switch (
|
|
1149
|
+
if ($(C, g)) {
|
|
1150
|
+
if (p !== 0 && !S)
|
|
1151
|
+
switch (c) {
|
|
1132
1152
|
case "horizontal": {
|
|
1133
|
-
|
|
1153
|
+
r |= p < 0 ? Be : Ke;
|
|
1134
1154
|
break;
|
|
1135
1155
|
}
|
|
1136
1156
|
case "vertical": {
|
|
1137
|
-
|
|
1157
|
+
r |= p < 0 ? Xe : qe;
|
|
1138
1158
|
break;
|
|
1139
1159
|
}
|
|
1140
1160
|
}
|
|
1141
1161
|
} else {
|
|
1142
1162
|
a.set(u.group, {
|
|
1143
|
-
defaultLayoutDeferred:
|
|
1144
|
-
derivedPanelConstraints:
|
|
1163
|
+
defaultLayoutDeferred: h,
|
|
1164
|
+
derivedPanelConstraints: v,
|
|
1145
1165
|
layout: C,
|
|
1146
|
-
separatorToPanels:
|
|
1166
|
+
separatorToPanels: x
|
|
1147
1167
|
});
|
|
1148
|
-
const
|
|
1149
|
-
u.group.inMemoryLayouts[
|
|
1168
|
+
const L = u.group.panels.map(({ id: R }) => R).join(",");
|
|
1169
|
+
u.group.inMemoryLayouts[L] = C;
|
|
1150
1170
|
}
|
|
1151
1171
|
}
|
|
1152
1172
|
});
|
|
1153
|
-
let
|
|
1154
|
-
t.movementX === 0 ?
|
|
1155
|
-
cursorFlags:
|
|
1173
|
+
let f = 0;
|
|
1174
|
+
t.movementX === 0 ? f |= l & Ce : f |= r & Ce, t.movementY === 0 ? f |= l & Pe : f |= r & Pe, E({
|
|
1175
|
+
cursorFlags: f,
|
|
1156
1176
|
mountedGroups: a
|
|
1157
1177
|
}), pe(e);
|
|
1158
1178
|
}
|
|
1159
1179
|
function Ee(e) {
|
|
1160
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } =
|
|
1180
|
+
const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
|
|
1161
1181
|
switch (n.state) {
|
|
1162
1182
|
case "active":
|
|
1163
1183
|
Ye({
|
|
@@ -1173,19 +1193,19 @@ function Ee(e) {
|
|
|
1173
1193
|
function ke(e) {
|
|
1174
1194
|
if (e.defaultPrevented)
|
|
1175
1195
|
return;
|
|
1176
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } =
|
|
1196
|
+
const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
|
|
1177
1197
|
switch (n.state) {
|
|
1178
1198
|
case "active": {
|
|
1179
1199
|
if (
|
|
1180
1200
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
1181
1201
|
e.buttons === 0
|
|
1182
1202
|
) {
|
|
1183
|
-
|
|
1203
|
+
E(
|
|
1184
1204
|
(i) => i.interactionState.state === "inactive" ? i : {
|
|
1185
1205
|
cursorFlags: 0,
|
|
1186
1206
|
interactionState: { state: "inactive" }
|
|
1187
1207
|
}
|
|
1188
|
-
),
|
|
1208
|
+
), E((i) => ({
|
|
1189
1209
|
mountedGroups: new Map(i.mountedGroups)
|
|
1190
1210
|
}));
|
|
1191
1211
|
return;
|
|
@@ -1203,11 +1223,11 @@ function ke(e) {
|
|
|
1203
1223
|
}
|
|
1204
1224
|
default: {
|
|
1205
1225
|
const i = de(e, o);
|
|
1206
|
-
i.length === 0 ? n.state !== "inactive" &&
|
|
1226
|
+
i.length === 0 ? n.state !== "inactive" && E({
|
|
1207
1227
|
interactionState: {
|
|
1208
1228
|
state: "inactive"
|
|
1209
1229
|
}
|
|
1210
|
-
}) :
|
|
1230
|
+
}) : E({
|
|
1211
1231
|
interactionState: {
|
|
1212
1232
|
hitRegions: i,
|
|
1213
1233
|
state: "hover"
|
|
@@ -1219,10 +1239,10 @@ function ke(e) {
|
|
|
1219
1239
|
}
|
|
1220
1240
|
function Ge(e) {
|
|
1221
1241
|
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1222
|
-
const { interactionState: t } =
|
|
1242
|
+
const { interactionState: t } = G();
|
|
1223
1243
|
switch (t.state) {
|
|
1224
1244
|
case "hover":
|
|
1225
|
-
|
|
1245
|
+
E({
|
|
1226
1246
|
interactionState: {
|
|
1227
1247
|
state: "inactive"
|
|
1228
1248
|
}
|
|
@@ -1235,15 +1255,15 @@ function Ie(e) {
|
|
|
1235
1255
|
return;
|
|
1236
1256
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1237
1257
|
return;
|
|
1238
|
-
const { interactionState: t } =
|
|
1258
|
+
const { interactionState: t } = G();
|
|
1239
1259
|
switch (t.state) {
|
|
1240
1260
|
case "active":
|
|
1241
|
-
|
|
1261
|
+
E({
|
|
1242
1262
|
cursorFlags: 0,
|
|
1243
1263
|
interactionState: {
|
|
1244
1264
|
state: "inactive"
|
|
1245
1265
|
}
|
|
1246
|
-
}), t.hitRegions.length > 0 && (pe(e.currentTarget),
|
|
1266
|
+
}), t.hitRegions.length > 0 && (pe(e.currentTarget), E((n) => ({
|
|
1247
1267
|
mountedGroups: new Map(n.mountedGroups)
|
|
1248
1268
|
})), e.preventDefault());
|
|
1249
1269
|
}
|
|
@@ -1251,32 +1271,32 @@ function Ie(e) {
|
|
|
1251
1271
|
function De(e) {
|
|
1252
1272
|
let t = 0, n = 0;
|
|
1253
1273
|
const o = {};
|
|
1254
|
-
for (const
|
|
1255
|
-
if (
|
|
1274
|
+
for (const s of e)
|
|
1275
|
+
if (s.defaultSize !== void 0) {
|
|
1256
1276
|
t++;
|
|
1257
|
-
const l =
|
|
1258
|
-
n += l, o[
|
|
1277
|
+
const l = O(s.defaultSize);
|
|
1278
|
+
n += l, o[s.panelId] = l;
|
|
1259
1279
|
} else
|
|
1260
|
-
o[
|
|
1280
|
+
o[s.panelId] = void 0;
|
|
1261
1281
|
const i = e.length - t;
|
|
1262
1282
|
if (i !== 0) {
|
|
1263
|
-
const
|
|
1283
|
+
const s = O((100 - n) / i);
|
|
1264
1284
|
for (const l of e)
|
|
1265
|
-
l.defaultSize === void 0 && (o[l.panelId] =
|
|
1285
|
+
l.defaultSize === void 0 && (o[l.panelId] = s);
|
|
1266
1286
|
}
|
|
1267
1287
|
return o;
|
|
1268
1288
|
}
|
|
1269
1289
|
function Ct(e, t, n) {
|
|
1270
1290
|
if (!n[0])
|
|
1271
1291
|
return;
|
|
1272
|
-
const i = e.panels.find((
|
|
1292
|
+
const i = e.panels.find((f) => f.element === t);
|
|
1273
1293
|
if (!i || !i.onResize)
|
|
1274
1294
|
return;
|
|
1275
|
-
const
|
|
1276
|
-
asPercentage:
|
|
1295
|
+
const s = B({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
|
|
1296
|
+
asPercentage: O(l / s * 100),
|
|
1277
1297
|
inPixels: l
|
|
1278
1298
|
};
|
|
1279
|
-
i.mutableValues.prevSize = a, i.onResize(a, i.id,
|
|
1299
|
+
i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
|
|
1280
1300
|
}
|
|
1281
1301
|
function Pt(e, t) {
|
|
1282
1302
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -1295,119 +1315,119 @@ function Rt(e, t) {
|
|
|
1295
1315
|
return !1;
|
|
1296
1316
|
return !0;
|
|
1297
1317
|
}
|
|
1298
|
-
const
|
|
1318
|
+
const W = /* @__PURE__ */ new Map();
|
|
1299
1319
|
function Mt(e) {
|
|
1300
1320
|
let t = !0;
|
|
1301
|
-
|
|
1321
|
+
b(
|
|
1302
1322
|
e.element.ownerDocument.defaultView,
|
|
1303
1323
|
"Cannot register an unmounted Group"
|
|
1304
1324
|
);
|
|
1305
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(),
|
|
1306
|
-
for (const d of
|
|
1307
|
-
const { borderBoxSize: p, target:
|
|
1308
|
-
if (
|
|
1325
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((c) => {
|
|
1326
|
+
for (const d of c) {
|
|
1327
|
+
const { borderBoxSize: p, target: y } = d;
|
|
1328
|
+
if (y === e.element) {
|
|
1309
1329
|
if (t) {
|
|
1310
|
-
if (
|
|
1330
|
+
if (B({ group: e }) === 0)
|
|
1311
1331
|
return;
|
|
1312
|
-
|
|
1313
|
-
const
|
|
1314
|
-
if (
|
|
1315
|
-
const
|
|
1332
|
+
E((v) => {
|
|
1333
|
+
const g = v.mountedGroups.get(e);
|
|
1334
|
+
if (g) {
|
|
1335
|
+
const x = Se(e), C = g.defaultLayoutDeferred ? De(x) : g.layout, L = H({
|
|
1316
1336
|
layout: C,
|
|
1317
|
-
panelConstraints:
|
|
1337
|
+
panelConstraints: x
|
|
1318
1338
|
});
|
|
1319
|
-
return !
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
) ?
|
|
1323
|
-
mountedGroups: new Map(
|
|
1339
|
+
return !g.defaultLayoutDeferred && $(C, L) && Pt(
|
|
1340
|
+
g.derivedPanelConstraints,
|
|
1341
|
+
x
|
|
1342
|
+
) ? v : {
|
|
1343
|
+
mountedGroups: new Map(v.mountedGroups).set(e, {
|
|
1324
1344
|
defaultLayoutDeferred: !1,
|
|
1325
|
-
derivedPanelConstraints:
|
|
1326
|
-
layout:
|
|
1327
|
-
separatorToPanels:
|
|
1345
|
+
derivedPanelConstraints: x,
|
|
1346
|
+
layout: L,
|
|
1347
|
+
separatorToPanels: g.separatorToPanels
|
|
1328
1348
|
})
|
|
1329
1349
|
};
|
|
1330
1350
|
}
|
|
1331
|
-
return
|
|
1351
|
+
return v;
|
|
1332
1352
|
});
|
|
1333
1353
|
}
|
|
1334
1354
|
} else
|
|
1335
|
-
Ct(e,
|
|
1355
|
+
Ct(e, y, p);
|
|
1336
1356
|
}
|
|
1337
1357
|
});
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
!o.has(
|
|
1341
|
-
`Panel ids must be unique; id "${
|
|
1342
|
-
), o.add(
|
|
1358
|
+
s.observe(e.element), e.panels.forEach((c) => {
|
|
1359
|
+
b(
|
|
1360
|
+
!o.has(c.id),
|
|
1361
|
+
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1362
|
+
), o.add(c.id), c.onResize && s.observe(c.element);
|
|
1343
1363
|
});
|
|
1344
|
-
const l =
|
|
1345
|
-
let
|
|
1346
|
-
|
|
1347
|
-
const u = e.inMemoryLayouts[a] ??
|
|
1364
|
+
const l = B({ group: e }), r = Se(e), a = e.panels.map(({ id: c }) => c).join(",");
|
|
1365
|
+
let f = e.defaultLayout;
|
|
1366
|
+
f && (Rt(e.panels, f) || (f = void 0));
|
|
1367
|
+
const u = e.inMemoryLayouts[a] ?? f ?? De(r), m = H({
|
|
1348
1368
|
layout: u,
|
|
1349
|
-
panelConstraints:
|
|
1350
|
-
}),
|
|
1351
|
-
return
|
|
1369
|
+
panelConstraints: r
|
|
1370
|
+
}), z = He(e), S = e.element.ownerDocument;
|
|
1371
|
+
return E((c) => {
|
|
1352
1372
|
const d = /* @__PURE__ */ new Map();
|
|
1353
|
-
return
|
|
1354
|
-
|
|
1355
|
-
(
|
|
1356
|
-
),
|
|
1373
|
+
return W.set(
|
|
1374
|
+
S,
|
|
1375
|
+
(W.get(S) ?? 0) + 1
|
|
1376
|
+
), z.forEach((p) => {
|
|
1357
1377
|
p.separator && d.set(p.separator, p.panels);
|
|
1358
1378
|
}), {
|
|
1359
|
-
mountedGroups: new Map(
|
|
1379
|
+
mountedGroups: new Map(c.mountedGroups).set(e, {
|
|
1360
1380
|
defaultLayoutDeferred: l === 0,
|
|
1361
|
-
derivedPanelConstraints:
|
|
1362
|
-
layout:
|
|
1381
|
+
derivedPanelConstraints: r,
|
|
1382
|
+
layout: m,
|
|
1363
1383
|
separatorToPanels: d
|
|
1364
1384
|
})
|
|
1365
1385
|
};
|
|
1366
|
-
}), e.separators.forEach((
|
|
1367
|
-
|
|
1368
|
-
!i.has(
|
|
1369
|
-
`Separator ids must be unique; id "${
|
|
1370
|
-
), i.add(
|
|
1371
|
-
}),
|
|
1372
|
-
t = !1,
|
|
1373
|
-
|
|
1374
|
-
Math.max(0, (
|
|
1375
|
-
),
|
|
1386
|
+
}), e.separators.forEach((c) => {
|
|
1387
|
+
b(
|
|
1388
|
+
!i.has(c.id),
|
|
1389
|
+
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1390
|
+
), i.add(c.id), c.element.addEventListener("keydown", we);
|
|
1391
|
+
}), W.get(S) === 1 && (S.addEventListener("dblclick", be, !0), S.addEventListener("pointerdown", Le, !0), S.addEventListener("pointerleave", Ee), S.addEventListener("pointermove", ke), S.addEventListener("pointerout", Ge), S.addEventListener("pointerup", Ie, !0)), function() {
|
|
1392
|
+
t = !1, W.set(
|
|
1393
|
+
S,
|
|
1394
|
+
Math.max(0, (W.get(S) ?? 0) - 1)
|
|
1395
|
+
), E((d) => {
|
|
1376
1396
|
const p = new Map(d.mountedGroups);
|
|
1377
1397
|
return p.delete(e), { mountedGroups: p };
|
|
1378
1398
|
}), e.separators.forEach((d) => {
|
|
1379
1399
|
d.element.removeEventListener("keydown", we);
|
|
1380
|
-
}),
|
|
1400
|
+
}), W.get(S) || (S.removeEventListener(
|
|
1381
1401
|
"dblclick",
|
|
1382
1402
|
be,
|
|
1383
1403
|
!0
|
|
1384
|
-
),
|
|
1404
|
+
), S.removeEventListener(
|
|
1385
1405
|
"pointerdown",
|
|
1386
1406
|
Le,
|
|
1387
1407
|
!0
|
|
1388
|
-
),
|
|
1408
|
+
), S.removeEventListener("pointerleave", Ee), S.removeEventListener("pointermove", ke), S.removeEventListener("pointerout", Ge), S.removeEventListener("pointerup", Ie, !0)), s.disconnect();
|
|
1389
1409
|
};
|
|
1390
1410
|
}
|
|
1391
1411
|
function Et() {
|
|
1392
|
-
const [e, t] =
|
|
1412
|
+
const [e, t] = Z({}), n = q(() => t({}), []);
|
|
1393
1413
|
return [e, n];
|
|
1394
1414
|
}
|
|
1395
1415
|
function me(e) {
|
|
1396
1416
|
const t = tt();
|
|
1397
1417
|
return `${e ?? t}`;
|
|
1398
1418
|
}
|
|
1399
|
-
const
|
|
1400
|
-
function
|
|
1401
|
-
const t =
|
|
1402
|
-
return
|
|
1419
|
+
const j = typeof window < "u" ? Oe : Te;
|
|
1420
|
+
function Y(e) {
|
|
1421
|
+
const t = I(e);
|
|
1422
|
+
return j(() => {
|
|
1403
1423
|
t.current = e;
|
|
1404
|
-
}, [e]),
|
|
1424
|
+
}, [e]), q(
|
|
1405
1425
|
(...n) => t.current?.(...n),
|
|
1406
1426
|
[t]
|
|
1407
1427
|
);
|
|
1408
1428
|
}
|
|
1409
1429
|
function he(...e) {
|
|
1410
|
-
return
|
|
1430
|
+
return Y((t) => {
|
|
1411
1431
|
e.forEach((n) => {
|
|
1412
1432
|
if (n)
|
|
1413
1433
|
switch (typeof n) {
|
|
@@ -1424,19 +1444,19 @@ function he(...e) {
|
|
|
1424
1444
|
});
|
|
1425
1445
|
}
|
|
1426
1446
|
function kt(e) {
|
|
1427
|
-
const t =
|
|
1428
|
-
return
|
|
1447
|
+
const t = I({ ...e });
|
|
1448
|
+
return j(() => {
|
|
1429
1449
|
for (const n in e)
|
|
1430
1450
|
t.current[n] = e[n];
|
|
1431
1451
|
}, [e]), t.current;
|
|
1432
1452
|
}
|
|
1433
1453
|
const Je = nt(null);
|
|
1434
1454
|
function Gt(e, t) {
|
|
1435
|
-
const n =
|
|
1455
|
+
const n = I({
|
|
1436
1456
|
getLayout: () => ({}),
|
|
1437
1457
|
setLayout: wt
|
|
1438
1458
|
});
|
|
1439
|
-
Ne(t, () => n.current, []),
|
|
1459
|
+
Ne(t, () => n.current, []), j(() => {
|
|
1440
1460
|
Object.assign(
|
|
1441
1461
|
n.current,
|
|
1442
1462
|
We({ groupId: e })
|
|
@@ -1449,41 +1469,41 @@ function It({
|
|
|
1449
1469
|
defaultLayout: n,
|
|
1450
1470
|
disableCursor: o,
|
|
1451
1471
|
disabled: i,
|
|
1452
|
-
elementRef:
|
|
1472
|
+
elementRef: s,
|
|
1453
1473
|
groupRef: l,
|
|
1454
|
-
id:
|
|
1474
|
+
id: r,
|
|
1455
1475
|
onLayoutChange: a,
|
|
1456
|
-
onLayoutChanged:
|
|
1476
|
+
onLayoutChanged: f,
|
|
1457
1477
|
orientation: u = "horizontal",
|
|
1458
|
-
resizeTargetMinimumSize:
|
|
1478
|
+
resizeTargetMinimumSize: m = {
|
|
1459
1479
|
coarse: 20,
|
|
1460
1480
|
fine: 10
|
|
1461
1481
|
},
|
|
1462
|
-
style:
|
|
1463
|
-
...
|
|
1482
|
+
style: z,
|
|
1483
|
+
...S
|
|
1464
1484
|
}) {
|
|
1465
|
-
const
|
|
1485
|
+
const c = I({
|
|
1466
1486
|
onLayoutChange: {},
|
|
1467
1487
|
onLayoutChanged: {}
|
|
1468
|
-
}), d =
|
|
1469
|
-
|
|
1470
|
-
}), p =
|
|
1471
|
-
|
|
1472
|
-
}),
|
|
1488
|
+
}), d = Y((w) => {
|
|
1489
|
+
$(c.current.onLayoutChange, w) || (c.current.onLayoutChange = w, a?.(w));
|
|
1490
|
+
}), p = Y((w) => {
|
|
1491
|
+
$(c.current.onLayoutChanged, w) || (c.current.onLayoutChanged = w, f?.(w));
|
|
1492
|
+
}), y = me(r), h = I(null), [v, g] = Et(), x = I({
|
|
1473
1493
|
lastExpandedPanelSizes: {},
|
|
1474
1494
|
layouts: {},
|
|
1475
1495
|
panels: [],
|
|
1476
|
-
resizeTargetMinimumSize:
|
|
1496
|
+
resizeTargetMinimumSize: m,
|
|
1477
1497
|
separators: []
|
|
1478
|
-
}), C = he(
|
|
1479
|
-
Gt(
|
|
1480
|
-
const
|
|
1481
|
-
(
|
|
1482
|
-
const { interactionState: k, mountedGroups:
|
|
1483
|
-
for (const ee of
|
|
1484
|
-
if (ee.id ===
|
|
1485
|
-
const
|
|
1486
|
-
if (
|
|
1498
|
+
}), C = he(h, s);
|
|
1499
|
+
Gt(y, l);
|
|
1500
|
+
const L = Y(
|
|
1501
|
+
(w, P) => {
|
|
1502
|
+
const { interactionState: k, mountedGroups: V } = G();
|
|
1503
|
+
for (const ee of V.keys())
|
|
1504
|
+
if (ee.id === w) {
|
|
1505
|
+
const K = V.get(ee);
|
|
1506
|
+
if (K) {
|
|
1487
1507
|
let te = !1;
|
|
1488
1508
|
switch (k.state) {
|
|
1489
1509
|
case "active": {
|
|
@@ -1494,7 +1514,7 @@ function It({
|
|
|
1494
1514
|
}
|
|
1495
1515
|
}
|
|
1496
1516
|
return {
|
|
1497
|
-
flexGrow:
|
|
1517
|
+
flexGrow: K.layout[P] ?? 1,
|
|
1498
1518
|
pointerEvents: te ? "none" : void 0
|
|
1499
1519
|
};
|
|
1500
1520
|
}
|
|
@@ -1503,108 +1523,108 @@ function It({
|
|
|
1503
1523
|
flexGrow: n?.[P] ?? 1
|
|
1504
1524
|
};
|
|
1505
1525
|
}
|
|
1506
|
-
),
|
|
1526
|
+
), R = _e(
|
|
1507
1527
|
() => ({
|
|
1508
|
-
getPanelStyles:
|
|
1509
|
-
id:
|
|
1528
|
+
getPanelStyles: L,
|
|
1529
|
+
id: y,
|
|
1510
1530
|
orientation: u,
|
|
1511
|
-
registerPanel: (
|
|
1512
|
-
const P =
|
|
1531
|
+
registerPanel: (w) => {
|
|
1532
|
+
const P = x.current;
|
|
1513
1533
|
return P.panels = fe(u, [
|
|
1514
1534
|
...P.panels,
|
|
1515
|
-
|
|
1516
|
-
]),
|
|
1535
|
+
w
|
|
1536
|
+
]), g(), () => {
|
|
1517
1537
|
P.panels = P.panels.filter(
|
|
1518
|
-
(k) => k !==
|
|
1519
|
-
),
|
|
1538
|
+
(k) => k !== w
|
|
1539
|
+
), g();
|
|
1520
1540
|
};
|
|
1521
1541
|
},
|
|
1522
|
-
registerSeparator: (
|
|
1523
|
-
const P =
|
|
1542
|
+
registerSeparator: (w) => {
|
|
1543
|
+
const P = x.current;
|
|
1524
1544
|
return P.separators = fe(u, [
|
|
1525
1545
|
...P.separators,
|
|
1526
|
-
|
|
1527
|
-
]),
|
|
1546
|
+
w
|
|
1547
|
+
]), g(), () => {
|
|
1528
1548
|
P.separators = P.separators.filter(
|
|
1529
|
-
(k) => k !==
|
|
1530
|
-
),
|
|
1549
|
+
(k) => k !== w
|
|
1550
|
+
), g();
|
|
1531
1551
|
};
|
|
1532
1552
|
}
|
|
1533
1553
|
}),
|
|
1534
|
-
[
|
|
1535
|
-
),
|
|
1554
|
+
[L, y, g, u]
|
|
1555
|
+
), _ = kt({
|
|
1536
1556
|
defaultLayout: n,
|
|
1537
1557
|
disableCursor: o
|
|
1538
|
-
}),
|
|
1539
|
-
return
|
|
1540
|
-
const
|
|
1541
|
-
if (
|
|
1558
|
+
}), A = I(null);
|
|
1559
|
+
return j(() => {
|
|
1560
|
+
const w = h.current;
|
|
1561
|
+
if (w === null)
|
|
1542
1562
|
return;
|
|
1543
|
-
const P =
|
|
1544
|
-
defaultLayout:
|
|
1545
|
-
disableCursor: !!
|
|
1563
|
+
const P = x.current, k = {
|
|
1564
|
+
defaultLayout: _.defaultLayout,
|
|
1565
|
+
disableCursor: !!_.disableCursor,
|
|
1546
1566
|
disabled: !!i,
|
|
1547
|
-
element:
|
|
1548
|
-
id:
|
|
1549
|
-
inMemoryLastExpandedPanelSizes:
|
|
1550
|
-
inMemoryLayouts:
|
|
1567
|
+
element: w,
|
|
1568
|
+
id: y,
|
|
1569
|
+
inMemoryLastExpandedPanelSizes: x.current.lastExpandedPanelSizes,
|
|
1570
|
+
inMemoryLayouts: x.current.layouts,
|
|
1551
1571
|
orientation: u,
|
|
1552
1572
|
panels: P.panels,
|
|
1553
1573
|
resizeTargetMinimumSize: P.resizeTargetMinimumSize,
|
|
1554
1574
|
separators: P.separators
|
|
1555
1575
|
};
|
|
1556
|
-
|
|
1557
|
-
const
|
|
1558
|
-
if (
|
|
1559
|
-
const { defaultLayoutDeferred:
|
|
1560
|
-
!
|
|
1576
|
+
A.current = k;
|
|
1577
|
+
const V = Mt(k), K = G().mountedGroups.get(k);
|
|
1578
|
+
if (K) {
|
|
1579
|
+
const { defaultLayoutDeferred: X, derivedPanelConstraints: ne, layout: oe } = K;
|
|
1580
|
+
!X && ne.length > 0 && (d(oe), p(oe));
|
|
1561
1581
|
}
|
|
1562
|
-
const te =
|
|
1582
|
+
const te = N.addListener(
|
|
1563
1583
|
"interactionStateChange",
|
|
1564
|
-
(
|
|
1565
|
-
|
|
1584
|
+
(X) => {
|
|
1585
|
+
X.state;
|
|
1566
1586
|
}
|
|
1567
|
-
), le =
|
|
1587
|
+
), le = N.addListener(
|
|
1568
1588
|
"mountedGroupsChange",
|
|
1569
|
-
(
|
|
1570
|
-
const ne =
|
|
1589
|
+
(X) => {
|
|
1590
|
+
const ne = X.get(k);
|
|
1571
1591
|
if (ne) {
|
|
1572
1592
|
const { defaultLayoutDeferred: oe, derivedPanelConstraints: Ze, layout: ye } = ne;
|
|
1573
1593
|
if (oe || Ze.length === 0)
|
|
1574
1594
|
return;
|
|
1575
|
-
const { interactionState: Qe } =
|
|
1595
|
+
const { interactionState: Qe } = G(), et = Qe.state !== "active";
|
|
1576
1596
|
d(ye), et && p(ye);
|
|
1577
1597
|
}
|
|
1578
1598
|
}
|
|
1579
1599
|
);
|
|
1580
1600
|
return () => {
|
|
1581
|
-
|
|
1601
|
+
A.current = null, V(), te(), le();
|
|
1582
1602
|
};
|
|
1583
1603
|
}, [
|
|
1584
1604
|
i,
|
|
1585
|
-
|
|
1605
|
+
y,
|
|
1586
1606
|
p,
|
|
1587
1607
|
d,
|
|
1588
1608
|
u,
|
|
1589
|
-
|
|
1590
|
-
|
|
1609
|
+
v,
|
|
1610
|
+
_
|
|
1591
1611
|
]), Te(() => {
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
}), /* @__PURE__ */
|
|
1612
|
+
const w = A.current;
|
|
1613
|
+
w && (w.defaultLayout = n, w.disableCursor = !!o);
|
|
1614
|
+
}), /* @__PURE__ */ J(Je.Provider, { value: R, children: /* @__PURE__ */ J(
|
|
1595
1615
|
"div",
|
|
1596
1616
|
{
|
|
1597
|
-
...
|
|
1617
|
+
...S,
|
|
1598
1618
|
className: t,
|
|
1599
1619
|
"data-group": !0,
|
|
1600
|
-
"data-testid":
|
|
1601
|
-
id:
|
|
1620
|
+
"data-testid": y,
|
|
1621
|
+
id: y,
|
|
1602
1622
|
ref: C,
|
|
1603
1623
|
style: {
|
|
1604
1624
|
height: "100%",
|
|
1605
1625
|
width: "100%",
|
|
1606
1626
|
overflow: "hidden",
|
|
1607
|
-
...
|
|
1627
|
+
...z,
|
|
1608
1628
|
display: "flex",
|
|
1609
1629
|
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1610
1630
|
flexWrap: "nowrap"
|
|
@@ -1623,39 +1643,39 @@ function Ht({
|
|
|
1623
1643
|
storage: n = localStorage,
|
|
1624
1644
|
...o
|
|
1625
1645
|
}) {
|
|
1626
|
-
const i = t !== void 0,
|
|
1646
|
+
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = ce(s, t ?? []), r = Ae(
|
|
1627
1647
|
Dt,
|
|
1628
1648
|
() => n.getItem(l),
|
|
1629
1649
|
() => n.getItem(l)
|
|
1630
1650
|
), a = _e(
|
|
1631
|
-
() =>
|
|
1632
|
-
[
|
|
1633
|
-
),
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1651
|
+
() => r ? JSON.parse(r) : void 0,
|
|
1652
|
+
[r]
|
|
1653
|
+
), f = I(null), u = q(() => {
|
|
1654
|
+
const S = f.current;
|
|
1655
|
+
S && (f.current = null, clearTimeout(S));
|
|
1636
1656
|
}, []);
|
|
1637
1657
|
Oe(() => () => {
|
|
1638
1658
|
u();
|
|
1639
1659
|
}, [u]);
|
|
1640
|
-
const
|
|
1641
|
-
(
|
|
1660
|
+
const m = q(
|
|
1661
|
+
(S) => {
|
|
1642
1662
|
u();
|
|
1643
|
-
let
|
|
1644
|
-
i ?
|
|
1663
|
+
let c;
|
|
1664
|
+
i ? c = ce(s, Object.keys(S)) : c = ce(s, []);
|
|
1645
1665
|
try {
|
|
1646
|
-
n.setItem(
|
|
1666
|
+
n.setItem(c, JSON.stringify(S));
|
|
1647
1667
|
} catch (d) {
|
|
1648
1668
|
console.error(d);
|
|
1649
1669
|
}
|
|
1650
1670
|
},
|
|
1651
|
-
[u, i,
|
|
1652
|
-
),
|
|
1653
|
-
(
|
|
1654
|
-
u(), e === 0 ?
|
|
1655
|
-
|
|
1671
|
+
[u, i, s, n]
|
|
1672
|
+
), z = q(
|
|
1673
|
+
(S) => {
|
|
1674
|
+
u(), e === 0 ? m(S) : f.current = setTimeout(() => {
|
|
1675
|
+
m(S);
|
|
1656
1676
|
}, e);
|
|
1657
1677
|
},
|
|
1658
|
-
[u, e,
|
|
1678
|
+
[u, e, m]
|
|
1659
1679
|
);
|
|
1660
1680
|
return {
|
|
1661
1681
|
/**
|
|
@@ -1667,11 +1687,11 @@ function Ht({
|
|
|
1667
1687
|
*
|
|
1668
1688
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1669
1689
|
*/
|
|
1670
|
-
onLayoutChange:
|
|
1690
|
+
onLayoutChange: z,
|
|
1671
1691
|
/**
|
|
1672
1692
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1673
1693
|
*/
|
|
1674
|
-
onLayoutChanged:
|
|
1694
|
+
onLayoutChanged: m
|
|
1675
1695
|
};
|
|
1676
1696
|
}
|
|
1677
1697
|
function Dt() {
|
|
@@ -1679,20 +1699,20 @@ function Dt() {
|
|
|
1679
1699
|
};
|
|
1680
1700
|
}
|
|
1681
1701
|
function jt() {
|
|
1682
|
-
return
|
|
1702
|
+
return Z(null);
|
|
1683
1703
|
}
|
|
1684
1704
|
function Vt() {
|
|
1685
|
-
return
|
|
1705
|
+
return I(null);
|
|
1686
1706
|
}
|
|
1687
1707
|
function ge() {
|
|
1688
1708
|
const e = ot(Je);
|
|
1689
|
-
return
|
|
1709
|
+
return b(
|
|
1690
1710
|
e,
|
|
1691
1711
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1692
1712
|
), e;
|
|
1693
1713
|
}
|
|
1694
1714
|
function Ot(e, t) {
|
|
1695
|
-
const { id: n } = ge(), o =
|
|
1715
|
+
const { id: n } = ge(), o = I({
|
|
1696
1716
|
collapse: ue,
|
|
1697
1717
|
expand: ue,
|
|
1698
1718
|
getSize: () => ({
|
|
@@ -1702,7 +1722,7 @@ function Ot(e, t) {
|
|
|
1702
1722
|
isCollapsed: () => !1,
|
|
1703
1723
|
resize: ue
|
|
1704
1724
|
});
|
|
1705
|
-
Ne(t, () => o.current, []),
|
|
1725
|
+
Ne(t, () => o.current, []), j(() => {
|
|
1706
1726
|
Object.assign(
|
|
1707
1727
|
o.current,
|
|
1708
1728
|
Ve({ groupId: n, panelId: e })
|
|
@@ -1715,69 +1735,73 @@ function Tt({
|
|
|
1715
1735
|
collapsedSize: n = "0%",
|
|
1716
1736
|
collapsible: o = !1,
|
|
1717
1737
|
defaultSize: i,
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1738
|
+
disabled: s,
|
|
1739
|
+
elementRef: l,
|
|
1740
|
+
id: r,
|
|
1741
|
+
maxSize: a = "100%",
|
|
1742
|
+
minSize: f = "0%",
|
|
1743
|
+
onResize: u,
|
|
1744
|
+
panelRef: m,
|
|
1745
|
+
style: z,
|
|
1725
1746
|
...S
|
|
1726
1747
|
}) {
|
|
1727
|
-
const
|
|
1728
|
-
(
|
|
1729
|
-
|
|
1748
|
+
const c = !!r, d = me(r), p = I(null), y = he(p, l), { getPanelStyles: h, id: v, registerPanel: g } = ge(), x = u !== null, C = Y(
|
|
1749
|
+
(R, _, A) => {
|
|
1750
|
+
u?.(R, r, A);
|
|
1730
1751
|
}
|
|
1731
1752
|
);
|
|
1732
|
-
|
|
1733
|
-
const
|
|
1734
|
-
if (
|
|
1735
|
-
return
|
|
1736
|
-
element:
|
|
1737
|
-
id:
|
|
1738
|
-
idIsStable:
|
|
1753
|
+
j(() => {
|
|
1754
|
+
const R = p.current;
|
|
1755
|
+
if (R !== null)
|
|
1756
|
+
return g({
|
|
1757
|
+
element: R,
|
|
1758
|
+
id: d,
|
|
1759
|
+
idIsStable: c,
|
|
1739
1760
|
mutableValues: {
|
|
1740
1761
|
expandToSize: void 0,
|
|
1741
1762
|
prevSize: void 0
|
|
1742
1763
|
},
|
|
1743
|
-
onResize:
|
|
1764
|
+
onResize: x ? C : void 0,
|
|
1744
1765
|
panelConstraints: {
|
|
1745
1766
|
collapsedSize: n,
|
|
1746
1767
|
collapsible: o,
|
|
1747
1768
|
defaultSize: i,
|
|
1748
|
-
|
|
1749
|
-
|
|
1769
|
+
disabled: s,
|
|
1770
|
+
maxSize: a,
|
|
1771
|
+
minSize: f
|
|
1750
1772
|
}
|
|
1751
1773
|
});
|
|
1752
1774
|
}, [
|
|
1753
1775
|
n,
|
|
1754
1776
|
o,
|
|
1755
1777
|
i,
|
|
1756
|
-
y,
|
|
1757
|
-
f,
|
|
1758
|
-
m,
|
|
1759
1778
|
s,
|
|
1779
|
+
x,
|
|
1780
|
+
d,
|
|
1781
|
+
c,
|
|
1760
1782
|
a,
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1783
|
+
f,
|
|
1784
|
+
C,
|
|
1785
|
+
g
|
|
1786
|
+
]), Ot(d, m);
|
|
1787
|
+
const L = Ae(
|
|
1788
|
+
(R) => (N.addListener("mountedGroupsChange", R), () => {
|
|
1789
|
+
N.removeListener("mountedGroupsChange", R);
|
|
1767
1790
|
}),
|
|
1768
1791
|
// useSyncExternalStore does not support a custom equality check
|
|
1769
1792
|
// stringify avoids re-rendering when the style value hasn't changed
|
|
1770
|
-
() => JSON.stringify(
|
|
1771
|
-
() => JSON.stringify(
|
|
1793
|
+
() => JSON.stringify(h(v, d)),
|
|
1794
|
+
() => JSON.stringify(h(v, d))
|
|
1772
1795
|
);
|
|
1773
|
-
return /* @__PURE__ */
|
|
1796
|
+
return /* @__PURE__ */ J(
|
|
1774
1797
|
"div",
|
|
1775
1798
|
{
|
|
1776
1799
|
...S,
|
|
1800
|
+
"aria-disabled": s,
|
|
1777
1801
|
"data-panel": !0,
|
|
1778
|
-
"data-testid":
|
|
1779
|
-
id:
|
|
1780
|
-
ref:
|
|
1802
|
+
"data-testid": d,
|
|
1803
|
+
id: d,
|
|
1804
|
+
ref: y,
|
|
1781
1805
|
style: {
|
|
1782
1806
|
...Nt,
|
|
1783
1807
|
display: "flex",
|
|
@@ -1785,9 +1809,9 @@ function Tt({
|
|
|
1785
1809
|
flexShrink: 1,
|
|
1786
1810
|
// Prevent Panel content from interfering with panel size
|
|
1787
1811
|
overflow: "hidden",
|
|
1788
|
-
...JSON.parse(
|
|
1812
|
+
...JSON.parse(L)
|
|
1789
1813
|
},
|
|
1790
|
-
children: /* @__PURE__ */
|
|
1814
|
+
children: /* @__PURE__ */ J(
|
|
1791
1815
|
"div",
|
|
1792
1816
|
{
|
|
1793
1817
|
className: t,
|
|
@@ -1795,7 +1819,7 @@ function Tt({
|
|
|
1795
1819
|
maxHeight: "100%",
|
|
1796
1820
|
maxWidth: "100%",
|
|
1797
1821
|
flexGrow: 1,
|
|
1798
|
-
...
|
|
1822
|
+
...z
|
|
1799
1823
|
},
|
|
1800
1824
|
children: e
|
|
1801
1825
|
}
|
|
@@ -1817,10 +1841,10 @@ const Nt = {
|
|
|
1817
1841
|
margin: 0
|
|
1818
1842
|
};
|
|
1819
1843
|
function Wt() {
|
|
1820
|
-
return
|
|
1844
|
+
return Z(null);
|
|
1821
1845
|
}
|
|
1822
1846
|
function Ut() {
|
|
1823
|
-
return
|
|
1847
|
+
return I(null);
|
|
1824
1848
|
}
|
|
1825
1849
|
function _t({
|
|
1826
1850
|
layout: e,
|
|
@@ -1828,23 +1852,23 @@ function _t({
|
|
|
1828
1852
|
panelId: n,
|
|
1829
1853
|
panelIndex: o
|
|
1830
1854
|
}) {
|
|
1831
|
-
let i,
|
|
1832
|
-
const l = e[n],
|
|
1855
|
+
let i, s;
|
|
1856
|
+
const l = e[n], r = t.find(
|
|
1833
1857
|
(a) => a.panelId === n
|
|
1834
1858
|
);
|
|
1835
|
-
if (
|
|
1836
|
-
const a =
|
|
1837
|
-
|
|
1838
|
-
layout:
|
|
1839
|
-
delta:
|
|
1859
|
+
if (r) {
|
|
1860
|
+
const a = r.maxSize, f = r.collapsible ? r.collapsedSize : r.minSize, u = [o, o + 1];
|
|
1861
|
+
s = H({
|
|
1862
|
+
layout: Q({
|
|
1863
|
+
delta: f - l,
|
|
1840
1864
|
initialLayout: e,
|
|
1841
1865
|
panelConstraints: t,
|
|
1842
1866
|
pivotIndices: u,
|
|
1843
1867
|
prevLayout: e
|
|
1844
1868
|
}),
|
|
1845
1869
|
panelConstraints: t
|
|
1846
|
-
})[n], i =
|
|
1847
|
-
layout:
|
|
1870
|
+
})[n], i = H({
|
|
1871
|
+
layout: Q({
|
|
1848
1872
|
delta: a - l,
|
|
1849
1873
|
initialLayout: e,
|
|
1850
1874
|
panelConstraints: t,
|
|
@@ -1857,53 +1881,55 @@ function _t({
|
|
|
1857
1881
|
return {
|
|
1858
1882
|
valueControls: n,
|
|
1859
1883
|
valueMax: i,
|
|
1860
|
-
valueMin:
|
|
1884
|
+
valueMin: s,
|
|
1861
1885
|
valueNow: l
|
|
1862
1886
|
};
|
|
1863
1887
|
}
|
|
1864
1888
|
function At({
|
|
1865
1889
|
children: e,
|
|
1866
1890
|
className: t,
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1891
|
+
disabled: n,
|
|
1892
|
+
elementRef: o,
|
|
1893
|
+
id: i,
|
|
1894
|
+
style: s,
|
|
1895
|
+
...l
|
|
1871
1896
|
}) {
|
|
1872
|
-
const
|
|
1873
|
-
id:
|
|
1874
|
-
orientation:
|
|
1875
|
-
registerSeparator:
|
|
1876
|
-
} = ge(),
|
|
1877
|
-
return
|
|
1878
|
-
const
|
|
1879
|
-
if (
|
|
1897
|
+
const r = me(i), [a, f] = Z({}), [u, m] = Z("inactive"), z = I(null), S = he(z, o), {
|
|
1898
|
+
id: c,
|
|
1899
|
+
orientation: d,
|
|
1900
|
+
registerSeparator: p
|
|
1901
|
+
} = ge(), y = d === "horizontal" ? "vertical" : "horizontal";
|
|
1902
|
+
return j(() => {
|
|
1903
|
+
const h = z.current;
|
|
1904
|
+
if (h !== null) {
|
|
1880
1905
|
const v = {
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1906
|
+
disabled: n,
|
|
1907
|
+
element: h,
|
|
1908
|
+
id: r
|
|
1909
|
+
}, g = p(v), x = N.addListener(
|
|
1884
1910
|
"interactionStateChange",
|
|
1885
|
-
(
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
(
|
|
1889
|
-
) ?
|
|
1911
|
+
(L) => {
|
|
1912
|
+
m(
|
|
1913
|
+
L.state !== "inactive" && L.hitRegions.some(
|
|
1914
|
+
(R) => R.separator === v
|
|
1915
|
+
) ? L.state : "inactive"
|
|
1890
1916
|
);
|
|
1891
1917
|
}
|
|
1892
|
-
),
|
|
1918
|
+
), C = N.addListener(
|
|
1893
1919
|
"mountedGroupsChange",
|
|
1894
|
-
(
|
|
1895
|
-
|
|
1896
|
-
({ derivedPanelConstraints:
|
|
1897
|
-
if (
|
|
1898
|
-
const
|
|
1899
|
-
if (
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1920
|
+
(L) => {
|
|
1921
|
+
L.forEach(
|
|
1922
|
+
({ derivedPanelConstraints: R, layout: _, separatorToPanels: A }, w) => {
|
|
1923
|
+
if (w.id === c) {
|
|
1924
|
+
const P = A.get(v);
|
|
1925
|
+
if (P) {
|
|
1926
|
+
const k = P[0], V = w.panels.indexOf(k);
|
|
1927
|
+
f(
|
|
1902
1928
|
_t({
|
|
1903
|
-
layout:
|
|
1904
|
-
panelConstraints:
|
|
1905
|
-
panelId:
|
|
1906
|
-
panelIndex:
|
|
1929
|
+
layout: _,
|
|
1930
|
+
panelConstraints: R,
|
|
1931
|
+
panelId: k.id,
|
|
1932
|
+
panelIndex: V
|
|
1907
1933
|
})
|
|
1908
1934
|
);
|
|
1909
1935
|
}
|
|
@@ -1913,32 +1939,34 @@ function At({
|
|
|
1913
1939
|
}
|
|
1914
1940
|
);
|
|
1915
1941
|
return () => {
|
|
1916
|
-
|
|
1942
|
+
x(), C(), g();
|
|
1917
1943
|
};
|
|
1918
1944
|
}
|
|
1919
|
-
}, [
|
|
1945
|
+
}, [n, c, r, p]), /* @__PURE__ */ J(
|
|
1920
1946
|
"div",
|
|
1921
1947
|
{
|
|
1922
|
-
...
|
|
1923
|
-
"aria-controls":
|
|
1924
|
-
"aria-
|
|
1925
|
-
"aria-
|
|
1926
|
-
"aria-
|
|
1927
|
-
"aria-
|
|
1948
|
+
...l,
|
|
1949
|
+
"aria-controls": a.valueControls,
|
|
1950
|
+
"aria-disabled": n,
|
|
1951
|
+
"aria-orientation": y,
|
|
1952
|
+
"aria-valuemax": a.valueMax,
|
|
1953
|
+
"aria-valuemin": a.valueMin,
|
|
1954
|
+
"aria-valuenow": a.valueNow,
|
|
1928
1955
|
children: e,
|
|
1929
1956
|
className: t,
|
|
1930
|
-
"data-separator":
|
|
1931
|
-
"data-testid":
|
|
1932
|
-
id:
|
|
1957
|
+
"data-separator": n ? "disabled" : u,
|
|
1958
|
+
"data-testid": r,
|
|
1959
|
+
id: r,
|
|
1933
1960
|
ref: S,
|
|
1934
1961
|
role: "separator",
|
|
1935
1962
|
style: {
|
|
1936
1963
|
flexBasis: "auto",
|
|
1937
|
-
|
|
1964
|
+
cursor: n ? "not-allowed" : void 0,
|
|
1965
|
+
...s,
|
|
1938
1966
|
flexGrow: 0,
|
|
1939
1967
|
flexShrink: 0
|
|
1940
1968
|
},
|
|
1941
|
-
tabIndex: 0
|
|
1969
|
+
tabIndex: n ? void 0 : 0
|
|
1942
1970
|
}
|
|
1943
1971
|
);
|
|
1944
1972
|
}
|