react-resizable-panels 4.5.9-alpha.0 → 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 (
|
|
239
|
-
const
|
|
243
|
+
if (s.collapsedSize !== void 0) {
|
|
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 (
|
|
248
|
-
const
|
|
251
|
+
let r;
|
|
252
|
+
if (s.defaultSize !== void 0) {
|
|
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 (
|
|
257
|
-
const
|
|
261
|
+
if (s.minSize !== void 0) {
|
|
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 (
|
|
266
|
-
const
|
|
269
|
+
let f = 100;
|
|
270
|
+
if (s.maxSize !== void 0) {
|
|
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
|
}
|
|
@@ -388,28 +396,28 @@ function ht(e) {
|
|
|
388
396
|
function gt(e, t) {
|
|
389
397
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
390
398
|
const n = {
|
|
391
|
-
a:
|
|
392
|
-
b:
|
|
399
|
+
a: xe(e),
|
|
400
|
+
b: xe(t)
|
|
393
401
|
};
|
|
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
|
);
|
|
401
409
|
const i = {
|
|
402
|
-
a:
|
|
403
|
-
b:
|
|
410
|
+
a: ze(ve(n.a)),
|
|
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,14 +437,14 @@ 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
|
}
|
|
436
|
-
function
|
|
444
|
+
function ze(e) {
|
|
437
445
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
438
446
|
}
|
|
439
|
-
function
|
|
447
|
+
function xe(e) {
|
|
440
448
|
const t = [];
|
|
441
449
|
for (; e; )
|
|
442
450
|
t.push(e), e = je(e);
|
|
@@ -446,10 +454,10 @@ function je(e) {
|
|
|
446
454
|
const { parentNode: t } = e;
|
|
447
455
|
return ht(t) ? t.host : t;
|
|
448
456
|
}
|
|
449
|
-
function
|
|
457
|
+
function zt(e, t) {
|
|
450
458
|
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
451
459
|
}
|
|
452
|
-
function
|
|
460
|
+
function xt({
|
|
453
461
|
groupElement: e,
|
|
454
462
|
hitRegion: t,
|
|
455
463
|
pointerEventTarget: n
|
|
@@ -461,7 +469,7 @@ function zt({
|
|
|
461
469
|
for (; o; ) {
|
|
462
470
|
if (o.contains(e))
|
|
463
471
|
return !0;
|
|
464
|
-
if (
|
|
472
|
+
if (zt(o.getBoundingClientRect(), t))
|
|
465
473
|
return !1;
|
|
466
474
|
o = o.parentElement;
|
|
467
475
|
}
|
|
@@ -473,11 +481,11 @@ 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
|
});
|
|
480
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 &&
|
|
488
|
+
l && l.distance.x <= 0 && l.distance.y <= 0 && xt({
|
|
481
489
|
groupElement: i.element,
|
|
482
490
|
hitRegion: l.hitRegion.rect,
|
|
483
491
|
pointerEventTarget: e.target
|
|
@@ -492,326 +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
|
}
|
|
589
|
+
default: {
|
|
590
|
+
const c = e < 0 ? u : f, d = n[c];
|
|
591
|
+
b(
|
|
592
|
+
d,
|
|
593
|
+
`Panel constraints not found for index ${c}`
|
|
594
|
+
);
|
|
595
|
+
const p = l[c], { collapsible: y, collapsedSize: h, minSize: v } = d;
|
|
596
|
+
if (y && T(p, v) < 0)
|
|
597
|
+
if (e > 0) {
|
|
598
|
+
const g = v - h, x = g / 2, C = p + e;
|
|
599
|
+
T(C, v) < 0 && (e = T(e, x) <= 0 ? 0 : g);
|
|
600
|
+
} else {
|
|
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);
|
|
603
|
+
}
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
577
606
|
}
|
|
578
607
|
{
|
|
579
|
-
const
|
|
580
|
-
let d = e < 0 ?
|
|
608
|
+
const c = e < 0 ? 1 : -1;
|
|
609
|
+
let d = e < 0 ? u : f, p = 0;
|
|
581
610
|
for (; ; ) {
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
611
|
+
const h = l[d];
|
|
612
|
+
b(
|
|
613
|
+
h != null,
|
|
585
614
|
`Previous layout not found for panel index ${d}`
|
|
586
615
|
);
|
|
587
|
-
const
|
|
616
|
+
const g = U({
|
|
588
617
|
panelConstraints: n[d],
|
|
618
|
+
prevSize: h,
|
|
589
619
|
size: 100
|
|
590
|
-
}) -
|
|
591
|
-
if (p +=
|
|
620
|
+
}) - h;
|
|
621
|
+
if (p += g, d += c, d < 0 || d >= n.length)
|
|
592
622
|
break;
|
|
593
623
|
}
|
|
594
|
-
const
|
|
595
|
-
e = e < 0 ? 0 -
|
|
624
|
+
const y = Math.min(Math.abs(e), Math.abs(p));
|
|
625
|
+
e = e < 0 ? 0 - y : y;
|
|
596
626
|
}
|
|
597
627
|
{
|
|
598
|
-
let d = e < 0 ?
|
|
628
|
+
let d = e < 0 ? f : u;
|
|
599
629
|
for (; d >= 0 && d < n.length; ) {
|
|
600
|
-
const p = Math.abs(e) - Math.abs(
|
|
601
|
-
|
|
602
|
-
|
|
630
|
+
const p = Math.abs(e) - Math.abs(m), y = l[d];
|
|
631
|
+
b(
|
|
632
|
+
y != null,
|
|
603
633
|
`Previous layout not found for panel index ${d}`
|
|
604
634
|
);
|
|
605
|
-
const
|
|
635
|
+
const h = y - p, v = U({
|
|
606
636
|
panelConstraints: n[d],
|
|
607
|
-
|
|
637
|
+
prevSize: y,
|
|
638
|
+
size: h
|
|
608
639
|
});
|
|
609
|
-
if (!
|
|
640
|
+
if (!M(y, v) && (m += y - v, a[d] = v, m.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
610
641
|
numeric: !0
|
|
611
642
|
}) >= 0))
|
|
612
643
|
break;
|
|
613
644
|
e < 0 ? d-- : d++;
|
|
614
645
|
}
|
|
615
646
|
}
|
|
616
|
-
if (bt(
|
|
647
|
+
if (bt(r, a))
|
|
617
648
|
return i;
|
|
618
649
|
{
|
|
619
|
-
const
|
|
620
|
-
|
|
650
|
+
const c = e < 0 ? u : f, d = l[c];
|
|
651
|
+
b(
|
|
621
652
|
d != null,
|
|
622
|
-
`Previous layout not found for panel index ${
|
|
653
|
+
`Previous layout not found for panel index ${c}`
|
|
623
654
|
);
|
|
624
|
-
const p = d +
|
|
625
|
-
panelConstraints: n[
|
|
655
|
+
const p = d + m, y = U({
|
|
656
|
+
panelConstraints: n[c],
|
|
657
|
+
prevSize: d,
|
|
626
658
|
size: p
|
|
627
659
|
});
|
|
628
|
-
if (a[
|
|
629
|
-
let
|
|
630
|
-
for (;
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
`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}`
|
|
635
667
|
);
|
|
636
|
-
const
|
|
637
|
-
panelConstraints: n[
|
|
638
|
-
|
|
668
|
+
const C = x + h, L = U({
|
|
669
|
+
panelConstraints: n[g],
|
|
670
|
+
prevSize: x,
|
|
671
|
+
size: C
|
|
639
672
|
});
|
|
640
|
-
if (
|
|
673
|
+
if (M(x, L) || (h -= L - x, a[g] = L), M(h, 0))
|
|
641
674
|
break;
|
|
642
|
-
e > 0 ?
|
|
675
|
+
e > 0 ? g-- : g++;
|
|
643
676
|
}
|
|
644
677
|
}
|
|
645
678
|
}
|
|
646
|
-
const
|
|
647
|
-
(
|
|
679
|
+
const z = Object.values(a).reduce(
|
|
680
|
+
(c, d) => d + c,
|
|
648
681
|
0
|
|
649
682
|
);
|
|
650
|
-
if (!
|
|
683
|
+
if (!M(z, 100, 0.1))
|
|
651
684
|
return i;
|
|
652
|
-
const
|
|
653
|
-
return a.reduce((
|
|
685
|
+
const S = Object.keys(i);
|
|
686
|
+
return a.reduce((c, d, p) => (c[S[p]] = d, c), {});
|
|
654
687
|
}
|
|
655
|
-
function
|
|
688
|
+
function $(e, t) {
|
|
656
689
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
657
690
|
return !1;
|
|
658
691
|
for (const n in e)
|
|
659
|
-
if (t[n] === void 0 ||
|
|
692
|
+
if (t[n] === void 0 || T(e[n], t[n]) !== 0)
|
|
660
693
|
return !1;
|
|
661
694
|
return !0;
|
|
662
695
|
}
|
|
663
|
-
function
|
|
696
|
+
function H({
|
|
664
697
|
layout: e,
|
|
665
698
|
panelConstraints: t
|
|
666
699
|
}) {
|
|
667
|
-
const
|
|
668
|
-
(
|
|
700
|
+
const n = Object.values(e), o = [...n], i = o.reduce(
|
|
701
|
+
(r, a) => r + a,
|
|
669
702
|
0
|
|
670
703
|
);
|
|
671
704
|
if (o.length !== t.length)
|
|
672
705
|
throw Error(
|
|
673
|
-
`Invalid ${t.length} panel layout: ${o.map((
|
|
706
|
+
`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
|
|
674
707
|
);
|
|
675
|
-
if (!
|
|
676
|
-
for (let
|
|
677
|
-
const a = o[
|
|
678
|
-
|
|
679
|
-
const
|
|
680
|
-
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;
|
|
681
714
|
}
|
|
682
|
-
let
|
|
683
|
-
for (let
|
|
684
|
-
const a =
|
|
685
|
-
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
|
|
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
|
|
689
725
|
});
|
|
690
|
-
|
|
726
|
+
f != u && (s += f - u, o[r] = u);
|
|
691
727
|
}
|
|
692
|
-
if (!
|
|
693
|
-
for (let
|
|
694
|
-
const a = o[
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
panelConstraints: t[
|
|
698
|
-
|
|
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
|
|
699
736
|
});
|
|
700
|
-
if (a !==
|
|
737
|
+
if (a !== u && (s -= u - a, o[r] = u, M(s, 0)))
|
|
701
738
|
break;
|
|
702
739
|
}
|
|
703
740
|
const l = Object.keys(e);
|
|
704
|
-
return o.reduce((
|
|
741
|
+
return o.reduce((r, a, f) => (r[l[f]] = a, r), {});
|
|
705
742
|
}
|
|
706
743
|
function Ve({
|
|
707
744
|
groupId: e,
|
|
708
745
|
panelId: t
|
|
709
746
|
}) {
|
|
710
747
|
const n = () => {
|
|
711
|
-
const { mountedGroups:
|
|
748
|
+
const { mountedGroups: r } = G();
|
|
712
749
|
for (const [
|
|
713
750
|
a,
|
|
714
751
|
{
|
|
715
|
-
defaultLayoutDeferred:
|
|
716
|
-
derivedPanelConstraints:
|
|
717
|
-
layout:
|
|
718
|
-
separatorToPanels:
|
|
752
|
+
defaultLayoutDeferred: f,
|
|
753
|
+
derivedPanelConstraints: u,
|
|
754
|
+
layout: m,
|
|
755
|
+
separatorToPanels: z
|
|
719
756
|
}
|
|
720
|
-
] of
|
|
757
|
+
] of r)
|
|
721
758
|
if (a.id === e)
|
|
722
759
|
return {
|
|
723
|
-
defaultLayoutDeferred:
|
|
724
|
-
derivedPanelConstraints:
|
|
760
|
+
defaultLayoutDeferred: f,
|
|
761
|
+
derivedPanelConstraints: u,
|
|
725
762
|
group: a,
|
|
726
|
-
layout:
|
|
727
|
-
separatorToPanels:
|
|
763
|
+
layout: m,
|
|
764
|
+
separatorToPanels: z
|
|
728
765
|
};
|
|
729
766
|
throw Error(`Group ${e} not found`);
|
|
730
767
|
}, o = () => {
|
|
731
|
-
const
|
|
768
|
+
const r = n().derivedPanelConstraints.find(
|
|
732
769
|
(a) => a.panelId === t
|
|
733
770
|
);
|
|
734
|
-
if (
|
|
735
|
-
return
|
|
771
|
+
if (r !== void 0)
|
|
772
|
+
return r;
|
|
736
773
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
737
774
|
}, i = () => {
|
|
738
|
-
const
|
|
739
|
-
if (
|
|
740
|
-
return
|
|
775
|
+
const r = n().group.panels.find((a) => a.id === t);
|
|
776
|
+
if (r !== void 0)
|
|
777
|
+
return r;
|
|
741
778
|
throw Error(`Layout not found for Panel ${t}`);
|
|
742
|
-
},
|
|
743
|
-
const
|
|
744
|
-
if (
|
|
745
|
-
return
|
|
779
|
+
}, s = () => {
|
|
780
|
+
const r = n().layout[t];
|
|
781
|
+
if (r !== void 0)
|
|
782
|
+
return r;
|
|
746
783
|
throw Error(`Layout not found for Panel ${t}`);
|
|
747
|
-
}, l = (
|
|
748
|
-
const a =
|
|
749
|
-
if (
|
|
784
|
+
}, l = (r) => {
|
|
785
|
+
const a = s();
|
|
786
|
+
if (r === a)
|
|
750
787
|
return;
|
|
751
788
|
const {
|
|
752
|
-
defaultLayoutDeferred:
|
|
753
|
-
derivedPanelConstraints:
|
|
754
|
-
group:
|
|
755
|
-
layout:
|
|
756
|
-
separatorToPanels:
|
|
757
|
-
} = n(),
|
|
758
|
-
delta: d ? a -
|
|
759
|
-
initialLayout:
|
|
760
|
-
panelConstraints:
|
|
761
|
-
pivotIndices: d ? [
|
|
762
|
-
prevLayout:
|
|
789
|
+
defaultLayoutDeferred: f,
|
|
790
|
+
derivedPanelConstraints: u,
|
|
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,
|
|
797
|
+
panelConstraints: u,
|
|
798
|
+
pivotIndices: d ? [c - 1, c] : [c, c + 1],
|
|
799
|
+
prevLayout: z,
|
|
763
800
|
trigger: "imperative-api"
|
|
764
|
-
}),
|
|
801
|
+
}), y = H({
|
|
765
802
|
layout: p,
|
|
766
|
-
panelConstraints:
|
|
803
|
+
panelConstraints: u
|
|
767
804
|
});
|
|
768
|
-
|
|
769
|
-
mountedGroups: new Map(
|
|
770
|
-
defaultLayoutDeferred:
|
|
771
|
-
derivedPanelConstraints:
|
|
772
|
-
layout:
|
|
773
|
-
separatorToPanels:
|
|
805
|
+
$(z, y) || E((h) => ({
|
|
806
|
+
mountedGroups: new Map(h.mountedGroups).set(m, {
|
|
807
|
+
defaultLayoutDeferred: f,
|
|
808
|
+
derivedPanelConstraints: u,
|
|
809
|
+
layout: y,
|
|
810
|
+
separatorToPanels: S
|
|
774
811
|
})
|
|
775
812
|
}));
|
|
776
813
|
};
|
|
777
814
|
return {
|
|
778
815
|
collapse: () => {
|
|
779
|
-
const { collapsible:
|
|
780
|
-
|
|
816
|
+
const { collapsible: r, collapsedSize: a } = o(), { mutableValues: f } = i(), u = s();
|
|
817
|
+
r && u !== a && (f.expandToSize = u, l(a));
|
|
781
818
|
},
|
|
782
819
|
expand: () => {
|
|
783
|
-
const { collapsible:
|
|
784
|
-
if (
|
|
785
|
-
let
|
|
786
|
-
|
|
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);
|
|
787
824
|
}
|
|
788
825
|
},
|
|
789
826
|
getSize: () => {
|
|
790
|
-
const { group:
|
|
827
|
+
const { group: r } = n(), a = s(), { element: f } = i(), u = r.orientation === "horizontal" ? f.offsetWidth : f.offsetHeight;
|
|
791
828
|
return {
|
|
792
829
|
asPercentage: a,
|
|
793
|
-
inPixels:
|
|
830
|
+
inPixels: u
|
|
794
831
|
};
|
|
795
832
|
},
|
|
796
833
|
isCollapsed: () => {
|
|
797
|
-
const { collapsible:
|
|
798
|
-
return
|
|
834
|
+
const { collapsible: r, collapsedSize: a } = o(), f = s();
|
|
835
|
+
return r && M(a, f);
|
|
799
836
|
},
|
|
800
|
-
resize: (
|
|
801
|
-
if (
|
|
802
|
-
let
|
|
803
|
-
switch (typeof
|
|
837
|
+
resize: (r) => {
|
|
838
|
+
if (s() !== r) {
|
|
839
|
+
let f;
|
|
840
|
+
switch (typeof r) {
|
|
804
841
|
case "number": {
|
|
805
|
-
const { group:
|
|
806
|
-
|
|
842
|
+
const { group: u } = n(), m = B({ group: u });
|
|
843
|
+
f = O(r / m * 100);
|
|
807
844
|
break;
|
|
808
845
|
}
|
|
809
846
|
case "string": {
|
|
810
|
-
|
|
847
|
+
f = parseFloat(r);
|
|
811
848
|
break;
|
|
812
849
|
}
|
|
813
850
|
}
|
|
814
|
-
l(
|
|
851
|
+
l(f);
|
|
815
852
|
}
|
|
816
853
|
}
|
|
817
854
|
};
|
|
@@ -819,24 +856,24 @@ function Ve({
|
|
|
819
856
|
function be(e) {
|
|
820
857
|
if (e.defaultPrevented)
|
|
821
858
|
return;
|
|
822
|
-
const { mountedGroups: t } =
|
|
859
|
+
const { mountedGroups: t } = G();
|
|
823
860
|
de(e, t).forEach((o) => {
|
|
824
861
|
if (o.separator) {
|
|
825
862
|
const i = o.panels.find(
|
|
826
|
-
(
|
|
863
|
+
(s) => s.panelConstraints.defaultSize !== void 0
|
|
827
864
|
);
|
|
828
865
|
if (i) {
|
|
829
|
-
const
|
|
866
|
+
const s = i.panelConstraints.defaultSize, l = Ve({
|
|
830
867
|
groupId: o.group.id,
|
|
831
868
|
panelId: i.id
|
|
832
869
|
});
|
|
833
|
-
l &&
|
|
870
|
+
l && s !== void 0 && (l.resize(s), e.preventDefault());
|
|
834
871
|
}
|
|
835
872
|
}
|
|
836
873
|
});
|
|
837
874
|
}
|
|
838
875
|
function ae(e) {
|
|
839
|
-
const { mountedGroups: t } =
|
|
876
|
+
const { mountedGroups: t } = G();
|
|
840
877
|
for (const [n] of t)
|
|
841
878
|
if (n.separators.some(
|
|
842
879
|
(o) => o.element === e
|
|
@@ -848,7 +885,7 @@ function We({
|
|
|
848
885
|
groupId: e
|
|
849
886
|
}) {
|
|
850
887
|
const t = () => {
|
|
851
|
-
const { mountedGroups: n } =
|
|
888
|
+
const { mountedGroups: n } = G();
|
|
852
889
|
for (const [o, i] of n)
|
|
853
890
|
if (o.id === e)
|
|
854
891
|
return { group: o, ...i };
|
|
@@ -863,51 +900,58 @@ function We({
|
|
|
863
900
|
const {
|
|
864
901
|
defaultLayoutDeferred: o,
|
|
865
902
|
derivedPanelConstraints: i,
|
|
866
|
-
group:
|
|
903
|
+
group: s,
|
|
867
904
|
layout: l,
|
|
868
|
-
separatorToPanels:
|
|
869
|
-
} = t(), a =
|
|
905
|
+
separatorToPanels: r
|
|
906
|
+
} = t(), a = H({
|
|
870
907
|
layout: n,
|
|
871
908
|
panelConstraints: i
|
|
872
909
|
});
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
910
|
+
if (o)
|
|
911
|
+
return l;
|
|
912
|
+
if (!$(l, a)) {
|
|
913
|
+
E((u) => ({
|
|
914
|
+
mountedGroups: new Map(u.mountedGroups).set(s, {
|
|
915
|
+
defaultLayoutDeferred: o,
|
|
916
|
+
derivedPanelConstraints: i,
|
|
917
|
+
layout: a,
|
|
918
|
+
separatorToPanels: r
|
|
919
|
+
})
|
|
920
|
+
}));
|
|
921
|
+
const f = s.panels.map(({ id: u }) => u).join(",");
|
|
922
|
+
s.inMemoryLayouts[f] = a;
|
|
923
|
+
}
|
|
924
|
+
return a;
|
|
881
925
|
}
|
|
882
926
|
};
|
|
883
927
|
}
|
|
884
928
|
function Ue(e) {
|
|
885
|
-
const { mountedGroups: t } =
|
|
886
|
-
return
|
|
929
|
+
const { mountedGroups: t } = G(), n = t.get(e);
|
|
930
|
+
return b(n, `Mounted Group ${e.id} not found`), n;
|
|
887
931
|
}
|
|
888
|
-
function
|
|
932
|
+
function F(e, t) {
|
|
889
933
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
890
|
-
(
|
|
934
|
+
(m) => m.element === e
|
|
891
935
|
);
|
|
892
|
-
|
|
893
|
-
const
|
|
894
|
-
|
|
895
|
-
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({
|
|
896
940
|
delta: t,
|
|
897
941
|
initialLayout: a,
|
|
898
942
|
panelConstraints: o.derivedPanelConstraints,
|
|
899
943
|
pivotIndices: l,
|
|
900
944
|
prevLayout: a,
|
|
901
945
|
trigger: "keyboard"
|
|
902
|
-
}),
|
|
903
|
-
layout:
|
|
946
|
+
}), u = H({
|
|
947
|
+
layout: f,
|
|
904
948
|
panelConstraints: o.derivedPanelConstraints
|
|
905
949
|
});
|
|
906
|
-
|
|
907
|
-
mountedGroups: new Map(
|
|
950
|
+
$(a, u) || E((m) => ({
|
|
951
|
+
mountedGroups: new Map(m.mountedGroups).set(n, {
|
|
908
952
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
909
953
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
910
|
-
layout:
|
|
954
|
+
layout: u,
|
|
911
955
|
separatorToPanels: o.separatorToPanels
|
|
912
956
|
})
|
|
913
957
|
}));
|
|
@@ -919,39 +963,39 @@ function we(e) {
|
|
|
919
963
|
if (!n.disabled)
|
|
920
964
|
switch (e.key) {
|
|
921
965
|
case "ArrowDown": {
|
|
922
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
966
|
+
e.preventDefault(), n.orientation === "vertical" && F(t, 5);
|
|
923
967
|
break;
|
|
924
968
|
}
|
|
925
969
|
case "ArrowLeft": {
|
|
926
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
970
|
+
e.preventDefault(), n.orientation === "horizontal" && F(t, -5);
|
|
927
971
|
break;
|
|
928
972
|
}
|
|
929
973
|
case "ArrowRight": {
|
|
930
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
974
|
+
e.preventDefault(), n.orientation === "horizontal" && F(t, 5);
|
|
931
975
|
break;
|
|
932
976
|
}
|
|
933
977
|
case "ArrowUp": {
|
|
934
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
978
|
+
e.preventDefault(), n.orientation === "vertical" && F(t, -5);
|
|
935
979
|
break;
|
|
936
980
|
}
|
|
937
981
|
case "End": {
|
|
938
|
-
e.preventDefault(),
|
|
982
|
+
e.preventDefault(), F(t, 100);
|
|
939
983
|
break;
|
|
940
984
|
}
|
|
941
985
|
case "Enter": {
|
|
942
986
|
e.preventDefault();
|
|
943
|
-
const o = ae(t), { derivedPanelConstraints: i, layout:
|
|
944
|
-
(
|
|
987
|
+
const o = ae(t), { derivedPanelConstraints: i, layout: s, separatorToPanels: l } = Ue(o), r = o.separators.find(
|
|
988
|
+
(m) => m.element === t
|
|
945
989
|
);
|
|
946
|
-
|
|
947
|
-
const a = l.get(
|
|
948
|
-
|
|
949
|
-
const
|
|
950
|
-
(
|
|
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
|
|
951
995
|
);
|
|
952
|
-
if (
|
|
953
|
-
const
|
|
954
|
-
|
|
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);
|
|
955
999
|
}
|
|
956
1000
|
break;
|
|
957
1001
|
}
|
|
@@ -959,16 +1003,16 @@ function we(e) {
|
|
|
959
1003
|
e.preventDefault();
|
|
960
1004
|
const i = ae(t).separators.map(
|
|
961
1005
|
(a) => a.element
|
|
962
|
-
),
|
|
1006
|
+
), s = Array.from(i).findIndex(
|
|
963
1007
|
(a) => a === e.currentTarget
|
|
964
1008
|
);
|
|
965
|
-
|
|
966
|
-
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;
|
|
967
1011
|
i[l].focus();
|
|
968
1012
|
break;
|
|
969
1013
|
}
|
|
970
1014
|
case "Home": {
|
|
971
|
-
e.preventDefault(),
|
|
1015
|
+
e.preventDefault(), F(t, -100);
|
|
972
1016
|
break;
|
|
973
1017
|
}
|
|
974
1018
|
}
|
|
@@ -978,13 +1022,13 @@ function Le(e) {
|
|
|
978
1022
|
return;
|
|
979
1023
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
980
1024
|
return;
|
|
981
|
-
const { mountedGroups: t } =
|
|
1025
|
+
const { mountedGroups: t } = G(), n = de(e, t), o = /* @__PURE__ */ new Map();
|
|
982
1026
|
let i = !1;
|
|
983
|
-
n.forEach((
|
|
984
|
-
|
|
985
|
-
const l = t.get(
|
|
986
|
-
l && o.set(
|
|
987
|
-
}),
|
|
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({
|
|
988
1032
|
interactionState: {
|
|
989
1033
|
hitRegions: n,
|
|
990
1034
|
initialLayoutMap: o,
|
|
@@ -1008,9 +1052,9 @@ function Lt({
|
|
|
1008
1052
|
switch (n) {
|
|
1009
1053
|
case "active":
|
|
1010
1054
|
case "hover":
|
|
1011
|
-
t.forEach((
|
|
1012
|
-
if (!
|
|
1013
|
-
switch (
|
|
1055
|
+
t.forEach((s) => {
|
|
1056
|
+
if (!s.disableCursor)
|
|
1057
|
+
switch (s.orientation) {
|
|
1014
1058
|
case "horizontal": {
|
|
1015
1059
|
o++;
|
|
1016
1060
|
break;
|
|
@@ -1022,25 +1066,25 @@ function Lt({
|
|
|
1022
1066
|
}
|
|
1023
1067
|
});
|
|
1024
1068
|
}
|
|
1025
|
-
if (o === 0 && i === 0)
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
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;
|
|
1039
1084
|
}
|
|
1040
|
-
break;
|
|
1041
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";
|
|
1042
1087
|
}
|
|
1043
|
-
return Re() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1044
1088
|
}
|
|
1045
1089
|
const Me = /* @__PURE__ */ new WeakMap();
|
|
1046
1090
|
function pe(e) {
|
|
@@ -1048,18 +1092,18 @@ function pe(e) {
|
|
|
1048
1092
|
return;
|
|
1049
1093
|
let { prevStyle: t, styleSheet: n } = Me.get(e) ?? {};
|
|
1050
1094
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1051
|
-
const { cursorFlags: o, interactionState: i } =
|
|
1095
|
+
const { cursorFlags: o, interactionState: i } = G();
|
|
1052
1096
|
switch (i.state) {
|
|
1053
1097
|
case "active":
|
|
1054
1098
|
case "hover": {
|
|
1055
|
-
const
|
|
1099
|
+
const s = Lt({
|
|
1056
1100
|
cursorFlags: o,
|
|
1057
|
-
groups: i.hitRegions.map((
|
|
1101
|
+
groups: i.hitRegions.map((r) => r.group),
|
|
1058
1102
|
state: i.state
|
|
1059
|
-
}), l = `*, *:hover {cursor: ${
|
|
1103
|
+
}), l = `*, *:hover {cursor: ${s} !important; ${i.state === "active" ? "touch-action: none;" : ""} }`;
|
|
1060
1104
|
if (t === l)
|
|
1061
1105
|
return;
|
|
1062
|
-
t = l,
|
|
1106
|
+
t = l, s ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
1063
1107
|
break;
|
|
1064
1108
|
}
|
|
1065
1109
|
case "inactive": {
|
|
@@ -1078,62 +1122,62 @@ function Ye({
|
|
|
1078
1122
|
hitRegions: n,
|
|
1079
1123
|
initialLayoutMap: o,
|
|
1080
1124
|
mountedGroups: i,
|
|
1081
|
-
pointerDownAtPoint:
|
|
1125
|
+
pointerDownAtPoint: s,
|
|
1082
1126
|
prevCursorFlags: l
|
|
1083
1127
|
}) {
|
|
1084
|
-
let
|
|
1128
|
+
let r = 0;
|
|
1085
1129
|
const a = new Map(i);
|
|
1086
|
-
n.forEach((
|
|
1087
|
-
const { group:
|
|
1130
|
+
n.forEach((u) => {
|
|
1131
|
+
const { group: m, groupSize: z } = u, { disableCursor: S, orientation: c, panels: d } = m;
|
|
1088
1132
|
let p = 0;
|
|
1089
|
-
|
|
1090
|
-
const
|
|
1091
|
-
defaultLayoutDeferred:
|
|
1092
|
-
derivedPanelConstraints:
|
|
1093
|
-
layout:
|
|
1094
|
-
separatorToPanels:
|
|
1095
|
-
} = i.get(
|
|
1096
|
-
if (
|
|
1097
|
-
const
|
|
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({
|
|
1098
1142
|
delta: p,
|
|
1099
|
-
initialLayout:
|
|
1100
|
-
panelConstraints:
|
|
1101
|
-
pivotIndices:
|
|
1102
|
-
prevLayout:
|
|
1143
|
+
initialLayout: y,
|
|
1144
|
+
panelConstraints: v,
|
|
1145
|
+
pivotIndices: u.panels.map((L) => d.indexOf(L)),
|
|
1146
|
+
prevLayout: g,
|
|
1103
1147
|
trigger: "mouse-or-touch"
|
|
1104
1148
|
});
|
|
1105
|
-
if (
|
|
1106
|
-
if (p !== 0 && !
|
|
1107
|
-
switch (
|
|
1149
|
+
if ($(C, g)) {
|
|
1150
|
+
if (p !== 0 && !S)
|
|
1151
|
+
switch (c) {
|
|
1108
1152
|
case "horizontal": {
|
|
1109
|
-
|
|
1153
|
+
r |= p < 0 ? Be : Ke;
|
|
1110
1154
|
break;
|
|
1111
1155
|
}
|
|
1112
1156
|
case "vertical": {
|
|
1113
|
-
|
|
1157
|
+
r |= p < 0 ? Xe : qe;
|
|
1114
1158
|
break;
|
|
1115
1159
|
}
|
|
1116
1160
|
}
|
|
1117
1161
|
} else {
|
|
1118
|
-
a.set(
|
|
1119
|
-
defaultLayoutDeferred:
|
|
1120
|
-
derivedPanelConstraints:
|
|
1121
|
-
layout:
|
|
1122
|
-
separatorToPanels:
|
|
1162
|
+
a.set(u.group, {
|
|
1163
|
+
defaultLayoutDeferred: h,
|
|
1164
|
+
derivedPanelConstraints: v,
|
|
1165
|
+
layout: C,
|
|
1166
|
+
separatorToPanels: x
|
|
1123
1167
|
});
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1168
|
+
const L = u.group.panels.map(({ id: R }) => R).join(",");
|
|
1169
|
+
u.group.inMemoryLayouts[L] = C;
|
|
1126
1170
|
}
|
|
1127
1171
|
}
|
|
1128
1172
|
});
|
|
1129
|
-
let
|
|
1130
|
-
t.movementX === 0 ?
|
|
1131
|
-
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,
|
|
1132
1176
|
mountedGroups: a
|
|
1133
1177
|
}), pe(e);
|
|
1134
1178
|
}
|
|
1135
1179
|
function Ee(e) {
|
|
1136
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } =
|
|
1180
|
+
const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
|
|
1137
1181
|
switch (n.state) {
|
|
1138
1182
|
case "active":
|
|
1139
1183
|
Ye({
|
|
@@ -1146,22 +1190,22 @@ function Ee(e) {
|
|
|
1146
1190
|
});
|
|
1147
1191
|
}
|
|
1148
1192
|
}
|
|
1149
|
-
function
|
|
1193
|
+
function ke(e) {
|
|
1150
1194
|
if (e.defaultPrevented)
|
|
1151
1195
|
return;
|
|
1152
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } =
|
|
1196
|
+
const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
|
|
1153
1197
|
switch (n.state) {
|
|
1154
1198
|
case "active": {
|
|
1155
1199
|
if (
|
|
1156
1200
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
1157
1201
|
e.buttons === 0
|
|
1158
1202
|
) {
|
|
1159
|
-
|
|
1203
|
+
E(
|
|
1160
1204
|
(i) => i.interactionState.state === "inactive" ? i : {
|
|
1161
1205
|
cursorFlags: 0,
|
|
1162
1206
|
interactionState: { state: "inactive" }
|
|
1163
1207
|
}
|
|
1164
|
-
),
|
|
1208
|
+
), E((i) => ({
|
|
1165
1209
|
mountedGroups: new Map(i.mountedGroups)
|
|
1166
1210
|
}));
|
|
1167
1211
|
return;
|
|
@@ -1179,11 +1223,11 @@ function Ge(e) {
|
|
|
1179
1223
|
}
|
|
1180
1224
|
default: {
|
|
1181
1225
|
const i = de(e, o);
|
|
1182
|
-
i.length === 0 ? n.state !== "inactive" &&
|
|
1226
|
+
i.length === 0 ? n.state !== "inactive" && E({
|
|
1183
1227
|
interactionState: {
|
|
1184
1228
|
state: "inactive"
|
|
1185
1229
|
}
|
|
1186
|
-
}) :
|
|
1230
|
+
}) : E({
|
|
1187
1231
|
interactionState: {
|
|
1188
1232
|
hitRegions: i,
|
|
1189
1233
|
state: "hover"
|
|
@@ -1193,12 +1237,12 @@ function Ge(e) {
|
|
|
1193
1237
|
}
|
|
1194
1238
|
}
|
|
1195
1239
|
}
|
|
1196
|
-
function
|
|
1240
|
+
function Ge(e) {
|
|
1197
1241
|
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1198
|
-
const { interactionState: t } =
|
|
1242
|
+
const { interactionState: t } = G();
|
|
1199
1243
|
switch (t.state) {
|
|
1200
1244
|
case "hover":
|
|
1201
|
-
|
|
1245
|
+
E({
|
|
1202
1246
|
interactionState: {
|
|
1203
1247
|
state: "inactive"
|
|
1204
1248
|
}
|
|
@@ -1211,15 +1255,15 @@ function Ie(e) {
|
|
|
1211
1255
|
return;
|
|
1212
1256
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1213
1257
|
return;
|
|
1214
|
-
const { interactionState: t } =
|
|
1258
|
+
const { interactionState: t } = G();
|
|
1215
1259
|
switch (t.state) {
|
|
1216
1260
|
case "active":
|
|
1217
|
-
|
|
1261
|
+
E({
|
|
1218
1262
|
cursorFlags: 0,
|
|
1219
1263
|
interactionState: {
|
|
1220
1264
|
state: "inactive"
|
|
1221
1265
|
}
|
|
1222
|
-
}), t.hitRegions.length > 0 && (pe(e.currentTarget),
|
|
1266
|
+
}), t.hitRegions.length > 0 && (pe(e.currentTarget), E((n) => ({
|
|
1223
1267
|
mountedGroups: new Map(n.mountedGroups)
|
|
1224
1268
|
})), e.preventDefault());
|
|
1225
1269
|
}
|
|
@@ -1227,32 +1271,32 @@ function Ie(e) {
|
|
|
1227
1271
|
function De(e) {
|
|
1228
1272
|
let t = 0, n = 0;
|
|
1229
1273
|
const o = {};
|
|
1230
|
-
for (const
|
|
1231
|
-
if (
|
|
1274
|
+
for (const s of e)
|
|
1275
|
+
if (s.defaultSize !== void 0) {
|
|
1232
1276
|
t++;
|
|
1233
|
-
const l =
|
|
1234
|
-
n += l, o[
|
|
1277
|
+
const l = O(s.defaultSize);
|
|
1278
|
+
n += l, o[s.panelId] = l;
|
|
1235
1279
|
} else
|
|
1236
|
-
o[
|
|
1280
|
+
o[s.panelId] = void 0;
|
|
1237
1281
|
const i = e.length - t;
|
|
1238
1282
|
if (i !== 0) {
|
|
1239
|
-
const
|
|
1283
|
+
const s = O((100 - n) / i);
|
|
1240
1284
|
for (const l of e)
|
|
1241
|
-
l.defaultSize === void 0 && (o[l.panelId] =
|
|
1285
|
+
l.defaultSize === void 0 && (o[l.panelId] = s);
|
|
1242
1286
|
}
|
|
1243
1287
|
return o;
|
|
1244
1288
|
}
|
|
1245
1289
|
function Ct(e, t, n) {
|
|
1246
1290
|
if (!n[0])
|
|
1247
1291
|
return;
|
|
1248
|
-
const i = e.panels.find((
|
|
1292
|
+
const i = e.panels.find((f) => f.element === t);
|
|
1249
1293
|
if (!i || !i.onResize)
|
|
1250
1294
|
return;
|
|
1251
|
-
const
|
|
1252
|
-
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),
|
|
1253
1297
|
inPixels: l
|
|
1254
1298
|
};
|
|
1255
|
-
i.mutableValues.prevSize = a, i.onResize(a, i.id,
|
|
1299
|
+
i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
|
|
1256
1300
|
}
|
|
1257
1301
|
function Pt(e, t) {
|
|
1258
1302
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -1271,119 +1315,119 @@ function Rt(e, t) {
|
|
|
1271
1315
|
return !1;
|
|
1272
1316
|
return !0;
|
|
1273
1317
|
}
|
|
1274
|
-
const
|
|
1318
|
+
const W = /* @__PURE__ */ new Map();
|
|
1275
1319
|
function Mt(e) {
|
|
1276
1320
|
let t = !0;
|
|
1277
|
-
|
|
1321
|
+
b(
|
|
1278
1322
|
e.element.ownerDocument.defaultView,
|
|
1279
1323
|
"Cannot register an unmounted Group"
|
|
1280
1324
|
);
|
|
1281
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(),
|
|
1282
|
-
for (const d of
|
|
1283
|
-
const { borderBoxSize: p, target:
|
|
1284
|
-
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) {
|
|
1285
1329
|
if (t) {
|
|
1286
|
-
if (
|
|
1330
|
+
if (B({ group: e }) === 0)
|
|
1287
1331
|
return;
|
|
1288
|
-
|
|
1289
|
-
const
|
|
1290
|
-
if (
|
|
1291
|
-
const
|
|
1292
|
-
layout:
|
|
1293
|
-
panelConstraints:
|
|
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({
|
|
1336
|
+
layout: C,
|
|
1337
|
+
panelConstraints: x
|
|
1294
1338
|
});
|
|
1295
|
-
return !
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
) ?
|
|
1299
|
-
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, {
|
|
1300
1344
|
defaultLayoutDeferred: !1,
|
|
1301
|
-
derivedPanelConstraints:
|
|
1302
|
-
layout:
|
|
1303
|
-
separatorToPanels:
|
|
1345
|
+
derivedPanelConstraints: x,
|
|
1346
|
+
layout: L,
|
|
1347
|
+
separatorToPanels: g.separatorToPanels
|
|
1304
1348
|
})
|
|
1305
1349
|
};
|
|
1306
1350
|
}
|
|
1307
|
-
return
|
|
1351
|
+
return v;
|
|
1308
1352
|
});
|
|
1309
1353
|
}
|
|
1310
1354
|
} else
|
|
1311
|
-
Ct(e,
|
|
1355
|
+
Ct(e, y, p);
|
|
1312
1356
|
}
|
|
1313
1357
|
});
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
!o.has(
|
|
1317
|
-
`Panel ids must be unique; id "${
|
|
1318
|
-
), 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);
|
|
1319
1363
|
});
|
|
1320
|
-
const l =
|
|
1321
|
-
let
|
|
1322
|
-
|
|
1323
|
-
const
|
|
1324
|
-
layout:
|
|
1325
|
-
panelConstraints:
|
|
1326
|
-
}),
|
|
1327
|
-
return
|
|
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({
|
|
1368
|
+
layout: u,
|
|
1369
|
+
panelConstraints: r
|
|
1370
|
+
}), z = He(e), S = e.element.ownerDocument;
|
|
1371
|
+
return E((c) => {
|
|
1328
1372
|
const d = /* @__PURE__ */ new Map();
|
|
1329
|
-
return
|
|
1330
|
-
|
|
1331
|
-
(
|
|
1332
|
-
),
|
|
1373
|
+
return W.set(
|
|
1374
|
+
S,
|
|
1375
|
+
(W.get(S) ?? 0) + 1
|
|
1376
|
+
), z.forEach((p) => {
|
|
1333
1377
|
p.separator && d.set(p.separator, p.panels);
|
|
1334
1378
|
}), {
|
|
1335
|
-
mountedGroups: new Map(
|
|
1379
|
+
mountedGroups: new Map(c.mountedGroups).set(e, {
|
|
1336
1380
|
defaultLayoutDeferred: l === 0,
|
|
1337
|
-
derivedPanelConstraints:
|
|
1338
|
-
layout:
|
|
1381
|
+
derivedPanelConstraints: r,
|
|
1382
|
+
layout: m,
|
|
1339
1383
|
separatorToPanels: d
|
|
1340
1384
|
})
|
|
1341
1385
|
};
|
|
1342
|
-
}), e.separators.forEach((
|
|
1343
|
-
|
|
1344
|
-
!i.has(
|
|
1345
|
-
`Separator ids must be unique; id "${
|
|
1346
|
-
), i.add(
|
|
1347
|
-
}),
|
|
1348
|
-
t = !1,
|
|
1349
|
-
|
|
1350
|
-
Math.max(0, (
|
|
1351
|
-
),
|
|
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) => {
|
|
1352
1396
|
const p = new Map(d.mountedGroups);
|
|
1353
1397
|
return p.delete(e), { mountedGroups: p };
|
|
1354
1398
|
}), e.separators.forEach((d) => {
|
|
1355
1399
|
d.element.removeEventListener("keydown", we);
|
|
1356
|
-
}),
|
|
1400
|
+
}), W.get(S) || (S.removeEventListener(
|
|
1357
1401
|
"dblclick",
|
|
1358
1402
|
be,
|
|
1359
1403
|
!0
|
|
1360
|
-
),
|
|
1404
|
+
), S.removeEventListener(
|
|
1361
1405
|
"pointerdown",
|
|
1362
1406
|
Le,
|
|
1363
1407
|
!0
|
|
1364
|
-
),
|
|
1408
|
+
), S.removeEventListener("pointerleave", Ee), S.removeEventListener("pointermove", ke), S.removeEventListener("pointerout", Ge), S.removeEventListener("pointerup", Ie, !0)), s.disconnect();
|
|
1365
1409
|
};
|
|
1366
1410
|
}
|
|
1367
1411
|
function Et() {
|
|
1368
|
-
const [e, t] =
|
|
1412
|
+
const [e, t] = Z({}), n = q(() => t({}), []);
|
|
1369
1413
|
return [e, n];
|
|
1370
1414
|
}
|
|
1371
1415
|
function me(e) {
|
|
1372
1416
|
const t = tt();
|
|
1373
1417
|
return `${e ?? t}`;
|
|
1374
1418
|
}
|
|
1375
|
-
const
|
|
1376
|
-
function
|
|
1377
|
-
const t =
|
|
1378
|
-
return
|
|
1419
|
+
const j = typeof window < "u" ? Oe : Te;
|
|
1420
|
+
function Y(e) {
|
|
1421
|
+
const t = I(e);
|
|
1422
|
+
return j(() => {
|
|
1379
1423
|
t.current = e;
|
|
1380
|
-
}, [e]),
|
|
1424
|
+
}, [e]), q(
|
|
1381
1425
|
(...n) => t.current?.(...n),
|
|
1382
1426
|
[t]
|
|
1383
1427
|
);
|
|
1384
1428
|
}
|
|
1385
1429
|
function he(...e) {
|
|
1386
|
-
return
|
|
1430
|
+
return Y((t) => {
|
|
1387
1431
|
e.forEach((n) => {
|
|
1388
1432
|
if (n)
|
|
1389
1433
|
switch (typeof n) {
|
|
@@ -1399,20 +1443,20 @@ function he(...e) {
|
|
|
1399
1443
|
});
|
|
1400
1444
|
});
|
|
1401
1445
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const t =
|
|
1404
|
-
return
|
|
1446
|
+
function kt(e) {
|
|
1447
|
+
const t = I({ ...e });
|
|
1448
|
+
return j(() => {
|
|
1405
1449
|
for (const n in e)
|
|
1406
1450
|
t.current[n] = e[n];
|
|
1407
1451
|
}, [e]), t.current;
|
|
1408
1452
|
}
|
|
1409
1453
|
const Je = nt(null);
|
|
1410
|
-
function
|
|
1411
|
-
const n =
|
|
1454
|
+
function Gt(e, t) {
|
|
1455
|
+
const n = I({
|
|
1412
1456
|
getLayout: () => ({}),
|
|
1413
1457
|
setLayout: wt
|
|
1414
1458
|
});
|
|
1415
|
-
Ne(t, () => n.current, []),
|
|
1459
|
+
Ne(t, () => n.current, []), j(() => {
|
|
1416
1460
|
Object.assign(
|
|
1417
1461
|
n.current,
|
|
1418
1462
|
We({ groupId: e })
|
|
@@ -1425,164 +1469,164 @@ function It({
|
|
|
1425
1469
|
defaultLayout: n,
|
|
1426
1470
|
disableCursor: o,
|
|
1427
1471
|
disabled: i,
|
|
1428
|
-
elementRef:
|
|
1472
|
+
elementRef: s,
|
|
1429
1473
|
groupRef: l,
|
|
1430
|
-
id:
|
|
1474
|
+
id: r,
|
|
1431
1475
|
onLayoutChange: a,
|
|
1432
|
-
onLayoutChanged:
|
|
1433
|
-
orientation:
|
|
1434
|
-
resizeTargetMinimumSize:
|
|
1476
|
+
onLayoutChanged: f,
|
|
1477
|
+
orientation: u = "horizontal",
|
|
1478
|
+
resizeTargetMinimumSize: m = {
|
|
1435
1479
|
coarse: 20,
|
|
1436
1480
|
fine: 10
|
|
1437
1481
|
},
|
|
1438
|
-
style:
|
|
1439
|
-
...
|
|
1482
|
+
style: z,
|
|
1483
|
+
...S
|
|
1440
1484
|
}) {
|
|
1441
|
-
const
|
|
1485
|
+
const c = I({
|
|
1442
1486
|
onLayoutChange: {},
|
|
1443
1487
|
onLayoutChanged: {}
|
|
1444
|
-
}), d =
|
|
1445
|
-
|
|
1446
|
-
}), p =
|
|
1447
|
-
|
|
1448
|
-
}),
|
|
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({
|
|
1449
1493
|
lastExpandedPanelSizes: {},
|
|
1450
1494
|
layouts: {},
|
|
1451
1495
|
panels: [],
|
|
1452
|
-
resizeTargetMinimumSize:
|
|
1496
|
+
resizeTargetMinimumSize: m,
|
|
1453
1497
|
separators: []
|
|
1454
|
-
}),
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1457
|
-
(w,
|
|
1458
|
-
const { interactionState:
|
|
1459
|
-
for (const ee of
|
|
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())
|
|
1460
1504
|
if (ee.id === w) {
|
|
1461
|
-
const
|
|
1462
|
-
if (
|
|
1505
|
+
const K = V.get(ee);
|
|
1506
|
+
if (K) {
|
|
1463
1507
|
let te = !1;
|
|
1464
|
-
switch (
|
|
1508
|
+
switch (k.state) {
|
|
1465
1509
|
case "active": {
|
|
1466
|
-
te =
|
|
1510
|
+
te = k.hitRegions.some(
|
|
1467
1511
|
(le) => le.group === ee
|
|
1468
1512
|
);
|
|
1469
1513
|
break;
|
|
1470
1514
|
}
|
|
1471
1515
|
}
|
|
1472
1516
|
return {
|
|
1473
|
-
flexGrow:
|
|
1517
|
+
flexGrow: K.layout[P] ?? 1,
|
|
1474
1518
|
pointerEvents: te ? "none" : void 0
|
|
1475
1519
|
};
|
|
1476
1520
|
}
|
|
1477
1521
|
}
|
|
1478
1522
|
return {
|
|
1479
|
-
flexGrow: n?.[
|
|
1523
|
+
flexGrow: n?.[P] ?? 1
|
|
1480
1524
|
};
|
|
1481
1525
|
}
|
|
1482
|
-
),
|
|
1526
|
+
), R = _e(
|
|
1483
1527
|
() => ({
|
|
1484
|
-
getPanelStyles:
|
|
1485
|
-
id:
|
|
1486
|
-
orientation:
|
|
1528
|
+
getPanelStyles: L,
|
|
1529
|
+
id: y,
|
|
1530
|
+
orientation: u,
|
|
1487
1531
|
registerPanel: (w) => {
|
|
1488
|
-
const
|
|
1489
|
-
return
|
|
1490
|
-
...
|
|
1532
|
+
const P = x.current;
|
|
1533
|
+
return P.panels = fe(u, [
|
|
1534
|
+
...P.panels,
|
|
1491
1535
|
w
|
|
1492
|
-
]),
|
|
1493
|
-
|
|
1494
|
-
(
|
|
1495
|
-
),
|
|
1536
|
+
]), g(), () => {
|
|
1537
|
+
P.panels = P.panels.filter(
|
|
1538
|
+
(k) => k !== w
|
|
1539
|
+
), g();
|
|
1496
1540
|
};
|
|
1497
1541
|
},
|
|
1498
1542
|
registerSeparator: (w) => {
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1501
|
-
...
|
|
1543
|
+
const P = x.current;
|
|
1544
|
+
return P.separators = fe(u, [
|
|
1545
|
+
...P.separators,
|
|
1502
1546
|
w
|
|
1503
|
-
]),
|
|
1504
|
-
|
|
1505
|
-
(
|
|
1506
|
-
),
|
|
1547
|
+
]), g(), () => {
|
|
1548
|
+
P.separators = P.separators.filter(
|
|
1549
|
+
(k) => k !== w
|
|
1550
|
+
), g();
|
|
1507
1551
|
};
|
|
1508
1552
|
}
|
|
1509
1553
|
}),
|
|
1510
|
-
[
|
|
1511
|
-
),
|
|
1554
|
+
[L, y, g, u]
|
|
1555
|
+
), _ = kt({
|
|
1512
1556
|
defaultLayout: n,
|
|
1513
1557
|
disableCursor: o
|
|
1514
|
-
}),
|
|
1515
|
-
return
|
|
1516
|
-
const w =
|
|
1558
|
+
}), A = I(null);
|
|
1559
|
+
return j(() => {
|
|
1560
|
+
const w = h.current;
|
|
1517
1561
|
if (w === null)
|
|
1518
1562
|
return;
|
|
1519
|
-
const
|
|
1520
|
-
defaultLayout:
|
|
1521
|
-
disableCursor: !!
|
|
1563
|
+
const P = x.current, k = {
|
|
1564
|
+
defaultLayout: _.defaultLayout,
|
|
1565
|
+
disableCursor: !!_.disableCursor,
|
|
1522
1566
|
disabled: !!i,
|
|
1523
1567
|
element: w,
|
|
1524
|
-
id:
|
|
1525
|
-
inMemoryLastExpandedPanelSizes:
|
|
1526
|
-
inMemoryLayouts:
|
|
1527
|
-
orientation:
|
|
1528
|
-
panels:
|
|
1529
|
-
resizeTargetMinimumSize:
|
|
1530
|
-
separators:
|
|
1568
|
+
id: y,
|
|
1569
|
+
inMemoryLastExpandedPanelSizes: x.current.lastExpandedPanelSizes,
|
|
1570
|
+
inMemoryLayouts: x.current.layouts,
|
|
1571
|
+
orientation: u,
|
|
1572
|
+
panels: P.panels,
|
|
1573
|
+
resizeTargetMinimumSize: P.resizeTargetMinimumSize,
|
|
1574
|
+
separators: P.separators
|
|
1531
1575
|
};
|
|
1532
|
-
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1535
|
-
const { defaultLayoutDeferred:
|
|
1536
|
-
!
|
|
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));
|
|
1537
1581
|
}
|
|
1538
|
-
const te =
|
|
1582
|
+
const te = N.addListener(
|
|
1539
1583
|
"interactionStateChange",
|
|
1540
|
-
(
|
|
1541
|
-
|
|
1584
|
+
(X) => {
|
|
1585
|
+
X.state;
|
|
1542
1586
|
}
|
|
1543
|
-
), le =
|
|
1587
|
+
), le = N.addListener(
|
|
1544
1588
|
"mountedGroupsChange",
|
|
1545
|
-
(
|
|
1546
|
-
const ne =
|
|
1589
|
+
(X) => {
|
|
1590
|
+
const ne = X.get(k);
|
|
1547
1591
|
if (ne) {
|
|
1548
1592
|
const { defaultLayoutDeferred: oe, derivedPanelConstraints: Ze, layout: ye } = ne;
|
|
1549
1593
|
if (oe || Ze.length === 0)
|
|
1550
1594
|
return;
|
|
1551
|
-
const { interactionState: Qe } =
|
|
1595
|
+
const { interactionState: Qe } = G(), et = Qe.state !== "active";
|
|
1552
1596
|
d(ye), et && p(ye);
|
|
1553
1597
|
}
|
|
1554
1598
|
}
|
|
1555
1599
|
);
|
|
1556
1600
|
return () => {
|
|
1557
|
-
|
|
1601
|
+
A.current = null, V(), te(), le();
|
|
1558
1602
|
};
|
|
1559
1603
|
}, [
|
|
1560
1604
|
i,
|
|
1561
|
-
|
|
1605
|
+
y,
|
|
1562
1606
|
p,
|
|
1563
1607
|
d,
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1608
|
+
u,
|
|
1609
|
+
v,
|
|
1610
|
+
_
|
|
1567
1611
|
]), Te(() => {
|
|
1568
|
-
const w =
|
|
1612
|
+
const w = A.current;
|
|
1569
1613
|
w && (w.defaultLayout = n, w.disableCursor = !!o);
|
|
1570
|
-
}), /* @__PURE__ */
|
|
1614
|
+
}), /* @__PURE__ */ J(Je.Provider, { value: R, children: /* @__PURE__ */ J(
|
|
1571
1615
|
"div",
|
|
1572
1616
|
{
|
|
1573
|
-
...
|
|
1617
|
+
...S,
|
|
1574
1618
|
className: t,
|
|
1575
1619
|
"data-group": !0,
|
|
1576
|
-
"data-testid":
|
|
1577
|
-
id:
|
|
1578
|
-
ref:
|
|
1620
|
+
"data-testid": y,
|
|
1621
|
+
id: y,
|
|
1622
|
+
ref: C,
|
|
1579
1623
|
style: {
|
|
1580
1624
|
height: "100%",
|
|
1581
1625
|
width: "100%",
|
|
1582
1626
|
overflow: "hidden",
|
|
1583
|
-
...
|
|
1627
|
+
...z,
|
|
1584
1628
|
display: "flex",
|
|
1585
|
-
flexDirection:
|
|
1629
|
+
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1586
1630
|
flexWrap: "nowrap"
|
|
1587
1631
|
},
|
|
1588
1632
|
children: e
|
|
@@ -1599,39 +1643,39 @@ function Ht({
|
|
|
1599
1643
|
storage: n = localStorage,
|
|
1600
1644
|
...o
|
|
1601
1645
|
}) {
|
|
1602
|
-
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(
|
|
1603
1647
|
Dt,
|
|
1604
1648
|
() => n.getItem(l),
|
|
1605
1649
|
() => n.getItem(l)
|
|
1606
|
-
), a =
|
|
1607
|
-
() =>
|
|
1608
|
-
[
|
|
1609
|
-
),
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1650
|
+
), a = _e(
|
|
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));
|
|
1612
1656
|
}, []);
|
|
1613
1657
|
Oe(() => () => {
|
|
1614
|
-
|
|
1615
|
-
}, [
|
|
1616
|
-
const
|
|
1617
|
-
(
|
|
1618
|
-
|
|
1619
|
-
let
|
|
1620
|
-
i ?
|
|
1658
|
+
u();
|
|
1659
|
+
}, [u]);
|
|
1660
|
+
const m = q(
|
|
1661
|
+
(S) => {
|
|
1662
|
+
u();
|
|
1663
|
+
let c;
|
|
1664
|
+
i ? c = ce(s, Object.keys(S)) : c = ce(s, []);
|
|
1621
1665
|
try {
|
|
1622
|
-
n.setItem(
|
|
1666
|
+
n.setItem(c, JSON.stringify(S));
|
|
1623
1667
|
} catch (d) {
|
|
1624
1668
|
console.error(d);
|
|
1625
1669
|
}
|
|
1626
1670
|
},
|
|
1627
|
-
[
|
|
1628
|
-
),
|
|
1629
|
-
(
|
|
1630
|
-
|
|
1631
|
-
|
|
1671
|
+
[u, i, s, n]
|
|
1672
|
+
), z = q(
|
|
1673
|
+
(S) => {
|
|
1674
|
+
u(), e === 0 ? m(S) : f.current = setTimeout(() => {
|
|
1675
|
+
m(S);
|
|
1632
1676
|
}, e);
|
|
1633
1677
|
},
|
|
1634
|
-
[
|
|
1678
|
+
[u, e, m]
|
|
1635
1679
|
);
|
|
1636
1680
|
return {
|
|
1637
1681
|
/**
|
|
@@ -1643,11 +1687,11 @@ function Ht({
|
|
|
1643
1687
|
*
|
|
1644
1688
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1645
1689
|
*/
|
|
1646
|
-
onLayoutChange:
|
|
1690
|
+
onLayoutChange: z,
|
|
1647
1691
|
/**
|
|
1648
1692
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1649
1693
|
*/
|
|
1650
|
-
onLayoutChanged:
|
|
1694
|
+
onLayoutChanged: m
|
|
1651
1695
|
};
|
|
1652
1696
|
}
|
|
1653
1697
|
function Dt() {
|
|
@@ -1655,20 +1699,20 @@ function Dt() {
|
|
|
1655
1699
|
};
|
|
1656
1700
|
}
|
|
1657
1701
|
function jt() {
|
|
1658
|
-
return
|
|
1702
|
+
return Z(null);
|
|
1659
1703
|
}
|
|
1660
1704
|
function Vt() {
|
|
1661
|
-
return
|
|
1705
|
+
return I(null);
|
|
1662
1706
|
}
|
|
1663
1707
|
function ge() {
|
|
1664
1708
|
const e = ot(Je);
|
|
1665
|
-
return
|
|
1709
|
+
return b(
|
|
1666
1710
|
e,
|
|
1667
1711
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1668
1712
|
), e;
|
|
1669
1713
|
}
|
|
1670
1714
|
function Ot(e, t) {
|
|
1671
|
-
const { id: n } = ge(), o =
|
|
1715
|
+
const { id: n } = ge(), o = I({
|
|
1672
1716
|
collapse: ue,
|
|
1673
1717
|
expand: ue,
|
|
1674
1718
|
getSize: () => ({
|
|
@@ -1678,7 +1722,7 @@ function Ot(e, t) {
|
|
|
1678
1722
|
isCollapsed: () => !1,
|
|
1679
1723
|
resize: ue
|
|
1680
1724
|
});
|
|
1681
|
-
Ne(t, () => o.current, []),
|
|
1725
|
+
Ne(t, () => o.current, []), j(() => {
|
|
1682
1726
|
Object.assign(
|
|
1683
1727
|
o.current,
|
|
1684
1728
|
Ve({ groupId: n, panelId: e })
|
|
@@ -1691,69 +1735,73 @@ function Tt({
|
|
|
1691
1735
|
collapsedSize: n = "0%",
|
|
1692
1736
|
collapsible: o = !1,
|
|
1693
1737
|
defaultSize: i,
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1738
|
+
disabled: s,
|
|
1739
|
+
elementRef: l,
|
|
1740
|
+
id: r,
|
|
1741
|
+
maxSize: a = "100%",
|
|
1742
|
+
minSize: f = "0%",
|
|
1698
1743
|
onResize: u,
|
|
1699
|
-
panelRef:
|
|
1700
|
-
style:
|
|
1701
|
-
...
|
|
1744
|
+
panelRef: m,
|
|
1745
|
+
style: z,
|
|
1746
|
+
...S
|
|
1702
1747
|
}) {
|
|
1703
|
-
const
|
|
1704
|
-
(
|
|
1705
|
-
u?.(
|
|
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);
|
|
1706
1751
|
}
|
|
1707
1752
|
);
|
|
1708
|
-
|
|
1709
|
-
const
|
|
1710
|
-
if (
|
|
1711
|
-
return
|
|
1712
|
-
element:
|
|
1713
|
-
id:
|
|
1714
|
-
idIsStable:
|
|
1753
|
+
j(() => {
|
|
1754
|
+
const R = p.current;
|
|
1755
|
+
if (R !== null)
|
|
1756
|
+
return g({
|
|
1757
|
+
element: R,
|
|
1758
|
+
id: d,
|
|
1759
|
+
idIsStable: c,
|
|
1715
1760
|
mutableValues: {
|
|
1716
1761
|
expandToSize: void 0,
|
|
1717
1762
|
prevSize: void 0
|
|
1718
1763
|
},
|
|
1719
|
-
onResize:
|
|
1764
|
+
onResize: x ? C : void 0,
|
|
1720
1765
|
panelConstraints: {
|
|
1721
1766
|
collapsedSize: n,
|
|
1722
1767
|
collapsible: o,
|
|
1723
1768
|
defaultSize: i,
|
|
1724
|
-
|
|
1725
|
-
|
|
1769
|
+
disabled: s,
|
|
1770
|
+
maxSize: a,
|
|
1771
|
+
minSize: f
|
|
1726
1772
|
}
|
|
1727
1773
|
});
|
|
1728
1774
|
}, [
|
|
1729
1775
|
n,
|
|
1730
1776
|
o,
|
|
1731
1777
|
i,
|
|
1732
|
-
S,
|
|
1733
|
-
f,
|
|
1734
|
-
m,
|
|
1735
1778
|
s,
|
|
1779
|
+
x,
|
|
1780
|
+
d,
|
|
1781
|
+
c,
|
|
1736
1782
|
a,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
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);
|
|
1743
1790
|
}),
|
|
1744
1791
|
// useSyncExternalStore does not support a custom equality check
|
|
1745
1792
|
// stringify avoids re-rendering when the style value hasn't changed
|
|
1746
|
-
() => JSON.stringify(
|
|
1747
|
-
() => JSON.stringify(
|
|
1793
|
+
() => JSON.stringify(h(v, d)),
|
|
1794
|
+
() => JSON.stringify(h(v, d))
|
|
1748
1795
|
);
|
|
1749
|
-
return /* @__PURE__ */
|
|
1796
|
+
return /* @__PURE__ */ J(
|
|
1750
1797
|
"div",
|
|
1751
1798
|
{
|
|
1752
|
-
...
|
|
1799
|
+
...S,
|
|
1800
|
+
"aria-disabled": s,
|
|
1753
1801
|
"data-panel": !0,
|
|
1754
|
-
"data-testid":
|
|
1755
|
-
id:
|
|
1756
|
-
ref:
|
|
1802
|
+
"data-testid": d,
|
|
1803
|
+
id: d,
|
|
1804
|
+
ref: y,
|
|
1757
1805
|
style: {
|
|
1758
1806
|
...Nt,
|
|
1759
1807
|
display: "flex",
|
|
@@ -1761,9 +1809,9 @@ function Tt({
|
|
|
1761
1809
|
flexShrink: 1,
|
|
1762
1810
|
// Prevent Panel content from interfering with panel size
|
|
1763
1811
|
overflow: "hidden",
|
|
1764
|
-
...JSON.parse(
|
|
1812
|
+
...JSON.parse(L)
|
|
1765
1813
|
},
|
|
1766
|
-
children: /* @__PURE__ */
|
|
1814
|
+
children: /* @__PURE__ */ J(
|
|
1767
1815
|
"div",
|
|
1768
1816
|
{
|
|
1769
1817
|
className: t,
|
|
@@ -1771,7 +1819,7 @@ function Tt({
|
|
|
1771
1819
|
maxHeight: "100%",
|
|
1772
1820
|
maxWidth: "100%",
|
|
1773
1821
|
flexGrow: 1,
|
|
1774
|
-
...
|
|
1822
|
+
...z
|
|
1775
1823
|
},
|
|
1776
1824
|
children: e
|
|
1777
1825
|
}
|
|
@@ -1793,38 +1841,38 @@ const Nt = {
|
|
|
1793
1841
|
margin: 0
|
|
1794
1842
|
};
|
|
1795
1843
|
function Wt() {
|
|
1796
|
-
return
|
|
1844
|
+
return Z(null);
|
|
1797
1845
|
}
|
|
1798
1846
|
function Ut() {
|
|
1799
|
-
return
|
|
1847
|
+
return I(null);
|
|
1800
1848
|
}
|
|
1801
|
-
function
|
|
1849
|
+
function _t({
|
|
1802
1850
|
layout: e,
|
|
1803
1851
|
panelConstraints: t,
|
|
1804
1852
|
panelId: n,
|
|
1805
1853
|
panelIndex: o
|
|
1806
1854
|
}) {
|
|
1807
|
-
let i,
|
|
1808
|
-
const l = e[n],
|
|
1855
|
+
let i, s;
|
|
1856
|
+
const l = e[n], r = t.find(
|
|
1809
1857
|
(a) => a.panelId === n
|
|
1810
1858
|
);
|
|
1811
|
-
if (
|
|
1812
|
-
const a =
|
|
1813
|
-
|
|
1814
|
-
layout:
|
|
1815
|
-
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,
|
|
1816
1864
|
initialLayout: e,
|
|
1817
1865
|
panelConstraints: t,
|
|
1818
|
-
pivotIndices:
|
|
1866
|
+
pivotIndices: u,
|
|
1819
1867
|
prevLayout: e
|
|
1820
1868
|
}),
|
|
1821
1869
|
panelConstraints: t
|
|
1822
|
-
})[n], i =
|
|
1823
|
-
layout:
|
|
1870
|
+
})[n], i = H({
|
|
1871
|
+
layout: Q({
|
|
1824
1872
|
delta: a - l,
|
|
1825
1873
|
initialLayout: e,
|
|
1826
1874
|
panelConstraints: t,
|
|
1827
|
-
pivotIndices:
|
|
1875
|
+
pivotIndices: u,
|
|
1828
1876
|
prevLayout: e
|
|
1829
1877
|
}),
|
|
1830
1878
|
panelConstraints: t
|
|
@@ -1833,53 +1881,55 @@ function At({
|
|
|
1833
1881
|
return {
|
|
1834
1882
|
valueControls: n,
|
|
1835
1883
|
valueMax: i,
|
|
1836
|
-
valueMin:
|
|
1884
|
+
valueMin: s,
|
|
1837
1885
|
valueNow: l
|
|
1838
1886
|
};
|
|
1839
1887
|
}
|
|
1840
|
-
function
|
|
1888
|
+
function At({
|
|
1841
1889
|
children: e,
|
|
1842
1890
|
className: t,
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1891
|
+
disabled: n,
|
|
1892
|
+
elementRef: o,
|
|
1893
|
+
id: i,
|
|
1894
|
+
style: s,
|
|
1895
|
+
...l
|
|
1847
1896
|
}) {
|
|
1848
|
-
const
|
|
1849
|
-
id:
|
|
1850
|
-
orientation:
|
|
1851
|
-
registerSeparator:
|
|
1852
|
-
} = ge(),
|
|
1853
|
-
return
|
|
1854
|
-
const
|
|
1855
|
-
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) {
|
|
1856
1905
|
const v = {
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1906
|
+
disabled: n,
|
|
1907
|
+
element: h,
|
|
1908
|
+
id: r
|
|
1909
|
+
}, g = p(v), x = N.addListener(
|
|
1860
1910
|
"interactionStateChange",
|
|
1861
|
-
(
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
(
|
|
1865
|
-
) ?
|
|
1911
|
+
(L) => {
|
|
1912
|
+
m(
|
|
1913
|
+
L.state !== "inactive" && L.hitRegions.some(
|
|
1914
|
+
(R) => R.separator === v
|
|
1915
|
+
) ? L.state : "inactive"
|
|
1866
1916
|
);
|
|
1867
1917
|
}
|
|
1868
|
-
),
|
|
1918
|
+
), C = N.addListener(
|
|
1869
1919
|
"mountedGroupsChange",
|
|
1870
|
-
(
|
|
1871
|
-
|
|
1872
|
-
({ derivedPanelConstraints:
|
|
1873
|
-
if (
|
|
1874
|
-
const
|
|
1875
|
-
if (
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
layout:
|
|
1880
|
-
panelConstraints:
|
|
1881
|
-
panelId:
|
|
1882
|
-
panelIndex:
|
|
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(
|
|
1928
|
+
_t({
|
|
1929
|
+
layout: _,
|
|
1930
|
+
panelConstraints: R,
|
|
1931
|
+
panelId: k.id,
|
|
1932
|
+
panelIndex: V
|
|
1883
1933
|
})
|
|
1884
1934
|
);
|
|
1885
1935
|
}
|
|
@@ -1889,40 +1939,42 @@ function _t({
|
|
|
1889
1939
|
}
|
|
1890
1940
|
);
|
|
1891
1941
|
return () => {
|
|
1892
|
-
|
|
1942
|
+
x(), C(), g();
|
|
1893
1943
|
};
|
|
1894
1944
|
}
|
|
1895
|
-
}, [
|
|
1945
|
+
}, [n, c, r, p]), /* @__PURE__ */ J(
|
|
1896
1946
|
"div",
|
|
1897
1947
|
{
|
|
1898
|
-
...
|
|
1899
|
-
"aria-controls":
|
|
1900
|
-
"aria-
|
|
1901
|
-
"aria-
|
|
1902
|
-
"aria-
|
|
1903
|
-
"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,
|
|
1904
1955
|
children: e,
|
|
1905
1956
|
className: t,
|
|
1906
|
-
"data-separator": u,
|
|
1907
|
-
"data-testid":
|
|
1908
|
-
id:
|
|
1909
|
-
ref:
|
|
1957
|
+
"data-separator": n ? "disabled" : u,
|
|
1958
|
+
"data-testid": r,
|
|
1959
|
+
id: r,
|
|
1960
|
+
ref: S,
|
|
1910
1961
|
role: "separator",
|
|
1911
1962
|
style: {
|
|
1912
1963
|
flexBasis: "auto",
|
|
1913
|
-
|
|
1964
|
+
cursor: n ? "not-allowed" : void 0,
|
|
1965
|
+
...s,
|
|
1914
1966
|
flexGrow: 0,
|
|
1915
1967
|
flexShrink: 0
|
|
1916
1968
|
},
|
|
1917
|
-
tabIndex: 0
|
|
1969
|
+
tabIndex: n ? void 0 : 0
|
|
1918
1970
|
}
|
|
1919
1971
|
);
|
|
1920
1972
|
}
|
|
1921
|
-
|
|
1973
|
+
At.displayName = "Separator";
|
|
1922
1974
|
export {
|
|
1923
1975
|
It as Group,
|
|
1924
1976
|
Tt as Panel,
|
|
1925
|
-
|
|
1977
|
+
At as Separator,
|
|
1926
1978
|
at as isCoarsePointer,
|
|
1927
1979
|
Ht as useDefaultLayout,
|
|
1928
1980
|
jt as useGroupCallbackRef,
|