react-resizable-panels 4.13.1 → 4.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as Z, useCallback as ce, useId as Pt, useLayoutEffect as Qe, useEffect as Se, useRef as
|
|
2
|
+
import { jsx as B, jsxs as wt } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Z, useCallback as ce, useId as Pt, useLayoutEffect as Qe, useEffect as Se, useRef as D, createContext as Lt, useContext as Ct, isValidElement as Rt, useImperativeHandle as et, useMemo as Pe, useSyncExternalStore as tt } from "react";
|
|
4
4
|
function Mt(e, t) {
|
|
5
5
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
6
6
|
return t * o;
|
|
@@ -15,7 +15,7 @@ function It(e) {
|
|
|
15
15
|
function kt(e) {
|
|
16
16
|
return e / 100 * window.innerWidth;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ot(e) {
|
|
19
19
|
switch (typeof e) {
|
|
20
20
|
case "number":
|
|
21
21
|
return [e, "px"];
|
|
@@ -31,8 +31,8 @@ function ie({
|
|
|
31
31
|
styleProp: n
|
|
32
32
|
}) {
|
|
33
33
|
let o;
|
|
34
|
-
const [r,
|
|
35
|
-
switch (
|
|
34
|
+
const [r, i] = Ot(n);
|
|
35
|
+
switch (i) {
|
|
36
36
|
case "%": {
|
|
37
37
|
o = r / 100 * e;
|
|
38
38
|
break;
|
|
@@ -60,7 +60,7 @@ function ie({
|
|
|
60
60
|
}
|
|
61
61
|
return o;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function F(e) {
|
|
64
64
|
return parseFloat(e.toFixed(3));
|
|
65
65
|
}
|
|
66
66
|
function ae({
|
|
@@ -81,59 +81,59 @@ function Le(e) {
|
|
|
81
81
|
maxSize: 100,
|
|
82
82
|
panelId: o.id
|
|
83
83
|
})) : t.map((o) => {
|
|
84
|
-
const { element: r, panelConstraints:
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
84
|
+
const { element: r, panelConstraints: i } = o;
|
|
85
|
+
let s = 0;
|
|
86
|
+
if (i.collapsedSize !== void 0) {
|
|
87
87
|
const f = ie({
|
|
88
88
|
groupSize: n,
|
|
89
89
|
panelElement: r,
|
|
90
|
-
styleProp:
|
|
90
|
+
styleProp: i.collapsedSize
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
s = F(f / n * 100);
|
|
93
93
|
}
|
|
94
94
|
let u;
|
|
95
|
-
if (
|
|
95
|
+
if (i.collapsedThreshold !== void 0) {
|
|
96
96
|
const f = ie({
|
|
97
97
|
groupSize: n,
|
|
98
98
|
panelElement: r,
|
|
99
|
-
styleProp:
|
|
99
|
+
styleProp: i.collapsedThreshold
|
|
100
100
|
});
|
|
101
|
-
u =
|
|
101
|
+
u = F(f / n * 100);
|
|
102
102
|
}
|
|
103
103
|
let c;
|
|
104
|
-
if (
|
|
104
|
+
if (i.defaultSize !== void 0) {
|
|
105
105
|
const f = ie({
|
|
106
106
|
groupSize: n,
|
|
107
107
|
panelElement: r,
|
|
108
|
-
styleProp:
|
|
108
|
+
styleProp: i.defaultSize
|
|
109
109
|
});
|
|
110
|
-
c =
|
|
110
|
+
c = F(f / n * 100);
|
|
111
111
|
}
|
|
112
112
|
let a = 0;
|
|
113
|
-
if (
|
|
113
|
+
if (i.minSize !== void 0) {
|
|
114
114
|
const f = ie({
|
|
115
115
|
groupSize: n,
|
|
116
116
|
panelElement: r,
|
|
117
|
-
styleProp:
|
|
117
|
+
styleProp: i.minSize
|
|
118
118
|
});
|
|
119
|
-
a =
|
|
119
|
+
a = F(f / n * 100);
|
|
120
120
|
}
|
|
121
121
|
let l = 100;
|
|
122
|
-
if (
|
|
122
|
+
if (i.maxSize !== void 0) {
|
|
123
123
|
const f = ie({
|
|
124
124
|
groupSize: n,
|
|
125
125
|
panelElement: r,
|
|
126
|
-
styleProp:
|
|
126
|
+
styleProp: i.maxSize
|
|
127
127
|
});
|
|
128
|
-
l =
|
|
128
|
+
l = F(f / n * 100);
|
|
129
129
|
}
|
|
130
130
|
return {
|
|
131
|
-
groupResizeBehavior:
|
|
132
|
-
collapsedSize:
|
|
131
|
+
groupResizeBehavior: i.groupResizeBehavior,
|
|
132
|
+
collapsedSize: s,
|
|
133
133
|
collapsedThreshold: u,
|
|
134
|
-
collapsible:
|
|
134
|
+
collapsible: i.collapsible === !0,
|
|
135
135
|
defaultSize: c,
|
|
136
|
-
disabled:
|
|
136
|
+
disabled: i.disabled,
|
|
137
137
|
minSize: a,
|
|
138
138
|
maxSize: l,
|
|
139
139
|
panelId: o.id
|
|
@@ -154,18 +154,18 @@ class nt {
|
|
|
154
154
|
if (o.length === 1)
|
|
155
155
|
o[0].call(null, n);
|
|
156
156
|
else {
|
|
157
|
-
let r = !1,
|
|
158
|
-
const
|
|
159
|
-
for (let u = 0; u <
|
|
160
|
-
const c =
|
|
157
|
+
let r = !1, i = null;
|
|
158
|
+
const s = Array.from(o);
|
|
159
|
+
for (let u = 0; u < s.length; u++) {
|
|
160
|
+
const c = s[u];
|
|
161
161
|
try {
|
|
162
162
|
c.call(null, n);
|
|
163
163
|
} catch (a) {
|
|
164
|
-
|
|
164
|
+
i === null && (r = !0, i = a);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
if (r)
|
|
168
|
-
throw
|
|
168
|
+
throw i;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
removeAllListeners() {
|
|
@@ -179,70 +179,72 @@ class nt {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
let
|
|
182
|
+
let k = {
|
|
183
183
|
cursorFlags: 0,
|
|
184
184
|
state: "inactive"
|
|
185
185
|
};
|
|
186
186
|
const Re = new nt();
|
|
187
|
-
function
|
|
188
|
-
return
|
|
187
|
+
function q() {
|
|
188
|
+
return k;
|
|
189
189
|
}
|
|
190
190
|
function ot(e) {
|
|
191
191
|
return Re.addListener("change", e);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
prev:
|
|
197
|
-
next:
|
|
193
|
+
function Tt(e, t = [], n, o = !1) {
|
|
194
|
+
const r = k, i = { ...k };
|
|
195
|
+
i.cursorFlags = e, i.state === "active" && (i.didPointerMove ||= o, i.previews = t, n && (i.previewLayoutMap = n)), k = i, Re.emit("change", {
|
|
196
|
+
prev: r,
|
|
197
|
+
next: i
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
function W(e) {
|
|
201
|
-
const t =
|
|
202
|
-
|
|
201
|
+
const t = k;
|
|
202
|
+
k = e, t.state === "active" && e.state !== "active" && t.didPointerMove && t.hitRegions.forEach(({ separator: n }) => {
|
|
203
|
+
n && n.element.ownerDocument.activeElement === n.element && n.element.blur();
|
|
204
|
+
}), Re.emit("change", {
|
|
203
205
|
prev: t,
|
|
204
206
|
next: e
|
|
205
207
|
});
|
|
206
208
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
209
|
-
...
|
|
210
|
-
previews:
|
|
209
|
+
function Dt(e) {
|
|
210
|
+
k.state !== "active" || !k.previews.some((t) => t.separator === e) || W({
|
|
211
|
+
...k,
|
|
212
|
+
previews: k.previews.map(
|
|
211
213
|
(t) => t.separator === e ? { ...t } : t
|
|
212
214
|
)
|
|
213
215
|
});
|
|
214
216
|
}
|
|
215
|
-
function
|
|
216
|
-
if (
|
|
217
|
+
function Nt(e) {
|
|
218
|
+
if (k.state === "inactive")
|
|
217
219
|
return !1;
|
|
218
|
-
const t =
|
|
220
|
+
const t = k.hitRegions.filter(
|
|
219
221
|
(o) => o.group !== e
|
|
220
|
-
), n =
|
|
221
|
-
if (t.length ===
|
|
222
|
+
), n = k.state === "active" && k.previews.some((o) => o.group === e);
|
|
223
|
+
if (t.length === k.hitRegions.length && !n)
|
|
222
224
|
return !1;
|
|
223
225
|
if (t.length === 0)
|
|
224
226
|
W({ cursorFlags: 0, state: "inactive" });
|
|
225
|
-
else if (
|
|
226
|
-
const o = new Map(
|
|
227
|
+
else if (k.state === "active") {
|
|
228
|
+
const o = new Map(k.initialLayoutMap), r = new Map(k.previewLayoutMap);
|
|
227
229
|
o.delete(e), r.delete(e), W({
|
|
228
|
-
...
|
|
230
|
+
...k,
|
|
229
231
|
cursorFlags: 0,
|
|
230
232
|
hitRegions: t,
|
|
231
233
|
initialLayoutMap: o,
|
|
232
234
|
previewLayoutMap: r,
|
|
233
|
-
previews:
|
|
235
|
+
previews: k.previews.filter((i) => i.group !== e)
|
|
234
236
|
});
|
|
235
237
|
} else
|
|
236
|
-
W({ ...
|
|
238
|
+
W({ ...k, hitRegions: t });
|
|
237
239
|
return !0;
|
|
238
240
|
}
|
|
239
|
-
const
|
|
240
|
-
}, rt = 1, it = 2, st = 4, at = 8,
|
|
241
|
+
const Gt = (e) => e, we = () => {
|
|
242
|
+
}, rt = 1, it = 2, st = 4, at = 8, Ae = 3, Fe = 12;
|
|
241
243
|
let me;
|
|
242
244
|
function _e() {
|
|
243
245
|
return me === void 0 && (me = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (me = !0)), me;
|
|
244
246
|
}
|
|
245
|
-
function
|
|
247
|
+
function At({
|
|
246
248
|
cursorFlags: e,
|
|
247
249
|
groups: t,
|
|
248
250
|
state: n
|
|
@@ -251,9 +253,9 @@ function Ft({
|
|
|
251
253
|
switch (n) {
|
|
252
254
|
case "active":
|
|
253
255
|
case "hover":
|
|
254
|
-
t.forEach((
|
|
255
|
-
if (!
|
|
256
|
-
switch (
|
|
256
|
+
t.forEach((i) => {
|
|
257
|
+
if (!i.mutableState.disableCursor)
|
|
258
|
+
switch (i.orientation) {
|
|
257
259
|
case "horizontal": {
|
|
258
260
|
o++;
|
|
259
261
|
break;
|
|
@@ -269,10 +271,10 @@ function Ft({
|
|
|
269
271
|
switch (n) {
|
|
270
272
|
case "active": {
|
|
271
273
|
if (e && _e()) {
|
|
272
|
-
const
|
|
273
|
-
if (s)
|
|
274
|
-
return u ? "se-resize" : c ? "ne-resize" : "e-resize";
|
|
274
|
+
const i = (e & rt) !== 0, s = (e & it) !== 0, u = (e & st) !== 0, c = (e & at) !== 0;
|
|
275
275
|
if (i)
|
|
276
|
+
return u ? "se-resize" : c ? "ne-resize" : "e-resize";
|
|
277
|
+
if (s)
|
|
276
278
|
return u ? "sw-resize" : c ? "nw-resize" : "w-resize";
|
|
277
279
|
if (u)
|
|
278
280
|
return "s-resize";
|
|
@@ -294,18 +296,18 @@ function fe(e) {
|
|
|
294
296
|
...e.adoptedStyleSheets,
|
|
295
297
|
n
|
|
296
298
|
]));
|
|
297
|
-
const o =
|
|
299
|
+
const o = q();
|
|
298
300
|
switch (o.state) {
|
|
299
301
|
case "active":
|
|
300
302
|
case "hover": {
|
|
301
|
-
const r =
|
|
303
|
+
const r = At({
|
|
302
304
|
cursorFlags: o.cursorFlags,
|
|
303
|
-
groups: o.hitRegions.map((
|
|
305
|
+
groups: o.hitRegions.map((s) => s.group),
|
|
304
306
|
state: o.state
|
|
305
|
-
}),
|
|
306
|
-
if (t ===
|
|
307
|
+
}), i = `*, *:hover {cursor: ${r} !important; }`;
|
|
308
|
+
if (t === i)
|
|
307
309
|
return;
|
|
308
|
-
t =
|
|
310
|
+
t = i, r ? n.cssRules.length === 0 ? n.insertRule(i) : n.replaceSync(i) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
309
311
|
break;
|
|
310
312
|
}
|
|
311
313
|
case "inactive": {
|
|
@@ -323,11 +325,15 @@ function L(e, t = "Assertion error") {
|
|
|
323
325
|
throw Error(t);
|
|
324
326
|
}
|
|
325
327
|
function Ce(e, t) {
|
|
326
|
-
return Array.from(t).sort(
|
|
327
|
-
e === "horizontal" ?
|
|
328
|
-
|
|
328
|
+
return Array.from(t).sort((n, o) => {
|
|
329
|
+
const r = e === "horizontal" ? Ft(n, o) : _t(n, o);
|
|
330
|
+
if (r !== 0)
|
|
331
|
+
return r;
|
|
332
|
+
const i = n.element.compareDocumentPosition(o.element);
|
|
333
|
+
return i & Node.DOCUMENT_POSITION_DISCONNECTED ? 0 : i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
334
|
+
});
|
|
329
335
|
}
|
|
330
|
-
function
|
|
336
|
+
function Ft(e, t) {
|
|
331
337
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
332
338
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
333
339
|
}
|
|
@@ -359,10 +365,10 @@ function $t({
|
|
|
359
365
|
x: n.x + n.width / 2,
|
|
360
366
|
y: n.y + n.height / 2
|
|
361
367
|
};
|
|
362
|
-
let r,
|
|
363
|
-
for (const
|
|
364
|
-
const { x: u, y: c } = ct(o,
|
|
365
|
-
a <
|
|
368
|
+
let r, i = Number.MAX_VALUE;
|
|
369
|
+
for (const s of t) {
|
|
370
|
+
const { x: u, y: c } = ct(o, s), a = e === "horizontal" ? u : c;
|
|
371
|
+
a < i && (i = a, r = s);
|
|
366
372
|
}
|
|
367
373
|
return L(r, "No rect found"), r;
|
|
368
374
|
}
|
|
@@ -375,151 +381,151 @@ function Me({
|
|
|
375
381
|
group: t,
|
|
376
382
|
includeDisabled: n = !1
|
|
377
383
|
}) {
|
|
378
|
-
const { element: o, orientation: r, panels:
|
|
384
|
+
const { element: o, orientation: r, panels: i, separators: s } = t, u = Ce(
|
|
379
385
|
r,
|
|
380
|
-
Array.from(o.children).filter(lt).filter((
|
|
381
|
-
).map(({ element:
|
|
382
|
-
let a = !1, l = !1, f = -1, y,
|
|
386
|
+
Array.from(o.children).filter(lt).filter((h) => !h.hasAttribute("data-resize-preview")).map((h) => ({ element: h }))
|
|
387
|
+
).map(({ element: h }) => h), c = [];
|
|
388
|
+
let a = !1, l = !1, f = -1, y, p = -1, g = 0, d, v = [];
|
|
383
389
|
{
|
|
384
|
-
let
|
|
385
|
-
for (const
|
|
386
|
-
|
|
390
|
+
let h = -1;
|
|
391
|
+
for (const m of u)
|
|
392
|
+
m.hasAttribute("data-panel") && (h++, m.hasAttribute("data-disabled") || (g++, f === -1 && (f = h), p = h));
|
|
387
393
|
}
|
|
388
|
-
if (n ||
|
|
389
|
-
let
|
|
390
|
-
for (const
|
|
391
|
-
if (
|
|
392
|
-
|
|
393
|
-
const x =
|
|
394
|
-
(
|
|
394
|
+
if (n || g > 1) {
|
|
395
|
+
let h = -1;
|
|
396
|
+
for (const m of u)
|
|
397
|
+
if (m.hasAttribute("data-panel")) {
|
|
398
|
+
h++;
|
|
399
|
+
const x = i.find(
|
|
400
|
+
(S) => S.element === m
|
|
395
401
|
);
|
|
396
402
|
if (x) {
|
|
397
|
-
if (
|
|
398
|
-
const
|
|
399
|
-
let
|
|
403
|
+
if (d) {
|
|
404
|
+
const S = d.element.getBoundingClientRect(), P = m.getBoundingClientRect();
|
|
405
|
+
let C;
|
|
400
406
|
if (l) {
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
|
|
407
|
+
const E = r === "horizontal" ? new DOMRect(
|
|
408
|
+
S.right,
|
|
409
|
+
S.top,
|
|
404
410
|
0,
|
|
405
|
-
|
|
411
|
+
S.height
|
|
406
412
|
) : new DOMRect(
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
413
|
+
S.left,
|
|
414
|
+
S.bottom,
|
|
415
|
+
S.width,
|
|
410
416
|
0
|
|
411
|
-
), w = r === "horizontal" ? new DOMRect(
|
|
417
|
+
), w = r === "horizontal" ? new DOMRect(P.left, P.top, 0, P.height) : new DOMRect(P.left, P.top, P.width, 0);
|
|
412
418
|
switch (v.length) {
|
|
413
419
|
case 0: {
|
|
414
|
-
|
|
415
|
-
|
|
420
|
+
C = [
|
|
421
|
+
E,
|
|
416
422
|
w
|
|
417
423
|
];
|
|
418
424
|
break;
|
|
419
425
|
}
|
|
420
426
|
case 1: {
|
|
421
|
-
const
|
|
427
|
+
const R = v[0], N = $t({
|
|
422
428
|
orientation: r,
|
|
423
|
-
rects: [
|
|
424
|
-
targetRect:
|
|
429
|
+
rects: [S, P],
|
|
430
|
+
targetRect: R.element.getBoundingClientRect()
|
|
425
431
|
});
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
432
|
+
C = [
|
|
433
|
+
R,
|
|
434
|
+
N === S ? w : E
|
|
429
435
|
];
|
|
430
436
|
break;
|
|
431
437
|
}
|
|
432
438
|
default: {
|
|
433
|
-
|
|
439
|
+
C = v;
|
|
434
440
|
break;
|
|
435
441
|
}
|
|
436
442
|
}
|
|
437
443
|
} else
|
|
438
|
-
v.length ?
|
|
444
|
+
v.length ? C = v : C = [
|
|
439
445
|
r === "horizontal" ? new DOMRect(
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
446
|
+
S.right,
|
|
447
|
+
P.top,
|
|
448
|
+
P.left - S.right,
|
|
449
|
+
P.height
|
|
444
450
|
) : new DOMRect(
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
451
|
+
P.left,
|
|
452
|
+
S.bottom,
|
|
453
|
+
P.width,
|
|
454
|
+
P.top - S.bottom
|
|
449
455
|
)
|
|
450
456
|
];
|
|
451
|
-
for (const
|
|
452
|
-
let w = "width" in
|
|
453
|
-
const
|
|
454
|
-
if (w.width <
|
|
455
|
-
const
|
|
457
|
+
for (const E of C) {
|
|
458
|
+
let w = "width" in E ? E : E.element.getBoundingClientRect();
|
|
459
|
+
const R = e ? Ht() ? t.resizeTargetMinimumSize.coarse : t.resizeTargetMinimumSize.fine : 0;
|
|
460
|
+
if (w.width < R) {
|
|
461
|
+
const O = R - w.width;
|
|
456
462
|
w = new DOMRect(
|
|
457
|
-
w.x -
|
|
463
|
+
w.x - O / 2,
|
|
458
464
|
w.y,
|
|
459
|
-
w.width +
|
|
465
|
+
w.width + O,
|
|
460
466
|
w.height
|
|
461
467
|
);
|
|
462
468
|
}
|
|
463
|
-
if (w.height <
|
|
464
|
-
const
|
|
469
|
+
if (w.height < R) {
|
|
470
|
+
const O = R - w.height;
|
|
465
471
|
w = new DOMRect(
|
|
466
472
|
w.x,
|
|
467
|
-
w.y -
|
|
473
|
+
w.y - O / 2,
|
|
468
474
|
w.width,
|
|
469
|
-
w.height +
|
|
475
|
+
w.height + O
|
|
470
476
|
);
|
|
471
477
|
}
|
|
472
|
-
const
|
|
473
|
-
(n || !a && !
|
|
478
|
+
const N = h <= f || h > p;
|
|
479
|
+
(n || !a && !N) && (y ??= ae({ group: t }), c.push({
|
|
474
480
|
group: t,
|
|
475
481
|
groupSize: y,
|
|
476
|
-
panels: [
|
|
477
|
-
separator: "width" in
|
|
482
|
+
panels: [d, x],
|
|
483
|
+
separator: "width" in E ? void 0 : E,
|
|
478
484
|
rect: w
|
|
479
485
|
})), a = !1;
|
|
480
486
|
}
|
|
481
487
|
}
|
|
482
|
-
l = !1,
|
|
488
|
+
l = !1, d = x, v = [];
|
|
483
489
|
}
|
|
484
|
-
} else if (
|
|
485
|
-
|
|
486
|
-
const x =
|
|
487
|
-
(
|
|
490
|
+
} else if (m.hasAttribute("data-separator")) {
|
|
491
|
+
m.ariaDisabled !== null && (a = !0);
|
|
492
|
+
const x = s.find(
|
|
493
|
+
(S) => S.element === m
|
|
488
494
|
);
|
|
489
|
-
x ? v.push(x) : (
|
|
495
|
+
x ? v.push(x) : (d = void 0, v = []);
|
|
490
496
|
} else
|
|
491
497
|
l = !0;
|
|
492
498
|
}
|
|
493
499
|
return c;
|
|
494
500
|
}
|
|
495
|
-
let
|
|
501
|
+
let U = /* @__PURE__ */ new Map();
|
|
496
502
|
const ut = new nt();
|
|
497
503
|
function Vt(e) {
|
|
498
|
-
|
|
504
|
+
U = new Map(U), U.delete(e);
|
|
499
505
|
}
|
|
500
506
|
function ft(e, t) {
|
|
501
|
-
for (const [n] of
|
|
507
|
+
for (const [n] of U)
|
|
502
508
|
if (n.id === e)
|
|
503
509
|
return n;
|
|
504
510
|
}
|
|
505
511
|
function Q(e, t) {
|
|
506
|
-
for (const [n, o] of
|
|
512
|
+
for (const [n, o] of U)
|
|
507
513
|
if (n.id === e)
|
|
508
514
|
return o;
|
|
509
515
|
if (t)
|
|
510
516
|
throw Error(`Could not find data for Group with id ${e}`);
|
|
511
517
|
}
|
|
512
518
|
function ee() {
|
|
513
|
-
return
|
|
519
|
+
return U;
|
|
514
520
|
}
|
|
515
521
|
function Ee(e, t) {
|
|
516
522
|
return ut.addListener("groupChange", (n) => {
|
|
517
523
|
n.group.id === e && t(n);
|
|
518
524
|
});
|
|
519
525
|
}
|
|
520
|
-
function
|
|
521
|
-
const o =
|
|
522
|
-
|
|
526
|
+
function X(e, t, n) {
|
|
527
|
+
const o = U.get(e);
|
|
528
|
+
U = new Map(U), U.set(e, t), ut.emit("groupChange", {
|
|
523
529
|
group: e,
|
|
524
530
|
isUserInteraction: n?.isUserInteraction === !0,
|
|
525
531
|
prev: o,
|
|
@@ -534,11 +540,11 @@ function jt(e, t) {
|
|
|
534
540
|
return !1;
|
|
535
541
|
return !0;
|
|
536
542
|
}
|
|
537
|
-
function
|
|
538
|
-
return Math.abs(
|
|
543
|
+
function T(e, t, n = 0) {
|
|
544
|
+
return Math.abs(F(e) - F(t)) <= n;
|
|
539
545
|
}
|
|
540
546
|
function j(e, t) {
|
|
541
|
-
return
|
|
547
|
+
return T(e, t) ? 0 : e > t ? 1 : -1;
|
|
542
548
|
}
|
|
543
549
|
function se({
|
|
544
550
|
overrideDisabledPanels: e,
|
|
@@ -548,8 +554,8 @@ function se({
|
|
|
548
554
|
}) {
|
|
549
555
|
const {
|
|
550
556
|
collapsedSize: r = 0,
|
|
551
|
-
collapsedThreshold:
|
|
552
|
-
collapsible:
|
|
557
|
+
collapsedThreshold: i,
|
|
558
|
+
collapsible: s,
|
|
553
559
|
disabled: u,
|
|
554
560
|
maxSize: c = 100,
|
|
555
561
|
minSize: a = 0
|
|
@@ -557,12 +563,12 @@ function se({
|
|
|
557
563
|
if (u && !e)
|
|
558
564
|
return n;
|
|
559
565
|
if (j(o, a) < 0)
|
|
560
|
-
if (
|
|
561
|
-
const l =
|
|
562
|
-
j(o, r) <= 0 ||
|
|
566
|
+
if (s) {
|
|
567
|
+
const l = i ?? (a - r) / 2, f = j(n, r) <= 0, y = f ? r + l : a - l, p = j(o, y);
|
|
568
|
+
j(o, r) <= 0 || p < 0 || i !== void 0 && f && p === 0 ? o = r : o = a;
|
|
563
569
|
} else
|
|
564
570
|
o = a;
|
|
565
|
-
return o = Math.min(c, o), o =
|
|
571
|
+
return o = Math.min(c, o), o = F(o), o;
|
|
566
572
|
}
|
|
567
573
|
function de({
|
|
568
574
|
delta: e,
|
|
@@ -570,163 +576,163 @@ function de({
|
|
|
570
576
|
panelConstraints: n,
|
|
571
577
|
pivotIndices: o,
|
|
572
578
|
prevLayout: r,
|
|
573
|
-
trigger:
|
|
579
|
+
trigger: i
|
|
574
580
|
}) {
|
|
575
|
-
if (
|
|
581
|
+
if (T(e, 0))
|
|
576
582
|
return t;
|
|
577
|
-
const
|
|
578
|
-
({ panelId:
|
|
583
|
+
const s = i === "imperative-api", u = n.map(
|
|
584
|
+
({ panelId: g }) => t[g]
|
|
579
585
|
), c = n.map(
|
|
580
|
-
({ panelId:
|
|
586
|
+
({ panelId: g }) => r[g]
|
|
581
587
|
), a = [...u], [l, f] = o;
|
|
582
588
|
L(l != null, "Invalid first pivot index"), L(f != null, "Invalid second pivot index");
|
|
583
589
|
let y = 0;
|
|
584
|
-
switch (
|
|
590
|
+
switch (i) {
|
|
585
591
|
case "keyboard": {
|
|
586
592
|
{
|
|
587
|
-
const
|
|
593
|
+
const g = e < 0 ? f : l, d = n[g];
|
|
588
594
|
L(
|
|
589
|
-
|
|
590
|
-
`Panel constraints not found for index ${
|
|
595
|
+
d,
|
|
596
|
+
`Panel constraints not found for index ${g}`
|
|
591
597
|
);
|
|
592
598
|
const {
|
|
593
599
|
collapsedSize: v = 0,
|
|
594
|
-
collapsible:
|
|
595
|
-
minSize:
|
|
596
|
-
} =
|
|
597
|
-
if (
|
|
598
|
-
const x = u[
|
|
600
|
+
collapsible: h,
|
|
601
|
+
minSize: m = 0
|
|
602
|
+
} = d;
|
|
603
|
+
if (h) {
|
|
604
|
+
const x = u[g];
|
|
599
605
|
if (L(
|
|
600
606
|
x != null,
|
|
601
|
-
`Previous layout not found for panel index ${
|
|
602
|
-
),
|
|
603
|
-
const
|
|
604
|
-
j(
|
|
607
|
+
`Previous layout not found for panel index ${g}`
|
|
608
|
+
), T(x, v)) {
|
|
609
|
+
const S = m - x;
|
|
610
|
+
j(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
605
611
|
}
|
|
606
612
|
}
|
|
607
613
|
}
|
|
608
614
|
{
|
|
609
|
-
const
|
|
615
|
+
const g = e < 0 ? l : f, d = n[g];
|
|
610
616
|
L(
|
|
611
|
-
|
|
612
|
-
`No panel constraints found for index ${
|
|
617
|
+
d,
|
|
618
|
+
`No panel constraints found for index ${g}`
|
|
613
619
|
);
|
|
614
620
|
const {
|
|
615
621
|
collapsedSize: v = 0,
|
|
616
|
-
collapsible:
|
|
617
|
-
minSize:
|
|
618
|
-
} =
|
|
619
|
-
if (
|
|
620
|
-
const x = u[
|
|
622
|
+
collapsible: h,
|
|
623
|
+
minSize: m = 0
|
|
624
|
+
} = d;
|
|
625
|
+
if (h) {
|
|
626
|
+
const x = u[g];
|
|
621
627
|
if (L(
|
|
622
628
|
x != null,
|
|
623
|
-
`Previous layout not found for panel index ${
|
|
624
|
-
),
|
|
625
|
-
const
|
|
626
|
-
j(
|
|
629
|
+
`Previous layout not found for panel index ${g}`
|
|
630
|
+
), T(x, m)) {
|
|
631
|
+
const S = x - v;
|
|
632
|
+
j(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
627
633
|
}
|
|
628
634
|
}
|
|
629
635
|
}
|
|
630
636
|
break;
|
|
631
637
|
}
|
|
632
638
|
default: {
|
|
633
|
-
const
|
|
639
|
+
const g = e < 0 ? f : l, d = n[g];
|
|
634
640
|
L(
|
|
635
|
-
|
|
636
|
-
`Panel constraints not found for index ${
|
|
641
|
+
d,
|
|
642
|
+
`Panel constraints not found for index ${g}`
|
|
637
643
|
);
|
|
638
|
-
const v = u[
|
|
639
|
-
if (x && j(v,
|
|
640
|
-
const
|
|
641
|
-
if (j(
|
|
642
|
-
const w = j(Math.abs(e),
|
|
643
|
-
w > 0 || w === 0 &&
|
|
644
|
+
const v = u[g], { collapsedSize: h, collapsedThreshold: m, collapsible: x, minSize: S } = d;
|
|
645
|
+
if (x && j(v, S) < 0) {
|
|
646
|
+
const P = S - h, C = m ?? P / 2, E = v + Math.abs(e);
|
|
647
|
+
if (j(E, S) < 0) {
|
|
648
|
+
const w = j(Math.abs(e), C), R = m === void 0 && e < 0;
|
|
649
|
+
w > 0 || w === 0 && R ? e = e < 0 ? -P : P : e = 0;
|
|
644
650
|
}
|
|
645
651
|
}
|
|
646
652
|
break;
|
|
647
653
|
}
|
|
648
654
|
}
|
|
649
655
|
{
|
|
650
|
-
const
|
|
651
|
-
let
|
|
656
|
+
const g = e < 0 ? 1 : -1;
|
|
657
|
+
let d = e < 0 ? f : l, v = 0;
|
|
652
658
|
for (; ; ) {
|
|
653
|
-
const
|
|
659
|
+
const m = u[d];
|
|
654
660
|
L(
|
|
655
|
-
|
|
656
|
-
`Previous layout not found for panel index ${
|
|
661
|
+
m != null,
|
|
662
|
+
`Previous layout not found for panel index ${d}`
|
|
657
663
|
);
|
|
658
|
-
const
|
|
659
|
-
overrideDisabledPanels:
|
|
660
|
-
panelConstraints: n[
|
|
661
|
-
prevSize:
|
|
664
|
+
const S = se({
|
|
665
|
+
overrideDisabledPanels: s,
|
|
666
|
+
panelConstraints: n[d],
|
|
667
|
+
prevSize: m,
|
|
662
668
|
size: 100
|
|
663
|
-
}) -
|
|
664
|
-
if (v +=
|
|
669
|
+
}) - m;
|
|
670
|
+
if (v += S, d += g, d < 0 || d >= n.length)
|
|
665
671
|
break;
|
|
666
672
|
}
|
|
667
|
-
const
|
|
668
|
-
e = e < 0 ? 0 -
|
|
673
|
+
const h = Math.min(Math.abs(e), Math.abs(v));
|
|
674
|
+
e = e < 0 ? 0 - h : h;
|
|
669
675
|
}
|
|
670
676
|
{
|
|
671
|
-
let
|
|
672
|
-
for (;
|
|
673
|
-
const v = Math.abs(e) - Math.abs(y),
|
|
677
|
+
let d = e < 0 ? l : f;
|
|
678
|
+
for (; d >= 0 && d < n.length; ) {
|
|
679
|
+
const v = Math.abs(e) - Math.abs(y), h = u[d];
|
|
674
680
|
L(
|
|
675
|
-
|
|
676
|
-
`Previous layout not found for panel index ${
|
|
681
|
+
h != null,
|
|
682
|
+
`Previous layout not found for panel index ${d}`
|
|
677
683
|
);
|
|
678
|
-
const
|
|
679
|
-
overrideDisabledPanels:
|
|
680
|
-
panelConstraints: n[
|
|
681
|
-
prevSize:
|
|
682
|
-
size:
|
|
684
|
+
const m = h - v, x = se({
|
|
685
|
+
overrideDisabledPanels: s,
|
|
686
|
+
panelConstraints: n[d],
|
|
687
|
+
prevSize: h,
|
|
688
|
+
size: m
|
|
683
689
|
});
|
|
684
|
-
if (!
|
|
690
|
+
if (!T(h, x) && (y += h - x, a[d] = x, y.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
685
691
|
numeric: !0
|
|
686
692
|
}) >= 0))
|
|
687
693
|
break;
|
|
688
|
-
e < 0 ?
|
|
694
|
+
e < 0 ? d-- : d++;
|
|
689
695
|
}
|
|
690
696
|
}
|
|
691
697
|
if (jt(c, a))
|
|
692
698
|
return r;
|
|
693
699
|
{
|
|
694
|
-
const
|
|
700
|
+
const g = e < 0 ? f : l, d = u[g];
|
|
695
701
|
L(
|
|
696
|
-
|
|
697
|
-
`Previous layout not found for panel index ${
|
|
702
|
+
d != null,
|
|
703
|
+
`Previous layout not found for panel index ${g}`
|
|
698
704
|
);
|
|
699
|
-
const v =
|
|
700
|
-
overrideDisabledPanels:
|
|
701
|
-
panelConstraints: n[
|
|
702
|
-
prevSize:
|
|
705
|
+
const v = d + y, h = se({
|
|
706
|
+
overrideDisabledPanels: s,
|
|
707
|
+
panelConstraints: n[g],
|
|
708
|
+
prevSize: d,
|
|
703
709
|
size: v
|
|
704
710
|
});
|
|
705
|
-
if (a[
|
|
706
|
-
let
|
|
707
|
-
for (;
|
|
708
|
-
const
|
|
711
|
+
if (a[g] = h, !T(h, v)) {
|
|
712
|
+
let m = v - h, S = e < 0 ? f : l;
|
|
713
|
+
for (; S >= 0 && S < n.length; ) {
|
|
714
|
+
const P = a[S];
|
|
709
715
|
L(
|
|
710
|
-
|
|
711
|
-
`Previous layout not found for panel index ${
|
|
716
|
+
P != null,
|
|
717
|
+
`Previous layout not found for panel index ${S}`
|
|
712
718
|
);
|
|
713
|
-
const
|
|
714
|
-
overrideDisabledPanels:
|
|
715
|
-
panelConstraints: n[
|
|
716
|
-
prevSize:
|
|
717
|
-
size:
|
|
719
|
+
const C = P + m, E = se({
|
|
720
|
+
overrideDisabledPanels: s,
|
|
721
|
+
panelConstraints: n[S],
|
|
722
|
+
prevSize: P,
|
|
723
|
+
size: C
|
|
718
724
|
});
|
|
719
|
-
if (
|
|
725
|
+
if (T(P, E) || (m -= E - P, a[S] = E), T(m, 0))
|
|
720
726
|
break;
|
|
721
|
-
e > 0 ?
|
|
727
|
+
e > 0 ? S-- : S++;
|
|
722
728
|
}
|
|
723
729
|
}
|
|
724
730
|
}
|
|
725
|
-
const
|
|
726
|
-
(
|
|
731
|
+
const p = Object.values(a).reduce(
|
|
732
|
+
(g, d) => d + g,
|
|
727
733
|
0
|
|
728
734
|
);
|
|
729
|
-
return
|
|
735
|
+
return T(p, 100, 0.1) ? a.reduce((g, d, v) => (g[n[v].panelId] = d, g), {}) : r;
|
|
730
736
|
}
|
|
731
737
|
function K(e, t) {
|
|
732
738
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -742,78 +748,80 @@ function Ie({
|
|
|
742
748
|
event: n,
|
|
743
749
|
hitRegions: o,
|
|
744
750
|
initialLayoutMap: r,
|
|
745
|
-
mountedGroups:
|
|
746
|
-
pointerDownAtPoint:
|
|
751
|
+
mountedGroups: i,
|
|
752
|
+
pointerDownAtPoint: s,
|
|
747
753
|
prevCursorFlags: u
|
|
748
754
|
}) {
|
|
749
755
|
let c = 0;
|
|
750
|
-
const a =
|
|
756
|
+
const a = q();
|
|
751
757
|
let l = a.state === "active" ? a.previews : [];
|
|
752
758
|
const f = new Map(
|
|
753
759
|
a.state === "active" ? a.previewLayoutMap : void 0
|
|
754
760
|
);
|
|
755
|
-
o.forEach((
|
|
756
|
-
const { group:
|
|
757
|
-
if (e &&
|
|
761
|
+
o.forEach((g) => {
|
|
762
|
+
const { group: d, groupSize: v } = g, { orientation: h, panels: m } = d;
|
|
763
|
+
if (e && d.resizePreviewMode !== "separator")
|
|
758
764
|
return;
|
|
759
|
-
const { disableCursor:
|
|
760
|
-
let
|
|
761
|
-
|
|
762
|
-
const
|
|
763
|
-
if (!
|
|
765
|
+
const { disableCursor: x } = d.mutableState;
|
|
766
|
+
let S = 0;
|
|
767
|
+
s ? h === "horizontal" ? S = (n.clientX - s.x) / v * 100 : S = (n.clientY - s.y) / v * 100 : h === "horizontal" ? S = n.clientX < 0 ? -100 : 100 : S = n.clientY < 0 ? -100 : 100;
|
|
768
|
+
const P = r.get(d), C = i.get(d);
|
|
769
|
+
if (!P || !C)
|
|
764
770
|
return;
|
|
765
771
|
const {
|
|
766
772
|
defaultLayoutDeferred: E,
|
|
767
|
-
derivedPanelConstraints:
|
|
768
|
-
groupSize:
|
|
769
|
-
layout:
|
|
770
|
-
separatorToPanels:
|
|
771
|
-
} =
|
|
772
|
-
if (
|
|
773
|
-
const I =
|
|
774
|
-
delta:
|
|
775
|
-
initialLayout:
|
|
776
|
-
panelConstraints:
|
|
777
|
-
pivotIndices:
|
|
773
|
+
derivedPanelConstraints: w,
|
|
774
|
+
groupSize: R,
|
|
775
|
+
layout: N,
|
|
776
|
+
separatorToPanels: O
|
|
777
|
+
} = C;
|
|
778
|
+
if (w && N && O) {
|
|
779
|
+
const I = d.resizePreviewMode === "separator" ? f.get(d) ?? N : N, G = de({
|
|
780
|
+
delta: S,
|
|
781
|
+
initialLayout: P,
|
|
782
|
+
panelConstraints: w,
|
|
783
|
+
pivotIndices: g.panels.map((_) => m.indexOf(_)),
|
|
778
784
|
prevLayout: I,
|
|
779
785
|
trigger: "mouse-or-touch"
|
|
780
786
|
});
|
|
781
|
-
if (
|
|
782
|
-
f.set(
|
|
783
|
-
let
|
|
784
|
-
const
|
|
785
|
-
l = l.map((
|
|
786
|
-
if (
|
|
787
|
-
return
|
|
788
|
-
const
|
|
789
|
-
return
|
|
787
|
+
if (d.resizePreviewMode === "separator" && !e && !K(G, I)) {
|
|
788
|
+
f.set(d, G);
|
|
789
|
+
let _ = 0;
|
|
790
|
+
const b = m.map((z) => (_ += G[z.id] - P[z.id], _ * (v / 100)));
|
|
791
|
+
l = l.map((z) => {
|
|
792
|
+
if (z.group !== d)
|
|
793
|
+
return z;
|
|
794
|
+
const M = b[z.panelIndex];
|
|
795
|
+
return M === z.offset ? z : { ...z, offset: M };
|
|
790
796
|
});
|
|
791
797
|
}
|
|
792
|
-
if (K(
|
|
793
|
-
switch (
|
|
798
|
+
if (K(G, I) && S !== 0 && !x)
|
|
799
|
+
switch (h) {
|
|
794
800
|
case "horizontal": {
|
|
795
|
-
c |=
|
|
801
|
+
c |= S < 0 ? rt : it;
|
|
796
802
|
break;
|
|
797
803
|
}
|
|
798
804
|
case "vertical": {
|
|
799
|
-
c |=
|
|
805
|
+
c |= S < 0 ? st : at;
|
|
800
806
|
break;
|
|
801
807
|
}
|
|
802
808
|
}
|
|
803
|
-
(
|
|
809
|
+
(d.resizePreviewMode !== "separator" || e) && !K(G, N) && X(g.group, {
|
|
804
810
|
defaultLayoutDeferred: E,
|
|
805
|
-
derivedPanelConstraints:
|
|
806
|
-
groupSize:
|
|
807
|
-
layout:
|
|
808
|
-
separatorToPanels:
|
|
811
|
+
derivedPanelConstraints: w,
|
|
812
|
+
groupSize: R,
|
|
813
|
+
layout: G,
|
|
814
|
+
separatorToPanels: O
|
|
809
815
|
});
|
|
810
816
|
}
|
|
811
817
|
});
|
|
812
818
|
let y = 0;
|
|
813
|
-
n.movementX === 0 ? y |= u &
|
|
819
|
+
n.movementX === 0 ? y |= u & Ae : y |= c & Ae, n.movementY === 0 ? y |= u & Fe : y |= c & Fe;
|
|
820
|
+
const p = a.state === "active" && (n.clientX !== a.pointerDownAtPoint.x || n.clientY !== a.pointerDownAtPoint.y);
|
|
821
|
+
Tt(y, l, f, p), fe(t);
|
|
814
822
|
}
|
|
815
823
|
function dt(e, t) {
|
|
816
|
-
const n =
|
|
824
|
+
const n = q(), o = ee();
|
|
817
825
|
let r = !1;
|
|
818
826
|
switch (n.state) {
|
|
819
827
|
case "active":
|
|
@@ -829,11 +837,11 @@ function dt(e, t) {
|
|
|
829
837
|
}), W({
|
|
830
838
|
cursorFlags: 0,
|
|
831
839
|
state: "inactive"
|
|
832
|
-
}), n.hitRegions.length > 0 && (fe(e), r = !0, n.hitRegions.forEach((
|
|
833
|
-
if (!o.has(
|
|
840
|
+
}), n.hitRegions.length > 0 && (fe(e), r = !0, n.hitRegions.forEach((i) => {
|
|
841
|
+
if (!o.has(i.group))
|
|
834
842
|
return;
|
|
835
|
-
const
|
|
836
|
-
|
|
843
|
+
const s = Q(i.group.id, !0);
|
|
844
|
+
X(i.group, s, {
|
|
837
845
|
isUserInteraction: !0
|
|
838
846
|
});
|
|
839
847
|
}));
|
|
@@ -843,20 +851,20 @@ function dt(e, t) {
|
|
|
843
851
|
function He(e) {
|
|
844
852
|
e.defaultPrevented || dt(e.currentTarget, e);
|
|
845
853
|
}
|
|
846
|
-
function
|
|
854
|
+
function Ut(e, t, n) {
|
|
847
855
|
let o, r = {
|
|
848
856
|
x: 1 / 0,
|
|
849
857
|
y: 1 / 0
|
|
850
858
|
};
|
|
851
|
-
for (const
|
|
852
|
-
const
|
|
859
|
+
for (const i of t) {
|
|
860
|
+
const s = ct(n, i.rect);
|
|
853
861
|
switch (e) {
|
|
854
862
|
case "horizontal": {
|
|
855
|
-
|
|
863
|
+
s.x <= r.x && (o = i, r = s);
|
|
856
864
|
break;
|
|
857
865
|
}
|
|
858
866
|
case "vertical": {
|
|
859
|
-
|
|
867
|
+
s.y <= r.y && (o = i, r = s);
|
|
860
868
|
break;
|
|
861
869
|
}
|
|
862
870
|
}
|
|
@@ -866,14 +874,14 @@ function Bt(e, t, n) {
|
|
|
866
874
|
hitRegion: o
|
|
867
875
|
} : void 0;
|
|
868
876
|
}
|
|
869
|
-
function
|
|
877
|
+
function Bt(e) {
|
|
870
878
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
871
879
|
}
|
|
872
880
|
function Wt(e, t) {
|
|
873
881
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
874
882
|
const n = {
|
|
875
|
-
a:
|
|
876
|
-
b:
|
|
883
|
+
a: Ue(e),
|
|
884
|
+
b: Ue(t)
|
|
877
885
|
};
|
|
878
886
|
let o;
|
|
879
887
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
@@ -887,40 +895,40 @@ function Wt(e, t) {
|
|
|
887
895
|
b: je(Ve(n.b))
|
|
888
896
|
};
|
|
889
897
|
if (r.a === r.b) {
|
|
890
|
-
const
|
|
898
|
+
const i = o.childNodes, s = {
|
|
891
899
|
a: n.a.at(-1),
|
|
892
900
|
b: n.b.at(-1)
|
|
893
901
|
};
|
|
894
|
-
let u =
|
|
902
|
+
let u = i.length;
|
|
895
903
|
for (; u--; ) {
|
|
896
|
-
const c =
|
|
897
|
-
if (c ===
|
|
898
|
-
if (c ===
|
|
904
|
+
const c = i[u];
|
|
905
|
+
if (c === s.a) return 1;
|
|
906
|
+
if (c === s.b) return -1;
|
|
899
907
|
}
|
|
900
908
|
}
|
|
901
909
|
return Math.sign(r.a - r.b);
|
|
902
910
|
}
|
|
903
911
|
const Kt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
904
|
-
function
|
|
912
|
+
function Xt(e) {
|
|
905
913
|
const t = getComputedStyle(pt(e) ?? e).display;
|
|
906
914
|
return t === "flex" || t === "inline-flex";
|
|
907
915
|
}
|
|
908
|
-
function
|
|
916
|
+
function qt(e) {
|
|
909
917
|
const t = getComputedStyle(e);
|
|
910
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
918
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || Xt(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || Kt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
911
919
|
}
|
|
912
920
|
function Ve(e) {
|
|
913
921
|
let t = e.length;
|
|
914
922
|
for (; t--; ) {
|
|
915
923
|
const n = e[t];
|
|
916
|
-
if (L(n, "Missing node"),
|
|
924
|
+
if (L(n, "Missing node"), qt(n)) return n;
|
|
917
925
|
}
|
|
918
926
|
return null;
|
|
919
927
|
}
|
|
920
928
|
function je(e) {
|
|
921
929
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
922
930
|
}
|
|
923
|
-
function
|
|
931
|
+
function Ue(e) {
|
|
924
932
|
const t = [];
|
|
925
933
|
for (; e; )
|
|
926
934
|
t.push(e), e = pt(e);
|
|
@@ -928,7 +936,7 @@ function Be(e) {
|
|
|
928
936
|
}
|
|
929
937
|
function pt(e) {
|
|
930
938
|
const { parentNode: t } = e;
|
|
931
|
-
return
|
|
939
|
+
return Bt(t) ? t.host : t;
|
|
932
940
|
}
|
|
933
941
|
function Yt(e, t) {
|
|
934
942
|
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;
|
|
@@ -957,64 +965,64 @@ function ke(e, t) {
|
|
|
957
965
|
return t.forEach((o, r) => {
|
|
958
966
|
if (r.disabled)
|
|
959
967
|
return;
|
|
960
|
-
const
|
|
968
|
+
const i = Me({ group: r }), s = Ut(r.orientation, i, {
|
|
961
969
|
x: e.clientX,
|
|
962
970
|
y: e.clientY
|
|
963
971
|
});
|
|
964
|
-
|
|
972
|
+
s && s.distance.x <= 0 && s.distance.y <= 0 && Jt({
|
|
965
973
|
groupElement: r.element,
|
|
966
|
-
hitRegion:
|
|
974
|
+
hitRegion: s.hitRegion.rect,
|
|
967
975
|
pointerEventTarget: e.target
|
|
968
|
-
}) && n.push(
|
|
976
|
+
}) && n.push(s.hitRegion);
|
|
969
977
|
}), n;
|
|
970
978
|
}
|
|
971
979
|
function ne({
|
|
972
980
|
layout: e,
|
|
973
981
|
panelConstraints: t
|
|
974
982
|
}) {
|
|
975
|
-
const n = t.map(({ panelId:
|
|
976
|
-
(
|
|
983
|
+
const n = t.map(({ panelId: s }) => e[s]), o = [...n], r = o.reduce(
|
|
984
|
+
(s, u) => s + u,
|
|
977
985
|
0
|
|
978
986
|
);
|
|
979
987
|
if (Object.keys(e).length !== t.length)
|
|
980
988
|
throw Error(
|
|
981
|
-
`Invalid ${t.length} panel layout: ${Object.values(e).map((
|
|
989
|
+
`Invalid ${t.length} panel layout: ${Object.values(e).map((s) => `${s}%`).join(", ")}`
|
|
982
990
|
);
|
|
983
|
-
if (!
|
|
984
|
-
for (let
|
|
985
|
-
const u = o[
|
|
986
|
-
L(u != null, `No layout data found for index ${
|
|
991
|
+
if (!T(r, 100) && o.length > 0)
|
|
992
|
+
for (let s = 0; s < t.length; s++) {
|
|
993
|
+
const u = o[s];
|
|
994
|
+
L(u != null, `No layout data found for index ${s}`);
|
|
987
995
|
const c = 100 / r * u;
|
|
988
|
-
o[
|
|
996
|
+
o[s] = c;
|
|
989
997
|
}
|
|
990
|
-
let
|
|
991
|
-
for (let
|
|
992
|
-
const u = n[
|
|
993
|
-
L(u != null, `No layout data found for index ${
|
|
994
|
-
const c = o[
|
|
995
|
-
L(c != null, `No layout data found for index ${
|
|
998
|
+
let i = 0;
|
|
999
|
+
for (let s = 0; s < t.length; s++) {
|
|
1000
|
+
const u = n[s];
|
|
1001
|
+
L(u != null, `No layout data found for index ${s}`);
|
|
1002
|
+
const c = o[s];
|
|
1003
|
+
L(c != null, `No layout data found for index ${s}`);
|
|
996
1004
|
const a = se({
|
|
997
1005
|
overrideDisabledPanels: !0,
|
|
998
|
-
panelConstraints: t[
|
|
1006
|
+
panelConstraints: t[s],
|
|
999
1007
|
prevSize: u,
|
|
1000
1008
|
size: c
|
|
1001
1009
|
});
|
|
1002
|
-
c != a && (
|
|
1010
|
+
c != a && (i += c - a, o[s] = a);
|
|
1003
1011
|
}
|
|
1004
|
-
if (!
|
|
1005
|
-
for (let
|
|
1006
|
-
const u = o[
|
|
1007
|
-
L(u != null, `No layout data found for index ${
|
|
1008
|
-
const c = u +
|
|
1012
|
+
if (!T(i, 0))
|
|
1013
|
+
for (let s = 0; s < t.length; s++) {
|
|
1014
|
+
const u = o[s];
|
|
1015
|
+
L(u != null, `No layout data found for index ${s}`);
|
|
1016
|
+
const c = u + i, a = se({
|
|
1009
1017
|
overrideDisabledPanels: !0,
|
|
1010
|
-
panelConstraints: t[
|
|
1018
|
+
panelConstraints: t[s],
|
|
1011
1019
|
prevSize: u,
|
|
1012
1020
|
size: c
|
|
1013
1021
|
});
|
|
1014
|
-
if (u !== a && (
|
|
1022
|
+
if (u !== a && (i -= a - u, o[s] = a, T(i, 0)))
|
|
1015
1023
|
break;
|
|
1016
1024
|
}
|
|
1017
|
-
return o.reduce((
|
|
1025
|
+
return o.reduce((s, u, c) => (s[t[c].panelId] = u, s), {});
|
|
1018
1026
|
}
|
|
1019
1027
|
function ht({
|
|
1020
1028
|
groupId: e,
|
|
@@ -1028,8 +1036,8 @@ function ht({
|
|
|
1028
1036
|
defaultLayoutDeferred: l,
|
|
1029
1037
|
derivedPanelConstraints: f,
|
|
1030
1038
|
layout: y,
|
|
1031
|
-
groupSize:
|
|
1032
|
-
separatorToPanels:
|
|
1039
|
+
groupSize: p,
|
|
1040
|
+
separatorToPanels: g
|
|
1033
1041
|
}
|
|
1034
1042
|
] of c)
|
|
1035
1043
|
if (a.id === e)
|
|
@@ -1037,9 +1045,9 @@ function ht({
|
|
|
1037
1045
|
defaultLayoutDeferred: l,
|
|
1038
1046
|
derivedPanelConstraints: f,
|
|
1039
1047
|
group: a,
|
|
1040
|
-
groupSize:
|
|
1048
|
+
groupSize: p,
|
|
1041
1049
|
layout: y,
|
|
1042
|
-
separatorToPanels:
|
|
1050
|
+
separatorToPanels: g
|
|
1043
1051
|
};
|
|
1044
1052
|
throw Error(`Group ${e} not found`);
|
|
1045
1053
|
}, o = () => {
|
|
@@ -1054,112 +1062,112 @@ function ht({
|
|
|
1054
1062
|
if (c !== void 0)
|
|
1055
1063
|
return c;
|
|
1056
1064
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1057
|
-
},
|
|
1065
|
+
}, i = () => {
|
|
1058
1066
|
const c = n().layout[t];
|
|
1059
1067
|
if (c !== void 0)
|
|
1060
1068
|
return c;
|
|
1061
1069
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1062
|
-
},
|
|
1070
|
+
}, s = ({
|
|
1063
1071
|
nextSize: c,
|
|
1064
1072
|
panels: a,
|
|
1065
1073
|
prevLayout: l,
|
|
1066
1074
|
derivedPanelConstraints: f
|
|
1067
1075
|
}) => {
|
|
1068
|
-
const y =
|
|
1069
|
-
if (
|
|
1070
|
-
const x = f[
|
|
1071
|
-
return x?.collapsible &&
|
|
1076
|
+
const y = i(), p = a.findIndex((h) => h.id === t), g = p === 0, d = p === a.length - 1;
|
|
1077
|
+
if (d && c < y && (g || a.slice(0, p).every((h, m) => {
|
|
1078
|
+
const x = f[m];
|
|
1079
|
+
return x?.collapsible && T(x.collapsedSize, l[x.panelId]);
|
|
1072
1080
|
}))) {
|
|
1073
|
-
const
|
|
1081
|
+
const h = a.slice(0, p).reduce((m, x) => m + l[x.id], 0);
|
|
1074
1082
|
return {
|
|
1075
1083
|
...l,
|
|
1076
|
-
[t]:
|
|
1084
|
+
[t]: F(100 - h)
|
|
1077
1085
|
};
|
|
1078
1086
|
}
|
|
1079
1087
|
return de({
|
|
1080
|
-
delta:
|
|
1088
|
+
delta: d ? y - c : c - y,
|
|
1081
1089
|
initialLayout: l,
|
|
1082
1090
|
panelConstraints: f,
|
|
1083
|
-
pivotIndices:
|
|
1091
|
+
pivotIndices: d ? [p - 1, p] : [p, p + 1],
|
|
1084
1092
|
prevLayout: l,
|
|
1085
1093
|
trigger: "imperative-api"
|
|
1086
1094
|
});
|
|
1087
1095
|
}, u = (c) => {
|
|
1088
|
-
const a =
|
|
1096
|
+
const a = i();
|
|
1089
1097
|
if (c === a)
|
|
1090
1098
|
return;
|
|
1091
1099
|
const {
|
|
1092
1100
|
defaultLayoutDeferred: l,
|
|
1093
1101
|
derivedPanelConstraints: f,
|
|
1094
1102
|
group: y,
|
|
1095
|
-
groupSize:
|
|
1096
|
-
layout:
|
|
1097
|
-
separatorToPanels:
|
|
1098
|
-
} = n(), v =
|
|
1103
|
+
groupSize: p,
|
|
1104
|
+
layout: g,
|
|
1105
|
+
separatorToPanels: d
|
|
1106
|
+
} = n(), v = s({
|
|
1099
1107
|
nextSize: c,
|
|
1100
1108
|
panels: y.panels,
|
|
1101
|
-
prevLayout:
|
|
1109
|
+
prevLayout: g,
|
|
1102
1110
|
derivedPanelConstraints: f
|
|
1103
|
-
}),
|
|
1111
|
+
}), h = ne({
|
|
1104
1112
|
layout: v,
|
|
1105
1113
|
panelConstraints: f
|
|
1106
1114
|
});
|
|
1107
|
-
K(
|
|
1115
|
+
K(g, h) || X(y, {
|
|
1108
1116
|
defaultLayoutDeferred: l,
|
|
1109
1117
|
derivedPanelConstraints: f,
|
|
1110
|
-
groupSize:
|
|
1111
|
-
layout:
|
|
1112
|
-
separatorToPanels:
|
|
1118
|
+
groupSize: p,
|
|
1119
|
+
layout: h,
|
|
1120
|
+
separatorToPanels: d
|
|
1113
1121
|
});
|
|
1114
1122
|
};
|
|
1115
1123
|
return {
|
|
1116
1124
|
collapse: () => {
|
|
1117
|
-
const { collapsible: c, collapsedSize: a } = o(), { mutableValues: l } = r(), f =
|
|
1125
|
+
const { collapsible: c, collapsedSize: a } = o(), { mutableValues: l } = r(), f = i();
|
|
1118
1126
|
c && f !== a && (l.expandToSize = f, u(a));
|
|
1119
1127
|
},
|
|
1120
1128
|
expand: () => {
|
|
1121
|
-
const { collapsible: c, collapsedSize: a, minSize: l } = o(), { mutableValues: f } = r(), y =
|
|
1129
|
+
const { collapsible: c, collapsedSize: a, minSize: l } = o(), { mutableValues: f } = r(), y = i();
|
|
1122
1130
|
if (c && y === a) {
|
|
1123
|
-
let
|
|
1124
|
-
|
|
1131
|
+
let p = f.expandToSize ?? l;
|
|
1132
|
+
p === 0 && (p = 1), u(p);
|
|
1125
1133
|
}
|
|
1126
1134
|
},
|
|
1127
1135
|
getSize: () => {
|
|
1128
|
-
const { group: c } = n(), a =
|
|
1136
|
+
const { group: c } = n(), a = i(), { element: l } = r(), f = c.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
|
|
1129
1137
|
return {
|
|
1130
1138
|
asPercentage: a,
|
|
1131
1139
|
inPixels: f
|
|
1132
1140
|
};
|
|
1133
1141
|
},
|
|
1134
1142
|
isCollapsed: () => {
|
|
1135
|
-
const { collapsible: c, collapsedSize: a } = o(), l =
|
|
1136
|
-
return c &&
|
|
1143
|
+
const { collapsible: c, collapsedSize: a } = o(), l = i();
|
|
1144
|
+
return c && T(a, l);
|
|
1137
1145
|
},
|
|
1138
1146
|
resize: (c) => {
|
|
1139
1147
|
const { group: a } = n(), { element: l } = r(), f = ae({ group: a }), y = ie({
|
|
1140
1148
|
groupSize: f,
|
|
1141
1149
|
panelElement: l,
|
|
1142
1150
|
styleProp: c
|
|
1143
|
-
}),
|
|
1144
|
-
u(
|
|
1151
|
+
}), p = F(y / f * 100);
|
|
1152
|
+
u(p);
|
|
1145
1153
|
}
|
|
1146
1154
|
};
|
|
1147
1155
|
}
|
|
1148
|
-
function
|
|
1156
|
+
function Be(e) {
|
|
1149
1157
|
if (e.defaultPrevented)
|
|
1150
1158
|
return;
|
|
1151
1159
|
const t = ee();
|
|
1152
1160
|
ke(e, t).forEach((o) => {
|
|
1153
1161
|
if (o.separator && !o.separator.disableDoubleClick) {
|
|
1154
1162
|
const r = o.panels.find(
|
|
1155
|
-
(
|
|
1163
|
+
(i) => i.panelConstraints.defaultSize !== void 0
|
|
1156
1164
|
);
|
|
1157
1165
|
if (r) {
|
|
1158
|
-
const
|
|
1166
|
+
const i = r.panelConstraints.defaultSize, s = ht({
|
|
1159
1167
|
groupId: o.group.id,
|
|
1160
1168
|
panelId: r.id
|
|
1161
1169
|
});
|
|
1162
|
-
|
|
1170
|
+
s && i !== void 0 && (s.resize(i), e.preventDefault());
|
|
1163
1171
|
}
|
|
1164
1172
|
}
|
|
1165
1173
|
});
|
|
@@ -1192,18 +1200,18 @@ function mt({
|
|
|
1192
1200
|
const {
|
|
1193
1201
|
defaultLayoutDeferred: o,
|
|
1194
1202
|
derivedPanelConstraints: r,
|
|
1195
|
-
group:
|
|
1196
|
-
groupSize:
|
|
1203
|
+
group: i,
|
|
1204
|
+
groupSize: s,
|
|
1197
1205
|
layout: u,
|
|
1198
1206
|
separatorToPanels: c
|
|
1199
1207
|
} = t(), a = ne({
|
|
1200
1208
|
layout: n,
|
|
1201
1209
|
panelConstraints: r
|
|
1202
1210
|
});
|
|
1203
|
-
return o ? u : (K(u, a) ||
|
|
1211
|
+
return o ? u : (K(u, a) || X(i, {
|
|
1204
1212
|
defaultLayoutDeferred: o,
|
|
1205
1213
|
derivedPanelConstraints: r,
|
|
1206
|
-
groupSize:
|
|
1214
|
+
groupSize: s,
|
|
1207
1215
|
layout: a,
|
|
1208
1216
|
separatorToPanels: c
|
|
1209
1217
|
}), a);
|
|
@@ -1215,20 +1223,20 @@ function te(e, t) {
|
|
|
1215
1223
|
(f) => f.element === e
|
|
1216
1224
|
);
|
|
1217
1225
|
L(r, "Matching separator not found");
|
|
1218
|
-
const
|
|
1219
|
-
L(
|
|
1220
|
-
const
|
|
1226
|
+
const i = o.separatorToPanels.get(r);
|
|
1227
|
+
L(i, "Matching panels not found");
|
|
1228
|
+
const s = i.map((f) => n.panels.indexOf(f)), c = mt({ groupId: n.id }).getLayout(), a = de({
|
|
1221
1229
|
delta: t,
|
|
1222
1230
|
initialLayout: c,
|
|
1223
1231
|
panelConstraints: o.derivedPanelConstraints,
|
|
1224
|
-
pivotIndices:
|
|
1232
|
+
pivotIndices: s,
|
|
1225
1233
|
prevLayout: c,
|
|
1226
1234
|
trigger: "keyboard"
|
|
1227
1235
|
}), l = ne({
|
|
1228
1236
|
layout: a,
|
|
1229
1237
|
panelConstraints: o.derivedPanelConstraints
|
|
1230
1238
|
});
|
|
1231
|
-
K(c, l) ||
|
|
1239
|
+
K(c, l) || X(
|
|
1232
1240
|
n,
|
|
1233
1241
|
{
|
|
1234
1242
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
@@ -1274,31 +1282,31 @@ function We(e) {
|
|
|
1274
1282
|
}
|
|
1275
1283
|
case "Enter": {
|
|
1276
1284
|
e.preventDefault();
|
|
1277
|
-
const r = ye(t),
|
|
1278
|
-
(
|
|
1285
|
+
const r = ye(t), i = Q(r.id, !0), { derivedPanelConstraints: s, layout: u, separatorToPanels: c } = i, a = r.separators.find(
|
|
1286
|
+
(p) => p.element === t
|
|
1279
1287
|
);
|
|
1280
1288
|
L(a, "Matching separator not found");
|
|
1281
1289
|
const l = c.get(a);
|
|
1282
1290
|
L(l, "Matching panels not found");
|
|
1283
|
-
const f = l[0], y =
|
|
1284
|
-
(
|
|
1291
|
+
const f = l[0], y = s.find(
|
|
1292
|
+
(p) => p.panelId === f.id
|
|
1285
1293
|
);
|
|
1286
1294
|
if (L(y, "Panel metadata not found"), y.collapsible) {
|
|
1287
|
-
const
|
|
1288
|
-
te(t,
|
|
1295
|
+
const p = u[f.id], g = y.collapsedSize === p ? r.mutableState.expandedPanelSizes[f.id] ?? y.minSize : y.collapsedSize;
|
|
1296
|
+
te(t, g - p);
|
|
1289
1297
|
}
|
|
1290
1298
|
break;
|
|
1291
1299
|
}
|
|
1292
1300
|
case "F6": {
|
|
1293
1301
|
e.preventDefault();
|
|
1294
|
-
const
|
|
1302
|
+
const i = ye(t).separators.map(
|
|
1295
1303
|
(a) => a.element
|
|
1296
|
-
),
|
|
1304
|
+
), s = Array.from(i).findIndex(
|
|
1297
1305
|
(a) => a === e.currentTarget
|
|
1298
1306
|
);
|
|
1299
|
-
L(
|
|
1300
|
-
const u = e.shiftKey ?
|
|
1301
|
-
|
|
1307
|
+
L(s !== null, "Index not found");
|
|
1308
|
+
const u = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
|
|
1309
|
+
i[u].focus({
|
|
1302
1310
|
preventScroll: !0
|
|
1303
1311
|
});
|
|
1304
1312
|
break;
|
|
@@ -1310,32 +1318,32 @@ function We(e) {
|
|
|
1310
1318
|
}
|
|
1311
1319
|
}
|
|
1312
1320
|
function Zt(e, t) {
|
|
1313
|
-
const { element: n, orientation: o, panels: r } = e,
|
|
1321
|
+
const { element: n, orientation: o, panels: r } = e, i = n.getBoundingClientRect(), s = o === "horizontal";
|
|
1314
1322
|
return Me({
|
|
1315
1323
|
expandHitTargets: !1,
|
|
1316
1324
|
group: e,
|
|
1317
1325
|
includeDisabled: !0
|
|
1318
1326
|
}).map(
|
|
1319
1327
|
({ panels: c, rect: a, separator: l }, f) => {
|
|
1320
|
-
const y = r.indexOf(c[0]),
|
|
1328
|
+
const y = r.indexOf(c[0]), p = s ? a.left + a.width / 2 : a.top + a.height / 2;
|
|
1321
1329
|
return {
|
|
1322
|
-
active: t.some((
|
|
1323
|
-
if (
|
|
1330
|
+
active: t.some((d) => {
|
|
1331
|
+
if (d.group !== e || d.panels[0] !== c[0])
|
|
1324
1332
|
return !1;
|
|
1325
|
-
if (l ||
|
|
1326
|
-
return
|
|
1327
|
-
const v =
|
|
1328
|
-
return
|
|
1333
|
+
if (l || d.separator)
|
|
1334
|
+
return d.separator === l;
|
|
1335
|
+
const v = s ? d.rect.left + d.rect.width / 2 : d.rect.top + d.rect.height / 2;
|
|
1336
|
+
return T(p, v);
|
|
1329
1337
|
}),
|
|
1330
1338
|
group: e,
|
|
1331
1339
|
key: l ? `separator-${l.id}` : `panel-${c[0].id}-${f}`,
|
|
1332
1340
|
offset: 0,
|
|
1333
1341
|
panelIndex: y,
|
|
1334
1342
|
rect: new DOMRect(
|
|
1335
|
-
(
|
|
1336
|
-
(!
|
|
1337
|
-
|
|
1338
|
-
!
|
|
1343
|
+
(s && !l ? p : a.left) - i.left - n.clientLeft + n.scrollLeft,
|
|
1344
|
+
(!s && !l ? p : a.top) - i.top - n.clientTop + n.scrollTop,
|
|
1345
|
+
s && !l ? 0 : a.width,
|
|
1346
|
+
!s && !l ? 0 : a.height
|
|
1339
1347
|
),
|
|
1340
1348
|
separator: l
|
|
1341
1349
|
};
|
|
@@ -1352,30 +1360,31 @@ function Ke(e) {
|
|
|
1352
1360
|
return;
|
|
1353
1361
|
const o = /* @__PURE__ */ new Map();
|
|
1354
1362
|
let r = !1;
|
|
1355
|
-
n.forEach((
|
|
1356
|
-
|
|
1363
|
+
n.forEach((s) => {
|
|
1364
|
+
s.separator && (r || (r = !0, s.separator.element.focus({
|
|
1357
1365
|
// @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility
|
|
1358
1366
|
focusVisible: !1,
|
|
1359
1367
|
preventScroll: !0
|
|
1360
1368
|
})));
|
|
1361
|
-
const u = t.get(
|
|
1362
|
-
u && o.set(
|
|
1369
|
+
const u = t.get(s.group);
|
|
1370
|
+
u && o.set(s.group, u.layout);
|
|
1363
1371
|
});
|
|
1364
|
-
const
|
|
1365
|
-
(
|
|
1372
|
+
const i = Array.from(o.keys()).flatMap(
|
|
1373
|
+
(s) => s.resizePreviewMode === "separator" ? Zt(s, n) : []
|
|
1366
1374
|
);
|
|
1367
1375
|
W({
|
|
1368
1376
|
cursorFlags: 0,
|
|
1377
|
+
didPointerMove: !1,
|
|
1369
1378
|
hitRegions: n,
|
|
1370
1379
|
initialLayoutMap: o,
|
|
1371
1380
|
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
1372
1381
|
previewLayoutMap: new Map(o),
|
|
1373
|
-
previews:
|
|
1382
|
+
previews: i,
|
|
1374
1383
|
state: "active"
|
|
1375
1384
|
}), e.preventDefault();
|
|
1376
1385
|
}
|
|
1377
|
-
function
|
|
1378
|
-
const t = ee(), n =
|
|
1386
|
+
function Xe(e) {
|
|
1387
|
+
const t = ee(), n = q();
|
|
1379
1388
|
switch (n.state) {
|
|
1380
1389
|
case "active":
|
|
1381
1390
|
Ie({
|
|
@@ -1389,10 +1398,10 @@ function qe(e) {
|
|
|
1389
1398
|
});
|
|
1390
1399
|
}
|
|
1391
1400
|
}
|
|
1392
|
-
function
|
|
1401
|
+
function qe(e) {
|
|
1393
1402
|
if (e.defaultPrevented)
|
|
1394
1403
|
return;
|
|
1395
|
-
const t =
|
|
1404
|
+
const t = q(), n = ee();
|
|
1396
1405
|
switch (t.state) {
|
|
1397
1406
|
case "active": {
|
|
1398
1407
|
if (
|
|
@@ -1400,8 +1409,8 @@ function Xe(e) {
|
|
|
1400
1409
|
e.buttons === 0
|
|
1401
1410
|
) {
|
|
1402
1411
|
t.previewLayoutMap.forEach((o, r) => {
|
|
1403
|
-
const
|
|
1404
|
-
r.resizePreviewMode === "separator" &&
|
|
1412
|
+
const i = n.get(r);
|
|
1413
|
+
r.resizePreviewMode === "separator" && i && !K(o, i.layout) && X(r, { ...i, layout: o });
|
|
1405
1414
|
}), W({
|
|
1406
1415
|
cursorFlags: 0,
|
|
1407
1416
|
state: "inactive"
|
|
@@ -1409,7 +1418,7 @@ function Xe(e) {
|
|
|
1409
1418
|
if (!n.has(o.group))
|
|
1410
1419
|
return;
|
|
1411
1420
|
const r = Q(o.group.id, !0);
|
|
1412
|
-
|
|
1421
|
+
X(o.group, r, {
|
|
1413
1422
|
isUserInteraction: !0
|
|
1414
1423
|
});
|
|
1415
1424
|
}), fe(e.currentTarget);
|
|
@@ -1448,7 +1457,7 @@ function Xe(e) {
|
|
|
1448
1457
|
}
|
|
1449
1458
|
function Ye(e) {
|
|
1450
1459
|
if (e.relatedTarget instanceof HTMLIFrameElement)
|
|
1451
|
-
switch (
|
|
1460
|
+
switch (q().state) {
|
|
1452
1461
|
case "hover":
|
|
1453
1462
|
W({
|
|
1454
1463
|
cursorFlags: 0,
|
|
@@ -1469,18 +1478,18 @@ function Je(e) {
|
|
|
1469
1478
|
function Qt(e) {
|
|
1470
1479
|
let t = 0, n = 0;
|
|
1471
1480
|
const o = {};
|
|
1472
|
-
for (const
|
|
1473
|
-
if (
|
|
1481
|
+
for (const i of e)
|
|
1482
|
+
if (i.defaultSize !== void 0) {
|
|
1474
1483
|
t++;
|
|
1475
|
-
const
|
|
1476
|
-
n +=
|
|
1484
|
+
const s = F(i.defaultSize);
|
|
1485
|
+
n += s, o[i.panelId] = s;
|
|
1477
1486
|
} else
|
|
1478
|
-
o[
|
|
1487
|
+
o[i.panelId] = void 0;
|
|
1479
1488
|
const r = e.length - t;
|
|
1480
1489
|
if (r !== 0) {
|
|
1481
|
-
const
|
|
1482
|
-
for (const
|
|
1483
|
-
|
|
1490
|
+
const i = F((100 - n) / r);
|
|
1491
|
+
for (const s of e)
|
|
1492
|
+
s.defaultSize === void 0 && (o[s.panelId] = i);
|
|
1484
1493
|
}
|
|
1485
1494
|
return o;
|
|
1486
1495
|
}
|
|
@@ -1506,9 +1515,9 @@ function tn(e, t, n) {
|
|
|
1506
1515
|
const r = e.panels.find((a) => a.element === t);
|
|
1507
1516
|
if (!r || !r.onResize)
|
|
1508
1517
|
return;
|
|
1509
|
-
const
|
|
1510
|
-
asPercentage:
|
|
1511
|
-
inPixels:
|
|
1518
|
+
const i = ae({ group: e }), s = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, u = r.mutableValues.prevSize, c = {
|
|
1519
|
+
asPercentage: F(s / i * 100),
|
|
1520
|
+
inPixels: s
|
|
1512
1521
|
};
|
|
1513
1522
|
r.mutableValues.prevSize = c, r.onResize(c, r.id, u);
|
|
1514
1523
|
}
|
|
@@ -1531,40 +1540,40 @@ function on({
|
|
|
1531
1540
|
}) {
|
|
1532
1541
|
if (n <= 0 || t <= 0 || n === t)
|
|
1533
1542
|
return o;
|
|
1534
|
-
let r = 0,
|
|
1543
|
+
let r = 0, i = 0, s = !1;
|
|
1535
1544
|
const u = /* @__PURE__ */ new Map(), c = [];
|
|
1536
1545
|
for (const f of e.panels) {
|
|
1537
1546
|
const y = o[f.id] ?? 0;
|
|
1538
1547
|
switch (f.panelConstraints.groupResizeBehavior) {
|
|
1539
1548
|
case "preserve-pixel-size": {
|
|
1540
|
-
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1549
|
+
s = !0;
|
|
1550
|
+
const p = y / 100 * n, g = F(
|
|
1551
|
+
p / t * 100
|
|
1543
1552
|
);
|
|
1544
|
-
u.set(f.id,
|
|
1553
|
+
u.set(f.id, g), r += g;
|
|
1545
1554
|
break;
|
|
1546
1555
|
}
|
|
1547
1556
|
case "preserve-relative-size":
|
|
1548
1557
|
default: {
|
|
1549
|
-
c.push(f.id),
|
|
1558
|
+
c.push(f.id), i += y;
|
|
1550
1559
|
break;
|
|
1551
1560
|
}
|
|
1552
1561
|
}
|
|
1553
1562
|
}
|
|
1554
|
-
if (!
|
|
1563
|
+
if (!s || c.length === 0)
|
|
1555
1564
|
return o;
|
|
1556
1565
|
const a = 100 - r, l = { ...o };
|
|
1557
1566
|
if (u.forEach((f, y) => {
|
|
1558
1567
|
l[y] = f;
|
|
1559
|
-
}),
|
|
1568
|
+
}), i > 0)
|
|
1560
1569
|
for (const f of c) {
|
|
1561
1570
|
const y = o[f] ?? 0;
|
|
1562
|
-
l[f] =
|
|
1563
|
-
y /
|
|
1571
|
+
l[f] = F(
|
|
1572
|
+
y / i * a
|
|
1564
1573
|
);
|
|
1565
1574
|
}
|
|
1566
1575
|
else {
|
|
1567
|
-
const f =
|
|
1576
|
+
const f = F(
|
|
1568
1577
|
a / c.length
|
|
1569
1578
|
);
|
|
1570
1579
|
for (const y of c)
|
|
@@ -1579,53 +1588,53 @@ function rn(e) {
|
|
|
1579
1588
|
e.element.ownerDocument.defaultView,
|
|
1580
1589
|
"Cannot register an unmounted Group"
|
|
1581
1590
|
);
|
|
1582
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(),
|
|
1583
|
-
for (const
|
|
1584
|
-
const { borderBoxSize:
|
|
1591
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = new n((p) => {
|
|
1592
|
+
for (const g of p) {
|
|
1593
|
+
const { borderBoxSize: d, target: v } = g;
|
|
1585
1594
|
if (v === e.element) {
|
|
1586
1595
|
if (t) {
|
|
1587
|
-
const
|
|
1588
|
-
if (
|
|
1596
|
+
const h = ae({ group: e });
|
|
1597
|
+
if (h === 0)
|
|
1589
1598
|
return;
|
|
1590
|
-
const
|
|
1591
|
-
if (!
|
|
1599
|
+
const m = Q(e.id);
|
|
1600
|
+
if (!m)
|
|
1592
1601
|
return;
|
|
1593
|
-
const x = Le(e),
|
|
1602
|
+
const x = Le(e), S = m.defaultLayoutDeferred ? Ze({
|
|
1594
1603
|
group: e,
|
|
1595
1604
|
panelConstraints: x
|
|
1596
|
-
}) :
|
|
1605
|
+
}) : m.layout, P = on({
|
|
1597
1606
|
group: e,
|
|
1598
|
-
nextGroupSize:
|
|
1599
|
-
prevGroupSize:
|
|
1600
|
-
prevLayout:
|
|
1601
|
-
}),
|
|
1602
|
-
layout:
|
|
1607
|
+
nextGroupSize: h,
|
|
1608
|
+
prevGroupSize: m.groupSize,
|
|
1609
|
+
prevLayout: S
|
|
1610
|
+
}), C = ne({
|
|
1611
|
+
layout: P,
|
|
1603
1612
|
panelConstraints: x
|
|
1604
1613
|
});
|
|
1605
|
-
if (!
|
|
1606
|
-
|
|
1614
|
+
if (!m.defaultLayoutDeferred && K(m.layout, C) && nn(
|
|
1615
|
+
m.derivedPanelConstraints,
|
|
1607
1616
|
x
|
|
1608
|
-
) &&
|
|
1617
|
+
) && m.groupSize === h)
|
|
1609
1618
|
continue;
|
|
1610
|
-
|
|
1619
|
+
X(e, {
|
|
1611
1620
|
defaultLayoutDeferred: !1,
|
|
1612
1621
|
derivedPanelConstraints: x,
|
|
1613
|
-
groupSize:
|
|
1614
|
-
layout:
|
|
1615
|
-
separatorToPanels:
|
|
1622
|
+
groupSize: h,
|
|
1623
|
+
layout: C,
|
|
1624
|
+
separatorToPanels: m.separatorToPanels
|
|
1616
1625
|
});
|
|
1617
1626
|
}
|
|
1618
1627
|
} else
|
|
1619
|
-
tn(e, v,
|
|
1628
|
+
tn(e, v, d);
|
|
1620
1629
|
}
|
|
1621
1630
|
});
|
|
1622
|
-
|
|
1631
|
+
i.observe(e.element), e.panels.forEach((p) => {
|
|
1623
1632
|
L(
|
|
1624
|
-
!o.has(
|
|
1625
|
-
`Panel ids must be unique; id "${
|
|
1626
|
-
), o.add(
|
|
1633
|
+
!o.has(p.id),
|
|
1634
|
+
`Panel ids must be unique; id "${p.id}" was used more than once`
|
|
1635
|
+
), o.add(p.id), p.onResize && i.observe(p.element);
|
|
1627
1636
|
});
|
|
1628
|
-
const
|
|
1637
|
+
const s = ae({ group: e }), u = Le(e), c = Ze({
|
|
1629
1638
|
group: e,
|
|
1630
1639
|
panelConstraints: u
|
|
1631
1640
|
}), a = ne({
|
|
@@ -1637,51 +1646,51 @@ function rn(e) {
|
|
|
1637
1646
|
(re.get(l) ?? 0) + 1
|
|
1638
1647
|
);
|
|
1639
1648
|
const f = /* @__PURE__ */ new Map();
|
|
1640
|
-
return Me({ group: e, includeDisabled: !0 }).forEach((
|
|
1641
|
-
|
|
1642
|
-
}),
|
|
1643
|
-
defaultLayoutDeferred:
|
|
1649
|
+
return Me({ group: e, includeDisabled: !0 }).forEach((p) => {
|
|
1650
|
+
p.separator && f.set(p.separator, p.panels);
|
|
1651
|
+
}), X(e, {
|
|
1652
|
+
defaultLayoutDeferred: s === 0,
|
|
1644
1653
|
derivedPanelConstraints: u,
|
|
1645
|
-
groupSize:
|
|
1654
|
+
groupSize: s,
|
|
1646
1655
|
layout: a,
|
|
1647
1656
|
separatorToPanels: f
|
|
1648
|
-
}), e.separators.forEach((
|
|
1657
|
+
}), e.separators.forEach((p) => {
|
|
1649
1658
|
L(
|
|
1650
|
-
!r.has(
|
|
1651
|
-
`Separator ids must be unique; id "${
|
|
1652
|
-
), r.add(
|
|
1653
|
-
}), re.get(l) === 1 && (l.addEventListener("contextmenu", He, !0), l.addEventListener("dblclick",
|
|
1659
|
+
!r.has(p.id),
|
|
1660
|
+
`Separator ids must be unique; id "${p.id}" was used more than once`
|
|
1661
|
+
), r.add(p.id), p.element.addEventListener("keydown", We);
|
|
1662
|
+
}), re.get(l) === 1 && (l.addEventListener("contextmenu", He, !0), l.addEventListener("dblclick", Be, !0), l.addEventListener("pointerdown", Ke, !0), l.addEventListener("pointerleave", Xe), l.addEventListener("pointermove", qe), l.addEventListener("pointerout", Ye), l.addEventListener("pointerup", Je, !0)), function() {
|
|
1654
1663
|
t = !1, re.set(
|
|
1655
1664
|
l,
|
|
1656
1665
|
Math.max(0, (re.get(l) ?? 0) - 1)
|
|
1657
|
-
), Vt(e),
|
|
1658
|
-
|
|
1666
|
+
), Vt(e), Nt(e) && fe(l), e.separators.forEach((g) => {
|
|
1667
|
+
g.element.removeEventListener("keydown", We);
|
|
1659
1668
|
}), re.get(l) || (l.removeEventListener(
|
|
1660
1669
|
"contextmenu",
|
|
1661
1670
|
He,
|
|
1662
1671
|
!0
|
|
1663
1672
|
), l.removeEventListener(
|
|
1664
1673
|
"dblclick",
|
|
1665
|
-
|
|
1674
|
+
Be,
|
|
1666
1675
|
!0
|
|
1667
1676
|
), l.removeEventListener(
|
|
1668
1677
|
"pointerdown",
|
|
1669
1678
|
Ke,
|
|
1670
1679
|
!0
|
|
1671
|
-
), l.removeEventListener("pointerleave",
|
|
1680
|
+
), l.removeEventListener("pointerleave", Xe), l.removeEventListener("pointermove", qe), l.removeEventListener("pointerout", Ye), l.removeEventListener("pointerup", Je, !0)), i.disconnect();
|
|
1672
1681
|
};
|
|
1673
1682
|
}
|
|
1674
1683
|
function sn() {
|
|
1675
1684
|
const [e, t] = Z({}), n = ce(() => t({}), []);
|
|
1676
1685
|
return [e, n];
|
|
1677
1686
|
}
|
|
1678
|
-
function
|
|
1687
|
+
function Oe(e) {
|
|
1679
1688
|
const t = Pt();
|
|
1680
1689
|
return `${e ?? t}`;
|
|
1681
1690
|
}
|
|
1682
1691
|
const V = typeof window < "u" ? Qe : Se;
|
|
1683
1692
|
function ue(e) {
|
|
1684
|
-
const t =
|
|
1693
|
+
const t = D(e);
|
|
1685
1694
|
return V(() => {
|
|
1686
1695
|
t.current = e;
|
|
1687
1696
|
}, [e]), ce(
|
|
@@ -1689,7 +1698,7 @@ function ue(e) {
|
|
|
1689
1698
|
[t]
|
|
1690
1699
|
);
|
|
1691
1700
|
}
|
|
1692
|
-
function
|
|
1701
|
+
function Te(...e) {
|
|
1693
1702
|
return ue((t) => {
|
|
1694
1703
|
e.forEach((n) => {
|
|
1695
1704
|
if (n)
|
|
@@ -1706,8 +1715,8 @@ function De(...e) {
|
|
|
1706
1715
|
});
|
|
1707
1716
|
});
|
|
1708
1717
|
}
|
|
1709
|
-
function
|
|
1710
|
-
const t =
|
|
1718
|
+
function De(e) {
|
|
1719
|
+
const t = D({ ...e });
|
|
1711
1720
|
return V(() => {
|
|
1712
1721
|
for (const n in e)
|
|
1713
1722
|
t.current[n] = e[n];
|
|
@@ -1717,13 +1726,13 @@ const yt = Lt(null);
|
|
|
1717
1726
|
function an({
|
|
1718
1727
|
separator: e
|
|
1719
1728
|
}) {
|
|
1720
|
-
const { element: t } = e, n =
|
|
1729
|
+
const { element: t } = e, n = D(null);
|
|
1721
1730
|
return V(() => {
|
|
1722
|
-
const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")],
|
|
1731
|
+
const o = t.cloneNode(!0), r = [t, ...t.querySelectorAll("*")], i = [o, ...o.querySelectorAll("*")], s = t.ownerDocument.defaultView;
|
|
1723
1732
|
return r.forEach((u, c) => {
|
|
1724
|
-
const a =
|
|
1725
|
-
if (a instanceof
|
|
1726
|
-
const l =
|
|
1733
|
+
const a = i[c];
|
|
1734
|
+
if (a instanceof s.HTMLElement || a instanceof s.SVGElement) {
|
|
1735
|
+
const l = s.getComputedStyle(u);
|
|
1727
1736
|
for (let f = 0; f < l.length; f++) {
|
|
1728
1737
|
const y = l.item(f);
|
|
1729
1738
|
a.style.setProperty(
|
|
@@ -1741,7 +1750,7 @@ function an({
|
|
|
1741
1750
|
transform: "none",
|
|
1742
1751
|
width: "100%"
|
|
1743
1752
|
}), n.current.appendChild(o), () => o.remove();
|
|
1744
|
-
}, [t]), /* @__PURE__ */
|
|
1753
|
+
}, [t]), /* @__PURE__ */ B(
|
|
1745
1754
|
"div",
|
|
1746
1755
|
{
|
|
1747
1756
|
ref: n,
|
|
@@ -1762,7 +1771,7 @@ function be() {
|
|
|
1762
1771
|
), e;
|
|
1763
1772
|
}
|
|
1764
1773
|
function vt(e) {
|
|
1765
|
-
const { registerOverlay: t } = be(), n =
|
|
1774
|
+
const { registerOverlay: t } = be(), n = D(e);
|
|
1766
1775
|
gt(n.current, e) || (n.current = e);
|
|
1767
1776
|
const o = n.current;
|
|
1768
1777
|
return V(
|
|
@@ -1794,7 +1803,7 @@ function ln({
|
|
|
1794
1803
|
break;
|
|
1795
1804
|
}
|
|
1796
1805
|
}
|
|
1797
|
-
return /* @__PURE__ */
|
|
1806
|
+
return /* @__PURE__ */ B(
|
|
1798
1807
|
"div",
|
|
1799
1808
|
{
|
|
1800
1809
|
...o,
|
|
@@ -1812,16 +1821,16 @@ function cn({
|
|
|
1812
1821
|
overlay: e,
|
|
1813
1822
|
preview: t
|
|
1814
1823
|
}) {
|
|
1815
|
-
const { group: n, offset: o, rect: r, separator:
|
|
1816
|
-
let u =
|
|
1817
|
-
return Rt(u) && u.type === vt && (c = u.props, u = void 0), u == null && (c ? u = /* @__PURE__ */
|
|
1824
|
+
const { group: n, offset: o, rect: r, separator: i } = t, s = n.orientation === "horizontal";
|
|
1825
|
+
let u = i?.preview, c = e;
|
|
1826
|
+
return Rt(u) && u.type === vt && (c = u.props, u = void 0), u == null && (c ? u = /* @__PURE__ */ B(
|
|
1818
1827
|
ln,
|
|
1819
1828
|
{
|
|
1820
1829
|
...c,
|
|
1821
1830
|
active: t.active,
|
|
1822
1831
|
orientation: n.orientation
|
|
1823
1832
|
}
|
|
1824
|
-
) :
|
|
1833
|
+
) : i && (u = /* @__PURE__ */ B(an, { separator: i }))), /* @__PURE__ */ B(
|
|
1825
1834
|
"div",
|
|
1826
1835
|
{
|
|
1827
1836
|
"aria-hidden": "true",
|
|
@@ -1833,7 +1842,7 @@ function cn({
|
|
|
1833
1842
|
pointerEvents: "none",
|
|
1834
1843
|
position: "absolute",
|
|
1835
1844
|
top: r.top,
|
|
1836
|
-
transform:
|
|
1845
|
+
transform: s ? `translateX(${o}px)` : `translateY(${o}px)`,
|
|
1837
1846
|
width: r.width
|
|
1838
1847
|
},
|
|
1839
1848
|
children: u
|
|
@@ -1841,9 +1850,9 @@ function cn({
|
|
|
1841
1850
|
);
|
|
1842
1851
|
}
|
|
1843
1852
|
function un(e, t) {
|
|
1844
|
-
const n =
|
|
1853
|
+
const n = D({
|
|
1845
1854
|
getLayout: () => ({}),
|
|
1846
|
-
setLayout:
|
|
1855
|
+
setLayout: Gt
|
|
1847
1856
|
});
|
|
1848
1857
|
et(t, () => n.current, []), V(() => {
|
|
1849
1858
|
Object.assign(
|
|
@@ -1856,24 +1865,24 @@ function fn({
|
|
|
1856
1865
|
groupId: e,
|
|
1857
1866
|
resizePreviewMode: t
|
|
1858
1867
|
}) {
|
|
1859
|
-
const [n, o] = Z([]), r =
|
|
1868
|
+
const [n, o] = Z([]), r = D(n);
|
|
1860
1869
|
return V(() => {
|
|
1861
|
-
const
|
|
1870
|
+
const i = (u) => {
|
|
1862
1871
|
const c = ft(e), a = t === "separator" && u.state === "active" ? u.previews.filter(
|
|
1863
|
-
(f) => f.group === c && (f.active || !
|
|
1872
|
+
(f) => f.group === c && (f.active || !T(f.offset, 0))
|
|
1864
1873
|
) : [], l = r.current;
|
|
1865
1874
|
l.length === a.length && a.every(
|
|
1866
1875
|
(f, y) => f === l[y]
|
|
1867
1876
|
) || (r.current = a, o(a));
|
|
1868
1877
|
};
|
|
1869
1878
|
if (t !== "separator") {
|
|
1870
|
-
|
|
1879
|
+
i(q());
|
|
1871
1880
|
return;
|
|
1872
1881
|
}
|
|
1873
|
-
const
|
|
1874
|
-
({ next: u }) =>
|
|
1882
|
+
const s = ot(
|
|
1883
|
+
({ next: u }) => i(u)
|
|
1875
1884
|
);
|
|
1876
|
-
return
|
|
1885
|
+
return i(q()), s;
|
|
1877
1886
|
}, [e, t]), n;
|
|
1878
1887
|
}
|
|
1879
1888
|
function dn({
|
|
@@ -1882,8 +1891,8 @@ function dn({
|
|
|
1882
1891
|
defaultLayout: n,
|
|
1883
1892
|
disableCursor: o,
|
|
1884
1893
|
disabled: r,
|
|
1885
|
-
elementRef:
|
|
1886
|
-
groupRef:
|
|
1894
|
+
elementRef: i,
|
|
1895
|
+
groupRef: s,
|
|
1887
1896
|
id: u,
|
|
1888
1897
|
onLayoutChange: c,
|
|
1889
1898
|
onLayoutChanged: a,
|
|
@@ -1893,187 +1902,187 @@ function dn({
|
|
|
1893
1902
|
coarse: 20,
|
|
1894
1903
|
fine: 10
|
|
1895
1904
|
},
|
|
1896
|
-
style:
|
|
1897
|
-
...
|
|
1905
|
+
style: p,
|
|
1906
|
+
...g
|
|
1898
1907
|
}) {
|
|
1899
|
-
const
|
|
1908
|
+
const d = D({
|
|
1900
1909
|
onLayoutChange: {},
|
|
1901
1910
|
onLayoutChanged: {}
|
|
1902
|
-
}), v = ue((
|
|
1903
|
-
K(
|
|
1904
|
-
}),
|
|
1905
|
-
(
|
|
1906
|
-
K(
|
|
1911
|
+
}), v = ue((b) => {
|
|
1912
|
+
K(d.current.onLayoutChange, b) || (d.current.onLayoutChange = b, c?.(b));
|
|
1913
|
+
}), h = ue(
|
|
1914
|
+
(b, z) => {
|
|
1915
|
+
K(d.current.onLayoutChanged, b) || (d.current.onLayoutChanged = b, a?.(b, { isUserInteraction: z }));
|
|
1907
1916
|
}
|
|
1908
|
-
),
|
|
1909
|
-
groupId:
|
|
1917
|
+
), m = Oe(u), [x, S] = Z(), P = fn({
|
|
1918
|
+
groupId: m,
|
|
1910
1919
|
resizePreviewMode: f
|
|
1911
|
-
}),
|
|
1920
|
+
}), C = D(null), [E, w] = sn(), R = D({
|
|
1912
1921
|
lastExpandedPanelSizes: {},
|
|
1913
1922
|
layouts: {},
|
|
1914
1923
|
panels: [],
|
|
1915
1924
|
separators: []
|
|
1916
|
-
}),
|
|
1917
|
-
un(
|
|
1918
|
-
const
|
|
1919
|
-
(
|
|
1920
|
-
const
|
|
1921
|
-
if (
|
|
1925
|
+
}), N = Te(C, i);
|
|
1926
|
+
un(m, s);
|
|
1927
|
+
const O = ue(
|
|
1928
|
+
(b, z) => {
|
|
1929
|
+
const M = Q(b);
|
|
1930
|
+
if (M)
|
|
1922
1931
|
return {
|
|
1923
|
-
flexGrow:
|
|
1932
|
+
flexGrow: M.layout[z] ?? 1
|
|
1924
1933
|
};
|
|
1925
|
-
if (n?.[
|
|
1934
|
+
if (n?.[z])
|
|
1926
1935
|
return {
|
|
1927
|
-
flexGrow: n?.[
|
|
1936
|
+
flexGrow: n?.[z]
|
|
1928
1937
|
};
|
|
1929
1938
|
}
|
|
1930
|
-
),
|
|
1939
|
+
), I = De({
|
|
1931
1940
|
defaultLayout: n,
|
|
1932
1941
|
disableCursor: o,
|
|
1933
1942
|
resizeTargetMinimumSize: y
|
|
1934
|
-
}),
|
|
1943
|
+
}), G = Pe(
|
|
1935
1944
|
() => ({
|
|
1936
1945
|
get disableCursor() {
|
|
1937
|
-
return !!
|
|
1946
|
+
return !!I.disableCursor;
|
|
1938
1947
|
},
|
|
1939
|
-
getPanelStyles:
|
|
1940
|
-
id:
|
|
1948
|
+
getPanelStyles: O,
|
|
1949
|
+
id: m,
|
|
1941
1950
|
orientation: l,
|
|
1942
|
-
registerPanel: (
|
|
1943
|
-
const
|
|
1944
|
-
return
|
|
1945
|
-
...
|
|
1946
|
-
|
|
1951
|
+
registerPanel: (b) => {
|
|
1952
|
+
const z = R.current;
|
|
1953
|
+
return z.panels = Ce(l, [
|
|
1954
|
+
...z.panels,
|
|
1955
|
+
b
|
|
1947
1956
|
]), w(), () => {
|
|
1948
|
-
|
|
1949
|
-
(
|
|
1957
|
+
z.panels = z.panels.filter(
|
|
1958
|
+
(M) => M !== b
|
|
1950
1959
|
), w();
|
|
1951
1960
|
};
|
|
1952
1961
|
},
|
|
1953
|
-
registerOverlay: (
|
|
1954
|
-
|
|
1962
|
+
registerOverlay: (b) => (S(b), () => {
|
|
1963
|
+
S(void 0);
|
|
1955
1964
|
}),
|
|
1956
|
-
registerSeparator: (
|
|
1957
|
-
const
|
|
1958
|
-
return
|
|
1959
|
-
...
|
|
1960
|
-
|
|
1965
|
+
registerSeparator: (b) => {
|
|
1966
|
+
const z = R.current;
|
|
1967
|
+
return z.separators = Ce(l, [
|
|
1968
|
+
...z.separators,
|
|
1969
|
+
b
|
|
1961
1970
|
]), w(), () => {
|
|
1962
|
-
|
|
1963
|
-
(
|
|
1971
|
+
z.separators = z.separators.filter(
|
|
1972
|
+
(M) => M !== b
|
|
1964
1973
|
), w();
|
|
1965
1974
|
};
|
|
1966
1975
|
},
|
|
1967
|
-
updatePanelProps: (
|
|
1968
|
-
const
|
|
1969
|
-
(oe) => oe.id ===
|
|
1976
|
+
updatePanelProps: (b, { disabled: z }) => {
|
|
1977
|
+
const A = R.current.panels.find(
|
|
1978
|
+
(oe) => oe.id === b
|
|
1970
1979
|
);
|
|
1971
|
-
|
|
1972
|
-
const $ = ft(
|
|
1973
|
-
$ && Y &&
|
|
1980
|
+
A && (A.panelConstraints.disabled = z);
|
|
1981
|
+
const $ = ft(m), Y = Q(m);
|
|
1982
|
+
$ && Y && X($, {
|
|
1974
1983
|
...Y,
|
|
1975
1984
|
derivedPanelConstraints: Le($)
|
|
1976
1985
|
});
|
|
1977
1986
|
},
|
|
1978
|
-
updateSeparatorProps: (
|
|
1979
|
-
disabled:
|
|
1980
|
-
disableDoubleClick:
|
|
1987
|
+
updateSeparatorProps: (b, {
|
|
1988
|
+
disabled: z,
|
|
1989
|
+
disableDoubleClick: M
|
|
1981
1990
|
}) => {
|
|
1982
|
-
const $ =
|
|
1983
|
-
(Y) => Y.id ===
|
|
1991
|
+
const $ = R.current.separators.find(
|
|
1992
|
+
(Y) => Y.id === b
|
|
1984
1993
|
);
|
|
1985
|
-
$ && ($.disabled =
|
|
1994
|
+
$ && ($.disabled = z, $.disableDoubleClick = M);
|
|
1986
1995
|
}
|
|
1987
1996
|
}),
|
|
1988
|
-
[
|
|
1989
|
-
), _ =
|
|
1997
|
+
[O, m, w, l, I]
|
|
1998
|
+
), _ = D(null);
|
|
1990
1999
|
return V(() => {
|
|
1991
|
-
const
|
|
1992
|
-
if (
|
|
2000
|
+
const b = C.current;
|
|
2001
|
+
if (b === null)
|
|
1993
2002
|
return;
|
|
1994
|
-
const
|
|
1995
|
-
let
|
|
1996
|
-
if (
|
|
1997
|
-
|
|
1998
|
-
for (const J of
|
|
1999
|
-
const pe =
|
|
2000
|
-
pe !== void 0 && (
|
|
2003
|
+
const z = R.current;
|
|
2004
|
+
let M;
|
|
2005
|
+
if (I.defaultLayout !== void 0 && Object.keys(I.defaultLayout).length === z.panels.length) {
|
|
2006
|
+
M = {};
|
|
2007
|
+
for (const J of z.panels) {
|
|
2008
|
+
const pe = I.defaultLayout[J.id];
|
|
2009
|
+
pe !== void 0 && (M[J.id] = pe);
|
|
2001
2010
|
}
|
|
2002
2011
|
}
|
|
2003
|
-
const
|
|
2012
|
+
const A = {
|
|
2004
2013
|
disabled: !!r,
|
|
2005
|
-
element:
|
|
2006
|
-
id:
|
|
2014
|
+
element: b,
|
|
2015
|
+
id: m,
|
|
2007
2016
|
mutableState: {
|
|
2008
|
-
defaultLayout:
|
|
2009
|
-
disableCursor: !!
|
|
2010
|
-
expandedPanelSizes:
|
|
2011
|
-
layouts:
|
|
2017
|
+
defaultLayout: M,
|
|
2018
|
+
disableCursor: !!I.disableCursor,
|
|
2019
|
+
expandedPanelSizes: R.current.lastExpandedPanelSizes,
|
|
2020
|
+
layouts: R.current.layouts
|
|
2012
2021
|
},
|
|
2013
2022
|
orientation: l,
|
|
2014
|
-
panels:
|
|
2023
|
+
panels: z.panels,
|
|
2015
2024
|
resizePreviewMode: f,
|
|
2016
2025
|
get resizeTargetMinimumSize() {
|
|
2017
|
-
return
|
|
2026
|
+
return I.resizeTargetMinimumSize;
|
|
2018
2027
|
},
|
|
2019
|
-
separators:
|
|
2028
|
+
separators: z.separators
|
|
2020
2029
|
};
|
|
2021
|
-
_.current =
|
|
2022
|
-
const $ = rn(
|
|
2023
|
-
!Y && oe.length > 0 && (v(le),
|
|
2024
|
-
const xe = Ee(
|
|
2025
|
-
const { defaultLayoutDeferred: pe, derivedPanelConstraints:
|
|
2026
|
-
if (pe ||
|
|
2030
|
+
_.current = A;
|
|
2031
|
+
const $ = rn(A), { defaultLayoutDeferred: Y, derivedPanelConstraints: oe, layout: le } = Q(A.id, !0);
|
|
2032
|
+
!Y && oe.length > 0 && (v(le), h(le, !1));
|
|
2033
|
+
const xe = Ee(m, (J) => {
|
|
2034
|
+
const { defaultLayoutDeferred: pe, derivedPanelConstraints: Ne, layout: he } = J.next;
|
|
2035
|
+
if (pe || Ne.length === 0)
|
|
2027
2036
|
return;
|
|
2028
|
-
const St =
|
|
2029
|
-
|
|
2037
|
+
const St = A.panels.map(({ id: H }) => H).join(",");
|
|
2038
|
+
A.mutableState.layouts[St] = he, Ne.forEach((H) => {
|
|
2030
2039
|
if (H.collapsible) {
|
|
2031
2040
|
const { layout: ze } = J.prev ?? {};
|
|
2032
2041
|
if (ze) {
|
|
2033
|
-
const xt =
|
|
2042
|
+
const xt = T(
|
|
2034
2043
|
H.collapsedSize,
|
|
2035
2044
|
he[H.panelId]
|
|
2036
|
-
), zt =
|
|
2045
|
+
), zt = T(
|
|
2037
2046
|
H.collapsedSize,
|
|
2038
2047
|
ze[H.panelId]
|
|
2039
2048
|
);
|
|
2040
|
-
xt && !zt && (
|
|
2049
|
+
xt && !zt && (A.mutableState.expandedPanelSizes[H.panelId] = ze[H.panelId]);
|
|
2041
2050
|
}
|
|
2042
2051
|
}
|
|
2043
2052
|
});
|
|
2044
|
-
const
|
|
2045
|
-
v(he), bt &&
|
|
2053
|
+
const Ge = q(), bt = Ge.state !== "active" || !Ge.hitRegions.some((H) => H.group === A);
|
|
2054
|
+
v(he), bt && h(he, J.isUserInteraction);
|
|
2046
2055
|
});
|
|
2047
2056
|
return () => {
|
|
2048
2057
|
_.current = null, $(), xe();
|
|
2049
2058
|
};
|
|
2050
2059
|
}, [
|
|
2051
2060
|
r,
|
|
2052
|
-
g,
|
|
2053
2061
|
m,
|
|
2062
|
+
h,
|
|
2054
2063
|
v,
|
|
2055
2064
|
l,
|
|
2056
|
-
|
|
2065
|
+
E,
|
|
2057
2066
|
f,
|
|
2058
|
-
|
|
2067
|
+
I
|
|
2059
2068
|
]), Se(() => {
|
|
2060
|
-
const
|
|
2061
|
-
|
|
2062
|
-
}), /* @__PURE__ */
|
|
2069
|
+
const b = _.current;
|
|
2070
|
+
b && (b.mutableState.defaultLayout = n, b.mutableState.disableCursor = !!o);
|
|
2071
|
+
}), /* @__PURE__ */ B(yt.Provider, { value: G, children: /* @__PURE__ */ wt(
|
|
2063
2072
|
"div",
|
|
2064
2073
|
{
|
|
2065
|
-
...
|
|
2074
|
+
...g,
|
|
2066
2075
|
className: t,
|
|
2067
2076
|
"data-group": !0,
|
|
2068
|
-
"data-testid":
|
|
2069
|
-
id:
|
|
2070
|
-
ref:
|
|
2077
|
+
"data-testid": m,
|
|
2078
|
+
id: m,
|
|
2079
|
+
ref: N,
|
|
2071
2080
|
style: {
|
|
2072
2081
|
height: "100%",
|
|
2073
2082
|
width: "100%",
|
|
2074
2083
|
overflow: "hidden",
|
|
2075
2084
|
position: f === "separator" ? "relative" : void 0,
|
|
2076
|
-
...
|
|
2085
|
+
...p,
|
|
2077
2086
|
display: "flex",
|
|
2078
2087
|
flexDirection: l === "horizontal" ? "row" : "column",
|
|
2079
2088
|
flexWrap: "nowrap",
|
|
@@ -2085,13 +2094,13 @@ function dn({
|
|
|
2085
2094
|
},
|
|
2086
2095
|
children: [
|
|
2087
2096
|
e,
|
|
2088
|
-
|
|
2097
|
+
P.map((b) => /* @__PURE__ */ B(
|
|
2089
2098
|
cn,
|
|
2090
2099
|
{
|
|
2091
2100
|
overlay: x,
|
|
2092
|
-
preview:
|
|
2101
|
+
preview: b
|
|
2093
2102
|
},
|
|
2094
|
-
|
|
2103
|
+
b.key
|
|
2095
2104
|
))
|
|
2096
2105
|
]
|
|
2097
2106
|
}
|
|
@@ -2109,9 +2118,9 @@ function pn({
|
|
|
2109
2118
|
const o = ve(e, []), r = n.getItem(o);
|
|
2110
2119
|
if (r)
|
|
2111
2120
|
try {
|
|
2112
|
-
const
|
|
2121
|
+
const i = JSON.parse(r);
|
|
2113
2122
|
if (t) {
|
|
2114
|
-
const
|
|
2123
|
+
const s = t.join(","), u = i[s];
|
|
2115
2124
|
if (u && Array.isArray(u.layout) && t.length === u.layout.length) {
|
|
2116
2125
|
const c = {};
|
|
2117
2126
|
for (let a = 0; a < t.length; a++)
|
|
@@ -2119,11 +2128,11 @@ function pn({
|
|
|
2119
2128
|
return c;
|
|
2120
2129
|
}
|
|
2121
2130
|
} else {
|
|
2122
|
-
const
|
|
2123
|
-
if (
|
|
2124
|
-
const u = s[
|
|
2131
|
+
const s = Object.keys(i);
|
|
2132
|
+
if (s.length === 1) {
|
|
2133
|
+
const u = i[s[0]];
|
|
2125
2134
|
if (u && Array.isArray(u.layout)) {
|
|
2126
|
-
const c =
|
|
2135
|
+
const c = s[0].split(",");
|
|
2127
2136
|
if (c.length === u.layout.length) {
|
|
2128
2137
|
const a = {};
|
|
2129
2138
|
for (let l = 0; l < c.length; l++)
|
|
@@ -2143,62 +2152,62 @@ function zn({
|
|
|
2143
2152
|
storage: o = localStorage,
|
|
2144
2153
|
...r
|
|
2145
2154
|
}) {
|
|
2146
|
-
const
|
|
2155
|
+
const i = n !== void 0, s = "id" in r ? r.id : r.groupId, u = ve(s, n ?? []), c = tt(
|
|
2147
2156
|
hn,
|
|
2148
2157
|
() => o.getItem(u),
|
|
2149
2158
|
() => o.getItem(u)
|
|
2150
2159
|
), a = Pe(() => {
|
|
2151
2160
|
if (c) {
|
|
2152
|
-
const v = JSON.parse(c),
|
|
2153
|
-
if (Array.from(
|
|
2161
|
+
const v = JSON.parse(c), h = Object.values(v);
|
|
2162
|
+
if (Array.from(h).every((m) => typeof m == "number"))
|
|
2154
2163
|
return v;
|
|
2155
2164
|
}
|
|
2156
2165
|
}, [c]), l = Pe(() => {
|
|
2157
2166
|
if (!a)
|
|
2158
2167
|
return pn({
|
|
2159
|
-
id:
|
|
2168
|
+
id: s,
|
|
2160
2169
|
panelIds: n,
|
|
2161
2170
|
storage: o
|
|
2162
2171
|
});
|
|
2163
|
-
}, [a,
|
|
2172
|
+
}, [a, s, n, o]), f = a ?? l, y = D(null), p = ce(() => {
|
|
2164
2173
|
const v = y.current;
|
|
2165
2174
|
v && (y.current = null, clearTimeout(v));
|
|
2166
2175
|
}, []);
|
|
2167
2176
|
Qe(() => () => {
|
|
2168
|
-
|
|
2169
|
-
}, [
|
|
2170
|
-
const
|
|
2177
|
+
p();
|
|
2178
|
+
}, [p]);
|
|
2179
|
+
const g = ce(
|
|
2171
2180
|
// The hook persists every layout commit -- including library-driven ones --
|
|
2172
2181
|
// because it owns its own storage and the goal is to remember whatever
|
|
2173
2182
|
// layout the user is currently looking at. Consumers that only want to
|
|
2174
2183
|
// persist on user interaction should branch on `isUserInteraction` in
|
|
2175
2184
|
// their own callback (see #716) rather than via this hook.
|
|
2176
|
-
(v,
|
|
2177
|
-
if (t && !
|
|
2185
|
+
(v, h) => {
|
|
2186
|
+
if (t && !h.isUserInteraction)
|
|
2178
2187
|
return;
|
|
2179
|
-
|
|
2180
|
-
let
|
|
2181
|
-
|
|
2188
|
+
p();
|
|
2189
|
+
let m;
|
|
2190
|
+
i ? m = ve(s, Object.keys(v)) : m = ve(s, []);
|
|
2182
2191
|
try {
|
|
2183
|
-
o.setItem(
|
|
2192
|
+
o.setItem(m, JSON.stringify(v));
|
|
2184
2193
|
} catch (x) {
|
|
2185
2194
|
console.error(x);
|
|
2186
2195
|
}
|
|
2187
2196
|
},
|
|
2188
2197
|
[
|
|
2189
|
-
|
|
2190
|
-
s,
|
|
2198
|
+
p,
|
|
2191
2199
|
i,
|
|
2200
|
+
s,
|
|
2192
2201
|
t,
|
|
2193
2202
|
o
|
|
2194
2203
|
]
|
|
2195
|
-
),
|
|
2204
|
+
), d = ce(
|
|
2196
2205
|
(v) => {
|
|
2197
|
-
|
|
2198
|
-
|
|
2206
|
+
p(), e === 0 ? g(v, { isUserInteraction: !1 }) : y.current = setTimeout(() => {
|
|
2207
|
+
g(v, { isUserInteraction: !1 });
|
|
2199
2208
|
}, e);
|
|
2200
2209
|
},
|
|
2201
|
-
[
|
|
2210
|
+
[p, e, g]
|
|
2202
2211
|
);
|
|
2203
2212
|
return {
|
|
2204
2213
|
/**
|
|
@@ -2210,11 +2219,11 @@ function zn({
|
|
|
2210
2219
|
*
|
|
2211
2220
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
2212
2221
|
*/
|
|
2213
|
-
onLayoutChange:
|
|
2222
|
+
onLayoutChange: d,
|
|
2214
2223
|
/**
|
|
2215
2224
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
2216
2225
|
*/
|
|
2217
|
-
onLayoutChanged:
|
|
2226
|
+
onLayoutChanged: g
|
|
2218
2227
|
};
|
|
2219
2228
|
}
|
|
2220
2229
|
function hn() {
|
|
@@ -2225,10 +2234,10 @@ function wn() {
|
|
|
2225
2234
|
return Z(null);
|
|
2226
2235
|
}
|
|
2227
2236
|
function Pn() {
|
|
2228
|
-
return
|
|
2237
|
+
return D(null);
|
|
2229
2238
|
}
|
|
2230
2239
|
function mn(e, t) {
|
|
2231
|
-
const { id: n } = be(), o =
|
|
2240
|
+
const { id: n } = be(), o = D({
|
|
2232
2241
|
collapse: we,
|
|
2233
2242
|
expand: we,
|
|
2234
2243
|
getSize: () => ({
|
|
@@ -2251,96 +2260,96 @@ function gn({
|
|
|
2251
2260
|
collapsedSize: n = "0%",
|
|
2252
2261
|
collapsedThreshold: o,
|
|
2253
2262
|
collapsible: r = !1,
|
|
2254
|
-
defaultSize:
|
|
2255
|
-
disabled:
|
|
2263
|
+
defaultSize: i,
|
|
2264
|
+
disabled: s,
|
|
2256
2265
|
elementRef: u,
|
|
2257
2266
|
groupResizeBehavior: c = "preserve-relative-size",
|
|
2258
2267
|
id: a,
|
|
2259
2268
|
maxSize: l = "100%",
|
|
2260
2269
|
minSize: f = "0%",
|
|
2261
2270
|
onResize: y,
|
|
2262
|
-
panelRef:
|
|
2263
|
-
style:
|
|
2264
|
-
...
|
|
2271
|
+
panelRef: p,
|
|
2272
|
+
style: g,
|
|
2273
|
+
...d
|
|
2265
2274
|
}) {
|
|
2266
|
-
const v = !!a,
|
|
2267
|
-
disabled:
|
|
2268
|
-
}), x =
|
|
2269
|
-
getPanelStyles:
|
|
2270
|
-
id:
|
|
2271
|
-
orientation:
|
|
2275
|
+
const v = !!a, h = Oe(a), m = De({
|
|
2276
|
+
disabled: s
|
|
2277
|
+
}), x = D(null), S = Te(x, u), {
|
|
2278
|
+
getPanelStyles: P,
|
|
2279
|
+
id: C,
|
|
2280
|
+
orientation: E,
|
|
2272
2281
|
registerPanel: w,
|
|
2273
|
-
updatePanelProps:
|
|
2274
|
-
} = be(),
|
|
2275
|
-
(
|
|
2276
|
-
y?.(
|
|
2282
|
+
updatePanelProps: R
|
|
2283
|
+
} = be(), N = y !== null, O = ue(
|
|
2284
|
+
(b, z, M) => {
|
|
2285
|
+
y?.(b, a, M);
|
|
2277
2286
|
}
|
|
2278
2287
|
);
|
|
2279
2288
|
V(() => {
|
|
2280
|
-
const
|
|
2281
|
-
if (
|
|
2282
|
-
const
|
|
2283
|
-
element:
|
|
2284
|
-
id:
|
|
2289
|
+
const b = x.current;
|
|
2290
|
+
if (b !== null) {
|
|
2291
|
+
const z = {
|
|
2292
|
+
element: b,
|
|
2293
|
+
id: h,
|
|
2285
2294
|
idIsStable: v,
|
|
2286
2295
|
mutableValues: {
|
|
2287
2296
|
expandToSize: void 0,
|
|
2288
2297
|
prevSize: void 0
|
|
2289
2298
|
},
|
|
2290
|
-
onResize:
|
|
2299
|
+
onResize: N ? O : void 0,
|
|
2291
2300
|
panelConstraints: {
|
|
2292
2301
|
groupResizeBehavior: c,
|
|
2293
2302
|
collapsedSize: n,
|
|
2294
2303
|
collapsedThreshold: o,
|
|
2295
2304
|
collapsible: r,
|
|
2296
|
-
defaultSize:
|
|
2297
|
-
disabled:
|
|
2305
|
+
defaultSize: i,
|
|
2306
|
+
disabled: m.disabled,
|
|
2298
2307
|
maxSize: l,
|
|
2299
2308
|
minSize: f
|
|
2300
2309
|
}
|
|
2301
2310
|
};
|
|
2302
|
-
return w(
|
|
2311
|
+
return w(z);
|
|
2303
2312
|
}
|
|
2304
2313
|
}, [
|
|
2305
2314
|
c,
|
|
2306
2315
|
n,
|
|
2307
2316
|
o,
|
|
2308
2317
|
r,
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2318
|
+
i,
|
|
2319
|
+
N,
|
|
2320
|
+
h,
|
|
2312
2321
|
v,
|
|
2313
2322
|
l,
|
|
2314
2323
|
f,
|
|
2315
|
-
|
|
2324
|
+
O,
|
|
2316
2325
|
w,
|
|
2317
|
-
|
|
2326
|
+
m
|
|
2318
2327
|
]), Se(() => {
|
|
2319
|
-
|
|
2320
|
-
}, [
|
|
2321
|
-
const
|
|
2322
|
-
const
|
|
2323
|
-
if (
|
|
2324
|
-
return JSON.stringify(
|
|
2325
|
-
},
|
|
2326
|
-
(
|
|
2327
|
-
|
|
2328
|
-
|
|
2328
|
+
R(h, { disabled: s });
|
|
2329
|
+
}, [s, h, R]), mn(h, p);
|
|
2330
|
+
const I = () => {
|
|
2331
|
+
const b = P(C, h);
|
|
2332
|
+
if (b)
|
|
2333
|
+
return JSON.stringify(b);
|
|
2334
|
+
}, G = tt(
|
|
2335
|
+
(b) => Ee(C, b),
|
|
2336
|
+
I,
|
|
2337
|
+
I
|
|
2329
2338
|
);
|
|
2330
2339
|
let _;
|
|
2331
|
-
return
|
|
2340
|
+
return G ? _ = JSON.parse(G) : i !== void 0 ? _ = {
|
|
2332
2341
|
flexGrow: void 0,
|
|
2333
2342
|
flexShrink: void 0,
|
|
2334
|
-
flexBasis:
|
|
2335
|
-
} : _ = { flexGrow: 1 }, /* @__PURE__ */
|
|
2343
|
+
flexBasis: i
|
|
2344
|
+
} : _ = { flexGrow: 1 }, /* @__PURE__ */ B(
|
|
2336
2345
|
"div",
|
|
2337
2346
|
{
|
|
2338
|
-
...
|
|
2339
|
-
"data-disabled":
|
|
2347
|
+
...d,
|
|
2348
|
+
"data-disabled": s || void 0,
|
|
2340
2349
|
"data-panel": !0,
|
|
2341
|
-
"data-testid":
|
|
2342
|
-
id:
|
|
2343
|
-
ref:
|
|
2350
|
+
"data-testid": h,
|
|
2351
|
+
id: h,
|
|
2352
|
+
ref: S,
|
|
2344
2353
|
style: {
|
|
2345
2354
|
...yn,
|
|
2346
2355
|
display: "flex",
|
|
@@ -2349,7 +2358,7 @@ function gn({
|
|
|
2349
2358
|
overflow: "visible",
|
|
2350
2359
|
..._
|
|
2351
2360
|
},
|
|
2352
|
-
children: /* @__PURE__ */
|
|
2361
|
+
children: /* @__PURE__ */ B(
|
|
2353
2362
|
"div",
|
|
2354
2363
|
{
|
|
2355
2364
|
className: t,
|
|
@@ -2358,12 +2367,12 @@ function gn({
|
|
|
2358
2367
|
maxWidth: "100%",
|
|
2359
2368
|
flexGrow: 1,
|
|
2360
2369
|
overflow: "auto",
|
|
2361
|
-
...
|
|
2370
|
+
...g,
|
|
2362
2371
|
// Inform the browser that the library is handling touch events for this element
|
|
2363
2372
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
2364
2373
|
// NOTE This is not an inherited style
|
|
2365
2374
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
2366
|
-
touchAction:
|
|
2375
|
+
touchAction: E === "horizontal" ? "pan-y" : "pan-x"
|
|
2367
2376
|
},
|
|
2368
2377
|
children: e
|
|
2369
2378
|
}
|
|
@@ -2388,7 +2397,7 @@ function Ln() {
|
|
|
2388
2397
|
return Z(null);
|
|
2389
2398
|
}
|
|
2390
2399
|
function Cn() {
|
|
2391
|
-
return
|
|
2400
|
+
return D(null);
|
|
2392
2401
|
}
|
|
2393
2402
|
function vn({
|
|
2394
2403
|
layout: e,
|
|
@@ -2396,15 +2405,15 @@ function vn({
|
|
|
2396
2405
|
panelId: n,
|
|
2397
2406
|
panelIndex: o
|
|
2398
2407
|
}) {
|
|
2399
|
-
let r,
|
|
2400
|
-
const
|
|
2408
|
+
let r, i;
|
|
2409
|
+
const s = e[n], u = t.find(
|
|
2401
2410
|
(c) => c.panelId === n
|
|
2402
2411
|
);
|
|
2403
2412
|
if (u) {
|
|
2404
2413
|
const c = u.maxSize, a = u.collapsible ? u.collapsedSize : u.minSize, l = [o, o + 1];
|
|
2405
|
-
|
|
2414
|
+
i = ne({
|
|
2406
2415
|
layout: de({
|
|
2407
|
-
delta: a -
|
|
2416
|
+
delta: a - s,
|
|
2408
2417
|
initialLayout: e,
|
|
2409
2418
|
panelConstraints: t,
|
|
2410
2419
|
pivotIndices: l,
|
|
@@ -2413,7 +2422,7 @@ function vn({
|
|
|
2413
2422
|
panelConstraints: t
|
|
2414
2423
|
})[n], r = ne({
|
|
2415
2424
|
layout: de({
|
|
2416
|
-
delta: c -
|
|
2425
|
+
delta: c - s,
|
|
2417
2426
|
initialLayout: e,
|
|
2418
2427
|
panelConstraints: t,
|
|
2419
2428
|
pivotIndices: l,
|
|
@@ -2425,8 +2434,8 @@ function vn({
|
|
|
2425
2434
|
return {
|
|
2426
2435
|
valueControls: n,
|
|
2427
2436
|
valueMax: r,
|
|
2428
|
-
valueMin:
|
|
2429
|
-
valueNow:
|
|
2437
|
+
valueMin: i,
|
|
2438
|
+
valueNow: s
|
|
2430
2439
|
};
|
|
2431
2440
|
}
|
|
2432
2441
|
function Sn({
|
|
@@ -2435,32 +2444,32 @@ function Sn({
|
|
|
2435
2444
|
disabled: n,
|
|
2436
2445
|
disableDoubleClick: o,
|
|
2437
2446
|
elementRef: r,
|
|
2438
|
-
id:
|
|
2439
|
-
preview:
|
|
2447
|
+
id: i,
|
|
2448
|
+
preview: s,
|
|
2440
2449
|
style: u,
|
|
2441
2450
|
...c
|
|
2442
2451
|
}) {
|
|
2443
|
-
const a =
|
|
2452
|
+
const a = Oe(i), l = De({
|
|
2444
2453
|
disabled: n,
|
|
2445
2454
|
disableDoubleClick: o,
|
|
2446
2455
|
children: e,
|
|
2447
2456
|
className: t,
|
|
2448
|
-
preview:
|
|
2457
|
+
preview: s,
|
|
2449
2458
|
style: u
|
|
2450
|
-
}), [f, y] = Z({}), [
|
|
2451
|
-
disableCursor:
|
|
2452
|
-
id:
|
|
2453
|
-
orientation:
|
|
2454
|
-
registerSeparator:
|
|
2459
|
+
}), [f, y] = Z({}), [p, g] = Z("inactive"), [d, v] = Z(!1), h = D(null), m = D(null), x = Te(h, r), {
|
|
2460
|
+
disableCursor: S,
|
|
2461
|
+
id: P,
|
|
2462
|
+
orientation: C,
|
|
2463
|
+
registerSeparator: E,
|
|
2455
2464
|
updateSeparatorProps: w
|
|
2456
|
-
} = be(),
|
|
2465
|
+
} = be(), R = C === "horizontal" ? "vertical" : "horizontal";
|
|
2457
2466
|
V(() => {
|
|
2458
|
-
const
|
|
2459
|
-
if (
|
|
2460
|
-
const
|
|
2467
|
+
const I = h.current;
|
|
2468
|
+
if (I !== null) {
|
|
2469
|
+
const G = {
|
|
2461
2470
|
disabled: l.disabled,
|
|
2462
2471
|
disableDoubleClick: l.disableDoubleClick,
|
|
2463
|
-
element:
|
|
2472
|
+
element: I,
|
|
2464
2473
|
id: a,
|
|
2465
2474
|
get children() {
|
|
2466
2475
|
return l.children;
|
|
@@ -2475,27 +2484,27 @@ function Sn({
|
|
|
2475
2484
|
return l.style;
|
|
2476
2485
|
}
|
|
2477
2486
|
};
|
|
2478
|
-
|
|
2479
|
-
const _ =
|
|
2480
|
-
(
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
(
|
|
2484
|
-
) ?
|
|
2487
|
+
m.current = G;
|
|
2488
|
+
const _ = E(G), b = ot(
|
|
2489
|
+
(M) => {
|
|
2490
|
+
g(
|
|
2491
|
+
M.next.state !== "inactive" && M.next.hitRegions.some(
|
|
2492
|
+
(A) => A.separator === G
|
|
2493
|
+
) ? M.next.state : "inactive"
|
|
2485
2494
|
);
|
|
2486
2495
|
}
|
|
2487
|
-
),
|
|
2488
|
-
|
|
2489
|
-
(
|
|
2490
|
-
const { derivedPanelConstraints:
|
|
2496
|
+
), z = Ee(
|
|
2497
|
+
P,
|
|
2498
|
+
(M) => {
|
|
2499
|
+
const { derivedPanelConstraints: A, layout: $, separatorToPanels: Y } = M.next, oe = Y.get(G);
|
|
2491
2500
|
if (oe) {
|
|
2492
|
-
const le = oe[0], xe =
|
|
2501
|
+
const le = oe[0], xe = A.findIndex(
|
|
2493
2502
|
(J) => J.panelId === le.id
|
|
2494
2503
|
);
|
|
2495
2504
|
y(
|
|
2496
2505
|
vn({
|
|
2497
2506
|
layout: $,
|
|
2498
|
-
panelConstraints:
|
|
2507
|
+
panelConstraints: A,
|
|
2499
2508
|
panelId: le.id,
|
|
2500
2509
|
panelIndex: xe
|
|
2501
2510
|
})
|
|
@@ -2504,42 +2513,42 @@ function Sn({
|
|
|
2504
2513
|
}
|
|
2505
2514
|
);
|
|
2506
2515
|
return () => {
|
|
2507
|
-
|
|
2516
|
+
m.current = null, b(), z(), _();
|
|
2508
2517
|
};
|
|
2509
2518
|
}
|
|
2510
|
-
}, [
|
|
2511
|
-
const
|
|
2512
|
-
|
|
2513
|
-
}, [
|
|
2519
|
+
}, [P, a, E, l]), V(() => {
|
|
2520
|
+
const I = m.current;
|
|
2521
|
+
I && Dt(I);
|
|
2522
|
+
}, [s]), Se(() => {
|
|
2514
2523
|
w(a, { disabled: n, disableDoubleClick: o });
|
|
2515
2524
|
}, [n, o, a, w]);
|
|
2516
|
-
let
|
|
2517
|
-
n && !
|
|
2518
|
-
let
|
|
2525
|
+
let N;
|
|
2526
|
+
n && !S && (N = "not-allowed");
|
|
2527
|
+
let O;
|
|
2519
2528
|
if (n)
|
|
2520
|
-
|
|
2529
|
+
O = "disabled";
|
|
2521
2530
|
else
|
|
2522
|
-
switch (
|
|
2531
|
+
switch (p) {
|
|
2523
2532
|
case "active": {
|
|
2524
|
-
|
|
2533
|
+
O = "active";
|
|
2525
2534
|
break;
|
|
2526
2535
|
}
|
|
2527
2536
|
default:
|
|
2528
|
-
|
|
2537
|
+
d ? O = "focus" : O = p;
|
|
2529
2538
|
}
|
|
2530
|
-
return /* @__PURE__ */
|
|
2539
|
+
return /* @__PURE__ */ B(
|
|
2531
2540
|
"div",
|
|
2532
2541
|
{
|
|
2533
2542
|
...c,
|
|
2534
2543
|
"aria-controls": f.valueControls,
|
|
2535
2544
|
"aria-disabled": n || void 0,
|
|
2536
|
-
"aria-orientation":
|
|
2545
|
+
"aria-orientation": R,
|
|
2537
2546
|
"aria-valuemax": f.valueMax,
|
|
2538
2547
|
"aria-valuemin": f.valueMin,
|
|
2539
2548
|
"aria-valuenow": f.valueNow,
|
|
2540
2549
|
children: e,
|
|
2541
2550
|
className: t,
|
|
2542
|
-
"data-separator":
|
|
2551
|
+
"data-separator": O,
|
|
2543
2552
|
"data-testid": a,
|
|
2544
2553
|
id: a,
|
|
2545
2554
|
onBlur: () => v(!1),
|
|
@@ -2548,7 +2557,7 @@ function Sn({
|
|
|
2548
2557
|
role: "separator",
|
|
2549
2558
|
style: {
|
|
2550
2559
|
flexBasis: "auto",
|
|
2551
|
-
cursor:
|
|
2560
|
+
cursor: N,
|
|
2552
2561
|
...u,
|
|
2553
2562
|
flexGrow: 0,
|
|
2554
2563
|
flexShrink: 0,
|